Skip to content

Commit 63c3fe6

Browse files
committed
refactor: make itkdev-validate-standards project-type-aware
Address PR #29 review feedback: remove Symfony-centric assumptions and make the skill flexible for Symfony, Drupal, and generic project types. - Add project type classification (symfony-*/drupal-*/generic) after Step 0 - Support documented project exceptions via CLAUDE.md - Make worker service and dev profile services conditional in Step 1 - Restructure Taskfile checks into required/conditional/optional tiers - Rename Step 5 to "Framework-Specific Config" with per-type checks - Split GitHub Actions workflow list by project type - Update verification report template with documented exceptions
1 parent a7b94ee commit 63c3fe6

2 files changed

Lines changed: 108 additions & 43 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- `itkdev-statusline` extension with context window usage, git branch, and plan progress display
1313
- `itkdev-validate-standards` skill for auditing projects against itk-dev Docker and development conventions (`skills/itkdev-validate-standards/SKILL.md`)
14+
- Project-type detection (Symfony, Drupal, generic) with conditional checks per type
1415
- Automated comparison via `itkdev-docker` MCP tools (detect, compare, fetch template content)
15-
- 9-area validation checklist: Docker Compose, server compose, environment, Taskfile, Symfony/PHP config, Composer, GitHub Actions, and miscellaneous files
16+
- 9-area validation checklist: Docker Compose, server compose, environment, Taskfile, framework-specific config, Composer, GitHub Actions, and miscellaneous files
17+
- Conditional framework-specific checks (Symfony Twig/PHPStan paths, Drupal custom module paths)
18+
- Support for documented project exceptions via `CLAUDE.md` or memory files
1619
- Remediation tables for each validation area
1720
- Summary report generation
1821

skills/itkdev-validate-standards/SKILL.md

Lines changed: 104 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: |
66
"check itk-dev standards", (3) reviewing PR for convention compliance,
77
(4) setting up a new itk-dev project, (5) upgrading Docker configuration.
88
Walks through 9 validation areas: MCP tool comparison, docker-compose,
9-
server compose, environment, Taskfile, Symfony/PHP config, Composer,
9+
server compose, environment, Taskfile, framework-specific config, Composer,
1010
GitHub Actions, and miscellaneous files.
1111
author: Claude Code
1212
version: 1.0.0
@@ -20,14 +20,14 @@ itk-dev projects must follow conventions from the
2020
`itk-dev/devops_itkdev-docker` template repository. Manually checking
2121
compliance across Docker Compose files, Taskfile, GitHub Actions, PHP
2222
tooling, and environment configuration is error-prone. This skill
23-
provides a structured checklist to audit any Symfony project.
23+
provides a structured checklist to audit any itk-dev project.
2424

2525
## Context / Trigger Conditions
2626

2727
Use this skill when:
2828
- Auditing a project for itk-dev convention compliance
2929
- Reviewing a PR that changes Docker, Taskfile, or CI configuration
30-
- Setting up a new itk-dev Symfony project
30+
- Setting up a new itk-dev project
3131
- Upgrading from older itk-dev Docker conventions
3232
- User asks to "check itk-dev standards" or "validate Docker setup"
3333

@@ -71,6 +71,23 @@ file-level diffs against the canonical template.
7171
**Fallback:** If MCP tools are unavailable or the project is not detected,
7272
proceed with the manual checklist below.
7373

74+
#### Project Type Classification
75+
76+
Use the detected template name to classify the project:
77+
78+
| Detected Template | Project Type | Steps with Conditional Checks |
79+
|-------------------|-------------|-------------------------------|
80+
| `symfony-*` | Symfony | Steps 4, 5, 7 include Symfony-specific checks |
81+
| `drupal-*` | Drupal | Steps 4, 5, 7 include Drupal-specific checks |
82+
| Other / unknown | Generic | Steps 4, 5, 7 use minimal universal checks only |
83+
84+
#### Project Exceptions
85+
86+
Deviations from these standards that are documented in the project's `CLAUDE.md`
87+
or memory files should be treated as acknowledged exceptions, not failures.
88+
When a check fails but the deviation is documented, report it as
89+
**"Exception (documented)"** in the summary rather than a failure.
90+
7491
---
7592

