Skip to content

chore: add Claude Code project automation#468

Merged
turegjorup merged 1 commit into
release/3.0.0from
feature/claude-code-project-config
May 28, 2026
Merged

chore: add Claude Code project automation#468
turegjorup merged 1 commit into
release/3.0.0from
feature/claude-code-project-config

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Summary

Project-shared Claude Code configuration: reduces repeat instruction overhead, catches the project's most common failure modes earlier, and codifies the patterns from ADR 003 and ADR 010. No runtime/functional changes — only tooling that Claude Code sessions read.

  • Hooks (.claude/settings.json)
    • PostToolUse formatters/linters on edit: php-cs-fixer, phpstan, twig-cs-fixer, prettier, markdownlint, composer-normalize, env-coverage.
    • Stop hooks: lint:container, API-spec drift warning, slide-template pair check.
    • PreToolUse guards: block edits to generated/locked files (composer.lock, package-lock.json, public/api-spec-v2.*, assets/shared/redux/generated-api.ts, vendor/, node_modules/) and reject $this->addSql() in migrations (ADR 010).
  • Skills (.claude/skills/) — guided workflows for the project's high-friction multi-file changes:
    • add-api-resource — Entity → migration → DTO → Provider/Processor → voter → spec regen → RTK enhancement.
    • add-migration — Doctrine Schema tool API only, Types::* constants (ADR 010).
    • add-slide-template.jsx/.json pair, id()/config()/renderSlide()/slideDone() contract.
    • add-feed-typeFeedTypeInterface 7 methods, output-model mapping, error-cache contract.
  • Subagents (.claude/agents/) — focused reviewers cross-checking the corresponding skills:
    • api-resource-reviewer, migration-portability-reviewer, slide-template-reviewer, rtk-cache-invalidation-reviewer, feed-type-reviewer.
  • MCP / plugins (.mcp.json + enabledPlugins)
    • context7 — live Symfony / Doctrine / API Platform docs lookup.
    • php-lsp@claude-plugins-official (Intelephense) — go-to-definition, find-references, inline diagnostics across the Entity ↔ DTO ↔ Provider/Processor chain. Prerequisite: npm install -g intelephense.
    • playwright@claude-plugins-official — browser MCP for driving the admin / client during interactive debugging. npx-launched, no prerequisite.
  • CLAUDE.md — project conventions for future Claude Code sessions: Docker-only dev tooling, /v2/ API is BC-frozen (ADR 003), Schema-tool-only migrations (ADR 010), multi-tenancy, prerequisites.
  • .gitignoreanthropic/claude-code scoped block tracks .claude/{settings.json,agents,commands,skills}, keeps settings.local.json and other local state ignored. .playwright-mcp/ added to the Playwright block.

Test plan

  • task code-analysis passes (verifies no PHPStan noise from the existing rule set is introduced by the new files).
  • task coding-standards:check passes (markdownlint + prettier on the new docs/scripts).
  • In a fresh Claude Code session on this branch:
    • claude plugin list shows php-lsp@claude-plugins-official and playwright@claude-plugins-official as project-scope enabled.
    • claude mcp list shows context7 connected.
    • Editing a .php file triggers the php-cs-fixer + phpstan PostToolUse hooks.
    • Attempting to write $this->addSql(...) into a migrations/Version*.php is rejected by the PreToolUse hook.
    • Slash commands /add-api-resource, /add-migration, /add-slide-template, /add-feed-type are discoverable.
  • Teammate prerequisite (npm install -g intelephense) documented in CLAUDE.md "Claude Code prerequisites" section.

🤖 Generated with Claude Code

@turegjorup
turegjorup requested a review from tuj May 27, 2026 15:54
@turegjorup turegjorup self-assigned this May 27, 2026
Project-shared Claude Code configuration to reduce repeat instruction
overhead, catch the project's most common failure modes earlier, and
codify the patterns documented in ADR 010 and ADR 003.

- `.claude/settings.json` — hooks (php-cs-fixer / phpstan / prettier /
  markdownlint / env coverage on edit; lint:container on stop; API-spec
  drift + template-pair Stop hooks; PreToolUse guards blocking edits to
  generated and locked files and `$this->addSql()` in migrations).
- `.claude/skills/` — guided workflows for the project's high-friction
  multi-file changes (add-api-resource, add-migration, add-slide-template,
  add-feed-type). User-invocable only.
- `.claude/agents/` — focused reviewers (api-resource-reviewer,
  migration-portability-reviewer, slide-template-reviewer,
  rtk-cache-invalidation-reviewer, feed-type-reviewer).
- `.mcp.json` + settings — auto-enables the context7 MCP (live Symfony /
  Doctrine / API Platform docs), the php-lsp plugin (Intelephense), and
  the playwright plugin (browser MCP).
- `CLAUDE.md` — project conventions for future Claude Code sessions
  (Docker-only dev tooling, the /v2/ API is versioned and BC-frozen,
  Schema-tool-only migrations, multi-tenancy, prerequisites).
- `scripts/claude-hook-check-{api-spec-drift,template-pairs}.sh` —
  Stop-hook helpers.
- `.gitignore` — `anthropic/claude-code` block tracks
  `.claude/{settings.json,agents,commands,skills}` while keeping
  `settings.local.json` and other local state ignored. `.playwright-mcp/`
  added to the Playwright block.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@turegjorup
turegjorup force-pushed the feature/claude-code-project-config branch from fa15cba to ee8437a Compare May 27, 2026 17:40
@turegjorup
turegjorup merged commit ff15eac into release/3.0.0 May 28, 2026
20 checks passed
@turegjorup
turegjorup deleted the feature/claude-code-project-config branch May 28, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants