@bonesofspring/ai-rules 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/README.md +5 -1
- package/bin/cli.js +4 -0
- package/package.json +1 -1
- package/presets/_shared/README.md +1 -1
- package/presets/_shared/core/agent-team/agent-artifact-contracts.md +114 -0
- package/presets/_shared/core/agent-team/agent-task-metrics.md +30 -0
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +71 -4
- package/presets/_shared/core/meta/preset-layering.md +1 -1
- package/presets/_shared/core/meta/preset-no-cross-stack-leakage.md +5 -5
- package/presets/_shared/core/meta/preset-pr-checklist.md +1 -1
- package/presets/_shared/core/meta/preset-twin-sync.md +4 -0
- package/presets/_shared/core/review/technical-retro.md +2 -0
- package/presets/claude/go/agents/build-verifier.md +11 -4
- package/presets/claude/go/agents/code-reviewer.md +8 -1
- package/presets/claude/go/agents/feature-developer.md +8 -1
- package/presets/claude/go/agents/task-analyst.md +8 -1
- package/presets/claude/go/agents/task-router.md +35 -3
- package/presets/claude/go/commands/task-continue.md +17 -16
- package/presets/claude/go/commands/task.md +11 -5
- package/presets/claude/go/commands/technical-retro.md +4 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +411 -69
- package/presets/claude/go/rules/README.md +6 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +33 -4
- package/presets/claude/go/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/preset-no-cross-stack-leakage.md +5 -5
- package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +4 -0
- package/presets/claude/go/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/go/team/README.md +19 -0
- package/presets/claude/ios-swift/agents/build-verifier.md +11 -4
- package/presets/claude/ios-swift/agents/code-reviewer.md +9 -14
- package/presets/claude/ios-swift/agents/feature-developer.md +8 -1
- package/presets/claude/ios-swift/agents/task-analyst.md +8 -1
- package/presets/claude/ios-swift/agents/task-router.md +33 -1
- package/presets/claude/ios-swift/commands/task-continue.md +17 -16
- package/presets/claude/ios-swift/commands/task.md +11 -5
- package/presets/claude/ios-swift/commands/technical-retro.md +4 -0
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +393 -70
- package/presets/claude/ios-swift/rules/README.md +6 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +36 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +5 -5
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +4 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/ios-swift/team/README.md +19 -0
- package/presets/claude/java/agents/build-verifier.md +11 -4
- package/presets/claude/java/agents/code-reviewer.md +8 -1
- package/presets/claude/java/agents/feature-developer.md +8 -1
- package/presets/claude/java/agents/task-analyst.md +8 -1
- package/presets/claude/java/agents/task-router.md +33 -1
- package/presets/claude/java/commands/task-continue.md +17 -16
- package/presets/claude/java/commands/task.md +11 -5
- package/presets/claude/java/commands/technical-retro.md +4 -0
- package/presets/claude/java/hooks/chain-team-phases.sh +411 -69
- package/presets/claude/java/rules/README.md +6 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +33 -4
- package/presets/claude/java/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/java/rules/tooling-and-review/preset-no-cross-stack-leakage.md +5 -5
- package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +4 -0
- package/presets/claude/java/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/java/team/README.md +19 -0
- package/presets/claude/mcp-ts/agents/build-verifier.md +11 -4
- package/presets/claude/mcp-ts/agents/feature-developer.md +7 -1
- package/presets/claude/mcp-ts/agents/task-analyst.md +8 -1
- package/presets/claude/mcp-ts/agents/task-router.md +35 -3
- package/presets/claude/mcp-ts/commands/task-continue.md +21 -20
- package/presets/claude/mcp-ts/commands/task.md +11 -5
- package/presets/claude/mcp-ts/commands/technical-retro.md +4 -0
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +397 -55
- package/presets/claude/mcp-ts/rules/README.md +6 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +33 -4
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-no-cross-stack-leakage.md +5 -5
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +4 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/technical-retro.md +2 -4
- package/presets/claude/mcp-ts/team/README.md +19 -0
- package/presets/claude/next/agents/accessibility-reviewer.md +6 -12
- package/presets/claude/next/agents/api-contract-reviewer.md +6 -12
- package/presets/claude/next/agents/build-verifier.md +10 -14
- package/presets/claude/next/agents/ci-investigator.md +7 -13
- package/presets/claude/next/agents/code-reviewer.md +9 -14
- package/presets/claude/next/agents/debugger.md +6 -12
- package/presets/claude/next/agents/feature-developer.md +8 -1
- package/presets/claude/next/agents/migration-specialist.md +6 -12
- package/presets/claude/next/agents/performance-auditor.md +5 -11
- package/presets/claude/next/agents/qa-tester.md +6 -12
- package/presets/claude/next/agents/security-reviewer.md +6 -12
- package/presets/claude/next/agents/solution-architect.md +6 -12
- package/presets/claude/next/agents/task-analyst.md +10 -16
- package/presets/claude/next/agents/task-router.md +33 -1
- package/presets/claude/next/agents/tech-writer.md +6 -13
- package/presets/claude/next/agents/unit-test-generator.md +6 -10
- package/presets/claude/next/agents/unit-test-healer.md +6 -10
- package/presets/claude/next/agents/unit-test-planner.md +5 -11
- package/presets/claude/next/commands/task-continue.md +17 -16
- package/presets/claude/next/commands/task.md +11 -5
- package/presets/claude/next/commands/technical-retro.md +4 -0
- package/presets/claude/next/hooks/chain-team-phases.sh +413 -70
- package/presets/claude/next/rules/README.md +6 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +32 -3
- package/presets/claude/next/rules/tooling-and-review/preset-layering.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +5 -5
- package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +4 -0
- package/presets/claude/next/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/next/team/README.md +32 -1
- package/presets/claude/next/team/fixtures/artifact-manifest.example.json +61 -0
- package/presets/claude/next/team/fixtures/bugfix-standard.json +10 -0
- package/presets/claude/next/team/fixtures/feature-full.json +10 -0
- package/presets/claude/next/team/fixtures/feature-light.json +10 -0
- package/presets/claude/php-hexagonal/CLAUDE.md +31 -0
- package/presets/claude/php-hexagonal/MCP.md +15 -0
- package/presets/claude/php-hexagonal/README.md +26 -0
- package/presets/claude/php-hexagonal/REPO_AGENTS.md +46 -0
- package/presets/claude/php-hexagonal/agents/README.md +32 -0
- package/presets/claude/php-hexagonal/agents/api-contract-reviewer.md +23 -0
- package/presets/claude/php-hexagonal/agents/build-verifier.md +52 -0
- package/presets/claude/php-hexagonal/agents/ci-investigator.md +21 -0
- package/presets/claude/php-hexagonal/agents/code-reviewer.md +47 -0
- package/presets/claude/php-hexagonal/agents/codebase-analyzer.md +28 -0
- package/presets/claude/php-hexagonal/agents/debugger.md +29 -0
- package/presets/claude/php-hexagonal/agents/feature-developer.md +54 -0
- package/presets/claude/php-hexagonal/agents/integration-test-generator.md +22 -0
- package/presets/claude/php-hexagonal/agents/integration-test-healer.md +22 -0
- package/presets/claude/php-hexagonal/agents/integration-test-planner.md +22 -0
- package/presets/claude/php-hexagonal/agents/migration-specialist.md +31 -0
- package/presets/claude/php-hexagonal/agents/performance-auditor.md +22 -0
- package/presets/claude/php-hexagonal/agents/qa-tester.md +24 -0
- package/presets/claude/php-hexagonal/agents/security-reviewer.md +20 -0
- package/presets/claude/php-hexagonal/agents/solution-architect.md +28 -0
- package/presets/claude/php-hexagonal/agents/task-analyst.md +32 -0
- package/presets/claude/php-hexagonal/agents/task-router.md +101 -0
- package/presets/claude/php-hexagonal/agents/tech-writer.md +15 -0
- package/presets/claude/php-hexagonal/agents/unit-test-generator.md +21 -0
- package/presets/claude/php-hexagonal/agents/unit-test-healer.md +13 -0
- package/presets/claude/php-hexagonal/agents/unit-test-planner.md +26 -0
- package/presets/claude/php-hexagonal/commands/README.md +13 -0
- package/presets/claude/php-hexagonal/commands/feature-continue.md +51 -0
- package/presets/claude/php-hexagonal/commands/feature-start.md +30 -0
- package/presets/claude/php-hexagonal/commands/task-continue.md +50 -0
- package/presets/claude/php-hexagonal/commands/task.md +55 -0
- package/presets/claude/php-hexagonal/commands/technical-retro.md +62 -0
- package/presets/claude/php-hexagonal/hooks/README.md +16 -0
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +724 -0
- package/presets/claude/php-hexagonal/hooks/examples/README.md +18 -0
- package/presets/claude/php-hexagonal/hooks/examples/format-edited.example.sh +11 -0
- package/presets/claude/php-hexagonal/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/claude/php-hexagonal/hooks/examples/test-on-save.example.sh +19 -0
- package/presets/claude/php-hexagonal/hooks/guard-shell-command.sh +80 -0
- package/presets/claude/php-hexagonal/mcp.json +11 -0
- package/presets/claude/php-hexagonal/rules/README.md +67 -0
- package/presets/claude/php-hexagonal/rules/api-and-data/README.md +14 -0
- package/presets/claude/php-hexagonal/rules/api-and-data/adapters-driven.md +38 -0
- package/presets/claude/php-hexagonal/rules/api-and-data/adapters-driving.md +38 -0
- package/presets/claude/php-hexagonal/rules/api-and-data/api-grpc.md +29 -0
- package/presets/claude/php-hexagonal/rules/api-and-data/api-http.md +36 -0
- package/presets/claude/php-hexagonal/rules/api-and-data/messaging-adapters.md +37 -0
- package/presets/claude/php-hexagonal/rules/api-and-data/persistence-adapters.md +33 -0
- package/presets/claude/php-hexagonal/rules/architecture/README.md +16 -0
- package/presets/claude/php-hexagonal/rules/architecture/application-usecases.md +31 -0
- package/presets/claude/php-hexagonal/rules/architecture/boundaries.md +34 -0
- package/presets/claude/php-hexagonal/rules/architecture/composition-root.md +33 -0
- package/presets/claude/php-hexagonal/rules/architecture/domain-layer.md +37 -0
- package/presets/claude/php-hexagonal/rules/architecture/feature-delivery.md +53 -0
- package/presets/claude/php-hexagonal/rules/architecture/module-public-api.md +31 -0
- package/presets/claude/php-hexagonal/rules/architecture/ports-interfaces.md +34 -0
- package/presets/claude/php-hexagonal/rules/architecture/reference-features.md +39 -0
- package/presets/claude/php-hexagonal/rules/stack/README.md +10 -0
- package/presets/claude/php-hexagonal/rules/stack/php-app-core.md +35 -0
- package/presets/claude/php-hexagonal/rules/stack/php-conventions.md +51 -0
- package/presets/claude/php-hexagonal/rules/testing/README.md +11 -0
- package/presets/claude/php-hexagonal/rules/testing/e2e.md +35 -0
- package/presets/claude/php-hexagonal/rules/testing/integration.md +31 -0
- package/presets/claude/php-hexagonal/rules/testing/unit.md +32 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/README.md +21 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +26 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +208 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/anti-sycophancy-discipline.md +29 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/code-quality.md +53 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/code-review.md +60 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/design-guidance.md +111 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/php-tooling.md +39 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/post-change-test.md +31 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-layering.md +36 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-no-cross-stack-leakage.md +69 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +39 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-token-budget.md +41 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +50 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/security-php.md +29 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/technical-retro.md +22 -0
- package/presets/claude/php-hexagonal/rules/ui-and-accessibility/README.md +5 -0
- package/presets/claude/php-hexagonal/skills/README.md +5 -0
- package/presets/claude/php-hexagonal/skills/ci-investigation/SKILL.md +11 -0
- package/presets/claude/php-hexagonal/skills/code-review/SKILL.md +25 -0
- package/presets/claude/php-hexagonal/skills/debug-investigation/SKILL.md +15 -0
- package/presets/claude/php-hexagonal/skills/feature-delivery/SKILL.md +30 -0
- package/presets/claude/php-hexagonal/skills/integration-testing/SKILL.md +15 -0
- package/presets/claude/php-hexagonal/skills/technical-retro/SKILL.md +54 -0
- package/presets/claude/php-hexagonal/skills/unit-testing/SKILL.md +14 -0
- package/presets/claude/php-hexagonal/skills/write-adr/SKILL.md +41 -0
- package/presets/claude/php-hexagonal/team/README.md +48 -0
- package/presets/claude/php-hexagonal/team/conventions.md +21 -0
- package/presets/claude/php-hexagonal/team/fixtures/bugfix-standard.json +37 -0
- package/presets/claude/php-hexagonal/team/fixtures/feature-full.json +25 -0
- package/presets/claude/php-hexagonal/team/fixtures/feature-light.json +17 -0
- package/presets/claude/php-laravel/CLAUDE.md +20 -0
- package/presets/claude/php-laravel/MCP.md +5 -0
- package/presets/claude/php-laravel/README.md +30 -0
- package/presets/claude/php-laravel/REPO_AGENTS.md +47 -0
- package/presets/claude/php-laravel/agents/README.md +32 -0
- package/presets/claude/php-laravel/agents/api-contract-reviewer.md +23 -0
- package/presets/claude/php-laravel/agents/build-verifier.md +52 -0
- package/presets/claude/php-laravel/agents/ci-investigator.md +21 -0
- package/presets/claude/php-laravel/agents/code-reviewer.md +47 -0
- package/presets/claude/php-laravel/agents/codebase-analyzer.md +28 -0
- package/presets/claude/php-laravel/agents/debugger.md +29 -0
- package/presets/claude/php-laravel/agents/feature-developer.md +54 -0
- package/presets/claude/php-laravel/agents/integration-test-generator.md +22 -0
- package/presets/claude/php-laravel/agents/integration-test-healer.md +22 -0
- package/presets/claude/php-laravel/agents/integration-test-planner.md +22 -0
- package/presets/claude/php-laravel/agents/migration-specialist.md +31 -0
- package/presets/claude/php-laravel/agents/performance-auditor.md +22 -0
- package/presets/claude/php-laravel/agents/qa-tester.md +30 -0
- package/presets/claude/php-laravel/agents/security-reviewer.md +32 -0
- package/presets/claude/php-laravel/agents/solution-architect.md +29 -0
- package/presets/claude/php-laravel/agents/task-analyst.md +32 -0
- package/presets/claude/php-laravel/agents/task-router.md +120 -0
- package/presets/claude/php-laravel/agents/tech-writer.md +15 -0
- package/presets/claude/php-laravel/agents/unit-test-generator.md +21 -0
- package/presets/claude/php-laravel/agents/unit-test-healer.md +13 -0
- package/presets/claude/php-laravel/agents/unit-test-planner.md +26 -0
- package/presets/claude/php-laravel/commands/README.md +13 -0
- package/presets/claude/php-laravel/commands/feature-continue.md +51 -0
- package/presets/claude/php-laravel/commands/feature-start.md +30 -0
- package/presets/claude/php-laravel/commands/task-continue.md +50 -0
- package/presets/claude/php-laravel/commands/task.md +55 -0
- package/presets/claude/php-laravel/commands/technical-retro.md +62 -0
- package/presets/claude/php-laravel/hooks/README.md +16 -0
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +724 -0
- package/presets/claude/php-laravel/hooks/examples/README.md +18 -0
- package/presets/claude/php-laravel/hooks/examples/format-edited.example.sh +11 -0
- package/presets/claude/php-laravel/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/claude/php-laravel/hooks/examples/test-on-save.example.sh +19 -0
- package/presets/claude/php-laravel/hooks/guard-shell-command.sh +80 -0
- package/presets/claude/php-laravel/mcp.json +11 -0
- package/presets/claude/php-laravel/rules/README.md +67 -0
- package/presets/claude/php-laravel/rules/api-and-data/README.md +3 -0
- package/presets/claude/php-laravel/rules/api-and-data/eloquent-persistence.md +31 -0
- package/presets/claude/php-laravel/rules/api-and-data/events-listeners.md +31 -0
- package/presets/claude/php-laravel/rules/api-and-data/form-requests.md +29 -0
- package/presets/claude/php-laravel/rules/api-and-data/http-layer.md +32 -0
- package/presets/claude/php-laravel/rules/api-and-data/jobs-queues.md +41 -0
- package/presets/claude/php-laravel/rules/api-and-data/policies-authorization.md +29 -0
- package/presets/claude/php-laravel/rules/api-and-data/routes-api.md +29 -0
- package/presets/claude/php-laravel/rules/architecture/README.md +3 -0
- package/presets/claude/php-laravel/rules/architecture/actions-services.md +30 -0
- package/presets/claude/php-laravel/rules/architecture/boundaries.md +34 -0
- package/presets/claude/php-laravel/rules/architecture/domain-layer.md +24 -0
- package/presets/claude/php-laravel/rules/architecture/feature-delivery.md +51 -0
- package/presets/claude/php-laravel/rules/architecture/module-public-api.md +29 -0
- package/presets/claude/php-laravel/rules/architecture/reference-features.md +40 -0
- package/presets/claude/php-laravel/rules/architecture/service-providers.md +28 -0
- package/presets/claude/php-laravel/rules/stack/README.md +3 -0
- package/presets/claude/php-laravel/rules/stack/laravel-app-core.md +32 -0
- package/presets/claude/php-laravel/rules/stack/laravel-conventions.md +38 -0
- package/presets/claude/php-laravel/rules/testing/README.md +3 -0
- package/presets/claude/php-laravel/rules/testing/e2e.md +34 -0
- package/presets/claude/php-laravel/rules/testing/integration.md +30 -0
- package/presets/claude/php-laravel/rules/testing/unit.md +30 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/README.md +3 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +21 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +205 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/anti-sycophancy-discipline.md +29 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/code-quality.md +52 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/code-review.md +58 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/design-guidance.md +111 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/php-tooling.md +37 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/post-change-test.md +29 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-layering.md +33 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-no-cross-stack-leakage.md +66 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +36 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-token-budget.md +38 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +47 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/security-php.md +58 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/technical-retro.md +17 -0
- package/presets/claude/php-laravel/rules/ui-and-accessibility/README.md +3 -0
- package/presets/claude/php-laravel/skills/README.md +5 -0
- package/presets/claude/php-laravel/skills/ci-investigation/SKILL.md +11 -0
- package/presets/claude/php-laravel/skills/code-review/SKILL.md +25 -0
- package/presets/claude/php-laravel/skills/debug-investigation/SKILL.md +15 -0
- package/presets/claude/php-laravel/skills/feature-delivery/SKILL.md +30 -0
- package/presets/claude/php-laravel/skills/integration-testing/SKILL.md +15 -0
- package/presets/claude/php-laravel/skills/technical-retro/SKILL.md +54 -0
- package/presets/claude/php-laravel/skills/unit-testing/SKILL.md +14 -0
- package/presets/claude/php-laravel/skills/write-adr/SKILL.md +41 -0
- package/presets/claude/php-laravel/team/README.md +28 -0
- package/presets/claude/php-laravel/team/conventions.md +21 -0
- package/presets/claude/php-laravel/team/fixtures/bugfix-standard.json +12 -0
- package/presets/claude/php-laravel/team/fixtures/feature-full.json +15 -0
- package/presets/claude/php-laravel/team/fixtures/feature-light.json +8 -0
- package/presets/cursor/go/agents/build-verifier.md +10 -3
- package/presets/cursor/go/agents/code-reviewer.md +8 -1
- package/presets/cursor/go/agents/feature-developer.md +8 -1
- package/presets/cursor/go/agents/task-analyst.md +8 -1
- package/presets/cursor/go/agents/task-router.md +33 -1
- package/presets/cursor/go/commands/task-continue.md +17 -16
- package/presets/cursor/go/commands/task.md +11 -5
- package/presets/cursor/go/commands/technical-retro.md +4 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +411 -69
- package/presets/cursor/go/rules/README.md +6 -0
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +33 -4
- package/presets/cursor/go/rules/preset-layering.mdc +1 -1
- package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +5 -5
- package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/go/rules/preset-twin-sync.mdc +4 -0
- package/presets/cursor/go/rules/technical-retro.mdc +2 -0
- package/presets/cursor/go/team/README.md +19 -0
- package/presets/cursor/ios-swift/agents/build-verifier.md +11 -4
- package/presets/cursor/ios-swift/agents/code-reviewer.md +9 -14
- package/presets/cursor/ios-swift/agents/feature-developer.md +8 -1
- package/presets/cursor/ios-swift/agents/task-analyst.md +8 -1
- package/presets/cursor/ios-swift/agents/task-router.md +33 -1
- package/presets/cursor/ios-swift/commands/task-continue.md +17 -16
- package/presets/cursor/ios-swift/commands/task.md +11 -5
- package/presets/cursor/ios-swift/commands/technical-retro.md +4 -0
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +411 -70
- package/presets/cursor/ios-swift/rules/README.md +6 -0
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +26 -1
- package/presets/cursor/ios-swift/rules/preset-layering.mdc +1 -1
- package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +5 -5
- package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +4 -0
- package/presets/cursor/ios-swift/rules/technical-retro.mdc +2 -0
- package/presets/cursor/ios-swift/team/README.md +19 -0
- package/presets/cursor/java/agents/build-verifier.md +11 -4
- package/presets/cursor/java/agents/code-reviewer.md +8 -1
- package/presets/cursor/java/agents/feature-developer.md +8 -1
- package/presets/cursor/java/agents/task-analyst.md +8 -1
- package/presets/cursor/java/agents/task-router.md +33 -1
- package/presets/cursor/java/commands/task-continue.md +17 -16
- package/presets/cursor/java/commands/task.md +11 -5
- package/presets/cursor/java/commands/technical-retro.md +4 -0
- package/presets/cursor/java/hooks/chain-team-phases.sh +411 -69
- package/presets/cursor/java/rules/README.md +6 -0
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +33 -4
- package/presets/cursor/java/rules/preset-layering.mdc +1 -1
- package/presets/cursor/java/rules/preset-no-cross-stack-leakage.mdc +5 -5
- package/presets/cursor/java/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/java/rules/preset-twin-sync.mdc +4 -0
- package/presets/cursor/java/rules/technical-retro.mdc +2 -0
- package/presets/cursor/java/team/README.md +19 -0
- package/presets/cursor/mcp-ts/agents/build-verifier.md +10 -3
- package/presets/cursor/mcp-ts/agents/feature-developer.md +7 -1
- package/presets/cursor/mcp-ts/agents/task-analyst.md +8 -1
- package/presets/cursor/mcp-ts/agents/task-router.md +33 -1
- package/presets/cursor/mcp-ts/commands/task-continue.md +19 -18
- package/presets/cursor/mcp-ts/commands/task.md +11 -5
- package/presets/cursor/mcp-ts/commands/technical-retro.md +4 -0
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +397 -55
- package/presets/cursor/mcp-ts/rules/README.md +6 -0
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +33 -4
- package/presets/cursor/mcp-ts/rules/preset-layering.mdc +1 -1
- package/presets/cursor/mcp-ts/rules/preset-no-cross-stack-leakage.mdc +5 -5
- package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +4 -0
- package/presets/cursor/mcp-ts/rules/technical-retro.mdc +2 -4
- package/presets/cursor/mcp-ts/team/README.md +19 -0
- package/presets/cursor/next/agents/accessibility-reviewer.md +7 -14
- package/presets/cursor/next/agents/api-contract-reviewer.md +7 -14
- package/presets/cursor/next/agents/build-verifier.md +10 -15
- package/presets/cursor/next/agents/ci-investigator.md +7 -14
- package/presets/cursor/next/agents/code-reviewer.md +9 -14
- package/presets/cursor/next/agents/debugger.md +6 -12
- package/presets/cursor/next/agents/feature-developer.md +8 -1
- package/presets/cursor/next/agents/migration-specialist.md +7 -14
- package/presets/cursor/next/agents/performance-auditor.md +6 -13
- package/presets/cursor/next/agents/qa-tester.md +6 -13
- package/presets/cursor/next/agents/security-reviewer.md +7 -14
- package/presets/cursor/next/agents/solution-architect.md +6 -12
- package/presets/cursor/next/agents/task-analyst.md +10 -16
- package/presets/cursor/next/agents/task-router.md +33 -1
- package/presets/cursor/next/agents/tech-writer.md +6 -13
- package/presets/cursor/next/agents/unit-test-generator.md +6 -11
- package/presets/cursor/next/agents/unit-test-healer.md +6 -11
- package/presets/cursor/next/agents/unit-test-planner.md +6 -13
- package/presets/cursor/next/commands/task-continue.md +17 -16
- package/presets/cursor/next/commands/task.md +11 -5
- package/presets/cursor/next/commands/technical-retro.md +4 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +417 -70
- package/presets/cursor/next/rules/README.md +6 -0
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +33 -4
- package/presets/cursor/next/rules/preset-layering.mdc +1 -1
- package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +5 -5
- package/presets/cursor/next/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/next/rules/preset-twin-sync.mdc +4 -0
- package/presets/cursor/next/rules/technical-retro.mdc +2 -0
- package/presets/cursor/next/team/README.md +33 -2
- package/presets/cursor/next/team/fixtures/artifact-manifest.example.json +61 -0
- package/presets/cursor/next/team/fixtures/bugfix-standard.json +10 -0
- package/presets/cursor/next/team/fixtures/feature-full.json +10 -0
- package/presets/cursor/next/team/fixtures/feature-light.json +10 -0
- package/presets/cursor/next/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
- package/presets/cursor/next/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
- package/presets/cursor/next/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
- package/presets/cursor/next/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
- package/presets/cursor/next/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
- package/presets/cursor/next/team/fixtures/metrics.example.json +54 -0
- package/presets/cursor/php-hexagonal/AGENTS.md +39 -0
- package/presets/cursor/php-hexagonal/BUGBOT.md +11 -0
- package/presets/cursor/php-hexagonal/MCP.md +15 -0
- package/presets/cursor/php-hexagonal/README.md +26 -0
- package/presets/cursor/php-hexagonal/REPO_AGENTS.md +46 -0
- package/presets/cursor/php-hexagonal/agents/README.md +36 -0
- package/presets/cursor/php-hexagonal/agents/api-contract-reviewer.md +23 -0
- package/presets/cursor/php-hexagonal/agents/build-verifier.md +52 -0
- package/presets/cursor/php-hexagonal/agents/ci-investigator.md +21 -0
- package/presets/cursor/php-hexagonal/agents/code-reviewer.md +47 -0
- package/presets/cursor/php-hexagonal/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/php-hexagonal/agents/debugger.md +29 -0
- package/presets/cursor/php-hexagonal/agents/feature-developer.md +54 -0
- package/presets/cursor/php-hexagonal/agents/integration-test-generator.md +22 -0
- package/presets/cursor/php-hexagonal/agents/integration-test-healer.md +22 -0
- package/presets/cursor/php-hexagonal/agents/integration-test-planner.md +22 -0
- package/presets/cursor/php-hexagonal/agents/migration-specialist.md +31 -0
- package/presets/cursor/php-hexagonal/agents/performance-auditor.md +22 -0
- package/presets/cursor/php-hexagonal/agents/qa-tester.md +24 -0
- package/presets/cursor/php-hexagonal/agents/security-reviewer.md +20 -0
- package/presets/cursor/php-hexagonal/agents/solution-architect.md +28 -0
- package/presets/cursor/php-hexagonal/agents/task-analyst.md +32 -0
- package/presets/cursor/php-hexagonal/agents/task-router.md +101 -0
- package/presets/cursor/php-hexagonal/agents/tech-writer.md +15 -0
- package/presets/cursor/php-hexagonal/agents/unit-test-generator.md +21 -0
- package/presets/cursor/php-hexagonal/agents/unit-test-healer.md +13 -0
- package/presets/cursor/php-hexagonal/agents/unit-test-planner.md +26 -0
- package/presets/cursor/php-hexagonal/commands/README.md +54 -0
- package/presets/cursor/php-hexagonal/commands/feature-continue.md +19 -0
- package/presets/cursor/php-hexagonal/commands/feature-start.md +33 -0
- package/presets/cursor/php-hexagonal/commands/task-continue.md +50 -0
- package/presets/cursor/php-hexagonal/commands/task.md +55 -0
- package/presets/cursor/php-hexagonal/commands/technical-retro.md +85 -0
- package/presets/cursor/php-hexagonal/hooks/README.md +12 -0
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +724 -0
- package/presets/cursor/php-hexagonal/hooks/examples/README.md +18 -0
- package/presets/cursor/php-hexagonal/hooks/examples/format-edited.example.sh +11 -0
- package/presets/cursor/php-hexagonal/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/cursor/php-hexagonal/hooks/examples/test-on-save.example.sh +19 -0
- package/presets/cursor/php-hexagonal/hooks/guard-shell-command.sh +80 -0
- package/presets/cursor/php-hexagonal/hooks.json +17 -0
- package/presets/cursor/php-hexagonal/mcp.json +11 -0
- package/presets/cursor/php-hexagonal/rules/README.md +106 -0
- package/presets/cursor/php-hexagonal/rules/adapters-driven.mdc +41 -0
- package/presets/cursor/php-hexagonal/rules/adapters-driving.mdc +42 -0
- package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +20 -0
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +202 -0
- package/presets/cursor/php-hexagonal/rules/anti-sycophancy-discipline.mdc +30 -0
- package/presets/cursor/php-hexagonal/rules/api-grpc.mdc +31 -0
- package/presets/cursor/php-hexagonal/rules/api-http.mdc +40 -0
- package/presets/cursor/php-hexagonal/rules/application-usecases.mdc +33 -0
- package/presets/cursor/php-hexagonal/rules/architecture-boundaries.mdc +36 -0
- package/presets/cursor/php-hexagonal/rules/code-quality-and-refactoring.mdc +54 -0
- package/presets/cursor/php-hexagonal/rules/code-review-mr.mdc +54 -0
- package/presets/cursor/php-hexagonal/rules/composition-root.mdc +37 -0
- package/presets/cursor/php-hexagonal/rules/design-guidance.mdc +112 -0
- package/presets/cursor/php-hexagonal/rules/domain-layer.mdc +39 -0
- package/presets/cursor/php-hexagonal/rules/feature-delivery-workflow.mdc +47 -0
- package/presets/cursor/php-hexagonal/rules/messaging-adapters.mdc +38 -0
- package/presets/cursor/php-hexagonal/rules/module-public-api.mdc +32 -0
- package/presets/cursor/php-hexagonal/rules/persistence-adapters.mdc +35 -0
- package/presets/cursor/php-hexagonal/rules/php-app-core.mdc +37 -0
- package/presets/cursor/php-hexagonal/rules/php-conventions.mdc +53 -0
- package/presets/cursor/php-hexagonal/rules/php-tooling.mdc +38 -0
- package/presets/cursor/php-hexagonal/rules/ports-interfaces.mdc +37 -0
- package/presets/cursor/php-hexagonal/rules/post-change-test.mdc +30 -0
- package/presets/cursor/php-hexagonal/rules/preset-layering.mdc +36 -0
- package/presets/cursor/php-hexagonal/rules/preset-no-cross-stack-leakage.mdc +69 -0
- package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +39 -0
- package/presets/cursor/php-hexagonal/rules/preset-token-budget.mdc +41 -0
- package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +50 -0
- package/presets/cursor/php-hexagonal/rules/reference-features.mdc +40 -0
- package/presets/cursor/php-hexagonal/rules/security-php.mdc +33 -0
- package/presets/cursor/php-hexagonal/rules/technical-retro.mdc +16 -0
- package/presets/cursor/php-hexagonal/rules/tests-e2e.mdc +36 -0
- package/presets/cursor/php-hexagonal/rules/tests-integration.mdc +33 -0
- package/presets/cursor/php-hexagonal/rules/tests-unit.mdc +35 -0
- package/presets/cursor/php-hexagonal/skills/README.md +5 -0
- package/presets/cursor/php-hexagonal/skills/ci-investigation/SKILL.md +11 -0
- package/presets/cursor/php-hexagonal/skills/code-review/SKILL.md +25 -0
- package/presets/cursor/php-hexagonal/skills/debug-investigation/SKILL.md +15 -0
- package/presets/cursor/php-hexagonal/skills/feature-delivery/SKILL.md +30 -0
- package/presets/cursor/php-hexagonal/skills/integration-testing/SKILL.md +15 -0
- package/presets/cursor/php-hexagonal/skills/technical-retro/SKILL.md +54 -0
- package/presets/cursor/php-hexagonal/skills/unit-testing/SKILL.md +14 -0
- package/presets/cursor/php-hexagonal/skills/write-adr/SKILL.md +41 -0
- package/presets/cursor/php-hexagonal/team/README.md +52 -0
- package/presets/cursor/php-hexagonal/team/conventions.md +21 -0
- package/presets/cursor/php-hexagonal/team/fixtures/bugfix-standard.json +37 -0
- package/presets/cursor/php-hexagonal/team/fixtures/feature-full.json +25 -0
- package/presets/cursor/php-hexagonal/team/fixtures/feature-light.json +17 -0
- package/presets/cursor/php-laravel/AGENTS.md +39 -0
- package/presets/cursor/php-laravel/BUGBOT.md +9 -0
- package/presets/cursor/php-laravel/MCP.md +5 -0
- package/presets/cursor/php-laravel/README.md +33 -0
- package/presets/cursor/php-laravel/REPO_AGENTS.md +47 -0
- package/presets/cursor/php-laravel/agents/README.md +36 -0
- package/presets/cursor/php-laravel/agents/api-contract-reviewer.md +23 -0
- package/presets/cursor/php-laravel/agents/build-verifier.md +52 -0
- package/presets/cursor/php-laravel/agents/ci-investigator.md +21 -0
- package/presets/cursor/php-laravel/agents/code-reviewer.md +47 -0
- package/presets/cursor/php-laravel/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/php-laravel/agents/debugger.md +29 -0
- package/presets/cursor/php-laravel/agents/feature-developer.md +54 -0
- package/presets/cursor/php-laravel/agents/integration-test-generator.md +22 -0
- package/presets/cursor/php-laravel/agents/integration-test-healer.md +22 -0
- package/presets/cursor/php-laravel/agents/integration-test-planner.md +22 -0
- package/presets/cursor/php-laravel/agents/migration-specialist.md +31 -0
- package/presets/cursor/php-laravel/agents/performance-auditor.md +22 -0
- package/presets/cursor/php-laravel/agents/qa-tester.md +30 -0
- package/presets/cursor/php-laravel/agents/security-reviewer.md +32 -0
- package/presets/cursor/php-laravel/agents/solution-architect.md +29 -0
- package/presets/cursor/php-laravel/agents/task-analyst.md +32 -0
- package/presets/cursor/php-laravel/agents/task-router.md +120 -0
- package/presets/cursor/php-laravel/agents/tech-writer.md +15 -0
- package/presets/cursor/php-laravel/agents/unit-test-generator.md +21 -0
- package/presets/cursor/php-laravel/agents/unit-test-healer.md +13 -0
- package/presets/cursor/php-laravel/agents/unit-test-planner.md +26 -0
- package/presets/cursor/php-laravel/commands/README.md +54 -0
- package/presets/cursor/php-laravel/commands/feature-continue.md +19 -0
- package/presets/cursor/php-laravel/commands/feature-start.md +33 -0
- package/presets/cursor/php-laravel/commands/task-continue.md +50 -0
- package/presets/cursor/php-laravel/commands/task.md +55 -0
- package/presets/cursor/php-laravel/commands/technical-retro.md +85 -0
- package/presets/cursor/php-laravel/hooks/README.md +12 -0
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +724 -0
- package/presets/cursor/php-laravel/hooks/examples/README.md +18 -0
- package/presets/cursor/php-laravel/hooks/examples/format-edited.example.sh +11 -0
- package/presets/cursor/php-laravel/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/cursor/php-laravel/hooks/examples/test-on-save.example.sh +19 -0
- package/presets/cursor/php-laravel/hooks/guard-shell-command.sh +80 -0
- package/presets/cursor/php-laravel/hooks.json +17 -0
- package/presets/cursor/php-laravel/mcp.json +11 -0
- package/presets/cursor/php-laravel/rules/README.md +111 -0
- package/presets/cursor/php-laravel/rules/actions-services.mdc +33 -0
- package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +20 -0
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +203 -0
- package/presets/cursor/php-laravel/rules/anti-sycophancy-discipline.mdc +30 -0
- package/presets/cursor/php-laravel/rules/architecture-boundaries.mdc +37 -0
- package/presets/cursor/php-laravel/rules/code-quality-and-refactoring.mdc +54 -0
- package/presets/cursor/php-laravel/rules/code-review-mr.mdc +56 -0
- package/presets/cursor/php-laravel/rules/design-guidance.mdc +112 -0
- package/presets/cursor/php-laravel/rules/domain-layer.mdc +27 -0
- package/presets/cursor/php-laravel/rules/eloquent-persistence.mdc +34 -0
- package/presets/cursor/php-laravel/rules/events-listeners.mdc +34 -0
- package/presets/cursor/php-laravel/rules/feature-delivery-workflow.mdc +50 -0
- package/presets/cursor/php-laravel/rules/form-requests.mdc +32 -0
- package/presets/cursor/php-laravel/rules/http-layer.mdc +35 -0
- package/presets/cursor/php-laravel/rules/jobs-queues.mdc +44 -0
- package/presets/cursor/php-laravel/rules/laravel-app-core.mdc +35 -0
- package/presets/cursor/php-laravel/rules/laravel-conventions.mdc +41 -0
- package/presets/cursor/php-laravel/rules/module-public-api.mdc +31 -0
- package/presets/cursor/php-laravel/rules/php-tooling.mdc +39 -0
- package/presets/cursor/php-laravel/rules/policies-authorization.mdc +32 -0
- package/presets/cursor/php-laravel/rules/post-change-test.mdc +31 -0
- package/presets/cursor/php-laravel/rules/preset-layering.mdc +36 -0
- package/presets/cursor/php-laravel/rules/preset-no-cross-stack-leakage.mdc +69 -0
- package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +39 -0
- package/presets/cursor/php-laravel/rules/preset-token-budget.mdc +41 -0
- package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +50 -0
- package/presets/cursor/php-laravel/rules/reference-features.mdc +42 -0
- package/presets/cursor/php-laravel/rules/routes-api.mdc +32 -0
- package/presets/cursor/php-laravel/rules/security-php.mdc +61 -0
- package/presets/cursor/php-laravel/rules/service-providers.mdc +31 -0
- package/presets/cursor/php-laravel/rules/technical-retro.mdc +16 -0
- package/presets/cursor/php-laravel/rules/tests-e2e.mdc +36 -0
- package/presets/cursor/php-laravel/rules/tests-integration.mdc +33 -0
- package/presets/cursor/php-laravel/rules/tests-unit.mdc +33 -0
- package/presets/cursor/php-laravel/skills/README.md +5 -0
- package/presets/cursor/php-laravel/skills/ci-investigation/SKILL.md +11 -0
- package/presets/cursor/php-laravel/skills/code-review/SKILL.md +25 -0
- package/presets/cursor/php-laravel/skills/debug-investigation/SKILL.md +15 -0
- package/presets/cursor/php-laravel/skills/feature-delivery/SKILL.md +30 -0
- package/presets/cursor/php-laravel/skills/integration-testing/SKILL.md +15 -0
- package/presets/cursor/php-laravel/skills/technical-retro/SKILL.md +54 -0
- package/presets/cursor/php-laravel/skills/unit-testing/SKILL.md +14 -0
- package/presets/cursor/php-laravel/skills/write-adr/SKILL.md +41 -0
- package/presets/cursor/php-laravel/team/README.md +28 -0
- package/presets/cursor/php-laravel/team/conventions.md +21 -0
- package/presets/cursor/php-laravel/team/fixtures/bugfix-standard.json +12 -0
- package/presets/cursor/php-laravel/team/fixtures/feature-full.json +15 -0
- package/presets/cursor/php-laravel/team/fixtures/feature-light.json +8 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Hooks cookbook (examples)
|
|
2
|
+
|
|
3
|
+
Optional scripts under `hooks/examples/`. **Not** referenced from default `hooks.json` (only `guard-shell-command.sh` + `chain-team-phases.sh`).
|
|
4
|
+
|
|
5
|
+
| Script | Purpose |
|
|
6
|
+
|--------|---------|
|
|
7
|
+
| `secret-guard.example.sh` | Fail if staged diff looks like secrets |
|
|
8
|
+
| `format-edited.example.sh` | Stack formatter / linter on edited files |
|
|
9
|
+
| `test-on-save.example.sh` | Scoped tests for the stack |
|
|
10
|
+
|
|
11
|
+
## Wiring (Cursor)
|
|
12
|
+
|
|
13
|
+
1. Copy an example into `hooks/` (drop `.example` suffix), e.g. `cp hooks/examples/secret-guard.example.sh hooks/secret-guard.sh`.
|
|
14
|
+
2. `chmod +x hooks/secret-guard.sh`.
|
|
15
|
+
3. Add a hook entry in `.cursor/hooks.json` (e.g. `beforeShellExecution` or `afterFileEdit` — see Cursor hooks docs).
|
|
16
|
+
4. Keep cookbook scripts **out** of the default preset `hooks.json` when contributing back upstream.
|
|
17
|
+
|
|
18
|
+
Stack: **go** — recipes must stay stack-safe (no cross-stack lint/test commands).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Optional: project formatter on edited PHP sources.
|
|
3
|
+
# NOT in default hooks.json. Discover formatter from repo/CI — do not invent one.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
changed=$(git diff --name-only --diff-filter=ACMR HEAD 2>/dev/null | grep '\.php$' || true)
|
|
6
|
+
if [[ -n "${changed:-}" ]]; then
|
|
7
|
+
# Prefer repo tool already configured — placeholders only:
|
|
8
|
+
# vendor/bin/php-cs-fixer fix $changed OR vendor/bin/pint $changed
|
|
9
|
+
true
|
|
10
|
+
fi
|
|
11
|
+
exit 0
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Optional cookbook: block committing likely secrets in staged diffs.
|
|
3
|
+
# NOT wired in default hooks.json — copy to hooks/ and register manually.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
PATTERN='(AKIA[0-9A-Z]{16}|-----BEGIN (RSA |OPENSSH )?PRIVATE KEY-----|api[_-]?key\s*[:=]\s*['\''\"][^'\''\"]{12,})'
|
|
6
|
+
if git diff --cached -U0 2>/dev/null | grep -Eiq "$PATTERN"; then
|
|
7
|
+
echo "secret-guard: possible secret in staged diff — review before commit" >&2
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
10
|
+
exit 0
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Optional: Composer/PHPUnit (or Pest) after PHP edits.
|
|
3
|
+
# NOT in default hooks.json. Prefer Composer scripts when present.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
changed=$(git diff --name-only --diff-filter=ACMR HEAD 2>/dev/null | grep '\.php$' || true)
|
|
6
|
+
if [[ -z "${changed:-}" ]]; then
|
|
7
|
+
exit 0
|
|
8
|
+
fi
|
|
9
|
+
if [[ ! -f composer.json ]]; then
|
|
10
|
+
exit 0
|
|
11
|
+
fi
|
|
12
|
+
if composer test -q >/dev/null 2>&1; then
|
|
13
|
+
composer test -q 2>/dev/null || true
|
|
14
|
+
elif [[ -x vendor/bin/pest ]]; then
|
|
15
|
+
vendor/bin/pest 2>/dev/null || true
|
|
16
|
+
elif [[ -x vendor/bin/phpunit ]]; then
|
|
17
|
+
vendor/bin/phpunit 2>/dev/null || true
|
|
18
|
+
fi
|
|
19
|
+
exit 0
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Lightweight shell guard for Claude Code projects using this preset.
|
|
3
|
+
# PHP: do NOT blanket-block composer test / vendor/bin/phpunit / compiler/IDE inspections / configured static analysis / repo static analysis.
|
|
4
|
+
# Package-manager mismatch checks apply only when a JS lockfile/package.json exists.
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
# PHP_PRESET_GUARD: allow composer/composer test; no Playwright/XCUITest assumptions
|
|
8
|
+
|
|
9
|
+
input=$(cat)
|
|
10
|
+
|
|
11
|
+
INPUT="$input" node <<'NODE'
|
|
12
|
+
const fs = require('fs');
|
|
13
|
+
|
|
14
|
+
const raw = process.env.INPUT || '';
|
|
15
|
+
let event;
|
|
16
|
+
try {
|
|
17
|
+
event = JSON.parse(raw);
|
|
18
|
+
} catch {
|
|
19
|
+
process.stdout.write('{ "permission": "allow" }');
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const command = String(event.command || event.input?.command || '');
|
|
24
|
+
if (!command.trim()) {
|
|
25
|
+
process.stdout.write('{ "permission": "allow" }');
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function out(permission, userMessage, agentMessage) {
|
|
30
|
+
process.stdout.write(JSON.stringify({
|
|
31
|
+
permission,
|
|
32
|
+
user_message: userMessage,
|
|
33
|
+
agent_message: agentMessage || userMessage,
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const dangerousGit = /\bgit\s+(reset\s+--hard|clean\s+-[^\n]*f|push\s+--force|push\s+-f|checkout\s+--\s+)/;
|
|
38
|
+
if (dangerousGit.test(command)) {
|
|
39
|
+
out(
|
|
40
|
+
'ask',
|
|
41
|
+
'This command looks destructive for git state. Review it before continuing.',
|
|
42
|
+
'A project hook flagged a destructive git command. Ask the user before running it.',
|
|
43
|
+
);
|
|
44
|
+
process.exit(0);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const managerByFile = [
|
|
48
|
+
['yarn.lock', 'yarn'],
|
|
49
|
+
['pnpm-lock.yaml', 'pnpm'],
|
|
50
|
+
['package-lock.json', 'npm'],
|
|
51
|
+
].find(([file]) => fs.existsSync(file));
|
|
52
|
+
|
|
53
|
+
let expected = managerByFile?.[1];
|
|
54
|
+
if (!expected && fs.existsSync('package.json')) {
|
|
55
|
+
try {
|
|
56
|
+
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
57
|
+
const pm = typeof pkg.packageManager === 'string' ? pkg.packageManager : '';
|
|
58
|
+
expected = pm.split('@')[0] || undefined;
|
|
59
|
+
} catch {
|
|
60
|
+
// Ignore invalid package.json in the hook; the agent can diagnose it later.
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!expected) {
|
|
65
|
+
process.stdout.write('{ "permission": "allow" }');
|
|
66
|
+
process.exit(0);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const used = command.match(/(^|[;&|]\s*)(npm|yarn|pnpm)\s+/)?.[2];
|
|
70
|
+
if (used && used !== expected) {
|
|
71
|
+
out(
|
|
72
|
+
'ask',
|
|
73
|
+
`This repository appears to use ${expected}, but the command uses ${used}. Confirm before continuing.`,
|
|
74
|
+
`Use ${expected} for package scripts and installs unless the user explicitly approves ${used}.`,
|
|
75
|
+
);
|
|
76
|
+
process.exit(0);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
process.stdout.write('{ "permission": "allow" }');
|
|
80
|
+
NODE
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# `.claude/rules` (preset php-laravel)
|
|
2
|
+
|
|
3
|
+
Claude topic `.md` files are **derived** from Cursor SoT `presets/cursor/php-laravel/rules/*.mdc`.
|
|
4
|
+
|
|
5
|
+
## SoT sync
|
|
6
|
+
|
|
7
|
+
| Principle | Detail |
|
|
8
|
+
|-----------|--------|
|
|
9
|
+
| **SoT** | `presets/cursor/php-laravel/rules/*.mdc` |
|
|
10
|
+
| **Derive** | Claude topic `.md` + `paths:` (drop `alwaysApply`) |
|
|
11
|
+
| **Checklist** | change Cursor → update Claude twin **same PR** (**FAIL** if missing — next, ios-swift, go, java, mcp-ts, php-hexagonal, and php-laravel; see `preset-twin-sync` / build-verifier) |
|
|
12
|
+
|
|
13
|
+
## Loading budget
|
|
14
|
+
|
|
15
|
+
- **Session-start (no `paths:`):** exactly **3** — `laravel-app-core`, `boundaries`, `code-quality`
|
|
16
|
+
- All others — with `paths:`
|
|
17
|
+
- **Twin depth:** domain rules target ≥15 body lines; thin aliases: `agent-team-intake`, `technical-retro`, `domain-layer`; see Cursor `presets/cursor/php-laravel/rules/README.md` Catalog
|
|
18
|
+
|
|
19
|
+
## Cursor → Claude mapping
|
|
20
|
+
|
|
21
|
+
| Cursor `.mdc` (SoT) | Claude topic |
|
|
22
|
+
|---------------------|--------------|
|
|
23
|
+
| `actions-services.mdc` | `architecture/actions-services.md` |
|
|
24
|
+
| `agent-team-intake.mdc` | `tooling-and-review/agent-team-intake.md` |
|
|
25
|
+
| `agent-team-orchestrator.mdc` | `tooling-and-review/agent-team-orchestrator.md` |
|
|
26
|
+
| `anti-sycophancy-discipline.mdc` | `tooling-and-review/anti-sycophancy-discipline.md` |
|
|
27
|
+
| `architecture-boundaries.mdc` | `architecture/boundaries.md` |
|
|
28
|
+
| `code-quality-and-refactoring.mdc` | `tooling-and-review/code-quality.md` |
|
|
29
|
+
| `code-review-mr.mdc` | `tooling-and-review/code-review.md` |
|
|
30
|
+
| `design-guidance.mdc` | `tooling-and-review/design-guidance.md` |
|
|
31
|
+
| `domain-layer.mdc` | `architecture/domain-layer.md` |
|
|
32
|
+
| `eloquent-persistence.mdc` | `api-and-data/eloquent-persistence.md` |
|
|
33
|
+
| `events-listeners.mdc` | `api-and-data/events-listeners.md` |
|
|
34
|
+
| `feature-delivery-workflow.mdc` | `architecture/feature-delivery.md` |
|
|
35
|
+
| `form-requests.mdc` | `api-and-data/form-requests.md` |
|
|
36
|
+
| `http-layer.mdc` | `api-and-data/http-layer.md` |
|
|
37
|
+
| `jobs-queues.mdc` | `api-and-data/jobs-queues.md` |
|
|
38
|
+
| `laravel-app-core.mdc` | `stack/laravel-app-core.md` |
|
|
39
|
+
| `laravel-conventions.mdc` | `stack/laravel-conventions.md` |
|
|
40
|
+
| `module-public-api.mdc` | `architecture/module-public-api.md` |
|
|
41
|
+
| `php-tooling.mdc` | `tooling-and-review/php-tooling.md` |
|
|
42
|
+
| `policies-authorization.mdc` | `api-and-data/policies-authorization.md` |
|
|
43
|
+
| `post-change-test.mdc` | `tooling-and-review/post-change-test.md` |
|
|
44
|
+
| `preset-layering.mdc` | `tooling-and-review/preset-layering.md` |
|
|
45
|
+
| `preset-no-cross-stack-leakage.mdc` | `tooling-and-review/preset-no-cross-stack-leakage.md` |
|
|
46
|
+
| `preset-pr-checklist.mdc` | `tooling-and-review/preset-pr-checklist.md` |
|
|
47
|
+
| `preset-token-budget.mdc` | `tooling-and-review/preset-token-budget.md` |
|
|
48
|
+
| `preset-twin-sync.mdc` | `tooling-and-review/preset-twin-sync.md` |
|
|
49
|
+
| `reference-features.mdc` | `architecture/reference-features.md` |
|
|
50
|
+
| `routes-api.mdc` | `api-and-data/routes-api.md` |
|
|
51
|
+
| `security-php.mdc` | `tooling-and-review/security-php.md` |
|
|
52
|
+
| `service-providers.mdc` | `architecture/service-providers.md` |
|
|
53
|
+
| `technical-retro.mdc` | `tooling-and-review/technical-retro.md` |
|
|
54
|
+
| `tests-e2e.mdc` | `testing/e2e.md` |
|
|
55
|
+
| `tests-integration.mdc` | `testing/integration.md` |
|
|
56
|
+
| `tests-unit.mdc` | `testing/unit.md` |
|
|
57
|
+
|
|
58
|
+
## Topics
|
|
59
|
+
|
|
60
|
+
`architecture/`, `stack/`, `api-and-data/`, `testing/`, `tooling-and-review/`.
|
|
61
|
+
`ui-and-accessibility/` — README stub only (N/A backend).
|
|
62
|
+
|
|
63
|
+
## Metrics policy mapping
|
|
64
|
+
|
|
65
|
+
| Shared core | Runtime integration | Loading |
|
|
66
|
+
|-------------|---------------------|---------|
|
|
67
|
+
| `agent-team/agent-task-metrics.md` | `agent-team-orchestrator` + `hooks/chain-team-phases.sh` | requestable/on-demand; never session-start |
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Eloquent models, migrations, and persistence conventions
|
|
3
|
+
paths:
|
|
4
|
+
- "**/Models/**/*"
|
|
5
|
+
- "**/database/migrations/**/*"
|
|
6
|
+
- "**/database/factories/**/*"
|
|
7
|
+
- "**/database/seeders/**/*"
|
|
8
|
+
---
|
|
9
|
+
# Eloquent persistence
|
|
10
|
+
|
|
11
|
+
- Models stay **persistence-focused**: fillable/guarded, casts, relations, scopes, accessors already used by the repo.
|
|
12
|
+
- Prefer mass-assignment protection (`$fillable` / `$guarded`) consistent with neighbors; never `$guarded = []` casually on user-facing models.
|
|
13
|
+
- Migrations are the schema SoT; keep them additive and reversible when the repo expects `down()`.
|
|
14
|
+
- Factories/seeders for Feature tests — match existing factory patterns.
|
|
15
|
+
- Repository / query object interfaces **only when justified** (swap backends, heavy query seams) — default is Eloquent on the Action/Service.
|
|
16
|
+
|
|
17
|
+
## Forbidden
|
|
18
|
+
|
|
19
|
+
- Importing `Illuminate\Http\Request` / Form Requests into models.
|
|
20
|
+
- AuthZ role checks inside model boot hooks when Policies exist.
|
|
21
|
+
- Returning models directly from controllers when the repo uses API Resources.
|
|
22
|
+
- Raw SQL in controllers; prefer Eloquent/query builder in Actions or dedicated query classes.
|
|
23
|
+
|
|
24
|
+
## Testing
|
|
25
|
+
|
|
26
|
+
- Feature tests use `RefreshDatabase` / `DatabaseMigrations` as the repo does (SQLite in-memory preferred for dogfood/CI).
|
|
27
|
+
- Unit-test custom casts/scopes when non-trivial; otherwise Feature coverage is enough.
|
|
28
|
+
|
|
29
|
+
## Related
|
|
30
|
+
|
|
31
|
+
- Actions calling models: `actions-services`; HTTP mapping: `http-layer` + `form-requests`.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Laravel Events and Listeners
|
|
3
|
+
paths:
|
|
4
|
+
- "**/Events/**/*"
|
|
5
|
+
- "**/Listeners/**/*"
|
|
6
|
+
- "**/*Event.php"
|
|
7
|
+
- "**/*Listener.php"
|
|
8
|
+
---
|
|
9
|
+
# Events / Listeners
|
|
10
|
+
|
|
11
|
+
- Domain/application events signal that **something happened**; Listeners react (notify, project, enqueue).
|
|
12
|
+
- Dispatch from Actions/Services (`TodoCreated::dispatch($todo)`); keep event payloads small (IDs / models via SerializesModels).
|
|
13
|
+
- Prefer dedicated Listener classes over closures in `EventServiceProvider` when neighbors use classes.
|
|
14
|
+
- Queued listeners (`ShouldQueue`) for slow side effects; sync listeners for cheap in-process reactions.
|
|
15
|
+
- Discover listeners via attributes / provider registration matching the Laravel version + repo.
|
|
16
|
+
|
|
17
|
+
## Structure
|
|
18
|
+
|
|
19
|
+
- `app/Events/TodoCreated.php`, `app/Listeners/SendTodoCreatedNotification.php`.
|
|
20
|
+
- One listener ≈ one reaction; split when a listener grows multiple unrelated side effects.
|
|
21
|
+
|
|
22
|
+
## Testing
|
|
23
|
+
|
|
24
|
+
- `Event::fake()`; `Event::assertDispatched(TodoCreated::class)`.
|
|
25
|
+
- Feature tests may assert listener effects when not faked — match repo style.
|
|
26
|
+
|
|
27
|
+
## Forbidden
|
|
28
|
+
|
|
29
|
+
- Business rules that belong in Actions living only inside Listeners (harder to test/sync).
|
|
30
|
+
- Circular event storms (Listener dispatches the same event without guard).
|
|
31
|
+
- Using Events as a mandatory hexagonal port layer — optional async pattern only.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Laravel Form Request validation at the HTTP edge
|
|
3
|
+
paths:
|
|
4
|
+
- "**/Http/Requests/**/*"
|
|
5
|
+
- "**/*Request.php"
|
|
6
|
+
---
|
|
7
|
+
# Form Requests
|
|
8
|
+
|
|
9
|
+
- Validate untrusted input in **Form Requests** (or the repo's established validator) — not ad-hoc `$request->validate` sprinkled in Actions when neighbors use Form Requests.
|
|
10
|
+
- `rules()` / `messages()` / `attributes()` stay at the HTTP edge; Actions receive already-validated arrays or typed props — **not** the Form Request object when avoidable.
|
|
11
|
+
- Prefer `authorize()` on the Form Request **or** Policy/`$this->authorize` in the controller — pick the pattern neighbors use; do not double-authorize inconsistently.
|
|
12
|
+
- Keep rules focused: required/types/uniqueness; complex cross-field domain rules may live in Action after validation basics pass.
|
|
13
|
+
- Use `$request->validated()` (or `safe()->only(...)`) — never trust raw `$request->all()` into persistence.
|
|
14
|
+
|
|
15
|
+
## Structure
|
|
16
|
+
|
|
17
|
+
- `app/Http/Requests/<Feature>/StoreXRequest.php` (or flat `StoreXRequest`) matching repo nesting.
|
|
18
|
+
- Shared rule fragments: extract only after Rule of Three; prefer Laravel Rule objects already in the repo.
|
|
19
|
+
|
|
20
|
+
## Testing
|
|
21
|
+
|
|
22
|
+
- Feature tests assert 422 validation envelopes for missing/invalid fields.
|
|
23
|
+
- Do not unit-test every rule string in isolation unless the repo already does.
|
|
24
|
+
|
|
25
|
+
## Forbidden
|
|
26
|
+
|
|
27
|
+
- Importing Form Requests into Models or Jobs as a validation substitute.
|
|
28
|
+
- Putting Eloquent queries that belong in Actions into Form Request `prepareForValidation` without need.
|
|
29
|
+
- Inventing a custom validation framework when Laravel Form Requests suffice.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Thin Laravel controllers, API Resources, and HTTP edge mapping
|
|
3
|
+
paths:
|
|
4
|
+
- "**/Http/Controllers/**/*"
|
|
5
|
+
- "**/Http/Resources/**/*"
|
|
6
|
+
- "**/Http/Middleware/**/*"
|
|
7
|
+
- "**/*Controller.php"
|
|
8
|
+
---
|
|
9
|
+
# HTTP layer (Laravel)
|
|
10
|
+
|
|
11
|
+
- Controllers are **thin**: authorize → validate (Form Request) → call one Action/Service → return Resource / response.
|
|
12
|
+
- Prefer invokable or resource controllers matching existing repo style; do not invent a new controller taxonomy mid-feature.
|
|
13
|
+
- Map status + body at the edge; use API Resources (or repo-equivalent) for JSON — do not return Eloquent models raw when neighbors use Resources.
|
|
14
|
+
- Keep business orchestration in Actions/Services — not private methods that grow into a second service layer inside the controller.
|
|
15
|
+
- Middleware owns cross-cutting HTTP concerns (auth, throttle, locale) already used by the repo.
|
|
16
|
+
|
|
17
|
+
## Resilience
|
|
18
|
+
|
|
19
|
+
- Side-effect endpoints: accept/propagate an **idempotency key** when the domain already uses one; document if intentionally omitted.
|
|
20
|
+
- Soft size hint: split when a controller grows past ~200 LOC or owns more than one use case.
|
|
21
|
+
|
|
22
|
+
## Testing
|
|
23
|
+
|
|
24
|
+
- Prefer Feature tests through the HTTP kernel (`tests/Feature`) with SQLite / repo test DB.
|
|
25
|
+
- Unit-test Actions separately when logic is non-trivial; mock Eloquent only if the repo already does.
|
|
26
|
+
|
|
27
|
+
## Forbidden
|
|
28
|
+
|
|
29
|
+
- Business SQL / multi-model workflows in controllers.
|
|
30
|
+
- Skipping Form Requests when neighbors validate via Form Requests.
|
|
31
|
+
- Ad-hoc role/`if ($user->isAdmin)` AuthZ when a Policy exists or should.
|
|
32
|
+
- Blade/Livewire/Filament concerns — **out of this preset**.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Laravel queued Jobs conventions
|
|
3
|
+
paths:
|
|
4
|
+
- "**/Jobs/**/*"
|
|
5
|
+
- "**/*Job.php"
|
|
6
|
+
---
|
|
7
|
+
# Jobs / queues
|
|
8
|
+
|
|
9
|
+
- Use Jobs for **deferred / async** work (email, fan-out, slow I/O) — not as a substitute for a clear sync Action.
|
|
10
|
+
- Dispatch from Actions/Services after the sync write succeeds (or inside the same transaction only when the repo already uses `afterCommit`).
|
|
11
|
+
- Implement `ShouldQueue` when neighbors queue; keep `handle()` focused.
|
|
12
|
+
- Configure `$tries`, `$backoff`, `$timeout` only when the job needs them or neighbors set them.
|
|
13
|
+
- Fail closed: don't swallow exceptions; use failed-job handling the repo already has.
|
|
14
|
+
|
|
15
|
+
## Serialization / DI (queued jobs)
|
|
16
|
+
|
|
17
|
+
Queued Job **constructors and public properties are serialized** onto the queue. Put only **serializable payloads** there:
|
|
18
|
+
|
|
19
|
+
- Primitives, IDs, arrays of scalars, DTOs that serialize cleanly.
|
|
20
|
+
- Eloquent models only when using `SerializesModels` carefully (prefer IDs when the model may change or be large).
|
|
21
|
+
|
|
22
|
+
**Resolve services / repositories / collaborators via `handle()` method injection** (or container resolve inside `handle`). Do **not** inject app services, repositories, mailers, HTTP clients, or other container collaborators through the queued Job constructor — they are not reliable queue payloads.
|
|
23
|
+
|
|
24
|
+
Sync-only jobs that never implement `ShouldQueue` may use constructor DI if that matches neighbors; prefer the same `handle()` injection pattern for consistency.
|
|
25
|
+
|
|
26
|
+
## Structure
|
|
27
|
+
|
|
28
|
+
- `app/Jobs/SendTodoCreatedNotification.php` (verb + subject naming).
|
|
29
|
+
- Prefer serializing models via `SerializesModels` as Laravel defaults when models are the payload.
|
|
30
|
+
|
|
31
|
+
## Testing
|
|
32
|
+
|
|
33
|
+
- `Bus::fake()` / `Queue::fake()` in Feature tests; assert `Bus::assertDispatched(…)`.
|
|
34
|
+
- Optionally `Bus::dispatchSync` in integration when asserting side effects end-to-end.
|
|
35
|
+
|
|
36
|
+
## Forbidden
|
|
37
|
+
|
|
38
|
+
- Injecting services / repositories / other collaborators via the queued Job constructor.
|
|
39
|
+
- HTTP Request types inside Jobs.
|
|
40
|
+
- Huge Jobs that re-implement the whole Action — pass IDs / minimal payloads.
|
|
41
|
+
- Requiring external brokers in dogfood when `sync` / `array` / `database` driver suffices.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Laravel Policies and authorization gates
|
|
3
|
+
paths:
|
|
4
|
+
- "**/Policies/**/*"
|
|
5
|
+
- "**/*Policy.php"
|
|
6
|
+
---
|
|
7
|
+
# Policies / authorization
|
|
8
|
+
|
|
9
|
+
- Authorize via **Policies** / `Gate` — not scattered `$user->role === …` checks in controllers/Actions.
|
|
10
|
+
- Controllers: `$this->authorize('update', $todo)` or Form Request `authorize()` — match neighbors.
|
|
11
|
+
- Policy methods return `bool` / `Response`; keep them focused on AuthZ (ownership, roles, abilities).
|
|
12
|
+
- Register policies via auto-discovery or `AuthServiceProvider` as the Laravel version expects.
|
|
13
|
+
- Guest / unauthenticated: return false or use `Gate::before` only if the repo already uses that pattern.
|
|
14
|
+
|
|
15
|
+
## Structure
|
|
16
|
+
|
|
17
|
+
- `app/Policies/TodoPolicy.php` with `view`, `create`, `update`, `delete` (or repo verbs).
|
|
18
|
+
- Prefer model-type hints (`User $user, Todo $todo`); use class-string abilities for create when needed.
|
|
19
|
+
|
|
20
|
+
## Testing
|
|
21
|
+
|
|
22
|
+
- Feature tests assert **403** on denied actions and **201/200** when allowed.
|
|
23
|
+
- Use actingAs / Sanctum helpers the repo already uses.
|
|
24
|
+
|
|
25
|
+
## Forbidden
|
|
26
|
+
|
|
27
|
+
- Duplicating the same role check in Controller + Action + Model.
|
|
28
|
+
- Putting business validation (field formats) into Policies — that belongs in Form Requests.
|
|
29
|
+
- Inventing a custom ACL framework when Laravel Policies suffice.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Laravel routes (api.php / web.php) and middleware wiring
|
|
3
|
+
paths:
|
|
4
|
+
- "**/routes/**/*"
|
|
5
|
+
- "**/bootstrap/app.php"
|
|
6
|
+
---
|
|
7
|
+
# Routes (API / web)
|
|
8
|
+
|
|
9
|
+
- Prefer `routes/api.php` for JSON APIs and `routes/web.php` for session/cookie web — follow the target Laravel version's routing layout (`bootstrap/app.php` on Laravel 11+).
|
|
10
|
+
- Route → controller method (or invokable); keep closures only for trivial health/ping already used by the repo.
|
|
11
|
+
- Apply auth / throttle / middleware groups at the **route** layer (`auth:sanctum`, `auth:api`, etc. as already configured).
|
|
12
|
+
- Name routes when neighbors name them (`->name('todos.store')`); keep URI style consistent (`/api/todos` vs versioned `/api/v1/...`).
|
|
13
|
+
- Resource routes (`Route::apiResource`) OK when CRUD matches; otherwise explicit verbs.
|
|
14
|
+
|
|
15
|
+
## Structure
|
|
16
|
+
|
|
17
|
+
- Feature-local route files only if the repo already splits (`routes/api/todos.php` required from `api.php`).
|
|
18
|
+
- Do not register business logic in route files.
|
|
19
|
+
|
|
20
|
+
## Testing
|
|
21
|
+
|
|
22
|
+
- Feature tests hit named URIs or `route('…')` helpers matching production paths.
|
|
23
|
+
- Assert middleware (401/403) when AuthZ is in scope.
|
|
24
|
+
|
|
25
|
+
## Forbidden
|
|
26
|
+
|
|
27
|
+
- Fat closures with Eloquent / Actions inlined in `routes/*.php`.
|
|
28
|
+
- Mixing Blade view routes into API delivery tasks without AC.
|
|
29
|
+
- Requiring Next/Playwright route conventions — Laravel only.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Laravel Actions and Services for application logic
|
|
3
|
+
paths:
|
|
4
|
+
- "**/Actions/**/*"
|
|
5
|
+
- "**/Services/**/*"
|
|
6
|
+
---
|
|
7
|
+
# Actions / Services
|
|
8
|
+
|
|
9
|
+
- Prefer **single-purpose Actions** (`CreateTodo`, `CompleteTodo`) for one use case; **Services** for multi-step orchestration shared across entry points.
|
|
10
|
+
- Accept primitives / arrays / domain value objects — **not** Form Requests or `Request` objects.
|
|
11
|
+
- Persist via Eloquent (or a justified repository); dispatch Jobs/Events for side effects.
|
|
12
|
+
- Keep methods small and named after the business verb; avoid god `TodoService` with every CRUD method unless the repo already uses that shape.
|
|
13
|
+
- Transaction boundaries: `DB::transaction` in the Action/Service when multiple writes must commit together.
|
|
14
|
+
|
|
15
|
+
## Structure
|
|
16
|
+
|
|
17
|
+
- `app/Actions/<Feature>/CreateX.php` or flat `app/Actions/CreateX.php` — match neighbors.
|
|
18
|
+
- Invokable `__invoke` or explicit `handle` / `execute` — follow existing style; do not invent a new Action base class mid-feature.
|
|
19
|
+
- Repository interfaces only when multiple backends or heavy test seams justify them (fold of hexagonal ports — not required).
|
|
20
|
+
|
|
21
|
+
## Testing
|
|
22
|
+
|
|
23
|
+
- Unit-test Actions with fakes/mocks when pure enough; Feature tests cover HTTP → Action → DB happy path.
|
|
24
|
+
- Assert Job/Event dispatch with `Bus::fake` / `Event::fake` when side effects are in scope.
|
|
25
|
+
|
|
26
|
+
## Forbidden
|
|
27
|
+
|
|
28
|
+
- HTTP status codes / Resources inside Actions.
|
|
29
|
+
- Fat Actions that also validate Form Request rules (validation stays at HTTP edge).
|
|
30
|
+
- Skipping Actions to put business SQL directly in controllers “for speed”.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Laravel layer boundaries (HTTP, Actions/Services, Eloquent, Policies, Providers)
|
|
3
|
+
---
|
|
4
|
+
# Границы слоёв (Laravel)
|
|
5
|
+
|
|
6
|
+
- **HTTP** (`app/Http/**`, Resources):
|
|
7
|
+
- Может: Controllers, Form Requests, API Resources, Middleware; map to Actions/Services; authorize via Policies.
|
|
8
|
+
- Не должен: fat business SQL; multi-step orchestration; queue side effects without Jobs/Events.
|
|
9
|
+
- **Actions / Services** (`app/Actions/**`, `app/Services/**`):
|
|
10
|
+
- Может: single-purpose Actions; multi-step Services; Eloquent / domain helpers; dispatch Jobs/Events.
|
|
11
|
+
- Не должен: `Request` / Form Request types; HTTP status mapping; controller concerns.
|
|
12
|
+
- **Eloquent** (`app/Models/**`, migrations):
|
|
13
|
+
- Может: persistence-focused models, casts, relations, scopes.
|
|
14
|
+
- Не должен: request/HTTP leakage; AuthZ role checks that belong in Policies.
|
|
15
|
+
- **Policies** (`app/Policies/**`): AuthZ via Policies / gates — not ad-hoc role checks in controllers.
|
|
16
|
+
- **Providers** (`app/Providers/**`): bindings/singletons only — no business rules.
|
|
17
|
+
- **Jobs / Events / Listeners**: deferred / async side effects — not a substitute for clear sync Actions.
|
|
18
|
+
|
|
19
|
+
# Зависимости
|
|
20
|
+
|
|
21
|
+
- Направление: **HTTP → Actions/Services → Eloquent**; Policies at HTTP edge; Providers wire the container.
|
|
22
|
+
- Cross-module access — public APIs / facades only (`module-public-api`); no deep sibling imports.
|
|
23
|
+
|
|
24
|
+
# Edit bundles (load on matching paths)
|
|
25
|
+
|
|
26
|
+
- `app/Http/**`, Resources → `http-layer` + `form-requests` + `architecture-boundaries`
|
|
27
|
+
- `routes/**` → `routes-api`; `app/Models/**`, migrations → `eloquent-persistence`
|
|
28
|
+
- `app/Actions/**`, `app/Services/**` → `actions-services`; `app/Providers/**` → `service-providers`
|
|
29
|
+
- `app/Policies/**` → `policies-authorization`; `app/Jobs/**` → `jobs-queues`
|
|
30
|
+
- `app/Events/**`, `app/Listeners/**` → `events-listeners`; after `*.php` → `post-change-test` (+ `php-tooling`)
|
|
31
|
+
|
|
32
|
+
# Требование к агенту
|
|
33
|
+
|
|
34
|
+
- Класть файлы в правильный слой; thin controllers; DI wiring только в Providers.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Optional modular domain folders note (flat app/ remains default)
|
|
3
|
+
paths:
|
|
4
|
+
- "**/Domain/**/*"
|
|
5
|
+
- "**/domain/**/*"
|
|
6
|
+
---
|
|
7
|
+
# Domain layer (optional modular note)
|
|
8
|
+
|
|
9
|
+
**Default for this preset:** flat Laravel `app/` (Controllers, Actions, Models, …). Do **not** invent `app/Domain/**` for every feature.
|
|
10
|
+
|
|
11
|
+
When the **target repo already** uses modular / domain folders (`app/Domain/<Module>/`, modules packages, etc.):
|
|
12
|
+
|
|
13
|
+
- Keep module-local Models/Actions/Policies cohesive under that module's public surface.
|
|
14
|
+
- Cross-module access via public APIs only (`module-public-api`) — no deep imports of another module's internals.
|
|
15
|
+
- Still prefer Laravel primitives (Form Requests at HTTP edge, Eloquent models, Policies) inside the module.
|
|
16
|
+
|
|
17
|
+
## Thin alias rationale
|
|
18
|
+
|
|
19
|
+
This stem is intentionally **thin**: v1 locks flat `app/` as default; modular layout is an optional documented variant only.
|
|
20
|
+
|
|
21
|
+
## Forbidden
|
|
22
|
+
|
|
23
|
+
- Mandating hexagonal `Domain/` / ports purity in Laravel consumer apps.
|
|
24
|
+
- Moving HTTP types into a “domain” folder to simulate hexagonal without need.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: End-to-end delivery checklist for Laravel features
|
|
3
|
+
paths:
|
|
4
|
+
- "**/*.php"
|
|
5
|
+
- "**/composer.json"
|
|
6
|
+
---
|
|
7
|
+
<!-- shared-core: architecture/feature-delivery-workflow.md -->
|
|
8
|
+
|
|
9
|
+
# Feature delivery (Laravel)
|
|
10
|
+
|
|
11
|
+
Order of work:
|
|
12
|
+
|
|
13
|
+
1. **Routes** — `routes/api.php` / `web.php` (`routes-api`).
|
|
14
|
+
2. **Form Request + Policy** — validation + AuthZ (`form-requests`, `policies-authorization`).
|
|
15
|
+
3. **Action / Service** — application logic (`actions-services`).
|
|
16
|
+
4. **Eloquent** — model + migration/factory as needed (`eloquent-persistence`).
|
|
17
|
+
5. **Controller + Resource** — thin HTTP edge (`http-layer`).
|
|
18
|
+
6. **Optional async** — Job / Event / Listener (`jobs-queues`, `events-listeners`).
|
|
19
|
+
7. **Provider bindings** — only if new interfaces/bindings (`service-providers`).
|
|
20
|
+
8. **Tests** — Feature (HTTP/DB) + Unit (Actions) as valuable.
|
|
21
|
+
9. **Gate** — `post-change-test` (+ `php-tooling`) → `php artisan test` / `composer test`.
|
|
22
|
+
|
|
23
|
+
```mermaid
|
|
24
|
+
flowchart LR
|
|
25
|
+
R[Routes] --> C[Controller]
|
|
26
|
+
C --> FR[Form Request]
|
|
27
|
+
C --> P[Policy]
|
|
28
|
+
C --> A[Action/Service]
|
|
29
|
+
A --> M[Eloquent]
|
|
30
|
+
A --> J[Job/Event]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Matrix
|
|
34
|
+
|
|
35
|
+
| Path | Rules |
|
|
36
|
+
|------|-------|
|
|
37
|
+
| `app/Http/**`, Resources | `http-layer`, `form-requests`, `architecture-boundaries` |
|
|
38
|
+
| `routes/**` | `routes-api` |
|
|
39
|
+
| `app/Models/**`, migrations | `eloquent-persistence` |
|
|
40
|
+
| `app/Actions/**`, `app/Services/**` | `actions-services` |
|
|
41
|
+
| `app/Providers/**` | `service-providers` |
|
|
42
|
+
| `app/Policies/**` | `policies-authorization` |
|
|
43
|
+
| `app/Jobs/**` | `jobs-queues` |
|
|
44
|
+
| `app/Events/**`, `app/Listeners/**` | `events-listeners` |
|
|
45
|
+
| After `*.php` edits | `post-change-test` (+ `php-tooling`) |
|
|
46
|
+
|
|
47
|
+
## Anti-patterns
|
|
48
|
+
|
|
49
|
+
- Fat controllers; Form Requests in Models; AuthZ via ad-hoc roles; skipping Feature tests for API writes.
|
|
50
|
+
- Mandating hexagonal ports/adapters folders in a Laravel-first app.
|
|
51
|
+
- Load `design-guidance` when assessing structure, smells, or pattern fit.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Public module API and package boundaries for Laravel apps
|
|
3
|
+
paths:
|
|
4
|
+
- "**/composer.json"
|
|
5
|
+
- "**/app/**/*.php"
|
|
6
|
+
---
|
|
7
|
+
# Module public API
|
|
8
|
+
|
|
9
|
+
- Published types under a package/module's public namespaces are a compatibility surface — change carefully; prefer additive APIs.
|
|
10
|
+
- Prefer narrow exports; expose only what other modules/features need.
|
|
11
|
+
- Do not deep-import another module's internal namespaces; depend on its published API / facade only.
|
|
12
|
+
- Document breaking PHP API changes in CHANGELOG when the repo publishes libraries.
|
|
13
|
+
|
|
14
|
+
## Flat app/ default / modular variant
|
|
15
|
+
|
|
16
|
+
- **Default:** one Laravel app with flat `app/` namespaces (see `dogfood/php-laravel`).
|
|
17
|
+
- **Modular:** when the repo already uses `app/Domain/<Module>/` or Composer path packages, each module exposes a narrow public API; other modules depend inward only.
|
|
18
|
+
- Do not invent multi-package scaffolding unless the repo already uses it.
|
|
19
|
+
|
|
20
|
+
## composer.json
|
|
21
|
+
|
|
22
|
+
- Package name, PHP/Laravel versions, and PSR-4 map are SoT for toolchain/autoload.
|
|
23
|
+
- Prefer minimal direct deps; pin via committed `composer.lock` the repo already uses.
|
|
24
|
+
- Dev-only tools (PHPUnit, Pint, PHPStan) stay in `require-dev`.
|
|
25
|
+
|
|
26
|
+
## Cross-feature
|
|
27
|
+
|
|
28
|
+
- Features communicate via Actions/Services public methods or small facades — not by importing sibling Feature private helpers.
|
|
29
|
+
- Form Request / Resource DTOs stay local to the HTTP edge of that feature.
|