7693
### Step 1 — Docker Compose (`docker-compose.yml`)
@@ -87,12 +104,17 @@ Validate the development Docker Compose file.
87104
- [ ] `phpfpm` uses `itkdev/php8.4-fpm:latest` (or appropriate PHP version)
88105
- [ ] `mariadb` uses `itkdev/mariadb:latest`
89106
- [ ] `nginx` uses `nginxinc/nginx-unprivileged:alpine`
90-
- [ ] `worker` uses `itkdev/supervisor-php8.4:alpine` (matching PHP version)
107+
- [ ] If `worker` service is present: uses `itkdev/supervisor-php8.4:alpine`
108+
(matching PHP version)
91109

92110
#### Service Names
93111

94-
- [ ] Services named: `phpfpm`, `mariadb`, `nginx`, `worker`
95-
(plus any project-specific services)
112+
Core services (required):
113+
- [ ] `phpfpm`, `mariadb`, `nginx`
114+
115+
Optional services (check if present):
116+
- [ ] `worker` — only required for projects using background job processing
117+
- [ ] Other project-specific services
96118

97119
#### Healthchecks
98120

@@ -101,7 +123,8 @@ Validate the development Docker Compose file.
101123
- [ ] `phpfpm` healthcheck tests TCP port 9000
102124
- [ ] `mariadb` healthcheck uses `healthcheck.sh --connect --innodb_initialized`
103125
- [ ] `nginx` depends_on phpfpm with `condition: service_healthy`
104-
- [ ] `worker` depends_on mariadb and phpfpm with `condition: service_healthy`
126+
- [ ] If `worker` service is present: depends_on mariadb and phpfpm with
127+
`condition: service_healthy`
105128

106129
#### Volumes
107130

@@ -118,6 +141,12 @@ Validate the development Docker Compose file.
118141

119142
- [ ] `node`, `markdownlint`, `prettier` services have `profiles: [dev]`
120143

144+
> **Note:** Dev profile services (`node`, `markdownlint`, `prettier`) are
145+
> typically defined in `docker-compose.override.yml` for local customization.
146+
> If they only appear in the override file, the check passes automatically.
147+
> `docker-compose.override.yml` is used for local development customization
148+
> and is not subject to the same strict validation.
149+
121150
#### Remediation
122151

123152
| Check | Fix |
@@ -195,81 +224,104 @@ Validate task runner configuration.
195224
- [ ] `DOCKER_COMPOSE` defined (supports override via `CONTAINER_COMPOSE`)
196225
- [ ] `PHP` defined as `{{.DOCKER_COMPOSE}} exec phpfpm`
197226
- [ ] `COMPOSER` defined as `{{.PHP}} composer`
198-
- [ ] `CONSOLE` defined as `{{.PHP}} bin/console`
199-
- [ ] `NODE` defined as `{{.DOCKER_COMPOSE}} run --rm node`
200227

201-
#### Required Tasks
228+
Conditional variables:
229+
- [ ] If Symfony: `CONSOLE` defined as `{{.PHP}} bin/console`
230+
- [ ] If Drupal: `DRUSH` defined as `{{.PHP}} vendor/bin/drush`
231+
- [ ] If project uses Node: `NODE` defined as `{{.DOCKER_COMPOSE}} run --rm node`
232+
233+
#### Required Tasks (all project types)
202234

