Loading...
Loading...
Use before committing code - validates Drupal coding standards, SOLID/DRY principles, security practices, and CSS standards
npx skill4agent add camoa/claude-skills code-pattern-checker| Reference | Checks |
|---|---|
| SOLID principles |
| DRY patterns |
| Security practices (online) |
| CSS/JS/SDC standards (online) |
| Gate 1 requirements |
For security and frontend checks, WebFetch frominstead of reading bundled files.https://camoa.github.io/dev-guides/
/drupal-dev-framework:validatetask-completerreferences/quality-gates.mdWhich files should I check?
1. All changed files (git diff)
2. Specific file(s)
3. All files in a component
Your choice:Bashgit diff --name-onlyRead\Drupal::service()!important@extend# PHP CodeSniffer
ddev exec vendor/bin/phpcs --standard=Drupal,DrupalPractice {path}
# PHPStan (if configured)
ddev exec vendor/bin/phpstan analyze {path}
# SCSS Lint (if applicable)
npm run lint:scss## Code Check: {file or component}
### Status: PASS / ISSUES FOUND
### Standards Check
| Check | Status | Notes |
|-------|--------|-------|
| PSR-12 | PASS | - |
| Docblocks | ISSUE | Missing on processData() |
| Type hints | PASS | - |
### SOLID Principles
| Principle | Status |
|-----------|--------|
| Single Responsibility | PASS |
| Dependency Inversion | PASS |
### Security
| Check | Status | Notes |
|-------|--------|-------|
| SQL Injection | PASS | Uses query builder |
| XSS | PASS | Output escaped |
| Access Control | ISSUE | Missing on /admin/custom route |
### DRY Check
| Issue | Location |
|-------|----------|
| Duplicate logic | lines 45-52 and 78-85 |
### Issues to Fix (Priority Order)
1. **Security**: Add access check to admin route
2. **Standards**: Add docblock to processData()
3. **DRY**: Extract duplicate logic to private method
### Recommendation
- [ ] Fix security issue before merge
- [ ] Other issues: fix now or create follow-up task
Approved for commit: NO (fix security first) / YESIssue: Missing docblock on processData()
Suggested fix:
/**
* Process the input data and return results.
*
* @param array $data
* The input data array.
*
* @return array
* The processed results.
*/
Apply this fix? (yes/no/skip)