@bonesofspring/ai-rules 0.2.5 → 0.2.6
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 +22 -5
- package/README.md +13 -1
- package/bin/cli.js +2 -0
- package/package.json +8 -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 +31 -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 +58 -0
- package/presets/_shared/core/quality/design-guidance.md +97 -0
- package/presets/_shared/core/review/code-review-mr.md +29 -0
- package/presets/_shared/core/review/technical-retro.md +7 -0
- package/presets/claude/go/CLAUDE.md +10 -0
- package/presets/claude/go/MCP.md +16 -0
- package/presets/claude/go/README.md +34 -0
- package/presets/claude/go/agents/README.md +15 -0
- package/presets/claude/go/agents/api-contract-reviewer.md +23 -0
- package/presets/claude/go/agents/build-verifier.md +30 -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/debugger.md +25 -0
- package/presets/claude/go/agents/feature-developer.md +30 -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 +10 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +381 -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 +26 -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 +30 -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 +24 -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 +72 -0
- package/presets/claude/go/rules/tooling-and-review/code-review.md +48 -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 +16 -0
- package/presets/claude/go/skills/debug-investigation/SKILL.md +15 -0
- package/presets/claude/go/skills/feature-delivery/SKILL.md +26 -0
- package/presets/claude/go/skills/integration-testing/SKILL.md +15 -0
- package/presets/claude/go/skills/technical-retro/SKILL.md +10 -0
- package/presets/claude/go/skills/unit-testing/SKILL.md +14 -0
- package/presets/claude/go/team/README.md +27 -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/README.md +7 -0
- package/presets/claude/ios-swift/agents/build-verifier.md +17 -8
- package/presets/claude/ios-swift/agents/code-reviewer.md +4 -0
- package/presets/claude/ios-swift/agents/debugger.md +4 -0
- package/presets/claude/ios-swift/agents/feature-developer.md +4 -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/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 +5 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +2 -2
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +7 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +53 -20
- package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +29 -35
- 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/skills/code-review/SKILL.md +4 -0
- package/presets/claude/ios-swift/skills/debug-investigation/SKILL.md +4 -0
- package/presets/claude/ios-swift/skills/feature-delivery/SKILL.md +4 -0
- package/presets/claude/next/README.md +9 -1
- package/presets/claude/next/agents/build-verifier.md +24 -0
- package/presets/claude/next/agents/code-reviewer.md +4 -0
- package/presets/claude/next/agents/debugger.md +4 -0
- package/presets/claude/next/agents/feature-developer.md +4 -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/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/rules/README.md +74 -21
- package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +5 -0
- package/presets/claude/next/rules/architecture/reference-features.md +5 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +7 -0
- package/presets/claude/next/rules/tooling-and-review/code-quality.md +48 -20
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +17 -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/technical-retro.md +16 -0
- package/presets/claude/next/skills/code-review/SKILL.md +4 -0
- package/presets/claude/next/skills/debug-investigation/SKILL.md +4 -0
- package/presets/claude/next/skills/feature-delivery/SKILL.md +4 -0
- package/presets/cursor/go/AGENTS.md +24 -0
- package/presets/cursor/go/BUGBOT.md +9 -0
- package/presets/cursor/go/MCP.md +16 -0
- package/presets/cursor/go/README.md +38 -0
- package/presets/cursor/go/agents/README.md +15 -0
- package/presets/cursor/go/agents/api-contract-reviewer.md +23 -0
- package/presets/cursor/go/agents/build-verifier.md +30 -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/debugger.md +25 -0
- package/presets/cursor/go/agents/feature-developer.md +30 -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 +8 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +381 -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 +27 -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 +73 -0
- package/presets/cursor/go/rules/code-review-mr.mdc +43 -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 +25 -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 +31 -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 +16 -0
- package/presets/cursor/go/skills/debug-investigation/SKILL.md +15 -0
- package/presets/cursor/go/skills/feature-delivery/SKILL.md +26 -0
- package/presets/cursor/go/skills/integration-testing/SKILL.md +15 -0
- package/presets/cursor/go/skills/technical-retro/SKILL.md +10 -0
- package/presets/cursor/go/skills/unit-testing/SKILL.md +14 -0
- package/presets/cursor/go/team/README.md +31 -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/README.md +7 -0
- package/presets/cursor/ios-swift/agents/build-verifier.md +17 -8
- package/presets/cursor/ios-swift/agents/code-reviewer.md +4 -0
- package/presets/cursor/ios-swift/agents/debugger.md +4 -0
- package/presets/cursor/ios-swift/agents/feature-developer.md +4 -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/rules/README.md +23 -2
- package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +2 -2
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +8 -2
- package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +53 -20
- package/presets/cursor/ios-swift/rules/code-review-mr.mdc +32 -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 +6 -0
- package/presets/cursor/ios-swift/rules/technical-retro.mdc +4 -2
- package/presets/cursor/ios-swift/skills/code-review/SKILL.md +4 -0
- package/presets/cursor/ios-swift/skills/debug-investigation/SKILL.md +4 -0
- package/presets/cursor/ios-swift/skills/feature-delivery/SKILL.md +4 -0
- package/presets/cursor/next/README.md +46 -0
- package/presets/cursor/next/agents/build-verifier.md +24 -0
- package/presets/cursor/next/agents/code-reviewer.md +4 -0
- package/presets/cursor/next/agents/debugger.md +4 -0
- package/presets/cursor/next/agents/feature-developer.md +4 -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/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/rules/README.md +21 -1
- package/presets/cursor/next/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +8 -2
- package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +45 -18
- package/presets/cursor/next/rules/code-review-mr.mdc +32 -0
- 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/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/reference-features.mdc +6 -0
- package/presets/cursor/next/rules/technical-retro.mdc +5 -3
- package/presets/cursor/next/skills/code-review/SKILL.md +4 -0
- package/presets/cursor/next/skills/debug-investigation/SKILL.md +4 -0
- package/presets/cursor/next/skills/feature-delivery/SKILL.md +4 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Idiomatic Go conventions for this hexagonal preset
|
|
3
|
+
globs:
|
|
4
|
+
- "**/*.go"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# Go conventions
|
|
10
|
+
|
|
11
|
+
- Follow [Effective Go](https://go.dev/doc/effective_go) and repo `golangci-lint` / `staticcheck` when present.
|
|
12
|
+
- Accept `context.Context` as first param on I/O and use-case methods.
|
|
13
|
+
- Wrap errors: `fmt.Errorf("…: %w", err)`; avoid panics in library/service code.
|
|
14
|
+
- Prefer `camelCase` unexported, `PascalCase` exported; package names short and lowercase.
|
|
15
|
+
- Do not expose `internal/` outside the module.
|
|
16
|
+
- Prefer table-driven tests; use `t.Parallel` only when safe.
|
|
17
|
+
|
|
18
|
+
## Packages
|
|
19
|
+
|
|
20
|
+
- Avoid `util`/`common` dumping grounds — name by domain capability.
|
|
21
|
+
- Keep `main` packages thin (see composition-root).
|
|
22
|
+
|
|
23
|
+
## Concurrency
|
|
24
|
+
|
|
25
|
+
- Document cancelation; do not start unbounded goroutines from handlers without supervision.
|
|
@@ -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`.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring meta-rule (preset-pr-checklist)
|
|
3
|
+
globs:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
alwaysApply: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-pr-checklist.md -->
|
|
11
|
+
|
|
12
|
+
# Preset PR checklist
|
|
13
|
+
|
|
14
|
+
Чеклист для PR, затрагивающих `packages/ai-rules/presets/**` (и dogfood `.cursor/` sync).
|
|
15
|
+
|
|
16
|
+
## Before merge
|
|
17
|
+
|
|
18
|
+
- [ ] **SoT:** правки в `packages/…` (не только root `.cursor/`)
|
|
19
|
+
- [ ] **Core:** если менялся `_shared/core/**` — обновлены все `<!-- shared-core: … -->` consumers (или documented intentional fork)
|
|
20
|
+
- [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, ios-swift, and go — см. `preset-twin-sync`)
|
|
21
|
+
- [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table актуален
|
|
22
|
+
- [ ] **Token budget:** alwaysApply / session-start ≤ 3; meta rules not always-on
|
|
23
|
+
- [ ] **Leakage:** нет чужих stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
|
|
24
|
+
- [ ] **Twin depth:** domain ≥15 lines; thin aliases documented
|
|
25
|
+
- [ ] **README:** stack `rules/README.md` core→stack mapping / catalog updated if stems added
|
|
26
|
+
- [ ] **CHANGELOG / package README:** note when public preset paths or install surface change
|
|
27
|
+
- [ ] **Dogfood:** run `packages/ai-rules/scripts/sync-dogfood-cursor.sh` (or document intentional skip) when maintaining this monorepo
|
|
28
|
+
- [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
|
|
29
|
+
|
|
30
|
+
## Pointers
|
|
31
|
+
|
|
32
|
+
- Layering: `preset-layering`
|
|
33
|
+
- Sync: `preset-twin-sync`
|
|
34
|
+
- Budget: `preset-token-budget`
|
|
35
|
+
- Leakage: `preset-no-cross-stack-leakage`
|
|
36
|
+
- Validation: stack `agents/build-verifier.md` → preset-structure section
|
|
37
|
+
- Dogfood script: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`
|
|
38
|
+
- Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
|
|
39
|
+
- Orchestrator: when editing presets, load this checklist + twin-sync
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring meta-rule (preset-token-budget)
|
|
3
|
+
globs:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
alwaysApply: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-token-budget.md -->
|
|
11
|
+
|
|
12
|
+
# Preset token budget
|
|
13
|
+
|
|
14
|
+
Инварианты загрузки правил в **установленном** пресете (consumer app).
|
|
15
|
+
|
|
16
|
+
## Hard caps
|
|
17
|
+
|
|
18
|
+
| Platform | Always-on | Cap |
|
|
19
|
+
|----------|-----------|-----|
|
|
20
|
+
| Cursor | `alwaysApply: true` | **≤ 3** |
|
|
21
|
+
| Claude | rules **without** `paths:` | **ровно 3** |
|
|
22
|
+
|
|
23
|
+
**Claude Option A (README exclusion):** when counting Claude rules without `paths:` / session-start, **exclude `**/README.md`** (topic indexes are not session-start rules). The intended session-start trio remains **exactly 3**; body budget sums **only those 3** rules.
|
|
24
|
+
|
|
25
|
+
Session-start body budget (где задокументировано): ≤120 строк суммарно (stretch ≤100).
|
|
26
|
+
|
|
27
|
+
## Meta / author rules
|
|
28
|
+
|
|
29
|
+
Rules for preset authors (`preset-layering`, `preset-twin-sync`, …):
|
|
30
|
+
|
|
31
|
+
- **Never** `alwaysApply: true` on consumer installs.
|
|
32
|
+
- Cursor: `globs` limited to `packages/ai-rules/presets/**` (and dogfood `.cursor/**` where useful).
|
|
33
|
+
- Claude: `paths:` limited to `packages/ai-rules/presets/**` (and `.claude/**` dogfood if present).
|
|
34
|
+
|
|
35
|
+
## Heavy workflows
|
|
36
|
+
|
|
37
|
+
Orchestrator, feature-delivery, code-review, post-change gates, domain globs — **requestable / paths**, not always-on.
|
|
38
|
+
|
|
39
|
+
## Verifier
|
|
40
|
+
|
|
41
|
+
build-verifier **FAIL** if alwaysApply / session-start count exceeds 3 (Claude count **excludes `**/README.md`**), or if a `preset-*` meta rule is marked always-on.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Preset authoring meta-rule (preset-twin-sync)
|
|
3
|
+
globs:
|
|
4
|
+
- packages/ai-rules/presets/**/*
|
|
5
|
+
- .cursor/rules/**/*
|
|
6
|
+
- .cursor/team/tasks/**/*
|
|
7
|
+
alwaysApply: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<!-- shared-core: meta/preset-twin-sync.md -->
|
|
11
|
+
|
|
12
|
+
# Preset twin sync
|
|
13
|
+
|
|
14
|
+
Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
|
|
15
|
+
|
|
16
|
+
## Matrix
|
|
17
|
+
|
|
18
|
+
| Stack | Cursor SoT | Claude derive | Mapping table |
|
|
19
|
+
|-------|------------|---------------|---------------|
|
|
20
|
+
| `next` | `presets/cursor/next/rules/*.mdc` | `presets/claude/next/rules/<topic>/` | **Required** in `claude/next/rules/README.md` |
|
|
21
|
+
| `ios-swift` | `presets/cursor/ios-swift/rules/*.mdc` | `presets/claude/ios-swift/rules/<topic>/` | Keep in `claude/ios-swift/rules/README.md` |
|
|
22
|
+
| `go` | `presets/cursor/go/rules/*.mdc` | `presets/claude/go/rules/<topic>/` | Keep in `claude/go/rules/README.md` |
|
|
23
|
+
|
|
24
|
+
## Same-PR checklist
|
|
25
|
+
|
|
26
|
+
1. Edit Cursor rule first (body + frontmatter).
|
|
27
|
+
2. Update Claude twin: body + `paths:` (from Cursor `globs:` / requestable triggers); drop `alwaysApply`.
|
|
28
|
+
3. Update mapping table row if stem/path changed.
|
|
29
|
+
4. If body embeds core (`<!-- shared-core: … -->`), sync core consumers across stacks when core changed.
|
|
30
|
+
|
|
31
|
+
## Twin depth
|
|
32
|
+
|
|
33
|
+
- **Domain** rules: ≥15 body lines (FAIL if thin without documented alias reason).
|
|
34
|
+
- **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
|
|
35
|
+
|
|
36
|
+
## Severity (build-verifier)
|
|
37
|
+
|
|
38
|
+
- **next:** missing Claude twin for a changed Cursor rule → **FAIL** (mapping table required).
|
|
39
|
+
- **ios-swift:** missing Claude twin for a changed Cursor rule → **FAIL**.
|
|
40
|
+
- **go:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift; mapping table required).
|
|
41
|
+
|
|
42
|
+
Dogfood: sync packages → root `.cursor/` after Cursor SoT changes (not the reverse). Use `packages/ai-rules/scripts/sync-dogfood-cursor.sh`.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Reference paths for Go hexagonal layout (fill after init)
|
|
3
|
+
globs:
|
|
4
|
+
- internal/**/*
|
|
5
|
+
- cmd/**/*
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<!-- shared-core: architecture/reference-features.template.md -->
|
|
10
|
+
|
|
11
|
+
# Reference features (Go)
|
|
12
|
+
|
|
13
|
+
Fill TBD paths after adopting this preset in a real service repo.
|
|
14
|
+
|
|
15
|
+
| Area | Example path (TBD) | Glob hint |
|
|
16
|
+
|------|--------------------|-----------|
|
|
17
|
+
| Domain | `internal/domain/` | `**/domain/**` |
|
|
18
|
+
| Application / ports | `internal/application/` | `**/application/**` |
|
|
19
|
+
| HTTP adapter | `internal/adapters/http/` | `**/adapters/http/**` |
|
|
20
|
+
| Persistence | `internal/adapters/persistence/` | `**/adapters/persistence/**` |
|
|
21
|
+
| Composition root | `cmd/<service>/`, `internal/app/` | `cmd/**`, `internal/app/**` |
|
|
22
|
+
| Unit tests | `*_test.go` beside packages | `**/*_test.go` |
|
|
23
|
+
| Integration | `**/integration/` | `**/*_integration_test.go` |
|
|
24
|
+
|
|
25
|
+
## Dogfood scenarios
|
|
26
|
+
|
|
27
|
+
1. `/task` new use case — domain → ports → adapters → wire → `post-change-test`.
|
|
28
|
+
2. Bug in handler mapping — debugger + httptest unit.
|
|
29
|
+
3. Repository contract — integration-test trio.
|
|
30
|
+
4. OpenAPI/proto drift — api-contract-reviewer.
|
|
31
|
+
5. Secrets in logs — security-reviewer + `security-go`.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Security basics for Go backends (secrets, auth, PII, TLS)
|
|
3
|
+
globs:
|
|
4
|
+
- "**/middleware/**/*"
|
|
5
|
+
- "**/auth/**/*"
|
|
6
|
+
- "**/config/**/*"
|
|
7
|
+
alwaysApply: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# Security (Go)
|
|
12
|
+
|
|
13
|
+
- Secrets from env/secret manager — never commit keys; do not log tokens/passwords.
|
|
14
|
+
- Validate and canonicalize untrusted input at the driving adapter edge.
|
|
15
|
+
- Prefer prepared statements / parameterized queries in persistence adapters.
|
|
16
|
+
- TLS and secure cookie/header defaults when exposing HTTP.
|
|
17
|
+
- AuthN/AuthZ in middleware or driving adapters; pass identity into use cases as domain value (user ID / claims), not raw headers.
|
|
18
|
+
- Minimize PII in logs; redact where needed.
|
|
19
|
+
|
|
20
|
+
## Config
|
|
21
|
+
|
|
22
|
+
- Distinguish public vs secret config fields in types.
|
|
23
|
+
- Fail closed when auth is misconfigured in production builds.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Technical retro alias — use /technical-retro command
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- shared-core: review/technical-retro.md -->
|
|
7
|
+
|
|
8
|
+
# Техническое ретро — rule alias
|
|
9
|
+
|
|
10
|
+
Полный сценарий (включая блок **«Работа агентов»** для slug из team tasks) — в slash-команде:
|
|
11
|
+
|
|
12
|
+
**`commands/technical-retro.md`** → `/technical-retro`
|
|
13
|
+
|
|
14
|
+
Используй rule только если command недоступен. Не дублируй содержимое command в ответе — следуй command-файлу и skill `technical-retro`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: End-to-end HTTP smoke tests for Go services
|
|
3
|
+
globs:
|
|
4
|
+
- "**/e2e/**/*_test.go"
|
|
5
|
+
- "**/*_e2e_test.go"
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# E2E / HTTP smoke
|
|
11
|
+
|
|
12
|
+
- Black-box against a running server (httptest with full composition root, or localhost in CI).
|
|
13
|
+
- Cover critical paths only; prefer integration + unit for breadth.
|
|
14
|
+
- Stable test data; avoid depending on wall-clock flakiness.
|
|
15
|
+
- Do not use browser/Playwright tooling in this preset.
|
|
16
|
+
|
|
17
|
+
## Placement
|
|
18
|
+
|
|
19
|
+
- `e2e/` package or `*_e2e_test.go` with build tags if needed.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Integration / adapter contract tests for Go hexagonal services
|
|
3
|
+
globs:
|
|
4
|
+
- "**/integration/**/*_test.go"
|
|
5
|
+
- "**/*_integration_test.go"
|
|
6
|
+
alwaysApply: false
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Integration tests
|
|
11
|
+
|
|
12
|
+
- Exercise driven adapters against real infra doubles (testcontainers, docker compose test DB, miniredis, etc.).
|
|
13
|
+
- Or exercise HTTP adapter with `httptest` + wired use case + fake/real ports — still no full prod cluster required.
|
|
14
|
+
- Build tags (`//go:build integration`) if the repo separates CI jobs.
|
|
15
|
+
- Keep fixtures deterministic; clean up data between tests.
|
|
16
|
+
|
|
17
|
+
## Scope
|
|
18
|
+
|
|
19
|
+
- Contract of a port implementation (repo save/load roundtrip).
|
|
20
|
+
- Not a substitute for domain unit tests.
|
|
21
|
+
|
|
22
|
+
## Agents
|
|
23
|
+
|
|
24
|
+
- Planning/generation: `integration-test-{planner,generator,healer}` + skill `integration-testing`.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Unit testing conventions for Go hexagonal services
|
|
3
|
+
globs:
|
|
4
|
+
- "**/*_test.go"
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# Unit tests
|
|
10
|
+
|
|
11
|
+
- Table-driven tests; clear arrange/act/assert.
|
|
12
|
+
- Domain and application: mock/fake **ports** only — no real DB/network.
|
|
13
|
+
- Prefer fakes over heavy mocking frameworks when simple.
|
|
14
|
+
- Skip integration/e2e files matching `*_integration_test.go`, `*_e2e_test.go`, or dirs `integration/`, `e2e/` — those use other rules.
|
|
15
|
+
|
|
16
|
+
## Forbidden smells
|
|
17
|
+
|
|
18
|
+
- `gin.Context` / `http.Request` in domain tests.
|
|
19
|
+
- SQL or live HTTP in use-case unit tests.
|
|
20
|
+
- Brittle tests on unexported adapter internals without need.
|
|
21
|
+
- Structural smells vocabulary (Feature Envy, Message Chains, …): see requestable `design-guidance` — do not duplicate the catalog here.
|
|
22
|
+
|
|
23
|
+
## Naming
|
|
24
|
+
|
|
25
|
+
- `TestUseCase_DoX` / `TestEntity_Invariant`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ci-investigation
|
|
3
|
+
description: Investigates failing CI checks on PRs and branches — go test, vet, lint, integration, preset-structure — with local reproduction and minimal fixes. Use when CI is red or for ci-fix pipeline tasks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CI investigation (Go)
|
|
7
|
+
|
|
8
|
+
1. Identify job + log excerpt.
|
|
9
|
+
2. Reproduce locally with the same commands.
|
|
10
|
+
3. Minimal fix; for ai-rules preset PRs run `yarn check:preset-structure`.
|
|
11
|
+
4. Do not treat Playwright/xcodebuild/`lint:js` as default Go gates.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: Reviews pull requests and branch diffs for Go hexagonal services using architecture, ports/adapters, networking, and testing standards. Use when the user asks for review or when code-reviewer runs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code review (Go)
|
|
7
|
+
|
|
8
|
+
1. Diff-first; load `code-review-mr.mdc` + hexagonal rules.
|
|
9
|
+
2. Check layer leaks, port ownership, composition root purity, tests, security-sensitive bits.
|
|
10
|
+
3. Write `review.md` with APPROVE or REQUEST_CHANGES.
|
|
11
|
+
|
|
12
|
+
Never require iOS/Next-only gates (XCUITest, Playwright, `lint:js`).
|
|
13
|
+
|
|
14
|
+
## Design guidance
|
|
15
|
+
|
|
16
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug-investigation
|
|
3
|
+
description: Investigates bugs, failing tests, and unexpected behavior in Go services with runtime evidence before applying minimal fixes. Use for bugfix tasks, debugger agent runs, or regressions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Debug investigation (Go)
|
|
7
|
+
|
|
8
|
+
1. Capture failing `go test` / logs / stack traces.
|
|
9
|
+
2. Hypothesize layer (domain vs adapter vs wiring).
|
|
10
|
+
3. Minimal fix + regression test when appropriate.
|
|
11
|
+
4. Document in `debug-report.md`.
|
|
12
|
+
|
|
13
|
+
## Design guidance
|
|
14
|
+
|
|
15
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-delivery
|
|
3
|
+
description: Delivers Go hexagonal backend features end-to-end across domain, application/ports, adapters, composition root, tests, and post-change-test validation. Use when implementing or extending a feature, especially through /task or feature-developer.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Feature Delivery (Go hexagonal)
|
|
7
|
+
|
|
8
|
+
1. Read brief, AC, and decomposition.
|
|
9
|
+
2. Follow `feature-delivery-workflow.mdc` + `reference-features.mdc`: domain → application/ports → driven adapters → driving adapters → composition root → tests.
|
|
10
|
+
3. Wire DI only in `cmd/` / `internal/app`.
|
|
11
|
+
4. Add unit tests for domain/use cases; integration tests for risky adapters.
|
|
12
|
+
5. After Go edits: **invoke** `post-change-test.mdc` (+ `go-tooling.mdc`).
|
|
13
|
+
|
|
14
|
+
## Do / Don't
|
|
15
|
+
|
|
16
|
+
- **Do** keep ports owned by application; map wire types at adapters.
|
|
17
|
+
- **Don't** put SQL/business rules in HTTP handlers or frameworks in domain.
|
|
18
|
+
- **Don't** use Playwright, XCUITest, or yarn lint as this stack's gate.
|
|
19
|
+
|
|
20
|
+
## Handoff
|
|
21
|
+
|
|
22
|
+
Summarize by layer + validation. Update `.cursor/team/tasks/<slug>/status.json`.
|
|
23
|
+
|
|
24
|
+
## Design guidance
|
|
25
|
+
|
|
26
|
+
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|