@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
|
@@ -134,10 +134,17 @@ const DEFAULT_ARTIFACT_OUTPUT_IDS = {
|
|
|
134
134
|
'build-verifier': 'validation',
|
|
135
135
|
'code-reviewer': 'review',
|
|
136
136
|
'security-reviewer': 'security-review',
|
|
137
|
-
'accessibility-reviewer': 'a11y-review',
|
|
138
137
|
'performance-auditor': 'perf-report',
|
|
139
138
|
'api-contract-reviewer': 'api-contract-review',
|
|
140
139
|
'tech-writer': 'documentation',
|
|
140
|
+
'openspec-author': 'openspec-change',
|
|
141
|
+
'qa-tester': 'qa',
|
|
142
|
+
'unit-test-planner': 'unit-test-plan',
|
|
143
|
+
'unit-test-generator': 'unit-test-spec',
|
|
144
|
+
'unit-test-healer': 'unit-test-heal',
|
|
145
|
+
'integration-test-planner': 'integration-test-plan',
|
|
146
|
+
'integration-test-generator': 'integration-test-spec',
|
|
147
|
+
'integration-test-healer': 'integration-test-heal',
|
|
141
148
|
};
|
|
142
149
|
function artifactOutputIdFor(step, agent) {
|
|
143
150
|
if (step && typeof step.artifactOutputId === 'string') return step.artifactOutputId;
|
|
@@ -242,7 +249,17 @@ function recordSkippedStep(step, stepIndex) {
|
|
|
242
249
|
function writeStatus(next) {
|
|
243
250
|
status = { ...status, ...next, slug, updatedAt: now };
|
|
244
251
|
const temporary = `${statusPath}.${process.pid}.${Date.now()}.tmp`;
|
|
245
|
-
|
|
252
|
+
// Open + write + fsync + rename so the durable file lands on disk before
|
|
253
|
+
// the orchestrator reads it. Closes the race window where a subagent that
|
|
254
|
+
// completed milliseconds before writeStatus() could otherwise invoke the
|
|
255
|
+
// next step on a stale status (in particular the human-gate write).
|
|
256
|
+
const fd = fs.openSync(temporary, 'w');
|
|
257
|
+
try {
|
|
258
|
+
fs.writeSync(fd, JSON.stringify(status, null, 2) + '\n');
|
|
259
|
+
try { fs.fsyncSync(fd); } catch {}
|
|
260
|
+
} finally {
|
|
261
|
+
fs.closeSync(fd);
|
|
262
|
+
}
|
|
246
263
|
fs.renameSync(temporary, statusPath);
|
|
247
264
|
}
|
|
248
265
|
|
|
@@ -337,6 +354,12 @@ const AGENT_HANDOFF = {
|
|
|
337
354
|
`Follow tests-integration.mdc, integration-testing, and debug-investigation. Do not use browser e2e tooling. Upsert the owned terminal receipt in artifact-manifest.json; do not mutate status.json lifecycle fields.`,
|
|
338
355
|
'tech-writer': (s) =>
|
|
339
356
|
`Invoke tech-writer for slug "${s}". Write documentation.md from task artifacts. Upsert the owned terminal receipt in artifact-manifest.json; do not mutate status.json lifecycle fields.`,
|
|
357
|
+
'openspec-author': (s, scope) =>
|
|
358
|
+
`Invoke openspec-author for slug "${s}"${scope ? ` (scope: ${scope})` : ''}. ` +
|
|
359
|
+
`Read openspec/config.yaml schema + rules; if openspec/** is absent, emit blocked ("openspec/** not initialized"). ` +
|
|
360
|
+
`Author openspec/changes/<change-id>/{proposal.md, design.md, tasks.md, .openspec.yaml} and the capability spec delta per phase (explore|propose|apply|archive). ` +
|
|
361
|
+
`Run \`openspec validate <change-id> --type change --strict\` and \`openspec validate --specs --strict\` (Phase 3); surface FAIL output verbatim. ` +
|
|
362
|
+
`Upsert the owned terminal receipt (artifactOutputId \`openspec-change\`) in artifact-manifest.json with validator exit code + evidence paths; do not mutate status.json lifecycle fields. `,
|
|
340
363
|
};
|
|
341
364
|
|
|
342
365
|
const REVIEW_AGENTS = new Set([
|
|
@@ -510,9 +533,37 @@ if (!fs.existsSync(pipelinePath)) {
|
|
|
510
533
|
}
|
|
511
534
|
|
|
512
535
|
let pipeline;
|
|
536
|
+
let pipelineParseError = null;
|
|
513
537
|
try {
|
|
514
538
|
pipeline = JSON.parse(fs.readFileSync(pipelinePath, 'utf8'));
|
|
515
|
-
} catch {
|
|
539
|
+
} catch (error) {
|
|
540
|
+
pipelineParseError = error;
|
|
541
|
+
}
|
|
542
|
+
// Modern pipelines carry an `intent` field. If pipeline.json is present but
|
|
543
|
+
// unparseable, surface the error so the orchestrator can stop and report
|
|
544
|
+
// instead of falling back to legacyFlow() — which silently drops modern
|
|
545
|
+
// roles like `openspec-author`, `qa-tester`, and the test-planner trio.
|
|
546
|
+
if (pipelineParseError) {
|
|
547
|
+
if (fs.existsSync(pipelinePath)) {
|
|
548
|
+
const raw = fs.readFileSync(pipelinePath, 'utf8');
|
|
549
|
+
const hasModernIntent = /"intent"\s*:/.test(raw);
|
|
550
|
+
appendMetric({
|
|
551
|
+
eventId: `${status.metricsRunId || slug}:pipeline_parse_error:${Date.now()}`,
|
|
552
|
+
type: 'pipeline_parse_error',
|
|
553
|
+
at: now,
|
|
554
|
+
source: 'hook',
|
|
555
|
+
attributionConfidence: 'high',
|
|
556
|
+
error: String(pipelineParseError.message || pipelineParseError),
|
|
557
|
+
hasModernIntent,
|
|
558
|
+
});
|
|
559
|
+
if (hasModernIntent) {
|
|
560
|
+
writeStatus({ state: 'blocked', phase: 'blocked', currentAgent: 'task-router' });
|
|
561
|
+
process.stdout.write(JSON.stringify({
|
|
562
|
+
followup_message: `pipeline.json is malformed for slug "${slug}" — JSON parse error: ${pipelineParseError.message}. Re-run the task-router to regenerate pipeline.json, then resume via /task-continue ${slug}.`,
|
|
563
|
+
}));
|
|
564
|
+
process.exit(0);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
516
567
|
legacyFlow();
|
|
517
568
|
}
|
|
518
569
|
|
|
@@ -30,6 +30,7 @@ Claude topic `.md` files are **derived** from Cursor SoT `presets/cursor/java/ru
|
|
|
30
30
|
| `architecture-boundaries.mdc` | `architecture/boundaries.md` |
|
|
31
31
|
| `anti-sycophancy-discipline.mdc` | `tooling-and-review/anti-sycophancy-discipline.md` |
|
|
32
32
|
| `code-quality-and-refactoring.mdc` | `tooling-and-review/code-quality.md` |
|
|
33
|
+
| `ai-local-overlay.mdc` | `tooling-and-review/ai-local-overlay.md` |
|
|
33
34
|
| `design-guidance.mdc` | `tooling-and-review/design-guidance.md` |
|
|
34
35
|
| `mcp-usage.mdc` | `tooling-and-review/mcp-usage.md` |
|
|
35
36
|
| `code-review-mr.mdc` | `tooling-and-review/code-review.md` |
|
|
@@ -23,8 +23,6 @@ Work request without `/task` — see **agent-team-intake** (when to suggest the
|
|
|
23
23
|
|---------|------|
|
|
24
24
|
| **`/task <desc>`** | **Preferred** — router → dynamic pipeline → first agent |
|
|
25
25
|
| `/task-continue <slug>` | After human gate or pause |
|
|
26
|
-
| `/feature-start <desc>` | Legacy: analyst-only start (no router) |
|
|
27
|
-
| `/feature-continue <slug>` | Alias of task-continue |
|
|
28
26
|
| `/spec-start [desc]` | Generate/bootstrap `docs/specs` — router intent `spec-gen` → analyst author mode → human gate |
|
|
29
27
|
| `/technical-retro [slug]` | Retro with agent team block |
|
|
30
28
|
|
|
@@ -163,7 +161,7 @@ After each agent completes, verify its terminal manifest receipt, then let the o
|
|
|
163
161
|
|
|
164
162
|
## Legacy mode
|
|
165
163
|
|
|
166
|
-
If `pipeline.json` is missing
|
|
164
|
+
If `pipeline.json` is missing, fall back to fixed phases: analysis → development → review → testing. Hook supports both.
|
|
167
165
|
|
|
168
166
|
## Skip pipeline when
|
|
169
167
|
|
|
@@ -208,4 +206,4 @@ When the work edits `packages/ai-rules/presets/**` (or dogfood `.cursor/` sync o
|
|
|
208
206
|
- Chain hook handoffs: `integration-test-*`, `post-change-test`, `java-tooling` — never `lint:js`, Playwright, XCUITest, or `xcodebuild`.
|
|
209
207
|
- Skills: `feature-delivery`, `unit-testing`, `integration-testing`, `ci-investigation`, `debug-investigation`, `code-review`, `technical-retro`, `write-adr`.
|
|
210
208
|
|
|
211
|
-
**Product specs:** When `/task
|
|
209
|
+
**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.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Local overlay from .ai.local/ (consumer-owned rules with priority over preset rules) — MANDATORY
|
|
3
|
+
paths:
|
|
4
|
+
- "**/.ai.local/**"
|
|
5
|
+
- "**/AGENTS.md"
|
|
6
|
+
- "**/CLAUDE.md"
|
|
7
|
+
alwaysApply: false
|
|
8
|
+
impact: CRITICAL
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Local overlay (`.ai.local/`) — MANDATORY
|
|
12
|
+
|
|
13
|
+
This rule is mandatory. **You MUST** obey it on every turn, without exception.
|
|
14
|
+
|
|
15
|
+
## On every turn
|
|
16
|
+
|
|
17
|
+
1. **Probe** — before answering, run `ls -la .ai.local` from the repository root.
|
|
18
|
+
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.
|
|
19
|
+
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.
|
|
20
|
+
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.
|
|
21
|
+
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.
|
|
22
|
+
|
|
23
|
+
If `.ai.local/` does not exist → **no-op**, do not error. Do not produce any log line about its absence.
|
|
24
|
+
|
|
25
|
+
## Authoring `.ai.local/rules/*.md` (consumer-side reference)
|
|
26
|
+
|
|
27
|
+
Each `.ai.local/rules/<name>.md` is a plain-markdown rule body. The model parses it as:
|
|
28
|
+
|
|
29
|
+
- Lines before `## Body` are scope metadata. Only `glob:` / `globs:` / `override:` lines are recognised.
|
|
30
|
+
- Everything from `## Body` onward is the rule body.
|
|
31
|
+
- `glob: always` → always-on. Counts against your context budget.
|
|
32
|
+
- `globs: <comma-separated globs>` → on-demand; applies only when matching files are in focus.
|
|
33
|
+
- `override: kill <preset-rule-name>` → drop that preset rule from context.
|
|
34
|
+
|
|
35
|
+
Keep files ≤ 120 lines. Match the style of preset rules (short sections, bullets, code examples).
|
|
36
|
+
|
|
37
|
+
## Limitations (read this)
|
|
38
|
+
|
|
39
|
+
- 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%.
|
|
40
|
+
- If a user adds a file to `.ai.local/` mid-session, **restart the session** to be sure it is picked up.
|
|
41
|
+
- "Priority" is **contextual**, not enforced. Always re-read the local rule before answering questions that touch it.
|
|
42
|
+
- This rule is **not** session-start (Claude convention); it loads on touch of `.ai.local/**` or `AGENTS.md`/`CLAUDE.md`. The "every turn" mandate is enforced by the body text, not by Cursor/Claude loading semantics.
|
|
43
|
+
|
|
44
|
+
## Pointers
|
|
45
|
+
|
|
46
|
+
- Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package.
|
|
47
|
+
- Living gotchas alternative: `.claude/team/conventions.md`.
|
|
48
|
+
- 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
|
|
|
@@ -20,6 +20,12 @@ description: Reviews pull requests and branch diffs for Java hexagonal services
|
|
|
20
20
|
|
|
21
21
|
Never require iOS/Next-only gates (XCUITest, Playwright, `lint:js`).
|
|
22
22
|
|
|
23
|
+
## Receiving review feedback
|
|
24
|
+
|
|
25
|
+
<!-- shared-core: review/receiving-code-review.md -->
|
|
26
|
+
|
|
27
|
+
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.
|
|
28
|
+
|
|
23
29
|
## Design guidance
|
|
24
30
|
|
|
25
31
|
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -3,21 +3,49 @@ name: debug-investigation
|
|
|
3
3
|
description: Investigates bugs, failing tests, and unexpected behavior in Java services with runtime evidence before applying minimal fixes. Use for bugfix tasks, debugger agent runs, or regressions.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
<!-- shared-core: quality/debug-investigation.md -->
|
|
7
|
+
|
|
8
|
+
# Debug investigation
|
|
9
|
+
|
|
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**.
|
|
11
|
+
|
|
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
|
+
### Stack process
|
|
7
36
|
|
|
8
37
|
1. Capture failing `mvn test` / `./gradlew test` / logs / stack traces.
|
|
9
38
|
2. Hypothesize layer (domain vs adapter vs wiring).
|
|
10
39
|
3. Minimal fix + regression test when appropriate.
|
|
11
40
|
4. Document in `debug-report.md`.
|
|
12
41
|
|
|
13
|
-
|
|
14
|
-
## MCP usage
|
|
42
|
+
### MCP usage
|
|
15
43
|
|
|
16
44
|
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.
|
|
17
45
|
|
|
18
46
|
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.
|
|
19
47
|
|
|
20
48
|
|
|
21
|
-
|
|
49
|
+
### Design guidance
|
|
22
50
|
|
|
23
51
|
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -18,6 +18,12 @@ You are the build verifier for **TypeScript MCP servers** (and for **ai-rules pr
|
|
|
18
18
|
|
|
19
19
|
**Never** require Playwright, XCUITest, `lint:js`/`lint:css`, `xcodebuild`/`SwiftLint`, or Go tools (`go test` / `go vet` / `golangci-lint`) as the MCP gate.
|
|
20
20
|
|
|
21
|
+
## Verification before completion
|
|
22
|
+
|
|
23
|
+
<!-- shared-core: quality/verification-before-completion.md -->
|
|
24
|
+
|
|
25
|
+
Before writing `validation-report.md` or claiming PASS: IDENTIFY the commands, RUN them, READ exit codes, VERIFY they match the verdict, THEN claim. Do not mark PASS from memory of a prior developer run.
|
|
26
|
+
|
|
21
27
|
## Preset-structure validation (when editing `packages/ai-rules/presets/**`)
|
|
22
28
|
|
|
23
29
|
From `packages/ai-rules/`:
|
|
@@ -43,6 +43,13 @@ Implement MCP server features following **mcp-ts** boundaries.
|
|
|
43
43
|
## Design guidance / anti-sycophancy
|
|
44
44
|
|
|
45
45
|
- Load `design-guidance` and `anti-sycophancy-discipline` when writing or changing code.
|
|
46
|
+
- When acting on review feedback (`changes_requested` / human comments): verify each item against the codebase before implementing; no performative agreement.
|
|
47
|
+
|
|
48
|
+
## Verification before completion
|
|
49
|
+
|
|
50
|
+
<!-- shared-core: quality/verification-before-completion.md -->
|
|
51
|
+
|
|
52
|
+
Before handoff, IDENTIFY→RUN→READ→VERIFY the scoped checks for this WP, THEN claim. Do not say the work is done without that evidence in the same turn. Full-project lint is `build-verifier`.
|
|
46
53
|
|
|
47
54
|
|
|
48
55
|
## Product specs (docs/specs)
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: task-analyst
|
|
3
|
-
description: Task analysis specialist. Clarifies requirements, validates acceptance criteria, and decomposes work into concrete tasks. Use for
|
|
3
|
+
description: Task analysis specialist. Clarifies requirements, validates acceptance criteria, and decomposes work into concrete tasks. Use for task intake, or when the user asks to analyze or decompose a feature before coding. Writes only team artifacts; never writes production code.
|
|
4
4
|
readonly: false
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
Analyze MCP server work requests for the **mcp-ts** preset.
|
|
8
8
|
|
|
9
|
+
## Classify first
|
|
10
|
+
|
|
11
|
+
<!-- shared-core: agent-team/task-classification.md -->
|
|
12
|
+
|
|
13
|
+
Before decomposing, name the class: **spike** / **bounded** / **architectural**. Maps to existing pipeline profiles — do not invent a second orchestrator.
|
|
14
|
+
|
|
15
|
+
- **Spike** — research DoR; no implement tasks.
|
|
16
|
+
- **Bounded** — few tasks, only layers actually touched; do not pad types/api/store/ui.
|
|
17
|
+
- **Architectural** — full layer table; architect when boundaries are unclear.
|
|
18
|
+
|
|
9
19
|
## Deliverables
|
|
10
20
|
|
|
11
21
|
1. `brief.md` — goal, AC, out of scope, assumptions, risks.
|
|
@@ -46,6 +46,20 @@ Append **`security-reviewer` after `build-verifier`** for `feature` / `bugfix` /
|
|
|
46
46
|
|
|
47
47
|
**Never skip `build-verifier`** after developer when TypeScript sources changed.
|
|
48
48
|
|
|
49
|
+
## Task class (spike / bounded / architectural)
|
|
50
|
+
|
|
51
|
+
<!-- shared-core: agent-team/task-classification.md -->
|
|
52
|
+
|
|
53
|
+
Name the class in `routingReasons`. Maps to profiles already in this file — do not add a parallel step table.
|
|
54
|
+
|
|
55
|
+
| Class | Use existing |
|
|
56
|
+
|-------|----------------|
|
|
57
|
+
| Spike | intent `spike` |
|
|
58
|
+
| Bounded | `profile: light` (or skip analyst when AC is complete) |
|
|
59
|
+
| Architectural | `profile: full` + `solution-architect` when boundaries unclear |
|
|
60
|
+
|
|
61
|
+
SoT: `agent-team/task-classification` (shared-core marker above; do not invent a second pipeline).
|
|
62
|
+
|
|
49
63
|
## Routing decision rubric
|
|
50
64
|
|
|
51
65
|
Keep top-level `profile` and emit this top-level object in every new `pipeline.json`:
|
|
@@ -6,6 +6,4 @@ Slash commands are copied to `.cursor/commands/` (Cursor) or `.claude/commands/`
|
|
|
6
6
|
|---------|---------|
|
|
7
7
|
| `/task` | Router + pipeline entry |
|
|
8
8
|
| `/task-continue` | Resume after human gate |
|
|
9
|
-
| `/feature-start` | Legacy analyst-only start |
|
|
10
|
-
| `/feature-continue` | Alias of task-continue |
|
|
11
9
|
| `/technical-retro` | Retro |
|
|
@@ -5,7 +5,7 @@ description: Continue an agent-team task after a human gate, pause, or review ch
|
|
|
5
5
|
|
|
6
6
|
# Task continue — after human gate or pause
|
|
7
7
|
|
|
8
|
-
Resume the pipeline from `pipeline.json`.
|
|
8
|
+
Resume the pipeline from `pipeline.json`.
|
|
9
9
|
|
|
10
10
|
## Arguments
|
|
11
11
|
|
|
@@ -33,7 +33,7 @@ Examples:
|
|
|
33
33
|
- **do not** write lifecycle fields in `status.json` / `metrics.json` yourself — orchestration runtime/hook owns them (see **agent-artifact-contracts**). If `status.json` is missing, only minimal bootstrap is allowed (`slug`, `intent`, `pipelineIndex: 0`, `currentAgent: steps[0]`, `state: in_progress`) — **do not** increment `pipelineIndex` manually;
|
|
34
34
|
- invoke subagent for `pipeline.steps[0].agent` (slug, artifact paths, scope).
|
|
35
35
|
6. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until hook returns `followup_message`).
|
|
36
|
-
7. **Human gate** — if there is a gate in `humanGates` after the current step (`after:<agent>`), **stop** after the agent finishes and ask for `/task-continue <slug
|
|
36
|
+
7. **Human gate** — if there is a gate in `humanGates` after the current step (`after:<agent>`), **stop** after the agent finishes and ask for `/task-continue <slug>`.
|
|
37
37
|
|
|
38
38
|
## Do not
|
|
39
39
|
|
|
@@ -46,9 +46,6 @@ Examples:
|
|
|
46
46
|
- `awaitingHumanGate` / `state: awaiting_approval` → offer artifact review or `/task-continue <slug>`.
|
|
47
47
|
- `in_progress` → ask: continue or new slug.
|
|
48
48
|
|
|
49
|
-
## Legacy
|
|
50
|
-
|
|
51
|
-
`/feature-start` and `/feature-continue` remain compatible; for new tasks prefer `/task`.
|
|
52
49
|
|
|
53
50
|
## Metrics
|
|
54
51
|
|
|
@@ -10,7 +10,7 @@ The agent acts as a **neutral facilitator of a technical retrospective**, not as
|
|
|
10
10
|
## When to use
|
|
11
11
|
|
|
12
12
|
- User asks: "retro", "technical retro", "sprint/iteration review", "action items after release".
|
|
13
|
-
- After completing the agent-team pipeline
|
|
13
|
+
- After completing the agent-team pipeline.
|
|
14
14
|
- Context available: period, topic (release, incident), task slug, notes.
|
|
15
15
|
|
|
16
16
|
## Inputs (gather; do not invent)
|
|
@@ -53,7 +53,7 @@ Do not attribute facts not present in artifacts, diff, or the user's message.
|
|
|
53
53
|
|
|
54
54
|
## "Agent work" block (required when slug present)
|
|
55
55
|
|
|
56
|
-
If retro is tied to
|
|
56
|
+
If retro is tied to an agent-team pipeline:
|
|
57
57
|
|
|
58
58
|
| Question | What to capture |
|
|
59
59
|
|----------|-----------------|
|
|
@@ -128,17 +128,10 @@ const DEFAULT_ARTIFACT_OUTPUT_IDS = {
|
|
|
128
128
|
'task-router': 'routing',
|
|
129
129
|
'task-analyst': 'analysis',
|
|
130
130
|
'solution-architect': 'architecture',
|
|
131
|
-
'migration-specialist': 'migration-plan',
|
|
132
131
|
debugger: 'debug',
|
|
133
|
-
'ci-investigator': 'ci',
|
|
134
132
|
'feature-developer': 'implementation',
|
|
135
133
|
'build-verifier': 'validation',
|
|
136
|
-
'code-reviewer': 'review',
|
|
137
134
|
'security-reviewer': 'security-review',
|
|
138
|
-
'accessibility-reviewer': 'a11y-review',
|
|
139
|
-
'performance-auditor': 'perf-report',
|
|
140
|
-
'api-contract-reviewer': 'api-contract-review',
|
|
141
|
-
'tech-writer': 'documentation',
|
|
142
135
|
};
|
|
143
136
|
function artifactOutputIdFor(step, agent) {
|
|
144
137
|
if (step && typeof step.artifactOutputId === 'string') return step.artifactOutputId;
|
|
@@ -243,7 +236,17 @@ function recordSkippedStep(step, stepIndex) {
|
|
|
243
236
|
function writeStatus(next) {
|
|
244
237
|
status = { ...status, ...next, slug, updatedAt: now };
|
|
245
238
|
const temporary = `${statusPath}.${process.pid}.${Date.now()}.tmp`;
|
|
246
|
-
|
|
239
|
+
// Open + write + fsync + rename so the durable file lands on disk before
|
|
240
|
+
// the orchestrator reads it. Closes the race window where a subagent that
|
|
241
|
+
// completed milliseconds before writeStatus() could otherwise invoke the
|
|
242
|
+
// next step on a stale status (in particular the human-gate write).
|
|
243
|
+
const fd = fs.openSync(temporary, 'w');
|
|
244
|
+
try {
|
|
245
|
+
fs.writeSync(fd, JSON.stringify(status, null, 2) + '\n');
|
|
246
|
+
try { fs.fsyncSync(fd); } catch {}
|
|
247
|
+
} finally {
|
|
248
|
+
fs.closeSync(fd);
|
|
249
|
+
}
|
|
247
250
|
fs.renameSync(temporary, statusPath);
|
|
248
251
|
}
|
|
249
252
|
|
|
@@ -475,9 +478,37 @@ if (!fs.existsSync(pipelinePath)) {
|
|
|
475
478
|
}
|
|
476
479
|
|
|
477
480
|
let pipeline;
|
|
481
|
+
let pipelineParseError = null;
|
|
478
482
|
try {
|
|
479
483
|
pipeline = JSON.parse(fs.readFileSync(pipelinePath, 'utf8'));
|
|
480
|
-
} catch {
|
|
484
|
+
} catch (error) {
|
|
485
|
+
pipelineParseError = error;
|
|
486
|
+
}
|
|
487
|
+
// Modern pipelines carry an `intent` field. If pipeline.json is present but
|
|
488
|
+
// unparseable, surface the error so the orchestrator can stop and report
|
|
489
|
+
// instead of falling back to legacyFlow() — which silently drops modern
|
|
490
|
+
// roles like `openspec-author`, `qa-tester`, and the test-planner trio.
|
|
491
|
+
if (pipelineParseError) {
|
|
492
|
+
if (fs.existsSync(pipelinePath)) {
|
|
493
|
+
const raw = fs.readFileSync(pipelinePath, 'utf8');
|
|
494
|
+
const hasModernIntent = /"intent"\s*:/.test(raw);
|
|
495
|
+
appendMetric({
|
|
496
|
+
eventId: `${status.metricsRunId || slug}:pipeline_parse_error:${Date.now()}`,
|
|
497
|
+
type: 'pipeline_parse_error',
|
|
498
|
+
at: now,
|
|
499
|
+
source: 'hook',
|
|
500
|
+
attributionConfidence: 'high',
|
|
501
|
+
error: String(pipelineParseError.message || pipelineParseError),
|
|
502
|
+
hasModernIntent,
|
|
503
|
+
});
|
|
504
|
+
if (hasModernIntent) {
|
|
505
|
+
writeStatus({ state: 'blocked', phase: 'blocked', currentAgent: 'task-router' });
|
|
506
|
+
process.stdout.write(JSON.stringify({
|
|
507
|
+
followup_message: `pipeline.json is malformed for slug "${slug}" — JSON parse error: ${pipelineParseError.message}. Re-run the task-router to regenerate pipeline.json, then resume via /task-continue ${slug}.`,
|
|
508
|
+
}));
|
|
509
|
+
process.exit(0);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
481
512
|
legacyFlow();
|
|
482
513
|
}
|
|
483
514
|
|
|
@@ -24,6 +24,7 @@ Claude topic `.md` files are **derived** from Cursor SoT `presets/cursor/mcp-ts/
|
|
|
24
24
|
| `agent-team-orchestrator.mdc` | `tooling-and-review/agent-team-orchestrator.md` |
|
|
25
25
|
| `anti-sycophancy-discipline.mdc` | `tooling-and-review/anti-sycophancy-discipline.md` |
|
|
26
26
|
| `code-quality-and-refactoring.mdc` | `tooling-and-review/code-quality.md` |
|
|
27
|
+
| `ai-local-overlay.mdc` | `tooling-and-review/ai-local-overlay.md` |
|
|
27
28
|
| `code-review-mr.mdc` | `tooling-and-review/code-review.md` |
|
|
28
29
|
| `design-guidance.mdc` | `tooling-and-review/design-guidance.md` |
|
|
29
30
|
| `mcp-usage.mdc` | `tooling-and-review/mcp-usage.md` |
|
|
@@ -19,8 +19,6 @@ Work request without `/task` — see **agent-team-intake** (when to suggest the
|
|
|
19
19
|
|---------|------|
|
|
20
20
|
| **`/task <desc>`** | **Preferred** — router → dynamic pipeline → first agent |
|
|
21
21
|
| `/task-continue <slug>` | After human gate or pause |
|
|
22
|
-
| `/feature-start <desc>` | Legacy: analyst-only start (no router) |
|
|
23
|
-
| `/feature-continue <slug>` | Alias of task-continue |
|
|
24
22
|
| `/spec-start [desc]` | Generate/bootstrap `docs/specs` — router intent `spec-gen` → analyst author mode → human gate |
|
|
25
23
|
| `/technical-retro [slug]` | Retro with agent team block |
|
|
26
24
|
|
|
@@ -159,7 +157,7 @@ After each agent completes, verify its terminal manifest receipt, then let the o
|
|
|
159
157
|
|
|
160
158
|
## Legacy mode
|
|
161
159
|
|
|
162
|
-
If `pipeline.json` is missing
|
|
160
|
+
If `pipeline.json` is missing, fall back to fixed phases: analysis → development → review → testing. Hook supports both.
|
|
163
161
|
|
|
164
162
|
## Skip pipeline when
|
|
165
163
|
|
|
@@ -190,4 +188,4 @@ When the work edits `packages/ai-rules/presets/**` (or dogfood `.cursor/` sync o
|
|
|
190
188
|
- **Review-only:** pipeline step = `security-reviewer` for threat/capability diffs; parent applies skill `code-review` for schema/contract/style (no `code-reviewer` agent in Phase 1).
|
|
191
189
|
- After TS changes, pipeline includes **build-verifier** with repository typecheck/test via `post-change-test` / `mcp-ts-tooling`.
|
|
192
190
|
|
|
193
|
-
**Product specs:** When `/task
|
|
191
|
+
**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.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Local overlay from .ai.local/ (consumer-owned rules with priority over preset rules) — MANDATORY
|
|
3
|
+
paths:
|
|
4
|
+
- "**/.ai.local/**"
|
|
5
|
+
- "**/AGENTS.md"
|
|
6
|
+
- "**/CLAUDE.md"
|
|
7
|
+
alwaysApply: false
|
|
8
|
+
impact: CRITICAL
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Local overlay (`.ai.local/`) — MANDATORY
|
|
12
|
+
|
|
13
|
+
This rule is mandatory. **You MUST** obey it on every turn, without exception.
|
|
14
|
+
|
|
15
|
+
## On every turn
|
|
16
|
+
|
|
17
|
+
1. **Probe** — before answering, run `ls -la .ai.local` from the repository root.
|
|
18
|
+
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.
|
|
19
|
+
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.
|
|
20
|
+
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.
|
|
21
|
+
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.
|
|
22
|
+
|
|
23
|
+
If `.ai.local/` does not exist → **no-op**, do not error. Do not produce any log line about its absence.
|
|
24
|
+
|
|
25
|
+
## Authoring `.ai.local/rules/*.md` (consumer-side reference)
|
|
26
|
+
|
|
27
|
+
Each `.ai.local/rules/<name>.md` is a plain-markdown rule body. The model parses it as:
|
|
28
|
+
|
|
29
|
+
- Lines before `## Body` are scope metadata. Only `glob:` / `globs:` / `override:` lines are recognised.
|
|
30
|
+
- Everything from `## Body` onward is the rule body.
|
|
31
|
+
- `glob: always` → always-on. Counts against your context budget.
|
|
32
|
+
- `globs: <comma-separated globs>` → on-demand; applies only when matching files are in focus.
|
|
33
|
+
- `override: kill <preset-rule-name>` → drop that preset rule from context.
|
|
34
|
+
|
|
35
|
+
Keep files ≤ 120 lines. Match the style of preset rules (short sections, bullets, code examples).
|
|
36
|
+
|
|
37
|
+
## Limitations (read this)
|
|
38
|
+
|
|
39
|
+
- 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%.
|
|
40
|
+
- If a user adds a file to `.ai.local/` mid-session, **restart the session** to be sure it is picked up.
|
|
41
|
+
- "Priority" is **contextual**, not enforced. Always re-read the local rule before answering questions that touch it.
|
|
42
|
+
- This rule is **not** session-start (Claude convention); it loads on touch of `.ai.local/**` or `AGENTS.md`/`CLAUDE.md`. The "every turn" mandate is enforced by the body text, not by Cursor/Claude loading semantics.
|
|
43
|
+
|
|
44
|
+
## Pointers
|
|
45
|
+
|
|
46
|
+
- Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package.
|
|
47
|
+
- Living gotchas alternative: `.claude/team/conventions.md`.
|
|
48
|
+
- 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.
|