@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
package/CHANGELOG.md
CHANGED
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
### Breaking
|
|
6
|
-
|
|
7
|
-
- **Deprecated rule stubs removed** (Cursor + Claude `next`): `types-public-imports`, `api-public-imports`, `no-cross-component-styles-import` / `component-styles`. Use `public-imports` and `react-ui` instead.
|
|
8
|
-
- **`next` preset — post-change-lint no longer always-on:** Cursor `post-change-lint.mdc` and Claude twin are **requestable** (not session-start / `alwaysApply`). Load explicitly after code edits via skill `feature-delivery` or agent `build-verifier`. Session-start / alwaysApply is now **3** rules: `next-app-core`, `package-manager`, `code-quality-and-refactoring`. Workspace dogfood `.cursor/rules/post-change-lint.mdc` synced.
|
|
9
|
-
|
|
10
5
|
### Added
|
|
11
6
|
|
|
7
|
+
- **Always-on Principles** in shared `quality/code-quality-and-refactoring` (+6 adapters): compact § **Принципы** — KISS, DRY + Rule of Three, YAGNI, SOLID, CUPID, composition over inheritance, Law of Demeter hint. No smell/GoF catalogs in always-on.
|
|
8
|
+
- **Requestable `quality/design-guidance`** (+6 adapters, Cursor/Claude × next/ios-swift/go): curated Fowler smells (≤12) + GoF (≤8) + skip/avoid; globs `app/src/**/*.{ts,tsx}` / `**/*.swift` / `**/*.go`. Cross-refs in `feature-delivery-workflow` (ubiquitous language) and `code-review-mr` checklist. One-liner wiring in feature-developer / code-review / debugger (+ recommended roles).
|
|
9
|
+
- **Go hexagonal preset (`go`):** Cursor + Claude twins — 32 rules (always-on: `go-app-core`, `architecture-boundaries`, `code-quality-and-refactoring`), 20 agents (`integration-test-*`, no a11y/Playwright/XCUITest), 7 skills (+ `integration-testing`), hooks/commands/team/MCP. Structure scripts `STACKS` include `go`; leakage `GO_FORBIDDEN_*` + pairwise chain forks. Install: `init cursor|claude --preset go`. Lineage markers on go `feature-delivery-workflow` / `reference-features`; go team fixtures / commands READMEs use Go gates (not xcodebuild/XCUITest copy-paste).
|
|
10
|
+
- **Preset structure CI gates:** `scripts/check-preset-{twin-map,token-budget,leakage,structure}.sh` + npm scripts `check:preset-*`; GitHub Actions workflow `.github/workflows/preset-structure.yml` on `packages/ai-rules/**` PRs. Hard FAIL on twin/budget/leakage; soft shared-core drift only (no `AI_RULES_DRIFT_FAIL`).
|
|
11
|
+
- **`presets/_shared/core/**`:** stack-agnostic shared prose (quality, agent-team, architecture templates, review, author meta-rules) with `<!-- shared-core: … -->` adapters in Cursor + Claude `next` and `ios-swift`.
|
|
12
|
+
- **Author meta-rules:** `preset-layering`, `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage` (never always-on / session-start).
|
|
13
|
+
- **Contributor docs:** `docs/PRESET-CONTRIBUTION.md` (layers, SoT, embed vs lineage sync modes, new-stack checklist).
|
|
14
|
+
- **Monorepo scripts:** `scripts/sync-dogfood-cursor.sh`, `scripts/check-shared-core-drift.sh`.
|
|
12
15
|
- **MCP configs in presets** (`next` + `ios-swift`, Cursor + Claude): `mcp.json` + `MCP.md`. Cursor → `.cursor/mcp.json`; Claude → project-root `.mcp.json`. **next:** Context7, Playwright, Chrome DevTools, Figma (remote). **ios-swift:** Context7 + Figma. CLI `init`/`clean` manage these paths.
|
|
13
16
|
- **Cursor + Claude `ios-swift` — full agent-team parity with `next`:** **21** agents (Playwright trio → `xcuitest-test-{planner,generator,healer}`), **7** skills (`xcuitest-e2e`), **5** slash commands, `hooks.json` + iOS-adapted `chain-team-phases.sh` (Cursor) / hook scripts + README (Claude), `team/fixtures/` ×3, `AGENTS.md` (Cursor) / thin `CLAUDE.md` (≤35 lines).
|
|
14
17
|
- **ios-swift rules:** agent-team intake/orchestrator, `xcode-tooling`, `reference-features`, domain rules (`navigation-coordinators`, `persistence-data`, `security-ios`, `module-public-api`), `technical-retro` alias; **21** rule topics (+ README). CLI init copies agents, hooks, skills, team, `AGENTS.md`.
|
|
@@ -16,12 +19,26 @@
|
|
|
16
19
|
|
|
17
20
|
### Changed
|
|
18
21
|
|
|
22
|
+
- **Meta twin policy (three stacks):** `preset-twin-sync` / `preset-pr-checklist` / `preset-layering` core + embeds name **next, ios-swift, and go**; twin FAIL applies to all three (`check-preset-twin-map.sh`).
|
|
23
|
+
- **PRESET-CONTRIBUTION:** shared-core sync step says **all six adapters** (3 stacks × 2 platforms), not «four presets».
|
|
24
|
+
- **Claude session-start count (Option A):** when counting rules without `paths:`, **exclude `**/README.md`**; intended trio remains **exactly 3**; body budget sums only those 3 (`preset-token-budget`, PRESET-CONTRIBUTION, build-verifier ×4).
|
|
25
|
+
- **Twin policy doc sync:** `claude/next/rules/README.md` — missing twin is **FAIL** (next, ios-swift, and go); no soft FAIL for next.
|
|
26
|
+
- **next agent roster docs:** READMEs/commands say **21** agents (was stale 20).
|
|
27
|
+
- **PRESET-CONTRIBUTION:** cross-link → `.cursor/team/tasks/preset-regression-audit/` (was `preset-arch-quality-rules`).
|
|
28
|
+
- **Twin policy:** missing Claude twin for a changed Cursor rule is **FAIL** on **next**, **ios-swift**, and **go**.
|
|
29
|
+
- **build-verifier** preset-structure section: twin FAIL on next, session-start line budget, embed-drift + dogfood script hooks.
|
|
30
|
+
- Claude meta-rule `paths:` include dogfood `.claude/**/*` (+ `.cursor/rules` / `team/tasks` for parity).
|
|
19
31
|
- **Agent team slug bootstrap:** `/task` and `/feature-start` (Cursor + Claude, `next` + `ios-swift`) create `.cursor|claude/team/tasks/<slug>/` via **Write**, not Shell `mkdir` — avoids Cursor sandbox `Operation not permitted` (esp. macOS Desktop/Documents). Orchestrator + `team/README` + `task-router` document the rule.
|
|
20
32
|
- **Token model (ios-swift + next):** both presets use **3** alwaysApply / session-start rules (~77 / ~59 body lines). Post-change verification is **requestable** — ios: `post-change-build`; next: `post-change-lint`. Orchestrator, intake, code-review, feature-delivery, tooling rules load on-demand (`paths:` / description).
|
|
21
33
|
- Claude `next`: `agent-team-orchestrator` and `code-review-mr` use `paths:` (on-demand) — session-start matches the 3-rule budget above.
|
|
22
34
|
- Cursor `next` agents: all pipeline agents set **`readonly: false`** so they can write `.cursor/team/**`. Production/app restrictions remain in prompt bodies (Cursor `readonly: true` blocks all file writes, including team artifacts).
|
|
23
35
|
- **ios-swift:** `networking-services` HTTP-only (persistence split out); soft AC-19 for thin aliases (`agent-team-intake`, `technical-retro`); `feature-developer` requires stack-specific hook handoff forks.
|
|
24
36
|
|
|
37
|
+
### Breaking
|
|
38
|
+
|
|
39
|
+
- **Deprecated rule stubs removed** (Cursor + Claude `next`): `types-public-imports`, `api-public-imports`, `no-cross-component-styles-import` / `component-styles`. Use `public-imports` and `react-ui` instead.
|
|
40
|
+
- **`next` preset — post-change-lint no longer always-on:** Cursor `post-change-lint.mdc` and Claude twin are **requestable** (not session-start / `alwaysApply`). Load explicitly after code edits via skill `feature-delivery` or agent `build-verifier`. Session-start / alwaysApply is now **3** rules: `next-app-core`, `package-manager`, `code-quality-and-refactoring`. Workspace dogfood `.cursor/rules/post-change-lint.mdc` synced.
|
|
41
|
+
|
|
25
42
|
### Notes
|
|
26
43
|
|
|
27
44
|
- **P2 optional (ios-swift):** Remaining polish: feature-delivery matrix enrichment, swift-conventions body cap. (`BUGBOT.md` shipped.)
|
package/README.md
CHANGED
|
@@ -48,13 +48,25 @@ Where things go on `init`:
|
|
|
48
48
|
| MCP | `mcp.json` → `.cursor/mcp.json`, `MCP.md` → `.cursor/` | `mcp.json` → **`.mcp.json`** (project root), `MCP.md` → `.claude/` |
|
|
49
49
|
| other | `BUGBOT.md`, `AGENTS.md` → `.cursor/` | `CLAUDE.md` → `.claude/CLAUDE.md` |
|
|
50
50
|
|
|
51
|
-
The package ships presets including **`next`** (Next.js stack)
|
|
51
|
+
The package ships presets including **`next`** (Next.js stack), **`ios-swift`** (iOS apps on Swift / SwiftUI), and **`go`** (Go backends with hexagonal architecture). Other preset names: see `presets/` in the [repo](https://github.com/bonesofspring/ai-rules). Name is a single path segment, no `/` or `..`.
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
npx @bonesofspring/ai-rules init cursor --preset ios-swift
|
|
55
55
|
npx @bonesofspring/ai-rules init claude --preset ios-swift
|
|
56
|
+
npx @bonesofspring/ai-rules init cursor --preset go
|
|
57
|
+
npx @bonesofspring/ai-rules init claude --preset go
|
|
56
58
|
```
|
|
57
59
|
|
|
58
60
|
Help: `ai-rules --help`.
|
|
59
61
|
|
|
62
|
+
## Contributing to presets
|
|
63
|
+
|
|
64
|
+
Presets are developed in this monorepo under `presets/`. If you add or change rules, agents, or platform artifacts:
|
|
65
|
+
|
|
66
|
+
- **Taxonomy & layers:** [`presets/_shared/README.md`](presets/_shared/README.md) — shared core (`_shared/core`), stack adapters, platform packaging
|
|
67
|
+
- **Contribution guide:** [`docs/PRESET-CONTRIBUTION.md`](docs/PRESET-CONTRIBUTION.md) — SoT, twin sync, embed vs lineage, token budget (≤3 always-on), PR checklist, new stack preset, platform-only files (`BUGBOT.md`, `CLAUDE.md`)
|
|
68
|
+
- **Dogfood / drift scripts:** [`scripts/sync-dogfood-cursor.sh`](scripts/sync-dogfood-cursor.sh), [`scripts/check-shared-core-drift.sh`](scripts/check-shared-core-drift.sh)
|
|
69
|
+
- **Preset structure CI gates** (exit non-zero on FAIL): `yarn check:preset-structure` (or `bash scripts/check-preset-structure.sh`) — twin map, session-start budget (Option A), leakage; soft drift included without `AI_RULES_DRIFT_FAIL`
|
|
70
|
+
- **CLI note:** `_shared` is not an installable `--preset`; `init` copies only `presets/cursor/<name>/` or `presets/claude/<name>/`
|
|
71
|
+
|
|
60
72
|
MIT.
|
package/bin/cli.js
CHANGED
|
@@ -65,8 +65,10 @@ Examples:
|
|
|
65
65
|
npx @bonesofspring/ai-rules init cursor --preset next
|
|
66
66
|
npx @bonesofspring/ai-rules init cursor next
|
|
67
67
|
npx @bonesofspring/ai-rules init cursor --preset ios-swift
|
|
68
|
+
npx @bonesofspring/ai-rules init cursor --preset go
|
|
68
69
|
npx @bonesofspring/ai-rules init claude
|
|
69
70
|
npx @bonesofspring/ai-rules init claude --preset ios-swift
|
|
71
|
+
npx @bonesofspring/ai-rules init claude --preset go
|
|
70
72
|
npx @bonesofspring/ai-rules clean cursor
|
|
71
73
|
`);
|
|
72
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonesofspring/ai-rules",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Presets of Cursor and Claude rules/commands for Revy Ross personal use",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Revy Ross",
|
|
@@ -24,6 +24,13 @@
|
|
|
24
24
|
"bin",
|
|
25
25
|
"presets"
|
|
26
26
|
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"check:preset-structure": "bash scripts/check-preset-structure.sh",
|
|
29
|
+
"check:preset-twin-map": "bash scripts/check-preset-twin-map.sh",
|
|
30
|
+
"check:preset-token-budget": "bash scripts/check-preset-token-budget.sh",
|
|
31
|
+
"check:preset-leakage": "bash scripts/check-preset-leakage.sh",
|
|
32
|
+
"check:shared-core-drift": "bash scripts/check-shared-core-drift.sh"
|
|
33
|
+
},
|
|
27
34
|
"engines": {
|
|
28
35
|
"node": ">=18"
|
|
29
36
|
},
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Shared preset core (`presets/_shared`)
|
|
2
|
+
|
|
3
|
+
Stack-agnostic **prose and checklists** for all installable presets: `next`, `ios-swift`, and `go` (`cursor/<stack>`, `claude/<stack>`).
|
|
4
|
+
|
|
5
|
+
**Not an installable preset.** CLI `init` copies only under `presets/cursor/<name>/` or `presets/claude/<name>/` — this sibling is never shipped to consumer apps.
|
|
6
|
+
|
|
7
|
+
## Layers
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
Core (_shared/core) → stack-agnostic prose
|
|
11
|
+
Stack (cursor|claude/<stack>) → domain / tooling deltas
|
|
12
|
+
Platform adapter → .mdc frontmatter | .md + paths:
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
See meta-rules: `core/meta/preset-layering.md`, `preset-twin-sync.md`, `preset-token-budget.md`, `preset-pr-checklist.md`, `preset-no-cross-stack-leakage.md`.
|
|
16
|
+
|
|
17
|
+
**Contributing:** [`../../docs/PRESET-CONTRIBUTION.md`](../../docs/PRESET-CONTRIBUTION.md) (full guide: layers, SoT, new stack, platform artifacts, PR checklist).
|
|
18
|
+
|
|
19
|
+
## Sync model
|
|
20
|
+
|
|
21
|
+
1. Edit core under `core/**` when changing shared principles.
|
|
22
|
+
2. Update every consumer that carries `<!-- shared-core: <path> -->` in the **same PR**.
|
|
23
|
+
3. Cursor `presets/cursor/<stack>/` is SoT per stack; Claude twins are derived in the same PR.
|
|
24
|
+
4. Dogfood: `packages/ai-rules/scripts/sync-dogfood-cursor.sh` (packages → root `.cursor/`).
|
|
25
|
+
|
|
26
|
+
### Sync modes (marker semantics)
|
|
27
|
+
|
|
28
|
+
| Mode | Marker | Adapter body | Typical stems |
|
|
29
|
+
|------|--------|--------------|---------------|
|
|
30
|
+
| **Embed** | `<!-- shared-core: … -->` | Core prose + optional `## Stack notes` only for deltas | `quality/*`, `meta/preset-*`, thin review/intake aliases |
|
|
31
|
+
| **Lineage** | same marker | **Stack-specific** body; core is abstract SoT / checklist reference | `architecture/feature-delivery-workflow`, `architecture/reference-features.template`, `agent-team/agent-team-orchestrator` |
|
|
32
|
+
|
|
33
|
+
Do **not** expect lineage adapters to byte-match core. Embed adapters should match core after stripping frontmatter and `## Stack notes` — verify with `scripts/check-shared-core-drift.sh`.
|
|
34
|
+
|
|
35
|
+
## Folder map
|
|
36
|
+
|
|
37
|
+
| Dir | Contents |
|
|
38
|
+
|-----|----------|
|
|
39
|
+
| `core/quality/` | Boy-scout + Principles (always-on); requestable `design-guidance` (smells ≤12 + GoF ≤8) |
|
|
40
|
+
| `core/agent-team/` | Orchestrator + intake (pipeline language) |
|
|
41
|
+
| `core/architecture/` | Feature-delivery abstract + reference-features template |
|
|
42
|
+
| `core/review/` | Code-review MR + technical-retro alias |
|
|
43
|
+
| `core/meta/` | Author-facing preset meta-rules |
|
|
44
|
+
|
|
45
|
+
## CLI note
|
|
46
|
+
|
|
47
|
+
Do **not** nest `_shared` under `cursor/` or `claude/`. Do not pass `_shared` as `--preset`.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Agent team intake
|
|
2
|
+
|
|
3
|
+
When the user message looks like a **work request** (implement, add, fix, refactor, review MR, write tests, spike) — not a question about how code works:
|
|
4
|
+
|
|
5
|
+
1. Prefer **`/task <their request>`** or invoke **task-router** first.
|
|
6
|
+
2. Do not jump straight to coding without router + pipeline when scope is non-trivial.
|
|
7
|
+
3. Pure questions («как работает X», «объясни») — answer normally, no `/task`.
|
|
8
|
+
|
|
9
|
+
Exceptions: user explicitly says «без pipeline», «просто сделай», or continues an active slug.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Agent team orchestrator
|
|
2
|
+
|
|
3
|
+
Parent agent = **manager**. Router plans; specialists execute. Artifacts: `.cursor/team/tasks/<slug>/` (Claude: `.claude/team/tasks/<slug>/`).
|
|
4
|
+
|
|
5
|
+
Work request без `/task` — см. **agent-team-intake** (когда предлагать router вместо прямого кодинга).
|
|
6
|
+
|
|
7
|
+
## Entry points
|
|
8
|
+
|
|
9
|
+
| Command | When |
|
|
10
|
+
|---------|------|
|
|
11
|
+
| **`/task <desc>`** | **Preferred** — router → dynamic pipeline → first agent |
|
|
12
|
+
| `/task-continue <slug>` | After human gate or pause |
|
|
13
|
+
| `/feature-start <desc>` | Legacy: analyst-only start (no router) |
|
|
14
|
+
| `/feature-continue <slug>` | Alias of task-continue |
|
|
15
|
+
| `/technical-retro [slug]` | Retro with agent team block |
|
|
16
|
+
|
|
17
|
+
## Roles (shared catalog)
|
|
18
|
+
|
|
19
|
+
Roster of specialists is **stack-specific** (agent names and write scopes differ). See **Stack notes** in the stack adapter for the live Roles table. Common patterns:
|
|
20
|
+
|
|
21
|
+
| Kind | Examples (names vary by stack) |
|
|
22
|
+
|------|--------------------------------|
|
|
23
|
+
| Planning | `task-router`, `task-analyst`, `solution-architect`, `migration-specialist` |
|
|
24
|
+
| Implementation | `feature-developer`, `debugger`, `ci-investigator` |
|
|
25
|
+
| Gates / review | `build-verifier`, `code-reviewer`, `security-reviewer`, `performance-auditor`; plus stack-native a11y/UI reviewer **only when the stack has a UI surface** |
|
|
26
|
+
| Tests | unit planner/generator/healer; e2e/UI planner/generator/healer (stack-native) |
|
|
27
|
+
| Docs | `tech-writer` |
|
|
28
|
+
|
|
29
|
+
**Cursor frontmatter:** all team pipeline agents use `readonly: false` so they can write team artifacts. Production/app restrictions live in the agent prompt body — do **not** set `readonly: true`.
|
|
30
|
+
|
|
31
|
+
Full prompts: stack `agents/*.md`. Artifact conventions: stack `team/README.md`.
|
|
32
|
+
|
|
33
|
+
## Dynamic pipeline
|
|
34
|
+
|
|
35
|
+
```mermaid
|
|
36
|
+
flowchart TD
|
|
37
|
+
task["/task prompt"]
|
|
38
|
+
router["task-router"]
|
|
39
|
+
pipeline["pipeline.json"]
|
|
40
|
+
step0["steps 0..N"]
|
|
41
|
+
gate{"humanGates?"}
|
|
42
|
+
hook["subagentStop hook"]
|
|
43
|
+
retro["/technical-retro"]
|
|
44
|
+
|
|
45
|
+
task --> router
|
|
46
|
+
router --> pipeline
|
|
47
|
+
pipeline --> step0
|
|
48
|
+
step0 --> gate
|
|
49
|
+
gate -->|"/task-continue"| step0
|
|
50
|
+
step0 --> hook
|
|
51
|
+
hook --> step0
|
|
52
|
+
step0 --> retro
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Source of truth for order:** `pipeline.json` → `steps[]`. Never hardcode analyst → dev → review → QA when `pipeline.json` exists.
|
|
56
|
+
|
|
57
|
+
## status.json (pipeline mode)
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"slug": "...",
|
|
62
|
+
"intent": "feature",
|
|
63
|
+
"pipelineIndex": 0,
|
|
64
|
+
"currentAgent": "task-analyst",
|
|
65
|
+
"phase": "executing",
|
|
66
|
+
"state": "in_progress",
|
|
67
|
+
"awaitingHumanGate": false
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
| state | Meaning |
|
|
72
|
+
|-------|---------|
|
|
73
|
+
| `in_progress` | Current step running |
|
|
74
|
+
| `completed` | Current step done; hook advances |
|
|
75
|
+
| `awaiting_approval` | Human gate; wait for `/task-continue` |
|
|
76
|
+
| `changes_requested` | Reviewer blocked; re-run developer (`retryAfterFix`) |
|
|
77
|
+
| `validation_failed` | build-verifier failed; re-run developer then build-verifier |
|
|
78
|
+
|
|
79
|
+
## Pipeline step options
|
|
80
|
+
|
|
81
|
+
| Field | Use |
|
|
82
|
+
|-------|-----|
|
|
83
|
+
| `skipIf` | `debugger.fixed` / `ci-investigator.resolved` — hook skips step when artifact says fix applied |
|
|
84
|
+
| `parallel: true` | `agent` is array — invoke **all** agents in one parent turn; each appends to `parallelCompleted` |
|
|
85
|
+
| `scope` | e.g. `unit-in-dev`, `e2e-only`, `preset-artifacts-only` — passed to developer/qa |
|
|
86
|
+
| `model` | `cheap` \| `standard` \| `strong` — optional tier override |
|
|
87
|
+
|
|
88
|
+
## Rules (strict)
|
|
89
|
+
|
|
90
|
+
1. **`/task` always starts with task-router** (except user says "skip router" with documented pipeline).
|
|
91
|
+
2. Read `pipeline.json` before every subagent invocation.
|
|
92
|
+
3. One role per Task call — **except** parallel steps: multiple Task calls in one message.
|
|
93
|
+
4. **Never** skip `humanGates` without `/task-continue` or explicit user approval.
|
|
94
|
+
5. Persist handoffs to disk (`brief.md`, `decomposition.md`, `debug-report.md`, `validation-report.md`, `architecture.md`, `migration-plan.md`, `ci-report.md`, `a11y-review.md`, `perf-report.md`, `security-review.md`, `api-contract-review.md`, `unit-test-plan.md`, `documentation.md`, `review.md`).
|
|
95
|
+
6. On `changes_requested` from reviewers: hook sets `retryAfterFix` → developer → same reviewer.
|
|
96
|
+
7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
|
|
97
|
+
8. When all steps complete, suggest `/technical-retro <slug>`.
|
|
98
|
+
9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
|
|
99
|
+
|
|
100
|
+
## Team artifact I/O (Cursor Shell sandbox)
|
|
101
|
+
|
|
102
|
+
- Create/update team task dirs with the **Write** tool (parents are created automatically). Do **not** bootstrap slug dirs with Shell `mkdir -p` — default sandbox returns `Operation not permitted` (worse on macOS Desktop/Documents with TCC).
|
|
103
|
+
- If Shell must touch team paths and fails with EPERM, retry with `required_permissions: ["all"]`. Prefer Write for artifacts.
|
|
104
|
+
- Prefer repo under `~/Projects` / `WebstormProjects` over `~/Desktop` when using agent team heavily.
|
|
105
|
+
|
|
106
|
+
## Invoking agents
|
|
107
|
+
|
|
108
|
+
Use Task tool or `/agent-name`. Pass: slug, artifact paths, step `scope` if set.
|
|
109
|
+
|
|
110
|
+
### Model when invoking (Task)
|
|
111
|
+
|
|
112
|
+
1. Read `steps[i].model` if present; else use the agent’s frontmatter `model` (see `agents/README.md` matrix).
|
|
113
|
+
2. Map abstract tiers:
|
|
114
|
+
- **`cheap`** → pass Task `model: "fast"` when the tool accepts it (or rely on agent `fast`).
|
|
115
|
+
- **`standard`** → omit Task `model` (frontmatter `inherit` / mid default).
|
|
116
|
+
- **`strong`** → **never** pass `fast`; rely on agent pin or parent Max model.
|
|
117
|
+
3. Parallel steps: apply the step-level `model` to **each** agent in the array (or omit → each agent’s own frontmatter).
|
|
118
|
+
|
|
119
|
+
After each agent completes, ensure `status.json` has `state: completed` (or `awaiting_approval` if gate applies).
|
|
120
|
+
|
|
121
|
+
## Legacy mode
|
|
122
|
+
|
|
123
|
+
If `pipeline.json` is missing (old `/feature-start` tasks), fall back to fixed phases: analysis → development → review → testing. Hook supports both.
|
|
124
|
+
|
|
125
|
+
## Skip pipeline when
|
|
126
|
+
|
|
127
|
+
Do **not** run `/task` + router for:
|
|
128
|
+
|
|
129
|
+
- Pure questions («как работает X», «объясни»).
|
|
130
|
+
- Typo / one-file fix / trivial config with no architecture risk.
|
|
131
|
+
- User explicitly says «без pipeline», «просто сделай», or continues an active slug.
|
|
132
|
+
- Single-line `docs-only` with no code impact.
|
|
133
|
+
|
|
134
|
+
Borderline work requests — см. **agent-team-intake**.
|
|
135
|
+
|
|
136
|
+
## Auto-detection (optional)
|
|
137
|
+
|
|
138
|
+
When user describes a **non-trivial task** (not a question), suggest `/task <message>` or run router if they agree.
|
|
139
|
+
|
|
140
|
+
## Preset authoring
|
|
141
|
+
|
|
142
|
+
When the work edits `packages/ai-rules/presets/**` (or dogfood `.cursor/` sync of presets), follow meta-rules: **preset-pr-checklist**, **preset-twin-sync**, **preset-layering**, **preset-token-budget**, **preset-no-cross-stack-leakage**.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Доставка фичи (сквозной порядок)
|
|
2
|
+
|
|
3
|
+
Типичная фича с данными и UI. Конкретные каталоги и rule stems — в **Stack notes** адаптера.
|
|
4
|
+
|
|
5
|
+
## Чеклист (абстрактный порядок)
|
|
6
|
+
|
|
7
|
+
1. **Домен / типы** — сущности и контракты слоя Domain/types; public API слоя.
|
|
8
|
+
2. **Транспорт / DTO** — DTO и мапперы Domain ↔ transport (не протекают в UI).
|
|
9
|
+
3. **Сервисы / Data** — реализации репозиториев / API-сервисов через public клиенты стека.
|
|
10
|
+
4. **Состояние** — store / ViewModel / use cases; без прямого HTTP и без DTO в UI.
|
|
11
|
+
5. **UI** — тонкие views/components; данные через состояние; design-system.
|
|
12
|
+
6. **Тесты** — unit на mappers / нетривиальную логику; e2e/UI по конвенции стека.
|
|
13
|
+
7. **Завершение** — post-change gate стека (lint/build) + package/toolchain rules.
|
|
14
|
+
|
|
15
|
+
## Поток данных (ориентир)
|
|
16
|
+
|
|
17
|
+
```mermaid
|
|
18
|
+
flowchart LR
|
|
19
|
+
DTO[DTO] --> Mappers[Mappers]
|
|
20
|
+
Mappers --> Domain[Domain]
|
|
21
|
+
Domain --> Service[Service / Repo]
|
|
22
|
+
Service --> State[Store / VM]
|
|
23
|
+
State --> UI[UI]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Частичные сценарии
|
|
27
|
+
|
|
28
|
+
| Задача | Минимум |
|
|
29
|
+
|--------|---------|
|
|
30
|
+
| Только API / модель | Domain + DTO + mapper + service/repo; unit на mapper |
|
|
31
|
+
| Только состояние | Протоколы/сервисы; без HTTP в UI |
|
|
32
|
+
| Только UI | Существующее состояние; без DTO |
|
|
33
|
+
| Только тесты | Specs по конвенции; не менять production без нужды |
|
|
34
|
+
|
|
35
|
+
## Антипаттерны (общие)
|
|
36
|
+
|
|
37
|
+
- DTO / transport-типы в UI или presentation state.
|
|
38
|
+
- Низкоуровневый HTTP / конкретный клиент из UI в обход сервиса.
|
|
39
|
+
- Deep-import внутренних файлов другого модуля/фичи.
|
|
40
|
+
- Нарушение границ слоёв ради краткости.
|
|
41
|
+
- **Ubiquitous language:** имена и границы Domain/типов отражают предметную область фичи — не смешивать транспорт/фреймворк-термины в домен без нужды; presentation не диктует словарь модели.
|
|
42
|
+
- При оценке структуры, smells или выбора паттерна — подгружать requestable **`design-guidance`** (не always-on); не копировать каталог в чеклист фичи.
|
|
43
|
+
|
|
44
|
+
## Матрица зона → правила
|
|
45
|
+
|
|
46
|
+
Заполняется в stack adapter: конкретные globs/пути и имена `.mdc` / topic `.md`.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Эталонные фичи (reference features)
|
|
2
|
+
|
|
3
|
+
Перед реализацией найди фичу того же типа и **повтори её структуру**, не изобретая новую организацию файлов.
|
|
4
|
+
|
|
5
|
+
## Таблица эталонов
|
|
6
|
+
|
|
7
|
+
Замени placeholders на **реальные** пути после `ai-rules init` / договорённости команды:
|
|
8
|
+
|
|
9
|
+
| Слой | Эталон | Что копировать |
|
|
10
|
+
|------|--------|----------------|
|
|
11
|
+
| UI / Presentation | **TBD** | компоненты, styles/data helpers, barrel |
|
|
12
|
+
| State / ViewModel | **TBD** | slice/VM, selectors, types |
|
|
13
|
+
| API / Data | **TBD** | service/repo, mappers, barrel |
|
|
14
|
+
| Domain / Types | **TBD** | domain types, public export |
|
|
15
|
+
| Unit tests | **TBD** | `*.spec` / XCTest naming |
|
|
16
|
+
| E2E / UI tests | **TBD** | cases/plans, page objects / accessibility IDs |
|
|
17
|
+
|
|
18
|
+
## Как использовать
|
|
19
|
+
|
|
20
|
+
1. Определи затронутые слои из `decomposition.md` или задачи.
|
|
21
|
+
2. Открой эталон из таблицы (после заполнения путей).
|
|
22
|
+
3. Зеркаль именование, порядок файлов, паттерны импортов и тестов.
|
|
23
|
+
4. Если эталона нет — выбери **самую близкую** существующую фичу того же слоя и зафиксируй выбор в handoff.
|
|
24
|
+
|
|
25
|
+
## Связанные правила
|
|
26
|
+
|
|
27
|
+
- `code-quality-and-refactoring` — повторять паттерны, не deep-import.
|
|
28
|
+
- `feature-delivery-workflow` — порядок слоёв.
|
|
29
|
+
- skill `feature-delivery` — end-to-end сценарий.
|
|
30
|
+
|
|
31
|
+
> Concrete path tables, globs, and dogfood checklists live in the stack adapter **Stack notes**.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Preset layering
|
|
2
|
+
|
|
3
|
+
Правила для **авторов пресетов** (`packages/ai-rules/presets/**`). Не always-on в consumer apps.
|
|
4
|
+
|
|
5
|
+
## Слои
|
|
6
|
+
|
|
7
|
+
| Слой | Где | Что класть |
|
|
8
|
+
|------|-----|------------|
|
|
9
|
+
| **Core** | `presets/_shared/core/**` | Stack-agnostic prose + checklists; без frontmatter; без путей `app/**`, `Features/**`, Playwright, xcodebuild |
|
|
10
|
+
| **Stack** | `presets/{cursor\|claude}/<stack>/` | Domain/tooling, always-on trio стека, stack examples в **Stack notes** |
|
|
11
|
+
| **Platform** | Cursor `.mdc` / Claude `.md` | Frontmatter (`alwaysApply`/`globs` vs `paths:`), platform-only (`BUGBOT.md`, `CLAUDE.md`) |
|
|
12
|
+
|
|
13
|
+
## Куда класть новое правило
|
|
14
|
+
|
|
15
|
+
1. Общие принципы для всех стеков → **core** + адаптеры с `<!-- shared-core: … -->`.
|
|
16
|
+
2. Только один из installable стеков (`next` / `ios-swift` / `go`) → **stack-specific** (не в `_shared`).
|
|
17
|
+
3. Только Cursor или только Claude packaging → platform artifact / frontmatter, не дублировать семантику.
|
|
18
|
+
|
|
19
|
+
## SoT
|
|
20
|
+
|
|
21
|
+
- Packages path — SoT; root `.cursor/` — dogfood sync.
|
|
22
|
+
- Per stack: **Cursor** `presets/cursor/<stack>/` → Claude twin same PR.
|
|
23
|
+
- `_shared` **не** `--preset` и не копируется CLI `init`.
|
|
24
|
+
|
|
25
|
+
См. также: `preset-twin-sync`, `preset-token-budget`, `preset-pr-checklist`, `preset-no-cross-stack-leakage`.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Preset no cross-stack leakage
|
|
2
|
+
|
|
3
|
+
Запрет протекания stack-specific имён, путей и handoff stems между пресетами.
|
|
4
|
+
|
|
5
|
+
## Principles
|
|
6
|
+
|
|
7
|
+
- `next` must not require iOS-only agents/tooling (`xcuitest-*`, `xcodebuild` as required handoff, Keychain-only rules).
|
|
8
|
+
- `ios-swift` must not ship Playwright handoffs or Next lint recipes as required commands.
|
|
9
|
+
- `go` must not ship Playwright, XCUITest, Next lint recipes, or `xcodebuild`/`SwiftLint` as required handoffs.
|
|
10
|
+
- Shared core must not embed stack paths (`app/src/**`, `Features/**`, `playwright`, `xcodebuild`).
|
|
11
|
+
|
|
12
|
+
## Forbidden in ios-swift hooks/agents (FAIL)
|
|
13
|
+
|
|
14
|
+
In ios-swift `chain-team-phases.sh` / agent handoffs (Cursor + Claude):
|
|
15
|
+
|
|
16
|
+
- `playwright-test-`, `playwright-agents`, `playwright-e2e`, `user-playwright`
|
|
17
|
+
- `app/__tests__/e2e` as a required path
|
|
18
|
+
- Positive yarn recipes `lint:js` / `lint:css` as commands to run (negation prose alone is weak — prefer zero occurrences)
|
|
19
|
+
|
|
20
|
+
Required instead: `xcuitest-test-*` stems; build-verifier mentions `xcodebuild` or `post-change-build` / `xcode-tooling`.
|
|
21
|
+
|
|
22
|
+
## Forbidden in next hooks/agents (FAIL when present as required)
|
|
23
|
+
|
|
24
|
+
- `xcuitest-test-` as handoff stems
|
|
25
|
+
- Requiring `xcodebuild` / SwiftLint as the default post-change gate for Next app work
|
|
26
|
+
|
|
27
|
+
## Forbidden in go hooks/agents (FAIL)
|
|
28
|
+
|
|
29
|
+
- `playwright-test-`, `playwright-e2e`, `user-playwright`, `app/__tests__/e2e`
|
|
30
|
+
- Positive yarn recipes `lint:js` / `lint:css`
|
|
31
|
+
- `xcuitest-test-`, `xcodebuild`, `SwiftLint` as required handoffs
|
|
32
|
+
- Agent file `accessibility-reviewer` (no UI surface)
|
|
33
|
+
|
|
34
|
+
Required instead: `integration-test-*`; build-verifier / `post-change-test` / `go-tooling` (`go test`, `go vet`).
|
|
35
|
+
|
|
36
|
+
## Soft / document
|
|
37
|
+
|
|
38
|
+
- Mentioning the other stack in **docs** comparing presets is OK.
|
|
39
|
+
- `build-verifier` may reference other stacks when validating **preset packaging** (`scope: preset-structure-validation`).
|
|
40
|
+
|
|
41
|
+
## Chain fork
|
|
42
|
+
|
|
43
|
+
`hooks/chain-team-phases.sh` must differ **byte-wise** pairwise among `next`, `ios-swift`, and `go` (per platform).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Preset PR checklist
|
|
2
|
+
|
|
3
|
+
Чеклист для PR, затрагивающих `packages/ai-rules/presets/**` (и dogfood `.cursor/` sync).
|
|
4
|
+
|
|
5
|
+
## Before merge
|
|
6
|
+
|
|
7
|
+
- [ ] **SoT:** правки в `packages/…` (не только root `.cursor/`)
|
|
8
|
+
- [ ] **Core:** если менялся `_shared/core/**` — обновлены все `<!-- shared-core: … -->` consumers (или documented intentional fork)
|
|
9
|
+
- [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, ios-swift, and go — см. `preset-twin-sync`)
|
|
10
|
+
- [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table актуален
|
|
11
|
+
- [ ] **Token budget:** alwaysApply / session-start ≤ 3; meta rules not always-on
|
|
12
|
+
- [ ] **Leakage:** нет чужих stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
|
|
13
|
+
- [ ] **Twin depth:** domain ≥15 lines; thin aliases documented
|
|
14
|
+
- [ ] **README:** stack `rules/README.md` core→stack mapping / catalog updated if stems added
|
|
15
|
+
- [ ] **CHANGELOG / package README:** note when public preset paths or install surface change
|
|
16
|
+
- [ ] **Dogfood:** run `packages/ai-rules/scripts/sync-dogfood-cursor.sh` (or document intentional skip) when maintaining this monorepo
|
|
17
|
+
- [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
|
|
18
|
+
|
|
19
|
+
## Pointers
|
|
20
|
+
|
|
21
|
+
- Layering: `preset-layering`
|
|
22
|
+
- Sync: `preset-twin-sync`
|
|
23
|
+
- Budget: `preset-token-budget`
|
|
24
|
+
- Leakage: `preset-no-cross-stack-leakage`
|
|
25
|
+
- Validation: stack `agents/build-verifier.md` → preset-structure section
|
|
26
|
+
- Dogfood script: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`
|
|
27
|
+
- Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
|
|
28
|
+
- Orchestrator: when editing presets, load this checklist + twin-sync
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Preset token budget
|
|
2
|
+
|
|
3
|
+
Инварианты загрузки правил в **установленном** пресете (consumer app).
|
|
4
|
+
|
|
5
|
+
## Hard caps
|
|
6
|
+
|
|
7
|
+
| Platform | Always-on | Cap |
|
|
8
|
+
|----------|-----------|-----|
|
|
9
|
+
| Cursor | `alwaysApply: true` | **≤ 3** |
|
|
10
|
+
| Claude | rules **without** `paths:` | **ровно 3** |
|
|
11
|
+
|
|
12
|
+
**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.
|
|
13
|
+
|
|
14
|
+
Session-start body budget (где задокументировано): ≤120 строк суммарно (stretch ≤100).
|
|
15
|
+
|
|
16
|
+
## Meta / author rules
|
|
17
|
+
|
|
18
|
+
Rules for preset authors (`preset-layering`, `preset-twin-sync`, …):
|
|
19
|
+
|
|
20
|
+
- **Never** `alwaysApply: true` on consumer installs.
|
|
21
|
+
- Cursor: `globs` limited to `packages/ai-rules/presets/**` (and dogfood `.cursor/**` where useful).
|
|
22
|
+
- Claude: `paths:` limited to `packages/ai-rules/presets/**` (and `.claude/**` dogfood if present).
|
|
23
|
+
|
|
24
|
+
## Heavy workflows
|
|
25
|
+
|
|
26
|
+
Orchestrator, feature-delivery, code-review, post-change gates, domain globs — **requestable / paths**, not always-on.
|
|
27
|
+
|
|
28
|
+
## Verifier
|
|
29
|
+
|
|
30
|
+
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,31 @@
|
|
|
1
|
+
# Preset twin sync
|
|
2
|
+
|
|
3
|
+
Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
|
|
4
|
+
|
|
5
|
+
## Matrix
|
|
6
|
+
|
|
7
|
+
| Stack | Cursor SoT | Claude derive | Mapping table |
|
|
8
|
+
|-------|------------|---------------|---------------|
|
|
9
|
+
| `next` | `presets/cursor/next/rules/*.mdc` | `presets/claude/next/rules/<topic>/` | **Required** in `claude/next/rules/README.md` |
|
|
10
|
+
| `ios-swift` | `presets/cursor/ios-swift/rules/*.mdc` | `presets/claude/ios-swift/rules/<topic>/` | Keep in `claude/ios-swift/rules/README.md` |
|
|
11
|
+
| `go` | `presets/cursor/go/rules/*.mdc` | `presets/claude/go/rules/<topic>/` | Keep in `claude/go/rules/README.md` |
|
|
12
|
+
|
|
13
|
+
## Same-PR checklist
|
|
14
|
+
|
|
15
|
+
1. Edit Cursor rule first (body + frontmatter).
|
|
16
|
+
2. Update Claude twin: body + `paths:` (from Cursor `globs:` / requestable triggers); drop `alwaysApply`.
|
|
17
|
+
3. Update mapping table row if stem/path changed.
|
|
18
|
+
4. If body embeds core (`<!-- shared-core: … -->`), sync core consumers across stacks when core changed.
|
|
19
|
+
|
|
20
|
+
## Twin depth
|
|
21
|
+
|
|
22
|
+
- **Domain** rules: ≥15 body lines (FAIL if thin without documented alias reason).
|
|
23
|
+
- **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
|
|
24
|
+
|
|
25
|
+
## Severity (build-verifier)
|
|
26
|
+
|
|
27
|
+
- **next:** missing Claude twin for a changed Cursor rule → **FAIL** (mapping table required).
|
|
28
|
+
- **ios-swift:** missing Claude twin for a changed Cursor rule → **FAIL**.
|
|
29
|
+
- **go:** missing Claude twin for a changed Cursor rule → **FAIL** (same as next / ios-swift; mapping table required).
|
|
30
|
+
|
|
31
|
+
Dogfood: sync packages → root `.cursor/` after Cursor SoT changes (not the reverse). Use `packages/ai-rules/scripts/sync-dogfood-cursor.sh`.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Поддержка существующего стиля
|
|
2
|
+
|
|
3
|
+
- Новые изменения должны:
|
|
4
|
+
- следовать существующим паттернам (имена, структура, типизация / DI / error handling стека);
|
|
5
|
+
- минимизировать «стилистический шум» (лишние правки форматирования, rename без нужды).
|
|
6
|
+
- Перед добавлением нового решения:
|
|
7
|
+
- искать аналогичное в коде и **повторять подход**, а не изобретать новый;
|
|
8
|
+
- проверять, нет ли уже подходящего компонента или паттерна в дизайн‑системе / UI‑пакетах проекта, прежде чем добавлять новый кастомный контрол;
|
|
9
|
+
- использовать при обращении к чужим модулям только их **public API** (barrel / протоколы / facades), а deep‑импорты внутренних файлов рассматривать как повод для рефакторинга.
|
|
10
|
+
|
|
11
|
+
# Принципы
|
|
12
|
+
|
|
13
|
+
- **KISS:** выбирать самое простое изменение, которое совпадает с паттернами репозитория; не изобретать новый стиль «с нуля».
|
|
14
|
+
- **DRY + Rule of Three:** устранять дублирование логики; выносить общее **только после 3-го** повторения — ошибочная абстракция дороже дублирования.
|
|
15
|
+
- **YAGNI:** не добавлять API, флаги, слои и обобщения «на будущее» без текущего требования.
|
|
16
|
+
- **SOLID** (agent-actionable, не эссе):
|
|
17
|
+
- **S** — один модуль / один повод менять; дробить god-файлы в рамках лёгкого refactor.
|
|
18
|
+
- **O** — расширять через композицию/новые реализации, не раздувая существующие ветки «на всякий случай».
|
|
19
|
+
- **L** — подтип не ломает контракт базового типа/протокола.
|
|
20
|
+
- **I** — узкие порты/интерфейсы; не заставлять клиента зависеть от неиспользуемого.
|
|
21
|
+
- **D** — зависеть от абстракций (порты); детали — в адаптерах стека (не дублировать stack boundaries).
|
|
22
|
+
- **CUPID** (компактный блок, Milanov):
|
|
23
|
+
- **Composable** — маленькие части стыкуются без скрытого глобального состояния.
|
|
24
|
+
- **Unix philosophy** — одна чёткая ответственность на единицу; пайплайн простых шагов.
|
|
25
|
+
- **Predictable** — одинаковый вход → одинаковый выход; минимум сюрпризов для вызывающего.
|
|
26
|
+
- **Idiomatic** — следовать идиомам языка и **существующим** конвенциям репо.
|
|
27
|
+
- **Domain-based** — имена и границы отражают предметную область фичи (не транспорт/фреймворк).
|
|
28
|
+
- **Composition over inheritance:** предпочитать композицию / делегирование наследованию иерархий.
|
|
29
|
+
- **Law of Demeter (hint):** не строить цепочки `a.b.c.d`; ходить через public API / facade модуля.
|
|
30
|
+
|
|
31
|
+
# Рефакторинг при изменениях
|
|
32
|
+
|
|
33
|
+
- Разрешён лёгкий refactor, если он:
|
|
34
|
+
- уменьшает дублирование;
|
|
35
|
+
- повышает читаемость;
|
|
36
|
+
- не ломает публичные контракты модулей.
|
|
37
|
+
- Примеры допустимых улучшений (абстрактно):
|
|
38
|
+
- вынести дублирующуюся логику в общую утилиту / хук / mapper / use case;
|
|
39
|
+
- сузить небезопасные типы и unsafe-операции стека;
|
|
40
|
+
- разделить слишком крупный модуль на несколько более простых;
|
|
41
|
+
- заменить локальные «магические» значения на токены/примитивы дизайн‑системы;
|
|
42
|
+
- заменить deep‑импорты внутренних файлов других модулей на обращения к их public API.
|
|
43
|
+
|
|
44
|
+
# Ограничения
|
|
45
|
+
|
|
46
|
+
- Не выполнять «большой» рефакторинг, если задача точечная и не про архитектуру:
|
|
47
|
+
- не менять структуру директорий / модулей / таргетов без нужды;
|
|
48
|
+
- не менять названия публичных типов/функций/API без явного запроса.
|
|
49
|
+
- При необходимости крупного изменения:
|
|
50
|
+
- сначала локально улучшить архитектуру минимальными шагами;
|
|
51
|
+
- оставить код в консистентном (собираемом) состоянии.
|
|
52
|
+
|
|
53
|
+
# Требование к агенту
|
|
54
|
+
|
|
55
|
+
- **Boy scout rule:** оставлять модуль немного лучше, чем до изменения (простые, безопасные улучшения).
|
|
56
|
+
- Не жертвовать архитектурой и слоями ради краткости реализации.
|
|
57
|
+
|
|
58
|
+
> Stack-specific lint gates, примеры и toolchain — в секции **Stack notes** адаптера пресета.
|