203-
- [ ] `setup` — first-time project setup (calls up, install, build, migrate)
204-
- [ ] `up` — start containers and run migrations
235+
- [ ] `compose`/`up` — start containers
205236
- [ ] `down` — stop containers (`{{.DOCKER_COMPOSE}} down`)
237+
- [ ] A dependency install task (e.g., `install`, `composer:install`)
238+
239+
#### Symfony-Specific Tasks (if detected as Symfony)
240+
241+
- [ ] `lint:twig` — Twig CS Fixer lint
242+
- [ ] `lint:twig:fix` — Twig CS Fixer fix
243+
- [ ] `analyze` — PHPStan analyse
244+
245+
#### Drupal-Specific Tasks (if detected as Drupal)
246+
247+
- [ ] `drush` — Run Drush commands
248+
- [ ] Config import/export tasks
249+
250+
#### Optional / Recommended Tasks
251+
252+
The following tasks are recommended but not strictly required. Their absence
253+
should be noted as suggestions, not failures:
254+
255+
- [ ] `setup` — first-time project setup
206256
- [ ] `restart` — calls down then up
207-
- [ ] `install` — install all dependencies (composer + assets)
208257
- [ ] `ci` — run all CI checks
209258
- [ ] `lint` — run all linters (calls subtasks)
210259
- [ ] `lint:php` — PHP CS Fixer dry-run
211260
- [ ] `lint:php:fix` — PHP CS Fixer fix
212-
- [ ] `lint:twig` — Twig CS Fixer lint
213-
- [ ] `lint:twig:fix` — Twig CS Fixer fix
214261
- [ ] `lint:composer` — composer validate + normalize dry-run
215262
- [ ] `lint:markdown` — markdown lint via container
216263
- [ ] `lint:styles` — Prettier check on CSS/SCSS
217-
- [ ] `analyze` — PHPStan analyse
218264
- [ ] `test` — PHPUnit all tests
219265

220-
#### CI Task Order
221-
222-
- [ ] `ci` runs in order: `assets:build` -> `lint` -> `analyze` -> `test`
223-
224-
#### Internal Tasks
225-
226-
- [ ] `db:migrate` is `internal: true`
227-
- [ ] `network:frontend` check task exists and is `internal: true`
228-
- [ ] `up` is split: `up:start` (infrastructure) + `up:worker` (worker container)
229-
230266
#### Remediation
231267

232268
| Check | Fix |
233269
|-------|-----|
234270
| Missing dotenv | Add `dotenv: [".env.local", ".env"]` |
235271
| Wrong var names | Rename to match standard: `DOCKER_COMPOSE`, `PHP`, etc. |
236-
| Missing task | Add task following the patterns in the template |
237-
| `db:migrate` not internal | Add `internal: true` to prevent direct invocation |
238-
| CI order wrong | Reorder cmds: assets:build, lint, analyze, test |
272+
| Missing required task | Add task following the patterns in the template |
239273

240274
---
241275

242-
### Step 5 — Symfony/PHP Config
276+
### Step 5 — Framework-Specific Config
277+
278+
Validate PHP tooling configuration. Checks are conditional on project type.
279+
For project types other than Symfony or Drupal, skip this step and report
280+
as "N/A" in the summary.
243281

244-
Validate PHP tooling configuration.
282+
#### For Symfony Projects
245283

246-
#### PHP CS Fixer (`.php-cs-fixer.dist.php`)
284+
**PHP CS Fixer (`.php-cs-fixer.dist.php`)**
247285

248286
- [ ] File exists at project root
249287
- [ ] Rules include `@Symfony` and `@PHP84Migration`
250288
(PHP migration rule matches project PHP version)
251289
- [ ] Finder uses `ignoreVCSIgnored(true)`
252290
- [ ] Header comment references `itk-dev/devops_itkdev-docker` origin
253291

254-
#### PHPStan (`phpstan.dist.neon`)
292+
**PHPStan (`phpstan.dist.neon`)**
255293

256294
- [ ] File exists at project root
257295
- [ ] Level is 6 (or higher)
258296
- [ ] `paths` includes `src`
259297
- [ ] `excludePaths` includes `src/Kernel.php`
260298

261-
#### PHP Code Conventions
299+
**PHP Code Conventions**
262300

263301
- [ ] All PHP files have `declare(strict_types=1)`
264302
- [ ] Classes use `final class` pattern (where appropriate)
265303

