@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
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
| Migration planner | `migration-specialist.md` | no |
|
|
13
13
|
| API contract reviewer | `api-contract-reviewer.md` | no |
|
|
14
14
|
|
|
15
|
+
## Analysis (on-demand)
|
|
16
|
+
|
|
17
|
+
| Agent | Файл | Production-код |
|
|
18
|
+
|-------|------|----------------|
|
|
19
|
+
| Codebase analyzer | `codebase-analyzer.md` | no (explain-as-is only) |
|
|
20
|
+
|
|
15
21
|
## Implementation and CI
|
|
16
22
|
|
|
17
23
|
| Agent | Файл | Production-код |
|
|
@@ -56,7 +62,7 @@ SoT по умолчанию — YAML `model` в каждом agent-файле.
|
|
|
56
62
|
|
|
57
63
|
| Tier | Default frontmatter | Agents |
|
|
58
64
|
|------|---------------------|--------|
|
|
59
|
-
| **cheap** | `fast` | `task-router`, `task-analyst`, `build-verifier`, `code-reviewer`, `tech-writer` |
|
|
65
|
+
| **cheap** | `fast` | `task-router`, `task-analyst`, `build-verifier`, `code-reviewer`, `tech-writer`, `codebase-analyzer` |
|
|
60
66
|
| **standard** | `inherit` or `sonnet` | `feature-developer`, `debugger`, `ci-investigator`, `api-contract-reviewer`, `accessibility-reviewer`, `qa-tester`, `unit-test-*`, `playwright-test-*` (`sonnet` where already pinned) |
|
|
61
67
|
| **strong** | `opus` | `solution-architect`, `migration-specialist`, `security-reviewer`, `performance-auditor` |
|
|
62
68
|
|
|
@@ -25,6 +25,35 @@ Use **`rules/tooling-and-review/package-manager.md`** for the repo package manag
|
|
|
25
25
|
|
|
26
26
|
Prefer **`lint`** (= js + css + type-check) before handoff on large changes.
|
|
27
27
|
|
|
28
|
+
## Preset-structure validation (when scope is preset / packages/ai-rules)
|
|
29
|
+
|
|
30
|
+
When validating **preset packaging** changes (paths under `packages/ai-rules/presets/**`, or `scope: preset-structure-validation` / `preset-artifacts-only`), run these checks. Skip app lint if there are **no** app source changes.
|
|
31
|
+
|
|
32
|
+
### FAIL (all stacks)
|
|
33
|
+
|
|
34
|
+
1. **Token budget:** Cursor `alwaysApply: true` count ≤ **3**; Claude rules without `paths:` === **3** (**exclude `**/README.md`** — Option A). Meta `preset-*` rules must **not** be session-start (must have `paths:`).
|
|
35
|
+
2. **Leakage (next):** hooks/agents must not require `xcuitest-test-*` handoffs or `xcodebuild` as the default Next post-change gate. See `tooling-and-review/preset-no-cross-stack-leakage.md`.
|
|
36
|
+
3. **Mapping / README:** `rules/README.md` must include a Cursor→Claude mapping table; document core→stack mapping when `_shared` consumers exist.
|
|
37
|
+
4. **shared-core consumers:** if `_shared/core/**` changed, every file with matching `<!-- shared-core: … -->` in this PR must be updated (or intentional fork documented).
|
|
38
|
+
5. **Twin presence:** Cursor rule change without Claude twin same PR → **FAIL** (next, ios-swift, and go). Domain twin body ≥15 lines; thin aliases may be shorter.
|
|
39
|
+
6. **Session-start body budget:** sum body lines of the **3** intended session-start rules ≤ **120** (stretch ≤100); do **not** include `**/README.md` — record in validation-report; FAIL if grossly over.
|
|
40
|
+
7. **Embed drift (soft by default):** run `packages/ai-rules/scripts/check-shared-core-drift.sh`. Document DRIFT; `AI_RULES_DRIFT_FAIL=1` to enforce. Lineage stems excluded from body equality.
|
|
41
|
+
8. **Dogfood (monorepo soft):** prefer `packages/ai-rules/scripts/sync-dogfood-cursor.sh`; mass dogfood deletion without migration doc → risk / FAIL for maintainers.
|
|
42
|
+
|
|
43
|
+
9. **Root AGENTS template:** each installable preset (`cursor|claude` × `next|ios-swift|go`) must ship `REPO_AGENTS.md` when validating preset packaging → **FAIL** if missing.
|
|
44
|
+
10. **Hooks cookbook:** default `hooks.json` must **not** reference `hooks/examples/` → **FAIL** if it does.
|
|
45
|
+
11. **No react-performance on ios/go:** skill directory / required handoff must be absent under ios-swift and go → **FAIL** (leakage). Prefer `check:preset-leakage`.
|
|
46
|
+
12. **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`.
|
|
47
|
+
|
|
48
|
+
### Soft notes
|
|
49
|
+
|
|
50
|
+
- Thin aliases may be <15 body lines.
|
|
51
|
+
- Embed vs lineage: `docs/PRESET-CONTRIBUTION.md`, `_shared/README.md`.
|
|
52
|
+
|
|
53
|
+
### ios-swift-only checks
|
|
54
|
+
|
|
55
|
+
When ios-swift paths are also in the PR, apply ios-swift verifier checks (chain fork, Playwright leakage) — **FAIL**.
|
|
56
|
+
|
|
28
57
|
## Output
|
|
29
58
|
|
|
30
59
|
Write `.claude/team/tasks/<slug>/validation-report.md`:
|
|
@@ -61,3 +61,7 @@ Update `status.json`:
|
|
|
61
61
|
If **REQUEST_CHANGES**, set `"state": "changes_requested"` (hook will re-invoke feature-developer).
|
|
62
62
|
|
|
63
63
|
Do not mix this output with retrospective facilitation — keep review and retro separate.
|
|
64
|
+
|
|
65
|
+
## Design guidance
|
|
66
|
+
|
|
67
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codebase-analyzer
|
|
3
|
+
description: Explains HOW existing code works as-is. Use when the user asks how something works, to trace data flow, 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 Next.js codebase 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 (routes, public barrels `@/api` / `@/types`, feature folders).
|
|
20
|
+
2. Trace calls and data flow across UI → store → API → HTTP as applicable; read each file involved.
|
|
21
|
+
3. Summarize: purpose, flow, contracts between modules, layer 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 files, call chains, types/mappers, layer boundaries as they exist today.
|
|
27
|
+
|
|
28
|
+
**Will not:** edit production code; open `/task` pipelines; propose PRs or refactors unprompted.
|
|
@@ -61,3 +61,7 @@ Update `status.json`:
|
|
|
61
61
|
Handoff summary: root cause, recommended fix, files touched (if any).
|
|
62
62
|
|
|
63
63
|
Do not perform formal code review or write e2e plans — those are separate agents.
|
|
64
|
+
|
|
65
|
+
## Design guidance
|
|
66
|
+
|
|
67
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -20,8 +20,25 @@ You are a senior frontend developer working in a Next.js monorepo with strict la
|
|
|
20
20
|
- Mark completed tasks in `decomposition.md`.
|
|
21
21
|
- Validation: **`rules/tooling-and-review/post-change-lint.md`**. If pipeline next step is **`build-verifier`**, scoped lint/type-check on **changed files** is enough; full project lint is build-verifier's job.
|
|
22
22
|
|
|
23
|
+
## Zero improvisation
|
|
24
|
+
|
|
25
|
+
- Implement **only** what the brief / AC / current decomposition task require.
|
|
26
|
+
- If requirements are ambiguous, conflicting, or multi-way — **ask** before coding; do not guess extras as "best practices".
|
|
27
|
+
- Forbidden without explicit AC/task: unrelated security hardening, extra validation, UI polish, logging/monitoring, drive-by refactors, new config/env.
|
|
28
|
+
- Boy scout / `design-guidance` improvements stay **within** touched files and must not expand task scope.
|
|
29
|
+
|
|
30
|
+
## Will / Will not
|
|
31
|
+
|
|
32
|
+
**Will:** follow layer order and reference features; add required unit tests; run the post-change gate; update task artifacts.
|
|
33
|
+
|
|
34
|
+
**Will not:** formal code review; start blocked/dependent tasks; invent AC; auto-continue the next WP when the pipeline expects a human gate or handoff.
|
|
35
|
+
|
|
23
36
|
## On completion
|
|
24
37
|
|
|
25
38
|
Update `status.json` (`currentAgent`: `feature-developer`, `state`: `completed`). Handoff: tasks done, files by layer, unit specs, validation result, gaps for build-verifier/reviewer.
|
|
26
39
|
|
|
27
40
|
Do not perform formal code review — that is the code-reviewer subagent's job.
|
|
41
|
+
|
|
42
|
+
## Design guidance
|
|
43
|
+
|
|
44
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -66,3 +66,7 @@ Update `status.json`:
|
|
|
66
66
|
For standalone `perf-audit` intent, suggest `/technical-retro` or a follow-up `/task` to implement fixes.
|
|
67
67
|
|
|
68
68
|
Do not modify production code.
|
|
69
|
+
|
|
70
|
+
## Design guidance
|
|
71
|
+
|
|
72
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -14,9 +14,11 @@ You are a frontend security reviewer for a Next.js TypeScript application.
|
|
|
14
14
|
|
|
15
15
|
## Review scope
|
|
16
16
|
|
|
17
|
-
-
|
|
17
|
+
Load `tooling-and-review/security-next.md` for coding-time invariants. Focus on:
|
|
18
|
+
|
|
19
|
+
- Secrets, tokens, API keys in source or committed env files; never in `NEXT_PUBLIC_*`.
|
|
18
20
|
- `dangerouslySetInnerHTML`, unsanitized HTML, URL injection.
|
|
19
|
-
- Auth token storage (cookies vs localStorage), refresh flows, 401 handling.
|
|
21
|
+
- Auth token storage (cookies vs localStorage), server-side session verify, refresh flows, 401 handling.
|
|
20
22
|
- CSRF considerations for state-changing requests (as applicable to frontend).
|
|
21
23
|
- Open redirects in navigation/router usage.
|
|
22
24
|
- Sensitive data in client-side logs or error messages.
|
|
@@ -68,3 +68,7 @@ Update `status.json`:
|
|
|
68
68
|
For `spike` intent with human gate after architect: set `"state": "awaiting_approval"` if design needs user sign-off.
|
|
69
69
|
|
|
70
70
|
Handoff: summary of design decisions and recommended next steps for developer.
|
|
71
|
+
|
|
72
|
+
## Design guidance
|
|
73
|
+
|
|
74
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -109,3 +109,7 @@ When DoR is reached and artifacts are saved:
|
|
|
109
109
|
3. **Stop** and ask the user to review artifacts. Tell them to run `/task-continue <slug>` after approval or reply with corrections.
|
|
110
110
|
|
|
111
111
|
Do not invoke the developer or any implementation subagent.
|
|
112
|
+
|
|
113
|
+
## Design guidance (optional)
|
|
114
|
+
|
|
115
|
+
- Optional: Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit — only when decomposing refactor/architecture tasks (not default).
|
|
@@ -6,3 +6,9 @@
|
|
|
6
6
|
| `guard-shell-command.sh` | Destructive git / package-manager guard |
|
|
7
7
|
|
|
8
8
|
Wire into Claude Code hooks per project documentation when enabling agent team auto-chain.
|
|
9
|
+
|
|
10
|
+
## Optional cookbook
|
|
11
|
+
|
|
12
|
+
Example scripts live in `hooks/examples/` (secret-guard, format-edited, test-on-save). They are **not** auto-enabled.
|
|
13
|
+
|
|
14
|
+
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: **next**). Cursor twin examples under `presets/cursor/next/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: **next** — recipes must stay stack-safe (no cross-stack lint/test commands).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Optional: format/lint edited JS/TS under app/ after save.
|
|
3
|
+
# NOT in default hooks.json. Requires yarn scripts in app/.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
ROOT="${CURSOR_PROJECT_DIR:-.}"
|
|
6
|
+
cd "$ROOT/app" 2>/dev/null || cd "$ROOT"
|
|
7
|
+
# Prefer project scripts; adjust names to match package.json
|
|
8
|
+
if command -v yarn >/dev/null 2>&1; then
|
|
9
|
+
yarn lint:js --fix 2>/dev/null || yarn eslint --fix . 2>/dev/null || true
|
|
10
|
+
fi
|
|
11
|
+
exit 0
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Optional cookbook: block committing likely secrets in staged diffs.
|
|
3
|
+
# NOT wired in default hooks.json — copy to hooks/ and register manually.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
PATTERN='(AKIA[0-9A-Z]{16}|-----BEGIN (RSA |OPENSSH )?PRIVATE KEY-----|api[_-]?key\s*[:=]\s*['\''\"][^'\''\"]{12,})'
|
|
6
|
+
if git diff --cached -U0 2>/dev/null | grep -Eiq "$PATTERN"; then
|
|
7
|
+
echo "secret-guard: possible secret in staged diff — review before commit" >&2
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
10
|
+
exit 0
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Optional: scoped unit tests for changed files under app/src.
|
|
3
|
+
# NOT in default hooks.json. No Playwright here.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
ROOT="${CURSOR_PROJECT_DIR:-.}"
|
|
6
|
+
cd "$ROOT/app" 2>/dev/null || exit 0
|
|
7
|
+
yarn test --findRelatedTests --passWithNoTests 2>/dev/null || yarn test --passWithNoTests 2>/dev/null || true
|
|
8
|
+
exit 0
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
# `.claude/rules` (preset next)
|
|
2
2
|
|
|
3
|
-
В Claude Code все `.md` под `rules/` **обнаруживаются рекурсивно**.
|
|
3
|
+
В Claude Code все `.md` под `rules/` **обнаруживаются рекурсивно**. Тела **derived** из Cursor SoT; индексы — не второй SoT.
|
|
4
|
+
|
|
5
|
+
## SoT sync
|
|
6
|
+
|
|
7
|
+
| Principle | Detail |
|
|
8
|
+
|-----------|--------|
|
|
9
|
+
| **SoT** | `presets/cursor/next/rules/*.mdc` — edit here first |
|
|
10
|
+
| **Derive** | Claude topic `.md` = body + `paths:` (from Cursor `globs:` / requestable triggers) |
|
|
11
|
+
| **Drop** | Cursor-only keys (`alwaysApply`); keep short `description` |
|
|
12
|
+
| **Checklist** | change Cursor → update Claude twin **same PR** (**FAIL** if missing — next, ios-swift, and go; see `preset-twin-sync` / build-verifier) |
|
|
13
|
+
| **Shared core** | `presets/_shared/core/**` — see `<!-- shared-core: … -->` markers; taxonomy in `_shared/README.md` |
|
|
4
14
|
|
|
5
15
|
## Loading strategy
|
|
6
16
|
|
|
7
17
|
- **Session start (no `paths:`):** ровно **3** — `next-app-core`, `package-manager`, `code-quality`
|
|
8
|
-
- **On-demand (`paths:` or via commands):** `post-change-lint` (**обязателен после правок кода**), `agent-team-intake`, `agent-team-orchestrator`, `code-review-mr`, architecture, imports, UI, tests, feature-delivery-workflow, reference-features, next-app-router, react-a11y-coding
|
|
18
|
+
- **On-demand (`paths:` or via commands):** `post-change-lint` (**обязателен после правок кода**), `agent-team-intake`, `agent-team-orchestrator`, `code-review-mr`, `security-next`, architecture, imports, UI, tests, feature-delivery-workflow, `design-guidance`, reference-features, next-app-router, react-a11y-coding, `technical-retro`, **preset-*** meta (paths on `packages/ai-rules/presets/**`)
|
|
9
19
|
- **Skills:** long workflows (`feature-delivery`, `code-review`, …)
|
|
10
20
|
|
|
11
21
|
### UI edit bundle (consolidated paths)
|
|
@@ -21,27 +31,71 @@
|
|
|
21
31
|
|
|
22
32
|
**Не грузятся на типичный UI edit:** `architecture/architecture-boundaries.md` (api/store/types/lib), `architecture/layer-barrel-exports.md` (только `index.ts`), `stack/navigation-router.md` (только `app/src/app/**`). Стили колокации — в `react-ui.md` (не отдельный stub).
|
|
23
33
|
|
|
24
|
-
##
|
|
34
|
+
## Cursor → Claude mapping
|
|
25
35
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
36
|
+
| Cursor `.mdc` (SoT) | Claude topic |
|
|
37
|
+
|---------------------|--------------|
|
|
38
|
+
| `next-app-core.mdc` | `stack/next-app-core.md` |
|
|
39
|
+
| `package-manager.mdc` | `tooling-and-review/package-manager.md` |
|
|
40
|
+
| `code-quality-and-refactoring.mdc` | `tooling-and-review/code-quality.md` |
|
|
41
|
+
| `design-guidance.mdc` | `tooling-and-review/design-guidance.md` |
|
|
42
|
+
| `next-app-router.mdc` | `stack/next-app-router.md` |
|
|
43
|
+
| `arrow-functions.mdc` | `stack/arrow-functions.md` |
|
|
44
|
+
| `types-jsdoc.mdc` | `stack/types-jsdoc.md` |
|
|
45
|
+
| `no-type-assertion-as-import-export.mdc` | `stack/no-type-assertion.md` |
|
|
46
|
+
| `navigation-router-stack.mdc` | `stack/navigation-router.md` |
|
|
47
|
+
| `navigation-router-ui.mdc` | `stack/navigation-router-ui.md` |
|
|
48
|
+
| `architecture-boundaries.mdc` | `architecture/architecture-boundaries.md` |
|
|
49
|
+
| `architecture-boundaries-ui.mdc` | `architecture/architecture-boundaries-ui.md` |
|
|
50
|
+
| `feature-delivery-workflow.mdc` | `architecture/feature-delivery-workflow.md` |
|
|
51
|
+
| `reference-features.mdc` | `architecture/reference-features.md` |
|
|
52
|
+
| `public-imports.mdc` | `architecture/public-imports.md` |
|
|
53
|
+
| `layer-barrel-exports.mdc` | `architecture/layer-barrel-exports.md` |
|
|
54
|
+
| `api-services.mdc` | `api-and-data/api-services.md` |
|
|
55
|
+
| `http-client.mdc` | `api-and-data/http-client.md` |
|
|
56
|
+
| `store-rtk.mdc` | `api-and-data/store-rtk.md` |
|
|
57
|
+
| `react-ui.mdc` | `ui-and-accessibility/react-ui.md` |
|
|
58
|
+
| `react-a11y-coding.mdc` | `ui-and-accessibility/react-a11y-coding.md` |
|
|
59
|
+
| `no-props-spread.mdc` | `ui-and-accessibility/no-props-spread.md` |
|
|
60
|
+
| `css-property-order-stylelint.mdc` | `ui-and-accessibility/css-property-order.md` |
|
|
61
|
+
| `tests-unit.mdc` | `testing/tests-unit.md` |
|
|
62
|
+
| `tests-e2e-structure.mdc` | `testing/tests-e2e-structure.md` |
|
|
63
|
+
| `playwright-agents.mdc` | `testing/playwright-agents.md` |
|
|
64
|
+
| `post-change-lint.mdc` | `tooling-and-review/post-change-lint.md` |
|
|
65
|
+
| `code-review-mr.mdc` | `tooling-and-review/code-review-mr.md` |
|
|
66
|
+
| `security-next.mdc` | `tooling-and-review/security-next.md` |
|
|
67
|
+
| `agent-team-intake.mdc` | `tooling-and-review/agent-team-intake.md` |
|
|
68
|
+
| `agent-team-orchestrator.mdc` | `tooling-and-review/agent-team-orchestrator.md` |
|
|
69
|
+
| `technical-retro.mdc` | `tooling-and-review/technical-retro.md` |
|
|
70
|
+
| `preset-layering.mdc` | `tooling-and-review/preset-layering.md` |
|
|
71
|
+
| `preset-twin-sync.mdc` | `tooling-and-review/preset-twin-sync.md` |
|
|
72
|
+
| `preset-token-budget.mdc` | `tooling-and-review/preset-token-budget.md` |
|
|
73
|
+
| `preset-pr-checklist.mdc` | `tooling-and-review/preset-pr-checklist.md` |
|
|
74
|
+
| `preset-no-cross-stack-leakage.mdc` | `tooling-and-review/preset-no-cross-stack-leakage.md` |
|
|
29
75
|
|
|
30
|
-
##
|
|
76
|
+
## Core → stack mapping
|
|
31
77
|
|
|
32
|
-
|
|
|
33
|
-
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `architecture/
|
|
39
|
-
| `architecture/
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
78
|
+
| Shared core | Cursor adapter | Notes |
|
|
79
|
+
|-------------|----------------|-------|
|
|
80
|
+
| `quality/code-quality-and-refactoring.md` | `code-quality-and-refactoring.mdc` / `code-quality.md` | + Stack notes (ESLint/CSS) |
|
|
81
|
+
| `quality/design-guidance.md` | `design-guidance.mdc` / `design-guidance.md` | requestable smells/GoF |
|
|
82
|
+
| `agent-team/agent-team-orchestrator.md` | `agent-team-orchestrator.mdc` | Roles in Stack notes |
|
|
83
|
+
| `agent-team/agent-team-intake.md` | `agent-team-intake.mdc` | thin alias |
|
|
84
|
+
| `architecture/feature-delivery-workflow.md` | `feature-delivery-workflow.mdc` | Next layer checklist in Stack notes |
|
|
85
|
+
| `architecture/reference-features.template.md` | `reference-features.mdc` | path table in Stack notes |
|
|
86
|
+
| `review/code-review-mr.md` | `code-review-mr.mdc` | Next checklist refs |
|
|
87
|
+
| `review/technical-retro.md` | `technical-retro.mdc` | thin alias |
|
|
88
|
+
| `meta/preset-*.md` | `preset-*.mdc` | author globs only |
|
|
89
|
+
|
|
90
|
+
## Folders
|
|
91
|
+
|
|
92
|
+
| Папка | О чём |
|
|
93
|
+
|-------|--------|
|
|
94
|
+
| `stack/` | Next core, router, conventions |
|
|
95
|
+
| `architecture/` | Границы, feature-delivery, reference-features, imports |
|
|
96
|
+
| `api-and-data/` | HTTP, services, store |
|
|
97
|
+
| `testing/` | Unit, e2e, Playwright |
|
|
98
|
+
| `ui-and-accessibility/` | React UI, a11y, props |
|
|
99
|
+
| `tooling-and-review/` | Quality, review, lint, agent-team, retro, **preset meta** |
|
|
46
100
|
|
|
47
101
|
**Коллизии:** импорт типов и API — **`architecture/public-imports.md`**.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
paths:
|
|
3
3
|
- app/src/api/services/**/*.ts
|
|
4
|
+
impact: HIGH
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Роль API слоя
|
|
@@ -55,3 +56,24 @@ paths:
|
|
|
55
56
|
- компоненты не должны зависеть от DTO;
|
|
56
57
|
- store не должен сам собирать URL/коды эндпоинтов и не обходить сервисы; **транспортный тип ответа** и **контракт ошибки** из `@/types` (как у прикладного клиента) допустимы во thunk при разборе `catch`/payload, если так выстроен сервис (см. `api-and-data/store-rtk.md`, `api-and-data/http-client.md`).
|
|
57
58
|
- При использовании API‑сервисов в UI, store и утилитах **вне** `app/src/api/**` импортировать **только** из `@/api` (корневой barrel), см. **`architecture/public-imports.md`**; внутри слоя API — по относительным путям или `@/api/services/**` / `@/api/clients/**`, не дублируя публичный контракт мимо корневого barrel для внешних потребителей.
|
|
59
|
+
## Incorrect
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
// Returning raw DTO to store/UI without mapping
|
|
63
|
+
export const getCard = async (id: string) => {
|
|
64
|
+
const { data } = await cardsClient.get(`/cards/${id}`)
|
|
65
|
+
return data // backend DTO leaked upward
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Correct
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
import type { TCard } from '@/types'
|
|
73
|
+
import { mapCardResponse } from './cardResponseMappers'
|
|
74
|
+
|
|
75
|
+
export const getCard = async (id: string): Promise<TCard> => {
|
|
76
|
+
const { data } = await cardsClient.get(`/cards/${id}`)
|
|
77
|
+
return mapCardResponse(data)
|
|
78
|
+
}
|
|
79
|
+
```
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
paths:
|
|
3
3
|
- app/src/lib/clients/**/*.ts
|
|
4
4
|
- app/src/api/clients/**/*.ts
|
|
5
|
+
impact: HIGH
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# HTTP-транспорт
|
|
@@ -38,3 +39,23 @@ paths:
|
|
|
38
39
|
|
|
39
40
|
- Меняя реализацию общего клиента — **обновить или добавить behavior‑тесты** рядом с модулем клиента (`testing/tests-unit.md`).
|
|
40
41
|
- Не вводить **второй полноценный HTTP‑стек** без явной задачи и согласования с архитектурой репозитория.
|
|
42
|
+
## Incorrect
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
// Inside api/services — ad-hoc fetch bypasses shared client
|
|
46
|
+
export const getSettings = async () => {
|
|
47
|
+
const res = await fetch('/api/settings')
|
|
48
|
+
return res.json()
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Correct
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { appHttpClient } from '@/api/clients/appHttpClient'
|
|
56
|
+
|
|
57
|
+
export const getSettings = async () => {
|
|
58
|
+
const { data } = await appHttpClient.get('/settings')
|
|
59
|
+
return mapSettingsResponse(data)
|
|
60
|
+
}
|
|
61
|
+
```
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
paths:
|
|
3
3
|
- app/src/store/**/*.ts
|
|
4
|
+
impact: HIGH
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Общие принципы
|
|
@@ -63,3 +64,22 @@ paths:
|
|
|
63
64
|
- Строго типизировать state и actions.
|
|
64
65
|
- Использовать **единый стиль именования actions и селекторов**, как в существующих слайсах.
|
|
65
66
|
- При работе с ошибками и ответами HTTP опираться на **`api-and-data/http-client.md`** и контракты из `@/types`, а не на типы внешних HTTP‑библиотек вне зависимостей проекта.
|
|
67
|
+
## Incorrect
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
export const loadProfile = createAsyncThunk('profile/load', async () => {
|
|
71
|
+
const res = await fetch('/api/profile')
|
|
72
|
+
return res.json() // raw DTO into slice
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Correct
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { profileApi } from '@/api'
|
|
80
|
+
|
|
81
|
+
export const loadProfile = createAsyncThunk('profile/load', async () => {
|
|
82
|
+
// service returns domain model already mapped
|
|
83
|
+
return profileApi.getProfile()
|
|
84
|
+
})
|
|
85
|
+
```
|
|
@@ -4,6 +4,7 @@ paths:
|
|
|
4
4
|
- app/src/store/**/*
|
|
5
5
|
- app/src/types/**/*
|
|
6
6
|
- app/src/lib/**/*
|
|
7
|
+
impact: CRITICAL
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
# Границы между слоями
|
|
@@ -73,3 +74,30 @@ paths:
|
|
|
73
74
|
- Разместить файлы в **соответствующих слоях**.
|
|
74
75
|
- Проверить существующие фичи с аналогичной структурой и **повторить их организацию**.
|
|
75
76
|
- Не "коротить" слои (например, не вызывать API прямо из компонента только ради упрощения).
|
|
77
|
+
## Incorrect
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
// UI calling HTTP client / deep service path directly
|
|
81
|
+
import { httpClient } from '@/lib/clients/HttpClient'
|
|
82
|
+
import { fetchOrders } from '@/api/services/OrdersApi/orders.service'
|
|
83
|
+
|
|
84
|
+
export const OrdersPage = () => {
|
|
85
|
+
// bypasses store and @/api barrel
|
|
86
|
+
void httpClient.get('/orders')
|
|
87
|
+
return null
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Correct
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
import { useAppDispatch } from '@/store'
|
|
95
|
+
import { loadOrders } from '@/store/slices/Orders'
|
|
96
|
+
|
|
97
|
+
export const OrdersPage = () => {
|
|
98
|
+
const dispatch = useAppDispatch()
|
|
99
|
+
// UI → store → services from @/api (inside thunk)
|
|
100
|
+
void dispatch(loadOrders())
|
|
101
|
+
return null
|
|
102
|
+
}
|
|
103
|
+
```
|
|
@@ -6,6 +6,9 @@ paths:
|
|
|
6
6
|
- app/src/types/**/*
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
<!-- shared-core: architecture/feature-delivery-workflow.md -->
|
|
10
|
+
|
|
11
|
+
|
|
9
12
|
# Доставка фичи (сквозной порядок)
|
|
10
13
|
|
|
11
14
|
Типичная фича с данными с backend и общим состоянием. Детали слоёв — `architecture/architecture-boundaries.md`, `stack/next-app-core.md`.
|
|
@@ -64,6 +67,8 @@ flowchart LR
|
|
|
64
67
|
- HTTP-клиент из компонента/thunk в обход сервиса.
|
|
65
68
|
- Deep-import `@/api/services/**` из UI/store.
|
|
66
69
|
- `{...props}` — `ui-and-accessibility/no-props-spread.md`.
|
|
70
|
+
- **Ubiquitous language:** имена Domain/типов отражают предметную область фичи — не смешивать транспорт/фреймворк-термины в домен без нужды.
|
|
71
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
67
72
|
|
|
68
73
|
## Матрица: зона → правила
|
|
69
74
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
paths:
|
|
3
3
|
- app/src/**/index.ts
|
|
4
|
+
impact: MEDIUM
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Barrel-экспорты слоёв с public API
|
|
@@ -56,3 +57,17 @@ paths:
|
|
|
56
57
|
| Core | `app/src/core/index.ts` | ESLint: `@/core/index` |
|
|
57
58
|
|
|
58
59
|
Иллюстрация двух уровней (API): локальный `services/.../<Feature>/index.ts` → фасад `*ApiService.ts` → `app/src/api/index.ts`.
|
|
60
|
+
## Incorrect
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
// app/src/api/index.ts — leaking internals
|
|
64
|
+
export { mapCardResponse } from './services/CardsApi/cardResponseMappers'
|
|
65
|
+
export { rawCardsClient } from './clients/rawCardsClient'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Correct
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
// app/src/api/index.ts — public facade only
|
|
72
|
+
export { cardsApi } from './services/CardsApi'
|
|
73
|
+
```
|
|
@@ -5,6 +5,7 @@ paths:
|
|
|
5
5
|
- app/src/lib/**/*
|
|
6
6
|
- app/src/types/**/*
|
|
7
7
|
- app/src/api/**/*
|
|
8
|
+
impact: HIGH
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
# Публичные импорты (`@/types`, `@/api`)
|
|
@@ -44,3 +45,16 @@ import { MedcardApiService } from '@/api/services/MedcardApiService/MedcardApiSe
|
|
|
44
45
|
```
|
|
45
46
|
|
|
46
47
|
Новые публичные символы API — реэкспорт в `app/src/api/index.ts` по **`architecture/layer-barrel-exports.md`**.
|
|
48
|
+
## Incorrect
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
import type { TUserProfile } from '@/types/User.types'
|
|
52
|
+
import { OrdersApi } from '@/api/services/OrdersApi'
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Correct
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import type { TUserProfile } from '@/types'
|
|
59
|
+
import { ordersApi } from '@/api'
|
|
60
|
+
```
|
|
@@ -6,10 +6,15 @@ paths:
|
|
|
6
6
|
- app/src/types/**/*
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
<!-- shared-core: architecture/reference-features.template.md -->
|
|
10
|
+
|
|
11
|
+
|
|
9
12
|
# Эталонные фичи (reference features)
|
|
10
13
|
|
|
11
14
|
Перед реализацией найди фичу того же типа и **повтори её структуру**, не изобретая новую организацию файлов.
|
|
12
15
|
|
|
16
|
+
Taxonomy / shared core: [`presets/_shared/README.md`](../../../../_shared/README.md) · [Preset contribution guide](../../../../docs/PRESET-CONTRIBUTION.md).
|
|
17
|
+
|
|
13
18
|
## Таблица эталонов
|
|
14
19
|
|
|
15
20
|
Замени **TBD** на реальные пути после договорённости в команде (или при `ai-rules init` в целевом репо):
|
|
@@ -30,6 +35,10 @@ paths:
|
|
|
30
35
|
3. Зеркаль именование, порядок файлов, паттерны импортов и тестов.
|
|
31
36
|
4. Если эталона нет — выбери **самую близкую** существующую фичу того же слоя и зафиксируй выбор в handoff.
|
|
32
37
|
|
|
38
|
+
## Living conventions
|
|
39
|
+
|
|
40
|
+
Post-init gotchas / patterns / decisions: **`.claude/team/conventions.md`** (and the twin tool path if both Cursor and Claude are installed). Consumer-owned; not always-on. See root `AGENTS.md` § Living conventions.
|
|
41
|
+
|
|
33
42
|
## Связанные правила
|
|
34
43
|
|
|
35
44
|
- `tooling-and-review/code-quality.md` — повторять паттерны, не deep-import.
|