@bonesofspring/ai-rules 0.2.5 → 0.2.7
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 +68 -4
- package/README.md +21 -3
- package/bin/cli.js +30 -1
- package/package.json +9 -1
- package/presets/_shared/README.md +47 -0
- package/presets/_shared/core/agent-team/agent-team-intake.md +9 -0
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +142 -0
- package/presets/_shared/core/architecture/feature-delivery-workflow.md +46 -0
- package/presets/_shared/core/architecture/reference-features.template.md +43 -0
- package/presets/_shared/core/meta/preset-layering.md +25 -0
- package/presets/_shared/core/meta/preset-no-cross-stack-leakage.md +43 -0
- package/presets/_shared/core/meta/preset-pr-checklist.md +28 -0
- package/presets/_shared/core/meta/preset-token-budget.md +30 -0
- package/presets/_shared/core/meta/preset-twin-sync.md +31 -0
- package/presets/_shared/core/quality/code-quality-and-refactoring.md +69 -0
- package/presets/_shared/core/quality/design-guidance.md +97 -0
- package/presets/_shared/core/review/code-review-mr.md +38 -0
- package/presets/_shared/core/review/technical-retro.md +7 -0
- package/presets/claude/go/CLAUDE.md +14 -0
- package/presets/claude/go/MCP.md +16 -0
- package/presets/claude/go/README.md +38 -0
- package/presets/claude/go/REPO_AGENTS.md +48 -0
- package/presets/claude/go/agents/README.md +32 -0
- package/presets/claude/go/agents/api-contract-reviewer.md +23 -0
- package/presets/claude/go/agents/build-verifier.md +35 -0
- package/presets/claude/go/agents/ci-investigator.md +17 -0
- package/presets/claude/go/agents/code-reviewer.md +40 -0
- package/presets/claude/go/agents/codebase-analyzer.md +28 -0
- package/presets/claude/go/agents/debugger.md +25 -0
- package/presets/claude/go/agents/feature-developer.md +43 -0
- package/presets/claude/go/agents/integration-test-generator.md +22 -0
- package/presets/claude/go/agents/integration-test-healer.md +22 -0
- package/presets/claude/go/agents/integration-test-planner.md +22 -0
- package/presets/claude/go/agents/migration-specialist.md +31 -0
- package/presets/claude/go/agents/performance-auditor.md +22 -0
- package/presets/claude/go/agents/qa-tester.md +24 -0
- package/presets/claude/go/agents/security-reviewer.md +20 -0
- package/presets/claude/go/agents/solution-architect.md +28 -0
- package/presets/claude/go/agents/task-analyst.md +25 -0
- package/presets/claude/go/agents/task-router.md +69 -0
- package/presets/claude/go/agents/tech-writer.md +15 -0
- package/presets/claude/go/agents/unit-test-generator.md +21 -0
- package/presets/claude/go/agents/unit-test-healer.md +13 -0
- package/presets/claude/go/agents/unit-test-planner.md +26 -0
- package/presets/claude/go/commands/README.md +13 -0
- package/presets/claude/go/commands/feature-continue.md +51 -0
- package/presets/claude/go/commands/feature-start.md +30 -0
- package/presets/claude/go/commands/task-continue.md +49 -0
- package/presets/claude/go/commands/task.md +49 -0
- package/presets/claude/go/commands/technical-retro.md +58 -0
- package/presets/claude/go/hooks/README.md +16 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +381 -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/hooks/guard-shell-command.sh +79 -0
- package/presets/claude/go/mcp.json +12 -0
- package/presets/claude/go/rules/README.md +60 -0
- package/presets/claude/go/rules/api-and-data/README.md +14 -0
- package/presets/claude/go/rules/api-and-data/adapters-driven.md +34 -0
- package/presets/claude/go/rules/api-and-data/adapters-driving.md +35 -0
- package/presets/claude/go/rules/api-and-data/api-grpc.md +27 -0
- package/presets/claude/go/rules/api-and-data/api-http.md +33 -0
- package/presets/claude/go/rules/api-and-data/messaging-adapters.md +21 -0
- package/presets/claude/go/rules/api-and-data/persistence-adapters.md +28 -0
- package/presets/claude/go/rules/architecture/README.md +16 -0
- package/presets/claude/go/rules/architecture/application-usecases.md +29 -0
- package/presets/claude/go/rules/architecture/boundaries.md +29 -0
- package/presets/claude/go/rules/architecture/composition-root.md +28 -0
- package/presets/claude/go/rules/architecture/domain-layer.md +32 -0
- package/presets/claude/go/rules/architecture/feature-delivery.md +51 -0
- package/presets/claude/go/rules/architecture/module-public-api.md +23 -0
- package/presets/claude/go/rules/architecture/ports-interfaces.md +34 -0
- package/presets/claude/go/rules/architecture/reference-features.md +34 -0
- package/presets/claude/go/rules/stack/README.md +10 -0
- package/presets/claude/go/rules/stack/go-app-core.md +31 -0
- package/presets/claude/go/rules/stack/go-conventions.md +51 -0
- package/presets/claude/go/rules/testing/README.md +11 -0
- package/presets/claude/go/rules/testing/e2e.md +18 -0
- package/presets/claude/go/rules/testing/integration.md +23 -0
- package/presets/claude/go/rules/testing/unit.md +24 -0
- package/presets/claude/go/rules/tooling-and-review/README.md +21 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +25 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +161 -0
- package/presets/claude/go/rules/tooling-and-review/code-quality.md +83 -0
- package/presets/claude/go/rules/tooling-and-review/code-review.md +57 -0
- package/presets/claude/go/rules/tooling-and-review/design-guidance.md +110 -0
- package/presets/claude/go/rules/tooling-and-review/go-tooling.md +38 -0
- package/presets/claude/go/rules/tooling-and-review/post-change-test.md +32 -0
- package/presets/claude/go/rules/tooling-and-review/preset-layering.md +36 -0
- package/presets/claude/go/rules/tooling-and-review/preset-no-cross-stack-leakage.md +58 -0
- package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +39 -0
- package/presets/claude/go/rules/tooling-and-review/preset-token-budget.md +41 -0
- package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +42 -0
- package/presets/claude/go/rules/tooling-and-review/security-go.md +22 -0
- package/presets/claude/go/rules/tooling-and-review/technical-retro.md +19 -0
- package/presets/claude/go/rules/ui-and-accessibility/README.md +3 -0
- package/presets/claude/go/skills/README.md +5 -0
- package/presets/claude/go/skills/ci-investigation/SKILL.md +11 -0
- package/presets/claude/go/skills/code-review/SKILL.md +25 -0
- package/presets/claude/go/skills/debug-investigation/SKILL.md +15 -0
- package/presets/claude/go/skills/feature-delivery/SKILL.md +30 -0
- package/presets/claude/go/skills/integration-testing/SKILL.md +15 -0
- package/presets/claude/go/skills/technical-retro/SKILL.md +54 -0
- package/presets/claude/go/skills/unit-testing/SKILL.md +14 -0
- package/presets/claude/go/skills/write-adr/SKILL.md +41 -0
- package/presets/claude/go/team/README.md +27 -0
- package/presets/claude/go/team/conventions.md +21 -0
- package/presets/claude/go/team/fixtures/bugfix-standard.json +37 -0
- package/presets/claude/go/team/fixtures/feature-full.json +43 -0
- package/presets/claude/go/team/fixtures/feature-light.json +17 -0
- package/presets/claude/ios-swift/CLAUDE.md +4 -1
- package/presets/claude/ios-swift/README.md +12 -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 +23 -8
- package/presets/claude/ios-swift/agents/code-reviewer.md +4 -0
- package/presets/claude/ios-swift/agents/codebase-analyzer.md +28 -0
- package/presets/claude/ios-swift/agents/debugger.md +4 -0
- package/presets/claude/ios-swift/agents/feature-developer.md +17 -0
- package/presets/claude/ios-swift/agents/migration-specialist.md +4 -0
- package/presets/claude/ios-swift/agents/performance-auditor.md +4 -0
- package/presets/claude/ios-swift/agents/qa-tester.md +4 -0
- package/presets/claude/ios-swift/agents/solution-architect.md +4 -0
- package/presets/claude/ios-swift/agents/task-analyst.md +4 -0
- package/presets/claude/ios-swift/agents/unit-test-generator.md +4 -0
- package/presets/claude/ios-swift/agents/unit-test-healer.md +4 -0
- package/presets/claude/ios-swift/agents/unit-test-planner.md +4 -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/README.md +24 -2
- package/presets/claude/ios-swift/rules/architecture/feature-delivery.md +5 -0
- package/presets/claude/ios-swift/rules/architecture/reference-features.md +9 -0
- 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 +3 -3
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +8 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +64 -20
- package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +42 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/design-guidance.md +110 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +36 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +54 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +39 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-token-budget.md +41 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +42 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/technical-retro.md +5 -3
- 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 +14 -2
- package/presets/claude/ios-swift/skills/debug-investigation/SKILL.md +4 -0
- package/presets/claude/ios-swift/skills/feature-delivery/SKILL.md +8 -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/next/CLAUDE.md +5 -1
- package/presets/claude/next/README.md +14 -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 +29 -0
- package/presets/claude/next/agents/code-reviewer.md +4 -0
- package/presets/claude/next/agents/codebase-analyzer.md +28 -0
- package/presets/claude/next/agents/debugger.md +4 -0
- package/presets/claude/next/agents/feature-developer.md +17 -0
- package/presets/claude/next/agents/migration-specialist.md +4 -0
- package/presets/claude/next/agents/performance-auditor.md +4 -0
- package/presets/claude/next/agents/qa-tester.md +4 -0
- package/presets/claude/next/agents/security-reviewer.md +4 -2
- package/presets/claude/next/agents/solution-architect.md +4 -0
- package/presets/claude/next/agents/task-analyst.md +4 -0
- package/presets/claude/next/agents/unit-test-generator.md +4 -0
- package/presets/claude/next/agents/unit-test-healer.md +4 -0
- package/presets/claude/next/agents/unit-test-planner.md +4 -0
- 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 +75 -21
- 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/feature-delivery-workflow.md +5 -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 +9 -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 +3 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +8 -1
- package/presets/claude/next/rules/tooling-and-review/code-quality.md +58 -20
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +39 -8
- package/presets/claude/next/rules/tooling-and-review/design-guidance.md +110 -0
- package/presets/claude/next/rules/tooling-and-review/preset-layering.md +36 -0
- package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +54 -0
- package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +39 -0
- package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +41 -0
- package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +42 -0
- package/presets/claude/next/rules/tooling-and-review/security-next.md +57 -0
- package/presets/claude/next/rules/tooling-and-review/technical-retro.md +16 -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 +14 -2
- package/presets/claude/next/skills/debug-investigation/SKILL.md +4 -0
- package/presets/claude/next/skills/feature-delivery/SKILL.md +8 -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 +30 -0
- package/presets/cursor/go/BUGBOT.md +9 -0
- package/presets/cursor/go/MCP.md +16 -0
- package/presets/cursor/go/README.md +39 -0
- package/presets/cursor/go/REPO_AGENTS.md +48 -0
- package/presets/cursor/go/agents/README.md +36 -0
- package/presets/cursor/go/agents/api-contract-reviewer.md +23 -0
- package/presets/cursor/go/agents/build-verifier.md +35 -0
- package/presets/cursor/go/agents/ci-investigator.md +17 -0
- package/presets/cursor/go/agents/code-reviewer.md +40 -0
- package/presets/cursor/go/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/go/agents/debugger.md +25 -0
- package/presets/cursor/go/agents/feature-developer.md +43 -0
- package/presets/cursor/go/agents/integration-test-generator.md +22 -0
- package/presets/cursor/go/agents/integration-test-healer.md +22 -0
- package/presets/cursor/go/agents/integration-test-planner.md +22 -0
- package/presets/cursor/go/agents/migration-specialist.md +31 -0
- package/presets/cursor/go/agents/performance-auditor.md +22 -0
- package/presets/cursor/go/agents/qa-tester.md +24 -0
- package/presets/cursor/go/agents/security-reviewer.md +20 -0
- package/presets/cursor/go/agents/solution-architect.md +28 -0
- package/presets/cursor/go/agents/task-analyst.md +25 -0
- package/presets/cursor/go/agents/task-router.md +69 -0
- package/presets/cursor/go/agents/tech-writer.md +15 -0
- package/presets/cursor/go/agents/unit-test-generator.md +21 -0
- package/presets/cursor/go/agents/unit-test-healer.md +13 -0
- package/presets/cursor/go/agents/unit-test-planner.md +26 -0
- package/presets/cursor/go/commands/README.md +54 -0
- package/presets/cursor/go/commands/feature-continue.md +19 -0
- package/presets/cursor/go/commands/feature-start.md +33 -0
- package/presets/cursor/go/commands/task-continue.md +49 -0
- package/presets/cursor/go/commands/task.md +49 -0
- package/presets/cursor/go/commands/technical-retro.md +81 -0
- package/presets/cursor/go/hooks/README.md +12 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +381 -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/hooks/guard-shell-command.sh +79 -0
- package/presets/cursor/go/hooks.json +17 -0
- package/presets/cursor/go/mcp.json +11 -0
- package/presets/cursor/go/rules/README.md +89 -0
- package/presets/cursor/go/rules/adapters-driven.mdc +35 -0
- package/presets/cursor/go/rules/adapters-driving.mdc +36 -0
- package/presets/cursor/go/rules/agent-team-intake.mdc +20 -0
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +156 -0
- package/presets/cursor/go/rules/api-grpc.mdc +28 -0
- package/presets/cursor/go/rules/api-http.mdc +34 -0
- package/presets/cursor/go/rules/application-usecases.mdc +30 -0
- package/presets/cursor/go/rules/architecture-boundaries.mdc +30 -0
- package/presets/cursor/go/rules/code-quality-and-refactoring.mdc +84 -0
- package/presets/cursor/go/rules/code-review-mr.mdc +52 -0
- package/presets/cursor/go/rules/composition-root.mdc +29 -0
- package/presets/cursor/go/rules/design-guidance.mdc +111 -0
- package/presets/cursor/go/rules/domain-layer.mdc +33 -0
- package/presets/cursor/go/rules/feature-delivery-workflow.mdc +46 -0
- package/presets/cursor/go/rules/go-app-core.mdc +32 -0
- package/presets/cursor/go/rules/go-conventions.mdc +52 -0
- package/presets/cursor/go/rules/go-tooling.mdc +33 -0
- package/presets/cursor/go/rules/messaging-adapters.mdc +22 -0
- package/presets/cursor/go/rules/module-public-api.mdc +24 -0
- package/presets/cursor/go/rules/persistence-adapters.mdc +29 -0
- package/presets/cursor/go/rules/ports-interfaces.mdc +35 -0
- package/presets/cursor/go/rules/post-change-test.mdc +27 -0
- package/presets/cursor/go/rules/preset-layering.mdc +36 -0
- package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +58 -0
- package/presets/cursor/go/rules/preset-pr-checklist.mdc +39 -0
- package/presets/cursor/go/rules/preset-token-budget.mdc +41 -0
- package/presets/cursor/go/rules/preset-twin-sync.mdc +42 -0
- package/presets/cursor/go/rules/reference-features.mdc +35 -0
- package/presets/cursor/go/rules/security-go.mdc +23 -0
- package/presets/cursor/go/rules/technical-retro.mdc +14 -0
- package/presets/cursor/go/rules/tests-e2e.mdc +19 -0
- package/presets/cursor/go/rules/tests-integration.mdc +24 -0
- package/presets/cursor/go/rules/tests-unit.mdc +25 -0
- package/presets/cursor/go/skills/README.md +5 -0
- package/presets/cursor/go/skills/ci-investigation/SKILL.md +11 -0
- package/presets/cursor/go/skills/code-review/SKILL.md +25 -0
- package/presets/cursor/go/skills/debug-investigation/SKILL.md +15 -0
- package/presets/cursor/go/skills/feature-delivery/SKILL.md +30 -0
- package/presets/cursor/go/skills/integration-testing/SKILL.md +15 -0
- package/presets/cursor/go/skills/technical-retro/SKILL.md +54 -0
- package/presets/cursor/go/skills/unit-testing/SKILL.md +14 -0
- package/presets/cursor/go/skills/write-adr/SKILL.md +41 -0
- package/presets/cursor/go/team/README.md +31 -0
- package/presets/cursor/go/team/conventions.md +21 -0
- package/presets/cursor/go/team/fixtures/bugfix-standard.json +37 -0
- package/presets/cursor/go/team/fixtures/feature-full.json +43 -0
- package/presets/cursor/go/team/fixtures/feature-light.json +17 -0
- package/presets/cursor/ios-swift/AGENTS.md +5 -2
- package/presets/cursor/ios-swift/README.md +13 -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 +23 -8
- package/presets/cursor/ios-swift/agents/code-reviewer.md +4 -0
- package/presets/cursor/ios-swift/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/ios-swift/agents/debugger.md +4 -0
- package/presets/cursor/ios-swift/agents/feature-developer.md +17 -0
- package/presets/cursor/ios-swift/agents/migration-specialist.md +4 -0
- package/presets/cursor/ios-swift/agents/performance-auditor.md +4 -0
- package/presets/cursor/ios-swift/agents/qa-tester.md +4 -0
- package/presets/cursor/ios-swift/agents/solution-architect.md +4 -0
- package/presets/cursor/ios-swift/agents/task-analyst.md +4 -0
- package/presets/cursor/ios-swift/agents/unit-test-generator.md +4 -0
- package/presets/cursor/ios-swift/agents/unit-test-healer.md +4 -0
- package/presets/cursor/ios-swift/agents/unit-test-planner.md +4 -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/README.md +23 -2
- package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +3 -3
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +9 -3
- package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +64 -20
- package/presets/cursor/ios-swift/rules/code-review-mr.mdc +41 -0
- package/presets/cursor/ios-swift/rules/design-guidance.mdc +111 -0
- package/presets/cursor/ios-swift/rules/feature-delivery-workflow.mdc +6 -0
- package/presets/cursor/ios-swift/rules/preset-layering.mdc +36 -0
- package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +54 -0
- package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +39 -0
- package/presets/cursor/ios-swift/rules/preset-token-budget.mdc +41 -0
- package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +42 -0
- package/presets/cursor/ios-swift/rules/reference-features.mdc +10 -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/rules/technical-retro.mdc +4 -2
- package/presets/cursor/ios-swift/skills/README.md +1 -0
- package/presets/cursor/ios-swift/skills/code-review/SKILL.md +14 -2
- package/presets/cursor/ios-swift/skills/debug-investigation/SKILL.md +4 -0
- package/presets/cursor/ios-swift/skills/feature-delivery/SKILL.md +8 -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/next/AGENTS.md +5 -2
- package/presets/cursor/next/README.md +47 -0
- 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 +29 -0
- package/presets/cursor/next/agents/code-reviewer.md +4 -0
- package/presets/cursor/next/agents/codebase-analyzer.md +28 -0
- package/presets/cursor/next/agents/debugger.md +4 -0
- package/presets/cursor/next/agents/feature-developer.md +17 -0
- package/presets/cursor/next/agents/migration-specialist.md +4 -0
- package/presets/cursor/next/agents/performance-auditor.md +4 -0
- package/presets/cursor/next/agents/qa-tester.md +4 -0
- package/presets/cursor/next/agents/security-reviewer.md +4 -2
- package/presets/cursor/next/agents/solution-architect.md +4 -0
- package/presets/cursor/next/agents/task-analyst.md +4 -0
- package/presets/cursor/next/agents/unit-test-generator.md +4 -0
- package/presets/cursor/next/agents/unit-test-healer.md +4 -0
- package/presets/cursor/next/agents/unit-test-planner.md +4 -0
- 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 +24 -3
- package/presets/cursor/next/rules/agent-team-intake.mdc +3 -1
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +9 -3
- 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 +55 -18
- package/presets/cursor/next/rules/code-review-mr.mdc +39 -9
- package/presets/cursor/next/rules/design-guidance.mdc +111 -0
- package/presets/cursor/next/rules/feature-delivery-workflow.mdc +6 -0
- 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 +36 -0
- package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +54 -0
- package/presets/cursor/next/rules/preset-pr-checklist.mdc +39 -0
- package/presets/cursor/next/rules/preset-token-budget.mdc +41 -0
- package/presets/cursor/next/rules/preset-twin-sync.mdc +42 -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 +10 -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/technical-retro.mdc +5 -3
- 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 +14 -2
- package/presets/cursor/next/skills/debug-investigation/SKILL.md +4 -0
- package/presets/cursor/next/skills/feature-delivery/SKILL.md +8 -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,13 +2,61 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
### Claude Code handbook agent discipline
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
- **`feature-developer` ×6:** Zero improvisation + Will / Will not (scope discipline; clarify before guessing).
|
|
10
|
+
- **`feature-delivery` skill ×6:** short Scope discipline pointer.
|
|
11
|
+
- **`codebase-analyzer` agent ×6:** explain-as-is only; AGENTS/CLAUDE + agents README pointers; roster next/ios **22**, go **21**.
|
|
12
|
+
- **`code-review` skill ×6:** Reuse + Efficiency lenses.
|
|
13
|
+
- **`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.
|
|
14
|
+
- **`agent-team-intake` / `agent-team-orchestrator`:** pure questions → prefer **`codebase-analyzer`** (aligned with AGENTS/CLAUDE maps).
|
|
15
|
+
- **`docs/PRESET-CONTRIBUTION.md`:** Building blocks matrix (rule / command / skill / agent / conventions / hook).
|
|
16
|
+
|
|
17
|
+
### Awesome-cursorrules borrow backlog
|
|
18
|
+
|
|
19
|
+
- **`security-next`** (cursor + claude next): coding-time secrets/auth/XSS/Server Actions rule; wired into `security-reviewer`, catalogs, AGENTS/CLAUDE quick start.
|
|
20
|
+
- **Anti-hallucination banlists:** `next-app-router`, `go-conventions`, `swift-conventions` (❌/✅ tables).
|
|
21
|
+
- **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.
|
|
22
|
+
- **Go:** expanded `go-conventions` (errors/interfaces/concurrency); `api-http` resilience (idempotency, bulkheads, thin handlers) — catalog depth stub→full.
|
|
23
|
+
- **iOS:** `swiftui-ui` lifecycle/ownership (`.task`, DI vs `@StateObject`, hit testing).
|
|
24
|
+
- **Shared quality:** Agent discipline (anti-sycophancy) section in `quality/code-quality-and-refactoring` (+6 adapters).
|
|
25
|
+
|
|
26
|
+
### Preset rules improvements (9 items)
|
|
27
|
+
|
|
28
|
+
Cross-cutting preset packaging work (all six presets unless noted **next-only**). Hard gates unchanged: twin sync, ≤3 always-on, no cross-stack leakage.
|
|
29
|
+
|
|
30
|
+
| # | Item | Unreleased note |
|
|
31
|
+
|---|------|-----------------|
|
|
32
|
+
| 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 |
|
|
33
|
+
| 2 | Incorrect/Correct samples | **next only** — 9 domain rules with emedcard-grounded pairs |
|
|
34
|
+
| 3 | Impact tags | `impact: CRITICAL\|HIGH\|MEDIUM\|LOW` frontmatter; documented in PRESET-CONTRIBUTION |
|
|
35
|
+
| 4 | Eval harness (opt-in) | `eval/next/manifest.json`, `check-rule-eval.mjs`, `yarn check:rule-eval`, workflow `rule-eval.yml` |
|
|
36
|
+
| 5 | Living conventions | `reference-features` lineage + `team/conventions.md` ×6 |
|
|
37
|
+
| 6 | Hooks cookbook | `hooks/examples/` (secret-guard, format-edited, test-on-save); default `hooks.json` unchanged |
|
|
38
|
+
| 7 | Skill `write-adr` | ×6 presets (on-demand) |
|
|
39
|
+
| 8 | Skill `react-performance` | **next only** (cursor + claude) |
|
|
40
|
+
| 9 | Linter-delegated style | Stack notes in code-quality adapters; `arrow-functions` trimmed → ESLint/Stylelint + `post-change-lint` |
|
|
9
41
|
|
|
10
42
|
### Added
|
|
11
43
|
|
|
44
|
+
- **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`.
|
|
45
|
+
- **Impact frontmatter:** `impact: CRITICAL|HIGH|MEDIUM|LOW` documented in `docs/PRESET-CONTRIBUTION.md`; applied on next golden domain rules with Incorrect/Correct samples.
|
|
46
|
+
- **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.
|
|
47
|
+
- **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`).
|
|
48
|
+
- **Living conventions:** lineage section in `reference-features.template.md` + 6 adapters; `team/conventions.md` template ×6.
|
|
49
|
+
- **Skills:** `write-adr` ×6; `react-performance` ×2 (next cursor+claude only).
|
|
50
|
+
- **Hooks cookbook:** `hooks/examples/` (secret-guard, format-edited, test-on-save) ×3 stacks ×2 platforms; default `hooks.json` unchanged.
|
|
51
|
+
- **Dogfood:** `sync-dogfood-cursor.sh` copies root `AGENTS.md` from `REPO_AGENTS.md`; seeds `team/conventions.md` if absent.
|
|
52
|
+
- **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.
|
|
53
|
+
- **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).
|
|
54
|
+
- **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).
|
|
55
|
+
- **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; soft shared-core drift only (no `AI_RULES_DRIFT_FAIL`).
|
|
56
|
+
- **`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`.
|
|
57
|
+
- **Author meta-rules:** `preset-layering`, `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage` (never always-on / session-start).
|
|
58
|
+
- **Contributor docs:** `docs/PRESET-CONTRIBUTION.md` (layers, SoT, embed vs lineage sync modes, new-stack checklist).
|
|
59
|
+
- **Monorepo scripts:** `scripts/sync-dogfood-cursor.sh`, `scripts/check-shared-core-drift.sh`.
|
|
12
60
|
- **MCP configs in presets** (`next` + `ios-swift`, Cursor + Claude): `mcp.json` + `MCP.md`. Cursor → `.cursor/mcp.json`; Claude → project-root `.mcp.json`. **next:** Context7, Playwright, Chrome DevTools, Figma (remote). **ios-swift:** Context7 + Figma. CLI `init`/`clean` manage these paths.
|
|
13
61
|
- **Cursor + Claude `ios-swift` — full agent-team parity with `next`:** **21** agents (Playwright trio → `xcuitest-test-{planner,generator,healer}`), **7** skills (`xcuitest-e2e`), **5** slash commands, `hooks.json` + iOS-adapted `chain-team-phases.sh` (Cursor) / hook scripts + README (Claude), `team/fixtures/` ×3, `AGENTS.md` (Cursor) / thin `CLAUDE.md` (≤35 lines).
|
|
14
62
|
- **ios-swift rules:** agent-team intake/orchestrator, `xcode-tooling`, `reference-features`, domain rules (`navigation-coordinators`, `persistence-data`, `security-ios`, `module-public-api`), `technical-retro` alias; **21** rule topics (+ README). CLI init copies agents, hooks, skills, team, `AGENTS.md`.
|
|
@@ -16,12 +64,28 @@
|
|
|
16
64
|
|
|
17
65
|
### Changed
|
|
18
66
|
|
|
67
|
+
- **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).
|
|
68
|
+
- **Leakage scan:** `hooks/**/*.sh` recursive (includes cookbook examples).
|
|
69
|
+
- **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`).
|
|
70
|
+
- **PRESET-CONTRIBUTION:** shared-core sync step says **all six adapters** (3 stacks × 2 platforms), not «four presets».
|
|
71
|
+
- **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).
|
|
72
|
+
- **Twin policy doc sync:** `claude/next/rules/README.md` — missing twin is **FAIL** (next, ios-swift, and go); no soft FAIL for next.
|
|
73
|
+
- **next agent roster docs:** READMEs/commands say **21** agents (was stale 20).
|
|
74
|
+
- **PRESET-CONTRIBUTION:** cross-link → `.cursor/team/tasks/preset-regression-audit/` (was `preset-arch-quality-rules`).
|
|
75
|
+
- **Twin policy:** missing Claude twin for a changed Cursor rule is **FAIL** on **next**, **ios-swift**, and **go**.
|
|
76
|
+
- **build-verifier** preset-structure section: twin FAIL on next, session-start line budget, embed-drift + dogfood script hooks.
|
|
77
|
+
- Claude meta-rule `paths:` include dogfood `.claude/**/*` (+ `.cursor/rules` / `team/tasks` for parity).
|
|
19
78
|
- **Agent team slug bootstrap:** `/task` and `/feature-start` (Cursor + Claude, `next` + `ios-swift`) create `.cursor|claude/team/tasks/<slug>/` via **Write**, not Shell `mkdir` — avoids Cursor sandbox `Operation not permitted` (esp. macOS Desktop/Documents). Orchestrator + `team/README` + `task-router` document the rule.
|
|
20
79
|
- **Token model (ios-swift + next):** both presets use **3** alwaysApply / session-start rules (~77 / ~59 body lines). Post-change verification is **requestable** — ios: `post-change-build`; next: `post-change-lint`. Orchestrator, intake, code-review, feature-delivery, tooling rules load on-demand (`paths:` / description).
|
|
21
80
|
- Claude `next`: `agent-team-orchestrator` and `code-review-mr` use `paths:` (on-demand) — session-start matches the 3-rule budget above.
|
|
22
81
|
- Cursor `next` agents: all pipeline agents set **`readonly: false`** so they can write `.cursor/team/**`. Production/app restrictions remain in prompt bodies (Cursor `readonly: true` blocks all file writes, including team artifacts).
|
|
23
82
|
- **ios-swift:** `networking-services` HTTP-only (persistence split out); soft AC-19 for thin aliases (`agent-team-intake`, `technical-retro`); `feature-developer` requires stack-specific hook handoff forks.
|
|
24
83
|
|
|
84
|
+
### Breaking
|
|
85
|
+
|
|
86
|
+
- **Deprecated rule stubs removed** (Cursor + Claude `next`): `types-public-imports`, `api-public-imports`, `no-cross-component-styles-import` / `component-styles`. Use `public-imports` and `react-ui` instead.
|
|
87
|
+
- **`next` preset — post-change-lint no longer always-on:** Cursor `post-change-lint.mdc` and Claude twin are **requestable** (not session-start / `alwaysApply`). Load explicitly after code edits via skill `feature-delivery` or agent `build-verifier`. Session-start / alwaysApply is now **3** rules: `next-app-core`, `package-manager`, `code-quality-and-refactoring`. Workspace dogfood `.cursor/rules/post-change-lint.mdc` synced.
|
|
88
|
+
|
|
25
89
|
### Notes
|
|
26
90
|
|
|
27
91
|
- **P2 optional (ios-swift):** Remaining polish: feature-delivery matrix enrichment, swift-conventions body cap. (`BUGBOT.md` shipped.)
|
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,35 @@ 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), and **`go`** (Go backends with hexagonal architecture). 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
|
|
61
|
+
npx @bonesofspring/ai-rules init cursor --preset go
|
|
62
|
+
npx @bonesofspring/ai-rules init claude --preset go
|
|
56
63
|
```
|
|
57
64
|
|
|
58
65
|
Help: `ai-rules --help`.
|
|
59
66
|
|
|
67
|
+
## Contributing to presets
|
|
68
|
+
|
|
69
|
+
Presets are developed in this monorepo under `presets/`. If you add or change rules, agents, or platform artifacts:
|
|
70
|
+
|
|
71
|
+
- **Taxonomy & layers:** [`presets/_shared/README.md`](presets/_shared/README.md) — shared core (`_shared/core`), stack adapters, platform packaging
|
|
72
|
+
- **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`)
|
|
73
|
+
- **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)
|
|
74
|
+
- **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; soft drift included without `AI_RULES_DRIFT_FAIL`
|
|
75
|
+
- **Opt-in rule eval:** `yarn check:rule-eval` + `.github/workflows/rule-eval.yml` (`workflow_dispatch` + paths-scoped PR) — **not** wired into `check:preset-structure`
|
|
76
|
+
- **CLI note:** `_shared` is not an installable `--preset`; `init` copies only `presets/cursor/<name>/` or `presets/claude/<name>/`
|
|
77
|
+
|
|
60
78
|
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,16 +61,20 @@ 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:
|
|
65
71
|
npx @bonesofspring/ai-rules init cursor --preset next
|
|
66
72
|
npx @bonesofspring/ai-rules init cursor next
|
|
67
73
|
npx @bonesofspring/ai-rules init cursor --preset ios-swift
|
|
74
|
+
npx @bonesofspring/ai-rules init cursor --preset go
|
|
68
75
|
npx @bonesofspring/ai-rules init claude
|
|
69
76
|
npx @bonesofspring/ai-rules init claude --preset ios-swift
|
|
77
|
+
npx @bonesofspring/ai-rules init claude --preset go
|
|
70
78
|
npx @bonesofspring/ai-rules clean cursor
|
|
71
79
|
`);
|
|
72
80
|
}
|
|
@@ -253,6 +261,11 @@ function presetHasAnySource(base, cfg) {
|
|
|
253
261
|
return true;
|
|
254
262
|
}
|
|
255
263
|
}
|
|
264
|
+
for (const srcName of Object.keys(cfg.repoRootFiles || {})) {
|
|
265
|
+
if (fs.existsSync(path.join(base, srcName))) {
|
|
266
|
+
return true;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
256
269
|
return false;
|
|
257
270
|
}
|
|
258
271
|
|
|
@@ -384,6 +397,17 @@ function cmdInit(tool, preset, cwdOption) {
|
|
|
384
397
|
copiedSteps++;
|
|
385
398
|
}
|
|
386
399
|
}
|
|
400
|
+
|
|
401
|
+
for (const [srcName, destRel] of Object.entries(cfg.repoRootFiles || {})) {
|
|
402
|
+
const from = path.join(base, srcName);
|
|
403
|
+
if (fs.existsSync(from)) {
|
|
404
|
+
const destAbs = path.join(cwd, destRel);
|
|
405
|
+
fs.mkdirSync(path.dirname(destAbs), { recursive: true });
|
|
406
|
+
fs.copyFileSync(from, destAbs);
|
|
407
|
+
console.log(`Copied ${srcName} → ${destRel}`);
|
|
408
|
+
copiedSteps++;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
387
411
|
} catch (err) {
|
|
388
412
|
const msg = err instanceof Error ? err.message : String(err);
|
|
389
413
|
console.error(`init failed: ${msg}`);
|
|
@@ -442,6 +466,11 @@ function cmdClean(tool, cwdOption) {
|
|
|
442
466
|
removedParts.push(`${toolRoot}/${name}`);
|
|
443
467
|
}
|
|
444
468
|
|
|
469
|
+
for (const destRel of Object.values(cfg.repoRootFiles || {})) {
|
|
470
|
+
removeFileIfExists(path.join(cwd, destRel));
|
|
471
|
+
removedParts.push(destRel);
|
|
472
|
+
}
|
|
473
|
+
|
|
445
474
|
console.log(`Removed ${removedParts.join(', ')} (if present)`);
|
|
446
475
|
}
|
|
447
476
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonesofspring/ai-rules",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Presets of Cursor and Claude rules/commands for Revy Ross personal use",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Revy Ross",
|
|
@@ -24,6 +24,14 @@
|
|
|
24
24
|
"bin",
|
|
25
25
|
"presets"
|
|
26
26
|
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"check:preset-structure": "bash scripts/check-preset-structure.sh",
|
|
29
|
+
"check:preset-twin-map": "bash scripts/check-preset-twin-map.sh",
|
|
30
|
+
"check:preset-token-budget": "bash scripts/check-preset-token-budget.sh",
|
|
31
|
+
"check:preset-leakage": "bash scripts/check-preset-leakage.sh",
|
|
32
|
+
"check:shared-core-drift": "bash scripts/check-shared-core-drift.sh",
|
|
33
|
+
"check:rule-eval": "node scripts/check-rule-eval.mjs"
|
|
34
|
+
},
|
|
27
35
|
"engines": {
|
|
28
36
|
"node": ">=18"
|
|
29
37
|
},
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Shared preset core (`presets/_shared`)
|
|
2
|
+
|
|
3
|
+
Stack-agnostic **prose and checklists** for all installable presets: `next`, `ios-swift`, and `go` (`cursor/<stack>`, `claude/<stack>`).
|
|
4
|
+
|
|
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
|
+
|
|
7
|
+
## Layers
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
Core (_shared/core) → stack-agnostic prose
|
|
11
|
+
Stack (cursor|claude/<stack>) → domain / tooling deltas
|
|
12
|
+
Platform adapter → .mdc frontmatter | .md + paths:
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
See meta-rules: `core/meta/preset-layering.md`, `preset-twin-sync.md`, `preset-token-budget.md`, `preset-pr-checklist.md`, `preset-no-cross-stack-leakage.md`.
|
|
16
|
+
|
|
17
|
+
**Contributing:** [`../../docs/PRESET-CONTRIBUTION.md`](../../docs/PRESET-CONTRIBUTION.md) (full guide: layers, SoT, new stack, platform artifacts, PR checklist).
|
|
18
|
+
|
|
19
|
+
## Sync model
|
|
20
|
+
|
|
21
|
+
1. Edit core under `core/**` when changing shared principles.
|
|
22
|
+
2. Update every consumer that carries `<!-- shared-core: <path> -->` in the **same PR**.
|
|
23
|
+
3. Cursor `presets/cursor/<stack>/` is SoT per stack; Claude twins are derived in the same PR.
|
|
24
|
+
4. Dogfood: `packages/ai-rules/scripts/sync-dogfood-cursor.sh` (packages → root `.cursor/`).
|
|
25
|
+
|
|
26
|
+
### Sync modes (marker semantics)
|
|
27
|
+
|
|
28
|
+
| Mode | Marker | Adapter body | Typical stems |
|
|
29
|
+
|------|--------|--------------|---------------|
|
|
30
|
+
| **Embed** | `<!-- shared-core: … -->` | Core prose + optional `## Stack notes` only for deltas | `quality/*`, `meta/preset-*`, thin review/intake aliases |
|
|
31
|
+
| **Lineage** | same marker | **Stack-specific** body; core is abstract SoT / checklist reference | `architecture/feature-delivery-workflow`, `architecture/reference-features.template`, `agent-team/agent-team-orchestrator` |
|
|
32
|
+
|
|
33
|
+
Do **not** expect lineage adapters to byte-match core. Embed adapters should match core after stripping frontmatter and `## Stack notes` — verify with `scripts/check-shared-core-drift.sh`.
|
|
34
|
+
|
|
35
|
+
## Folder map
|
|
36
|
+
|
|
37
|
+
| Dir | Contents |
|
|
38
|
+
|-----|----------|
|
|
39
|
+
| `core/quality/` | Boy-scout + Principles (always-on); requestable `design-guidance` (smells ≤12 + GoF ≤8) |
|
|
40
|
+
| `core/agent-team/` | Orchestrator + intake (pipeline language) |
|
|
41
|
+
| `core/architecture/` | Feature-delivery abstract + reference-features template |
|
|
42
|
+
| `core/review/` | Code-review MR + technical-retro alias |
|
|
43
|
+
| `core/meta/` | Author-facing preset meta-rules |
|
|
44
|
+
|
|
45
|
+
## CLI note
|
|
46
|
+
|
|
47
|
+
Do **not** nest `_shared` under `cursor/` or `claude/`. Do not pass `_shared` as `--preset`.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Agent team intake
|
|
2
|
+
|
|
3
|
+
When the user message looks like a **work request** (implement, add, fix, refactor, review MR, write tests, spike) — not a question about how code works:
|
|
4
|
+
|
|
5
|
+
1. Prefer **`/task <their request>`** or invoke **task-router** first.
|
|
6
|
+
2. Do not jump straight to coding without router + pipeline when scope is non-trivial.
|
|
7
|
+
3. Pure questions («как работает X», «объясни») — prefer agent **`codebase-analyzer`** (explain-as-is); trivial one-liners may be answered inline. Do not open `/task`.
|
|
8
|
+
|
|
9
|
+
Exceptions: user explicitly says «без pipeline», «просто сделай», or continues an active slug.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Agent team orchestrator
|
|
2
|
+
|
|
3
|
+
Parent agent = **manager**. Router plans; specialists execute. Artifacts: `.cursor/team/tasks/<slug>/` (Claude: `.claude/team/tasks/<slug>/`).
|
|
4
|
+
|
|
5
|
+
Work request без `/task` — см. **agent-team-intake** (когда предлагать router вместо прямого кодинга).
|
|
6
|
+
|
|
7
|
+
## Entry points
|
|
8
|
+
|
|
9
|
+
| Command | When |
|
|
10
|
+
|---------|------|
|
|
11
|
+
| **`/task <desc>`** | **Preferred** — router → dynamic pipeline → first agent |
|
|
12
|
+
| `/task-continue <slug>` | After human gate or pause |
|
|
13
|
+
| `/feature-start <desc>` | Legacy: analyst-only start (no router) |
|
|
14
|
+
| `/feature-continue <slug>` | Alias of task-continue |
|
|
15
|
+
| `/technical-retro [slug]` | Retro with agent team block |
|
|
16
|
+
|
|
17
|
+
## Roles (shared catalog)
|
|
18
|
+
|
|
19
|
+
Roster of specialists is **stack-specific** (agent names and write scopes differ). See **Stack notes** in the stack adapter for the live Roles table. Common patterns:
|
|
20
|
+
|
|
21
|
+
| Kind | Examples (names vary by stack) |
|
|
22
|
+
|------|--------------------------------|
|
|
23
|
+
| Planning | `task-router`, `task-analyst`, `solution-architect`, `migration-specialist` |
|
|
24
|
+
| Implementation | `feature-developer`, `debugger`, `ci-investigator` |
|
|
25
|
+
| Gates / review | `build-verifier`, `code-reviewer`, `security-reviewer`, `performance-auditor`; plus stack-native a11y/UI reviewer **only when the stack has a UI surface** |
|
|
26
|
+
| Tests | unit planner/generator/healer; e2e/UI planner/generator/healer (stack-native) |
|
|
27
|
+
| Docs | `tech-writer` |
|
|
28
|
+
|
|
29
|
+
**Cursor frontmatter:** all team pipeline agents use `readonly: false` so they can write team artifacts. Production/app restrictions live in the agent prompt body — do **not** set `readonly: true`.
|
|
30
|
+
|
|
31
|
+
Full prompts: stack `agents/*.md`. Artifact conventions: stack `team/README.md`.
|
|
32
|
+
|
|
33
|
+
## Dynamic pipeline
|
|
34
|
+
|
|
35
|
+
```mermaid
|
|
36
|
+
flowchart TD
|
|
37
|
+
task["/task prompt"]
|
|
38
|
+
router["task-router"]
|
|
39
|
+
pipeline["pipeline.json"]
|
|
40
|
+
step0["steps 0..N"]
|
|
41
|
+
gate{"humanGates?"}
|
|
42
|
+
hook["subagentStop hook"]
|
|
43
|
+
retro["/technical-retro"]
|
|
44
|
+
|
|
45
|
+
task --> router
|
|
46
|
+
router --> pipeline
|
|
47
|
+
pipeline --> step0
|
|
48
|
+
step0 --> gate
|
|
49
|
+
gate -->|"/task-continue"| step0
|
|
50
|
+
step0 --> hook
|
|
51
|
+
hook --> step0
|
|
52
|
+
step0 --> retro
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Source of truth for order:** `pipeline.json` → `steps[]`. Never hardcode analyst → dev → review → QA when `pipeline.json` exists.
|
|
56
|
+
|
|
57
|
+
## status.json (pipeline mode)
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"slug": "...",
|
|
62
|
+
"intent": "feature",
|
|
63
|
+
"pipelineIndex": 0,
|
|
64
|
+
"currentAgent": "task-analyst",
|
|
65
|
+
"phase": "executing",
|
|
66
|
+
"state": "in_progress",
|
|
67
|
+
"awaitingHumanGate": false
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
| state | Meaning |
|
|
72
|
+
|-------|---------|
|
|
73
|
+
| `in_progress` | Current step running |
|
|
74
|
+
| `completed` | Current step done; hook advances |
|
|
75
|
+
| `awaiting_approval` | Human gate; wait for `/task-continue` |
|
|
76
|
+
| `changes_requested` | Reviewer blocked; re-run developer (`retryAfterFix`) |
|
|
77
|
+
| `validation_failed` | build-verifier failed; re-run developer then build-verifier |
|
|
78
|
+
|
|
79
|
+
## Pipeline step options
|
|
80
|
+
|
|
81
|
+
| Field | Use |
|
|
82
|
+
|-------|-----|
|
|
83
|
+
| `skipIf` | `debugger.fixed` / `ci-investigator.resolved` — hook skips step when artifact says fix applied |
|
|
84
|
+
| `parallel: true` | `agent` is array — invoke **all** agents in one parent turn; each appends to `parallelCompleted` |
|
|
85
|
+
| `scope` | e.g. `unit-in-dev`, `e2e-only`, `preset-artifacts-only` — passed to developer/qa |
|
|
86
|
+
| `model` | `cheap` \| `standard` \| `strong` — optional tier override |
|
|
87
|
+
|
|
88
|
+
## Rules (strict)
|
|
89
|
+
|
|
90
|
+
1. **`/task` always starts with task-router** (except user says "skip router" with documented pipeline).
|
|
91
|
+
2. Read `pipeline.json` before every subagent invocation.
|
|
92
|
+
3. One role per Task call — **except** parallel steps: multiple Task calls in one message.
|
|
93
|
+
4. **Never** skip `humanGates` without `/task-continue` or explicit user approval.
|
|
94
|
+
5. Persist handoffs to disk (`brief.md`, `decomposition.md`, `debug-report.md`, `validation-report.md`, `architecture.md`, `migration-plan.md`, `ci-report.md`, `a11y-review.md`, `perf-report.md`, `security-review.md`, `api-contract-review.md`, `unit-test-plan.md`, `documentation.md`, `review.md`).
|
|
95
|
+
6. On `changes_requested` from reviewers: hook sets `retryAfterFix` → developer → same reviewer.
|
|
96
|
+
7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
|
|
97
|
+
8. When all steps complete, suggest `/technical-retro <slug>`.
|
|
98
|
+
9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
|
|
99
|
+
|
|
100
|
+
## Team artifact I/O (Cursor Shell sandbox)
|
|
101
|
+
|
|
102
|
+
- Create/update team task dirs with the **Write** tool (parents are created automatically). Do **not** bootstrap slug dirs with Shell `mkdir -p` — default sandbox returns `Operation not permitted` (worse on macOS Desktop/Documents with TCC).
|
|
103
|
+
- If Shell must touch team paths and fails with EPERM, retry with `required_permissions: ["all"]`. Prefer Write for artifacts.
|
|
104
|
+
- Prefer repo under `~/Projects` / `WebstormProjects` over `~/Desktop` when using agent team heavily.
|
|
105
|
+
|
|
106
|
+
## Invoking agents
|
|
107
|
+
|
|
108
|
+
Use Task tool or `/agent-name`. Pass: slug, artifact paths, step `scope` if set.
|
|
109
|
+
|
|
110
|
+
### Model when invoking (Task)
|
|
111
|
+
|
|
112
|
+
1. Read `steps[i].model` if present; else use the agent’s frontmatter `model` (see `agents/README.md` matrix).
|
|
113
|
+
2. Map abstract tiers:
|
|
114
|
+
- **`cheap`** → pass Task `model: "fast"` when the tool accepts it (or rely on agent `fast`).
|
|
115
|
+
- **`standard`** → omit Task `model` (frontmatter `inherit` / mid default).
|
|
116
|
+
- **`strong`** → **never** pass `fast`; rely on agent pin or parent Max model.
|
|
117
|
+
3. Parallel steps: apply the step-level `model` to **each** agent in the array (or omit → each agent’s own frontmatter).
|
|
118
|
+
|
|
119
|
+
After each agent completes, ensure `status.json` has `state: completed` (or `awaiting_approval` if gate applies).
|
|
120
|
+
|
|
121
|
+
## Legacy mode
|
|
122
|
+
|
|
123
|
+
If `pipeline.json` is missing (old `/feature-start` tasks), fall back to fixed phases: analysis → development → review → testing. Hook supports both.
|
|
124
|
+
|
|
125
|
+
## Skip pipeline when
|
|
126
|
+
|
|
127
|
+
Do **not** run `/task` + router for:
|
|
128
|
+
|
|
129
|
+
- Pure questions («как работает X», «объясни») — prefer agent **`codebase-analyzer`** for deep traces; inline OK for trivial one-liners.
|
|
130
|
+
- Typo / one-file fix / trivial config with no architecture risk.
|
|
131
|
+
- User explicitly says «без pipeline», «просто сделай», or continues an active slug.
|
|
132
|
+
- Single-line `docs-only` with no code impact.
|
|
133
|
+
|
|
134
|
+
Borderline work requests — см. **agent-team-intake**.
|
|
135
|
+
|
|
136
|
+
## Auto-detection (optional)
|
|
137
|
+
|
|
138
|
+
When user describes a **non-trivial task** (not a question), suggest `/task <message>` or run router if they agree.
|
|
139
|
+
|
|
140
|
+
## Preset authoring
|
|
141
|
+
|
|
142
|
+
When the work edits `packages/ai-rules/presets/**` (or dogfood `.cursor/` sync of presets), follow meta-rules: **preset-pr-checklist**, **preset-twin-sync**, **preset-layering**, **preset-token-budget**, **preset-no-cross-stack-leakage**.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Доставка фичи (сквозной порядок)
|
|
2
|
+
|
|
3
|
+
Типичная фича с данными и UI. Конкретные каталоги и rule stems — в **Stack notes** адаптера.
|
|
4
|
+
|
|
5
|
+
## Чеклист (абстрактный порядок)
|
|
6
|
+
|
|
7
|
+
1. **Домен / типы** — сущности и контракты слоя Domain/types; public API слоя.
|
|
8
|
+
2. **Транспорт / DTO** — DTO и мапперы Domain ↔ transport (не протекают в UI).
|
|
9
|
+
3. **Сервисы / Data** — реализации репозиториев / API-сервисов через public клиенты стека.
|
|
10
|
+
4. **Состояние** — store / ViewModel / use cases; без прямого HTTP и без DTO в UI.
|
|
11
|
+
5. **UI** — тонкие views/components; данные через состояние; design-system.
|
|
12
|
+
6. **Тесты** — unit на mappers / нетривиальную логику; e2e/UI по конвенции стека.
|
|
13
|
+
7. **Завершение** — post-change gate стека (lint/build) + package/toolchain rules.
|
|
14
|
+
|
|
15
|
+
## Поток данных (ориентир)
|
|
16
|
+
|
|
17
|
+
```mermaid
|
|
18
|
+
flowchart LR
|
|
19
|
+
DTO[DTO] --> Mappers[Mappers]
|
|
20
|
+
Mappers --> Domain[Domain]
|
|
21
|
+
Domain --> Service[Service / Repo]
|
|
22
|
+
Service --> State[Store / VM]
|
|
23
|
+
State --> UI[UI]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Частичные сценарии
|
|
27
|
+
|
|
28
|
+
| Задача | Минимум |
|
|
29
|
+
|--------|---------|
|
|
30
|
+
| Только API / модель | Domain + DTO + mapper + service/repo; unit на mapper |
|
|
31
|
+
| Только состояние | Протоколы/сервисы; без HTTP в UI |
|
|
32
|
+
| Только UI | Существующее состояние; без DTO |
|
|
33
|
+
| Только тесты | Specs по конвенции; не менять production без нужды |
|
|
34
|
+
|
|
35
|
+
## Антипаттерны (общие)
|
|
36
|
+
|
|
37
|
+
- DTO / transport-типы в UI или presentation state.
|
|
38
|
+
- Низкоуровневый HTTP / конкретный клиент из UI в обход сервиса.
|
|
39
|
+
- Deep-import внутренних файлов другого модуля/фичи.
|
|
40
|
+
- Нарушение границ слоёв ради краткости.
|
|
41
|
+
- **Ubiquitous language:** имена и границы Domain/типов отражают предметную область фичи — не смешивать транспорт/фреймворк-термины в домен без нужды; presentation не диктует словарь модели.
|
|
42
|
+
- При оценке структуры, smells или выбора паттерна — подгружать requestable **`design-guidance`** (не always-on); не копировать каталог в чеклист фичи.
|
|
43
|
+
|
|
44
|
+
## Матрица зона → правила
|
|
45
|
+
|
|
46
|
+
Заполняется в stack adapter: конкретные globs/пути и имена `.mdc` / topic `.md`.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Эталонные фичи (reference features)
|
|
2
|
+
|
|
3
|
+
Перед реализацией найди фичу того же типа и **повтори её структуру**, не изобретая новую организацию файлов.
|
|
4
|
+
|
|
5
|
+
## Таблица эталонов
|
|
6
|
+
|
|
7
|
+
Замени placeholders на **реальные** пути после `ai-rules init` / договорённости команды:
|
|
8
|
+
|
|
9
|
+
| Слой | Эталон | Что копировать |
|
|
10
|
+
|------|--------|----------------|
|
|
11
|
+
| UI / Presentation | **TBD** | компоненты, styles/data helpers, barrel |
|
|
12
|
+
| State / ViewModel | **TBD** | slice/VM, selectors, types |
|
|
13
|
+
| API / Data | **TBD** | service/repo, mappers, barrel |
|
|
14
|
+
| Domain / Types | **TBD** | domain types, public export |
|
|
15
|
+
| Unit tests | **TBD** | `*.spec` / XCTest naming |
|
|
16
|
+
| E2E / UI tests | **TBD** | cases/plans, page objects / accessibility IDs |
|
|
17
|
+
|
|
18
|
+
## Как использовать
|
|
19
|
+
|
|
20
|
+
1. Определи затронутые слои из `decomposition.md` или задачи.
|
|
21
|
+
2. Открой эталон из таблицы (после заполнения путей).
|
|
22
|
+
3. Зеркаль именование, порядок файлов, паттерны импортов и тестов.
|
|
23
|
+
4. Если эталона нет — выбери **самую близкую** существующую фичу того же слоя и зафиксируй выбор в handoff.
|
|
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
|
+
|
|
37
|
+
## Связанные правила
|
|
38
|
+
|
|
39
|
+
- `code-quality-and-refactoring` — повторять паттерны, не deep-import.
|
|
40
|
+
- `feature-delivery-workflow` — порядок слоёв.
|
|
41
|
+
- skill `feature-delivery` — end-to-end сценарий.
|
|
42
|
+
|
|
43
|
+
> Concrete path tables, globs, and dogfood checklists live in the stack adapter **Stack notes**.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Preset layering
|
|
2
|
+
|
|
3
|
+
Правила для **авторов пресетов** (`packages/ai-rules/presets/**`). Не always-on в consumer apps.
|
|
4
|
+
|
|
5
|
+
## Слои
|
|
6
|
+
|
|
7
|
+
| Слой | Где | Что класть |
|
|
8
|
+
|------|-----|------------|
|
|
9
|
+
| **Core** | `presets/_shared/core/**` | Stack-agnostic prose + checklists; без frontmatter; без путей `app/**`, `Features/**`, Playwright, xcodebuild |
|
|
10
|
+
| **Stack** | `presets/{cursor\|claude}/<stack>/` | Domain/tooling, always-on trio стека, stack examples в **Stack notes** |
|
|
11
|
+
| **Platform** | Cursor `.mdc` / Claude `.md` | Frontmatter (`alwaysApply`/`globs` vs `paths:`), platform-only (`BUGBOT.md`, `CLAUDE.md`) |
|
|
12
|
+
|
|
13
|
+
## Куда класть новое правило
|
|
14
|
+
|
|
15
|
+
1. Общие принципы для всех стеков → **core** + адаптеры с `<!-- shared-core: … -->`.
|
|
16
|
+
2. Только один из installable стеков (`next` / `ios-swift` / `go`) → **stack-specific** (не в `_shared`).
|
|
17
|
+
3. Только Cursor или только Claude packaging → platform artifact / frontmatter, не дублировать семантику.
|
|
18
|
+
|
|
19
|
+
## SoT
|
|
20
|
+
|
|
21
|
+
- Packages path — SoT; root `.cursor/` — dogfood sync.
|
|
22
|
+
- Per stack: **Cursor** `presets/cursor/<stack>/` → Claude twin same PR.
|
|
23
|
+
- `_shared` **не** `--preset` и не копируется CLI `init`.
|
|
24
|
+
|
|
25
|
+
См. также: `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage`.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Preset no cross-stack leakage
|
|
2
|
+
|
|
3
|
+
Запрет протекания stack-specific имён, путей и handoff stems между пресетами.
|
|
4
|
+
|
|
5
|
+
## Principles
|
|
6
|
+
|
|
7
|
+
- `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
|
|
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.
|
|
10
|
+
- Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
|
|
11
|
+
|
|
12
|
+
## Forbidden in ios-swift hooks/agents (FAIL)
|
|
13
|
+
|
|
14
|
+
In ios-swift `chain-team-phases.sh` / agent handoffs (Cursor + Claude):
|
|
15
|
+
|
|
16
|
+
- `playwright-test-`, `playwright-agents`, `playwright-e2e`, `user-playwright`
|
|
17
|
+
- `app/__tests__/e2e` as a required path
|
|
18
|
+
- Positive yarn recipes `lint:js` / `lint:css` as commands to run (negation prose alone is weak — prefer zero occurrences)
|
|
19
|
+
|
|
20
|
+
Required instead: `xcuitest-test-*` stems; build-verifier mentions `xcodebuild` or `post-change-build` / `xcode-tooling`.
|
|
21
|
+
|
|
22
|
+
## Forbidden in next hooks/agents (FAIL when present as required)
|
|
23
|
+
|
|
24
|
+
- `xcuitest-test-` as handoff stems
|
|
25
|
+
- Requiring `xcodebuild` / SwiftLint as the default post-change gate for Next app work
|
|
26
|
+
|
|
27
|
+
## Forbidden in go hooks/agents (FAIL)
|
|
28
|
+
|
|
29
|
+
- `playwright-test-`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
|
|
30
|
+
- Positive yarn recipes `lint:js` / `lint:css`
|
|
31
|
+
- `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
|
|
32
|
+
- Agent file `accessibility-reviewer` (no UI surface)
|
|
33
|
+
|
|
34
|
+
Required instead: `integration-test-*`; build-verifier / `post-change-test` / `go-tooling` (`go test`, `go vet`).
|
|
35
|
+
|
|
36
|
+
## Soft / document
|
|
37
|
+
|
|
38
|
+
- Mentioning the other stack in **docs** comparing presets is OK.
|
|
39
|
+
- `build-verifier` may reference other stacks when validating **preset packaging** (`scope: preset-structure-validation`).
|
|
40
|
+
|
|
41
|
+
## Chain fork
|
|
42
|
+
|
|
43
|
+
`hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, and `go` (per platform).
|