@bonesofspring/ai-rules 0.2.19 → 0.2.21
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 +42 -0
- package/README.md +17 -2
- package/bin/cli.js +83 -6
- package/package.json +5 -2
- package/presets/_shared/README.md +4 -3
- package/presets/_shared/assets/docs-specs/INDEX.md +4 -1
- package/presets/_shared/core/agent-team/agent-artifact-contracts.md +13 -0
- package/presets/_shared/core/agent-team/agent-task-metrics.md +1 -1
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +1 -3
- package/presets/_shared/core/agent-team/task-classification.md +21 -0
- package/presets/_shared/core/meta/preset-pr-checklist.md +5 -1
- package/presets/_shared/core/meta/preset-token-budget.md +7 -3
- package/presets/_shared/core/meta/preset-twin-sync.md +2 -0
- package/presets/_shared/core/quality/debug-investigation.md +24 -0
- package/presets/_shared/core/quality/verification-before-completion.md +25 -0
- package/presets/_shared/core/review/receiving-code-review.md +24 -0
- package/presets/_shared/core/testing/testing-principles.md +70 -0
- package/presets/claude/android-kotlin/agents/README.md +2 -1
- package/presets/claude/android-kotlin/agents/build-verifier.md +6 -0
- package/presets/claude/android-kotlin/agents/ci-investigator.md +1 -0
- package/presets/claude/android-kotlin/agents/code-reviewer.md +2 -0
- package/presets/claude/android-kotlin/agents/debugger.md +5 -0
- package/presets/claude/android-kotlin/agents/feature-developer.md +8 -1
- package/presets/claude/android-kotlin/agents/openspec-author.md +163 -0
- package/presets/claude/android-kotlin/agents/task-analyst.md +11 -1
- package/presets/claude/android-kotlin/agents/task-router.md +19 -1
- package/presets/claude/android-kotlin/agents/tech-writer.md +4 -0
- package/presets/claude/android-kotlin/commands/README.md +0 -2
- package/presets/claude/android-kotlin/commands/task-continue.md +1 -1
- package/presets/claude/android-kotlin/commands/task.md +1 -5
- package/presets/claude/android-kotlin/commands/technical-retro.md +2 -2
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +54 -2
- package/presets/claude/android-kotlin/rules/README.md +1 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +7 -4
- package/presets/claude/android-kotlin/rules/tooling-and-review/ai-local-overlay.md +48 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +5 -1
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-token-budget.md +7 -3
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/android-kotlin/skills/code-review/SKILL.md +6 -0
- package/presets/claude/android-kotlin/skills/debug-investigation/SKILL.md +33 -5
- package/presets/claude/go/README.md +1 -1
- package/presets/claude/go/agents/README.md +3 -2
- package/presets/claude/go/agents/build-verifier.md +6 -0
- package/presets/claude/go/agents/ci-investigator.md +1 -0
- package/presets/claude/go/agents/code-reviewer.md +2 -0
- package/presets/claude/go/agents/debugger.md +7 -0
- package/presets/claude/go/agents/feature-developer.md +7 -0
- package/presets/claude/go/agents/openspec-author.md +163 -0
- package/presets/claude/go/agents/task-analyst.md +10 -0
- package/presets/claude/go/agents/task-router.md +19 -1
- package/presets/claude/go/agents/tech-writer.md +4 -0
- package/presets/claude/go/commands/README.md +0 -2
- package/presets/claude/go/commands/task-continue.md +1 -1
- package/presets/claude/go/commands/task.md +1 -4
- package/presets/claude/go/hooks/chain-team-phases.sh +54 -3
- package/presets/claude/go/rules/README.md +1 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
- package/presets/claude/go/rules/tooling-and-review/ai-local-overlay.md +48 -0
- package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +5 -1
- package/presets/claude/go/rules/tooling-and-review/preset-token-budget.md +7 -3
- package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/go/skills/code-review/SKILL.md +6 -0
- package/presets/claude/go/skills/debug-investigation/SKILL.md +32 -4
- package/presets/claude/ios-swift/agents/README.md +3 -2
- package/presets/claude/ios-swift/agents/build-verifier.md +6 -0
- package/presets/claude/ios-swift/agents/ci-investigator.md +1 -0
- package/presets/claude/ios-swift/agents/code-reviewer.md +2 -0
- package/presets/claude/ios-swift/agents/debugger.md +5 -0
- package/presets/claude/ios-swift/agents/feature-developer.md +8 -1
- package/presets/claude/ios-swift/agents/openspec-author.md +163 -0
- package/presets/claude/ios-swift/agents/task-analyst.md +11 -1
- package/presets/claude/ios-swift/agents/task-router.md +19 -1
- package/presets/claude/ios-swift/agents/tech-writer.md +4 -0
- package/presets/claude/ios-swift/commands/README.md +0 -2
- package/presets/claude/ios-swift/commands/task-continue.md +1 -1
- package/presets/claude/ios-swift/commands/task.md +1 -5
- package/presets/claude/ios-swift/commands/technical-retro.md +2 -2
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +54 -2
- package/presets/claude/ios-swift/rules/README.md +1 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +7 -4
- package/presets/claude/ios-swift/rules/tooling-and-review/ai-local-overlay.md +48 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +5 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-token-budget.md +7 -3
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/ios-swift/skills/code-review/SKILL.md +6 -0
- package/presets/claude/ios-swift/skills/debug-investigation/SKILL.md +33 -5
- package/presets/claude/java/CLAUDE.md +1 -1
- package/presets/claude/java/agents/README.md +3 -2
- package/presets/claude/java/agents/build-verifier.md +6 -0
- package/presets/claude/java/agents/ci-investigator.md +1 -0
- package/presets/claude/java/agents/code-reviewer.md +2 -0
- package/presets/claude/java/agents/debugger.md +7 -0
- package/presets/claude/java/agents/feature-developer.md +7 -0
- package/presets/claude/java/agents/openspec-author.md +163 -0
- package/presets/claude/java/agents/task-analyst.md +10 -0
- package/presets/claude/java/agents/task-router.md +19 -1
- package/presets/claude/java/agents/tech-writer.md +4 -0
- package/presets/claude/java/commands/README.md +0 -2
- package/presets/claude/java/commands/task-continue.md +1 -1
- package/presets/claude/java/commands/task.md +1 -4
- package/presets/claude/java/hooks/chain-team-phases.sh +54 -3
- package/presets/claude/java/rules/README.md +1 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
- package/presets/claude/java/rules/tooling-and-review/ai-local-overlay.md +48 -0
- package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +5 -1
- package/presets/claude/java/rules/tooling-and-review/preset-token-budget.md +7 -3
- package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/java/skills/code-review/SKILL.md +6 -0
- package/presets/claude/java/skills/debug-investigation/SKILL.md +32 -4
- package/presets/claude/mcp-ts/agents/build-verifier.md +6 -0
- package/presets/claude/mcp-ts/agents/feature-developer.md +7 -0
- package/presets/claude/mcp-ts/agents/task-analyst.md +11 -1
- package/presets/claude/mcp-ts/agents/task-router.md +14 -0
- package/presets/claude/mcp-ts/commands/README.md +0 -2
- package/presets/claude/mcp-ts/commands/task-continue.md +1 -1
- package/presets/claude/mcp-ts/commands/task.md +1 -4
- package/presets/claude/mcp-ts/commands/technical-retro.md +2 -2
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +40 -9
- package/presets/claude/mcp-ts/rules/README.md +1 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
- package/presets/claude/mcp-ts/rules/tooling-and-review/ai-local-overlay.md +48 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +5 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-token-budget.md +7 -3
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/mcp-ts/skills/code-review/SKILL.md +6 -0
- package/presets/claude/mcp-ts/skills/debug-investigation/SKILL.md +31 -3
- package/presets/claude/next/README.md +1 -0
- package/presets/claude/next/agents/README.md +2 -2
- package/presets/claude/next/agents/build-verifier.md +17 -1
- package/presets/claude/next/agents/ci-investigator.md +1 -0
- package/presets/claude/next/agents/code-reviewer.md +2 -0
- package/presets/claude/next/agents/debugger.md +5 -0
- package/presets/claude/next/agents/feature-developer.md +8 -1
- package/presets/claude/next/agents/openspec-author.md +163 -0
- package/presets/claude/next/agents/task-analyst.md +12 -2
- package/presets/claude/next/agents/task-router.md +19 -1
- package/presets/claude/next/agents/tech-writer.md +4 -0
- package/presets/claude/next/commands/README.md +0 -2
- package/presets/claude/next/commands/task-continue.md +1 -1
- package/presets/claude/next/commands/task.md +1 -4
- package/presets/claude/next/hooks/chain-team-phases.sh +54 -2
- package/presets/claude/next/rules/README.md +1 -0
- package/presets/claude/next/rules/testing/README.md +6 -0
- package/presets/claude/next/rules/testing/tests-e2e-structure.md +84 -48
- package/presets/claude/next/rules/testing/tests-unit.md +79 -50
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +3 -4
- package/presets/claude/next/rules/tooling-and-review/ai-local-overlay.md +48 -0
- package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +5 -1
- package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +7 -3
- package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/next/skills/code-review/SKILL.md +6 -0
- package/presets/claude/next/skills/debug-investigation/SKILL.md +29 -14
- package/presets/claude/next/team/README.md +0 -3
- package/presets/claude/nuxt/agents/README.md +1 -1
- package/presets/claude/nuxt/agents/build-verifier.md +6 -0
- package/presets/claude/nuxt/agents/ci-investigator.md +1 -0
- package/presets/claude/nuxt/agents/code-reviewer.md +2 -0
- package/presets/claude/nuxt/agents/debugger.md +5 -0
- package/presets/claude/nuxt/agents/feature-developer.md +8 -1
- package/presets/claude/nuxt/agents/openspec-author.md +163 -0
- package/presets/claude/nuxt/agents/task-analyst.md +12 -2
- package/presets/claude/nuxt/agents/task-router.md +19 -1
- package/presets/claude/nuxt/agents/tech-writer.md +4 -0
- package/presets/claude/nuxt/commands/README.md +0 -2
- package/presets/claude/nuxt/commands/task-continue.md +1 -1
- package/presets/claude/nuxt/commands/task.md +1 -5
- package/presets/claude/nuxt/commands/technical-retro.md +2 -2
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +54 -2
- package/presets/claude/nuxt/rules/README.md +1 -0
- package/presets/claude/nuxt/rules/testing/README.md +6 -0
- package/presets/claude/nuxt/rules/testing/tests-e2e-structure.md +86 -43
- package/presets/claude/nuxt/rules/testing/tests-unit.md +58 -45
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +8 -5
- package/presets/claude/nuxt/rules/tooling-and-review/ai-local-overlay.md +48 -0
- package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +5 -1
- package/presets/claude/nuxt/rules/tooling-and-review/preset-token-budget.md +7 -3
- package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/nuxt/skills/code-review/SKILL.md +6 -0
- package/presets/claude/nuxt/skills/debug-investigation/SKILL.md +29 -12
- package/presets/claude/nuxt/team/README.md +0 -3
- package/presets/claude/php-hexagonal/CLAUDE.md +1 -1
- package/presets/claude/php-hexagonal/agents/README.md +3 -2
- package/presets/claude/php-hexagonal/agents/build-verifier.md +6 -0
- package/presets/claude/php-hexagonal/agents/ci-investigator.md +1 -0
- package/presets/claude/php-hexagonal/agents/code-reviewer.md +2 -0
- package/presets/claude/php-hexagonal/agents/debugger.md +7 -0
- package/presets/claude/php-hexagonal/agents/feature-developer.md +7 -0
- package/presets/claude/php-hexagonal/agents/openspec-author.md +163 -0
- package/presets/claude/php-hexagonal/agents/task-analyst.md +10 -0
- package/presets/claude/php-hexagonal/agents/task-router.md +19 -1
- package/presets/claude/php-hexagonal/agents/tech-writer.md +4 -0
- package/presets/claude/php-hexagonal/commands/README.md +0 -2
- package/presets/claude/php-hexagonal/commands/task-continue.md +1 -1
- package/presets/claude/php-hexagonal/commands/task.md +1 -4
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +54 -3
- package/presets/claude/php-hexagonal/rules/README.md +1 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
- package/presets/claude/php-hexagonal/rules/tooling-and-review/ai-local-overlay.md +48 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +5 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-token-budget.md +7 -3
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/php-hexagonal/skills/code-review/SKILL.md +6 -0
- package/presets/claude/php-hexagonal/skills/debug-investigation/SKILL.md +32 -4
- package/presets/claude/php-laravel/agents/README.md +3 -2
- package/presets/claude/php-laravel/agents/build-verifier.md +6 -0
- package/presets/claude/php-laravel/agents/ci-investigator.md +1 -0
- package/presets/claude/php-laravel/agents/code-reviewer.md +2 -0
- package/presets/claude/php-laravel/agents/debugger.md +7 -0
- package/presets/claude/php-laravel/agents/feature-developer.md +7 -0
- package/presets/claude/php-laravel/agents/openspec-author.md +163 -0
- package/presets/claude/php-laravel/agents/task-analyst.md +10 -0
- package/presets/claude/php-laravel/agents/task-router.md +19 -1
- package/presets/claude/php-laravel/agents/tech-writer.md +4 -0
- package/presets/claude/php-laravel/commands/README.md +0 -2
- package/presets/claude/php-laravel/commands/task-continue.md +1 -1
- package/presets/claude/php-laravel/commands/task.md +1 -4
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +54 -3
- package/presets/claude/php-laravel/rules/README.md +1 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
- package/presets/claude/php-laravel/rules/tooling-and-review/ai-local-overlay.md +48 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +5 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-token-budget.md +7 -3
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/php-laravel/skills/code-review/SKILL.md +6 -0
- package/presets/claude/php-laravel/skills/debug-investigation/SKILL.md +32 -4
- package/presets/claude/svelte/agents/README.md +1 -1
- package/presets/claude/svelte/agents/build-verifier.md +6 -0
- package/presets/claude/svelte/agents/ci-investigator.md +1 -0
- package/presets/claude/svelte/agents/code-reviewer.md +2 -0
- package/presets/claude/svelte/agents/debugger.md +5 -0
- package/presets/claude/svelte/agents/feature-developer.md +8 -1
- package/presets/claude/svelte/agents/openspec-author.md +163 -0
- package/presets/claude/svelte/agents/task-analyst.md +12 -2
- package/presets/claude/svelte/agents/task-router.md +19 -1
- package/presets/claude/svelte/agents/tech-writer.md +4 -0
- package/presets/claude/svelte/commands/README.md +0 -2
- package/presets/claude/svelte/commands/task-continue.md +1 -1
- package/presets/claude/svelte/commands/task.md +1 -5
- package/presets/claude/svelte/commands/technical-retro.md +2 -2
- package/presets/claude/svelte/hooks/chain-team-phases.sh +54 -2
- package/presets/claude/svelte/rules/README.md +1 -0
- package/presets/claude/svelte/rules/testing/README.md +6 -0
- package/presets/claude/svelte/rules/testing/tests-e2e-structure.md +87 -45
- package/presets/claude/svelte/rules/testing/tests-unit.md +70 -23
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +8 -5
- package/presets/claude/svelte/rules/tooling-and-review/ai-local-overlay.md +48 -0
- package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +5 -1
- package/presets/claude/svelte/rules/tooling-and-review/preset-token-budget.md +7 -3
- package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +2 -0
- package/presets/claude/svelte/skills/code-review/SKILL.md +6 -0
- package/presets/claude/svelte/skills/debug-investigation/SKILL.md +29 -12
- package/presets/claude/svelte/team/README.md +0 -3
- package/presets/cursor/android-kotlin/agents/README.md +2 -1
- package/presets/cursor/android-kotlin/agents/build-verifier.md +6 -0
- package/presets/cursor/android-kotlin/agents/ci-investigator.md +1 -0
- package/presets/cursor/android-kotlin/agents/code-reviewer.md +2 -0
- package/presets/cursor/android-kotlin/agents/debugger.md +5 -0
- package/presets/cursor/android-kotlin/agents/feature-developer.md +8 -1
- package/presets/cursor/android-kotlin/agents/openspec-author.md +164 -0
- package/presets/cursor/android-kotlin/agents/task-analyst.md +11 -1
- package/presets/cursor/android-kotlin/agents/task-router.md +19 -1
- package/presets/cursor/android-kotlin/agents/tech-writer.md +4 -0
- package/presets/cursor/android-kotlin/commands/README.md +0 -2
- package/presets/cursor/android-kotlin/commands/task-continue.md +1 -1
- package/presets/cursor/android-kotlin/commands/task.md +1 -5
- package/presets/cursor/android-kotlin/commands/technical-retro.md +2 -2
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +54 -2
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +7 -4
- package/presets/cursor/android-kotlin/rules/ai-local-overlay.mdc +43 -0
- package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +5 -1
- package/presets/cursor/android-kotlin/rules/preset-token-budget.mdc +7 -3
- package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/android-kotlin/skills/code-review/SKILL.md +6 -0
- package/presets/cursor/android-kotlin/skills/debug-investigation/SKILL.md +33 -5
- package/presets/cursor/go/README.md +6 -6
- package/presets/cursor/go/agents/README.md +3 -2
- package/presets/cursor/go/agents/build-verifier.md +6 -0
- package/presets/cursor/go/agents/ci-investigator.md +1 -0
- package/presets/cursor/go/agents/code-reviewer.md +2 -0
- package/presets/cursor/go/agents/debugger.md +7 -0
- package/presets/cursor/go/agents/feature-developer.md +7 -0
- package/presets/cursor/go/agents/openspec-author.md +164 -0
- package/presets/cursor/go/agents/task-analyst.md +10 -0
- package/presets/cursor/go/agents/task-router.md +19 -1
- package/presets/cursor/go/agents/tech-writer.md +4 -0
- package/presets/cursor/go/commands/README.md +0 -2
- package/presets/cursor/go/commands/task-continue.md +1 -1
- package/presets/cursor/go/commands/task.md +1 -4
- package/presets/cursor/go/commands/technical-retro.md +2 -2
- package/presets/cursor/go/hooks/chain-team-phases.sh +54 -3
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +2 -4
- package/presets/cursor/go/rules/ai-local-overlay.mdc +43 -0
- package/presets/cursor/go/rules/preset-pr-checklist.mdc +5 -1
- package/presets/cursor/go/rules/preset-token-budget.mdc +7 -3
- package/presets/cursor/go/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/go/skills/code-review/SKILL.md +6 -0
- package/presets/cursor/go/skills/debug-investigation/SKILL.md +32 -4
- package/presets/cursor/ios-swift/README.md +6 -6
- package/presets/cursor/ios-swift/agents/README.md +3 -2
- package/presets/cursor/ios-swift/agents/build-verifier.md +6 -0
- package/presets/cursor/ios-swift/agents/ci-investigator.md +1 -0
- package/presets/cursor/ios-swift/agents/code-reviewer.md +2 -0
- package/presets/cursor/ios-swift/agents/debugger.md +5 -0
- package/presets/cursor/ios-swift/agents/feature-developer.md +8 -1
- package/presets/cursor/ios-swift/agents/openspec-author.md +164 -0
- package/presets/cursor/ios-swift/agents/task-analyst.md +11 -1
- package/presets/cursor/ios-swift/agents/task-router.md +19 -1
- package/presets/cursor/ios-swift/agents/tech-writer.md +4 -0
- package/presets/cursor/ios-swift/commands/README.md +1 -3
- package/presets/cursor/ios-swift/commands/task-continue.md +1 -1
- package/presets/cursor/ios-swift/commands/task.md +1 -5
- package/presets/cursor/ios-swift/commands/technical-retro.md +2 -2
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +54 -2
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +7 -4
- package/presets/cursor/ios-swift/rules/ai-local-overlay.mdc +43 -0
- package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +5 -1
- package/presets/cursor/ios-swift/rules/preset-token-budget.mdc +7 -3
- package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/ios-swift/skills/code-review/SKILL.md +6 -0
- package/presets/cursor/ios-swift/skills/debug-investigation/SKILL.md +33 -5
- package/presets/cursor/java/AGENTS.md +1 -1
- package/presets/cursor/java/agents/README.md +3 -2
- package/presets/cursor/java/agents/build-verifier.md +6 -0
- package/presets/cursor/java/agents/ci-investigator.md +1 -0
- package/presets/cursor/java/agents/code-reviewer.md +2 -0
- package/presets/cursor/java/agents/debugger.md +7 -0
- package/presets/cursor/java/agents/feature-developer.md +7 -0
- package/presets/cursor/java/agents/openspec-author.md +164 -0
- package/presets/cursor/java/agents/task-analyst.md +10 -0
- package/presets/cursor/java/agents/task-router.md +19 -1
- package/presets/cursor/java/agents/tech-writer.md +4 -0
- package/presets/cursor/java/commands/README.md +0 -2
- package/presets/cursor/java/commands/task-continue.md +1 -1
- package/presets/cursor/java/commands/task.md +1 -4
- package/presets/cursor/java/commands/technical-retro.md +2 -2
- package/presets/cursor/java/hooks/chain-team-phases.sh +54 -3
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +2 -4
- package/presets/cursor/java/rules/ai-local-overlay.mdc +43 -0
- package/presets/cursor/java/rules/preset-pr-checklist.mdc +5 -1
- package/presets/cursor/java/rules/preset-token-budget.mdc +7 -3
- package/presets/cursor/java/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/java/skills/code-review/SKILL.md +6 -0
- package/presets/cursor/java/skills/debug-investigation/SKILL.md +32 -4
- package/presets/cursor/mcp-ts/agents/build-verifier.md +6 -0
- package/presets/cursor/mcp-ts/agents/feature-developer.md +7 -0
- package/presets/cursor/mcp-ts/agents/task-analyst.md +11 -1
- package/presets/cursor/mcp-ts/agents/task-router.md +14 -0
- package/presets/cursor/mcp-ts/commands/README.md +0 -2
- package/presets/cursor/mcp-ts/commands/task-continue.md +1 -1
- package/presets/cursor/mcp-ts/commands/task.md +1 -4
- package/presets/cursor/mcp-ts/commands/technical-retro.md +2 -2
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +40 -9
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +2 -4
- package/presets/cursor/mcp-ts/rules/ai-local-overlay.mdc +43 -0
- package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +5 -1
- package/presets/cursor/mcp-ts/rules/preset-token-budget.mdc +7 -3
- package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/mcp-ts/skills/code-review/SKILL.md +6 -0
- package/presets/cursor/mcp-ts/skills/debug-investigation/SKILL.md +31 -3
- package/presets/cursor/next/README.md +8 -6
- package/presets/cursor/next/REPO_AGENTS.md +8 -0
- package/presets/cursor/next/agents/README.md +2 -2
- package/presets/cursor/next/agents/build-verifier.md +17 -1
- package/presets/cursor/next/agents/ci-investigator.md +1 -0
- package/presets/cursor/next/agents/code-reviewer.md +2 -0
- package/presets/cursor/next/agents/debugger.md +5 -0
- package/presets/cursor/next/agents/feature-developer.md +8 -1
- package/presets/cursor/next/agents/openspec-author.md +164 -0
- package/presets/cursor/next/agents/task-analyst.md +12 -2
- package/presets/cursor/next/agents/task-router.md +19 -1
- package/presets/cursor/next/agents/tech-writer.md +4 -0
- package/presets/cursor/next/commands/README.md +0 -2
- package/presets/cursor/next/commands/task-continue.md +1 -1
- package/presets/cursor/next/commands/task.md +1 -4
- package/presets/cursor/next/commands/technical-retro.md +2 -2
- package/presets/cursor/next/hooks/chain-team-phases.sh +54 -2
- package/presets/cursor/next/rules/README.md +6 -3
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +7 -5
- package/presets/cursor/next/rules/ai-local-overlay.mdc +43 -0
- package/presets/cursor/next/rules/preset-pr-checklist.mdc +5 -1
- package/presets/cursor/next/rules/preset-token-budget.mdc +7 -3
- package/presets/cursor/next/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/next/rules/tests-e2e-structure.mdc +83 -43
- package/presets/cursor/next/rules/tests-unit.mdc +78 -45
- package/presets/cursor/next/skills/code-review/SKILL.md +6 -0
- package/presets/cursor/next/skills/debug-investigation/SKILL.md +29 -14
- package/presets/cursor/next/team/README.md +0 -3
- package/presets/cursor/nuxt/README.md +6 -6
- package/presets/cursor/nuxt/agents/README.md +1 -1
- package/presets/cursor/nuxt/agents/build-verifier.md +6 -0
- package/presets/cursor/nuxt/agents/ci-investigator.md +1 -0
- package/presets/cursor/nuxt/agents/code-reviewer.md +2 -0
- package/presets/cursor/nuxt/agents/debugger.md +5 -0
- package/presets/cursor/nuxt/agents/feature-developer.md +8 -1
- package/presets/cursor/nuxt/agents/openspec-author.md +164 -0
- package/presets/cursor/nuxt/agents/task-analyst.md +12 -2
- package/presets/cursor/nuxt/agents/task-router.md +19 -1
- package/presets/cursor/nuxt/agents/tech-writer.md +4 -0
- package/presets/cursor/nuxt/commands/README.md +0 -2
- package/presets/cursor/nuxt/commands/task-continue.md +1 -1
- package/presets/cursor/nuxt/commands/task.md +1 -5
- package/presets/cursor/nuxt/commands/technical-retro.md +2 -2
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +54 -2
- package/presets/cursor/nuxt/rules/README.md +3 -1
- package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +8 -5
- package/presets/cursor/nuxt/rules/ai-local-overlay.mdc +43 -0
- package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +5 -1
- package/presets/cursor/nuxt/rules/preset-token-budget.mdc +7 -3
- package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/nuxt/rules/tests-e2e-structure.mdc +87 -43
- package/presets/cursor/nuxt/rules/tests-unit.mdc +62 -47
- package/presets/cursor/nuxt/skills/code-review/SKILL.md +6 -0
- package/presets/cursor/nuxt/skills/debug-investigation/SKILL.md +29 -12
- package/presets/cursor/nuxt/team/README.md +0 -3
- package/presets/cursor/php-hexagonal/AGENTS.md +1 -1
- package/presets/cursor/php-hexagonal/agents/README.md +3 -2
- package/presets/cursor/php-hexagonal/agents/build-verifier.md +6 -0
- package/presets/cursor/php-hexagonal/agents/ci-investigator.md +1 -0
- package/presets/cursor/php-hexagonal/agents/code-reviewer.md +2 -0
- package/presets/cursor/php-hexagonal/agents/debugger.md +7 -0
- package/presets/cursor/php-hexagonal/agents/feature-developer.md +7 -0
- package/presets/cursor/php-hexagonal/agents/openspec-author.md +164 -0
- package/presets/cursor/php-hexagonal/agents/task-analyst.md +10 -0
- package/presets/cursor/php-hexagonal/agents/task-router.md +19 -1
- package/presets/cursor/php-hexagonal/agents/tech-writer.md +4 -0
- package/presets/cursor/php-hexagonal/commands/README.md +0 -2
- package/presets/cursor/php-hexagonal/commands/task-continue.md +1 -1
- package/presets/cursor/php-hexagonal/commands/task.md +1 -4
- package/presets/cursor/php-hexagonal/commands/technical-retro.md +2 -2
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +54 -3
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +2 -4
- package/presets/cursor/php-hexagonal/rules/ai-local-overlay.mdc +43 -0
- package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +5 -1
- package/presets/cursor/php-hexagonal/rules/preset-token-budget.mdc +7 -3
- package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/php-hexagonal/skills/code-review/SKILL.md +6 -0
- package/presets/cursor/php-hexagonal/skills/debug-investigation/SKILL.md +32 -4
- package/presets/cursor/php-laravel/AGENTS.md +1 -1
- package/presets/cursor/php-laravel/agents/README.md +3 -2
- package/presets/cursor/php-laravel/agents/build-verifier.md +6 -0
- package/presets/cursor/php-laravel/agents/ci-investigator.md +1 -0
- package/presets/cursor/php-laravel/agents/code-reviewer.md +2 -0
- package/presets/cursor/php-laravel/agents/debugger.md +7 -0
- package/presets/cursor/php-laravel/agents/feature-developer.md +7 -0
- package/presets/cursor/php-laravel/agents/openspec-author.md +164 -0
- package/presets/cursor/php-laravel/agents/task-analyst.md +10 -0
- package/presets/cursor/php-laravel/agents/task-router.md +19 -1
- package/presets/cursor/php-laravel/agents/tech-writer.md +4 -0
- package/presets/cursor/php-laravel/commands/README.md +0 -2
- package/presets/cursor/php-laravel/commands/task-continue.md +1 -1
- package/presets/cursor/php-laravel/commands/task.md +1 -4
- package/presets/cursor/php-laravel/commands/technical-retro.md +2 -2
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +54 -3
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +2 -4
- package/presets/cursor/php-laravel/rules/ai-local-overlay.mdc +43 -0
- package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +5 -1
- package/presets/cursor/php-laravel/rules/preset-token-budget.mdc +7 -3
- package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/php-laravel/skills/code-review/SKILL.md +6 -0
- package/presets/cursor/php-laravel/skills/debug-investigation/SKILL.md +32 -4
- package/presets/cursor/svelte/README.md +6 -6
- package/presets/cursor/svelte/agents/README.md +1 -1
- package/presets/cursor/svelte/agents/build-verifier.md +6 -0
- package/presets/cursor/svelte/agents/ci-investigator.md +1 -0
- package/presets/cursor/svelte/agents/code-reviewer.md +2 -0
- package/presets/cursor/svelte/agents/debugger.md +5 -0
- package/presets/cursor/svelte/agents/feature-developer.md +8 -1
- package/presets/cursor/svelte/agents/openspec-author.md +164 -0
- package/presets/cursor/svelte/agents/task-analyst.md +12 -2
- package/presets/cursor/svelte/agents/task-router.md +19 -1
- package/presets/cursor/svelte/agents/tech-writer.md +4 -0
- package/presets/cursor/svelte/commands/README.md +0 -2
- package/presets/cursor/svelte/commands/task-continue.md +1 -1
- package/presets/cursor/svelte/commands/task.md +1 -5
- package/presets/cursor/svelte/commands/technical-retro.md +2 -2
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +54 -2
- package/presets/cursor/svelte/rules/README.md +3 -1
- package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +8 -5
- package/presets/cursor/svelte/rules/ai-local-overlay.mdc +43 -0
- package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +5 -1
- package/presets/cursor/svelte/rules/preset-token-budget.mdc +7 -3
- package/presets/cursor/svelte/rules/preset-twin-sync.mdc +2 -0
- package/presets/cursor/svelte/rules/tests-e2e-structure.mdc +87 -43
- package/presets/cursor/svelte/rules/tests-unit.mdc +72 -23
- package/presets/cursor/svelte/skills/code-review/SKILL.md +6 -0
- package/presets/cursor/svelte/skills/debug-investigation/SKILL.md +29 -12
- package/presets/cursor/svelte/team/README.md +0 -3
- package/scripts/_lib/embed-stems.json +31 -0
- package/scripts/aggregate-agent-task-metrics.mjs +23 -0
- package/scripts/check-chain-hook-coverage.sh +109 -0
- package/scripts/check-local-overlay.sh +136 -0
- package/scripts/check-preset-i18n.sh +2 -2
- package/scripts/check-preset-leakage.sh +4 -1
- package/scripts/check-preset-structure.sh +21 -1
- package/scripts/check-preset-token-budget.sh +20 -10
- package/scripts/check-rule-eval.mjs +16 -0
- package/scripts/check-shared-core-drift.sh +10 -26
- package/scripts/close-agent-task-human-gate.mjs +22 -5
- package/scripts/sync-shared-core-embeds.sh +9 -20
- package/scripts/test-agent-task-metrics-hooks.mjs +1 -1
- package/scripts/test-chain-team-phases-coverage.mjs +411 -0
- package/presets/claude/android-kotlin/commands/feature-continue.md +0 -23
- package/presets/claude/android-kotlin/commands/feature-start.md +0 -41
- package/presets/claude/go/commands/feature-continue.md +0 -23
- package/presets/claude/go/commands/feature-start.md +0 -38
- package/presets/claude/ios-swift/commands/feature-continue.md +0 -23
- package/presets/claude/ios-swift/commands/feature-start.md +0 -41
- package/presets/claude/java/commands/feature-continue.md +0 -23
- package/presets/claude/java/commands/feature-start.md +0 -38
- package/presets/claude/mcp-ts/commands/feature-continue.md +0 -23
- package/presets/claude/mcp-ts/commands/feature-start.md +0 -41
- package/presets/claude/next/commands/feature-continue.md +0 -23
- package/presets/claude/next/commands/feature-start.md +0 -38
- package/presets/claude/nuxt/commands/feature-continue.md +0 -23
- package/presets/claude/nuxt/commands/feature-start.md +0 -41
- package/presets/claude/php-hexagonal/commands/feature-continue.md +0 -23
- package/presets/claude/php-hexagonal/commands/feature-start.md +0 -38
- package/presets/claude/php-laravel/commands/feature-continue.md +0 -23
- package/presets/claude/php-laravel/commands/feature-start.md +0 -38
- package/presets/claude/svelte/commands/feature-continue.md +0 -23
- package/presets/claude/svelte/commands/feature-start.md +0 -41
- package/presets/cursor/android-kotlin/commands/feature-continue.md +0 -23
- package/presets/cursor/android-kotlin/commands/feature-start.md +0 -41
- package/presets/cursor/go/commands/feature-continue.md +0 -23
- package/presets/cursor/go/commands/feature-start.md +0 -41
- package/presets/cursor/ios-swift/commands/feature-continue.md +0 -23
- package/presets/cursor/ios-swift/commands/feature-start.md +0 -41
- package/presets/cursor/java/commands/feature-continue.md +0 -23
- package/presets/cursor/java/commands/feature-start.md +0 -41
- package/presets/cursor/mcp-ts/commands/feature-continue.md +0 -23
- package/presets/cursor/mcp-ts/commands/feature-start.md +0 -41
- package/presets/cursor/next/commands/feature-continue.md +0 -23
- package/presets/cursor/next/commands/feature-start.md +0 -41
- package/presets/cursor/nuxt/commands/feature-continue.md +0 -23
- package/presets/cursor/nuxt/commands/feature-start.md +0 -41
- package/presets/cursor/php-hexagonal/commands/feature-continue.md +0 -23
- package/presets/cursor/php-hexagonal/commands/feature-start.md +0 -41
- package/presets/cursor/php-laravel/commands/feature-continue.md +0 -23
- package/presets/cursor/php-laravel/commands/feature-start.md +0 -41
- package/presets/cursor/svelte/commands/feature-continue.md +0 -23
- package/presets/cursor/svelte/commands/feature-start.md +0 -41
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Orchestrates the agent team via task-router and pipeline.json. Use for /task, /task-continue,
|
|
2
|
+
description: Orchestrates the agent team via task-router and pipeline.json. Use for /task, /task-continue, task decomposition, or when the user describes a feature, bug, or review request.
|
|
3
3
|
alwaysApply: false
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -17,8 +17,6 @@ Work request without `/task` — see **`agent-team-intake.mdc`** (when to sugges
|
|
|
17
17
|
|---------|------|
|
|
18
18
|
| **`/task <desc>`** | **Preferred** — router → dynamic pipeline → first agent |
|
|
19
19
|
| `/task-continue <slug>` | After human gate or pause |
|
|
20
|
-
| `/feature-start <desc>` | Legacy: analyst-only start (no router) |
|
|
21
|
-
| `/feature-continue <slug>` | Alias of task-continue |
|
|
22
20
|
| `/spec-start [desc]` | Generate/bootstrap `docs/specs` — router intent `spec-gen` → analyst author mode → human gate |
|
|
23
21
|
| `/technical-retro [slug]` | Retro with agent team block |
|
|
24
22
|
|
|
@@ -50,6 +48,7 @@ Work request without `/task` — see **`agent-team-intake.mdc`** (when to sugges
|
|
|
50
48
|
| `playwright-test-generator` | e2e tests | e2e spec generation |
|
|
51
49
|
| `playwright-test-healer` | e2e fixes | failing/flaky e2e fixes |
|
|
52
50
|
| `tech-writer` | docs / team | docs-only, feature/migration docs |
|
|
51
|
+
| `openspec-author` | `openspec/**` only | openspec-change (`/opsx:propose`, `/opsx:apply`, `/opsx:archive`, openspec refresh) |
|
|
53
52
|
|
|
54
53
|
**Cursor frontmatter:** all team pipeline agents use `readonly: false` so they can write `.cursor/team/**`. Production/app restrictions live in the agent prompt body — do **not** set `readonly: true` (Cursor blocks *all* file writes, including team artifacts).
|
|
55
54
|
|
|
@@ -57,7 +56,7 @@ Full prompts: `.cursor/agents/*.md`. Artifact conventions: `.cursor/team/README.
|
|
|
57
56
|
|
|
58
57
|
**Behavioral UX:** `task-analyst` loads requestable skill `ux-design` for standalone intent `ux-design` and embedded required-signal / advisory UI AC. No `ux-designer` agent in v1.
|
|
59
58
|
|
|
60
|
-
**Product specs:** When `/task
|
|
59
|
+
**Product specs:** When `/task` or `/spec-start` touches pages/features/`docs/specs`: if INDEX exists and no generate intent → instruct next agent to load requestable **`product-specs`** (consume; soft-fail; never invent). If generate/bootstrap/`spec-gen` → load **`product-specs-authoring`** + skill **`spec-authoring`** inside **task-analyst** (not a separate pipeline step); pass created spec paths + INDEX diff in handoff; human gate must approve before feature-developer. No-op if INDEX absent and no author intent.
|
|
61
60
|
|
|
62
61
|
When editing `packages/ai-rules/presets/**`, follow **`preset-pr-checklist.mdc`** (+ twin-sync / layering / token-budget / leakage meta-rules).
|
|
63
62
|
|
|
@@ -180,7 +179,7 @@ After each agent completes, verify its terminal manifest receipt, then let the o
|
|
|
180
179
|
|
|
181
180
|
## Legacy mode
|
|
182
181
|
|
|
183
|
-
If `pipeline.json` is missing
|
|
182
|
+
If `pipeline.json` is missing, fall back to fixed phases: analysis → development → review → testing. Hook supports both.
|
|
184
183
|
|
|
185
184
|
## Skip pipeline when
|
|
186
185
|
|
|
@@ -196,3 +195,7 @@ Borderline work requests — see **`agent-team-intake.mdc`**.
|
|
|
196
195
|
## Auto-detection (optional)
|
|
197
196
|
|
|
198
197
|
When user describes a **non-trivial task** (not a question), suggest `/task <message>` or run router if they agree.
|
|
198
|
+
|
|
199
|
+
## Preset authoring
|
|
200
|
+
|
|
201
|
+
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,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Local overlay from .ai.local/ (consumer-owned rules with priority over preset rules) — MANDATORY
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
impact: CRITICAL
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Local overlay (`.ai.local/`) — MANDATORY
|
|
8
|
+
|
|
9
|
+
This rule is mandatory. **You MUST** obey it on every turn, without exception.
|
|
10
|
+
|
|
11
|
+
## On every turn
|
|
12
|
+
|
|
13
|
+
1. **Probe** — before answering, run `ls -la .ai.local` from the repository root.
|
|
14
|
+
2. **Walk** — if `.ai.local/` exists at multiple levels (monorepo), read every level from root to leaf. **Deeper wins** in practice: more specific rules appear later in the assembled context and take precedence.
|
|
15
|
+
3. **Apply** — treat every `.ai.local/rules/*.md` and `.ai.local/conventions.md` as a higher-priority rule for this repo. The block below ("Authoring `.ai.local/rules/*.md`") defines the conventions.
|
|
16
|
+
4. **Conflict** — if a local rule conflicts with a preset rule, **the local rule wins**. If a local rule body contains `override: kill <preset-rule-name>`, drop that preset rule from your context window entirely.
|
|
17
|
+
5. **Acknowledge** — when answering a user question, briefly state which `.ai.local/` rules apply to the current task (one line is enough). Format: `Using .ai.local: <rule-name>(, <rule-name>)*`. If no `.ai.local/` exists, do NOT mention this rule.
|
|
18
|
+
|
|
19
|
+
If `.ai.local/` does not exist → **no-op**, do not error. Do not produce any log line about its absence.
|
|
20
|
+
|
|
21
|
+
## Authoring `.ai.local/rules/*.md` (consumer-side reference)
|
|
22
|
+
|
|
23
|
+
Each `.ai.local/rules/<name>.md` is a plain-markdown rule body. The model parses it as:
|
|
24
|
+
|
|
25
|
+
- Lines before `## Body` are scope metadata. Only `glob:` / `globs:` / `override:` lines are recognised.
|
|
26
|
+
- Everything from `## Body` onward is the rule body.
|
|
27
|
+
- `glob: always` → always-on. Counts against your context budget.
|
|
28
|
+
- `globs: <comma-separated globs>` → on-demand; applies only when matching files are in focus.
|
|
29
|
+
- `override: kill <preset-rule-name>` → drop that preset rule from context.
|
|
30
|
+
|
|
31
|
+
Keep files ≤ 120 lines. Match the style of preset rules (short sections, bullets, code examples).
|
|
32
|
+
|
|
33
|
+
## Limitations (read this)
|
|
34
|
+
|
|
35
|
+
- Cursor/Claude do **not** natively read `.ai.local/`. This rule is a **prompt-only** mechanism: it asks you, the model, to read and apply the files. Reliability is high but not 100%.
|
|
36
|
+
- If a user adds a file to `.ai.local/` mid-session, **restart the session** to be sure it is picked up.
|
|
37
|
+
- "Priority" is **contextual**, not enforced. Always re-read the local rule before answering questions that touch it.
|
|
38
|
+
|
|
39
|
+
## Pointers
|
|
40
|
+
|
|
41
|
+
- Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package.
|
|
42
|
+
- Living gotchas alternative: `.cursor/team/conventions.md`.
|
|
43
|
+
- Root `AGENTS.md` reinforces this rule with a `MANDATORY` section.
|
|
@@ -19,11 +19,15 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
|
|
|
19
19
|
- [ ] **Core:** if `_shared/core/**` changed — all `<!-- shared-core: … -->` consumers updated (or documented intentional fork)
|
|
20
20
|
- [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, nuxt, svelte, ios-swift, android-kotlin, go, java, mcp-ts, php-hexagonal, and php-laravel — see `preset-twin-sync`)
|
|
21
21
|
- [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table is current
|
|
22
|
-
- [ ] **Token budget:** alwaysApply
|
|
22
|
+
- [ ] **Token budget:** Cursor `alwaysApply` ≤ 4 (4th slot reserved for `ai-local-overlay`); Claude session-start exactly 3; meta rules not always-on
|
|
23
|
+
- [ ] **Local overlay coverage:** every installable stack ships `ai-local-overlay.mdc` (Cursor) and `ai-local-overlay.md` (Claude) with `MANDATORY` + acknowledgement format + `docs/LOCAL-OVERLAY.md` pointer; Claude twin listed in `claude/<stack>/rules/README.md` mapping table. Run `packages/ai-rules/scripts/check-local-overlay.sh`.
|
|
23
24
|
- [ ] **Leakage:** no foreign stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
|
|
25
|
+
- [ ] **Hook-only lifecycle:** `status.json` / `metrics.json` writes happen only inside `hooks/`; agents read but never rewrite lifecycle fields. Run `packages/ai-rules/scripts/check-hook-only-lifecycle.sh`.
|
|
26
|
+
- [ ] **Chain fork:** the byte-wise MD5 uniqueness of `chain-team-phases.sh` across the 10 stacks × 2 platforms (20 hooks) holds. Run `packages/ai-rules/scripts/check-chain-hook-coverage.sh` and `packages/ai-rules/scripts/test-chain-team-phases-coverage.mjs`.
|
|
24
27
|
- [ ] **Twin depth:** domain ≥15 lines; thin aliases documented
|
|
25
28
|
- [ ] **README:** stack `rules/README.md` core→stack mapping / catalog updated if stems added
|
|
26
29
|
- [ ] **CHANGELOG / package README:** note when public preset paths or install surface change
|
|
30
|
+
- [ ] **i18n anchors:** kept-marked Cyrillic fragments in `tests-unit.md(c)` stay consistent with their English counterparts. Run `packages/ai-rules/scripts/check-preset-i18n.sh`.
|
|
27
31
|
- [ ] **Dogfood:** run `packages/ai-rules/scripts/sync-dogfood-cursor.sh` (or document intentional skip) when maintaining this monorepo
|
|
28
32
|
- [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
|
|
29
33
|
|
|
@@ -17,12 +17,16 @@ Invariants for rule loading in an **installed** preset (consumer app).
|
|
|
17
17
|
|
|
18
18
|
| Platform | Always-on | Cap |
|
|
19
19
|
|----------|-----------|-----|
|
|
20
|
-
| Cursor | `alwaysApply: true` | **≤
|
|
20
|
+
| Cursor | `alwaysApply: true` | **≤ 4** |
|
|
21
21
|
| Claude | rules **without** `paths:` | **exactly 3** |
|
|
22
22
|
|
|
23
|
+
**Cursor 4th slot is reserved for `ai-local-overlay`** (consumer-owned `.ai.local/` rules). If you do not need local overlay, demote that rule to `globs: ["**/.ai.local/**"]` and revert to ≤3.
|
|
24
|
+
|
|
23
25
|
**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
26
|
|
|
25
|
-
Session-start body budget
|
|
27
|
+
Session-start body budget:
|
|
28
|
+
- Claude trio: ≤140 lines total (stretch ≤120).
|
|
29
|
+
- Cursor 4-set: ≤170 lines total (4 rules including `ai-local-overlay`).
|
|
26
30
|
|
|
27
31
|
## Meta / author rules
|
|
28
32
|
|
|
@@ -38,4 +42,4 @@ Orchestrator, feature-delivery, code-review, post-change gates, domain globs —
|
|
|
38
42
|
|
|
39
43
|
## Verifier
|
|
40
44
|
|
|
41
|
-
build-verifier **FAIL** if alwaysApply
|
|
45
|
+
build-verifier **FAIL** if Cursor `alwaysApply` count exceeds 4, Claude session-start count exceeds 3 (Claude count **excludes `**/README.md`**), or if a `preset-*` meta rule is marked always-on.
|
|
@@ -39,6 +39,8 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
|
|
|
39
39
|
|
|
40
40
|
- **Domain** rules: ≥15 body lines (FAIL if thin without documented alias reason).
|
|
41
41
|
- **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
|
|
42
|
+
- **Slim-companion rules** (UI-edit bundle, slim app-cores, slim tooling): may be shorter than 15 lines **if and only if** the body is a pointer into shared-core / stack-prose (no standalone prose). Examples live in stack `rules/README.md` (e.g. `cursor/next/rules/README.md` "UI-edit bundle" intent).
|
|
43
|
+
- **Mechanical enforcement is pending.** Today build-verifier excludes only `agent-team-intake` / `technical-retro` / `preset-layering`; slim-companion rules currently pass under the same human-judgement path as thin aliases. Follow-up: add `allow_slim_stems` to `packages/ai-rules/scripts/check-preset-token-budget.sh` analogous to `trio_stems_allowlist`.
|
|
42
44
|
|
|
43
45
|
## Severity (build-verifier)
|
|
44
46
|
|
|
@@ -1,50 +1,94 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: E2E test and plan structure (Playwright)
|
|
3
3
|
globs: tests/e2e/**/*
|
|
4
4
|
alwaysApply: false
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
<!-- shared-core: testing/testing-principles.md -->
|
|
8
8
|
|
|
9
|
+
# Testing principles
|
|
10
|
+
|
|
11
|
+
Stack-agnostic; concrete paths, runners, and selectors live in the stack adapter (`## Stack notes`).
|
|
12
|
+
|
|
13
|
+
## Behavior vs. implementation
|
|
14
|
+
|
|
15
|
+
- Verify **behavior and business rules**, not implementation or internal details.
|
|
16
|
+
|
|
17
|
+
## File naming
|
|
18
|
+
|
|
19
|
+
- For **new** tests use `*.spec.ts` / `*.spec.tsx`. Do not rename existing `*.test.ts` / `*.test.tsx` without a separate task (legacy).
|
|
20
|
+
|
|
21
|
+
## Runner and matchers
|
|
22
|
+
|
|
23
|
+
- Use the project's runner (Jest or Vitest are common); components — the project's Testing Library integration. Reuse existing matchers — no new micro-framework.
|
|
24
|
+
|
|
25
|
+
## Test title locale
|
|
26
|
+
|
|
27
|
+
- Consumer apps **may use the project locale** (often Russian) — clear business phrases stating what is checked and the expected outcome.
|
|
28
|
+
- When ESLint enforces the locale (e.g. `jest/valid-title`): each sentence must start with a **capital letter** (including after `.`, `!`, `?`); a space after `.` followed by a lowercase letter is forbidden ("capital after period" violation).
|
|
29
|
+
|
|
30
|
+
Good (Russian locale in consumer app):
|
|
31
|
+
|
|
32
|
+
- `it('Возвращает пустой список. Пользователь не авторизован', () => {})` <!-- i18n-keep: E5 --> (Returns empty list. User is not authorized)
|
|
33
|
+
|
|
34
|
+
Bad (no capital after period; or wrong locale for configured ESLint):
|
|
35
|
+
|
|
36
|
+
- `it('Возвращает пустой список. пользователь не авторизован', () => {})` <!-- i18n-keep: E5 -->
|
|
37
|
+
- `it('Returns empty list when user is guest', () => {})` (wrong locale if ESLint enforces Russian)
|
|
38
|
+
|
|
39
|
+
## Isolation and mocks
|
|
40
|
+
|
|
41
|
+
- Mock at the **public-contract boundary**; use the project's accepted HTTP/API/store mock approach. Do not mock what is part of the feature's public contract if that breaks the test's meaning.
|
|
42
|
+
|
|
43
|
+
## Coverage of cross-cutting modules
|
|
44
|
+
|
|
45
|
+
- When changing a **shared cross-cutting module** (e.g. HTTP client body parsing, headers, error / auth handling) — **update or add behavior tests** covering success, error, and edge branches relevant to the module under change.
|
|
46
|
+
|
|
47
|
+
## Data transformation coverage
|
|
48
|
+
|
|
49
|
+
- Data transformation functions with computed fields and branches must have unit tests covering edge cases (boundary values, missing fields, unexpected value combinations).
|
|
50
|
+
|
|
51
|
+
## Reuse fixtures over ad-hoc random data
|
|
52
|
+
|
|
53
|
+
- Prefer shared fixtures / handlers from the project's accepted mocks module; do not duplicate interfaces in tests. Use the API response types (DTO types) and the **target domain types** from the project's public type surface.
|
|
54
|
+
|
|
55
|
+
## E2E: one canonical scenario plan per feature
|
|
56
|
+
|
|
57
|
+
- For each feature keep a **single canonical scenario plan** (distinct from implementation specs; the stack adapter names the file — typically `*.cases.md`).
|
|
58
|
+
|
|
59
|
+
## E2E: scenario ↔ test traceability
|
|
60
|
+
|
|
61
|
+
- Every scenario has a corresponding test. **Do not weaken** assertions to match an outdated implementation — tests must reflect business expectations from the plan. Colocate plan and executable tests in the same directory.
|
|
62
|
+
|
|
63
|
+
## E2E: page objects / shared helpers
|
|
64
|
+
|
|
65
|
+
- Prefer page objects and shared helpers over scattered selectors and per-test setup duplication.
|
|
66
|
+
|
|
67
|
+
## E2E: stable identifiers (PREFIX-XXX)
|
|
68
|
+
|
|
69
|
+
- When scenarios need stable IDs, prefix the title with `PREFIX-XXX`: `PREFIX` = first letters of words in the entity under test (Latin uppercase); `XXX` = sequential number with three digits and leading zeros. Within one `PREFIX`, numbers must form a consistent sequence with no duplicates.
|
|
70
|
+
- Example: `test('OH-001 Отображается список заказов', async ({ page }) => { ... })` <!-- i18n-keep: E5 --> (Order list is displayed)
|
|
71
|
+
|
|
72
|
+
## E2E: selector priority
|
|
73
|
+
|
|
74
|
+
- Prefer role/label selectors for accessibility and forms; fall back to `data-testid` for stable elements. Use a **hierarchical naming convention** on page roots and key interactive elements (stack adapter defines the scheme — typically `{parent}__{element}`).
|
|
75
|
+
|
|
76
|
+
## E2E: keep plans and selectors in sync with UI
|
|
77
|
+
|
|
78
|
+
- When changing UI: update selectors in page objects and cross-check with the scenario plan. When adding/changing tests: read the matching plan and sync scenario titles first.
|
|
79
|
+
|
|
80
|
+
## Stack notes
|
|
81
|
+
|
|
82
|
+
- Runner: Playwright (`@playwright/test`).
|
|
9
83
|
- E2E folder: `tests/e2e/**`.
|
|
10
|
-
- Scenario plans:
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
- Prefer:
|
|
22
|
-
- page objects (e.g. `OrderHistoryPage.ts`);
|
|
23
|
-
- shared helpers from `_shared`.
|
|
24
|
-
|
|
25
|
-
# E2E test naming
|
|
26
|
-
|
|
27
|
-
- Language:
|
|
28
|
-
- all `test` / `it` names, `describe` blocks, and steps in `*.cases.md` must be formulated **in Russian**, describing behavior and the expected result. <!-- i18n-keep: E5 -->
|
|
29
|
-
- E2E title format (`test(...)` / `it(...)`):
|
|
30
|
-
- before the scenario description, put a **numbered prefix** in the form: `PREFIX-XXX Scenario description`.
|
|
31
|
-
- `PREFIX` — abbreviation from the **first letters of the words** of the entity under test, written in **Latin uppercase**.
|
|
32
|
-
- example: `OrderHistory` → `OH`, `BillingReport` → `BR`.
|
|
33
|
-
- `XXX` — sequential test number **with three digits and leading zeros**: `001`, `002`, `010`, `123`, etc.
|
|
34
|
-
- full e2e title example:
|
|
35
|
-
- `test('OH-001 Отображается список заказов', async ({ page }) => { ... })` <!-- i18n-keep: E5 -->
|
|
36
|
-
- within one entity (`PREFIX`), test numbers must form a **consistent sequence** without duplicate numbers.
|
|
37
|
-
|
|
38
|
-
# data-testid for e2e
|
|
39
|
-
|
|
40
|
-
- **Selector priority:** `data-testid` for stable elements; `getByRole` and `getByLabel` for forms and accessible elements.
|
|
41
|
-
- **Naming:** scheme `{parent}__{element}` (e.g. `history-page__title`, `history-page__recognition-banner__attach-files-button`).
|
|
42
|
-
- **Where to add:** on page root containers and key interactive elements (buttons, links, fields) that page objects target.
|
|
43
|
-
- **When UI changes:** update data-testid in components and matching selectors in page objects; align with `*.cases.md`.
|
|
44
|
-
|
|
45
|
-
# Agent requirement
|
|
46
|
-
|
|
47
|
-
When adding/changing e2e tests:
|
|
48
|
-
- First look at the matching `*.cases.md` and sync scenario names.
|
|
49
|
-
- Place specs next to plans in the same directory.
|
|
50
|
-
- Reuse shared page objects and helpers; do not copy selectors into every test.
|
|
84
|
+
- Scenario plans: `*.cases.md` — canonical source.
|
|
85
|
+
- Tests: `*.spec.ts` — Playwright implementations.
|
|
86
|
+
- Shared utilities: `tests/e2e/_shared/**`.
|
|
87
|
+
- **Russian-locale HARD policy:** all `test` / `it` titles, `describe` blocks, and `*.cases.md` steps MUST be in Russian, describing behavior + expected result. <!-- i18n-keep: E5 -->
|
|
88
|
+
- `data-testid` priority: `data-testid` for stable; `getByRole` / `getByLabel` for forms.
|
|
89
|
+
- `data-testid` naming scheme `{parent}__{element}` — example `history-page__title`, `history-page__recognition-banner__attach-files-button`.
|
|
90
|
+
- `PREFIX-XXX` example: `OrderHistory` → `OH`, `BillingReport` → `BR`.
|
|
91
|
+
- Russian example: `test('OH-001 Отображается список заказов', async ({ page }) => { ... })` <!-- i18n-keep: E5 --> (Order list is displayed).
|
|
92
|
+
- Page object example filename: `OrderHistoryPage.ts`.
|
|
93
|
+
- Cross-reference: See also **`playwright-agents.mdc`**.
|
|
94
|
+
- `## Stack notes` content is stripped by `scripts/check-shared-core-drift.sh` before byte-comparing this file against `_shared/core/testing/testing-principles.md`; keep prose above (core content) verbatim against the core file.
|
|
@@ -6,37 +6,86 @@ alwaysApply: false
|
|
|
6
6
|
impact: MEDIUM
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
<!-- shared-core: testing/testing-principles.md -->
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- **Runner:** Vitest (or as in the project). Components — **`@testing-library/svelte`** (not `@vue/test-utils`, not React Testing Library as default).
|
|
13
|
-
- Assert **behavior**, not internals.
|
|
14
|
-
- **`describe` / `it` naming:** formulate titles **in Russian**, each sentence capitalized (as with ESLint `jest/valid-title` if enabled). <!-- i18n-keep: E5 -->
|
|
11
|
+
# Testing principles
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
// ✅
|
|
18
|
-
it('Возвращает пустой список. Пользователь не авторизован', () => {}) // <!-- i18n-keep: E5 -->
|
|
13
|
+
Stack-agnostic; concrete paths, runners, and selectors live in the stack adapter (`## Stack notes`).
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
it('Returns empty list when user is guest', () => {})
|
|
22
|
-
```
|
|
15
|
+
## Behavior vs. implementation
|
|
23
16
|
|
|
24
|
-
|
|
17
|
+
- Verify **behavior and business rules**, not implementation or internal details.
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
- Interactions: `userEvent` from `@testing-library/user-event` when that is the repo convention.
|
|
19
|
+
## File naming
|
|
28
20
|
|
|
29
|
-
|
|
21
|
+
- For **new** tests use `*.spec.ts` / `*.spec.tsx`. Do not rename existing `*.test.ts` / `*.test.tsx` without a separate task (legacy).
|
|
30
22
|
|
|
31
|
-
|
|
32
|
-
- Do not mock the feature’s public contract without need.
|
|
23
|
+
## Runner and matchers
|
|
33
24
|
|
|
34
|
-
|
|
25
|
+
- Use the project's runner (Jest or Vitest are common); components — the project's Testing Library integration. Reuse existing matchers — no new micro-framework.
|
|
35
26
|
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
## Test title locale
|
|
28
|
+
|
|
29
|
+
- Consumer apps **may use the project locale** (often Russian) — clear business phrases stating what is checked and the expected outcome.
|
|
30
|
+
- When ESLint enforces the locale (e.g. `jest/valid-title`): each sentence must start with a **capital letter** (including after `.`, `!`, `?`); a space after `.` followed by a lowercase letter is forbidden ("capital after period" violation).
|
|
31
|
+
|
|
32
|
+
Good (Russian locale in consumer app):
|
|
33
|
+
|
|
34
|
+
- `it('Возвращает пустой список. Пользователь не авторизован', () => {})` <!-- i18n-keep: E5 --> (Returns empty list. User is not authorized)
|
|
35
|
+
|
|
36
|
+
Bad (no capital after period; or wrong locale for configured ESLint):
|
|
37
|
+
|
|
38
|
+
- `it('Возвращает пустой список. пользователь не авторизован', () => {})` <!-- i18n-keep: E5 -->
|
|
39
|
+
- `it('Returns empty list when user is guest', () => {})` (wrong locale if ESLint enforces Russian)
|
|
40
|
+
|
|
41
|
+
## Isolation and mocks
|
|
42
|
+
|
|
43
|
+
- Mock at the **public-contract boundary**; use the project's accepted HTTP/API/store mock approach. Do not mock what is part of the feature's public contract if that breaks the test's meaning.
|
|
44
|
+
|
|
45
|
+
## Coverage of cross-cutting modules
|
|
46
|
+
|
|
47
|
+
- When changing a **shared cross-cutting module** (e.g. HTTP client body parsing, headers, error / auth handling) — **update or add behavior tests** covering success, error, and edge branches relevant to the module under change.
|
|
48
|
+
|
|
49
|
+
## Data transformation coverage
|
|
50
|
+
|
|
51
|
+
- Data transformation functions with computed fields and branches must have unit tests covering edge cases (boundary values, missing fields, unexpected value combinations).
|
|
52
|
+
|
|
53
|
+
## Reuse fixtures over ad-hoc random data
|
|
54
|
+
|
|
55
|
+
- Prefer shared fixtures / handlers from the project's accepted mocks module; do not duplicate interfaces in tests. Use the API response types (DTO types) and the **target domain types** from the project's public type surface.
|
|
38
56
|
|
|
39
|
-
|
|
57
|
+
## E2E: one canonical scenario plan per feature
|
|
40
58
|
|
|
41
|
-
-
|
|
42
|
-
|
|
59
|
+
- For each feature keep a **single canonical scenario plan** (distinct from implementation specs; the stack adapter names the file — typically `*.cases.md`).
|
|
60
|
+
|
|
61
|
+
## E2E: scenario ↔ test traceability
|
|
62
|
+
|
|
63
|
+
- Every scenario has a corresponding test. **Do not weaken** assertions to match an outdated implementation — tests must reflect business expectations from the plan. Colocate plan and executable tests in the same directory.
|
|
64
|
+
|
|
65
|
+
## E2E: page objects / shared helpers
|
|
66
|
+
|
|
67
|
+
- Prefer page objects and shared helpers over scattered selectors and per-test setup duplication.
|
|
68
|
+
|
|
69
|
+
## E2E: stable identifiers (PREFIX-XXX)
|
|
70
|
+
|
|
71
|
+
- When scenarios need stable IDs, prefix the title with `PREFIX-XXX`: `PREFIX` = first letters of words in the entity under test (Latin uppercase); `XXX` = sequential number with three digits and leading zeros. Within one `PREFIX`, numbers must form a consistent sequence with no duplicates.
|
|
72
|
+
- Example: `test('OH-001 Отображается список заказов', async ({ page }) => { ... })` <!-- i18n-keep: E5 --> (Order list is displayed)
|
|
73
|
+
|
|
74
|
+
## E2E: selector priority
|
|
75
|
+
|
|
76
|
+
- Prefer role/label selectors for accessibility and forms; fall back to `data-testid` for stable elements. Use a **hierarchical naming convention** on page roots and key interactive elements (stack adapter defines the scheme — typically `{parent}__{element}`).
|
|
77
|
+
|
|
78
|
+
## E2E: keep plans and selectors in sync with UI
|
|
79
|
+
|
|
80
|
+
- When changing UI: update selectors in page objects and cross-check with the scenario plan. When adding/changing tests: read the matching plan and sync scenario titles first.
|
|
81
|
+
|
|
82
|
+
## Stack notes
|
|
83
|
+
|
|
84
|
+
- Runner: Vitest (default for SvelteKit).
|
|
85
|
+
- Components: `render` from `@testing-library/svelte` (NOT `@vue/test-utils`, NOT React Testing Library as default).
|
|
86
|
+
- `userEvent` from `@testing-library/user-event` when that is the repo convention.
|
|
87
|
+
- HTTP-client behavior tests next to `src/lib/clients/**` (SvelteKit convention; no `app/`, no `src/app/`).
|
|
88
|
+
- Mock `$lib/api` / stores per neighbor patterns.
|
|
89
|
+
- DTO→domain mappers — unit tests for edge cases.
|
|
90
|
+
- UI placement: sibling `*.spec.ts` in `src/lib/components` (no `__tests__/` inside the component folder).
|
|
91
|
+
- `## Stack notes` content is stripped by `scripts/check-shared-core-drift.sh` before byte-comparing this file against `_shared/core/testing/testing-principles.md`; keep prose above (core content) verbatim against the core file.
|
|
@@ -33,6 +33,12 @@ Lead with findings ordered by severity. Required shape (also in `code-review-mr`
|
|
|
33
33
|
|
|
34
34
|
For agent team tasks, write `.cursor/team/tasks/<slug>/review.md` and upsert the owned terminal receipt (`completed` or `changes_requested`); do not mutate `status.json`.
|
|
35
35
|
|
|
36
|
+
## Receiving review feedback
|
|
37
|
+
|
|
38
|
+
<!-- shared-core: review/receiving-code-review.md -->
|
|
39
|
+
|
|
40
|
+
When **implementing** review comments (not when issuing them): verify each item against the codebase before changing code; do not perform agreement (`You're absolutely right!`). Unclear items → ask, do not guess.
|
|
41
|
+
|
|
36
42
|
## Design guidance
|
|
37
43
|
|
|
38
44
|
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -3,19 +3,36 @@ name: debug-investigation
|
|
|
3
3
|
description: Investigates bugs, failing tests, crashes, and incorrect behavior with runtime evidence before applying minimal fixes. Use for bugfix tasks, debugger agent runs, regressions, and flaky test diagnosis.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
<!-- shared-core: quality/debug-investigation.md -->
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
# Debug investigation
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
2. Define expected vs actual behavior in one sentence.
|
|
12
|
-
3. Trace the failing path through the smallest relevant slice of the codebase.
|
|
13
|
-
4. Identify the root cause before editing. Avoid broad refactors during bugfixes.
|
|
14
|
-
5. Apply the smallest fix that preserves existing architecture and public contracts.
|
|
15
|
-
6. Add or update a regression test when the behavior is user-facing or likely to recur.
|
|
16
|
-
7. Run the narrow failing check first, then relevant lint/type/test validation.
|
|
10
|
+
Stack-agnostic root-cause loop. Consumed by skill `debug-investigation` and agent `debugger`. Platform paths, MCP, and stack commands belong in adapter **Stack notes**.
|
|
17
11
|
|
|
18
|
-
##
|
|
12
|
+
## When
|
|
13
|
+
|
|
14
|
+
Any bug, test failure, build failure, or unexpected behavior — **before** proposing a fix.
|
|
15
|
+
|
|
16
|
+
## Phases (in order)
|
|
17
|
+
|
|
18
|
+
1. **Evidence** — reproduce, or collect the closest evidence (error output, failing test, logs, user steps).
|
|
19
|
+
2. **Isolate** — expected vs actual in one sentence; smallest relevant slice of the codebase.
|
|
20
|
+
3. **Root cause** — name the cause before editing. One hypothesis at a time; do not stack speculative fixes.
|
|
21
|
+
4. **Minimal fix + verify** — smallest change that preserves architecture and public contracts. Add a regression test when the behavior is user-facing or likely to recur. Re-run the **failing** check first, then the relevant lint/type/test slice.
|
|
22
|
+
|
|
23
|
+
## 3-fix architecture gate
|
|
24
|
+
|
|
25
|
+
If **three** fix attempts fail, or the same symptom returns after two supposed fixes: **STOP**. Do not attempt fix #4. Escalate — the design is likely wrong (human partner or `solution-architect`). Chasing symptoms is the failure mode.
|
|
26
|
+
|
|
27
|
+
## Do not
|
|
28
|
+
|
|
29
|
+
- Broad refactor during a bugfix.
|
|
30
|
+
- Fix only where the error surfaces if invalid data originates elsewhere.
|
|
31
|
+
- Claim `fixApplied: true` without re-running the failing check (see `quality/verification-before-completion.md`).
|
|
32
|
+
|
|
33
|
+
## Stack notes
|
|
34
|
+
|
|
35
|
+
### Artifacts
|
|
19
36
|
|
|
20
37
|
For agent team tasks, write `.cursor/team/tasks/<slug>/debug-report.md` with:
|
|
21
38
|
|
|
@@ -28,7 +45,7 @@ For agent team tasks, write `.cursor/team/tasks/<slug>/debug-report.md` with:
|
|
|
28
45
|
Agent team: upsert the owned terminal receipt in `artifact-manifest.json`; do not mutate `status.json`.
|
|
29
46
|
|
|
30
47
|
|
|
31
|
-
|
|
48
|
+
### MCP usage
|
|
32
49
|
|
|
33
50
|
Load requestable rule `mcp-usage` when verifying third-party library APIs (Context7) or when a local overlay MCP is present and the task fits. Discover tools at runtime; do not invent schemas. Overlay absence is not a blocker unless the user required that MCP as source of truth.
|
|
34
51
|
|
|
@@ -39,6 +56,6 @@ Shipped browser split: Playwright MCP for e2e specs/selectors; Chrome DevTools M
|
|
|
39
56
|
If a Sentry/Datadog (or similar) MCP is ready and the task is a production error, event, or trace, use it. Do not invent telemetry.
|
|
40
57
|
|
|
41
58
|
|
|
42
|
-
|
|
59
|
+
### Design guidance
|
|
43
60
|
|
|
44
61
|
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -106,8 +106,6 @@ Prefer **`executing`** for pipeline mode. Legacy: `analysis`, `development`, `re
|
|
|
106
106
|
/technical-retro <slug>
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
Legacy: `/feature-start`, `/feature-continue`.
|
|
110
|
-
|
|
111
109
|
## Creating task dirs
|
|
112
110
|
|
|
113
111
|
Bootstrap `<slug>/` by **writing** `pipeline.json` (Write tool). Runtime/hook owns `status.json` lifecycle; parent may only create a minimal bootstrap if missing. Do **not** use Shell `mkdir -p` — Cursor’s default sandbox returns `Operation not permitted` (especially for repos on macOS Desktop/Documents).
|
|
@@ -116,7 +114,6 @@ Bootstrap `<slug>/` by **writing** `pipeline.json` (Write tool). Runtime/hook ow
|
|
|
116
114
|
|
|
117
115
|
Commit task artifacts if you want them to survive `ai-rules clean cursor`. Or copy finished tasks to `docs/agent-workflow/tasks/<slug>/`.
|
|
118
116
|
|
|
119
|
-
|
|
120
117
|
## specMode, applyReadiness, memlog
|
|
121
118
|
|
|
122
119
|
- **`specMode`:** `consume` | `generate` | `none` — primary in `brief.md` `## Spec mode`; optional top-level `pipeline.json` `specMode`. `none` skips INDEX/author mode (spike/research).
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "Single source of truth for embed-mode shared-core stems. Loaded by check-shared-core-drift.sh and sync-shared-core-embeds.sh to keep the two scripts in lockstep.",
|
|
3
|
+
"embed": [
|
|
4
|
+
"quality/code-quality-and-refactoring.md",
|
|
5
|
+
"quality/anti-sycophancy-discipline.md",
|
|
6
|
+
"quality/design-guidance.md",
|
|
7
|
+
"quality/mcp-usage.md",
|
|
8
|
+
"meta/preset-layering.md",
|
|
9
|
+
"meta/preset-twin-sync.md",
|
|
10
|
+
"meta/preset-token-budget.md",
|
|
11
|
+
"meta/preset-pr-checklist.md",
|
|
12
|
+
"meta/preset-no-cross-stack-leakage.md",
|
|
13
|
+
"review/code-review-mr.md",
|
|
14
|
+
"review/technical-retro.md",
|
|
15
|
+
"review/mockup-review.md",
|
|
16
|
+
"review/ux-design.md",
|
|
17
|
+
"agent-team/agent-team-intake.md",
|
|
18
|
+
"architecture/product-specs.md",
|
|
19
|
+
"architecture/product-specs-authoring.md",
|
|
20
|
+
"quality/debug-investigation.md",
|
|
21
|
+
"testing/testing-principles.md"
|
|
22
|
+
],
|
|
23
|
+
"lineage": [
|
|
24
|
+
"architecture/feature-delivery-workflow.md",
|
|
25
|
+
"architecture/reference-features.template.md",
|
|
26
|
+
"agent-team/agent-team-orchestrator.md",
|
|
27
|
+
"quality/verification-before-completion.md",
|
|
28
|
+
"review/receiving-code-review.md",
|
|
29
|
+
"agent-team/task-classification.md"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Aggregate `metrics.json` ledgers across `.cursor/team/tasks/*` and emit a JSON report.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* node scripts/aggregate-agent-task-metrics.mjs [--team-root <dir>] [--help]
|
|
7
|
+
*
|
|
8
|
+
* Defaults to `<cwd>/.cursor/team` when --team-root is omitted.
|
|
9
|
+
*/
|
|
2
10
|
|
|
3
11
|
import fs from 'node:fs';
|
|
4
12
|
import path from 'node:path';
|
|
5
13
|
|
|
6
14
|
const args = process.argv.slice(2);
|
|
15
|
+
|
|
16
|
+
if (args.includes('-h') || args.includes('--help')) {
|
|
17
|
+
console.log(`Aggregate agent-task metrics ledgers.
|
|
18
|
+
|
|
19
|
+
Usage:
|
|
20
|
+
node scripts/aggregate-agent-task-metrics.mjs [--team-root <dir>]
|
|
21
|
+
|
|
22
|
+
Options:
|
|
23
|
+
--team-root <dir> Directory containing a 'tasks/' subfolder with *.metrics.json ledgers
|
|
24
|
+
(default: <cwd>/.cursor/team)
|
|
25
|
+
|
|
26
|
+
Output: JSON report on stdout (machine-readable).`);
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}
|
|
29
|
+
|
|
7
30
|
const teamRootIndex = args.indexOf('--team-root');
|
|
8
31
|
const teamRoot =
|
|
9
32
|
teamRootIndex >= 0
|