304+
#### For Drupal Projects
305+
306+
**PHP CS Fixer (`.php-cs-fixer.dist.php`)**
307+
308+
- [ ] File exists at project root
309+
- [ ] Finder targets `web/modules/custom` and `web/themes/custom`
310+
- [ ] Finder uses `ignoreVCSIgnored(true)`
311+
312+
**PHPStan (`phpstan.dist.neon`)**
313+
314+
- [ ] File exists at project root
315+
- [ ] Level is 6 (or higher)
316+
- [ ] `paths` includes `web/modules/custom` and/or `web/themes/custom`
317+
266318
#### Remediation
267319

268320
| Check | Fix |
269321
|-------|-----|
270-
| Missing `.php-cs-fixer.dist.php` | Copy from template, adjust finder excludes |
322+
| Missing `.php-cs-fixer.dist.php` | Copy from template, adjust finder for project type |
271323
| Wrong PHPStan level | Set `level: 6` in `phpstan.dist.neon` |
272-
| Missing `Kernel.php` exclude | Add to `excludePaths` in PHPStan config |
324+
| Wrong PHPStan paths | Adjust `paths` to match project type (`src` for Symfony, `web/modules/custom` for Drupal) |
273325

274326
---
275327

@@ -299,15 +351,20 @@ Validate CI workflow files.
299351

300352
#### Expected Workflow Files
301353

354+
Universal (all project types):
302355
- [ ] `.github/workflows/changelog.yaml`
303356
- [ ] `.github/workflows/composer.yaml`
304-
- [ ] `.github/workflows/javascript.yaml`
305357
- [ ] `.github/workflows/markdown.yaml`
306358
- [ ] `.github/workflows/php.yaml`
307-
- [ ] `.github/workflows/styles.yaml`
308-
- [ ] `.github/workflows/twig.yaml`
309359
- [ ] `.github/workflows/yaml.yaml`
310360

361+
Symfony additionally:
362+
- [ ] `.github/workflows/twig.yaml`
363+
364+
Projects with JS/CSS assets:
365+
- [ ] `.github/workflows/javascript.yaml`
366+
- [ ] `.github/workflows/styles.yaml`
367+
311368
#### Workflow Content Standards
312369

313370
- [ ] Each file starts with header comment:
@@ -372,7 +429,7 @@ Date: <current date>
372429
| Step 2: Server compose | / | 0 |
373430
| Step 3: Environment | / | 0 |
374431
| Step 4: Taskfile | / | 0 |
375-
| Step 5: Symfony/PHP | / | 0 |
432+
| Step 5: Framework Config | / | 0 |
376433
| Step 6: Composer | / | 0 |
377434
| Step 7: GitHub Actions | / | 0 |
378435
| Step 8: Miscellaneous | / | 0 |
@@ -381,9 +438,14 @@ Date: <current date>
381438
382439
(List any failing checks with remediation steps)
383440
441+
### Documented Exceptions
442+
443+
(List any checks that failed but have documented justification in CLAUDE.md
444+
or project memory files — these are acknowledged deviations, not failures)
445+
384446
### Summary
385447
386-
X/Y checks passed. [COMPLIANT | NEEDS FIXES]
448+
X/Y checks passed, Z documented exceptions. [COMPLIANT | NEEDS FIXES]
387449
```
388450

389451
## Common Issues
@@ -443,7 +505,7 @@ Date: 2026-02-26
443505
| Step 2: Server compose | PASS | 0 |
444506
| Step 3: Environment | PASS | 0 |
445507
| Step 4: Taskfile | PASS | 0 |
446-
| Step 5: Symfony/PHP | PASS | 0 |
508+
| Step 5: Framework Config | PASS | 0 |
447509
| Step 6: Composer | PASS | 0 |
448510
| Step 7: GitHub Actions | PASS | 0 |
449511
| Step 8: Miscellaneous | PASS | 0 |

0 commit comments

Comments
 (0)