@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
package/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,74 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
### Review follow-ups (core sharing / structure)
|
|
6
|
+
|
|
7
|
+
- **Shared-core drift is a hard gate** in `check:preset-structure` / CI (`AI_RULES_DRIFT_FAIL=1`).
|
|
8
|
+
- **build-verifier** agents (next/ios-swift/go/java × Cursor+Claude): twin / REPO_AGENTS / react-performance gates list all four stacks.
|
|
9
|
+
- **Leakage core DRY:** merged go+java forbidden blocks in `meta/preset-no-cross-stack-leakage` (+8 embed adapters).
|
|
10
|
+
- **ios-swift session-start:** trimmed `ios-app-core` toward stretch ≤100 body sum.
|
|
11
|
+
- **Docs:** leakage soft-WARN baseline + drift hardgate in `PRESET-CONTRIBUTION.md`; go/java `feature-full` fixtures drop Playwright/XCUITest skipped noise.
|
|
12
|
+
|
|
13
|
+
### Java preset
|
|
14
|
+
|
|
15
|
+
- New installable preset **`java`** (Cursor + Claude twins): Spring Boot hexagonal default, layer-first single-module layout, Context7-only MCP, Maven/Gradle detection via `java-tooling` / `post-change-test`.
|
|
16
|
+
- Full mapped rule catalog (~32 stems); always-on trio `java-app-core`, `architecture-boundaries`, `code-quality-and-refactoring` (≤120 body lines).
|
|
17
|
+
- Agent-team surface: 21 agents, 8 skills, 5 commands, hooks + team fixtures; `integration-test-*` (no Playwright/XCUITest/a11y).
|
|
18
|
+
- Structure scripts (`twin-map`, `token-budget`, `leakage`) include `java`; meta cores list four stacks (8 adapters per embed stem).
|
|
19
|
+
- Install: `npx @bonesofspring/ai-rules init cursor|claude --preset java`.
|
|
20
|
+
- Platform asymmetry: `BUGBOT.md` + `hooks.json` Cursor-only; `CLAUDE.md` Claude-only.
|
|
21
|
+
|
|
22
|
+
### Claude Code handbook agent discipline
|
|
23
|
+
|
|
24
|
+
Borrowed workflow patterns from [claude-code-rules](https://github.com/nikiforovall/claude-code-rules) (methodology marketplace — not coding standards). Additive on top of structure-change / preset-rules-improvements work.
|
|
25
|
+
|
|
26
|
+
- **`feature-developer` ×6:** Zero improvisation + Will / Will not (scope discipline; clarify before guessing).
|
|
27
|
+
- **`feature-delivery` skill ×6:** short Scope discipline pointer.
|
|
28
|
+
- **`codebase-analyzer` agent ×6:** explain-as-is only; AGENTS/CLAUDE + agents README pointers; roster next/ios **22**, go **21**.
|
|
29
|
+
- **`code-review` skill ×6:** Reuse + Efficiency lenses.
|
|
30
|
+
- **`technical-retro` skill ×6:** wrong-turn taxonomy + conventions.md feedback (Rule of Three); full skill body on next/go/ios (not alias-only); no auto-apply.
|
|
31
|
+
- **`agent-team-intake` / `agent-team-orchestrator`:** pure questions → prefer **`codebase-analyzer`** (aligned with AGENTS/CLAUDE maps).
|
|
32
|
+
- **`docs/PRESET-CONTRIBUTION.md`:** Building blocks matrix (rule / command / skill / agent / conventions / hook).
|
|
33
|
+
|
|
34
|
+
### Awesome-cursorrules borrow backlog
|
|
35
|
+
|
|
36
|
+
- **`security-next`** (cursor + claude next): coding-time secrets/auth/XSS/Server Actions rule; wired into `security-reviewer`, catalogs, AGENTS/CLAUDE quick start.
|
|
37
|
+
- **Anti-hallucination banlists:** `next-app-router`, `go-conventions`, `swift-conventions` (❌/✅ tables).
|
|
38
|
+
- **Review output contract** in shared `review/code-review-mr` (+6 adapters) and all 6 `code-review` skills: `path:line`, severity `blocker|important|nit`, verdict line.
|
|
39
|
+
- **Go:** expanded `go-conventions` (errors/interfaces/concurrency); `api-http` resilience (idempotency, bulkheads, thin handlers) — catalog depth stub→full.
|
|
40
|
+
- **iOS:** `swiftui-ui` lifecycle/ownership (`.task`, DI vs `@StateObject`, hit testing).
|
|
41
|
+
- **Shared quality:** Agent discipline (anti-sycophancy) section in `quality/code-quality-and-refactoring` (+6 adapters).
|
|
42
|
+
|
|
43
|
+
### Preset rules improvements (9 items)
|
|
44
|
+
|
|
45
|
+
Cross-cutting preset packaging work (all six presets unless noted **next-only**). Hard gates unchanged: twin sync, ≤3 always-on, no cross-stack leakage.
|
|
46
|
+
|
|
47
|
+
| # | Item | Unreleased note |
|
|
48
|
+
|---|------|-----------------|
|
|
49
|
+
| 1 | Root `AGENTS.md` + **CLI** | `repoRootFiles`: `REPO_AGENTS.md` → `<cwd>/AGENTS.md` on cursor **and** claude `init` (overwrite policy A); removed on `clean` either tool |
|
|
50
|
+
| 2 | Incorrect/Correct samples | **next only** — 9 domain rules with emedcard-grounded pairs |
|
|
51
|
+
| 3 | Impact tags | `impact: CRITICAL\|HIGH\|MEDIUM\|LOW` frontmatter; documented in PRESET-CONTRIBUTION |
|
|
52
|
+
| 4 | Eval harness (opt-in) | `eval/next/manifest.json`, `check-rule-eval.mjs`, `yarn check:rule-eval`, workflow `rule-eval.yml` |
|
|
53
|
+
| 5 | Living conventions | `reference-features` lineage + `team/conventions.md` ×6 |
|
|
54
|
+
| 6 | Hooks cookbook | `hooks/examples/` (secret-guard, format-edited, test-on-save); default `hooks.json` unchanged |
|
|
55
|
+
| 7 | Skill `write-adr` | ×6 presets (on-demand) |
|
|
56
|
+
| 8 | Skill `react-performance` | **next only** (cursor + claude) |
|
|
57
|
+
| 9 | Linter-delegated style | Stack notes in code-quality adapters; `arrow-functions` trimmed → ESLint/Stylelint + `post-change-lint` |
|
|
58
|
+
|
|
5
59
|
### Added
|
|
6
60
|
|
|
61
|
+
- **CLI `repoRootFiles` + root `AGENTS.md` (all stacks):** preset source `REPO_AGENTS.md` → `<cwd>/AGENTS.md` on cursor **and** claude `init` (overwrite); removed on `clean`. Lean cross-tool sections + pointer to `team/conventions.md`.
|
|
62
|
+
- **Impact frontmatter:** `impact: CRITICAL|HIGH|MEDIUM|LOW` documented in `docs/PRESET-CONTRIBUTION.md`; applied on next golden domain rules with Incorrect/Correct samples.
|
|
63
|
+
- **Next Incorrect/Correct samples** on 9 domain rules (architecture-boundaries, public-imports, api-services, store-rtk, react-ui, tests-unit, http-client, layer-barrel-exports, arrow-functions) + Claude twins.
|
|
64
|
+
- **Opt-in eval:** `eval/next/manifest.json`, `scripts/check-rule-eval.mjs`, `yarn check:rule-eval`, workflow `.github/workflows/rule-eval.yml` (not in `check:preset-structure`).
|
|
65
|
+
- **Living conventions:** lineage section in `reference-features.template.md` + 6 adapters; `team/conventions.md` template ×6.
|
|
66
|
+
- **Skills:** `write-adr` ×6; `react-performance` ×2 (next cursor+claude only).
|
|
67
|
+
- **Hooks cookbook:** `hooks/examples/` (secret-guard, format-edited, test-on-save) ×3 stacks ×2 platforms; default `hooks.json` unchanged.
|
|
68
|
+
- **Dogfood:** `sync-dogfood-cursor.sh` copies root `AGENTS.md` from `REPO_AGENTS.md`; seeds `team/conventions.md` if absent.
|
|
7
69
|
- **Always-on Principles** in shared `quality/code-quality-and-refactoring` (+6 adapters): compact § **Принципы** — KISS, DRY + Rule of Three, YAGNI, SOLID, CUPID, composition over inheritance, Law of Demeter hint. No smell/GoF catalogs in always-on.
|
|
8
70
|
- **Requestable `quality/design-guidance`** (+6 adapters, Cursor/Claude × next/ios-swift/go): curated Fowler smells (≤12) + GoF (≤8) + skip/avoid; globs `app/src/**/*.{ts,tsx}` / `**/*.swift` / `**/*.go`. Cross-refs in `feature-delivery-workflow` (ubiquitous language) and `code-review-mr` checklist. One-liner wiring in feature-developer / code-review / debugger (+ recommended roles).
|
|
9
71
|
- **Go hexagonal preset (`go`):** Cursor + Claude twins — 32 rules (always-on: `go-app-core`, `architecture-boundaries`, `code-quality-and-refactoring`), 20 agents (`integration-test-*`, no a11y/Playwright/XCUITest), 7 skills (+ `integration-testing`), hooks/commands/team/MCP. Structure scripts `STACKS` include `go`; leakage `GO_FORBIDDEN_*` + pairwise chain forks. Install: `init cursor|claude --preset go`. Lineage markers on go `feature-delivery-workflow` / `reference-features`; go team fixtures / commands READMEs use Go gates (not xcodebuild/XCUITest copy-paste).
|
|
10
|
-
- **Preset structure CI gates:** `scripts/check-preset-{twin-map,token-budget,leakage,structure}.sh` + npm scripts `check:preset-*`; GitHub Actions workflow `.github/workflows/preset-structure.yml` on `packages/ai-rules/**` PRs. Hard FAIL on twin/budget/leakage
|
|
72
|
+
- **Preset structure CI gates:** `scripts/check-preset-{twin-map,token-budget,leakage,structure}.sh` + npm scripts `check:preset-*`; GitHub Actions workflow `.github/workflows/preset-structure.yml` on `packages/ai-rules/**` PRs. Hard FAIL on twin/budget/leakage/**shared-core drift** (`AI_RULES_DRIFT_FAIL=1` in structure orchestrator).
|
|
11
73
|
- **`presets/_shared/core/**`:** stack-agnostic shared prose (quality, agent-team, architecture templates, review, author meta-rules) with `<!-- shared-core: … -->` adapters in Cursor + Claude `next` and `ios-swift`.
|
|
12
74
|
- **Author meta-rules:** `preset-layering`, `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage` (never always-on / session-start).
|
|
13
75
|
- **Contributor docs:** `docs/PRESET-CONTRIBUTION.md` (layers, SoT, embed vs lineage sync modes, new-stack checklist).
|
|
@@ -19,6 +81,8 @@
|
|
|
19
81
|
|
|
20
82
|
### Changed
|
|
21
83
|
|
|
84
|
+
- **Style delegate:** next `arrow-functions` trimmed → ESLint/Stylelint + `post-change-lint`; ios/go Stack notes point to SwiftLint / golangci; abstract style sentence in shared code-quality core (no tool names in core body).
|
|
85
|
+
- **Leakage scan:** `hooks/**/*.sh` recursive (includes cookbook examples).
|
|
22
86
|
- **Meta twin policy (three stacks):** `preset-twin-sync` / `preset-pr-checklist` / `preset-layering` core + embeds name **next, ios-swift, and go**; twin FAIL applies to all three (`check-preset-twin-map.sh`).
|
|
23
87
|
- **PRESET-CONTRIBUTION:** shared-core sync step says **all six adapters** (3 stacks × 2 platforms), not «four presets».
|
|
24
88
|
- **Claude session-start count (Option A):** when counting rules without `paths:`, **exclude `**/README.md`**; intended trio remains **exactly 3**; body budget sums only those 3 (`preset-token-budget`, PRESET-CONTRIBUTION, build-verifier ×4).
|
package/README.md
CHANGED
|
@@ -32,6 +32,7 @@ If `.cursor` does not appear, check the command output for errors and confirm yo
|
|
|
32
32
|
- optional dirs when present: `agents/`, `hooks/`, `skills/`, `team/`
|
|
33
33
|
- Cursor root files: `hooks.json`, `BUGBOT.md`, `AGENTS.md`, `MCP.md`, `mcp.json`
|
|
34
34
|
- Claude: `CLAUDE.md`, `MCP.md` under `.claude/`; project `.mcp.json` at repo root
|
|
35
|
+
- **Both tools:** repo-root `AGENTS.md` (from preset `REPO_AGENTS.md`)
|
|
35
36
|
|
|
36
37
|
Any other files you added under `.cursor/` or `.claude/` (notes, local overrides, IDE state) are **left intact**. Older releases that deleted the whole tool directory are no longer the behavior.
|
|
37
38
|
|
|
@@ -43,18 +44,24 @@ Where things go on `init`:
|
|
|
43
44
|
| commands | `.cursor/commands` | `.claude/commands` |
|
|
44
45
|
| agents | `.cursor/agents` | `.claude/agents` |
|
|
45
46
|
| hooks | `.cursor/hooks`, `.cursor/hooks.json` | `.claude/hooks` |
|
|
47
|
+
| hooks cookbook | `.cursor/hooks/examples/` (not in default `hooks.json`) | `.claude/hooks/examples/` |
|
|
46
48
|
| skills | `.cursor/skills` | `.claude/skills` |
|
|
47
|
-
| team artifacts template | `.cursor/team` | `.claude/team` |
|
|
49
|
+
| team artifacts template | `.cursor/team` (incl. `conventions.md`) | `.claude/team` |
|
|
48
50
|
| MCP | `mcp.json` → `.cursor/mcp.json`, `MCP.md` → `.cursor/` | `mcp.json` → **`.mcp.json`** (project root), `MCP.md` → `.claude/` |
|
|
49
|
-
|
|
|
51
|
+
| tool map | `AGENTS.md` → `.cursor/AGENTS.md`, `BUGBOT.md` | `CLAUDE.md` → `.claude/CLAUDE.md` |
|
|
52
|
+
| **repo-root agents** | `REPO_AGENTS.md` → **`<cwd>/AGENTS.md`** | same |
|
|
50
53
|
|
|
51
|
-
|
|
54
|
+
Skills of note: `write-adr` (all stacks); `react-performance` (**next only**). Living gotchas: `team/conventions.md`. Opt-in rule samples eval: `yarn check:rule-eval` (workflow `rule-eval.yml`; not part of `check:preset-structure`).
|
|
55
|
+
|
|
56
|
+
The package ships presets including **`next`** (Next.js stack), **`ios-swift`** (iOS apps on Swift / SwiftUI), **`go`** (Go backends with hexagonal architecture), and **`java`** (Java / Spring Boot hexagonal backends). Other preset names: see `presets/` in the [repo](https://github.com/bonesofspring/ai-rules). Name is a single path segment, no `/` or `..`.
|
|
52
57
|
|
|
53
58
|
```bash
|
|
54
59
|
npx @bonesofspring/ai-rules init cursor --preset ios-swift
|
|
55
60
|
npx @bonesofspring/ai-rules init claude --preset ios-swift
|
|
56
61
|
npx @bonesofspring/ai-rules init cursor --preset go
|
|
57
62
|
npx @bonesofspring/ai-rules init claude --preset go
|
|
63
|
+
npx @bonesofspring/ai-rules init cursor --preset java
|
|
64
|
+
npx @bonesofspring/ai-rules init claude --preset java
|
|
58
65
|
```
|
|
59
66
|
|
|
60
67
|
Help: `ai-rules --help`.
|
|
@@ -65,8 +72,9 @@ Presets are developed in this monorepo under `presets/`. If you add or change ru
|
|
|
65
72
|
|
|
66
73
|
- **Taxonomy & layers:** [`presets/_shared/README.md`](presets/_shared/README.md) — shared core (`_shared/core`), stack adapters, platform packaging
|
|
67
74
|
- **Contribution guide:** [`docs/PRESET-CONTRIBUTION.md`](docs/PRESET-CONTRIBUTION.md) — SoT, twin sync, embed vs lineage, token budget (≤3 always-on), PR checklist, new stack preset, platform-only files (`BUGBOT.md`, `CLAUDE.md`)
|
|
68
|
-
- **Dogfood / drift scripts:** [`scripts/sync-dogfood-cursor.sh`](scripts/sync-dogfood-cursor.sh), [`scripts/check-shared-core-drift.sh`](scripts/check-shared-core-drift.sh)
|
|
69
|
-
- **Preset structure CI gates** (exit non-zero on FAIL): `yarn check:preset-structure` (or `bash scripts/check-preset-structure.sh`) — twin map, session-start budget (Option A), leakage
|
|
75
|
+
- **Dogfood / drift scripts:** [`scripts/sync-dogfood-cursor.sh`](scripts/sync-dogfood-cursor.sh) (also syncs root `AGENTS.md` from `REPO_AGENTS.md`; seeds `team/conventions.md` if absent), [`scripts/check-shared-core-drift.sh`](scripts/check-shared-core-drift.sh)
|
|
76
|
+
- **Preset structure CI gates** (exit non-zero on FAIL): `yarn check:preset-structure` (or `bash scripts/check-preset-structure.sh`) — twin map, session-start budget (Option A), leakage, shared-core drift (`AI_RULES_DRIFT_FAIL=1`)
|
|
77
|
+
- **Opt-in rule eval:** `yarn check:rule-eval` + `.github/workflows/rule-eval.yml` (`workflow_dispatch` + paths-scoped PR) — **not** wired into `check:preset-structure`
|
|
70
78
|
- **CLI note:** `_shared` is not an installable `--preset`; `init` copies only `presets/cursor/<name>/` or `presets/claude/<name>/`
|
|
71
79
|
|
|
72
80
|
MIT.
|
package/bin/cli.js
CHANGED
|
@@ -21,6 +21,8 @@ const PRESETS = {
|
|
|
21
21
|
mcpJsonSrc: 'mcp.json',
|
|
22
22
|
mcpJsonDest: '.cursor/mcp.json',
|
|
23
23
|
toolRootFiles: ['BUGBOT.md', 'AGENTS.md', 'MCP.md'],
|
|
24
|
+
/** Preset-root basename → path relative to cwd (not under .cursor/). */
|
|
25
|
+
repoRootFiles: { 'REPO_AGENTS.md': 'AGENTS.md' },
|
|
24
26
|
},
|
|
25
27
|
claude: {
|
|
26
28
|
rulesDir: '.claude/rules',
|
|
@@ -32,6 +34,8 @@ const PRESETS = {
|
|
|
32
34
|
mcpJsonSrc: 'mcp.json',
|
|
33
35
|
mcpJsonDest: '.mcp.json',
|
|
34
36
|
toolRootFiles: ['MCP.md'],
|
|
37
|
+
/** Same cross-tool root AGENTS.md as cursor (overwrite on init). */
|
|
38
|
+
repoRootFiles: { 'REPO_AGENTS.md': 'AGENTS.md' },
|
|
35
39
|
},
|
|
36
40
|
};
|
|
37
41
|
|
|
@@ -57,8 +61,10 @@ Options:
|
|
|
57
61
|
|
|
58
62
|
Notes:
|
|
59
63
|
init merges into the target directory; same-named files are overwritten.
|
|
60
|
-
Cursor init copies rules, commands, agents, hooks, skills, team, hooks.json, BUGBOT.md, AGENTS.md, MCP.md, mcp.json → .cursor/mcp.json.
|
|
64
|
+
Cursor init copies rules, commands, agents, hooks, skills, team, hooks.json, BUGBOT.md, AGENTS.md → .cursor/AGENTS.md, MCP.md, mcp.json → .cursor/mcp.json.
|
|
61
65
|
Claude init copies rules, commands, skills, agents, hooks, team, CLAUDE.md, MCP.md, and mcp.json → .mcp.json (project root).
|
|
66
|
+
Both tools also copy REPO_AGENTS.md → <cwd>/AGENTS.md (repo-root cross-tool agents file; overwrite).
|
|
67
|
+
clean removes tool dirs/files and <cwd>/AGENTS.md (shared across tools — re-init the other tool to restore).
|
|
62
68
|
Command forms: "init cursor --preset next", "init cursor next", "--preset next init cursor", "cursor init --preset next".
|
|
63
69
|
|
|
64
70
|
Examples:
|
|
@@ -66,9 +72,11 @@ Examples:
|
|
|
66
72
|
npx @bonesofspring/ai-rules init cursor next
|
|
67
73
|
npx @bonesofspring/ai-rules init cursor --preset ios-swift
|
|
68
74
|
npx @bonesofspring/ai-rules init cursor --preset go
|
|
75
|
+
npx @bonesofspring/ai-rules init cursor --preset java
|
|
69
76
|
npx @bonesofspring/ai-rules init claude
|
|
70
77
|
npx @bonesofspring/ai-rules init claude --preset ios-swift
|
|
71
78
|
npx @bonesofspring/ai-rules init claude --preset go
|
|
79
|
+
npx @bonesofspring/ai-rules init claude --preset java
|
|
72
80
|
npx @bonesofspring/ai-rules clean cursor
|
|
73
81
|
`);
|
|
74
82
|
}
|
|
@@ -255,6 +263,11 @@ function presetHasAnySource(base, cfg) {
|
|
|
255
263
|
return true;
|
|
256
264
|
}
|
|
257
265
|
}
|
|
266
|
+
for (const srcName of Object.keys(cfg.repoRootFiles || {})) {
|
|
267
|
+
if (fs.existsSync(path.join(base, srcName))) {
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
258
271
|
return false;
|
|
259
272
|
}
|
|
260
273
|
|
|
@@ -386,6 +399,17 @@ function cmdInit(tool, preset, cwdOption) {
|
|
|
386
399
|
copiedSteps++;
|
|
387
400
|
}
|
|
388
401
|
}
|
|
402
|
+
|
|
403
|
+
for (const [srcName, destRel] of Object.entries(cfg.repoRootFiles || {})) {
|
|
404
|
+
const from = path.join(base, srcName);
|
|
405
|
+
if (fs.existsSync(from)) {
|
|
406
|
+
const destAbs = path.join(cwd, destRel);
|
|
407
|
+
fs.mkdirSync(path.dirname(destAbs), { recursive: true });
|
|
408
|
+
fs.copyFileSync(from, destAbs);
|
|
409
|
+
console.log(`Copied ${srcName} → ${destRel}`);
|
|
410
|
+
copiedSteps++;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
389
413
|
} catch (err) {
|
|
390
414
|
const msg = err instanceof Error ? err.message : String(err);
|
|
391
415
|
console.error(`init failed: ${msg}`);
|
|
@@ -444,6 +468,11 @@ function cmdClean(tool, cwdOption) {
|
|
|
444
468
|
removedParts.push(`${toolRoot}/${name}`);
|
|
445
469
|
}
|
|
446
470
|
|
|
471
|
+
for (const destRel of Object.values(cfg.repoRootFiles || {})) {
|
|
472
|
+
removeFileIfExists(path.join(cwd, destRel));
|
|
473
|
+
removedParts.push(destRel);
|
|
474
|
+
}
|
|
475
|
+
|
|
447
476
|
console.log(`Removed ${removedParts.join(', ')} (if present)`);
|
|
448
477
|
}
|
|
449
478
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonesofspring/ai-rules",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "Presets of Cursor and Claude rules/commands for Revy Ross personal use",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Revy Ross",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"check:preset-twin-map": "bash scripts/check-preset-twin-map.sh",
|
|
30
30
|
"check:preset-token-budget": "bash scripts/check-preset-token-budget.sh",
|
|
31
31
|
"check:preset-leakage": "bash scripts/check-preset-leakage.sh",
|
|
32
|
-
"check:shared-core-drift": "bash scripts/check-shared-core-drift.sh"
|
|
32
|
+
"check:shared-core-drift": "bash scripts/check-shared-core-drift.sh",
|
|
33
|
+
"check:rule-eval": "node scripts/check-rule-eval.mjs"
|
|
33
34
|
},
|
|
34
35
|
"engines": {
|
|
35
36
|
"node": ">=18"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Shared preset core (`presets/_shared`)
|
|
2
2
|
|
|
3
|
-
Stack-agnostic **prose and checklists** for all installable presets: `next`, `ios-swift`, and `
|
|
3
|
+
Stack-agnostic **prose and checklists** for all installable presets: `next`, `ios-swift`, `go`, and `java` (`cursor/<stack>`, `claude/<stack>`).
|
|
4
4
|
|
|
5
5
|
**Not an installable preset.** CLI `init` copies only under `presets/cursor/<name>/` or `presets/claude/<name>/` — this sibling is never shipped to consumer apps.
|
|
6
6
|
|
|
@@ -4,6 +4,6 @@ When the user message looks like a **work request** (implement, add, fix, refact
|
|
|
4
4
|
|
|
5
5
|
1. Prefer **`/task <their request>`** or invoke **task-router** first.
|
|
6
6
|
2. Do not jump straight to coding without router + pipeline when scope is non-trivial.
|
|
7
|
-
3. Pure questions («как работает X», «объясни») —
|
|
7
|
+
3. Pure questions («как работает X», «объясни») — prefer agent **`codebase-analyzer`** (explain-as-is); trivial one-liners may be answered inline. Do not open `/task`.
|
|
8
8
|
|
|
9
9
|
Exceptions: user explicitly says «без pipeline», «просто сделай», or continues an active slug.
|
|
@@ -126,7 +126,7 @@ If `pipeline.json` is missing (old `/feature-start` tasks), fall back to fixed p
|
|
|
126
126
|
|
|
127
127
|
Do **not** run `/task` + router for:
|
|
128
128
|
|
|
129
|
-
- Pure questions («как работает X», «объясни»).
|
|
129
|
+
- Pure questions («как работает X», «объясни») — prefer agent **`codebase-analyzer`** for deep traces; inline OK for trivial one-liners.
|
|
130
130
|
- Typo / one-file fix / trivial config with no architecture risk.
|
|
131
131
|
- User explicitly says «без pipeline», «просто сделай», or continues an active slug.
|
|
132
132
|
- Single-line `docs-only` with no code impact.
|
|
@@ -22,6 +22,18 @@
|
|
|
22
22
|
3. Зеркаль именование, порядок файлов, паттерны импортов и тестов.
|
|
23
23
|
4. Если эталона нет — выбери **самую близкую** существующую фичу того же слоя и зафиксируй выбор в handoff.
|
|
24
24
|
|
|
25
|
+
## Living conventions
|
|
26
|
+
|
|
27
|
+
После init команда ведёт **локальные** gotchas, patterns и decisions в consumer-owned store (не в shared core и не только в корневом `AGENTS.md`):
|
|
28
|
+
|
|
29
|
+
| Раздел | Что фиксировать |
|
|
30
|
+
|--------|-----------------|
|
|
31
|
+
| Gotchas | Повторяющиеся ловушки, хрупкие места, «не делай X в этом репо» |
|
|
32
|
+
| Patterns | Локальные паттерны сверх эталонной таблицы |
|
|
33
|
+
| Decisions | Краткие ADR-ссылки / продуктовые решения, влияющие на код |
|
|
34
|
+
|
|
35
|
+
Указатель пути к файлу и stack-таблицы — в адаптере пресета (`team/conventions.md`). Файл **не** always-on.
|
|
36
|
+
|
|
25
37
|
## Связанные правила
|
|
26
38
|
|
|
27
39
|
- `code-quality-and-refactoring` — повторять паттерны, не deep-import.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
## Куда класть новое правило
|
|
14
14
|
|
|
15
15
|
1. Общие принципы для всех стеков → **core** + адаптеры с `<!-- shared-core: … -->`.
|
|
16
|
-
2. Только один из installable стеков (`next` / `ios-swift` / `go`) → **stack-specific** (не в `_shared`).
|
|
16
|
+
2. Только один из installable стеков (`next` / `ios-swift` / `go` / `java`) → **stack-specific** (не в `_shared`).
|
|
17
17
|
3. Только Cursor или только Claude packaging → platform artifact / frontmatter, не дублировать семантику.
|
|
18
18
|
|
|
19
19
|
## SoT
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
- `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
|
|
8
8
|
- `ios-swift` must not ship Playwright handoffs or Next lint recipes as required commands.
|
|
9
|
-
- `go` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
|
|
9
|
+
- `go` / `java` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
|
|
10
10
|
- Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
|
|
11
11
|
|
|
12
12
|
## Forbidden in ios-swift hooks/agents (FAIL)
|
|
@@ -24,14 +24,16 @@ Required instead: `xcuitest-test-*` stems; build-verifier mentions `xcodebuild`
|
|
|
24
24
|
- `xcuitest-test-` as handoff stems
|
|
25
25
|
- Requiring `xcodebuild` / SwiftLint as the default post-change gate for Next app work
|
|
26
26
|
|
|
27
|
-
## Forbidden in go hooks/agents (FAIL)
|
|
27
|
+
## Forbidden in go / java hooks/agents (FAIL)
|
|
28
|
+
|
|
29
|
+
Shared backend-stack bans (both `go` and `java`):
|
|
28
30
|
|
|
29
31
|
- `playwright-test-`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
|
|
30
32
|
- Positive yarn recipes `lint:js` / `lint:css`
|
|
31
33
|
- `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
|
|
32
34
|
- Agent file `accessibility-reviewer` (no UI surface)
|
|
33
35
|
|
|
34
|
-
Required instead: `integration-test-*`; build-verifier / `post-change-test`
|
|
36
|
+
Required instead: `integration-test-*`; build-verifier / `post-change-test` plus stack tooling — `go-tooling` (`go test`, `go vet`) or `java-tooling` (`mvn test` / `./gradlew test`).
|
|
35
37
|
|
|
36
38
|
## Soft / document
|
|
37
39
|
|
|
@@ -40,4 +42,4 @@ Required instead: `integration-test-*`; build-verifier / `post-change-test` / `g
|
|
|
40
42
|
|
|
41
43
|
## Chain fork
|
|
42
44
|
|
|
43
|
-
`hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, and `
|
|
45
|
+
`hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, `go`, and `java` (per platform).
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
- [ ] **SoT:** правки в `packages/…` (не только root `.cursor/`)
|
|
8
8
|
- [ ] **Core:** если менялся `_shared/core/**` — обновлены все `<!-- shared-core: … -->` consumers (или documented intentional fork)
|
|
9
|
-
- [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, ios-swift, and
|
|
9
|
+
- [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, ios-swift, go, and java — см. `preset-twin-sync`)
|
|
10
10
|
- [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table актуален
|
|
11
11
|
- [ ] **Token budget:** alwaysApply / session-start ≤ 3; meta rules not always-on
|
|
12
12
|
- [ ] **Leakage:** нет чужих stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
|
|
@@ -9,6 +9,7 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
|
|
|
9
9
|
| `next` | `presets/cursor/next/rules/*.mdc` | `presets/claude/next/rules/<topic>/` | **Required** in `claude/next/rules/README.md` |
|
|
10
10
|
| `ios-swift` | `presets/cursor/ios-swift/rules/*.mdc` | `presets/claude/ios-swift/rules/<topic>/` | Keep in `claude/ios-swift/rules/README.md` |
|
|
11
11
|
| `go` | `presets/cursor/go/rules/*.mdc` | `presets/claude/go/rules/<topic>/` | Keep in `claude/go/rules/README.md` |
|
|
12
|
+
| `java` | `presets/cursor/java/rules/*.mdc` | `presets/claude/java/rules/<topic>/` | Keep in `claude/java/rules/README.md` |
|
|
12
13
|
|
|
13
14
|
## Same-PR checklist
|
|
14
15
|
|
|
@@ -27,5 +28,6 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
|
|
|
27
28
|
- **next:** missing Claude twin for a changed Cursor rule → **FAIL** (mapping table required).
|
|
28
29
|
- **ios-swift:** missing Claude twin for a changed Cursor rule → **FAIL**.
|
|
29
30
|
- **go:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift; mapping table required).
|
|
31
|
+
- **java:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift / go; mapping table required).
|
|
30
32
|
|
|
31
33
|
Dogfood: sync packages → root `.cursor/` after Cursor SoT changes (not the reverse). Use `packages/ai-rules/scripts/sync-dogfood-cursor.sh`.
|
|
@@ -55,4 +55,15 @@
|
|
|
55
55
|
- **Boy scout rule:** оставлять модуль немного лучше, чем до изменения (простые, безопасные улучшения).
|
|
56
56
|
- Не жертвовать архитектурой и слоями ради краткости реализации.
|
|
57
57
|
|
|
58
|
+
## Agent discipline (anti-sycophancy)
|
|
59
|
+
|
|
60
|
+
- Unverifiable third-party API → mark `// VERIFY: lib.symbol @ version` (or stack equivalent) and surface uncertainty; never invent signatures.
|
|
61
|
+
- Before «is this correct?» — list ≥3 failure modes (empty, boundary, concurrency/state) or name what you could not check.
|
|
62
|
+
- Refactor without tests → propose a characterization test first; if declined, label `UNTESTED`.
|
|
63
|
+
- Comments = WHY only when non-obvious; ban self-referential «added for issue Y» comments.
|
|
64
|
+
- Urgency/authority pressure: name the technical trade-off once, then comply — no apology loops.
|
|
65
|
+
- Match verification depth to risk; report status by what was **verified**, not attempted.
|
|
66
|
+
|
|
67
|
+
Style enforcement (formatter / linter / post-change gate) lives in the **stack toolchain** — see each adapter’s **Stack notes**; do not invent a parallel style bible in this core body.
|
|
68
|
+
|
|
58
69
|
> Stack-specific lint gates, примеры и toolchain — в секции **Stack notes** адаптера пресета.
|
|
@@ -27,3 +27,12 @@ Concrete rule stems — in **Stack notes**.
|
|
|
27
27
|
- Use local `git diff` — do not invent hosting metadata.
|
|
28
28
|
- Boy scout rule: suggest fixes feasible within the MR scope.
|
|
29
29
|
- No «большие рефакторинги» without an explicit request (`code-quality-and-refactoring`).
|
|
30
|
+
|
|
31
|
+
## Output contract
|
|
32
|
+
|
|
33
|
+
Procedure details live in skill `code-review`. Required shape:
|
|
34
|
+
|
|
35
|
+
- Each finding cites **`path:line`**, the problem, impact, and a concrete fix direction.
|
|
36
|
+
- Rank by severity: **`blocker` | `important` | `nit`** (list blocker → nit).
|
|
37
|
+
- Vague («looks risky») is not a finding — cite evidence or ask for surrounding file context.
|
|
38
|
+
- End with a verdict on its own line: **`Safe to merge | needs changes | reject`**.
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Preset for Go backends using ports & adapters.
|
|
4
4
|
|
|
5
|
+
**Repo-root agents:** see [`AGENTS.md`](../../AGENTS.md) at the project root.
|
|
6
|
+
|
|
5
7
|
- Session-start: `go-app-core`, `architecture/boundaries`, `code-quality` (exactly 3).
|
|
6
8
|
- Delivery: `architecture/feature-delivery.md` + skill `feature-delivery`.
|
|
7
9
|
- After Go edits: `tooling-and-review/post-change-test.md`.
|
|
8
10
|
- Integration tests: agents `integration-test-*` (never Playwright/XCUITest).
|
|
11
|
+
- ADR: skill `write-adr` (on-demand).
|
|
12
|
+
- How does X work: agent `codebase-analyzer` (explain-as-is; no `/task`).
|
|
9
13
|
|
|
10
|
-
Init: `npx @bonesofspring/ai-rules init claude --preset go`
|
|
14
|
+
Init: `npx @bonesofspring/ai-rules init claude --preset go` (also copies `REPO_AGENTS.md` → root `AGENTS.md`).
|
|
@@ -12,7 +12,7 @@ npx @bonesofspring/ai-rules init claude --preset go
|
|
|
12
12
|
|------|------------|
|
|
13
13
|
| `CLAUDE.md` | Thin session entry |
|
|
14
14
|
| `rules/**` | Topic `.md` + `paths:` (session-start = 3) |
|
|
15
|
-
| `agents/**` | **
|
|
15
|
+
| `agents/**` | **21** ролей (+ `codebase-analyzer`) |
|
|
16
16
|
| `skills/**` | **7** skills (в т.ч. `integration-testing`) |
|
|
17
17
|
| `commands/**` | task, task-continue, feature-start/continue, technical-retro |
|
|
18
18
|
| `hooks/**` | guard-shell + chain-team-phases |
|
|
@@ -32,3 +32,7 @@ npx @bonesofspring/ai-rules init claude --preset go
|
|
|
32
32
|
## Sync with Cursor
|
|
33
33
|
|
|
34
34
|
SoT = `presets/cursor/go/`. Update this twin **in the same PR** when Cursor changes.
|
|
35
|
+
|
|
36
|
+
## Cross-tool root AGENTS
|
|
37
|
+
|
|
38
|
+
`REPO_AGENTS.md` → project-root `AGENTS.md` on init. Living conventions: `team/conventions.md`. Skill `write-adr` on-demand.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Go — agent instructions
|
|
2
|
+
|
|
3
|
+
Cross-tool repo-root guide. Tool-specific maps stay under `.cursor/AGENTS.md` and `.claude/CLAUDE.md`.
|
|
4
|
+
|
|
5
|
+
## Cross-tool setup
|
|
6
|
+
|
|
7
|
+
- Treat this file as the **shared** entry for any agent (Cursor, Claude Code, or other).
|
|
8
|
+
- Tool maps live in `.cursor/AGENTS.md` / `.claude/CLAUDE.md` when that tool is installed.
|
|
9
|
+
- Install:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx @bonesofspring/ai-rules init cursor --preset go
|
|
13
|
+
npx @bonesofspring/ai-rules init claude --preset go
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`init` overwrites this file from the preset (`REPO_AGENTS.md` → `AGENTS.md`). Living gotchas belong in `team/conventions.md`, not here.
|
|
17
|
+
|
|
18
|
+
## Commands (test / lint / build)
|
|
19
|
+
|
|
20
|
+
Prefer hexagonal / ports-and-adapters layout from stack rules (`go-app-core`, `architecture-boundaries`).
|
|
21
|
+
|
|
22
|
+
| Gate | Typical command |
|
|
23
|
+
|------|-----------------|
|
|
24
|
+
| Test | `go test ./...` (or package-scoped) |
|
|
25
|
+
| Vet | `go vet ./...` |
|
|
26
|
+
| Lint | **golangci-lint** when configured |
|
|
27
|
+
| Format | `gofmt` / `goimports` |
|
|
28
|
+
|
|
29
|
+
After code edits: invoke **`post-change-test`** (requestable). Full gate: agent `build-verifier`.
|
|
30
|
+
|
|
31
|
+
## Security basics
|
|
32
|
+
|
|
33
|
+
- Do not commit secrets (tokens, `.env`, private keys).
|
|
34
|
+
- Review destructive git before running; respect shell hooks.
|
|
35
|
+
- Do not weaken CI or skip hooks unless the user explicitly asks.
|
|
36
|
+
|
|
37
|
+
## Tool entry points
|
|
38
|
+
|
|
39
|
+
| Tool | Map |
|
|
40
|
+
|------|-----|
|
|
41
|
+
| Cursor | `.cursor/AGENTS.md` (optional if Cursor not installed) |
|
|
42
|
+
| Claude Code | `.claude/CLAUDE.md` (optional if Claude not installed) |
|
|
43
|
+
|
|
44
|
+
Rules: `.cursor/rules/` or `.claude/rules/`. Skills: `.cursor/skills/` or `.claude/skills/`.
|
|
45
|
+
|
|
46
|
+
## Living conventions
|
|
47
|
+
|
|
48
|
+
Gotchas, local patterns, and team decisions: **`.cursor/team/conventions.md`** and/or **`.claude/team/conventions.md`** (fill after init).
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
# `.claude/agents` (preset go)
|
|
2
2
|
|
|
3
|
+
Ролевые subagents для командного пайплайна Claude Code (Go hexagonal).
|
|
4
|
+
|
|
5
|
+
## Analysis (on-demand)
|
|
6
|
+
|
|
7
|
+
| Agent | Файл | Production-код |
|
|
8
|
+
|-------|------|----------------|
|
|
9
|
+
| Codebase analyzer | `codebase-analyzer.md` | no (explain-as-is only) |
|
|
10
|
+
|
|
11
|
+
## Roster (21)
|
|
12
|
+
|
|
3
13
|
| Agent | Production writes |
|
|
4
14
|
|-------|-------------------|
|
|
5
15
|
| task-router, task-analyst, solution-architect | team only |
|
|
16
|
+
| codebase-analyzer | no (explain-as-is only) |
|
|
6
17
|
| feature-developer | yes (Go sources) |
|
|
7
18
|
| build-verifier | no (report only) |
|
|
8
19
|
| debugger, ci-investigator | minimal |
|
|
@@ -10,6 +21,12 @@
|
|
|
10
21
|
| migration-specialist, api-contract-reviewer, tech-writer | team / docs |
|
|
11
22
|
| qa-tester, unit-test-*, integration-test-* | tests |
|
|
12
23
|
|
|
13
|
-
**
|
|
24
|
+
**No** `accessibility-reviewer`, Playwright, or XCUITest stems. Replace those intents with **`integration-test-*`**.
|
|
25
|
+
|
|
26
|
+
## Model matrix
|
|
14
27
|
|
|
15
|
-
|
|
28
|
+
| Tier | Agents |
|
|
29
|
+
|------|--------|
|
|
30
|
+
| **cheap** | router, analyst, build-verifier, code-reviewer, tech-writer, codebase-analyzer |
|
|
31
|
+
| **standard** | developer, debugger, ci-investigator, api-contract, qa, unit-*, integration-* |
|
|
32
|
+
| **strong** | solution-architect, migration-specialist, security-reviewer, performance-auditor |
|
|
@@ -25,6 +25,11 @@ From `packages/ai-rules/`:
|
|
|
25
25
|
yarn check:preset-structure
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Hard gates: twin-map (stacks include **go**), token-budget (alwaysApply/session-start = 3), leakage (`GO_FORBIDDEN_*`, chain forks go≠next≠ios-swift).
|
|
28
|
+
Hard gates: twin-map (stacks include **go**), token-budget (alwaysApply/session-start = 3), leakage (`GO_FORBIDDEN_*`, chain forks go≠next≠ios-swift≠java), shared-core drift (`AI_RULES_DRIFT_FAIL=1` via `check:preset-structure`).
|
|
29
29
|
|
|
30
30
|
Document PASS/FAIL in `validation-report.md`.
|
|
31
|
+
|
|
32
|
+
1. **Root AGENTS template:** each installable preset (`cursor|claude` × `next|ios-swift|go|java`) must ship `REPO_AGENTS.md` when validating preset packaging → **FAIL** if missing.
|
|
33
|
+
2. **Hooks cookbook:** default `hooks.json` must **not** reference `hooks/examples/` → **FAIL** if it does.
|
|
34
|
+
3. **No react-performance on ios/go/java:** skill directory / required handoff must be absent under ios-swift, go, and java → **FAIL** (leakage). Prefer `check:preset-leakage`.
|
|
35
|
+
4. **Rule eval (WARN):** `scripts/check-rule-eval.mjs` / `yarn check:rule-eval` should exist for maintainers; smoke optional. Hard fail only when the opt-in eval job runs — not part of default `check:preset-structure`.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codebase-analyzer
|
|
3
|
+
description: Explains HOW existing Go code works as-is. Use when the user asks how something works, to trace ports/adapters, or document architecture — without suggesting changes. Prefer over /task for pure questions.
|
|
4
|
+
readonly: false
|
|
5
|
+
model: fast
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a specialist at understanding HOW this Go hexagonal service works. Document implementation details with precise `path:line` references.
|
|
9
|
+
|
|
10
|
+
## CRITICAL — explain as-is only
|
|
11
|
+
|
|
12
|
+
- DO NOT suggest improvements, refactors, or "better approaches" unless the user explicitly asks.
|
|
13
|
+
- DO NOT perform root-cause analysis or bug hunts unless asked.
|
|
14
|
+
- DO NOT critique quality, performance, or security unless asked.
|
|
15
|
+
- ONLY describe what exists, how it works, and how components interact.
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
1. Start from entry points the user named (`cmd/`, handlers, use cases, ports).
|
|
20
|
+
2. Trace domain → application/ports → adapters → composition root as applicable.
|
|
21
|
+
3. Summarize: purpose, flow, port contracts, adapter placement, conventions observed.
|
|
22
|
+
4. End with open questions only if facts are missing — not with a wishlist of changes.
|
|
23
|
+
|
|
24
|
+
## Will / Will not
|
|
25
|
+
|
|
26
|
+
**Will:** map packages, call chains, ports/adapters as they exist today.
|
|
27
|
+
|
|
28
|
+
**Will not:** edit production code; open `/task` pipelines; propose PRs or refactors unprompted; require Next/iOS gates.
|
|
@@ -19,6 +19,19 @@ Implement Go features following hexagonal boundaries.
|
|
|
19
19
|
- **Don't** import frameworks into domain; don't use SQL in use cases.
|
|
20
20
|
- **Don't** require Playwright, XCUITest, or yarn lint gates.
|
|
21
21
|
|
|
22
|
+
## Zero improvisation
|
|
23
|
+
|
|
24
|
+
- Implement **only** what the brief / AC / current decomposition task require.
|
|
25
|
+
- If requirements are ambiguous, conflicting, or multi-way — **ask** before coding; do not guess extras as "best practices".
|
|
26
|
+
- Forbidden without explicit AC/task: unrelated security hardening, extra validation, observability, drive-by refactors, new config/env.
|
|
27
|
+
- Boy scout / `design-guidance` improvements stay **within** touched files and must not expand task scope.
|
|
28
|
+
|
|
29
|
+
## Will / Will not
|
|
30
|
+
|
|
31
|
+
**Will:** follow hexagonal order; add required tests; run `post-change-test` (+ `go-tooling`); update task artifacts.
|
|
32
|
+
|
|
33
|
+
**Will not:** formal code review; invent AC; pull Next/iOS gates; auto-continue the next WP when the pipeline expects a human gate or handoff.
|
|
34
|
+
|
|
22
35
|
## Preset packaging
|
|
23
36
|
|
|
24
37
|
When editing ai-rules `presets/**/go/**`, keep Cursor/Claude twins in sync and preserve chain fork ≠ next/ios-swift.
|
|
@@ -8,3 +8,9 @@
|
|
|
8
8
|
Claude Code may not use Cursor `hooks.json`. Wire scripts per project docs when enabling agent-team auto-chain.
|
|
9
9
|
|
|
10
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: **go**). Cursor twin examples under `presets/cursor/go/hooks/examples/` are the same allowlist forks.
|
|
@@ -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,9 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Optional: gofmt / golangci-lint on edited packages.
|
|
3
|
+
# NOT in default hooks.json.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
gofmt -w $(git diff --name-only --diff-filter=ACMR HEAD 2>/dev/null | grep '\.go$' || true) 2>/dev/null || true
|
|
6
|
+
if command -v golangci-lint >/dev/null 2>&1; then
|
|
7
|
+
golangci-lint run ./... 2>/dev/null || true
|
|
8
|
+
fi
|
|
9
|
+
exit 0
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Optional cookbook: block committing likely secrets in staged diffs.
|
|
3
|
+
# NOT wired in default hooks.json — copy to hooks/ and register manually.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
PATTERN='(AKIA[0-9A-Z]{16}|-----BEGIN (RSA |OPENSSH )?PRIVATE KEY-----|api[_-]?key\s*[:=]\s*['\''\"][^'\''\"]{12,})'
|
|
6
|
+
if git diff --cached -U0 2>/dev/null | grep -Eiq "$PATTERN"; then
|
|
7
|
+
echo "secret-guard: possible secret in staged diff — review before commit" >&2
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
10
|
+
exit 0
|