@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
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Code review checklist for Go hexagonal merge requests
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- shared-core: review/code-review-mr.md -->
|
|
7
|
+
|
|
8
|
+
# Code review merge requests
|
|
9
|
+
|
|
10
|
+
On-demand rule for review flows. **Procedure and output format:** skill `code-review`.
|
|
11
|
+
|
|
12
|
+
## When to load
|
|
13
|
+
|
|
14
|
+
- User asks for review/MR/diff
|
|
15
|
+
- Pipeline step `code-reviewer`
|
|
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**.
|
|
30
|
+
|
|
31
|
+
## Constraints
|
|
32
|
+
|
|
33
|
+
- Focus on MR diff, not the whole repo.
|
|
34
|
+
- Use local `git diff` — do not invent hosting metadata.
|
|
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
|
+
- Hexagonal boundaries: `architecture-boundaries`, `domain-layer`, ports vs adapters.
|
|
50
|
+
- HTTP/persistence mapping only at edges; composition root has no business logic.
|
|
51
|
+
- Tests: `tests-unit`, `tests-integration`; post-change: `post-change-test` / `go-tooling`.
|
|
52
|
+
- Never require Playwright, XCUITest, `lint:js`, or `xcodebuild` for Go MRs.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Composition root and DI wiring for Go hexagonal services
|
|
3
|
+
globs:
|
|
4
|
+
- cmd/**/*
|
|
5
|
+
- internal/app/**/*
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Composition root
|
|
11
|
+
|
|
12
|
+
- Construct adapters, use cases, and servers in `cmd/<service>` and/or `internal/app`.
|
|
13
|
+
- Wire interfaces to implementations explicitly (manual DI preferred unless repo already uses a container).
|
|
14
|
+
- Load config once; fail fast on missing required settings.
|
|
15
|
+
- Lifecycle: graceful shutdown via `context` cancel + server `Shutdown`.
|
|
16
|
+
|
|
17
|
+
## Allowed here
|
|
18
|
+
|
|
19
|
+
- Import all layers for wiring only.
|
|
20
|
+
- Process-wide loggers/metrics providers.
|
|
21
|
+
|
|
22
|
+
## Forbidden
|
|
23
|
+
|
|
24
|
+
- Business rules, SQL queries, HTTP routing tables with domain logic.
|
|
25
|
+
- Global mutable singletons for repos without clear init (prefer explicit deps).
|
|
26
|
+
|
|
27
|
+
## Tests
|
|
28
|
+
|
|
29
|
+
- Optional smoke that wiring builds (compile-time / construction test); heavy logic stays in unit/integration tests.
|
|
@@ -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
|
+
- "**/*.go"
|
|
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
|
+
- Strategy via func values / small interfaces at **ports**; adapters implement, domain stays free of frameworks.
|
|
111
|
+
- Suggest Facade at package public API; avoid Singleton in favor of composition root wiring.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Domain layer invariants for Go hexagonal services
|
|
3
|
+
globs:
|
|
4
|
+
- internal/domain/**/*
|
|
5
|
+
- "**/domain/**/*"
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Domain layer
|
|
11
|
+
|
|
12
|
+
- Pure business types and rules; no I/O.
|
|
13
|
+
- Prefer small value objects with validation constructors (`NewX` / `ParseX` that return typed errors).
|
|
14
|
+
- Domain errors are typed (sentinel or structured); map to HTTP/gRPC statuses only in adapters.
|
|
15
|
+
- Domain services orchestrate entities without calling outbound ports (ports live in application).
|
|
16
|
+
- Keep invariants close to the type that owns them; avoid anemic bags of fields with all logic in use cases.
|
|
17
|
+
|
|
18
|
+
## Forbidden imports
|
|
19
|
+
|
|
20
|
+
- `net/http`, `database/sql`, ORM packages, Redis/Kafka clients, router frameworks (`gin`, `chi` as handler deps).
|
|
21
|
+
- Transport DTOs and `json` tags that mirror API contracts (keep API shapes in adapters).
|
|
22
|
+
- Framework `context` cancellation plumbing as a substitute for domain deadlines (prefer explicit types).
|
|
23
|
+
|
|
24
|
+
## Allowed
|
|
25
|
+
|
|
26
|
+
- `context` only if domain API genuinely needs deadlines (prefer application to pass primitives).
|
|
27
|
+
- Stdlib: `time`, `errors`, `fmt`, `slices`, `maps`, etc.
|
|
28
|
+
- Cross-aggregate references by ID, not by loading other aggregates via ports.
|
|
29
|
+
|
|
30
|
+
## Tests
|
|
31
|
+
|
|
32
|
+
- Table-driven unit tests; no DB, no `httptest`, no framework contexts.
|
|
33
|
+
- Cover invalid constructor inputs and invariant violations explicitly.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: End-to-end delivery checklist for Go hexagonal features
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- shared-core: architecture/feature-delivery-workflow.md -->
|
|
7
|
+
|
|
8
|
+
# Feature delivery (Go hexagonal)
|
|
9
|
+
|
|
10
|
+
Order of work:
|
|
11
|
+
|
|
12
|
+
1. **Domain** — entities/VOs/errors (`domain-layer`).
|
|
13
|
+
2. **Application + ports** — use case + outbound interfaces (`application-usecases`, `ports-interfaces`).
|
|
14
|
+
3. **Driven adapters** — persistence/cache/messaging implementing ports.
|
|
15
|
+
4. **Driving adapters** — HTTP/gRPC/CLI mapping DTOs.
|
|
16
|
+
5. **Composition root** — wire in `cmd/` / `internal/app`.
|
|
17
|
+
6. **Tests** — unit (domain/app) → integration (adapters) → optional e2e smoke.
|
|
18
|
+
7. **Gate** — `post-change-test` (+ `go-tooling`).
|
|
19
|
+
|
|
20
|
+
```mermaid
|
|
21
|
+
flowchart LR
|
|
22
|
+
D[Domain] --> A[Application+Ports]
|
|
23
|
+
A --> Drv[Driven adapters]
|
|
24
|
+
Drv --> A
|
|
25
|
+
HTTP[Driving HTTP] --> A
|
|
26
|
+
CR[Composition root] --> HTTP
|
|
27
|
+
CR --> A
|
|
28
|
+
CR --> Drv
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Matrix
|
|
32
|
+
|
|
33
|
+
| Path | Rules |
|
|
34
|
+
|------|-------|
|
|
35
|
+
| `**/domain/**` | `domain-layer`, `architecture-boundaries` |
|
|
36
|
+
| `**/application/**` | `application-usecases`, `ports-interfaces` |
|
|
37
|
+
| `**/adapters/http/**` | `adapters-driving`, `api-http` |
|
|
38
|
+
| `**/adapters/persistence/**` | `adapters-driven`, `persistence-adapters` |
|
|
39
|
+
| `cmd/**`, `internal/app/**` | `composition-root` |
|
|
40
|
+
| After `*.go` edits | `post-change-test` |
|
|
41
|
+
|
|
42
|
+
## Anti-patterns
|
|
43
|
+
|
|
44
|
+
- Framework types in domain; SQL in use cases; DI inside handlers; skipping port interfaces “for speed”.
|
|
45
|
+
- **Ubiquitous language:** Domain names/boundaries reflect the feature domain — do not mix transport/framework terms into domain without need.
|
|
46
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Go backend stack, module layout, and agent entry points (hexagonal preset)
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Стек и окружение
|
|
8
|
+
|
|
9
|
+
Версии Go, toolchain и зависимостей — **из `go.mod` / `go.work` целевого репозитория**. Рамка preset:
|
|
10
|
+
|
|
11
|
+
- **Язык / платформа:** Go (module mode); min version — из `go` directive в `go.mod`.
|
|
12
|
+
- **Архитектура:** hexagonal (ports & adapters); слой domain не знает HTTP/SQL/брокеры.
|
|
13
|
+
- **Точки входа:** `cmd/<service>/main.go` → composition root.
|
|
14
|
+
- **Concurrency:** `context.Context` в API границ; не хранить Context в структурах дольше запроса.
|
|
15
|
+
- **Тесты:** `testing` + table-driven; integration за адаптерами; e2e HTTP smoke — по необходимости.
|
|
16
|
+
- **HTTP:** framework-agnostic (`net/http`, chi/gin/echo — примеры, не мандат).
|
|
17
|
+
- **Наблюдаемость:** только если уже в репо — централизованно (логи/metrics/tracing).
|
|
18
|
+
|
|
19
|
+
# Структура (default: layer-first)
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
cmd/<service>/main.go
|
|
23
|
+
internal/domain/
|
|
24
|
+
internal/application/ # use cases + ports
|
|
25
|
+
internal/adapters/http|grpc|persistence|cache|messaging/
|
|
26
|
+
internal/app/ # optional DI wiring
|
|
27
|
+
pkg/ # optional public library API
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Feature-first variant** allowed: `internal/<feature>/{domain,application,adapters}` — same dependency direction.
|
|
31
|
+
|
|
32
|
+
Границы — **`architecture-boundaries.mdc`**. Tooling — requestable **`go-tooling.mdc`**. После правок Go — **`post-change-test.mdc`**.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Idiomatic Go conventions for this hexagonal preset
|
|
3
|
+
globs:
|
|
4
|
+
- "**/*.go"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Go conventions
|
|
9
|
+
|
|
10
|
+
- Follow [Effective Go](https://go.dev/doc/effective_go) and repo `golangci-lint` / `staticcheck` when present.
|
|
11
|
+
- Accept `context.Context` as first param on I/O and use-case methods.
|
|
12
|
+
- Prefer `camelCase` unexported, `PascalCase` exported; package names short and lowercase.
|
|
13
|
+
- Do not expose `internal/` outside the module.
|
|
14
|
+
- Prefer table-driven tests; use `t.Parallel` only when safe.
|
|
15
|
+
|
|
16
|
+
## Errors
|
|
17
|
+
|
|
18
|
+
- Always handle errors — never `_ = err`.
|
|
19
|
+
- Wrap with `fmt.Errorf("…: %w", err)`; check with `errors.Is` / `errors.As`.
|
|
20
|
+
- Prefer domain/custom error types for structured cases; avoid panics in library/service code.
|
|
21
|
+
|
|
22
|
+
## Interfaces
|
|
23
|
+
|
|
24
|
+
- Accept interfaces, return concrete types.
|
|
25
|
+
- Define interfaces at the **call site** (ports / consumers), not on every implementation.
|
|
26
|
+
- Prefer small, single-method interfaces when they match the use.
|
|
27
|
+
|
|
28
|
+
## Packages
|
|
29
|
+
|
|
30
|
+
- Avoid `util`/`common` dumping grounds — name by domain capability.
|
|
31
|
+
- Keep `main` packages thin (see composition-root).
|
|
32
|
+
- No `init()` for business logic; no package-level mutable state for request data.
|
|
33
|
+
|
|
34
|
+
## Concurrency
|
|
35
|
+
|
|
36
|
+
- Document cancelation; `defer cancel()` after creating a derived context.
|
|
37
|
+
- Do not start unbounded goroutines from handlers without a termination condition / supervision (`WaitGroup`, errgroup, or context cancel).
|
|
38
|
+
- Channels for communication, mutexes for shared state — match existing package patterns.
|
|
39
|
+
|
|
40
|
+
## Anti-hallucination
|
|
41
|
+
|
|
42
|
+
| ❌ Avoid | ✅ Prefer |
|
|
43
|
+
|---------|----------|
|
|
44
|
+
| `_ = err` / ignored errors | Handle or wrap with `%w` |
|
|
45
|
+
| Interfaces on every struct «just in case» | Ports at consumer / call site |
|
|
46
|
+
| Invented modules not in `go.mod` | Add dependency explicitly or copy existing import |
|
|
47
|
+
| `interface{}` where generics or a concrete type fit | Generics / concrete types used by the repo |
|
|
48
|
+
| Business logic in `init()` | Wire in composition root / `main` |
|
|
49
|
+
|
|
50
|
+
## Agent requirement
|
|
51
|
+
|
|
52
|
+
New Go code must stay idiomatic and verifiable against `go.mod` and neighboring packages. Less guessed code is better than more.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Go toolchain commands (test, vet, lint, race) — requestable
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Go tooling (requestable)
|
|
8
|
+
|
|
9
|
+
Before running commands, read **`go.mod`** for module path and Go version.
|
|
10
|
+
|
|
11
|
+
## Common commands
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
go test ./...
|
|
15
|
+
go vet ./...
|
|
16
|
+
go test ./... -race
|
|
17
|
+
go test ./... -cover
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- If the repo has `golangci-lint` or `staticcheck`, use the project’s documented invocation (Makefile/taskfile).
|
|
21
|
+
- Do not invent a lint stack; prefer what CI already runs.
|
|
22
|
+
- Module ops: `go get`, `go mod tidy` only when deps change.
|
|
23
|
+
- Prefer `go test ./path/to/pkg` while iterating; widen to `./...` before handoff.
|
|
24
|
+
|
|
25
|
+
## Race / cover
|
|
26
|
+
|
|
27
|
+
- Use `-race` for concurrent maps, workers, or shared caches.
|
|
28
|
+
- Coverage is optional unless the task or CI requires a threshold.
|
|
29
|
+
|
|
30
|
+
## Related
|
|
31
|
+
|
|
32
|
+
- Mandatory after Go edits: **`post-change-test.mdc`**.
|
|
33
|
+
- Pipeline gate: `build-verifier` (same commands; no yarn lint / xcodebuild).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Messaging driven/driving adapters for Go hexagonal services
|
|
3
|
+
globs:
|
|
4
|
+
- "**/adapters/messaging/**/*"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# Messaging adapters
|
|
10
|
+
|
|
11
|
+
- **Publisher** (driven): implements outbound port; serializes domain events / integration events.
|
|
12
|
+
- **Consumer** (driving): deserializes → calls use case / inbound port; ack/nack policy here.
|
|
13
|
+
- Idempotency keys and retry/DLQ are adapter concerns; document at-least-once assumptions.
|
|
14
|
+
- Do not put broker client types in domain or application signatures.
|
|
15
|
+
|
|
16
|
+
## Event shapes
|
|
17
|
+
|
|
18
|
+
- Prefer explicit event structs in application or a small `events` package used by ports — map to wire format in the adapter.
|
|
19
|
+
|
|
20
|
+
## Tests
|
|
21
|
+
|
|
22
|
+
- Unit-test mapping with fakes; integration against embedded/broker test duals when the repo has them.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Public module API (pkg/) and internal boundaries for Go services
|
|
3
|
+
globs:
|
|
4
|
+
- pkg/**/*
|
|
5
|
+
- go.mod
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Module public API
|
|
11
|
+
|
|
12
|
+
- Anything under `pkg/` is a compatibility surface — change carefully; prefer additive APIs.
|
|
13
|
+
- Service-private code stays in `internal/`.
|
|
14
|
+
- Do not import another module's `internal/` (compiler enforces for separate modules).
|
|
15
|
+
- Document breaking Go API changes in CHANGELOG when the repo publishes libraries.
|
|
16
|
+
|
|
17
|
+
## go.mod
|
|
18
|
+
|
|
19
|
+
- Module path and Go version are SoT for toolchain.
|
|
20
|
+
- Prefer minimal direct deps; pin via `go.mod` / `go.sum`.
|
|
21
|
+
|
|
22
|
+
## Cross-feature
|
|
23
|
+
|
|
24
|
+
- Inside one module, features communicate via application ports or small `pkg` facades — not by importing sibling feature adapter packages.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Persistence driven adapters (SQL/repos) for Go hexagonal services
|
|
3
|
+
globs:
|
|
4
|
+
- "**/adapters/persistence/**/*"
|
|
5
|
+
- "**/*repository*.go"
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Persistence adapters
|
|
11
|
+
|
|
12
|
+
- Implement outbound repository ports from application.
|
|
13
|
+
- Use parameterized queries; map rows → domain entities inside the adapter.
|
|
14
|
+
- Transactions: expose via port (`Transactional`, `UnitOfWork`) implemented here — use cases call the port, not `*sql.Tx` directly.
|
|
15
|
+
- Migrations live with infra (separate package/dir) — not in domain.
|
|
16
|
+
|
|
17
|
+
## Mapping
|
|
18
|
+
|
|
19
|
+
- Persistence models (db tags) stay private to the adapter package when possible.
|
|
20
|
+
- Nullability and DB defaults converted to domain values explicitly.
|
|
21
|
+
|
|
22
|
+
## Forbidden
|
|
23
|
+
|
|
24
|
+
- Importing persistence from domain or leaking `*sql.DB` through port APIs.
|
|
25
|
+
- Building SQL strings in use cases.
|
|
26
|
+
|
|
27
|
+
## Tests
|
|
28
|
+
|
|
29
|
+
- Integration tests with testcontainers / test DB preferred for repos; unit-test mappers with fixtures.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Inbound and outbound port interfaces for Go hexagonal services
|
|
3
|
+
globs:
|
|
4
|
+
- "**/ports/**/*"
|
|
5
|
+
- internal/application/**/*port*
|
|
6
|
+
- "**/application/**/*port*"
|
|
7
|
+
alwaysApply: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# Ports (interfaces)
|
|
12
|
+
|
|
13
|
+
## Outbound (driven)
|
|
14
|
+
|
|
15
|
+
- Repository, cache, publisher, clock, ID generator, external client — defined by **application**.
|
|
16
|
+
- Signatures use **domain** types (or small application DTOs), never ORM models.
|
|
17
|
+
- Keep interfaces small (ISP); prefer role interfaces over god-repos.
|
|
18
|
+
- Accept `context.Context` as the first parameter when the call may block or cancel.
|
|
19
|
+
|
|
20
|
+
## Inbound (driving)
|
|
21
|
+
|
|
22
|
+
- Optional interface wrapping use cases for multiple drivers (HTTP + gRPC + CLI).
|
|
23
|
+
- Drivers depend on inbound ports / use-case APIs — not on each other.
|
|
24
|
+
- Prefer a concrete use-case struct when only one driver exists; extract an interface when a second driver appears.
|
|
25
|
+
|
|
26
|
+
## Naming
|
|
27
|
+
|
|
28
|
+
- `SaveOrder`, `FindOrderByID`, `PublishOrderPlaced` — verb-oriented.
|
|
29
|
+
- Implementation types live in adapters (`PostgresOrderRepository`), not beside the interface in domain.
|
|
30
|
+
|
|
31
|
+
## Anti-patterns
|
|
32
|
+
|
|
33
|
+
- Ports returning `map[string]any` or `json.RawMessage` without need.
|
|
34
|
+
- Putting port interfaces inside adapter packages (wrong owner).
|
|
35
|
+
- Leakage of SQL/`driver.Valuer` types through port method signatures.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Mandatory verification after Go code edits (go test / vet / lint-if-present)
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Post-change test (requestable, mandatory after Go edits)
|
|
8
|
+
|
|
9
|
+
After changing `*.go` / `go.mod` in a consumer repo:
|
|
10
|
+
|
|
11
|
+
1. `go test ./...` (or scoped packages touched).
|
|
12
|
+
2. `go vet ./...`.
|
|
13
|
+
3. If present: `golangci-lint run` and/or `staticcheck ./...` per repo docs.
|
|
14
|
+
4. Optional: `go test ./... -race` for concurrency-sensitive changes (`go-tooling.mdc`).
|
|
15
|
+
|
|
16
|
+
## Scope hints
|
|
17
|
+
|
|
18
|
+
- Prefer package-scoped tests while iterating; run `./...` before claiming the task done.
|
|
19
|
+
- If only `*_test.go` helpers changed, still run the package under test.
|
|
20
|
+
- Module/`go.mod` changes: run `go test ./...` after `go mod tidy`.
|
|
21
|
+
|
|
22
|
+
## Agent requirement
|
|
23
|
+
|
|
24
|
+
- Do not claim completion without running the applicable gate (or noting why CI-only).
|
|
25
|
+
- Pipeline `build-verifier` enforces the same checklist.
|
|
26
|
+
- Record failing command output in the task artifact when the gate fails.
|
|
27
|
+
- Skip only when the change is docs/config with no `*.go` / `go.mod` impact — state that explicitly.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring meta-rule (preset-layering)
|
|
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`.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring meta-rule (preset-no-cross-stack-leakage)
|
|
3
|
+
globs:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
alwaysApply: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-no-cross-stack-leakage.md -->
|
|
11
|
+
|
|
12
|
+
# Preset no cross-stack leakage
|
|
13
|
+
|
|
14
|
+
Запрет протекания stack-specific имён, путей и handoff stems между пресетами.
|
|
15
|
+
|
|
16
|
+
## Principles
|
|
17
|
+
|
|
18
|
+
- `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
|
|
19
|
+
- `ios-swift` must not ship Playwright handoffs or Next lint recipes as required commands.
|
|
20
|
+
- `go` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
|
|
21
|
+
- Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
|
|
22
|
+
|
|
23
|
+
## Forbidden in ios-swift hooks/agents (FAIL)
|
|
24
|
+
|
|
25
|
+
In ios-swift `chain-team-phases.sh` / agent handoffs (Cursor + Claude):
|
|
26
|
+
|
|
27
|
+
- `playwright-test-`, `playwright-agents`, `playwright-e2e`, `user-playwright`
|
|
28
|
+
- `app/__tests__/e2e` as a required path
|
|
29
|
+
- Positive yarn recipes `lint:js` / `lint:css` as commands to run (negation prose alone is weak — prefer zero occurrences)
|
|
30
|
+
|
|
31
|
+
Required instead: `xcuitest-test-*` stems; build-verifier mentions `xcodebuild` or `post-change-build` / `xcode-tooling`.
|
|
32
|
+
|
|
33
|
+
## Forbidden in next hooks/agents (FAIL when present as required)
|
|
34
|
+
|
|
35
|
+
- `xcuitest-test-` as handoff stems
|
|
36
|
+
- Requiring `xcodebuild` / SwiftLint as the default post-change gate for Next app work
|
|
37
|
+
|
|
38
|
+
## Forbidden in go hooks/agents (FAIL)
|
|
39
|
+
|
|
40
|
+
- `playwright-test-`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
|
|
41
|
+
- Positive yarn recipes `lint:js` / `lint:css`
|
|
42
|
+
- `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
|
|
43
|
+
- Agent file `accessibility-reviewer` (no UI surface)
|
|
44
|
+
|
|
45
|
+
Required instead: `integration-test-*`; build-verifier / `post-change-test` / `go-tooling` (`go test`, `go vet`).
|
|
46
|
+
|
|
47
|
+
## Soft / document
|
|
48
|
+
|
|
49
|
+
- Mentioning the other stack in **docs** comparing presets is OK.
|
|
50
|
+
- `build-verifier` may reference other stacks when validating **preset packaging** (`scope: preset-structure-validation`).
|
|
51
|
+
|
|
52
|
+
## Chain fork
|
|
53
|
+
|
|
54
|
+
`hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, and `go` (per platform).
|
|
55
|
+
|
|
56
|
+
## Stack notes
|
|
57
|
+
|
|
58
|
+
Forbidden positive handoffs on this stack are listed in core § go. Prefer `integration-test-*` and `post-change-test`.
|