@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
|
@@ -3,12 +3,14 @@ description: Use when user posts a work request without /task — suggest or use
|
|
|
3
3
|
alwaysApply: false
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
<!-- shared-core: agent-team/agent-team-intake.md -->
|
|
7
|
+
|
|
6
8
|
# Agent team intake
|
|
7
9
|
|
|
8
10
|
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:
|
|
9
11
|
|
|
10
12
|
1. Prefer **`/task <their request>`** or invoke **task-router** first.
|
|
11
13
|
2. Do not jump straight to coding without router + pipeline when scope is non-trivial.
|
|
12
|
-
3. Pure questions («как работает X», «объясни») —
|
|
14
|
+
3. Pure questions («как работает X», «объясни») — prefer agent **`codebase-analyzer`** (explain-as-is); trivial one-liners may be answered inline. Do not open `/task`.
|
|
13
15
|
|
|
14
16
|
Exceptions: user explicitly says «без pipeline», «просто сделай», or continues an active slug.
|
|
@@ -3,6 +3,8 @@ description: Orchestrates the agent team via task-router and pipeline.json. Use
|
|
|
3
3
|
alwaysApply: false
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
<!-- shared-core: agent-team/agent-team-orchestrator.md -->
|
|
7
|
+
|
|
6
8
|
# Agent team orchestrator
|
|
7
9
|
|
|
8
10
|
Parent agent = **manager**. Router plans; specialists execute. Artifacts: `.cursor/team/tasks/<slug>/`.
|
|
@@ -19,7 +21,9 @@ Work request без `/task` — см. **`agent-team-intake.mdc`** (когда п
|
|
|
19
21
|
| `/feature-continue <slug>` | Alias of task-continue |
|
|
20
22
|
| `/technical-retro [slug]` | Retro with agent team block |
|
|
21
23
|
|
|
22
|
-
##
|
|
24
|
+
## Stack notes
|
|
25
|
+
|
|
26
|
+
### Roles
|
|
23
27
|
|
|
24
28
|
| Agent | App / prod writes | Typical intent |
|
|
25
29
|
|-------|-------------------|----------------|
|
|
@@ -31,7 +35,7 @@ Work request без `/task` — см. **`agent-team-intake.mdc`** (когда п
|
|
|
31
35
|
| `debugger` | minimal fix | bugfix |
|
|
32
36
|
| `ci-investigator` | minimal CI fix | ci-fix — minimal CI repair |
|
|
33
37
|
| `feature-developer` | yes | feature, bugfix, refactor, migration, a11y |
|
|
34
|
-
| `build-verifier` | no (team only) | lint/type-check/unit gate after developer |
|
|
38
|
+
| `build-verifier` | no (team only) | lint/type-check/unit gate after developer; preset-structure when editing presets |
|
|
35
39
|
| `accessibility-reviewer` | no (team only) | a11y, UI-heavy feature |
|
|
36
40
|
| `performance-auditor` | no (team only) | perf-audit, perf-sensitive feature |
|
|
37
41
|
| `code-reviewer` | no (team only) | most pipelines, review-only |
|
|
@@ -49,6 +53,8 @@ Work request без `/task` — см. **`agent-team-intake.mdc`** (когда п
|
|
|
49
53
|
|
|
50
54
|
Full prompts: `.cursor/agents/*.md`. Artifact conventions: `.cursor/team/README.md`.
|
|
51
55
|
|
|
56
|
+
When editing `packages/ai-rules/presets/**`, follow **`preset-pr-checklist.mdc`** (+ twin-sync / layering / token-budget / leakage meta-rules).
|
|
57
|
+
|
|
52
58
|
## Dynamic pipeline
|
|
53
59
|
|
|
54
60
|
```mermaid
|
|
@@ -145,7 +151,7 @@ If `pipeline.json` is missing (old `/feature-start` tasks), fall back to fixed p
|
|
|
145
151
|
|
|
146
152
|
Do **not** run `/task` + router for:
|
|
147
153
|
|
|
148
|
-
- Pure questions («как работает X», «объясни»).
|
|
154
|
+
- Pure questions («как работает X», «объясни») — prefer agent **`codebase-analyzer`** for deep traces; inline OK for trivial one-liners.
|
|
149
155
|
- Typo / one-file fix / trivial config with no architecture risk.
|
|
150
156
|
- User explicitly says «без pipeline», «просто сделай», or continues an active slug.
|
|
151
157
|
- Single-line `docs-only` with no code impact.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
description: Конвенции API сервисов и мапперов
|
|
3
3
|
globs: app/src/api/services/**/*.ts
|
|
4
4
|
alwaysApply: false
|
|
5
|
+
impact: HIGH
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Роль API слоя
|
|
@@ -55,4 +56,24 @@ alwaysApply: false
|
|
|
55
56
|
- компоненты не должны зависеть от DTO;
|
|
56
57
|
- store не должен сам собирать URL/коды эндпоинтов и не обходить сервисы; **транспортный тип ответа** и **контракт ошибки** из `@/types` (как у прикладного клиента) допустимы во thunk при разборе `catch`/payload, если так выстроен сервис (см. `store-rtk.mdc`, `http-client.mdc`).
|
|
57
58
|
- При использовании API‑сервисов в UI, store и утилитах **вне** `app/src/api/**` импортировать **только** из `@/api` (корневой barrel), см. **`public-imports.mdc`**; внутри слоя API — по относительным путям или `@/api/services/**` / `@/api/clients/**`, не дублируя публичный контракт мимо корневого barrel для внешних потребителей.
|
|
59
|
+
## Incorrect
|
|
58
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
|
description: Архитектурные границы и правила импортов
|
|
3
3
|
globs: app/src/api/**/*,app/src/store/**/*,app/src/types/**/*,app/src/lib/**/*
|
|
4
4
|
alwaysApply: false
|
|
5
|
+
impact: CRITICAL
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Границы между слоями
|
|
@@ -63,4 +64,30 @@ alwaysApply: false
|
|
|
63
64
|
- Разместить файлы в **соответствующих слоях**.
|
|
64
65
|
- Проверить существующие фичи с аналогичной структурой и **повторить их организацию**.
|
|
65
66
|
- Не "коротить" слои (например, не вызывать API прямо из компонента только ради упрощения).
|
|
67
|
+
## Incorrect
|
|
66
68
|
|
|
69
|
+
```ts
|
|
70
|
+
// UI calling HTTP client / deep service path directly
|
|
71
|
+
import { httpClient } from '@/lib/clients/HttpClient'
|
|
72
|
+
import { fetchOrders } from '@/api/services/OrdersApi/orders.service'
|
|
73
|
+
|
|
74
|
+
export const OrdersPage = () => {
|
|
75
|
+
// bypasses store and @/api barrel
|
|
76
|
+
void httpClient.get('/orders')
|
|
77
|
+
return null
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Correct
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
import { useAppDispatch } from '@/store'
|
|
85
|
+
import { loadOrders } from '@/store/slices/Orders'
|
|
86
|
+
|
|
87
|
+
export const OrdersPage = () => {
|
|
88
|
+
const dispatch = useAppDispatch()
|
|
89
|
+
// UI → store → services from @/api (inside thunk)
|
|
90
|
+
void dispatch(loadOrders())
|
|
91
|
+
return null
|
|
92
|
+
}
|
|
93
|
+
```
|
|
@@ -2,45 +2,30 @@
|
|
|
2
2
|
description: Предпочитать стрелочные функции при написании кода
|
|
3
3
|
globs: app/src/**/*.{ts,tsx,js,jsx}
|
|
4
4
|
alwaysApply: false
|
|
5
|
+
impact: LOW
|
|
5
6
|
---
|
|
6
|
-
|
|
7
7
|
# Стрелочные функции
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## Что делать
|
|
9
|
+
Предпочитать стрелочный синтаксис для нового кода в `app/src/**`, где это допустимо в TypeScript/JavaScript.
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
- Колбэки и обработчики — стрелочные функции: `.map((x) => ...)`, `onClick={() => ...}`.
|
|
15
|
-
- React-компоненты и хуки — как стрелочные функции с явной типизацией пропсов/возврата по принятому в проекте стилю.
|
|
11
|
+
**Style enforcement:** детальные pref — в ESLint (`app/eslint.config.mjs`) и Stylelint; после правок — **`post-change-lint`**. Это правило — краткий intent, не дублировать линтер.
|
|
16
12
|
|
|
17
|
-
## Исключения
|
|
13
|
+
## Исключения
|
|
18
14
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
15
|
+
- Генераторы (`function*`)
|
|
16
|
+
- Методы класса, где нужен `this` прототипа
|
|
17
|
+
- Редкие случаи hoisting / именованного `function` в стеке
|
|
22
18
|
|
|
23
|
-
##
|
|
19
|
+
## Incorrect
|
|
24
20
|
|
|
25
|
-
```
|
|
26
|
-
// ❌ Избегать для нового кода
|
|
21
|
+
```ts
|
|
27
22
|
function formatLabel(id: string): string {
|
|
28
23
|
return id.toUpperCase()
|
|
29
24
|
}
|
|
30
|
-
|
|
31
|
-
// ✅ Предпочтительно
|
|
32
|
-
const formatLabel = (id: string): string => {
|
|
33
|
-
return id.toUpperCase()
|
|
34
|
-
}
|
|
35
25
|
```
|
|
36
26
|
|
|
37
|
-
|
|
38
|
-
// ✅ Предпочтительно
|
|
39
|
-
const UserCard = ({ name }: { name: string }) => {
|
|
40
|
-
return <span>{name}</span>
|
|
41
|
-
}
|
|
42
|
-
```
|
|
27
|
+
## Correct
|
|
43
28
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
29
|
+
```ts
|
|
30
|
+
const formatLabel = (id: string): string => id.toUpperCase()
|
|
31
|
+
```
|
|
@@ -3,15 +3,37 @@ description: Поддержка и улучшение качества кода
|
|
|
3
3
|
alwaysApply: true
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
<!-- shared-core: quality/code-quality-and-refactoring.md -->
|
|
7
|
+
|
|
6
8
|
# Поддержка существующего стиля
|
|
7
9
|
|
|
8
10
|
- Новые изменения должны:
|
|
9
|
-
- следовать существующим паттернам (имена, структура, типизация);
|
|
10
|
-
- минимизировать
|
|
11
|
+
- следовать существующим паттернам (имена, структура, типизация / DI / error handling стека);
|
|
12
|
+
- минимизировать «стилистический шум» (лишние правки форматирования, rename без нужды).
|
|
11
13
|
- Перед добавлением нового решения:
|
|
12
|
-
- искать аналогичное в коде и **повторять подход**, а не изобретать
|
|
13
|
-
- проверять, нет ли уже подходящего компонента или паттерна в
|
|
14
|
-
- использовать при обращении к чужим модулям только их **public API** (
|
|
14
|
+
- искать аналогичное в коде и **повторять подход**, а не изобретать новый;
|
|
15
|
+
- проверять, нет ли уже подходящего компонента или паттерна в дизайн‑системе / UI‑пакетах проекта, прежде чем добавлять новый кастомный контрол;
|
|
16
|
+
- использовать при обращении к чужим модулям только их **public API** (barrel / протоколы / facades), а deep‑импорты внутренних файлов рассматривать как повод для рефакторинга.
|
|
17
|
+
|
|
18
|
+
# Принципы
|
|
19
|
+
|
|
20
|
+
- **KISS:** выбирать самое простое изменение, которое совпадает с паттернами репозитория; не изобретать новый стиль «с нуля».
|
|
21
|
+
- **DRY + Rule of Three:** устранять дублирование логики; выносить общее **только после 3-го** повторения — ошибочная абстракция дороже дублирования.
|
|
22
|
+
- **YAGNI:** не добавлять API, флаги, слои и обобщения «на будущее» без текущего требования.
|
|
23
|
+
- **SOLID** (agent-actionable, не эссе):
|
|
24
|
+
- **S** — один модуль / один повод менять; дробить god-файлы в рамках лёгкого refactor.
|
|
25
|
+
- **O** — расширять через композицию/новые реализации, не раздувая существующие ветки «на всякий случай».
|
|
26
|
+
- **L** — подтип не ломает контракт базового типа/протокола.
|
|
27
|
+
- **I** — узкие порты/интерфейсы; не заставлять клиента зависеть от неиспользуемого.
|
|
28
|
+
- **D** — зависеть от абстракций (порты); детали — в адаптерах стека (не дублировать stack boundaries).
|
|
29
|
+
- **CUPID** (компактный блок, Milanov):
|
|
30
|
+
- **Composable** — маленькие части стыкуются без скрытого глобального состояния.
|
|
31
|
+
- **Unix philosophy** — одна чёткая ответственность на единицу; пайплайн простых шагов.
|
|
32
|
+
- **Predictable** — одинаковый вход → одинаковый выход; минимум сюрпризов для вызывающего.
|
|
33
|
+
- **Idiomatic** — следовать идиомам языка и **существующим** конвенциям репо.
|
|
34
|
+
- **Domain-based** — имена и границы отражают предметную область фичи (не транспорт/фреймворк).
|
|
35
|
+
- **Composition over inheritance:** предпочитать композицию / делегирование наследованию иерархий.
|
|
36
|
+
- **Law of Demeter (hint):** не строить цепочки `a.b.c.d`; ходить через public API / facade модуля.
|
|
15
37
|
|
|
16
38
|
# Рефакторинг при изменениях
|
|
17
39
|
|
|
@@ -19,27 +41,42 @@ alwaysApply: true
|
|
|
19
41
|
- уменьшает дублирование;
|
|
20
42
|
- повышает читаемость;
|
|
21
43
|
- не ломает публичные контракты модулей.
|
|
22
|
-
- Примеры допустимых
|
|
23
|
-
- вынести дублирующуюся логику в
|
|
24
|
-
-
|
|
25
|
-
- разделить слишком крупный
|
|
26
|
-
- заменить локальные «магические»
|
|
44
|
+
- Примеры допустимых улучшений (абстрактно):
|
|
45
|
+
- вынести дублирующуюся логику в общую утилиту / хук / mapper / use case;
|
|
46
|
+
- сузить небезопасные типы и unsafe-операции стека;
|
|
47
|
+
- разделить слишком крупный модуль на несколько более простых;
|
|
48
|
+
- заменить локальные «магические» значения на токены/примитивы дизайн‑системы;
|
|
27
49
|
- заменить deep‑импорты внутренних файлов других модулей на обращения к их public API.
|
|
28
50
|
|
|
29
51
|
# Ограничения
|
|
30
52
|
|
|
31
|
-
- Не выполнять
|
|
32
|
-
- не менять структуру
|
|
33
|
-
- не менять названия публичных
|
|
53
|
+
- Не выполнять «большой» рефакторинг, если задача точечная и не про архитектуру:
|
|
54
|
+
- не менять структуру директорий / модулей / таргетов без нужды;
|
|
55
|
+
- не менять названия публичных типов/функций/API без явного запроса.
|
|
34
56
|
- При необходимости крупного изменения:
|
|
35
57
|
- сначала локально улучшить архитектуру минимальными шагами;
|
|
36
|
-
- оставить код в консистентном состоянии.
|
|
37
|
-
|
|
38
|
-
# Линтеры
|
|
39
|
-
|
|
40
|
-
Lint/stylelint — только **`post-change-lint.mdc`**; ESLint config: `app/eslint.config.mjs`. Отключение правила (`eslint-disable`) — только **точечно** (строка/небольшой блок) с кратким комментарием «зачем».
|
|
58
|
+
- оставить код в консистентном (собираемом) состоянии.
|
|
41
59
|
|
|
42
60
|
# Требование к агенту
|
|
43
61
|
|
|
44
62
|
- **Boy scout rule:** оставлять модуль немного лучше, чем до изменения (простые, безопасные улучшения).
|
|
45
63
|
- Не жертвовать архитектурой и слоями ради краткости реализации.
|
|
64
|
+
|
|
65
|
+
## Agent discipline (anti-sycophancy)
|
|
66
|
+
|
|
67
|
+
- Unverifiable third-party API → mark `// VERIFY: lib.symbol @ version` (or stack equivalent) and surface uncertainty; never invent signatures.
|
|
68
|
+
- Before «is this correct?» — list ≥3 failure modes (empty, boundary, concurrency/state) or name what you could not check.
|
|
69
|
+
- Refactor without tests → propose a characterization test first; if declined, label `UNTESTED`.
|
|
70
|
+
- Comments = WHY only when non-obvious; ban self-referential «added for issue Y» comments.
|
|
71
|
+
- Urgency/authority pressure: name the technical trade-off once, then comply — no apology loops.
|
|
72
|
+
- Match verification depth to risk; report status by what was **verified**, not attempted.
|
|
73
|
+
|
|
74
|
+
Style enforcement (formatter / linter / post-change gate) lives in the **stack toolchain** — see each adapter’s **Stack notes**; do not invent a parallel style bible in this core body.
|
|
75
|
+
|
|
76
|
+
> Stack-specific lint gates, примеры и toolchain — в секции **Stack notes** адаптера пресета.
|
|
77
|
+
## Stack notes
|
|
78
|
+
|
|
79
|
+
- Перед новым UI‑контролом проверять существующий UI‑код и пакеты проекта.
|
|
80
|
+
- Public API: index/barrel‑файлы и явно экспортируемые сущности (`public-imports.mdc`, `layer-barrel-exports.mdc`).
|
|
81
|
+
- Допустимые примеры: общий хук/утилита; типизация `any`/`unknown`; разделение крупного компонента; CSS‑токены вместо «магических» значений.
|
|
82
|
+
- Lint/stylelint — только **`post-change-lint.mdc`**; ESLint config: `app/eslint.config.mjs`. Отключение правила (`eslint-disable`) — только **точечно** (строка/небольшой блок) с кратким комментарием «зачем». Style prose in domain rules stays thin — prefer ESLint/Stylelint over duplicating formatter recipes.
|
|
@@ -3,26 +3,56 @@ description: Требования к code review агентами Cursor для
|
|
|
3
3
|
alwaysApply: false
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
<!-- shared-core: review/code-review-mr.md -->
|
|
7
|
+
|
|
6
8
|
# Code review merge requests
|
|
7
9
|
|
|
8
10
|
On-demand rule for review flows. **Procedure and output format:** skill `code-review`.
|
|
9
11
|
|
|
10
|
-
## Checklist references
|
|
11
|
-
|
|
12
|
-
- Architecture layers: `architecture-boundaries.mdc`, `next-app-core.mdc`; network: `http-client.mdc`
|
|
13
|
-
- Imports: `public-imports.mdc`, `layer-barrel-exports.mdc`
|
|
14
|
-
- UI: `react-ui.mdc`
|
|
15
|
-
- Tests: `tests-unit.mdc`, `playwright-agents.mdc`, `tests-e2e-structure.mdc`
|
|
16
|
-
- Lint gate before final report: `post-change-lint.mdc`
|
|
17
|
-
|
|
18
12
|
## When to load
|
|
19
13
|
|
|
20
14
|
- User asks for review/MR/diff
|
|
21
15
|
- Pipeline step `code-reviewer`
|
|
22
|
-
-
|
|
16
|
+
- Platform automated review (e.g. BUGBOT) when present
|
|
17
|
+
|
|
18
|
+
## Checklist references (abstract)
|
|
19
|
+
|
|
20
|
+
- Architecture layers and stack core rules
|
|
21
|
+
- Public imports / module boundaries
|
|
22
|
+
- UI conventions of the stack
|
|
23
|
+
- Unit and e2e/UI test conventions
|
|
24
|
+
- Post-change lint/build gate before final report
|
|
25
|
+
- Design smells **in MR diff scope** — load `design-guidance`; не разворачивать полный каталог Fowler вне диффа
|
|
26
|
+
- Pattern name (GoF) — только если репозиторий уже использует эту форму или match минимален
|
|
27
|
+
- Principles (KISS / DRY+Ro3 / YAGNI / SOLID / CUPID) — через always-on `code-quality-and-refactoring`, не дублировать эссе в review
|
|
28
|
+
|
|
29
|
+
Concrete rule stems — in **Stack notes**.
|
|
23
30
|
|
|
24
31
|
## Constraints
|
|
25
32
|
|
|
26
33
|
- Focus on MR diff, not the whole repo.
|
|
27
34
|
- Use local `git diff` — do not invent hosting metadata.
|
|
28
35
|
- Boy scout rule: suggest fixes feasible within the MR scope.
|
|
36
|
+
- No «большие рефакторинги» without an explicit request (`code-quality-and-refactoring`).
|
|
37
|
+
|
|
38
|
+
## Output contract
|
|
39
|
+
|
|
40
|
+
Procedure details live in skill `code-review`. Required shape:
|
|
41
|
+
|
|
42
|
+
- Each finding cites **`path:line`**, the problem, impact, and a concrete fix direction.
|
|
43
|
+
- Rank by severity: **`blocker` | `important` | `nit`** (list blocker → nit).
|
|
44
|
+
- Vague («looks risky») is not a finding — cite evidence or ask for surrounding file context.
|
|
45
|
+
- End with a verdict on its own line: **`Safe to merge | needs changes | reject`**.
|
|
46
|
+
|
|
47
|
+
## Stack notes
|
|
48
|
+
|
|
49
|
+
On-demand rule for review flows. **Procedure and output format:** skill `code-review`.
|
|
50
|
+
|
|
51
|
+
### Checklist references
|
|
52
|
+
|
|
53
|
+
- Architecture layers: `architecture-boundaries.mdc`, `next-app-core.mdc`; network: `http-client.mdc`
|
|
54
|
+
- Imports: `public-imports.mdc`, `layer-barrel-exports.mdc`
|
|
55
|
+
- UI: `react-ui.mdc`
|
|
56
|
+
- Security: `security-next.mdc`
|
|
57
|
+
- Tests: `tests-unit.mdc`, `playwright-agents.mdc`, `tests-e2e-structure.mdc`
|
|
58
|
+
- Lint gate before final report: `post-change-lint.mdc`
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Design smells (Fowler) and curated GoF patterns for agents. Load when assessing structure, smells, or pattern fit.
|
|
3
|
+
globs:
|
|
4
|
+
- app/src/**/*.{ts,tsx}
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- shared-core: quality/design-guidance.md -->
|
|
9
|
+
|
|
10
|
+
# Design guidance (smells & patterns)
|
|
11
|
+
|
|
12
|
+
Словарь **code smells** (Fowler) и **design patterns** (GoF) для агентов при implement / review / debug.
|
|
13
|
+
|
|
14
|
+
Применять только в scope задачи или MR. Лёгкий refactor — да; «большой» rewrite без явного запроса — нет.
|
|
15
|
+
|
|
16
|
+
Называть паттерн **только если** репозиторий уже так делает или это минимальный match. Иначе — extract/split/move без ярлыка GoF.
|
|
17
|
+
|
|
18
|
+
Не заменяет always-on Principles в `code-quality-and-refactoring` (KISS, DRY + Rule of Three, YAGNI, SOLID, CUPID, composition, Demeter).
|
|
19
|
+
|
|
20
|
+
## When to load
|
|
21
|
+
|
|
22
|
+
- **Feature delivery / implement** — оценка структуры модулей, границ и дублирования.
|
|
23
|
+
- **Code review** — smells и pattern fit **в диффе MR**, не по всему репо.
|
|
24
|
+
- **Debug** — root-cause похож на wrong abstraction, Feature Envy, Message Chains, Shotgun Surgery.
|
|
25
|
+
- **Light refactor only** — улучшения в рамках boy-scout / MR scope; не расширять задачу ради каталога.
|
|
26
|
+
|
|
27
|
+
Агенты и skills подгружают stem по one-liner wiring — не копировать этот каталог в промпт агента.
|
|
28
|
+
|
|
29
|
+
## How to use (agent rules of thumb)
|
|
30
|
+
|
|
31
|
+
1. Сначала сверить с Principles (always-on): проще ли решение, нет ли ранней абстракции, соблюдён ли public API.
|
|
32
|
+
2. Затем отметить smells **в изменённых файлах** задачи/MR; предложить fix только если он укладывается в light refactor.
|
|
33
|
+
3. Паттерн GoF — опциональный ярлык после того, как структура уже ясна; не начинать дизайн с выбора паттерна.
|
|
34
|
+
4. Если smell и паттерн конфликтуют с границами слоёв стека — побеждают stack boundaries и existing repo patterns.
|
|
35
|
+
5. Не требовать переименования «под GoF», если поведение уже корректно и читаемо.
|
|
36
|
+
|
|
37
|
+
## Code smells (Fowler, curated ≤12)
|
|
38
|
+
|
|
39
|
+
Таблица: smell → detect hint → fix hint (одна линия каждый). Без механических меню рефакторинга.
|
|
40
|
+
|
|
41
|
+
| # | Smell | Detect | Fix hint |
|
|
42
|
+
|---|-------|--------|----------|
|
|
43
|
+
| 1 | Duplicate Code | одинаковая логика в ≥2 местах | dedupe после Rule of Three |
|
|
44
|
+
| 2 | Long Method / Long Module | единица делает слишком много | extract в рамках scope; без big rewrite |
|
|
45
|
+
| 3 | Feature Envy | метод чаще трогает чужие данные, чем свои | сдвинуть логику к данным / public API |
|
|
46
|
+
| 4 | Data Clumps | одни и те же группы аргументов кочуют вместе | сгруппировать в type / value object |
|
|
47
|
+
| 5 | Primitive Obsession | сырые string/int вместо доменных понятий | typed ids / value objects при нужде домена |
|
|
48
|
+
| 6 | Speculative Generality | неиспользуемые хуки, флаги, абстракции «на будущее» | удалить (YAGNI) |
|
|
49
|
+
| 7 | Message Chains | цепочки `a.b.c.d` | Demeter; facade / public API модуля |
|
|
50
|
+
| 8 | Middle Man | класс почти только прокидывает вызовы | убрать pass-through **или** оставить как boundary |
|
|
51
|
+
| 9 | Divergent Change | один модуль меняется по разным причинам | split по поводам изменения |
|
|
52
|
+
| 10 | Shotgun Surgery | одно смысловое изменение разъезжается по многим файлам | consolidate ответственность |
|
|
53
|
+
| 11 | Inappropriate Intimacy | доступ к чужим internals / private деталям | только public API / ports / facades |
|
|
54
|
+
| 12 | Refused Bequest / Parallel Inheritance | подтип игнорирует базу; зеркальные иерархии классов | composition; не плодить параллельные деревья |
|
|
55
|
+
|
|
56
|
+
**Skip Fowler (не в core):** Lazy Class, Incomplete Library Class, Comments-as-smell dogma, полный каталог 70+, пошаговые recipe-меню.
|
|
57
|
+
|
|
58
|
+
Приоритет при конфликте smells: Inappropriate Intimacy и Message Chains (границы модулей) > Duplicate Code (после Rule of Three) > Long Method внутри уже правильного модуля.
|
|
59
|
+
|
|
60
|
+
## Design patterns (GoF, curated ≤8)
|
|
61
|
+
|
|
62
|
+
Suggest only when repo already uses the shape or the match is minimal. Prefer extract-function over naming Strategy ради ярлыка.
|
|
63
|
+
|
|
64
|
+
Паттерны ниже — **разрешённый минимум** для агентов; остальной GoF по умолчанию в Skip.
|
|
65
|
+
|
|
66
|
+
| Pattern | When to suggest | Anti-trigger |
|
|
67
|
+
|---------|-----------------|--------------|
|
|
68
|
+
| Strategy | взаимозаменяемые алгоритмы уже (или явно скоро) выбираются политикой | один алгоритм без ветвления политики |
|
|
69
|
+
| Adapter | обернуть внешний / чужой API под локальный port | лишняя обёртка вокруг своего же API |
|
|
70
|
+
| Facade | упростить multi-step subsystem за public API | facade превращается в god-object |
|
|
71
|
+
| Factory Method | полиморфное создание уже принято в стиле репо | factory на каждый тривиальный `new` |
|
|
72
|
+
| Decorator | аддитивное поведение без взрыва subclass-иерархий | decorator «для слоёв» без реальной нужды |
|
|
73
|
+
| Observer | events / subscriptions уже есть в архитектуре | самодельный pub/sub без прецедента в репо |
|
|
74
|
+
| Template Method | общий algorithm skeleton + вариативные hooks | наследование ради пары отличающихся строк |
|
|
75
|
+
| Composite | дерево однородных узлов (UI/domain), как уже в репо | Composite на плоский список без иерархии |
|
|
76
|
+
|
|
77
|
+
Если сомневаешься между двумя паттернами — выбери более простой extract/compose без имени; ярлык можно добавить на review, если репо уже так говорит.
|
|
78
|
+
|
|
79
|
+
## Skip / avoid by default
|
|
80
|
+
|
|
81
|
+
| Catalog | Skip |
|
|
82
|
+
|---------|------|
|
|
83
|
+
| GoF | Singleton, Abstract Factory, Flyweight, Memento, Interpreter, Visitor, Bridge, Prototype |
|
|
84
|
+
| GoF (conditional) | Command, Chain of Responsibility, State — упоминать **только если** репо уже использует |
|
|
85
|
+
| Fowler | всё сверх 12 smells выше |
|
|
86
|
+
| DDD | Aggregates, bounded-context maps, event sourcing, CQRS — **не в core** |
|
|
87
|
+
| DDD (pointer) | ubiquitous language anti-pattern — расширять в `feature-delivery-workflow`, не здесь |
|
|
88
|
+
| GRASP | список Larman как отдельные правила — skip (перекрывается SOLID/CUPID) |
|
|
89
|
+
| Clean Code dogma | жёсткие caps на строки функции / «ровно один assert» — skip |
|
|
90
|
+
|
|
91
|
+
Не вводить второй stem (`refactoring-smells` / `design-patterns-for-agents`) — один каталог: `design-guidance`.
|
|
92
|
+
|
|
93
|
+
## Out of scope for this stem
|
|
94
|
+
|
|
95
|
+
- Полный GoF (23) и полный Fowler catalog.
|
|
96
|
+
- Stack-specific рецепты (пути модулей, lint-команды) — только в **Stack notes** адаптера.
|
|
97
|
+
- Security, a11y, perf — отдельные review-правила; здесь только структурные smells/patterns.
|
|
98
|
+
- Четвёртое always-on правило — запрещено; этот stem только requestable / agent-load.
|
|
99
|
+
|
|
100
|
+
## Cross-refs
|
|
101
|
+
|
|
102
|
+
- Always-on Principles: `code-quality-and-refactoring`.
|
|
103
|
+
- DIP / ports vs adapters: stack `architecture-boundaries` (детали стека — в Stack notes адаптеров).
|
|
104
|
+
- Ubiquitous language: `feature-delivery-workflow` (lineage).
|
|
105
|
+
- MR checklist (smells in scope; pattern name only if repo uses it): `code-review-mr`.
|
|
106
|
+
- Token / twin policy for authors: `preset-token-budget`, `preset-twin-sync` (meta, not consumer always-on).
|
|
107
|
+
|
|
108
|
+
## Stack notes
|
|
109
|
+
|
|
110
|
+
- Prefer hooks/mappers over HOC or new pattern names when the repo already extracts that way.
|
|
111
|
+
- Suggest Strategy/Adapter only when ports or policy branching already exist in `app/src/**`.
|
|
@@ -3,8 +3,12 @@ description: Сквозной чеклист новой фичи и матриц
|
|
|
3
3
|
alwaysApply: false
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
<!-- shared-core: architecture/feature-delivery-workflow.md -->
|
|
7
|
+
|
|
6
8
|
# Доставка фичи (сквозной порядок)
|
|
7
9
|
|
|
10
|
+
## Stack notes
|
|
11
|
+
|
|
8
12
|
Типичная фича с данными с backend и общим состоянием. Детали слоёв — `architecture-boundaries.mdc`, `next-app-core.mdc`.
|
|
9
13
|
|
|
10
14
|
## Чеклист (порядок работ)
|
|
@@ -61,6 +65,8 @@ flowchart LR
|
|
|
61
65
|
- HTTP-клиент из компонента/thunk в обход сервиса.
|
|
62
66
|
- Deep-import `@/api/services/**` из UI/store.
|
|
63
67
|
- `{...props}` в компоненты — `no-props-spread.mdc`.
|
|
68
|
+
- **Ubiquitous language:** имена Domain/типов отражают предметную область фичи — не смешивать транспорт/фреймворк-термины в домен без нужды.
|
|
69
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
64
70
|
|
|
65
71
|
## Матрица: зона → правила
|
|
66
72
|
|
|
@@ -4,6 +4,7 @@ globs:
|
|
|
4
4
|
- app/src/lib/clients/HttpClient/**/*.ts
|
|
5
5
|
- app/src/api/clients/**/*.ts
|
|
6
6
|
alwaysApply: false
|
|
7
|
+
impact: HIGH
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
# HTTP-транспорт
|
|
@@ -40,3 +41,23 @@ alwaysApply: false
|
|
|
40
41
|
|
|
41
42
|
- Меняя реализацию общего клиента — **обновить или добавить behavior‑тесты** рядом с модулем клиента (`tests-unit.mdc`).
|
|
42
43
|
- Не вводить **второй полноценный HTTP‑стек** без явной задачи и согласования с архитектурой репозитория.
|
|
44
|
+
## Incorrect
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
// Inside api/services — ad-hoc fetch bypasses shared client
|
|
48
|
+
export const getSettings = async () => {
|
|
49
|
+
const res = await fetch('/api/settings')
|
|
50
|
+
return res.json()
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Correct
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { appHttpClient } from '@/api/clients/appHttpClient'
|
|
58
|
+
|
|
59
|
+
export const getSettings = async () => {
|
|
60
|
+
const { data } = await appHttpClient.get('/settings')
|
|
61
|
+
return mapSettingsResponse(data)
|
|
62
|
+
}
|
|
63
|
+
```
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
description: Двухуровневые barrel-экспорты для слоёв с регламентированным public API
|
|
3
3
|
globs: app/src/**/index.ts
|
|
4
4
|
alwaysApply: false
|
|
5
|
+
impact: MEDIUM
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Barrel-экспорты слоёв с public API
|
|
@@ -57,3 +58,17 @@ alwaysApply: false
|
|
|
57
58
|
| Core | `app/src/core/index.ts` | ESLint: `@/core/index` |
|
|
58
59
|
|
|
59
60
|
Иллюстрация двух уровней (API): локальный `services/.../<Feature>/index.ts` → фасад `*ApiService.ts` → `app/src/api/index.ts`.
|
|
61
|
+
## Incorrect
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
// app/src/api/index.ts — leaking internals
|
|
65
|
+
export { mapCardResponse } from './services/CardsApi/cardResponseMappers'
|
|
66
|
+
export { rawCardsClient } from './clients/rawCardsClient'
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Correct
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
// app/src/api/index.ts — public facade only
|
|
73
|
+
export { cardsApi } from './services/CardsApi'
|
|
74
|
+
```
|
|
@@ -22,7 +22,7 @@ alwaysApply: false
|
|
|
22
22
|
|
|
23
23
|
## Маршруты и UX
|
|
24
24
|
|
|
25
|
-
- Для async routes
|
|
25
|
+
- Для async data routes **обязательны** sibling **`loading.tsx`** и **`error.tsx`** (и `not-found.tsx` где уместно) — по образцу соседних routes.
|
|
26
26
|
- **Suspense** — для медленных client/server секций; fallback согласован с дизайн-системой.
|
|
27
27
|
- Навигация — `navigation-router-stack.mdc` + router/link паттерны проекта.
|
|
28
28
|
|
|
@@ -31,6 +31,18 @@ alwaysApply: false
|
|
|
31
31
|
- RSC/route handlers **не импортируют UI-компоненты с client-only зависимостями** напрямую в server tree без `'use client'` границы.
|
|
32
32
|
- Доменные типы — `@/types`; вызовы backend — через `@/api` / services, не raw `fetch` из page.tsx без слоя API.
|
|
33
33
|
|
|
34
|
+
## Anti-hallucination (App Router)
|
|
35
|
+
|
|
36
|
+
Меньше угаданного кода лучше, чем больше. Сверяй API с версией Next в `package.json` и соседними routes.
|
|
37
|
+
|
|
38
|
+
| ❌ Avoid | ✅ Prefer |
|
|
39
|
+
|---------|----------|
|
|
40
|
+
| Sync `params` / `searchParams` / `cookies()` / `headers()` when the installed Next treats them as async | `await params` / `await cookies()` / patterns from existing pages |
|
|
41
|
+
| Invented `getSession()`-only server auth without project verify | Server session verify used by the repo (`security-next.mdc`) |
|
|
42
|
+
| Auth enforcement only in Edge middleware | Layout/page/Server Action checks + middleware refresh if present |
|
|
43
|
+
| New App Router APIs not in the installed Next major | Copy from a sibling route; mark `VERIFY` if unsure |
|
|
44
|
+
| Client `fetch` in `page.tsx` bypassing `@/api` | Services via `@/api` / established data loaders |
|
|
45
|
+
|
|
34
46
|
## Эталон
|
|
35
47
|
|
|
36
48
|
Смотри существующий route той же сложности в `app/src/app/**` и повтори структуру (`reference-features.mdc`).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring: Core → Stack → Platform layering. Use when editing packages/ai-rules/presets/**.
|
|
3
|
+
globs:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
alwaysApply: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-layering.md -->
|
|
11
|
+
|
|
12
|
+
# Preset layering
|
|
13
|
+
|
|
14
|
+
Правила для **авторов пресетов** (`packages/ai-rules/presets/**`). Не always-on в consumer apps.
|
|
15
|
+
|
|
16
|
+
## Слои
|
|
17
|
+
|
|
18
|
+
| Слой | Где | Что класть |
|
|
19
|
+
|------|-----|------------|
|
|
20
|
+
| **Core** | `presets/_shared/core/**` | Stack-agnostic prose + checklists; без frontmatter; без путей `app/**`, `Features/**`, Playwright, xcodebuild |
|
|
21
|
+
| **Stack** | `presets/{cursor\|claude}/<stack>/` | Domain/tooling, always-on trio стека, stack examples в **Stack notes** |
|
|
22
|
+
| **Platform** | Cursor `.mdc` / Claude `.md` | Frontmatter (`alwaysApply`/`globs` vs `paths:`), platform-only (`BUGBOT.md`, `CLAUDE.md`) |
|
|
23
|
+
|
|
24
|
+
## Куда класть новое правило
|
|
25
|
+
|
|
26
|
+
1. Общие принципы для всех стеков → **core** + адаптеры с `<!-- shared-core: … -->`.
|
|
27
|
+
2. Только один из installable стеков (`next` / `ios-swift` / `go`) → **stack-specific** (не в `_shared`).
|
|
28
|
+
3. Только Cursor или только Claude packaging → platform artifact / frontmatter, не дублировать семантику.
|
|
29
|
+
|
|
30
|
+
## SoT
|
|
31
|
+
|
|
32
|
+
- Packages path — SoT; root `.cursor/` — dogfood sync.
|
|
33
|
+
- Per stack: **Cursor** `presets/cursor/<stack>/` → Claude twin same PR.
|
|
34
|
+
- `_shared` **не** `--preset` и не копируется CLI `init`.
|
|
35
|
+
|
|
36
|
+
См. также: `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage`.
|