@bonesofspring/ai-rules 0.2.6 → 0.2.8
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 +65 -1
- package/README.md +13 -5
- package/bin/cli.js +30 -1
- package/package.json +3 -2
- package/presets/_shared/README.md +1 -1
- package/presets/_shared/core/agent-team/agent-team-intake.md +1 -1
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +1 -1
- package/presets/_shared/core/architecture/reference-features.template.md +12 -0
- package/presets/_shared/core/meta/preset-layering.md +1 -1
- package/presets/_shared/core/meta/preset-no-cross-stack-leakage.md +6 -4
- package/presets/_shared/core/meta/preset-pr-checklist.md +1 -1
- package/presets/_shared/core/meta/preset-twin-sync.md +2 -0
- package/presets/_shared/core/quality/code-quality-and-refactoring.md +11 -0
- package/presets/_shared/core/review/code-review-mr.md +9 -0
- package/presets/claude/go/CLAUDE.md +5 -1
- package/presets/claude/go/README.md +5 -1
- package/presets/claude/go/REPO_AGENTS.md +48 -0
- package/presets/claude/go/agents/README.md +19 -2
- package/presets/claude/go/agents/build-verifier.md +6 -1
- package/presets/claude/go/agents/codebase-analyzer.md +28 -0
- package/presets/claude/go/agents/feature-developer.md +13 -0
- package/presets/claude/go/hooks/README.md +6 -0
- package/presets/claude/go/hooks/examples/README.md +18 -0
- package/presets/claude/go/hooks/examples/format-edited.example.sh +9 -0
- package/presets/claude/go/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/claude/go/hooks/examples/test-on-save.example.sh +11 -0
- package/presets/claude/go/rules/api-and-data/api-http.md +10 -3
- package/presets/claude/go/rules/architecture/reference-features.md +4 -0
- package/presets/claude/go/rules/stack/go-conventions.md +30 -3
- package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/code-quality.md +12 -1
- package/presets/claude/go/rules/tooling-and-review/code-review.md +9 -0
- 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 +6 -8
- 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 +2 -0
- package/presets/claude/go/skills/README.md +2 -2
- package/presets/claude/go/skills/code-review/SKILL.md +11 -2
- package/presets/claude/go/skills/feature-delivery/SKILL.md +4 -0
- package/presets/claude/go/skills/technical-retro/SKILL.md +46 -2
- package/presets/claude/go/skills/write-adr/SKILL.md +41 -0
- package/presets/claude/go/team/conventions.md +21 -0
- package/presets/claude/go/team/fixtures/feature-full.json +5 -23
- package/presets/claude/ios-swift/CLAUDE.md +4 -1
- package/presets/claude/ios-swift/README.md +5 -1
- package/presets/claude/ios-swift/REPO_AGENTS.md +46 -0
- package/presets/claude/ios-swift/agents/README.md +3 -2
- package/presets/claude/ios-swift/agents/build-verifier.md +7 -2
- package/presets/claude/ios-swift/agents/codebase-analyzer.md +28 -0
- package/presets/claude/ios-swift/agents/feature-developer.md +13 -0
- package/presets/claude/ios-swift/hooks/README.md +6 -0
- package/presets/claude/ios-swift/hooks/examples/README.md +18 -0
- package/presets/claude/ios-swift/hooks/examples/format-edited.example.sh +13 -0
- package/presets/claude/ios-swift/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/claude/ios-swift/hooks/examples/test-on-save.example.sh +8 -0
- package/presets/claude/ios-swift/rules/architecture/reference-features.md +4 -0
- package/presets/claude/ios-swift/rules/stack/ios-app-core.md +5 -28
- package/presets/claude/ios-swift/rules/stack/swift-conventions.md +12 -2
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +12 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +47 -0
- 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 +6 -4
- 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 +2 -0
- package/presets/claude/ios-swift/rules/ui-and-accessibility/swiftui.md +8 -0
- package/presets/claude/ios-swift/skills/README.md +1 -0
- package/presets/claude/ios-swift/skills/code-review/SKILL.md +10 -2
- package/presets/claude/ios-swift/skills/feature-delivery/SKILL.md +4 -0
- package/presets/claude/ios-swift/skills/technical-retro/SKILL.md +46 -2
- package/presets/claude/ios-swift/skills/write-adr/SKILL.md +41 -0
- package/presets/claude/ios-swift/team/conventions.md +21 -0
- package/presets/claude/java/CLAUDE.md +29 -0
- package/presets/claude/java/MCP.md +13 -0
- package/presets/claude/java/README.md +26 -0
- package/presets/claude/java/REPO_AGENTS.md +45 -0
- package/presets/claude/java/agents/README.md +32 -0
- package/presets/claude/java/agents/api-contract-reviewer.md +23 -0
- package/presets/claude/java/agents/build-verifier.md +45 -0
- package/presets/claude/java/agents/ci-investigator.md +17 -0
- package/presets/claude/java/agents/code-reviewer.md +40 -0
- package/presets/claude/java/agents/codebase-analyzer.md +28 -0
- package/presets/claude/java/agents/debugger.md +25 -0
- package/presets/claude/java/agents/feature-developer.md +43 -0
- package/presets/claude/java/agents/integration-test-generator.md +22 -0
- package/presets/claude/java/agents/integration-test-healer.md +22 -0
- package/presets/claude/java/agents/integration-test-planner.md +22 -0
- package/presets/claude/java/agents/migration-specialist.md +31 -0
- package/presets/claude/java/agents/performance-auditor.md +22 -0
- package/presets/claude/java/agents/qa-tester.md +24 -0
- package/presets/claude/java/agents/security-reviewer.md +20 -0
- package/presets/claude/java/agents/solution-architect.md +28 -0
- package/presets/claude/java/agents/task-analyst.md +25 -0
- package/presets/claude/java/agents/task-router.md +69 -0
- package/presets/claude/java/agents/tech-writer.md +15 -0
- package/presets/claude/java/agents/unit-test-generator.md +21 -0
- package/presets/claude/java/agents/unit-test-healer.md +13 -0
- package/presets/claude/java/agents/unit-test-planner.md +26 -0
- package/presets/claude/java/commands/README.md +13 -0
- package/presets/claude/java/commands/feature-continue.md +51 -0
- package/presets/claude/java/commands/feature-start.md +30 -0
- package/presets/claude/java/commands/task-continue.md +49 -0
- package/presets/claude/java/commands/task.md +49 -0
- package/presets/claude/java/commands/technical-retro.md +58 -0
- package/presets/claude/java/hooks/README.md +16 -0
- package/presets/claude/java/hooks/chain-team-phases.sh +381 -0
- package/presets/claude/java/hooks/examples/README.md +18 -0
- package/presets/claude/java/hooks/examples/format-edited.example.sh +11 -0
- package/presets/claude/java/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/claude/java/hooks/examples/test-on-save.example.sh +18 -0
- package/presets/claude/java/hooks/guard-shell-command.sh +80 -0
- package/presets/claude/java/mcp.json +11 -0
- package/presets/claude/java/rules/README.md +60 -0
- package/presets/claude/java/rules/api-and-data/README.md +14 -0
- package/presets/claude/java/rules/api-and-data/adapters-driven.md +38 -0
- package/presets/claude/java/rules/api-and-data/adapters-driving.md +38 -0
- package/presets/claude/java/rules/api-and-data/api-grpc.md +29 -0
- package/presets/claude/java/rules/api-and-data/api-http.md +36 -0
- package/presets/claude/java/rules/api-and-data/messaging-adapters.md +24 -0
- package/presets/claude/java/rules/api-and-data/persistence-adapters.md +33 -0
- package/presets/claude/java/rules/architecture/README.md +16 -0
- package/presets/claude/java/rules/architecture/application-usecases.md +32 -0
- package/presets/claude/java/rules/architecture/boundaries.md +29 -0
- package/presets/claude/java/rules/architecture/composition-root.md +31 -0
- package/presets/claude/java/rules/architecture/domain-layer.md +38 -0
- package/presets/claude/java/rules/architecture/feature-delivery.md +52 -0
- package/presets/claude/java/rules/architecture/module-public-api.md +31 -0
- package/presets/claude/java/rules/architecture/ports-interfaces.md +34 -0
- package/presets/claude/java/rules/architecture/reference-features.md +34 -0
- package/presets/claude/java/rules/stack/README.md +10 -0
- package/presets/claude/java/rules/stack/java-app-core.md +32 -0
- package/presets/claude/java/rules/stack/java-conventions.md +52 -0
- package/presets/claude/java/rules/testing/README.md +11 -0
- package/presets/claude/java/rules/testing/e2e.md +22 -0
- package/presets/claude/java/rules/testing/integration.md +27 -0
- package/presets/claude/java/rules/testing/unit.md +33 -0
- package/presets/claude/java/rules/tooling-and-review/README.md +21 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +26 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +179 -0
- package/presets/claude/java/rules/tooling-and-review/code-quality.md +83 -0
- package/presets/claude/java/rules/tooling-and-review/code-review.md +59 -0
- package/presets/claude/java/rules/tooling-and-review/design-guidance.md +110 -0
- package/presets/claude/java/rules/tooling-and-review/java-tooling.md +36 -0
- package/presets/claude/java/rules/tooling-and-review/post-change-test.md +32 -0
- package/presets/claude/java/rules/tooling-and-review/preset-layering.md +36 -0
- package/presets/claude/java/rules/tooling-and-review/preset-no-cross-stack-leakage.md +56 -0
- package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +39 -0
- package/presets/claude/java/rules/tooling-and-review/preset-token-budget.md +41 -0
- package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +44 -0
- package/presets/claude/java/rules/tooling-and-review/security-java.md +29 -0
- package/presets/claude/java/rules/tooling-and-review/technical-retro.md +20 -0
- package/presets/claude/java/rules/ui-and-accessibility/README.md +5 -0
- package/presets/claude/java/skills/README.md +5 -0
- package/presets/claude/java/skills/ci-investigation/SKILL.md +11 -0
- package/presets/claude/java/skills/code-review/SKILL.md +25 -0
- package/presets/claude/java/skills/debug-investigation/SKILL.md +15 -0
- package/presets/claude/java/skills/feature-delivery/SKILL.md +30 -0
- package/presets/claude/java/skills/integration-testing/SKILL.md +15 -0
- package/presets/claude/java/skills/technical-retro/SKILL.md +54 -0
- package/presets/claude/java/skills/unit-testing/SKILL.md +14 -0
- package/presets/claude/java/skills/write-adr/SKILL.md +41 -0
- package/presets/claude/java/team/README.md +27 -0
- package/presets/claude/java/team/conventions.md +21 -0
- package/presets/claude/java/team/fixtures/bugfix-standard.json +37 -0
- package/presets/claude/java/team/fixtures/feature-full.json +25 -0
- package/presets/claude/java/team/fixtures/feature-light.json +17 -0
- package/presets/claude/next/CLAUDE.md +5 -1
- package/presets/claude/next/README.md +6 -1
- package/presets/claude/next/REPO_AGENTS.md +48 -0
- package/presets/claude/next/agents/README.md +7 -1
- package/presets/claude/next/agents/build-verifier.md +7 -2
- package/presets/claude/next/agents/codebase-analyzer.md +28 -0
- package/presets/claude/next/agents/feature-developer.md +13 -0
- package/presets/claude/next/agents/security-reviewer.md +4 -2
- package/presets/claude/next/hooks/README.md +6 -0
- package/presets/claude/next/hooks/examples/README.md +18 -0
- package/presets/claude/next/hooks/examples/format-edited.example.sh +11 -0
- package/presets/claude/next/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/claude/next/hooks/examples/test-on-save.example.sh +8 -0
- package/presets/claude/next/rules/README.md +2 -1
- package/presets/claude/next/rules/api-and-data/api-services.md +22 -0
- package/presets/claude/next/rules/api-and-data/http-client.md +21 -0
- package/presets/claude/next/rules/api-and-data/store-rtk.md +20 -0
- package/presets/claude/next/rules/architecture/architecture-boundaries.md +28 -0
- package/presets/claude/next/rules/architecture/layer-barrel-exports.md +15 -0
- package/presets/claude/next/rules/architecture/public-imports.md +14 -0
- package/presets/claude/next/rules/architecture/reference-features.md +4 -0
- package/presets/claude/next/rules/stack/arrow-functions.md +13 -28
- package/presets/claude/next/rules/stack/next-app-router.md +13 -1
- package/presets/claude/next/rules/testing/tests-unit.md +13 -0
- package/presets/claude/next/rules/tooling-and-review/README.md +2 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/code-quality.md +12 -2
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +22 -0
- 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 +6 -4
- 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 +2 -0
- package/presets/claude/next/rules/tooling-and-review/security-next.md +57 -0
- package/presets/claude/next/rules/ui-and-accessibility/react-ui.md +21 -0
- package/presets/claude/next/skills/README.md +2 -0
- package/presets/claude/next/skills/code-review/SKILL.md +10 -2
- package/presets/claude/next/skills/feature-delivery/SKILL.md +4 -0
- package/presets/claude/next/skills/react-performance/SKILL.md +44 -0
- package/presets/claude/next/skills/technical-retro/SKILL.md +19 -5
- package/presets/claude/next/skills/write-adr/SKILL.md +41 -0
- package/presets/claude/next/team/conventions.md +21 -0
- package/presets/cursor/go/AGENTS.md +6 -0
- package/presets/cursor/go/README.md +6 -5
- package/presets/cursor/go/REPO_AGENTS.md +48 -0
- package/presets/cursor/go/agents/README.md +23 -2
- package/presets/cursor/go/agents/build-verifier.md +6 -1
- package/presets/cursor/go/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/go/agents/feature-developer.md +13 -0
- package/presets/cursor/go/commands/README.md +1 -1
- package/presets/cursor/go/hooks/README.md +4 -0
- package/presets/cursor/go/hooks/examples/README.md +18 -0
- package/presets/cursor/go/hooks/examples/format-edited.example.sh +9 -0
- package/presets/cursor/go/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/cursor/go/hooks/examples/test-on-save.example.sh +11 -0
- package/presets/cursor/go/rules/README.md +2 -2
- package/presets/cursor/go/rules/agent-team-intake.mdc +1 -1
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/go/rules/api-http.mdc +10 -3
- package/presets/cursor/go/rules/code-quality-and-refactoring.mdc +12 -1
- package/presets/cursor/go/rules/code-review-mr.mdc +9 -0
- package/presets/cursor/go/rules/go-conventions.mdc +30 -3
- package/presets/cursor/go/rules/preset-layering.mdc +1 -1
- package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +6 -8
- package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/go/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/go/rules/reference-features.mdc +4 -0
- package/presets/cursor/go/skills/README.md +2 -2
- package/presets/cursor/go/skills/code-review/SKILL.md +10 -1
- package/presets/cursor/go/skills/feature-delivery/SKILL.md +4 -0
- package/presets/cursor/go/skills/technical-retro/SKILL.md +46 -2
- package/presets/cursor/go/skills/write-adr/SKILL.md +41 -0
- package/presets/cursor/go/team/conventions.md +21 -0
- package/presets/cursor/go/team/fixtures/feature-full.json +5 -23
- package/presets/cursor/ios-swift/AGENTS.md +5 -2
- package/presets/cursor/ios-swift/README.md +6 -5
- package/presets/cursor/ios-swift/REPO_AGENTS.md +46 -0
- package/presets/cursor/ios-swift/agents/README.md +3 -2
- package/presets/cursor/ios-swift/agents/build-verifier.md +7 -2
- package/presets/cursor/ios-swift/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/ios-swift/agents/feature-developer.md +13 -0
- package/presets/cursor/ios-swift/commands/README.md +1 -1
- package/presets/cursor/ios-swift/hooks/README.md +4 -0
- package/presets/cursor/ios-swift/hooks/examples/README.md +18 -0
- package/presets/cursor/ios-swift/hooks/examples/format-edited.example.sh +13 -0
- package/presets/cursor/ios-swift/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/cursor/ios-swift/hooks/examples/test-on-save.example.sh +8 -0
- package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +1 -1
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +12 -1
- package/presets/cursor/ios-swift/rules/code-review-mr.mdc +9 -0
- package/presets/cursor/ios-swift/rules/ios-app-core.mdc +5 -28
- package/presets/cursor/ios-swift/rules/preset-layering.mdc +1 -1
- package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +6 -4
- package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/ios-swift/rules/reference-features.mdc +4 -0
- package/presets/cursor/ios-swift/rules/swift-conventions.mdc +12 -2
- package/presets/cursor/ios-swift/rules/swiftui-ui.mdc +8 -0
- package/presets/cursor/ios-swift/skills/README.md +1 -0
- package/presets/cursor/ios-swift/skills/code-review/SKILL.md +10 -2
- package/presets/cursor/ios-swift/skills/feature-delivery/SKILL.md +4 -0
- package/presets/cursor/ios-swift/skills/technical-retro/SKILL.md +46 -2
- package/presets/cursor/ios-swift/skills/write-adr/SKILL.md +41 -0
- package/presets/cursor/ios-swift/team/conventions.md +21 -0
- package/presets/cursor/java/AGENTS.md +37 -0
- package/presets/cursor/java/BUGBOT.md +11 -0
- package/presets/cursor/java/MCP.md +15 -0
- package/presets/cursor/java/README.md +26 -0
- package/presets/cursor/java/REPO_AGENTS.md +45 -0
- package/presets/cursor/java/agents/README.md +36 -0
- package/presets/cursor/java/agents/api-contract-reviewer.md +23 -0
- package/presets/cursor/java/agents/build-verifier.md +45 -0
- package/presets/cursor/java/agents/ci-investigator.md +17 -0
- package/presets/cursor/java/agents/code-reviewer.md +40 -0
- package/presets/cursor/java/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/java/agents/debugger.md +25 -0
- package/presets/cursor/java/agents/feature-developer.md +43 -0
- package/presets/cursor/java/agents/integration-test-generator.md +22 -0
- package/presets/cursor/java/agents/integration-test-healer.md +22 -0
- package/presets/cursor/java/agents/integration-test-planner.md +22 -0
- package/presets/cursor/java/agents/migration-specialist.md +31 -0
- package/presets/cursor/java/agents/performance-auditor.md +22 -0
- package/presets/cursor/java/agents/qa-tester.md +24 -0
- package/presets/cursor/java/agents/security-reviewer.md +20 -0
- package/presets/cursor/java/agents/solution-architect.md +28 -0
- package/presets/cursor/java/agents/task-analyst.md +25 -0
- package/presets/cursor/java/agents/task-router.md +69 -0
- package/presets/cursor/java/agents/tech-writer.md +15 -0
- package/presets/cursor/java/agents/unit-test-generator.md +21 -0
- package/presets/cursor/java/agents/unit-test-healer.md +13 -0
- package/presets/cursor/java/agents/unit-test-planner.md +26 -0
- package/presets/cursor/java/commands/README.md +54 -0
- package/presets/cursor/java/commands/feature-continue.md +19 -0
- package/presets/cursor/java/commands/feature-start.md +33 -0
- package/presets/cursor/java/commands/task-continue.md +49 -0
- package/presets/cursor/java/commands/task.md +49 -0
- package/presets/cursor/java/commands/technical-retro.md +81 -0
- package/presets/cursor/java/hooks/README.md +12 -0
- package/presets/cursor/java/hooks/chain-team-phases.sh +381 -0
- package/presets/cursor/java/hooks/examples/README.md +18 -0
- package/presets/cursor/java/hooks/examples/format-edited.example.sh +11 -0
- package/presets/cursor/java/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/cursor/java/hooks/examples/test-on-save.example.sh +18 -0
- package/presets/cursor/java/hooks/guard-shell-command.sh +80 -0
- package/presets/cursor/java/hooks.json +17 -0
- package/presets/cursor/java/mcp.json +11 -0
- package/presets/cursor/java/rules/README.md +97 -0
- package/presets/cursor/java/rules/adapters-driven.mdc +40 -0
- package/presets/cursor/java/rules/adapters-driving.mdc +40 -0
- package/presets/cursor/java/rules/agent-team-intake.mdc +20 -0
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +173 -0
- package/presets/cursor/java/rules/api-grpc.mdc +31 -0
- package/presets/cursor/java/rules/api-http.mdc +38 -0
- package/presets/cursor/java/rules/application-usecases.mdc +34 -0
- package/presets/cursor/java/rules/architecture-boundaries.mdc +30 -0
- package/presets/cursor/java/rules/code-quality-and-refactoring.mdc +84 -0
- package/presets/cursor/java/rules/code-review-mr.mdc +54 -0
- package/presets/cursor/java/rules/composition-root.mdc +33 -0
- package/presets/cursor/java/rules/design-guidance.mdc +112 -0
- package/presets/cursor/java/rules/domain-layer.mdc +40 -0
- package/presets/cursor/java/rules/feature-delivery-workflow.mdc +47 -0
- package/presets/cursor/java/rules/java-app-core.mdc +33 -0
- package/presets/cursor/java/rules/java-conventions.mdc +54 -0
- package/presets/cursor/java/rules/java-tooling.mdc +34 -0
- package/presets/cursor/java/rules/messaging-adapters.mdc +26 -0
- package/presets/cursor/java/rules/module-public-api.mdc +33 -0
- package/presets/cursor/java/rules/persistence-adapters.mdc +35 -0
- package/presets/cursor/java/rules/ports-interfaces.mdc +36 -0
- package/presets/cursor/java/rules/post-change-test.mdc +30 -0
- package/presets/cursor/java/rules/preset-layering.mdc +36 -0
- package/presets/cursor/java/rules/preset-no-cross-stack-leakage.mdc +56 -0
- package/presets/cursor/java/rules/preset-pr-checklist.mdc +39 -0
- package/presets/cursor/java/rules/preset-token-budget.mdc +41 -0
- package/presets/cursor/java/rules/preset-twin-sync.mdc +44 -0
- package/presets/cursor/java/rules/reference-features.mdc +36 -0
- package/presets/cursor/java/rules/security-java.mdc +31 -0
- package/presets/cursor/java/rules/technical-retro.mdc +14 -0
- package/presets/cursor/java/rules/tests-e2e.mdc +24 -0
- package/presets/cursor/java/rules/tests-integration.mdc +29 -0
- package/presets/cursor/java/rules/tests-unit.mdc +35 -0
- package/presets/cursor/java/skills/README.md +5 -0
- package/presets/cursor/java/skills/ci-investigation/SKILL.md +11 -0
- package/presets/cursor/java/skills/code-review/SKILL.md +25 -0
- package/presets/cursor/java/skills/debug-investigation/SKILL.md +15 -0
- package/presets/cursor/java/skills/feature-delivery/SKILL.md +30 -0
- package/presets/cursor/java/skills/integration-testing/SKILL.md +15 -0
- package/presets/cursor/java/skills/technical-retro/SKILL.md +54 -0
- package/presets/cursor/java/skills/unit-testing/SKILL.md +14 -0
- package/presets/cursor/java/skills/write-adr/SKILL.md +41 -0
- package/presets/cursor/java/team/README.md +31 -0
- package/presets/cursor/java/team/conventions.md +21 -0
- package/presets/cursor/java/team/fixtures/bugfix-standard.json +37 -0
- package/presets/cursor/java/team/fixtures/feature-full.json +25 -0
- package/presets/cursor/java/team/fixtures/feature-light.json +17 -0
- package/presets/cursor/next/AGENTS.md +5 -2
- package/presets/cursor/next/README.md +7 -6
- package/presets/cursor/next/REPO_AGENTS.md +48 -0
- package/presets/cursor/next/agents/README.md +7 -1
- package/presets/cursor/next/agents/build-verifier.md +7 -2
- package/presets/cursor/next/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/next/agents/feature-developer.md +13 -0
- package/presets/cursor/next/agents/security-reviewer.md +4 -2
- package/presets/cursor/next/commands/README.md +1 -1
- package/presets/cursor/next/hooks/README.md +4 -0
- package/presets/cursor/next/hooks/examples/README.md +18 -0
- package/presets/cursor/next/hooks/examples/format-edited.example.sh +11 -0
- package/presets/cursor/next/hooks/examples/secret-guard.example.sh +10 -0
- package/presets/cursor/next/hooks/examples/test-on-save.example.sh +8 -0
- package/presets/cursor/next/rules/README.md +4 -3
- package/presets/cursor/next/rules/agent-team-intake.mdc +1 -1
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/next/rules/api-services.mdc +21 -0
- package/presets/cursor/next/rules/architecture-boundaries.mdc +27 -0
- package/presets/cursor/next/rules/arrow-functions.mdc +13 -28
- package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +12 -2
- package/presets/cursor/next/rules/code-review-mr.mdc +11 -13
- package/presets/cursor/next/rules/http-client.mdc +21 -0
- package/presets/cursor/next/rules/layer-barrel-exports.mdc +15 -0
- package/presets/cursor/next/rules/next-app-router.mdc +13 -1
- package/presets/cursor/next/rules/preset-layering.mdc +1 -1
- package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +6 -4
- package/presets/cursor/next/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/next/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/next/rules/public-imports.mdc +14 -0
- package/presets/cursor/next/rules/react-ui.mdc +20 -0
- package/presets/cursor/next/rules/reference-features.mdc +4 -0
- package/presets/cursor/next/rules/security-next.mdc +57 -0
- package/presets/cursor/next/rules/store-rtk.mdc +19 -0
- package/presets/cursor/next/rules/tests-unit.mdc +12 -0
- package/presets/cursor/next/skills/README.md +2 -0
- package/presets/cursor/next/skills/code-review/SKILL.md +10 -2
- package/presets/cursor/next/skills/feature-delivery/SKILL.md +4 -0
- package/presets/cursor/next/skills/react-performance/SKILL.md +44 -0
- package/presets/cursor/next/skills/technical-retro/SKILL.md +19 -5
- package/presets/cursor/next/skills/write-adr/SKILL.md +41 -0
- package/presets/cursor/next/team/conventions.md +21 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-continue
|
|
3
|
+
description: Legacy alias for /task-continue that resumes a feature pipeline after human approval or pause.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Feature continue — продолжение после утверждения brief
|
|
7
|
+
|
|
8
|
+
Legacy-команда для продолжения после human gate. Для новых пайплайнов с `pipeline.json` используй те же правила, что в `/task-continue`.
|
|
9
|
+
|
|
10
|
+
## Аргументы
|
|
11
|
+
|
|
12
|
+
`<slug>` — идентификатор задачи из `.claude/team/tasks/<slug>/`.
|
|
13
|
+
|
|
14
|
+
## Preconditions
|
|
15
|
+
|
|
16
|
+
1. Прочитай `.claude/team/tasks/<slug>/brief.md` и `decomposition.md`.
|
|
17
|
+
2. Если есть `pipeline.json`, делегируй поведение `/task-continue <slug>`.
|
|
18
|
+
3. Если `pipeline.json` нет, прочитай `status.json`. Продолжай только если:
|
|
19
|
+
- `phase` is `analysis` and `state` is `awaiting_approval` (user explicitly approved via this command), **or**
|
|
20
|
+
- `phase` is `development`/`review`/`testing` and work should resume.
|
|
21
|
+
|
|
22
|
+
## Legacy алгоритм без `pipeline.json`
|
|
23
|
+
|
|
24
|
+
1. Обнови `status.json`:
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"slug": "<slug>",
|
|
28
|
+
"phase": "development",
|
|
29
|
+
"state": "approved",
|
|
30
|
+
"updatedAt": "<ISO8601>"
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
Затем сразу установи `"state": "in_progress"` перед вызовом developer.
|
|
34
|
+
|
|
35
|
+
2. Запиши `.claude/team/active-task.json` → `{ "slug": "<slug>" }`.
|
|
36
|
+
|
|
37
|
+
3. Вызови subagent **feature-developer** с контекстом:
|
|
38
|
+
- пути к `brief.md`, `decomposition.md`, `status.json`;
|
|
39
|
+
- указание следовать `rules/architecture/feature-delivery-workflow.md`.
|
|
40
|
+
|
|
41
|
+
4. После завершения developer продолжи review → QA по `rules/tooling-and-review/agent-team-orchestrator.md`.
|
|
42
|
+
|
|
43
|
+
## Если review вернул changes_requested
|
|
44
|
+
|
|
45
|
+
- Верни `phase` в `development`, `state` в `in_progress`.
|
|
46
|
+
- Снова вызови **feature-developer** с списком правок от reviewer.
|
|
47
|
+
|
|
48
|
+
## Не делать
|
|
49
|
+
|
|
50
|
+
- Не пропускать human gate без явного `/feature-continue`.
|
|
51
|
+
- Не совмещать роли developer и reviewer в одном subagent-вызове.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-start
|
|
3
|
+
description: Legacy analyst-only feature intake. Prefer /task for new work because it uses router and dynamic pipeline.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Feature start — legacy команда агентов
|
|
7
|
+
|
|
8
|
+
Запуск **фазы анализа** для новой задачи. Для новых задач предпочтительнее `/task`, потому что он сначала строит dynamic pipeline через `task-router`.
|
|
9
|
+
|
|
10
|
+
## Что делать
|
|
11
|
+
|
|
12
|
+
1. Извлеки описание задачи из аргументов команды (всё после `/feature-start`).
|
|
13
|
+
2. Сгенерируй **slug** (kebab-case, до 48 символов) из заголовка задачи.
|
|
14
|
+
3. Создай `.claude/team/tasks/<slug>/` если его ещё нет — через запись файла (Write / Edit), не через Shell `mkdir`.
|
|
15
|
+
4. Запиши `.claude/team/active-task.json` → `{ "slug": "<slug>" }`.
|
|
16
|
+
5. Вызови subagent **task-analyst** с полным описанием задачи и путём к артефактам.
|
|
17
|
+
6. Дождись завершения аналитика. **Не вызывай developer** на этом этапе.
|
|
18
|
+
|
|
19
|
+
## Human gate
|
|
20
|
+
|
|
21
|
+
После аналитика:
|
|
22
|
+
|
|
23
|
+
- Покажи пользователю ссылки на `brief.md` и `decomposition.md`.
|
|
24
|
+
- Попроси проверить и утвердить или прислать правки.
|
|
25
|
+
- Для продолжения: `/feature-continue <slug>` или `/task-continue <slug>`.
|
|
26
|
+
|
|
27
|
+
## Если slug уже существует
|
|
28
|
+
|
|
29
|
+
- Если `status.json` в `awaiting_approval` — предложи ревью или `/feature-continue`.
|
|
30
|
+
- Если задача в работе — спроси, продолжать или начать новый slug.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: task-continue
|
|
3
|
+
description: Continue an agent-team task after a human gate, pause, or review changes request using pipeline.json and status.json.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Task continue — после human gate или паузы
|
|
7
|
+
|
|
8
|
+
Продолжение пайплайна из `pipeline.json`. Алиас по смыслу: `/feature-continue`.
|
|
9
|
+
|
|
10
|
+
## Аргументы
|
|
11
|
+
|
|
12
|
+
`<slug>` — идентификатор задачи.
|
|
13
|
+
|
|
14
|
+
## Preconditions
|
|
15
|
+
|
|
16
|
+
1. Прочитай `.claude/team/tasks/<slug>/pipeline.json` и `status.json`.
|
|
17
|
+
2. Продолжай если:
|
|
18
|
+
- `awaitingHumanGate: true` или `state: awaiting_approval`, **или**
|
|
19
|
+
- `state: changes_requested` (после review), **или**
|
|
20
|
+
- задача прервана и нужно возобновить с `pipelineIndex`.
|
|
21
|
+
|
|
22
|
+
## Алгоритм
|
|
23
|
+
|
|
24
|
+
1. Запиши `.claude/team/active-task.json` → `{ "slug": "<slug>" }`.
|
|
25
|
+
2. Сбрось gate: `awaitingHumanGate: false`.
|
|
26
|
+
3. Определи **следующий шаг**:
|
|
27
|
+
- После approval analyst/architect: `pipelineIndex + 1` → следующий agent в `steps`.
|
|
28
|
+
- После `changes_requested`: снова **feature-developer** (тот же index или найди developer в steps).
|
|
29
|
+
4. Обнови `status.json`:
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"pipelineIndex": <n>,
|
|
33
|
+
"currentAgent": "<steps[n].agent>",
|
|
34
|
+
"phase": "executing",
|
|
35
|
+
"state": "in_progress",
|
|
36
|
+
"awaitingHumanGate": false
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
5. Вызови subagent для `currentAgent` с контекстом slug и артефактов.
|
|
40
|
+
6. Если hook `chain-team-phases.sh` включён в проекте и `autoChain: true`, он продолжит цепочку по `pipeline.json`; иначе продолжай следующий шаг вручную.
|
|
41
|
+
|
|
42
|
+
## Артефакты для handoff
|
|
43
|
+
|
|
44
|
+
| Agent | Прочитать |
|
|
45
|
+
|-------|-----------|
|
|
46
|
+
| feature-developer | brief.md, decomposition.md, validation-report.md (if retry), review.md (if retry), architecture.md |
|
|
47
|
+
| build-verifier | git diff, decomposition.md |
|
|
48
|
+
| code-reviewer | brief.md, validation-report.md, git diff |
|
|
49
|
+
| qa-tester | brief.md, decomposition.md, scope from pipeline step |
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: task
|
|
3
|
+
description: Route a natural-language task through the agent-team pipeline: task-router, pipeline.json, and the first planned specialist.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Task — единая точка входа
|
|
7
|
+
|
|
8
|
+
Главная команда для постановки задачи в Claude Code. Родительский агент = оркестратор (`rules/tooling-and-review/agent-team-orchestrator.md`). Intake — `rules/tooling-and-review/agent-team-intake.md`.
|
|
9
|
+
|
|
10
|
+
## Аргументы
|
|
11
|
+
|
|
12
|
+
Всё после `/task` — описание задачи на естественном языке.
|
|
13
|
+
|
|
14
|
+
Примеры:
|
|
15
|
+
|
|
16
|
+
- `/task Добавить use case отмены заказа`
|
|
17
|
+
- `/task Handler падает при пустом body — пофикси`
|
|
18
|
+
- `/task CI упал на mvn test / gradlew test в PR`
|
|
19
|
+
- `/task Миграция на новый JDK / обновление Maven-Gradle модуля`
|
|
20
|
+
- `/task Покрой unit-тестами OrderService`
|
|
21
|
+
- `/task Напиши changelog для релиза фильтров`
|
|
22
|
+
- `/task Сделай ревью моих изменений в application/`
|
|
23
|
+
- `/task Напиши integration tests для persistence adapter`
|
|
24
|
+
|
|
25
|
+
## Алгоритм
|
|
26
|
+
|
|
27
|
+
1. **Slug** — kebab-case из описания (≤48 символов). Создай `.claude/team/tasks/<slug>/` через запись файла (Write / Edit) — **не** полагайся на Shell `mkdir` как единственный способ создать каталог.
|
|
28
|
+
2. **Router** — вызови subagent **task-router** с описанием задачи и путём к slug.
|
|
29
|
+
3. **План** — покажи пользователю таблицу из `pipeline.json`: intent, steps, skipped, humanGates.
|
|
30
|
+
4. **Intent retro** — если `intent === "retro"`, выполни `/technical-retro` и **остановись**.
|
|
31
|
+
5. **Старт** — вызови subagent для `pipeline.steps[0].agent`:
|
|
32
|
+
- передай slug, пути к артефактам, scope из step (если есть);
|
|
33
|
+
- обнови `status.json`: `pipelineIndex: 0`, `currentAgent`, `state: in_progress`.
|
|
34
|
+
6. **Human gate** — если после текущего шага есть gate в `humanGates` (`after:<agent>`), после завершения агента **остановись** и попроси `/task-continue <slug>` (или `/feature-continue <slug>`).
|
|
35
|
+
|
|
36
|
+
## Не делать
|
|
37
|
+
|
|
38
|
+
- Не вызывать developer до router и (если в pipeline) analyst/architect.
|
|
39
|
+
- Не hardcode порядок ролей — только `pipeline.json`.
|
|
40
|
+
- Не пропускать human gate без явного continue.
|
|
41
|
+
|
|
42
|
+
## Если slug занят
|
|
43
|
+
|
|
44
|
+
- `awaitingHumanGate` / `state: awaiting_approval` → предложи ревью артефактов или `/task-continue <slug>`.
|
|
45
|
+
- `in_progress` → спроси: продолжить или новый slug.
|
|
46
|
+
|
|
47
|
+
## Legacy
|
|
48
|
+
|
|
49
|
+
`/feature-start` и `/feature-continue` остаются совместимыми; для новых задач предпочитай `/task`.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: technical-retro
|
|
3
|
+
description: Facilitate a technical retrospective for a period, incident, release, or completed agent-team task slug.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Техническое ретро — роль агента
|
|
7
|
+
|
|
8
|
+
Агент выступает как **нейтральный фасилитатор технической ретроспективы**, а не как ревьюер кода или оценщик людей. Цель — вынести уроки, согласовать действия и улучшить процесс разработки. Используй skill **`technical-retro`** как основной сценарий.
|
|
9
|
+
|
|
10
|
+
## Когда включать
|
|
11
|
+
|
|
12
|
+
- Пользователь просит: «ретро», «техническое ретро», «разбор спринта/итерации», «что пошло хорошо / плохо», «action items после релиза».
|
|
13
|
+
- Есть контекст: период (спринт, квартал), тема (релиз, инцидент, миграция), или приложены заметки/линки.
|
|
14
|
+
|
|
15
|
+
## Входные данные (запросить при нехватке)
|
|
16
|
+
|
|
17
|
+
- **Период и фокус** (например: две недели, релиз X, постмортем).
|
|
18
|
+
- **Участники/роли** (если важно для формулировок): только разработка или весь кросс‑функциональный поток.
|
|
19
|
+
- **Ограничения**: время (15 / 30 / 60 мин), формат (async в чате vs синхронная повестка).
|
|
20
|
+
- По желанию: список deliverables, метрики, ссылки на тикеты/MR — **без выдумывания** фактов, которых нет в сообщении или репозитории.
|
|
21
|
+
|
|
22
|
+
Если контекста мало — задать **1–3 коротких уточняющих вопроса**, затем продолжить с явными допущениями в шапке вывода.
|
|
23
|
+
|
|
24
|
+
## Принципы фасилитации
|
|
25
|
+
|
|
26
|
+
- **Безопасность и нейтральность**: формулировки про процесс и систему, не про «виноватых»; избегать ярлыков к людям.
|
|
27
|
+
- **Конкретика**: от абстрактного «надо лучше общаться» — к наблюдаемым событиям и договорённостям.
|
|
28
|
+
- **Баланс**: зафиксировать и позитив (что усилить), и зоны роста.
|
|
29
|
+
- **Один владелец и срок** у каждого action item; избегать списка «сделает команда» без имени/роли.
|
|
30
|
+
- **Не смешивать с code review**: ретро не заменяет построчный разбор диффа; при запросе «и ретро, и ревью» — развести два блока в ответе.
|
|
31
|
+
|
|
32
|
+
## Рекомендуемая структура сессии (по умолчанию)
|
|
33
|
+
|
|
34
|
+
Подстроить под указанное время. Для короткого async‑формата — сжать до шагов 2–4.
|
|
35
|
+
|
|
36
|
+
1. **Цель и рамки** (1–2 предложения): зачем встреча, что в фокусе / что вне скоупа.
|
|
37
|
+
2. **Сбор фактов** (молча в чате — списком от пользователя; агент структурирует):
|
|
38
|
+
- что шло хорошо,
|
|
39
|
+
- что мешало / вызывало риски,
|
|
40
|
+
- сюрпризы (технический долг, узкие места, зависимости).
|
|
41
|
+
3. **Группировка тем**: объединить дубли, выделить 3–7 тем для обсуждения (приоритет — влияние × изменяемость).
|
|
42
|
+
4. **Корневые причины (легко)**: для 1–2 самых болезненных тем — кратко «5 почему» или «что в процессе/артефактах позволило этому случиться», без морализаторства.
|
|
43
|
+
5. **Эксперименты на следующий цикл**: не больше 1–3 изменений процесса/инструментов; каждое — измеримое или с явным критерием «успех/не успех».
|
|
44
|
+
6. **Action items**: таблица или список с **что / владелец / до когда / как поймём, что сработало**.
|
|
45
|
+
|
|
46
|
+
## Формат ответа агента
|
|
47
|
+
|
|
48
|
+
- Краткая **шапка**: период, фокус, допущения (если были).
|
|
49
|
+
- **Повестка** или итог по этапам выше.
|
|
50
|
+
- **Темы** — буллеты; по спорным местам — **вопросы команде**, а не окончательные выводы без данных.
|
|
51
|
+
- **Решения и эксперименты** отдельным блоком.
|
|
52
|
+
- **Action items** — в конце, каждый пункт с владельцем и дедлайном (или пометка «нужно назначить на встрече»).
|
|
53
|
+
|
|
54
|
+
## Ограничения
|
|
55
|
+
|
|
56
|
+
- Не приписывать команде цитаты или факты, которых не было во входе.
|
|
57
|
+
- Не выдавать юридические/HR‑рекомендации; при явных конфликтах или токсичности — мягко предложить эскалацию человеку, ответственному за команду, без детализации «наказаний».
|
|
58
|
+
- Если пользователь просит только шаблон — выдать **шаблон повестки и доски** (колонки, таймбоксы) без выдуманного контента.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# `.claude/hooks` (preset java)
|
|
2
|
+
|
|
3
|
+
| File | Purpose |
|
|
4
|
+
|------|---------|
|
|
5
|
+
| `chain-team-phases.sh` | Pipeline chaining after subagent stop (`TEAM_ROOT=.claude/team`) |
|
|
6
|
+
| `guard-shell-command.sh` | Destructive git / JS package-manager guard; **allows** `mvn test / ./gradlew test` / `compiler/IDE inspections` / `configured static analysis` / `repo static analysis` |
|
|
7
|
+
|
|
8
|
+
Claude Code may not use Cursor `hooks.json`. Wire scripts per project docs when enabling agent-team auto-chain.
|
|
9
|
+
|
|
10
|
+
**No `hooks.json` in Claude preset** (platform limit — same as next Claude).
|
|
11
|
+
|
|
12
|
+
## Optional cookbook
|
|
13
|
+
|
|
14
|
+
Example scripts live in `hooks/examples/` (secret-guard, format-edited, test-on-save). They are **not** auto-enabled.
|
|
15
|
+
|
|
16
|
+
To wire in Claude Code: copy an `.example.sh` into `hooks/`, make executable, and register per [Claude Code hooks](https://code.claude.com/docs/en/hooks) for your project. Keep stack-safe recipes (this preset: **java**). Cursor twin examples under `presets/cursor/java/hooks/examples/` are the same allowlist forks.
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# preset: java (hexagonal) — chain handoffs use integration-test-* + post-change-test + java-tooling
|
|
3
|
+
# Chains agent team steps from pipeline.json after subagentStop.
|
|
4
|
+
# Falls back to legacy phase-based flow when pipeline.json is absent.
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
input=$(cat)
|
|
9
|
+
|
|
10
|
+
INPUT="$input" node <<'NODE'
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
|
|
14
|
+
const TEAM_ROOT = path.join(process.cwd(), '.claude', 'team');
|
|
15
|
+
|
|
16
|
+
const inputRaw = process.env.INPUT || '';
|
|
17
|
+
let hookInput;
|
|
18
|
+
try {
|
|
19
|
+
hookInput = JSON.parse(inputRaw);
|
|
20
|
+
} catch {
|
|
21
|
+
process.stdout.write('{}');
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (hookInput.status !== 'completed') {
|
|
26
|
+
process.stdout.write('{}');
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const activePath = path.join(TEAM_ROOT, 'active-task.json');
|
|
31
|
+
|
|
32
|
+
if (!fs.existsSync(activePath)) {
|
|
33
|
+
process.stdout.write('{}');
|
|
34
|
+
process.exit(0);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let active;
|
|
38
|
+
try {
|
|
39
|
+
active = JSON.parse(fs.readFileSync(activePath, 'utf8'));
|
|
40
|
+
} catch {
|
|
41
|
+
process.stdout.write('{}');
|
|
42
|
+
process.exit(0);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const slug = active.slug;
|
|
46
|
+
if (!slug) {
|
|
47
|
+
process.stdout.write('{}');
|
|
48
|
+
process.exit(0);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const taskDir = path.join(TEAM_ROOT, 'tasks', slug);
|
|
52
|
+
const statusPath = path.join(taskDir, 'status.json');
|
|
53
|
+
const pipelinePath = path.join(taskDir, 'pipeline.json');
|
|
54
|
+
|
|
55
|
+
if (!fs.existsSync(statusPath)) {
|
|
56
|
+
process.stdout.write('{}');
|
|
57
|
+
process.exit(0);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
let status;
|
|
61
|
+
try {
|
|
62
|
+
status = JSON.parse(fs.readFileSync(statusPath, 'utf8'));
|
|
63
|
+
} catch {
|
|
64
|
+
process.stdout.write('{}');
|
|
65
|
+
process.exit(0);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const now = new Date().toISOString();
|
|
69
|
+
|
|
70
|
+
function writeStatus(next) {
|
|
71
|
+
status = { ...status, ...next, slug, updatedAt: now };
|
|
72
|
+
fs.writeFileSync(statusPath, JSON.stringify(status, null, 2) + '\n');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function out(message) {
|
|
76
|
+
process.stdout.write(JSON.stringify({ followup_message: message }));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function readArtifact(name) {
|
|
80
|
+
const p = path.join(taskDir, name);
|
|
81
|
+
if (!fs.existsSync(p)) return '';
|
|
82
|
+
try {
|
|
83
|
+
return fs.readFileSync(p, 'utf8');
|
|
84
|
+
} catch {
|
|
85
|
+
return '';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function getStepAgents(step) {
|
|
90
|
+
if (!step) return [];
|
|
91
|
+
return Array.isArray(step.agent) ? step.agent : [step.agent];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function skipIfMatches(skipIf, dir) {
|
|
95
|
+
if (!skipIf) return false;
|
|
96
|
+
if (skipIf === 'debugger.fixed') {
|
|
97
|
+
const text = readArtifact('debug-report.md');
|
|
98
|
+
return /fixApplied:\s*true/i.test(text) || /\*\*Fix applied:\*\*\s*true/i.test(text);
|
|
99
|
+
}
|
|
100
|
+
if (skipIf === 'ci-investigator.resolved') {
|
|
101
|
+
const text = readArtifact('ci-report.md');
|
|
102
|
+
return /fixApplied:\s*true/i.test(text) || /## Verdict\s*\nPASS/i.test(text);
|
|
103
|
+
}
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function findNextExecutableStep(steps, startIdx, dir) {
|
|
108
|
+
for (let i = startIdx; i < steps.length; i++) {
|
|
109
|
+
if (!skipIfMatches(steps[i].skipIf, dir)) {
|
|
110
|
+
return { step: steps[i], index: i };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const AGENT_HANDOFF = {
|
|
117
|
+
'task-analyst': (s) =>
|
|
118
|
+
`Invoke task-analyst for slug "${s}". Write brief.md and decomposition.md under .claude/team/tasks/${s}/. ` +
|
|
119
|
+
`Set status.json: phase executing, state awaiting_approval if human gate applies. Do not use legacy phase analysis.`,
|
|
120
|
+
debugger: (s) =>
|
|
121
|
+
`Invoke debugger subagent for slug "${s}". Investigate root cause with mvn test / ./gradlew test/logs; write debug-report.md with fixApplied: true/false. ` +
|
|
122
|
+
`Update status.json when done.`,
|
|
123
|
+
'solution-architect': (s) =>
|
|
124
|
+
`Invoke solution-architect for slug "${s}". Read brief.md; write architecture.md for Java hexagonal layers. Update status.json when done.`,
|
|
125
|
+
'migration-specialist': (s) =>
|
|
126
|
+
`Invoke migration-specialist for slug "${s}". Read brief.md; write migration-plan.md for Java build/toolchain. Update status.json when done.`,
|
|
127
|
+
'api-contract-reviewer': (s) =>
|
|
128
|
+
`Invoke api-contract-reviewer (readonly) for slug "${s}". Review OpenAPI/Protobuf vs adapters; write api-contract-review.md. Update status.json when done.`,
|
|
129
|
+
'ci-investigator': (s) =>
|
|
130
|
+
`Invoke ci-investigator for slug "${s}". Diagnose CI failure (mvn test / ./gradlew test/vet/lint or preset-structure); write ci-report.md; apply minimal fix. ` +
|
|
131
|
+
`Use ci-investigation skill. Update status.json when done.`,
|
|
132
|
+
'feature-developer': (s) =>
|
|
133
|
+
`Invoke feature-developer for slug "${s}". Read brief.md, decomposition.md, validation-report.md, review.md, architecture.md, migration-plan.md, api-contract-review.md, debug-report.md if present. ` +
|
|
134
|
+
`Follow feature-delivery-workflow.mdc and reference-features.mdc. Prefer src/main/java domain|application|adapters and configuration/*Application.java composition root. ` +
|
|
135
|
+
`Include parameterized/JUnit mvn test / ./gradlew test coverage for domain/use cases before handoff. Update status.json when done.`,
|
|
136
|
+
'build-verifier': (s) =>
|
|
137
|
+
`Invoke build-verifier (readonly) for slug "${s}". Follow java-tooling.mdc and post-change-test.mdc. ` +
|
|
138
|
+
`Run mvn test / ./gradlew test and configured static analysis if present in repo/CI — never yarn/ESLint/Stylelint. ` +
|
|
139
|
+
`For preset packaging: yarn check:preset-structure. Write validation-report.md. Set state completed or validation_failed. Do not edit production code.`,
|
|
140
|
+
'performance-auditor': (s) =>
|
|
141
|
+
`Invoke performance-auditor (readonly) for slug "${s}". Audit Java hot paths/allocs/DB N+1/profiler/JFR risks; write perf-report.md. Update status.json when done.`,
|
|
142
|
+
'code-reviewer': (s) =>
|
|
143
|
+
`Invoke code-reviewer subagent (readonly) for slug "${s}". Review git diff vs brief.md per code-review-mr.mdc (hexagonal boundaries). ` +
|
|
144
|
+
`Update status.json when done.`,
|
|
145
|
+
'security-reviewer': (s) =>
|
|
146
|
+
`Invoke security-reviewer (readonly) for slug "${s}". Follow security-java.mdc; write security-review.md. Update status.json when done.`,
|
|
147
|
+
'qa-tester': (s, scope) =>
|
|
148
|
+
`Invoke qa-tester for slug "${s}"${scope ? ` (scope: ${scope})` : ''}. ` +
|
|
149
|
+
`Add/update JUnit unit and integration tests per brief. Follow tests-unit.mdc, tests-integration.mdc, and skill integration-testing. Update status.json when done.`,
|
|
150
|
+
'unit-test-planner': (s) =>
|
|
151
|
+
`Invoke unit-test-planner for slug "${s}". Write unit-test-plan.md for parameterized/JUnit mvn test / ./gradlew test. Use unit-testing skill. Update status.json when done.`,
|
|
152
|
+
'unit-test-generator': (s) =>
|
|
153
|
+
`Invoke unit-test-generator for slug "${s}". Implement *Test.java / *Tests.java from unit-test-plan.md under src/test/java. Use unit-testing skill. Update status.json when done.`,
|
|
154
|
+
'unit-test-healer': (s) =>
|
|
155
|
+
`Invoke unit-test-healer for slug "${s}". Fix failing unit tests. Use unit-testing and debug-investigation skills. Update status.json when done.`,
|
|
156
|
+
'integration-test-planner': (s) =>
|
|
157
|
+
`Invoke integration-test-planner for slug "${s}". Create/update integration test plans (MockMvc/Testcontainers/testcontainers/adapter contracts). ` +
|
|
158
|
+
`Follow tests-integration.mdc and the integration-testing skill. Do not use browser e2e tooling. Update status.json when done.`,
|
|
159
|
+
'integration-test-generator': (s) =>
|
|
160
|
+
`Invoke integration-test-generator for slug "${s}". Generate/update *IT.java / *IntegrationTest.java from plans. ` +
|
|
161
|
+
`Follow tests-integration.mdc and the integration-testing skill. Do not use browser e2e tooling. Update status.json when done.`,
|
|
162
|
+
'integration-test-healer': (s) =>
|
|
163
|
+
`Invoke integration-test-healer for slug "${s}". Fix failing/flaky integration tests while preserving plan assertions. ` +
|
|
164
|
+
`Follow tests-integration.mdc, integration-testing, and debug-investigation. Do not use browser e2e tooling. Update status.json when done.`,
|
|
165
|
+
'tech-writer': (s) =>
|
|
166
|
+
`Invoke tech-writer for slug "${s}". Write documentation.md from task artifacts. Update status.json when done.`,
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const REVIEW_AGENTS = new Set([
|
|
170
|
+
'code-reviewer',
|
|
171
|
+
'security-reviewer',
|
|
172
|
+
'api-contract-reviewer',
|
|
173
|
+
]);
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
function handoffForAgent(agent, scope) {
|
|
177
|
+
const fn = AGENT_HANDOFF[agent];
|
|
178
|
+
return fn ? fn(slug, scope) : `Invoke ${agent} subagent for slug "${slug}". Update status.json when done.`;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function handoffForParallelStep(step) {
|
|
182
|
+
const agents = getStepAgents(step);
|
|
183
|
+
return (
|
|
184
|
+
`Invoke IN PARALLEL (one message, multiple Task calls): ${agents.join(' AND ')} for slug "${slug}". ` +
|
|
185
|
+
`Each agent writes its artifact and appends itself to status.json parallelCompleted when done.`
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function hasGateAfter(agent, humanGates) {
|
|
190
|
+
return Array.isArray(humanGates) && humanGates.includes(`after:${agent}`);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function hasGateAfterStep(step, humanGates) {
|
|
194
|
+
return getStepAgents(step).some((a) => hasGateAfter(a, humanGates));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function legacyFlow() {
|
|
198
|
+
if (status.phase === 'analysis') {
|
|
199
|
+
process.stdout.write('{}');
|
|
200
|
+
process.exit(0);
|
|
201
|
+
}
|
|
202
|
+
if (status.phase === 'development' && (status.state === 'completed' || status.state === 'in_progress')) {
|
|
203
|
+
writeStatus({ phase: 'executing', state: 'in_progress', currentAgent: 'build-verifier' });
|
|
204
|
+
out(handoffForAgent('build-verifier'));
|
|
205
|
+
process.exit(0);
|
|
206
|
+
}
|
|
207
|
+
if (status.currentAgent === 'build-verifier' && status.state === 'completed') {
|
|
208
|
+
writeStatus({ phase: 'executing', state: 'in_progress', currentAgent: 'code-reviewer' });
|
|
209
|
+
out(handoffForAgent('code-reviewer'));
|
|
210
|
+
process.exit(0);
|
|
211
|
+
}
|
|
212
|
+
if (status.phase === 'review' && status.state === 'completed') {
|
|
213
|
+
writeStatus({ phase: 'executing', state: 'in_progress', currentAgent: 'qa-tester' });
|
|
214
|
+
out(handoffForAgent('qa-tester'));
|
|
215
|
+
process.exit(0);
|
|
216
|
+
}
|
|
217
|
+
if (status.state === 'changes_requested' && REVIEW_AGENTS.has(status.currentAgent)) {
|
|
218
|
+
writeStatus({
|
|
219
|
+
currentAgent: 'feature-developer',
|
|
220
|
+
state: 'in_progress',
|
|
221
|
+
phase: 'executing',
|
|
222
|
+
retryAfterFix: status.currentAgent,
|
|
223
|
+
});
|
|
224
|
+
out(
|
|
225
|
+
handoffForAgent('feature-developer') +
|
|
226
|
+
` After fixes, re-run ${status.currentAgent}.`,
|
|
227
|
+
);
|
|
228
|
+
process.exit(0);
|
|
229
|
+
}
|
|
230
|
+
if (status.state === 'validation_failed' && status.currentAgent === 'build-verifier') {
|
|
231
|
+
writeStatus({
|
|
232
|
+
currentAgent: 'feature-developer',
|
|
233
|
+
state: 'in_progress',
|
|
234
|
+
phase: 'executing',
|
|
235
|
+
retryAfterFix: 'build-verifier',
|
|
236
|
+
});
|
|
237
|
+
out(
|
|
238
|
+
handoffForAgent('feature-developer') +
|
|
239
|
+
` Read validation-report.md. After fixes, re-run build-verifier.`,
|
|
240
|
+
);
|
|
241
|
+
process.exit(0);
|
|
242
|
+
}
|
|
243
|
+
if (status.state === 'completed' && status.retryAfterFix) {
|
|
244
|
+
const retry = status.retryAfterFix;
|
|
245
|
+
writeStatus({ currentAgent: retry, state: 'in_progress', retryAfterFix: null });
|
|
246
|
+
out(handoffForAgent(retry));
|
|
247
|
+
process.exit(0);
|
|
248
|
+
}
|
|
249
|
+
if (status.phase === 'testing' && status.state === 'completed') {
|
|
250
|
+
writeStatus({ phase: 'done', state: 'completed' });
|
|
251
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
252
|
+
process.exit(0);
|
|
253
|
+
}
|
|
254
|
+
process.stdout.write('{}');
|
|
255
|
+
process.exit(0);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (!fs.existsSync(pipelinePath)) {
|
|
259
|
+
legacyFlow();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
let pipeline;
|
|
263
|
+
try {
|
|
264
|
+
pipeline = JSON.parse(fs.readFileSync(pipelinePath, 'utf8'));
|
|
265
|
+
} catch {
|
|
266
|
+
legacyFlow();
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const steps = pipeline.steps || [];
|
|
270
|
+
if (steps.length === 0 || pipeline.autoChain === false) {
|
|
271
|
+
process.stdout.write('{}');
|
|
272
|
+
process.exit(0);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (status.awaitingHumanGate || status.state === 'awaiting_approval') {
|
|
276
|
+
process.stdout.write('{}');
|
|
277
|
+
process.exit(0);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (status.state === 'changes_requested' && REVIEW_AGENTS.has(status.currentAgent)) {
|
|
281
|
+
const reviewer = status.currentAgent;
|
|
282
|
+
writeStatus({
|
|
283
|
+
currentAgent: 'feature-developer',
|
|
284
|
+
state: 'in_progress',
|
|
285
|
+
phase: 'executing',
|
|
286
|
+
retryAfterFix: reviewer,
|
|
287
|
+
});
|
|
288
|
+
out(
|
|
289
|
+
handoffForAgent('feature-developer') +
|
|
290
|
+
` After fixes, re-run ${reviewer}.`,
|
|
291
|
+
);
|
|
292
|
+
process.exit(0);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
if (status.state === 'validation_failed' && status.currentAgent === 'build-verifier') {
|
|
296
|
+
writeStatus({
|
|
297
|
+
currentAgent: 'feature-developer',
|
|
298
|
+
state: 'in_progress',
|
|
299
|
+
phase: 'executing',
|
|
300
|
+
retryAfterFix: 'build-verifier',
|
|
301
|
+
});
|
|
302
|
+
out(
|
|
303
|
+
handoffForAgent('feature-developer') +
|
|
304
|
+
` Read validation-report.md. After fixes, re-run build-verifier.`,
|
|
305
|
+
);
|
|
306
|
+
process.exit(0);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (status.state === 'completed' && status.retryAfterFix) {
|
|
310
|
+
const retry = status.retryAfterFix;
|
|
311
|
+
writeStatus({ currentAgent: retry, state: 'in_progress', retryAfterFix: null });
|
|
312
|
+
out(handoffForAgent(retry));
|
|
313
|
+
process.exit(0);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const idx = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
|
|
317
|
+
const currentStep = steps[idx];
|
|
318
|
+
if (!currentStep) {
|
|
319
|
+
writeStatus({ phase: 'done', state: 'completed', currentAgent: null });
|
|
320
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
321
|
+
process.exit(0);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
const completedAgent = status.currentAgent || getStepAgents(currentStep)[0];
|
|
325
|
+
const stepAgents = getStepAgents(currentStep);
|
|
326
|
+
|
|
327
|
+
if (currentStep.parallel && stepAgents.length > 1) {
|
|
328
|
+
const done = [...(status.parallelCompleted || [])];
|
|
329
|
+
if (completedAgent && !done.includes(completedAgent)) {
|
|
330
|
+
done.push(completedAgent);
|
|
331
|
+
}
|
|
332
|
+
writeStatus({ parallelCompleted: done });
|
|
333
|
+
const remaining = stepAgents.filter((a) => !done.includes(a));
|
|
334
|
+
if (remaining.length > 0) {
|
|
335
|
+
process.stdout.write('{}');
|
|
336
|
+
process.exit(0);
|
|
337
|
+
}
|
|
338
|
+
writeStatus({ parallelCompleted: [] });
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (hasGateAfterStep(currentStep, pipeline.humanGates)) {
|
|
342
|
+
writeStatus({
|
|
343
|
+
awaitingHumanGate: true,
|
|
344
|
+
state: 'awaiting_approval',
|
|
345
|
+
currentAgent: completedAgent,
|
|
346
|
+
});
|
|
347
|
+
process.stdout.write('{}');
|
|
348
|
+
process.exit(0);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
const next = findNextExecutableStep(steps, idx + 1, taskDir);
|
|
352
|
+
if (!next) {
|
|
353
|
+
writeStatus({
|
|
354
|
+
pipelineIndex: steps.length,
|
|
355
|
+
phase: 'done',
|
|
356
|
+
state: 'completed',
|
|
357
|
+
currentAgent: null,
|
|
358
|
+
awaitingHumanGate: false,
|
|
359
|
+
});
|
|
360
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
361
|
+
process.exit(0);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const { step: nextStep, index: nextIdx } = next;
|
|
365
|
+
const nextAgents = getStepAgents(nextStep);
|
|
366
|
+
|
|
367
|
+
writeStatus({
|
|
368
|
+
pipelineIndex: nextIdx,
|
|
369
|
+
currentAgent: nextAgents[0],
|
|
370
|
+
phase: 'executing',
|
|
371
|
+
state: 'in_progress',
|
|
372
|
+
awaitingHumanGate: false,
|
|
373
|
+
parallelCompleted: [],
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
if (nextStep.parallel && nextAgents.length > 1) {
|
|
377
|
+
out(handoffForParallelStep(nextStep));
|
|
378
|
+
} else {
|
|
379
|
+
out(handoffForAgent(nextAgents[0], nextStep.scope));
|
|
380
|
+
}
|
|
381
|
+
NODE
|
|
@@ -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 / configured static analysis on edited Java 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 '\.java$' || true)
|
|
6
|
+
if [[ -n "${changed:-}" ]]; then
|
|
7
|
+
# Prefer repo wrapper / Spotless / formatter already configured — placeholders only:
|
|
8
|
+
# ./mvnw spotless:apply OR ./gradlew spotlessApply OR google-java-format -i $changed
|
|
9
|
+
true
|
|
10
|
+
fi
|
|
11
|
+
exit 0
|