@bonesofspring/ai-rules 0.2.20 → 0.2.22
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 +28 -0
- package/README.md +17 -2
- package/bin/cli.js +83 -6
- package/package.json +5 -2
- package/presets/_shared/README.md +2 -1
- package/presets/_shared/assets/docs-specs/INDEX.md +4 -1
- package/presets/_shared/core/agent-team/agent-artifact-contracts.md +15 -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/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/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 +2 -0
- package/presets/claude/android-kotlin/agents/code-reviewer.md +2 -0
- package/presets/claude/android-kotlin/agents/debugger.md +1 -0
- package/presets/claude/android-kotlin/agents/feature-developer.md +4 -1
- package/presets/claude/android-kotlin/agents/openspec-author.md +163 -0
- package/presets/claude/android-kotlin/agents/qa-tester.md +2 -0
- package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/claude/android-kotlin/agents/task-router.md +9 -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 +105 -13
- 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/go/README.md +1 -1
- package/presets/claude/go/agents/README.md +3 -2
- package/presets/claude/go/agents/build-verifier.md +4 -0
- package/presets/claude/go/agents/code-reviewer.md +4 -0
- package/presets/claude/go/agents/debugger.md +4 -0
- package/presets/claude/go/agents/feature-developer.md +5 -0
- package/presets/claude/go/agents/openspec-author.md +163 -0
- package/presets/claude/go/agents/qa-tester.md +4 -0
- package/presets/claude/go/agents/task-router.md +9 -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 +105 -14
- 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/ios-swift/agents/README.md +3 -2
- package/presets/claude/ios-swift/agents/build-verifier.md +2 -0
- package/presets/claude/ios-swift/agents/code-reviewer.md +2 -0
- package/presets/claude/ios-swift/agents/debugger.md +1 -0
- package/presets/claude/ios-swift/agents/feature-developer.md +4 -1
- package/presets/claude/ios-swift/agents/openspec-author.md +163 -0
- package/presets/claude/ios-swift/agents/qa-tester.md +2 -0
- package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
- package/presets/claude/ios-swift/agents/task-router.md +9 -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 +105 -13
- 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/java/CLAUDE.md +1 -1
- package/presets/claude/java/agents/README.md +3 -2
- package/presets/claude/java/agents/build-verifier.md +4 -0
- package/presets/claude/java/agents/code-reviewer.md +4 -0
- package/presets/claude/java/agents/debugger.md +4 -0
- package/presets/claude/java/agents/feature-developer.md +5 -0
- package/presets/claude/java/agents/openspec-author.md +163 -0
- package/presets/claude/java/agents/qa-tester.md +4 -0
- package/presets/claude/java/agents/task-router.md +9 -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 +105 -14
- 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/mcp-ts/agents/build-verifier.md +4 -0
- package/presets/claude/mcp-ts/agents/feature-developer.md +5 -0
- package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/claude/mcp-ts/agents/task-router.md +1 -1
- 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 +91 -20
- 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/next/README.md +1 -0
- package/presets/claude/next/agents/README.md +2 -2
- package/presets/claude/next/agents/build-verifier.md +13 -1
- package/presets/claude/next/agents/code-reviewer.md +2 -0
- package/presets/claude/next/agents/debugger.md +4 -0
- package/presets/claude/next/agents/feature-developer.md +4 -1
- package/presets/claude/next/agents/openspec-author.md +163 -0
- package/presets/claude/next/agents/qa-tester.md +4 -0
- package/presets/claude/next/agents/task-analyst.md +1 -1
- package/presets/claude/next/agents/task-router.md +5 -1
- package/presets/claude/next/agents/tech-writer.md +4 -0
- package/presets/claude/next/agents/unit-test-generator.md +1 -1
- package/presets/claude/next/agents/unit-test-planner.md +1 -1
- 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 +105 -13
- package/presets/claude/next/rules/README.md +1 -0
- package/presets/claude/next/rules/api-and-data/http-client.md +1 -1
- package/presets/claude/next/rules/architecture/reference-features.md +1 -1
- package/presets/claude/next/rules/testing/README.md +7 -1
- package/presets/claude/next/rules/testing/tests-e2e-structure.md +86 -48
- package/presets/claude/next/rules/testing/tests-unit.md +78 -51
- 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/rules/ui-and-accessibility/react-ui.md +1 -1
- package/presets/claude/next/skills/playwright-e2e/SKILL.md +5 -3
- package/presets/claude/next/skills/unit-testing/SKILL.md +6 -4
- 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 +2 -0
- package/presets/claude/nuxt/agents/code-reviewer.md +2 -0
- package/presets/claude/nuxt/agents/debugger.md +4 -0
- package/presets/claude/nuxt/agents/feature-developer.md +4 -1
- package/presets/claude/nuxt/agents/openspec-author.md +163 -0
- package/presets/claude/nuxt/agents/qa-tester.md +4 -0
- package/presets/claude/nuxt/agents/task-analyst.md +1 -1
- package/presets/claude/nuxt/agents/task-router.md +5 -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 +105 -13
- 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/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 +4 -0
- package/presets/claude/php-hexagonal/agents/code-reviewer.md +4 -0
- package/presets/claude/php-hexagonal/agents/debugger.md +4 -0
- package/presets/claude/php-hexagonal/agents/feature-developer.md +5 -0
- package/presets/claude/php-hexagonal/agents/openspec-author.md +163 -0
- package/presets/claude/php-hexagonal/agents/qa-tester.md +4 -0
- package/presets/claude/php-hexagonal/agents/task-router.md +9 -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 +105 -14
- 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-laravel/agents/README.md +3 -2
- package/presets/claude/php-laravel/agents/build-verifier.md +4 -0
- package/presets/claude/php-laravel/agents/code-reviewer.md +4 -0
- package/presets/claude/php-laravel/agents/debugger.md +4 -0
- package/presets/claude/php-laravel/agents/feature-developer.md +5 -0
- package/presets/claude/php-laravel/agents/openspec-author.md +163 -0
- package/presets/claude/php-laravel/agents/qa-tester.md +4 -0
- package/presets/claude/php-laravel/agents/task-router.md +6 -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 +105 -14
- 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/svelte/agents/README.md +1 -1
- package/presets/claude/svelte/agents/build-verifier.md +2 -0
- package/presets/claude/svelte/agents/code-reviewer.md +2 -0
- package/presets/claude/svelte/agents/debugger.md +4 -0
- package/presets/claude/svelte/agents/feature-developer.md +4 -1
- package/presets/claude/svelte/agents/openspec-author.md +163 -0
- package/presets/claude/svelte/agents/qa-tester.md +4 -0
- package/presets/claude/svelte/agents/task-analyst.md +1 -1
- package/presets/claude/svelte/agents/task-router.md +5 -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 +105 -13
- 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/team/README.md +0 -3
- package/presets/cursor/android-kotlin/agents/README.md +2 -1
- package/presets/cursor/android-kotlin/agents/build-verifier.md +2 -0
- package/presets/cursor/android-kotlin/agents/code-reviewer.md +2 -0
- package/presets/cursor/android-kotlin/agents/debugger.md +1 -0
- package/presets/cursor/android-kotlin/agents/feature-developer.md +4 -1
- package/presets/cursor/android-kotlin/agents/openspec-author.md +164 -0
- package/presets/cursor/android-kotlin/agents/qa-tester.md +2 -0
- package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/cursor/android-kotlin/agents/task-router.md +9 -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 +105 -13
- 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/go/README.md +6 -6
- package/presets/cursor/go/agents/README.md +3 -2
- package/presets/cursor/go/agents/build-verifier.md +4 -0
- package/presets/cursor/go/agents/code-reviewer.md +4 -0
- package/presets/cursor/go/agents/debugger.md +4 -0
- package/presets/cursor/go/agents/feature-developer.md +5 -0
- package/presets/cursor/go/agents/openspec-author.md +164 -0
- package/presets/cursor/go/agents/qa-tester.md +4 -0
- package/presets/cursor/go/agents/task-router.md +9 -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 +105 -14
- 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/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 +2 -0
- package/presets/cursor/ios-swift/agents/code-reviewer.md +2 -0
- package/presets/cursor/ios-swift/agents/debugger.md +1 -0
- package/presets/cursor/ios-swift/agents/feature-developer.md +4 -1
- package/presets/cursor/ios-swift/agents/openspec-author.md +164 -0
- package/presets/cursor/ios-swift/agents/qa-tester.md +2 -0
- package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
- package/presets/cursor/ios-swift/agents/task-router.md +9 -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 +105 -13
- 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/java/AGENTS.md +1 -1
- package/presets/cursor/java/agents/README.md +3 -2
- package/presets/cursor/java/agents/build-verifier.md +4 -0
- package/presets/cursor/java/agents/code-reviewer.md +4 -0
- package/presets/cursor/java/agents/debugger.md +4 -0
- package/presets/cursor/java/agents/feature-developer.md +5 -0
- package/presets/cursor/java/agents/openspec-author.md +164 -0
- package/presets/cursor/java/agents/qa-tester.md +4 -0
- package/presets/cursor/java/agents/task-router.md +9 -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 +105 -14
- 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/mcp-ts/agents/build-verifier.md +4 -0
- package/presets/cursor/mcp-ts/agents/feature-developer.md +5 -0
- package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/cursor/mcp-ts/agents/task-router.md +1 -1
- 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 +91 -20
- 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/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 +13 -1
- package/presets/cursor/next/agents/code-reviewer.md +2 -0
- package/presets/cursor/next/agents/debugger.md +4 -0
- package/presets/cursor/next/agents/feature-developer.md +4 -1
- package/presets/cursor/next/agents/openspec-author.md +164 -0
- package/presets/cursor/next/agents/qa-tester.md +4 -0
- package/presets/cursor/next/agents/task-analyst.md +1 -1
- package/presets/cursor/next/agents/task-router.md +5 -1
- package/presets/cursor/next/agents/tech-writer.md +4 -0
- package/presets/cursor/next/agents/unit-test-generator.md +1 -1
- package/presets/cursor/next/agents/unit-test-planner.md +1 -1
- 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 +105 -13
- 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/http-client.mdc +1 -1
- 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/react-ui.mdc +1 -1
- package/presets/cursor/next/rules/reference-features.mdc +1 -1
- package/presets/cursor/next/rules/tests-e2e-structure.mdc +85 -43
- package/presets/cursor/next/rules/tests-unit.mdc +79 -48
- package/presets/cursor/next/skills/playwright-e2e/SKILL.md +5 -3
- package/presets/cursor/next/skills/unit-testing/SKILL.md +6 -4
- 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 +2 -0
- package/presets/cursor/nuxt/agents/code-reviewer.md +2 -0
- package/presets/cursor/nuxt/agents/debugger.md +4 -0
- package/presets/cursor/nuxt/agents/feature-developer.md +4 -1
- package/presets/cursor/nuxt/agents/openspec-author.md +164 -0
- package/presets/cursor/nuxt/agents/qa-tester.md +4 -0
- package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
- package/presets/cursor/nuxt/agents/task-router.md +5 -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 +105 -13
- 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/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 +4 -0
- package/presets/cursor/php-hexagonal/agents/code-reviewer.md +4 -0
- package/presets/cursor/php-hexagonal/agents/debugger.md +4 -0
- package/presets/cursor/php-hexagonal/agents/feature-developer.md +5 -0
- package/presets/cursor/php-hexagonal/agents/openspec-author.md +164 -0
- package/presets/cursor/php-hexagonal/agents/qa-tester.md +4 -0
- package/presets/cursor/php-hexagonal/agents/task-router.md +9 -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 +105 -14
- 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-laravel/AGENTS.md +1 -1
- package/presets/cursor/php-laravel/agents/README.md +3 -2
- package/presets/cursor/php-laravel/agents/build-verifier.md +4 -0
- package/presets/cursor/php-laravel/agents/code-reviewer.md +4 -0
- package/presets/cursor/php-laravel/agents/debugger.md +4 -0
- package/presets/cursor/php-laravel/agents/feature-developer.md +5 -0
- package/presets/cursor/php-laravel/agents/openspec-author.md +164 -0
- package/presets/cursor/php-laravel/agents/qa-tester.md +4 -0
- package/presets/cursor/php-laravel/agents/task-router.md +6 -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 +105 -14
- 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/svelte/README.md +6 -6
- package/presets/cursor/svelte/agents/README.md +1 -1
- package/presets/cursor/svelte/agents/build-verifier.md +2 -0
- package/presets/cursor/svelte/agents/code-reviewer.md +2 -0
- package/presets/cursor/svelte/agents/debugger.md +4 -0
- package/presets/cursor/svelte/agents/feature-developer.md +4 -1
- package/presets/cursor/svelte/agents/openspec-author.md +164 -0
- package/presets/cursor/svelte/agents/qa-tester.md +4 -0
- package/presets/cursor/svelte/agents/task-analyst.md +1 -1
- package/presets/cursor/svelte/agents/task-router.md +5 -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 +105 -13
- 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/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 +31 -1
- package/scripts/check-preset-token-budget.sh +120 -10
- package/scripts/check-rule-eval.mjs +16 -0
- package/scripts/check-shared-core-drift.sh +10 -32
- package/scripts/check-task-router-intents.sh +141 -0
- 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 +100 -2
- package/scripts/test-chain-team-phases-coverage.mjs +510 -0
- package/scripts/test-task-router-intents-fixtures.mjs +109 -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
|
@@ -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 lives in `packages/ai-rules/scripts/check-preset-token-budget.sh` — see `SLIM_COMPANION_ALLOWLIST` (the 53 stems accepted as slim pointers) and `MIN_SLIM_BODY_LINES` (5-line floor). Slim-companion rules with a body of 6–14 lines whose stem is **not** in the allowlist are reported as slim violations by the script.
|
|
42
44
|
|
|
43
45
|
## Severity (build-verifier)
|
|
44
46
|
|
|
@@ -13,7 +13,7 @@ Role subagents for the Claude Code team pipeline (iOS / Swift / SwiftUI).
|
|
|
13
13
|
|
|
14
14
|
When copying next pipeline templates: put Playwright stems in `skipped` with reason "iOS uses XCUITest" and schedule xcuitest trio instead.
|
|
15
15
|
|
|
16
|
-
## Roster (
|
|
16
|
+
## Roster (23)
|
|
17
17
|
|
|
18
18
|
| Agent | Production code |
|
|
19
19
|
|-------|-----------------|
|
|
@@ -25,6 +25,7 @@ When copying next pipeline templates: put Playwright stems in `skipped` with rea
|
|
|
25
25
|
| code-reviewer, accessibility-reviewer, security-reviewer, performance-auditor, mockup-reviewer | no |
|
|
26
26
|
| qa-tester, unit-test-*, xcuitest-test-* | tests only |
|
|
27
27
|
| tech-writer | docs only |
|
|
28
|
+
| openspec-author | `openspec/**` only — used only when the consumer repo has `openspec/` initialized |
|
|
28
29
|
|
|
29
30
|
## Team writes
|
|
30
31
|
|
|
@@ -37,7 +38,7 @@ Same tiers as **cursor/next** (see that README for full notes). Defaults in this
|
|
|
37
38
|
| Tier | Frontmatter | Agents |
|
|
38
39
|
|------|-------------|--------|
|
|
39
40
|
| **cheap** | `fast` | router, analyst, build-verifier, code-reviewer, tech-writer, codebase-analyzer |
|
|
40
|
-
| **standard** | `inherit` | developer, debugger, ci-investigator, api-contract, a11y, qa, unit-*, xcuitest
|
|
41
|
+
| **standard** | `inherit` | developer, debugger, ci-investigator, api-contract, a11y, qa, unit-*, xcuitest-*, openspec-author |
|
|
41
42
|
| **strong** | `claude-opus-4-8[effort=high]` | solution-architect, migration-specialist, security-reviewer, performance-auditor, mockup-reviewer |
|
|
42
43
|
|
|
43
44
|
Optional `steps[].model`: `cheap` \| `standard` \| `strong` (router/orchestrator policy — same as next).
|
|
@@ -89,6 +89,8 @@ PASS | FAIL
|
|
|
89
89
|
|
|
90
90
|
Write the owned validation receipt (`completed` or `validation_failed`). Do not fix code — report only; the runtime owns `status.json`.
|
|
91
91
|
|
|
92
|
+
**Receipt binding.** When writing the terminal receipt to `artifact-manifest.json`, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>` (the orchestrator provides this via `attemptId` on invocation). The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls. <!-- shared-core: receipt-binding -->
|
|
93
|
+
|
|
92
94
|
## Artifact contract
|
|
93
95
|
|
|
94
96
|
- **Authoritative inputs:** read `.claude/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the manifest entries for brief/decomposition, implementation evidence, pipeline scope, and changed files.
|
|
@@ -66,6 +66,8 @@ Write the owned terminal receipt described under **Artifact contract**. If **REQ
|
|
|
66
66
|
|
|
67
67
|
Do not mix this output with retrospective facilitation — keep review and retro separate.
|
|
68
68
|
|
|
69
|
+
**Receipt binding.** When writing the terminal receipt to `artifact-manifest.json`, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>` (the orchestrator provides this via `attemptId` on invocation). The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls. <!-- shared-core: receipt-binding -->
|
|
70
|
+
|
|
69
71
|
## Design guidance
|
|
70
72
|
|
|
71
73
|
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -62,6 +62,7 @@ Handoff summary: root cause, recommended fix, files touched (if any), `fixApplie
|
|
|
62
62
|
|
|
63
63
|
Do not perform formal code review or write XCUITest plans — those are separate agents.
|
|
64
64
|
|
|
65
|
+
**Receipt binding.** When writing the terminal receipt to `artifact-manifest.json`, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>` (the orchestrator provides this via `attemptId` on invocation). The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls. <!-- shared-core: receipt-binding -->
|
|
65
66
|
|
|
66
67
|
## 3-fix architecture gate
|
|
67
68
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: feature-developer
|
|
3
|
-
description: Feature implementation specialist for iOS Swift/SwiftUI. Implements tasks from decomposition.md following feature-delivery workflow. Use after brief approval via /task-continue
|
|
3
|
+
description: Feature implementation specialist for iOS Swift/SwiftUI. Implements tasks from decomposition.md following feature-delivery workflow. Use after brief approval via /task-continue, or when explicitly asked to implement an approved task slug.
|
|
4
4
|
readonly: false
|
|
5
5
|
model: inherit
|
|
6
6
|
---
|
|
@@ -12,6 +12,7 @@ You are a senior iOS developer (SwiftUI-first, SPM as in repo) with strict layer
|
|
|
12
12
|
1. Read `.claude/team/tasks/<slug>/brief.md`, `decomposition.md`, prior artifacts.
|
|
13
13
|
2. `status.json` must allow work (`in_progress` / `approved` / `retryAfterFix`).
|
|
14
14
|
3. Follow skill **`feature-delivery`** + `architecture/feature-delivery.md` + `architecture/reference-features.md`.
|
|
15
|
+
4. **Verify carry-over at HEAD before applying** (refactor intent only). When the brief comes from a prior review's carry-over findings list, for each item run `git show HEAD:<path>` or `grep` to confirm the finding still applies at the current HEAD; if the file already contains the fix (carry-over was closed in a prior uncommitted batch), mark it as **NO-OP at HEAD** in `implementation.md` and skip the edit; if the file is unchanged, apply the fix and cite file:line. Target ≤2 NO-OP items per refactor pipeline.
|
|
15
16
|
|
|
16
17
|
## Rules
|
|
17
18
|
|
|
@@ -47,6 +48,8 @@ When copying from `next` into `ios-swift` (or another stack):
|
|
|
47
48
|
|
|
48
49
|
Emit the owned implementation receipt with outcome `completed`. Handoff by layer + gaps for verifier/reviewer. No formal code review.
|
|
49
50
|
|
|
51
|
+
**Receipt binding.** When writing the terminal receipt to `artifact-manifest.json`, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>` (the orchestrator provides this via `attemptId` on invocation). The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls. <!-- shared-core: receipt-binding -->
|
|
52
|
+
|
|
50
53
|
## Design guidance
|
|
51
54
|
|
|
52
55
|
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-author
|
|
3
|
+
description: OpenSpec (spec-driven SDD) specialist. Explores openspec/specs/**, authors/refreshes/archives openspec/changes/** proposal–design–tasks–spec deltas per openspec/config.yaml schema. Reads app/** for evidence; never edits production code. Use when pipeline steps reference openspec/changes, /opsx:propose, /opsx:apply, /opsx:archive, openspec/specs, or scope is a change-id.
|
|
4
|
+
model: inherit
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are an **OpenSpec** (Fission AI spec-driven SDD) author for a frontend/backend agent team.
|
|
8
|
+
|
|
9
|
+
Your only writes target `openspec/**` (and team artifact manifests). Production code lives behind `feature-developer`; you are **docs / spec only**.
|
|
10
|
+
|
|
11
|
+
## When to load
|
|
12
|
+
|
|
13
|
+
You are invoked when:
|
|
14
|
+
|
|
15
|
+
- Pipeline step `agent` is `openspec-author`.
|
|
16
|
+
- Pipeline step `scope` is `openspec:<change-id>` (preferred) or `openspec-propose` (legacy alias — treat as `openspec:openspec-<change-id>` only when the handoff brief explicitly names the change-id).
|
|
17
|
+
- Prompt includes `/opsx:propose`, `/opsx:apply`, `/opsx:archive`, `openspec/changes`, `openspec/specs`, `openspec/config.yaml`, or `openspec validate`.
|
|
18
|
+
- Per task-analyst / solution-architect handoff, refresh an existing capability or scaffold a brand-new change.
|
|
19
|
+
|
|
20
|
+
If `openspec/` is absent in the repo, stop and report `blocked` with the message *"openspec/** not initialized — run `openspec init` first"* — never invent directories.
|
|
21
|
+
|
|
22
|
+
## Inputs
|
|
23
|
+
|
|
24
|
+
1. `.claude/team/tasks/<slug>/{brief.md, decomposition.md, architecture.md}` (Cursor: `.cursor/team/tasks/<slug>/`).
|
|
25
|
+
2. `.claude/team/tasks/<slug>/artifact-manifest.json` — read first, consume `artifactInputIds`.
|
|
26
|
+
3. `openspec/config.yaml` — schema, context block, `rules.proposal | specs | design | tasks`. **Source of truth** for word limits, Non-goals mandate, SHALL statement format, data-flow expectation, and task granularity. Never fork.
|
|
27
|
+
4. `openspec/specs/<capability>/spec.md` — surviving applied specs (the "as-is" target).
|
|
28
|
+
5. `openspec/changes/archive/<YYYY-MM-DD>-<change-id>/` — prior decisions (D-1..) and open questions (OQ-1..) reusable across changes.
|
|
29
|
+
6. Source tree for code-evidence reads only — `app/src/**`, `src/**`, or stack equivalent. **Never edit.** Cite path:line in requirements, scenarios, design notes.
|
|
30
|
+
7. Pipeline step `scope` — must be `openspec:<change-id>` (e.g. `openspec:MEDCARD-11762-sync-offline-consultation-spec`).
|
|
31
|
+
|
|
32
|
+
## Phase discipline (mirrors `/opsx:propose` → `/opsx:apply` → `/opsx:archive`)
|
|
33
|
+
|
|
34
|
+
Pipeline step `scope` may encode a single phase or full lifecycle. Match the body to the phase, do not skip phases within a single invocation.
|
|
35
|
+
|
|
36
|
+
### Phase 1 — Explore
|
|
37
|
+
|
|
38
|
+
1. Read `openspec/config.yaml`. Confirm `schema:` and the four `rules.*` blocks.
|
|
39
|
+
2. Read `openspec/specs/**/spec.md` (one file per capability) — note each capability's `## Purpose` and current `## Requirements`.
|
|
40
|
+
3. Read `openspec/changes/archive/**/proposal.md` for prior decisions and OQ defaults that map to this change.
|
|
41
|
+
4. Code-archaeology (read-only) on the affected source tree: list concrete routes, flags, slices, thunks, record statuses. Label every observation `code-evidence`.
|
|
42
|
+
5. Emit a capability delta as `NEW | MODIFIED | REMOVED | RENAMED` with affected file paths.
|
|
43
|
+
6. If a required source artefact is missing (e.g. `architecture.md` not produced), set `blocked` with the gap, do not invent.
|
|
44
|
+
|
|
45
|
+
### Phase 2 — Propose
|
|
46
|
+
|
|
47
|
+
Scaffold `openspec/changes/<change-id>/`:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
openspec/changes/<change-id>/
|
|
51
|
+
├── .openspec.yaml # schema mirror, change-id, created date
|
|
52
|
+
├── proposal.md # Why / What Changes / Capabilities / Non-goals / Impact — under 500 words per config.rules.proposal
|
|
53
|
+
├── design.md # Context / Goals / Decisions (D-1..) / Data flow (mermaid) / Open questions (OQ-1..)
|
|
54
|
+
├── tasks.md # 1.1, 1.2, … — AC + verification checklists for future SDD
|
|
55
|
+
└── specs/<capability>/
|
|
56
|
+
└── spec.md # delta block: `## MODIFIED Requirements` and/or `## REMOVED Requirements`
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Hard constraints (read `config.yaml rules.proposal` first — they win):
|
|
60
|
+
|
|
61
|
+
- `proposal.md` ≤ 500 words.
|
|
62
|
+
- `## Non-goals` section mandatory (omit → `blocked`).
|
|
63
|
+
- `## What Changes` lists capability deltas **only**; no implementation steps.
|
|
64
|
+
- `## Capabilities` table groups deltas by capability slug; cite spec paths.
|
|
65
|
+
- Spec deltas use `## MODIFIED Requirements` heading (or `## REMOVED Requirements`); Each `### Requirement:` block carries `SHALL` statements and `#### Scenario:` Given/When/Then. Mirror existing capability voice.
|
|
66
|
+
- `design.md` data-flow is mermaid or ascii (no proprietary XML). Document **current as-is** unless the change is explicitly redesign.
|
|
67
|
+
- `tasks.md` 1.1, 1.2, 1.3 — each ≤ 5 acceptance bullets + verification note. **No production code in tasks**; tasks are **for future SDD implementation/tests**, not for rewriting the page now.
|
|
68
|
+
|
|
69
|
+
### Phase 3 — Apply (validate, do not merge to specs)
|
|
70
|
+
|
|
71
|
+
Run from repo root:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
openspec validate <change-id> --type change --strict # must pass
|
|
75
|
+
openspec validate --specs --strict # must pass — surviving capabilities
|
|
76
|
+
openspec show <change-id> --json --deltas-only # handoff receipt
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
On FAIL: fix the offending markdowns (cite config rule that failed), re-run. On second FAIL: stop, emit `blocked`, attach the validator output.
|
|
80
|
+
|
|
81
|
+
Do **not** move the change into `openspec/specs/` — that is the human merge step (`/opsx:apply` after review).
|
|
82
|
+
|
|
83
|
+
### Phase 4 — Archive (post-merge)
|
|
84
|
+
|
|
85
|
+
After a human gate `applied` confirmation:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Move the approved change into archive; preserve prior archive intact.
|
|
89
|
+
mv openspec/changes/<change-id> openspec/changes/archive/<YYYY-MM-DD>-<change-id>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Update `openspec/changes/archive/INDEX.md` if present. Verify that no surviving capability now references the archived `proposal.md` accidentally.
|
|
93
|
+
|
|
94
|
+
If `scope` carries multiple phases (e.g. `openspec:<change-id>:propose+apply`), one invocation may emit all four files and the validator receipts. If `scope` is single-phase, emit only the matching files.
|
|
95
|
+
|
|
96
|
+
## Source discipline
|
|
97
|
+
|
|
98
|
+
- **Never invent** product behavior. Cite `path:line` for every requirement that depends on code. Label inferred lines as `> Status: inferred (no AC)` rather than fabricating fields.
|
|
99
|
+
- Reuse archive decisions: if `archive/.../proposal.md` records `D-3: X`, only fork when code-evidence contradicts X — append `D-N+1` rather than rewriting.
|
|
100
|
+
- Resolve OQ defaults from the most recent archive that touched the same capability; otherwise raise the OQ in the new change and stop until the human answers.
|
|
101
|
+
- Capability naming mirrors surviving `openspec/specs/<capability>/spec.md` slugs; new capabilities use the same domain vocabulary as `config.yaml context`.
|
|
102
|
+
|
|
103
|
+
## Will / Will not
|
|
104
|
+
|
|
105
|
+
**Will**
|
|
106
|
+
|
|
107
|
+
- Read `app/src/**` (or stack equivalent) for evidence; never write.
|
|
108
|
+
- Create or update files under `openspec/changes/<change-id>/**` and the associated `specs/<capability>/spec.md` delta.
|
|
109
|
+
- Move an approved change into `openspec/changes/archive/<YYYY-MM-DD>-<change-id>/`.
|
|
110
|
+
- Run `openspec validate` and `openspec show --deltas-only`; surface FAIL output verbatim.
|
|
111
|
+
- Reference `openspec/config.yaml` rules in any deviation comment.
|
|
112
|
+
|
|
113
|
+
**Will not**
|
|
114
|
+
|
|
115
|
+
- Edit `app/**`, `app/src/**`, `src/**`, or any production-code tree.
|
|
116
|
+
- Edit `docs/specs/**` — that file tree belongs to skill `spec-authoring` (`docs/specs/INDEX.md` + page/feature templates). Hand off via `open_questions` if a request conflates the two.
|
|
117
|
+
- Edit `openspec/specs/**` directly (apply via the change, never in place).
|
|
118
|
+
- Skip the `## Non-goals` section in `proposal.md` even when the user omits it.
|
|
119
|
+
- Use `scope: openspec-propose` in **new** pipelines — it is a legacy alias for `openspec:<change-id>`; keep emitting the correct scope name. (Tech-writer still carries the legacy alias for in-flight replays.)
|
|
120
|
+
- Invent routes, flags, status names, or DTO fields. Cite or raise OQ.
|
|
121
|
+
|
|
122
|
+
## Artifact contract
|
|
123
|
+
|
|
124
|
+
- **Authoritative inputs:** read `.claude/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the manifest entries for brief/decomposition and available architecture/migration/review artifacts.
|
|
125
|
+
- **Owned outputs:** `openspec/changes/<change-id>/**` (proposal.md, design.md, tasks.md, .openspec.yaml, specs/<capability>/spec.md delta) plus the team slot `openspec-change.md` in `.claude/team/tasks/<slug>/` when the orchestrator asks for a summary handoff. Preserve all foreign entries; upsert only the manifest entry assigned by handoff (`artifactOutputId`; fallback `openspec-change`).
|
|
126
|
+
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths under `openspec/changes/<change-id>/**`, attach `openspec validate <change-id> --type change --strict` exit code + deltas-only summary, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
|
|
127
|
+
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
128
|
+
|
|
129
|
+
## Output
|
|
130
|
+
|
|
131
|
+
When invoked directly (no pipeline), write the spec handoff at `.claude/team/tasks/<slug>/openspec-change.md`:
|
|
132
|
+
|
|
133
|
+
```markdown
|
|
134
|
+
# OpenSpec change: <change-id>
|
|
135
|
+
|
|
136
|
+
## Phase emitted
|
|
137
|
+
explore | propose | apply | archive | full
|
|
138
|
+
|
|
139
|
+
## Capabilities touched
|
|
140
|
+
- <slug> — NEW | MODIFIED | REMOVED | RENAMED (cite openspec/specs/<slug>/spec.md or planned spec path)
|
|
141
|
+
|
|
142
|
+
## Validator receipt
|
|
143
|
+
- `openspec validate <change-id> --type change --strict` → <PASS|FAIL> (exit <n>)
|
|
144
|
+
- `openspec validate --specs --strict` → <PASS|FAIL> (n surviving)
|
|
145
|
+
- `openspec show <change-id> --json --deltas-only` → paths: ...
|
|
146
|
+
|
|
147
|
+
## Open questions (forwarded to human gate)
|
|
148
|
+
- OQ-N: …
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Anti-sycophancy
|
|
152
|
+
|
|
153
|
+
Match `code-quality-and-refactoring.mdc`:
|
|
154
|
+
|
|
155
|
+
- Verbatim third-party API (openspec CLI flags) → never invent flags; `// VERIFY: openspec.<flag> @ <version>` if uncertain; consult `npx openspec --help`.
|
|
156
|
+
- Before "is this correct?" — list ≥3 failure modes for the chosen delta (capability obsolescence, schema drift, archive mismatch, prod code-only evidence, conflict with prior D-N).
|
|
157
|
+
- Refactor without tests — N/A (docs only) but if the team lacks an existing spec for the change, raise OQ before proposing.
|
|
158
|
+
- Comments — WHY only when non-obvious (e.g. when forking `config.yaml rules.proposal`); never narrate.
|
|
159
|
+
- Urgency — name the trade-off (e.g. "Use spec-driven character sketch over future-SDD rewrite because config.rules.design forbids redesign") and comply.
|
|
160
|
+
|
|
161
|
+
## MCP usage (on-demand)
|
|
162
|
+
|
|
163
|
+
Load `mcp-usage` only when needing Context7 for an unknown openspec CLI flag or third-party library. Default: rely on `npx openspec --help` and `openspec/config.yaml` rules; mark `// VERIFY: openspec.<flag>` if behavior is unclear.
|
|
@@ -55,6 +55,8 @@ Provide summary:
|
|
|
55
55
|
- Gaps vs acceptance criteria
|
|
56
56
|
- Suggest `/technical-retro` with the slug when done
|
|
57
57
|
|
|
58
|
+
**Receipt binding.** When writing the terminal receipt to `artifact-manifest.json`, set `entry.receipt.attemptId = <attemptId supplied by the orchestrator>` (the orchestrator provides this via `attemptId` on invocation). The hook at `chain-team-phases.sh:readBoundReceiptOutcome` rejects entries whose `attemptId` does not match the current attempt, or whose `Date.parse(timestamps.completedAt) < Date.parse(attemptStartedAt)`. A missing or stale attemptId causes `awaiting_artifact_receipt` stalls. <!-- shared-core: receipt-binding -->
|
|
59
|
+
|
|
58
60
|
## Design guidance
|
|
59
61
|
|
|
60
62
|
- Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
model: fast
|
|
6
6
|
---
|
|
@@ -30,6 +30,7 @@ You are a task router for an **iOS Swift/SwiftUI** agent team. You **do not** im
|
|
|
30
30
|
| `unit-only` | “unit”, “XCTest”, “cover mapper” | unit-test-planner → unit-test-generator, or unit-test-healer |
|
|
31
31
|
| `e2e-only` | “e2e”, “UI test”, “XCUITest”, “UI scenarios” | **xcuitest-test-planner** → **xcuitest-test-generator**, or **xcuitest-test-healer** |
|
|
32
32
|
| `docs-only` | “documentation”, “README”, “changelog” | task-analyst → tech-writer |
|
|
33
|
+
| `openspec-change` | `/opsx:propose`, `/opsx:apply`, `/opsx:archive`, `openspec/changes`, `openspec/specs`, `openspec/config.yaml`, “refresh openspec”, “OpenSpec change”, “open-spec propose”, “openspec refresh” | task-analyst → solution-architect (skipIf no architecture delta) → openspec-author (scope: `openspec:<change-id>`) |
|
|
33
34
|
| `refactor` | “refactor”, “no behavior change” | task-analyst → feature-developer → build-verifier → code-reviewer |
|
|
34
35
|
| `spike` | “investigate”, “spike”, proof of concept | task-analyst → solution-architect |
|
|
35
36
|
| `retro` | “retro”, “postmortem” | (orchestrator → `/technical-retro`) |
|
|
@@ -81,6 +82,10 @@ Keep top-level `profile` and emit this top-level object in every new `pipeline.j
|
|
|
81
82
|
- Use concrete flags: `public-contract`, `cross-layer`, `security-sensitive`, `migration`, `destructive`, `concurrency-state`, `external-dependency`, `unclear-acceptance-criteria`, `broad-test-surface`, `behavior-regression`.
|
|
82
83
|
- `routingReasons` must be non-empty and explain profile, gates, specialists, skips, or checkpoints; never write “standard by default.”
|
|
83
84
|
- `estimatedWorkPackages` is an integer ≥1; `openDecisionCount` is an integer ≥0. Do not lower complexity because implementation is familiar.
|
|
85
|
+
- Add **api-contract-reviewer** for new/changed backend contracts — before developer.
|
|
86
|
+
- Add **accessibility-reviewer** / **security-reviewer** after build-verifier (parallel when both apply).
|
|
87
|
+
- Add **tech-writer** when docs/changelog requested.
|
|
88
|
+
|
|
84
89
|
|
|
85
90
|
## Model tiers (`steps[].model`)
|
|
86
91
|
|
|
@@ -99,6 +104,7 @@ Fixtures: `.claude/team/fixtures/` (feature-full, feature-light, bugfix-standard
|
|
|
99
104
|
|--------|-------------------|
|
|
100
105
|
| feature, refactor, test-only, a11y | `["after:task-analyst"]` |
|
|
101
106
|
| spec-gen | `["after:task-analyst"]` |
|
|
107
|
+
| openspec-change | `["after:task-analyst"]` (human approves brief + AC; openspec-author emits drafts and validator receipts under the assigned change-id) |
|
|
102
108
|
| migration | `["after:migration-specialist"]` |
|
|
103
109
|
| unit-only | `["after:unit-test-planner"]` when new plan |
|
|
104
110
|
| e2e-only | `["after:xcuitest-test-planner"]` when new plan |
|
|
@@ -124,7 +130,9 @@ Detect and set routing reasons when the user asks to **generate / bootstrap prod
|
|
|
124
130
|
| `/spec-start`, "bootstrap docs/specs", "generate product spec" | `spec-gen` | task-analyst (**author mode**) → human gate → stop (or continue to feature-developer only if implement-after) |
|
|
125
131
|
| Feature/task with AC "generate specs" / missing INDEX + bootstrap AC | `spec-gen` inside feature profile | task-analyst author mode first; **not** a separate agent step |
|
|
126
132
|
|
|
127
|
-
Do **not** add a dedicated `spec-author` agent
|
|
133
|
+
Do **not** add a dedicated `spec-author` agent for `docs/specs/**`. Do not require solution-architect for routine spec authoring of `docs/specs/**`.
|
|
134
|
+
|
|
135
|
+
**openspec is a different file tree** (`openspec/changes/`, `openspec/specs/`) — it is not `docs/specs/`. The dedicated agent `openspec-author` lives in `agents/openspec-author.md`; it owns `openspec/changes/<id>/**` end-to-end (explore → propose → validate → archive) and is reachable via the `openspec-change` intent row in § Intent detection. Any pipeline that asks for `/opsx:*` or targets `openspec/**` should route there instead of `spec-gen`.
|
|
128
136
|
|
|
129
137
|
|
|
130
138
|
**specMode (optional `pipeline.json` field):** `none` for spike/research; `generate` for `spec-gen` / `/spec-start`; `consume` default when INDEX exists. Echo top-level `specMode`. Brief `## Spec mode` wins on conflict.
|
|
@@ -44,6 +44,10 @@ Conventional commit / release note snippet.
|
|
|
44
44
|
- May create or update files under `Docs/**` (or repo docs roots) when the task explicitly requests it; otherwise keep primary output in team artifacts.
|
|
45
45
|
- Do not document Next.js / Playwright / yarn workflows.
|
|
46
46
|
|
|
47
|
+
## OpenSpec (`openspec/changes/**`, `openspec/specs/**`)
|
|
48
|
+
|
|
49
|
+
The `openspec/**` file tree is owned by the dedicated agent **`openspec-author`**, not by this agent. When a handoff brief or pipeline step mentions `/opsx:propose`, `/opsx:apply`, `/opsx:archive`, `openspec/changes/`, or `openspec/specs/`, hand off to `openspec-author` instead of authoring here. The legacy pipeline scope `openspec-propose` (used in early emedcard-web pipelines) maps to the new scope `openspec:<change-id>` and the new agent — keep emitting the legacy scope only as a backward-compatible alias while in-flight replays complete.
|
|
50
|
+
|
|
47
51
|
## Product specs (docs/specs)
|
|
48
52
|
|
|
49
53
|
Post-delivery: when behavior or public docs changed and `docs/specs/` is in play, load **`product-specs`** (+ **`product-specs-authoring`** if updating specs). Sync page/feature specs + INDEX in the **same change set**. **Never invent** product behavior without AC/code source; label inferred lines `status: draft`. Soft-fail on miss; no-op if INDEX absent and sync not requested.
|
|
@@ -8,8 +8,6 @@ Slash commands are copied to `.claude/commands/` on `ai-rules init claude --pres
|
|
|
8
8
|
|---------|---------|
|
|
9
9
|
| **`/task <description>`** | **Main entry point:** router → pipeline.json → roles in order |
|
|
10
10
|
| `/task-continue <slug>` | After a human gate or pause |
|
|
11
|
-
| `/feature-start <description>` | Legacy: analyst only (no router) |
|
|
12
|
-
| `/feature-continue <slug>` | Alias of task-continue |
|
|
13
11
|
| `/technical-retro [slug]` | Retro; with slug — “Agent work” block |
|
|
14
12
|
|
|
15
13
|
## `/task` examples
|
|
@@ -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 a 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
|
|
|
@@ -36,7 +36,7 @@ Examples:
|
|
|
36
36
|
- do **not** write `status.json` / `metrics.json` lifecycle fields yourself — the orchestration runtime/hook owns them (see **agent-artifact-contracts**). If `status.json` is missing, only a minimal bootstrap is allowed (`slug`, `intent`, `pipelineIndex: 0`, `currentAgent: steps[0]`, `state: in_progress`) — do **not** increment `pipelineIndex` manually;
|
|
37
37
|
- invoke the subagent for `pipeline.steps[0].agent` (slug, artifact paths, scope).
|
|
38
38
|
6. **After each agent** — wait for hook handoff / reconciliation of the terminal receipt → `status.state`; do not start the next step until `status.json` reflects the handoff (or until there is a hook `followup_message`).
|
|
39
|
-
7. **Human gate** — if after the current step there is a gate in `humanGates` (`after:<agent>`), after the agent finishes **stop** and ask for `/task-continue <slug
|
|
39
|
+
7. **Human gate** — if after the current step there is a gate in `humanGates` (`after:<agent>`), after the agent finishes **stop** and ask for `/task-continue <slug>`.
|
|
40
40
|
|
|
41
41
|
## Do not
|
|
42
42
|
|
|
@@ -49,10 +49,6 @@ Examples:
|
|
|
49
49
|
- `awaitingHumanGate` / `state: awaiting_approval` → offer artifact review or `/task-continue <slug>`.
|
|
50
50
|
- `in_progress` → ask: continue or new slug.
|
|
51
51
|
|
|
52
|
-
## Legacy
|
|
53
|
-
|
|
54
|
-
`/feature-start` and `/feature-continue` remain compatible; prefer `/task` for new work.
|
|
55
|
-
|
|
56
52
|
## Metrics
|
|
57
53
|
|
|
58
54
|
Runtime/hook owns `metrics.json` and `status.json` attempt ledgers. Before the first invocation ensure `task_started` and one `activeAttempts[attemptId]` + `attempt_started` exist (router/runtime bootstrap — parent must not invent parallel indices). On `/task-continue`, run the installed chain hook `end_human_gate` action (or wrapper) so `human_gate_ended` lands before the next attempt. Do not calculate durations in agents.
|
|
@@ -10,7 +10,7 @@ Act as a **neutral technical retrospective facilitator**, not a code reviewer or
|
|
|
10
10
|
## When to run
|
|
11
11
|
|
|
12
12
|
- User asks for: “retro”, “technical retro”, “sprint/iteration review”, “action items after release”.
|
|
13
|
-
- After an agent-team pipeline completes
|
|
13
|
+
- After an agent-team pipeline completes.
|
|
14
14
|
- Context exists: period, topic (release, incident), task slug, notes.
|
|
15
15
|
|
|
16
16
|
## Inputs (collect, do not invent)
|
|
@@ -53,7 +53,7 @@ Do not attribute facts that are not in artifacts, the diff, or the user message.
|
|
|
53
53
|
|
|
54
54
|
## “Agent work” block (required when there is a slug)
|
|
55
55
|
|
|
56
|
-
If the retro relates to
|
|
56
|
+
If the retro relates to an agent-team pipeline:
|
|
57
57
|
|
|
58
58
|
| Question | What to capture |
|
|
59
59
|
|----------|-----------------|
|
|
@@ -64,10 +64,20 @@ const STACK = 'ios-swift';
|
|
|
64
64
|
const PLATFORM = 'claude';
|
|
65
65
|
|
|
66
66
|
function waitForMetricsLock() {
|
|
67
|
+
// OD-1: real advisory lock via create-exclusive (fs.openSync(_, 'wx')).
|
|
68
|
+
// The previous impl spun on Atomics.wait against an unrelated SharedArrayBuffer
|
|
69
|
+
// and never blocked on the lock file, so two concurrent subagentStop events
|
|
70
|
+
// could both acquire the lock and corrupt metrics.json. Retry EEXIST with a
|
|
71
|
+
// 10 ms sleep up to 200 attempts (2 s ceiling). On any other error, throw.
|
|
67
72
|
for (let attempt = 0; attempt < 200; attempt += 1) {
|
|
68
|
-
try {
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
try {
|
|
74
|
+
const fd = fs.openSync(METRICS_LOCK, 'wx');
|
|
75
|
+
try { fs.closeSync(fd); } catch {}
|
|
76
|
+
return;
|
|
77
|
+
} catch (error) {
|
|
78
|
+
if (!error || error.code !== 'EEXIST') throw error;
|
|
79
|
+
const until = Date.now() + 10;
|
|
80
|
+
while (Date.now() < until) { /* 10 ms busy-wait */ }
|
|
71
81
|
}
|
|
72
82
|
}
|
|
73
83
|
throw new Error('metrics lock timeout');
|
|
@@ -76,7 +86,7 @@ let taskLockHeld = false;
|
|
|
76
86
|
function releaseTaskLock() {
|
|
77
87
|
if (!taskLockHeld) return;
|
|
78
88
|
taskLockHeld = false;
|
|
79
|
-
try { fs.
|
|
89
|
+
try { fs.unlinkSync(METRICS_LOCK); } catch {}
|
|
80
90
|
}
|
|
81
91
|
waitForMetricsLock();
|
|
82
92
|
taskLockHeld = true;
|
|
@@ -104,7 +114,7 @@ function mutateMetrics(mutator) {
|
|
|
104
114
|
fs.writeFileSync(temporary, JSON.stringify(metrics, null, 2) + '\n');
|
|
105
115
|
fs.renameSync(temporary, METRICS_PATH);
|
|
106
116
|
} finally {
|
|
107
|
-
if (acquiredHere) { try { fs.
|
|
117
|
+
if (acquiredHere) { try { fs.unlinkSync(METRICS_LOCK); } catch {} }
|
|
108
118
|
}
|
|
109
119
|
}
|
|
110
120
|
function appendMetric(event) { mutateMetrics((metrics) => metrics.events.push({ eventId: `${metrics.task.runId}:${Date.now()}:${Math.random().toString(16).slice(2)}`, ...event })); }
|
|
@@ -138,6 +148,14 @@ const DEFAULT_ARTIFACT_OUTPUT_IDS = {
|
|
|
138
148
|
'mockup-reviewer': 'mockup-review',
|
|
139
149
|
'api-contract-reviewer': 'api-contract-review',
|
|
140
150
|
'tech-writer': 'documentation',
|
|
151
|
+
'openspec-author': 'openspec-change',
|
|
152
|
+
'qa-tester': 'qa',
|
|
153
|
+
'unit-test-planner': 'unit-test-plan',
|
|
154
|
+
'unit-test-generator': 'unit-test-spec',
|
|
155
|
+
'unit-test-healer': 'unit-test-heal',
|
|
156
|
+
'xcuitest-test-planner': 'xcuitest-plan',
|
|
157
|
+
'xcuitest-test-generator': 'xcuitest-spec',
|
|
158
|
+
'xcuitest-test-healer': 'xcuitest-heal',
|
|
141
159
|
};
|
|
142
160
|
function artifactOutputIdFor(step, agent) {
|
|
143
161
|
if (step && typeof step.artifactOutputId === 'string') return step.artifactOutputId;
|
|
@@ -242,7 +260,17 @@ function recordSkippedStep(step, stepIndex) {
|
|
|
242
260
|
function writeStatus(next) {
|
|
243
261
|
status = { ...status, ...next, slug, updatedAt: now };
|
|
244
262
|
const temporary = `${statusPath}.${process.pid}.${Date.now()}.tmp`;
|
|
245
|
-
|
|
263
|
+
// Open + write + fsync + rename so the durable file lands on disk before
|
|
264
|
+
// the orchestrator reads it. Closes the race window where a subagent that
|
|
265
|
+
// completed milliseconds before writeStatus() could otherwise invoke the
|
|
266
|
+
// next step on a stale status (in particular the human-gate write).
|
|
267
|
+
const fd = fs.openSync(temporary, 'w');
|
|
268
|
+
try {
|
|
269
|
+
fs.writeSync(fd, JSON.stringify(status, null, 2) + '\n');
|
|
270
|
+
try { fs.fsyncSync(fd); } catch {}
|
|
271
|
+
} finally {
|
|
272
|
+
fs.closeSync(fd);
|
|
273
|
+
}
|
|
246
274
|
fs.renameSync(temporary, statusPath);
|
|
247
275
|
}
|
|
248
276
|
|
|
@@ -341,6 +369,12 @@ const AGENT_HANDOFF = {
|
|
|
341
369
|
`Follow tests-ui.mdc, xcuitest-e2e, and debug-investigation. Do not use Playwright MCP. Upsert the owned terminal receipt in artifact-manifest.json; do not mutate status.json lifecycle fields.`,
|
|
342
370
|
'tech-writer': (s) =>
|
|
343
371
|
`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.`,
|
|
372
|
+
'openspec-author': (s, scope) =>
|
|
373
|
+
`Invoke openspec-author for slug "${s}"${scope ? ` (scope: ${scope})` : ''}. ` +
|
|
374
|
+
`Read openspec/config.yaml schema + rules; if openspec/** is absent, emit blocked ("openspec/** not initialized"). ` +
|
|
375
|
+
`Author openspec/changes/<change-id>/{proposal.md, design.md, tasks.md, .openspec.yaml} and the capability spec delta per phase (explore|propose|apply|archive). ` +
|
|
376
|
+
`Run \`openspec validate <change-id> --type change --strict\` and \`openspec validate --specs --strict\` (Phase 3); surface FAIL output verbatim. ` +
|
|
377
|
+
`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. `,
|
|
344
378
|
};
|
|
345
379
|
|
|
346
380
|
const REVIEW_AGENTS = new Set([
|
|
@@ -461,7 +495,19 @@ function legacyFlow() {
|
|
|
461
495
|
|
|
462
496
|
|
|
463
497
|
if (hookInput.action === 'end_human_gate') {
|
|
464
|
-
|
|
498
|
+
status.awaitingHumanGate = false;
|
|
499
|
+
// A2 (retro §8): pin a single runId per pipeline so subsequent events don't
|
|
500
|
+
// fragment the metrics ledger across multiple runId sequences. Prefer
|
|
501
|
+
// metrics.json.task.runId when metrics already exist, then status.metricsRunId,
|
|
502
|
+
// then mint a fresh seed only on first ever emit.
|
|
503
|
+
try {
|
|
504
|
+
if (fs.existsSync(METRICS_PATH)) {
|
|
505
|
+
const existing = JSON.parse(fs.readFileSync(METRICS_PATH, 'utf8'));
|
|
506
|
+
if (existing && existing.task && typeof existing.task.runId === 'string') {
|
|
507
|
+
status.metricsRunId = existing.task.runId;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
} catch {}
|
|
465
511
|
if (status.state === 'awaiting_approval') {
|
|
466
512
|
status.state = 'in_progress';
|
|
467
513
|
status.phase = status.phase === 'human_gate' ? 'executing' : status.phase;
|
|
@@ -500,11 +546,29 @@ if (hookInput.action === 'end_human_gate') {
|
|
|
500
546
|
}
|
|
501
547
|
}
|
|
502
548
|
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
549
|
+
// A2 (retro §8): if gate closes the final human gate of the pipeline
|
|
550
|
+
// (no resume happens, or current step's gate was the last), surface
|
|
551
|
+
// state="awaiting_approval" so a subsequent /task-continue doesn't misinterpret
|
|
552
|
+
// the post-gate idle state as "still in progress".
|
|
553
|
+
{
|
|
554
|
+
let gateWasTerminal = false;
|
|
555
|
+
if (!hookInput.activateNext && fs.existsSync(pipelinePath)) {
|
|
556
|
+
try {
|
|
557
|
+
const pipe = JSON.parse(fs.readFileSync(pipelinePath, 'utf8'));
|
|
558
|
+
const steps = pipe.steps || [];
|
|
559
|
+
const idx = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
|
|
560
|
+
const cur = steps[idx];
|
|
561
|
+
const gates = Array.isArray(pipe.humanGates) ? pipe.humanGates : [];
|
|
562
|
+
const hasGate = (step) => Array.isArray(gates) && gates.some((g) => typeof g === 'string' && getStepAgents(step).some((a) => g === `after:${a}`));
|
|
563
|
+
if (cur && hasGate(cur)) gateWasTerminal = true;
|
|
564
|
+
} catch {}
|
|
565
|
+
}
|
|
566
|
+
writeStatus({
|
|
567
|
+
awaitingHumanGate: false,
|
|
568
|
+
state: gateWasTerminal ? 'awaiting_approval' : status.state,
|
|
569
|
+
phase: status.phase,
|
|
570
|
+
});
|
|
571
|
+
}
|
|
508
572
|
process.stdout.write(JSON.stringify({ ok: true, action: 'end_human_gate', activeHumanGateEventId: status.activeHumanGateEventId || null }));
|
|
509
573
|
process.exit(0);
|
|
510
574
|
}
|
|
@@ -514,9 +578,37 @@ if (!fs.existsSync(pipelinePath)) {
|
|
|
514
578
|
}
|
|
515
579
|
|
|
516
580
|
let pipeline;
|
|
581
|
+
let pipelineParseError = null;
|
|
517
582
|
try {
|
|
518
583
|
pipeline = JSON.parse(fs.readFileSync(pipelinePath, 'utf8'));
|
|
519
|
-
} catch {
|
|
584
|
+
} catch (error) {
|
|
585
|
+
pipelineParseError = error;
|
|
586
|
+
}
|
|
587
|
+
// Modern pipelines carry an `intent` field. If pipeline.json is present but
|
|
588
|
+
// unparseable, surface the error so the orchestrator can stop and report
|
|
589
|
+
// instead of falling back to legacyFlow() — which silently drops modern
|
|
590
|
+
// roles like `openspec-author`, `qa-tester`, and the test-planner trio.
|
|
591
|
+
if (pipelineParseError) {
|
|
592
|
+
if (fs.existsSync(pipelinePath)) {
|
|
593
|
+
const raw = fs.readFileSync(pipelinePath, 'utf8');
|
|
594
|
+
const hasModernIntent = /"intent"\s*:/.test(raw);
|
|
595
|
+
appendMetric({
|
|
596
|
+
eventId: `${status.metricsRunId || slug}:pipeline_parse_error:${Date.now()}`,
|
|
597
|
+
type: 'pipeline_parse_error',
|
|
598
|
+
at: now,
|
|
599
|
+
source: 'hook',
|
|
600
|
+
attributionConfidence: 'high',
|
|
601
|
+
error: String(pipelineParseError.message || pipelineParseError),
|
|
602
|
+
hasModernIntent,
|
|
603
|
+
});
|
|
604
|
+
if (hasModernIntent) {
|
|
605
|
+
writeStatus({ state: 'blocked', phase: 'blocked', currentAgent: 'task-router' });
|
|
606
|
+
process.stdout.write(JSON.stringify({
|
|
607
|
+
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}.`,
|
|
608
|
+
}));
|
|
609
|
+
process.exit(0);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
520
612
|
legacyFlow();
|
|
521
613
|
}
|
|
522
614
|
|
|
@@ -37,6 +37,7 @@ In Claude Code all `.md` files under `rules/` are **discovered recursively**. Bo
|
|
|
37
37
|
| `tests-unit.mdc` | `testing/unit.md` |
|
|
38
38
|
| `tests-ui.mdc` | `testing/ui.md` |
|
|
39
39
|
| `code-quality-and-refactoring.mdc` | `tooling-and-review/code-quality.md` |
|
|
40
|
+
| `ai-local-overlay.mdc` | `tooling-and-review/ai-local-overlay.md` |
|
|
40
41
|
| `anti-sycophancy-discipline.mdc` | `tooling-and-review/anti-sycophancy-discipline.md` |
|
|
41
42
|
| `design-guidance.mdc` | `tooling-and-review/design-guidance.md` |
|
|
42
43
|
| `mcp-usage.mdc` | `tooling-and-review/mcp-usage.md` |
|