@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,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Code quality and light refactoring for Laravel backends
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- shared-core: quality/code-quality-and-refactoring.md -->
|
|
7
|
+
|
|
8
|
+
# Поддержка существующего стиля
|
|
9
|
+
|
|
10
|
+
- Следовать существующим паттернам (имена, структура, типизация / DI / error handling); минимизировать стилистический шум (лишний format/rename).
|
|
11
|
+
- Перед новым решением: искать аналог и **повторять подход**; проверять дизайн‑систему / UI‑пакеты; ходить только через **public API** (deep‑импорты — повод для рефакторинга).
|
|
12
|
+
|
|
13
|
+
# Принципы
|
|
14
|
+
|
|
15
|
+
- **KISS:** самое простое изменение в паттернах репозитория.
|
|
16
|
+
- **DRY + Rule of Three:** общее — только после 3-го повторения (ошибочная абстракция дороже дублирования).
|
|
17
|
+
- **YAGNI:** без API, флагов, слоёв «на будущее» без текущего требования.
|
|
18
|
+
- **SOLID:** S — один повод менять; O — композиция/новые реализации; L — контракт подтипа; I — узкие порты; D — абстракции (порты), детали в адаптерах стека.
|
|
19
|
+
- **CUPID:** Composable; Unix philosophy (одна ответственность); Predictable; Idiomatic (репо); Domain-based.
|
|
20
|
+
- **Composition over inheritance;** Law of Demeter — без цепочек `a.b.c.d`; через public API / facade.
|
|
21
|
+
|
|
22
|
+
# Рефакторинг при изменениях
|
|
23
|
+
|
|
24
|
+
- Лёгкий refactor OK, если меньше дублирования, выше читаемость, без ломки публичных контрактов.
|
|
25
|
+
- Примеры: общая утилита/хук/mapper/use case; сузить unsafe-типы; разбить крупный модуль; токены вместо «магии»; deep‑импорт → public API.
|
|
26
|
+
- Не делать «большой» рефакторинг на точечной задаче (структура/публичные имена без запроса). Крупное — минимальными шагами; код остаётся собираемым.
|
|
27
|
+
|
|
28
|
+
# Требование к агенту
|
|
29
|
+
|
|
30
|
+
- **Boy scout:** оставлять модуль немного лучше; не жертвовать архитектурой и слоями ради краткости.
|
|
31
|
+
|
|
32
|
+
## Agent discipline (anti-sycophancy)
|
|
33
|
+
|
|
34
|
+
Essentials below. Full procedural set (~17 rules) → load **`anti-sycophancy-discipline`**.
|
|
35
|
+
|
|
36
|
+
- Unverifiable third-party API → mark `// VERIFY: lib.symbol @ version` (or stack equivalent); never invent signatures.
|
|
37
|
+
- Before «is this correct?» — ≥3 failure modes (empty, boundary, concurrency/state) or name what you could not check.
|
|
38
|
+
- Refactor without tests → propose characterization test; if declined, label `UNTESTED`.
|
|
39
|
+
- Comments = WHY only when non-obvious; ban self-referential «added for issue Y».
|
|
40
|
+
- Urgency/authority: name the trade-off once, then comply — no apology loops.
|
|
41
|
+
- Match verification to risk; report by what was **verified**, not attempted.
|
|
42
|
+
|
|
43
|
+
Style enforcement (formatter / linter / post-change gate) lives in the **stack toolchain** — see each adapter’s **Stack notes**.
|
|
44
|
+
|
|
45
|
+
> Stack-specific lint gates, примеры и toolchain — в секции **Stack notes** адаптера пресета.
|
|
46
|
+
|
|
47
|
+
## Stack notes
|
|
48
|
+
|
|
49
|
+
- **No UI layer in this preset** — ignore shared-core bullets about дизайн‑система / UI‑пакеты / CSS‑токены; apply public-API and boy-scout rules to Laravel Actions/Models/Providers instead.
|
|
50
|
+
- Prefer thin controllers + single-purpose Actions; Services for multi-step orchestration — avoid fat controllers and god Services.
|
|
51
|
+
- Repository interfaces **only when justified** (multiple backends / test seams) — not required for every Eloquent model.
|
|
52
|
+
- Prefer Laravel exceptions + Form Request / Policy mapping at the HTTP edge; do not leak raw persistence exceptions as HTTP bodies.
|
|
53
|
+
- Post-change gate: **`post-change-test.mdc`** + **`php-tooling.mdc`** (`php artisan test` / `composer test` — not yarn lint / xcodebuild / Playwright).
|
|
54
|
+
- Style/static analysis: use **repository/CI** Pint/PHPStan/Psalm — do not invent a parallel bible in rules.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Code review checklist for Laravel merge requests
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- shared-core: review/code-review-mr.md -->
|
|
7
|
+
|
|
8
|
+
# Code review merge requests
|
|
9
|
+
|
|
10
|
+
On-demand rule for review flows. **Procedure and output format:** skill `code-review`.
|
|
11
|
+
|
|
12
|
+
## When to load
|
|
13
|
+
|
|
14
|
+
- User asks for review/MR/diff
|
|
15
|
+
- Pipeline step `code-reviewer`
|
|
16
|
+
- Platform automated review (e.g. BUGBOT) when present
|
|
17
|
+
|
|
18
|
+
## Checklist references (abstract)
|
|
19
|
+
|
|
20
|
+
- Architecture layers and stack core rules
|
|
21
|
+
- Public imports / module boundaries
|
|
22
|
+
- UI conventions of the stack
|
|
23
|
+
- Unit and e2e/UI test conventions
|
|
24
|
+
- Post-change lint/build gate before final report
|
|
25
|
+
- Design smells **in MR diff scope** — load `design-guidance`; не разворачивать полный каталог Fowler вне диффа
|
|
26
|
+
- Pattern name (GoF) — только если репозиторий уже использует эту форму или match минимален
|
|
27
|
+
- Principles (KISS / DRY+Ro3 / YAGNI / SOLID / CUPID) — через always-on `code-quality-and-refactoring`, не дублировать эссе в review
|
|
28
|
+
|
|
29
|
+
Concrete rule stems — in **Stack notes**.
|
|
30
|
+
|
|
31
|
+
## Constraints
|
|
32
|
+
|
|
33
|
+
- Focus on MR diff, not the whole repo.
|
|
34
|
+
- Use local `git diff` — do not invent hosting metadata.
|
|
35
|
+
- Boy scout rule: suggest fixes feasible within the MR scope.
|
|
36
|
+
- No «большие рефакторинги» without an explicit request (`code-quality-and-refactoring`).
|
|
37
|
+
|
|
38
|
+
## Output contract
|
|
39
|
+
|
|
40
|
+
Procedure details live in skill `code-review`. Required shape:
|
|
41
|
+
|
|
42
|
+
- Each finding cites **`path:line`**, the problem, impact, and a concrete fix direction.
|
|
43
|
+
- Rank by severity: **`blocker` | `important` | `nit`** (list blocker → nit).
|
|
44
|
+
- Vague («looks risky») is not a finding — cite evidence or ask for surrounding file context.
|
|
45
|
+
- End with a verdict on its own line: **`Safe to merge | needs changes | reject`**.
|
|
46
|
+
|
|
47
|
+
## Stack notes
|
|
48
|
+
|
|
49
|
+
- Laravel boundaries: `architecture-boundaries` — HTTP → Actions/Services → Eloquent; Policies at the edge; Providers wire only.
|
|
50
|
+
- HTTP edge: `http-layer`, `form-requests`, `routes-api` — thin Controllers, Form Request validation, API Resources.
|
|
51
|
+
- Application + persistence: `actions-services`, `eloquent-persistence`, `policies-authorization`, `service-providers`.
|
|
52
|
+
- Paths: `app/Http/**`, `app/Actions|Services/**`, `app/Models/**`, `app/Policies/**`, `app/Providers/**`, `routes/**`.
|
|
53
|
+
- Tests: `tests-unit` (Actions/pure PHP); `tests-integration` (Feature HTTP/DB); post-change: `post-change-test` / `php-tooling`.
|
|
54
|
+
- Security: secrets/PII/`security-php`; AuthZ via Policies — not ad-hoc role checks in Controllers/Models.
|
|
55
|
+
- Never require Playwright, XCUITest, `lint:js`, or `xcodebuild` for Laravel MRs.
|
|
56
|
+
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Design smells (Fowler) and curated GoF patterns for agents. Load when assessing structure, smells, or pattern fit.
|
|
3
|
+
globs:
|
|
4
|
+
- "**/*.php"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- shared-core: quality/design-guidance.md -->
|
|
9
|
+
|
|
10
|
+
# Design guidance (smells & patterns)
|
|
11
|
+
|
|
12
|
+
Словарь **code smells** (Fowler) и **design patterns** (GoF) для агентов при implement / review / debug.
|
|
13
|
+
|
|
14
|
+
Применять только в scope задачи или MR. Лёгкий refactor — да; «большой» rewrite без явного запроса — нет.
|
|
15
|
+
|
|
16
|
+
Называть паттерн **только если** репозиторий уже так делает или это минимальный match. Иначе — extract/split/move без ярлыка GoF.
|
|
17
|
+
|
|
18
|
+
Не заменяет always-on Principles в `code-quality-and-refactoring` (KISS, DRY + Rule of Three, YAGNI, SOLID, CUPID, composition, Demeter).
|
|
19
|
+
|
|
20
|
+
## When to load
|
|
21
|
+
|
|
22
|
+
- **Feature delivery / implement** — оценка структуры модулей, границ и дублирования.
|
|
23
|
+
- **Code review** — smells и pattern fit **в диффе MR**, не по всему репо.
|
|
24
|
+
- **Debug** — root-cause похож на wrong abstraction, Feature Envy, Message Chains, Shotgun Surgery.
|
|
25
|
+
- **Light refactor only** — улучшения в рамках boy-scout / MR scope; не расширять задачу ради каталога.
|
|
26
|
+
|
|
27
|
+
Агенты и skills подгружают stem по one-liner wiring — не копировать этот каталог в промпт агента.
|
|
28
|
+
|
|
29
|
+
## How to use (agent rules of thumb)
|
|
30
|
+
|
|
31
|
+
1. Сначала сверить с Principles (always-on): проще ли решение, нет ли ранней абстракции, соблюдён ли public API.
|
|
32
|
+
2. Затем отметить smells **в изменённых файлах** задачи/MR; предложить fix только если он укладывается в light refactor.
|
|
33
|
+
3. Паттерн GoF — опциональный ярлык после того, как структура уже ясна; не начинать дизайн с выбора паттерна.
|
|
34
|
+
4. Если smell и паттерн конфликтуют с границами слоёв стека — побеждают stack boundaries и existing repo patterns.
|
|
35
|
+
5. Не требовать переименования «под GoF», если поведение уже корректно и читаемо.
|
|
36
|
+
|
|
37
|
+
## Code smells (Fowler, curated ≤12)
|
|
38
|
+
|
|
39
|
+
Таблица: smell → detect hint → fix hint (одна линия каждый). Без механических меню рефакторинга.
|
|
40
|
+
|
|
41
|
+
| # | Smell | Detect | Fix hint |
|
|
42
|
+
|---|-------|--------|----------|
|
|
43
|
+
| 1 | Duplicate Code | одинаковая логика в ≥2 местах | dedupe после Rule of Three |
|
|
44
|
+
| 2 | Long Method / Long Module | единица делает слишком много | extract в рамках scope; без big rewrite |
|
|
45
|
+
| 3 | Feature Envy | метод чаще трогает чужие данные, чем свои | сдвинуть логику к данным / public API |
|
|
46
|
+
| 4 | Data Clumps | одни и те же группы аргументов кочуют вместе | сгруппировать в type / value object |
|
|
47
|
+
| 5 | Primitive Obsession | сырые string/int вместо доменных понятий | typed ids / value objects при нужде домена |
|
|
48
|
+
| 6 | Speculative Generality | неиспользуемые хуки, флаги, абстракции «на будущее» | удалить (YAGNI) |
|
|
49
|
+
| 7 | Message Chains | цепочки `a.b.c.d` | Demeter; facade / public API модуля |
|
|
50
|
+
| 8 | Middle Man | класс почти только прокидывает вызовы | убрать pass-through **или** оставить как boundary |
|
|
51
|
+
| 9 | Divergent Change | один модуль меняется по разным причинам | split по поводам изменения |
|
|
52
|
+
| 10 | Shotgun Surgery | одно смысловое изменение разъезжается по многим файлам | consolidate ответственность |
|
|
53
|
+
| 11 | Inappropriate Intimacy | доступ к чужим internals / private деталям | только public API / ports / facades |
|
|
54
|
+
| 12 | Refused Bequest / Parallel Inheritance | подтип игнорирует базу; зеркальные иерархии классов | composition; не плодить параллельные деревья |
|
|
55
|
+
|
|
56
|
+
**Skip Fowler (не в core):** Lazy Class, Incomplete Library Class, Comments-as-smell dogma, полный каталог 70+, пошаговые recipe-меню.
|
|
57
|
+
|
|
58
|
+
Приоритет при конфликте smells: Inappropriate Intimacy и Message Chains (границы модулей) > Duplicate Code (после Rule of Three) > Long Method внутри уже правильного модуля.
|
|
59
|
+
|
|
60
|
+
## Design patterns (GoF, curated ≤8)
|
|
61
|
+
|
|
62
|
+
Suggest only when repo already uses the shape or the match is minimal. Prefer extract-function over naming Strategy ради ярлыка.
|
|
63
|
+
|
|
64
|
+
Паттерны ниже — **разрешённый минимум** для агентов; остальной GoF по умолчанию в Skip.
|
|
65
|
+
|
|
66
|
+
| Pattern | When to suggest | Anti-trigger |
|
|
67
|
+
|---------|-----------------|--------------|
|
|
68
|
+
| Strategy | взаимозаменяемые алгоритмы уже (или явно скоро) выбираются политикой | один алгоритм без ветвления политики |
|
|
69
|
+
| Adapter | обернуть внешний / чужой API под локальный port | лишняя обёртка вокруг своего же API |
|
|
70
|
+
| Facade | упростить multi-step subsystem за public API | facade превращается в god-object |
|
|
71
|
+
| Factory Method | полиморфное создание уже принято в стиле репо | factory на каждый тривиальный `new` |
|
|
72
|
+
| Decorator | аддитивное поведение без взрыва subclass-иерархий | decorator «для слоёв» без реальной нужды |
|
|
73
|
+
| Observer | events / subscriptions уже есть в архитектуре | самодельный pub/sub без прецедента в репо |
|
|
74
|
+
| Template Method | общий algorithm skeleton + вариативные hooks | наследование ради пары отличающихся строк |
|
|
75
|
+
| Composite | дерево однородных узлов (UI/domain), как уже в репо | Composite на плоский список без иерархии |
|
|
76
|
+
|
|
77
|
+
Если сомневаешься между двумя паттернами — выбери более простой extract/compose без имени; ярлык можно добавить на review, если репо уже так говорит.
|
|
78
|
+
|
|
79
|
+
## Skip / avoid by default
|
|
80
|
+
|
|
81
|
+
| Catalog | Skip |
|
|
82
|
+
|---------|------|
|
|
83
|
+
| GoF | Singleton, Abstract Factory, Flyweight, Memento, Interpreter, Visitor, Bridge, Prototype |
|
|
84
|
+
| GoF (conditional) | Command, Chain of Responsibility, State — упоминать **только если** репо уже использует |
|
|
85
|
+
| Fowler | всё сверх 12 smells выше |
|
|
86
|
+
| DDD | Aggregates, bounded-context maps, event sourcing, CQRS — **не в core** |
|
|
87
|
+
| DDD (pointer) | ubiquitous language anti-pattern — расширять в `feature-delivery-workflow`, не здесь |
|
|
88
|
+
| GRASP | список Larman как отдельные правила — skip (перекрывается SOLID/CUPID) |
|
|
89
|
+
| Clean Code dogma | жёсткие caps на строки функции / «ровно один assert» — skip |
|
|
90
|
+
|
|
91
|
+
Не вводить второй stem (`refactoring-smells` / `design-patterns-for-agents`) — один каталог: `design-guidance`.
|
|
92
|
+
|
|
93
|
+
## Out of scope for this stem
|
|
94
|
+
|
|
95
|
+
- Полный GoF (23) и полный Fowler catalog.
|
|
96
|
+
- Stack-specific рецепты (пути модулей, lint-команды) — только в **Stack notes** адаптера.
|
|
97
|
+
- Security, a11y, perf — отдельные review-правила; здесь только структурные smells/patterns.
|
|
98
|
+
- Четвёртое always-on правило — запрещено; этот stem только requestable / agent-load.
|
|
99
|
+
|
|
100
|
+
## Cross-refs
|
|
101
|
+
|
|
102
|
+
- Always-on Principles: `code-quality-and-refactoring`.
|
|
103
|
+
- DIP / ports vs adapters: stack `architecture-boundaries` (детали стека — в Stack notes адаптеров).
|
|
104
|
+
- Ubiquitous language: `feature-delivery-workflow` (lineage).
|
|
105
|
+
- MR checklist (smells in scope; pattern name only if repo uses it): `code-review-mr`.
|
|
106
|
+
- Token / twin policy for authors: `preset-token-budget`, `preset-twin-sync` (meta, not consumer always-on).
|
|
107
|
+
|
|
108
|
+
## Stack notes
|
|
109
|
+
|
|
110
|
+
- Prefer small interfaces / repository contracts only when justified; keep Actions/Services and Eloquent within Laravel layers (`architecture-boundaries`).
|
|
111
|
+
- Suggest Facade at package public API when the repo uses it; prefer Service Provider bindings over Singleton / ad-hoc static wiring.
|
|
112
|
+
- Prefer immutable value objects / DTOs for Strategy inputs when the repo already uses them — do not invent patterns mid-module.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Optional modular domain folders note (flat app/ remains default)
|
|
3
|
+
globs:
|
|
4
|
+
- "**/Domain/**/*"
|
|
5
|
+
- "**/domain/**/*"
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Domain layer (optional modular note)
|
|
11
|
+
|
|
12
|
+
**Default for this preset:** flat Laravel `app/` (Controllers, Actions, Models, …). Do **not** invent `app/Domain/**` for every feature.
|
|
13
|
+
|
|
14
|
+
When the **target repo already** uses modular / domain folders (`app/Domain/<Module>/`, modules packages, etc.):
|
|
15
|
+
|
|
16
|
+
- Keep module-local Models/Actions/Policies cohesive under that module's public surface.
|
|
17
|
+
- Cross-module access via public APIs only (`module-public-api`) — no deep imports of another module's internals.
|
|
18
|
+
- Still prefer Laravel primitives (Form Requests at HTTP edge, Eloquent models, Policies) inside the module.
|
|
19
|
+
|
|
20
|
+
## Thin alias rationale
|
|
21
|
+
|
|
22
|
+
This stem is intentionally **thin**: v1 locks flat `app/` as default; modular layout is an optional documented variant only.
|
|
23
|
+
|
|
24
|
+
## Forbidden
|
|
25
|
+
|
|
26
|
+
- Mandating hexagonal `Domain/` / ports purity in Laravel consumer apps.
|
|
27
|
+
- Moving HTTP types into a “domain” folder to simulate hexagonal without need.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Eloquent models, migrations, and persistence conventions
|
|
3
|
+
globs:
|
|
4
|
+
- "**/Models/**/*"
|
|
5
|
+
- "**/database/migrations/**/*"
|
|
6
|
+
- "**/database/factories/**/*"
|
|
7
|
+
- "**/database/seeders/**/*"
|
|
8
|
+
alwaysApply: false
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# Eloquent persistence
|
|
13
|
+
|
|
14
|
+
- Models stay **persistence-focused**: fillable/guarded, casts, relations, scopes, accessors already used by the repo.
|
|
15
|
+
- Prefer mass-assignment protection (`$fillable` / `$guarded`) consistent with neighbors; never `$guarded = []` casually on user-facing models.
|
|
16
|
+
- Migrations are the schema SoT; keep them additive and reversible when the repo expects `down()`.
|
|
17
|
+
- Factories/seeders for Feature tests — match existing factory patterns.
|
|
18
|
+
- Repository / query object interfaces **only when justified** (swap backends, heavy query seams) — default is Eloquent on the Action/Service.
|
|
19
|
+
|
|
20
|
+
## Forbidden
|
|
21
|
+
|
|
22
|
+
- Importing `Illuminate\Http\Request` / Form Requests into models.
|
|
23
|
+
- AuthZ role checks inside model boot hooks when Policies exist.
|
|
24
|
+
- Returning models directly from controllers when the repo uses API Resources.
|
|
25
|
+
- Raw SQL in controllers; prefer Eloquent/query builder in Actions or dedicated query classes.
|
|
26
|
+
|
|
27
|
+
## Testing
|
|
28
|
+
|
|
29
|
+
- Feature tests use `RefreshDatabase` / `DatabaseMigrations` as the repo does (SQLite in-memory preferred for dogfood/CI).
|
|
30
|
+
- Unit-test custom casts/scopes when non-trivial; otherwise Feature coverage is enough.
|
|
31
|
+
|
|
32
|
+
## Related
|
|
33
|
+
|
|
34
|
+
- Actions calling models: `actions-services`; HTTP mapping: `http-layer` + `form-requests`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Laravel Events and Listeners
|
|
3
|
+
globs:
|
|
4
|
+
- "**/Events/**/*"
|
|
5
|
+
- "**/Listeners/**/*"
|
|
6
|
+
- "**/*Event.php"
|
|
7
|
+
- "**/*Listener.php"
|
|
8
|
+
alwaysApply: false
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# Events / Listeners
|
|
13
|
+
|
|
14
|
+
- Domain/application events signal that **something happened**; Listeners react (notify, project, enqueue).
|
|
15
|
+
- Dispatch from Actions/Services (`TodoCreated::dispatch($todo)`); keep event payloads small (IDs / models via SerializesModels).
|
|
16
|
+
- Prefer dedicated Listener classes over closures in `EventServiceProvider` when neighbors use classes.
|
|
17
|
+
- Queued listeners (`ShouldQueue`) for slow side effects; sync listeners for cheap in-process reactions.
|
|
18
|
+
- Discover listeners via attributes / provider registration matching the Laravel version + repo.
|
|
19
|
+
|
|
20
|
+
## Structure
|
|
21
|
+
|
|
22
|
+
- `app/Events/TodoCreated.php`, `app/Listeners/SendTodoCreatedNotification.php`.
|
|
23
|
+
- One listener ≈ one reaction; split when a listener grows multiple unrelated side effects.
|
|
24
|
+
|
|
25
|
+
## Testing
|
|
26
|
+
|
|
27
|
+
- `Event::fake()`; `Event::assertDispatched(TodoCreated::class)`.
|
|
28
|
+
- Feature tests may assert listener effects when not faked — match repo style.
|
|
29
|
+
|
|
30
|
+
## Forbidden
|
|
31
|
+
|
|
32
|
+
- Business rules that belong in Actions living only inside Listeners (harder to test/sync).
|
|
33
|
+
- Circular event storms (Listener dispatches the same event without guard).
|
|
34
|
+
- Using Events as a mandatory hexagonal port layer — optional async pattern only.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: End-to-end delivery checklist for Laravel features
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- shared-core: architecture/feature-delivery-workflow.md -->
|
|
7
|
+
|
|
8
|
+
# Feature delivery (Laravel)
|
|
9
|
+
|
|
10
|
+
Order of work:
|
|
11
|
+
|
|
12
|
+
1. **Routes** — `routes/api.php` / `web.php` (`routes-api`).
|
|
13
|
+
2. **Form Request + Policy** — validation + AuthZ (`form-requests`, `policies-authorization`).
|
|
14
|
+
3. **Action / Service** — application logic (`actions-services`).
|
|
15
|
+
4. **Eloquent** — model + migration/factory as needed (`eloquent-persistence`).
|
|
16
|
+
5. **Controller + Resource** — thin HTTP edge (`http-layer`).
|
|
17
|
+
6. **Optional async** — Job / Event / Listener (`jobs-queues`, `events-listeners`).
|
|
18
|
+
7. **Provider bindings** — only if new interfaces/bindings (`service-providers`).
|
|
19
|
+
8. **Tests** — Feature (HTTP/DB) + Unit (Actions) as valuable.
|
|
20
|
+
9. **Gate** — `post-change-test` (+ `php-tooling`) → `php artisan test` / `composer test`.
|
|
21
|
+
|
|
22
|
+
```mermaid
|
|
23
|
+
flowchart LR
|
|
24
|
+
R[Routes] --> C[Controller]
|
|
25
|
+
C --> FR[Form Request]
|
|
26
|
+
C --> P[Policy]
|
|
27
|
+
C --> A[Action/Service]
|
|
28
|
+
A --> M[Eloquent]
|
|
29
|
+
A --> J[Job/Event]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Matrix
|
|
33
|
+
|
|
34
|
+
| Path | Rules |
|
|
35
|
+
|------|-------|
|
|
36
|
+
| `app/Http/**`, Resources | `http-layer`, `form-requests`, `architecture-boundaries` |
|
|
37
|
+
| `routes/**` | `routes-api` |
|
|
38
|
+
| `app/Models/**`, migrations | `eloquent-persistence` |
|
|
39
|
+
| `app/Actions/**`, `app/Services/**` | `actions-services` |
|
|
40
|
+
| `app/Providers/**` | `service-providers` |
|
|
41
|
+
| `app/Policies/**` | `policies-authorization` |
|
|
42
|
+
| `app/Jobs/**` | `jobs-queues` |
|
|
43
|
+
| `app/Events/**`, `app/Listeners/**` | `events-listeners` |
|
|
44
|
+
| After `*.php` edits | `post-change-test` (+ `php-tooling`) |
|
|
45
|
+
|
|
46
|
+
## Anti-patterns
|
|
47
|
+
|
|
48
|
+
- Fat controllers; Form Requests in Models; AuthZ via ad-hoc roles; skipping Feature tests for API writes.
|
|
49
|
+
- Mandating hexagonal ports/adapters folders in a Laravel-first app.
|
|
50
|
+
- Load `design-guidance` when assessing structure, smells, or pattern fit.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Laravel Form Request validation at the HTTP edge
|
|
3
|
+
globs:
|
|
4
|
+
- "**/Http/Requests/**/*"
|
|
5
|
+
- "**/*Request.php"
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Form Requests
|
|
11
|
+
|
|
12
|
+
- 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.
|
|
13
|
+
- `rules()` / `messages()` / `attributes()` stay at the HTTP edge; Actions receive already-validated arrays or typed props — **not** the Form Request object when avoidable.
|
|
14
|
+
- Prefer `authorize()` on the Form Request **or** Policy/`$this->authorize` in the controller — pick the pattern neighbors use; do not double-authorize inconsistently.
|
|
15
|
+
- Keep rules focused: required/types/uniqueness; complex cross-field domain rules may live in Action after validation basics pass.
|
|
16
|
+
- Use `$request->validated()` (or `safe()->only(...)`) — never trust raw `$request->all()` into persistence.
|
|
17
|
+
|
|
18
|
+
## Structure
|
|
19
|
+
|
|
20
|
+
- `app/Http/Requests/<Feature>/StoreXRequest.php` (or flat `StoreXRequest`) matching repo nesting.
|
|
21
|
+
- Shared rule fragments: extract only after Rule of Three; prefer Laravel Rule objects already in the repo.
|
|
22
|
+
|
|
23
|
+
## Testing
|
|
24
|
+
|
|
25
|
+
- Feature tests assert 422 validation envelopes for missing/invalid fields.
|
|
26
|
+
- Do not unit-test every rule string in isolation unless the repo already does.
|
|
27
|
+
|
|
28
|
+
## Forbidden
|
|
29
|
+
|
|
30
|
+
- Importing Form Requests into Models or Jobs as a validation substitute.
|
|
31
|
+
- Putting Eloquent queries that belong in Actions into Form Request `prepareForValidation` without need.
|
|
32
|
+
- Inventing a custom validation framework when Laravel Form Requests suffice.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Thin Laravel controllers, API Resources, and HTTP edge mapping
|
|
3
|
+
globs:
|
|
4
|
+
- "**/Http/Controllers/**/*"
|
|
5
|
+
- "**/Http/Resources/**/*"
|
|
6
|
+
- "**/Http/Middleware/**/*"
|
|
7
|
+
- "**/*Controller.php"
|
|
8
|
+
alwaysApply: false
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# HTTP layer (Laravel)
|
|
13
|
+
|
|
14
|
+
- Controllers are **thin**: authorize → validate (Form Request) → call one Action/Service → return Resource / response.
|
|
15
|
+
- Prefer invokable or resource controllers matching existing repo style; do not invent a new controller taxonomy mid-feature.
|
|
16
|
+
- Map status + body at the edge; use API Resources (or repo-equivalent) for JSON — do not return Eloquent models raw when neighbors use Resources.
|
|
17
|
+
- Keep business orchestration in Actions/Services — not private methods that grow into a second service layer inside the controller.
|
|
18
|
+
- Middleware owns cross-cutting HTTP concerns (auth, throttle, locale) already used by the repo.
|
|
19
|
+
|
|
20
|
+
## Resilience
|
|
21
|
+
|
|
22
|
+
- Side-effect endpoints: accept/propagate an **idempotency key** when the domain already uses one; document if intentionally omitted.
|
|
23
|
+
- Soft size hint: split when a controller grows past ~200 LOC or owns more than one use case.
|
|
24
|
+
|
|
25
|
+
## Testing
|
|
26
|
+
|
|
27
|
+
- Prefer Feature tests through the HTTP kernel (`tests/Feature`) with SQLite / repo test DB.
|
|
28
|
+
- Unit-test Actions separately when logic is non-trivial; mock Eloquent only if the repo already does.
|
|
29
|
+
|
|
30
|
+
## Forbidden
|
|
31
|
+
|
|
32
|
+
- Business SQL / multi-model workflows in controllers.
|
|
33
|
+
- Skipping Form Requests when neighbors validate via Form Requests.
|
|
34
|
+
- Ad-hoc role/`if ($user->isAdmin)` AuthZ when a Policy exists or should.
|
|
35
|
+
- Blade/Livewire/Filament concerns — **out of this preset**.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Laravel queued Jobs conventions
|
|
3
|
+
globs:
|
|
4
|
+
- "**/Jobs/**/*"
|
|
5
|
+
- "**/*Job.php"
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Jobs / queues
|
|
11
|
+
|
|
12
|
+
- Use Jobs for **deferred / async** work (email, fan-out, slow I/O) — not as a substitute for a clear sync Action.
|
|
13
|
+
- Dispatch from Actions/Services after the sync write succeeds (or inside the same transaction only when the repo already uses `afterCommit`).
|
|
14
|
+
- Implement `ShouldQueue` when neighbors queue; keep `handle()` focused.
|
|
15
|
+
- Configure `$tries`, `$backoff`, `$timeout` only when the job needs them or neighbors set them.
|
|
16
|
+
- Fail closed: don't swallow exceptions; use failed-job handling the repo already has.
|
|
17
|
+
|
|
18
|
+
## Serialization / DI (queued jobs)
|
|
19
|
+
|
|
20
|
+
Queued Job **constructors and public properties are serialized** onto the queue. Put only **serializable payloads** there:
|
|
21
|
+
|
|
22
|
+
- Primitives, IDs, arrays of scalars, DTOs that serialize cleanly.
|
|
23
|
+
- Eloquent models only when using `SerializesModels` carefully (prefer IDs when the model may change or be large).
|
|
24
|
+
|
|
25
|
+
**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.
|
|
26
|
+
|
|
27
|
+
Sync-only jobs that never implement `ShouldQueue` may use constructor DI if that matches neighbors; prefer the same `handle()` injection pattern for consistency.
|
|
28
|
+
|
|
29
|
+
## Structure
|
|
30
|
+
|
|
31
|
+
- `app/Jobs/SendTodoCreatedNotification.php` (verb + subject naming).
|
|
32
|
+
- Prefer serializing models via `SerializesModels` as Laravel defaults when models are the payload.
|
|
33
|
+
|
|
34
|
+
## Testing
|
|
35
|
+
|
|
36
|
+
- `Bus::fake()` / `Queue::fake()` in Feature tests; assert `Bus::assertDispatched(…)`.
|
|
37
|
+
- Optionally `Bus::dispatchSync` in integration when asserting side effects end-to-end.
|
|
38
|
+
|
|
39
|
+
## Forbidden
|
|
40
|
+
|
|
41
|
+
- Injecting services / repositories / other collaborators via the queued Job constructor.
|
|
42
|
+
- HTTP Request types inside Jobs.
|
|
43
|
+
- Huge Jobs that re-implement the whole Action — pass IDs / minimal payloads.
|
|
44
|
+
- Requiring external brokers in dogfood when `sync` / `array` / `database` driver suffices.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Laravel stack, app layout, artisan, and agent entry points
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Стек и окружение
|
|
8
|
+
|
|
9
|
+
Версии PHP и Laravel — **из `composer.json` / `composer.lock` целевого репозитория**. Рамка preset:
|
|
10
|
+
|
|
11
|
+
- **Язык / платформа:** PHP **8.2+** + **Composer** + **PSR-4** (`App\…`).
|
|
12
|
+
- **Framework:** **Laravel 11+** baseline in Stack notes; read exact constraint from the target repo.
|
|
13
|
+
- **Архитектура:** Laravel-first (HTTP → Actions/Services → Eloquent); not mandatory hexagonal ports purity.
|
|
14
|
+
- **Тесты:** PHPUnit default; Pest — если уже в репо/CI; gate = `php artisan test` / `composer test`.
|
|
15
|
+
- **Static / format:** Pint / PHPStan / Psalm — только если уже сконфигурированы.
|
|
16
|
+
- **HTTP:** thin controllers; Form Requests; API Resources; Policies for AuthZ.
|
|
17
|
+
|
|
18
|
+
# Структура (default: flat `app/`)
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
app/
|
|
22
|
+
Http/Controllers|Requests|Resources|Middleware/
|
|
23
|
+
Actions/ and/or Services/
|
|
24
|
+
Models/
|
|
25
|
+
Policies/
|
|
26
|
+
Providers/
|
|
27
|
+
Jobs/ Events/ Listeners/
|
|
28
|
+
routes/api.php routes/web.php
|
|
29
|
+
tests/Unit/ tests/Feature/
|
|
30
|
+
artisan composer.json
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Modular variant (optional):** `app/Domain/<Module>/` — short requestable note in `domain-layer` only; default remains flat Laravel `app/`.
|
|
34
|
+
|
|
35
|
+
Границы — **`architecture-boundaries.mdc`**. Tooling — requestable **`php-tooling.mdc`**. После правок PHP — **`post-change-test.mdc`**.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Idiomatic Laravel / PHP conventions for this preset
|
|
3
|
+
globs:
|
|
4
|
+
- "**/*.php"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# Laravel conventions
|
|
10
|
+
|
|
11
|
+
- Follow PSR-12 / Pint config when present; naming: `PascalCase` classes, `camelCase` methods, namespaces match Composer PSR-4 (`App\…`).
|
|
12
|
+
- Prefer typed properties, return types, and `strict_types=1` when neighboring files use them.
|
|
13
|
+
- Prefer `final` / `readonly` where the repo already uses them; do not invent a new style mid-module.
|
|
14
|
+
- Artisan generators (`php artisan make:…`) OK when they match target layout; tidy generated stubs to repo style.
|
|
15
|
+
- Do not invent Laravel APIs — verify against `composer.json` / framework docs for the installed major (`// VERIFY:` when unsure).
|
|
16
|
+
- Prefer Form Requests, Policies, Actions, Resources — the Laravel toolkit — over inventing hexagonal DTO trees.
|
|
17
|
+
|
|
18
|
+
## Errors / exceptions
|
|
19
|
+
|
|
20
|
+
- Prefer domain/application exceptions or Laravel's HTTP exceptions at the edge (`abort`, `AuthorizationException`).
|
|
21
|
+
- Chain causes; never empty-catch without logging or rethrowing.
|
|
22
|
+
- Map to HTTP statuses in controllers / exception handler — not inside Models.
|
|
23
|
+
|
|
24
|
+
## Container / facades
|
|
25
|
+
|
|
26
|
+
- Constructor injection preferred in new code; Facades OK when neighbors use them (`Route`, `DB`, `Event`).
|
|
27
|
+
- Avoid service-locator `app(Foo::class)` mid-Action when constructor injection fits.
|
|
28
|
+
|
|
29
|
+
## Anti-hallucination
|
|
30
|
+
|
|
31
|
+
| ❌ Avoid | ✅ Prefer |
|
|
32
|
+
|---------|----------|
|
|
33
|
+
| Invented packages not in `composer.json` | Add dependency explicitly or copy existing import |
|
|
34
|
+
| Fat controllers | Thin controller → Action |
|
|
35
|
+
| Blade/Livewire in API tasks | Out of preset scope |
|
|
36
|
+
| Hexagonal folder mandates | Flat `app/` Laravel layout |
|
|
37
|
+
| Empty `catch` | Handle, wrap, or declare |
|
|
38
|
+
|
|
39
|
+
## Agent requirement
|
|
40
|
+
|
|
41
|
+
New PHP code must stay idiomatic Laravel and verifiable against `composer.json` and neighboring `app/` packages.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Public module API and package boundaries for Laravel apps
|
|
3
|
+
globs:
|
|
4
|
+
- "**/composer.json"
|
|
5
|
+
- "**/app/**/*.php"
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Module public API
|
|
10
|
+
|
|
11
|
+
- Published types under a package/module's public namespaces are a compatibility surface — change carefully; prefer additive APIs.
|
|
12
|
+
- Prefer narrow exports; expose only what other modules/features need.
|
|
13
|
+
- Do not deep-import another module's internal namespaces; depend on its published API / facade only.
|
|
14
|
+
- Document breaking PHP API changes in CHANGELOG when the repo publishes libraries.
|
|
15
|
+
|
|
16
|
+
## Flat app/ default / modular variant
|
|
17
|
+
|
|
18
|
+
- **Default:** one Laravel app with flat `app/` namespaces (see `dogfood/php-laravel`).
|
|
19
|
+
- **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.
|
|
20
|
+
- Do not invent multi-package scaffolding unless the repo already uses it.
|
|
21
|
+
|
|
22
|
+
## composer.json
|
|
23
|
+
|
|
24
|
+
- Package name, PHP/Laravel versions, and PSR-4 map are SoT for toolchain/autoload.
|
|
25
|
+
- Prefer minimal direct deps; pin via committed `composer.lock` the repo already uses.
|
|
26
|
+
- Dev-only tools (PHPUnit, Pint, PHPStan) stay in `require-dev`.
|
|
27
|
+
|
|
28
|
+
## Cross-feature
|
|
29
|
+
|
|
30
|
+
- Features communicate via Actions/Services public methods or small facades — not by importing sibling Feature private helpers.
|
|
31
|
+
- Form Request / Resource DTOs stay local to the HTTP edge of that feature.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Laravel/PHP toolchain (artisan, Composer, Pint, PHPStan) — requestable
|
|
3
|
+
globs:
|
|
4
|
+
- "**/*.php"
|
|
5
|
+
- "**/composer.json"
|
|
6
|
+
- "**/composer.lock"
|
|
7
|
+
- "**/phpunit.xml*"
|
|
8
|
+
- "**/artisan"
|
|
9
|
+
- "**/pint.json"
|
|
10
|
+
- "**/phpstan*"
|
|
11
|
+
alwaysApply: false
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# PHP / Laravel tooling (requestable)
|
|
15
|
+
|
|
16
|
+
Before running commands, discover from the repository:
|
|
17
|
+
|
|
18
|
+
1. Require **`composer.json` / `composer.lock`** — Composer is the package manager.
|
|
19
|
+
2. PHP / Laravel versions — from `composer.json`; do not invent.
|
|
20
|
+
3. Tests: prefer **`php artisan test`**; else Composer script `test`; else `vendor/bin/phpunit`; use **Pest** only if already in repo/CI.
|
|
21
|
+
4. If both PHPUnit and Pest exist, follow CI/README — do not guess.
|
|
22
|
+
|
|
23
|
+
## Typical commands
|
|
24
|
+
|
|
25
|
+
| Goal | Command |
|
|
26
|
+
|------|---------|
|
|
27
|
+
| Feature/unit tests | `php artisan test` or `composer test` |
|
|
28
|
+
| Pest (if present) | via `artisan test` / `vendor/bin/pest` per repo |
|
|
29
|
+
| Autoload refresh | `composer dump-autoload` |
|
|
30
|
+
| Static analysis | `vendor/bin/phpstan` or `vendor/bin/psalm` **only if** config exists |
|
|
31
|
+
| Format | `vendor/bin/pint` or `php-cs-fixer` **only if** configured |
|
|
32
|
+
|
|
33
|
+
Do not introduce a new static/format tool as a hard gate.
|
|
34
|
+
|
|
35
|
+
## Agent requirements
|
|
36
|
+
|
|
37
|
+
- Mandatory after PHP edits: **`post-change-test.mdc`**.
|
|
38
|
+
- Never require Playwright, XCUITest, `lint:js`, `lint:css`, `xcodebuild`, `mvn`, or `gradlew` as Laravel handoffs.
|
|
39
|
+
- Integration/Feature tests: agents `integration-test-*` + skill `integration-testing` (Laravel Feature ≈ integration).
|