@bonesofspring/ai-rules 0.2.36 → 0.2.38
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 +38 -0
- package/README.md +23 -2
- package/bin/cli.js +106 -1
- package/bin/lib/engine-scripts.js +22 -0
- package/bin/lib/fs-utils.js +78 -11
- package/bin/lib/merged-config.js +30 -16
- package/bin/lib/seed-ai-local-team.js +160 -12
- package/bin/opencode-install.js +37 -52
- package/docs/OPENCODE.md +4 -4
- package/docs/specs/INDEX.md +5 -2
- package/package.json +7 -1
- package/presets/_shared/ai-local/scripts/derive-gate-signals.mjs +173 -0
- package/presets/_shared/ai-local/scripts/efficacy-oracle.mjs +576 -0
- package/presets/_shared/ai-local/scripts/lock.mjs +118 -0
- package/presets/_shared/ai-local/scripts/rule-improver.mjs +795 -0
- package/presets/_shared/ai-local/scripts/run.mjs +309 -0
- package/presets/_shared/ai-local/scripts/signals.mjs +256 -0
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +1 -1
- package/presets/_shared/core/quality/self-review-and-context-hygiene.md +8 -7
- package/presets/_shared/hooks/README.md +142 -0
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +1377 -0
- package/presets/_shared/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/android-kotlin/CLAUDE.md +1 -1
- package/presets/claude/android-kotlin/MCP.md +2 -2
- package/presets/claude/android-kotlin/REPO_AGENTS.md +14 -0
- package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/claude/android-kotlin/agents/debugger.md +1 -1
- package/presets/claude/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/claude/android-kotlin/commands/README.md +1 -0
- package/presets/claude/android-kotlin/commands/task-continue.md +9 -0
- package/presets/claude/android-kotlin/commands/technical-retro.md +8 -0
- package/presets/claude/android-kotlin/commands/update.md +39 -0
- package/presets/claude/android-kotlin/hooks/README.md +1 -0
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +278 -28
- package/presets/claude/android-kotlin/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/android-kotlin/hooks/examples/README.md +1 -1
- package/presets/claude/android-kotlin/mcp.json +1 -1
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +7 -154
- package/presets/claude/android-kotlin/settings.json +14 -1
- package/presets/claude/android-kotlin/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/android-kotlin/team/README.md +2 -6
- package/presets/claude/android-kotlin/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/claude/go/CLAUDE.md +1 -1
- package/presets/claude/go/MCP.md +2 -2
- package/presets/claude/go/REPO_AGENTS.md +14 -0
- package/presets/claude/go/agents/build-verifier.md +1 -1
- package/presets/claude/go/agents/code-reviewer.md +1 -1
- package/presets/claude/go/agents/debugger.md +1 -1
- package/presets/claude/go/agents/feature-developer.md +1 -1
- package/presets/claude/go/agents/task-analyst.md +1 -1
- package/presets/claude/go/commands/README.md +1 -0
- package/presets/claude/go/commands/task-continue.md +9 -0
- package/presets/claude/go/commands/technical-retro.md +8 -0
- package/presets/claude/go/commands/update.md +39 -0
- package/presets/claude/go/hooks/README.md +1 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +290 -34
- package/presets/claude/go/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/go/hooks/examples/README.md +1 -1
- package/presets/claude/go/mcp.json +1 -1
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +7 -12
- package/presets/claude/go/settings.json +14 -1
- package/presets/claude/go/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/go/team/README.md +2 -6
- package/presets/claude/ios-swift/CLAUDE.md +1 -1
- package/presets/claude/ios-swift/MCP.md +2 -2
- package/presets/claude/ios-swift/REPO_AGENTS.md +14 -0
- package/presets/claude/ios-swift/agents/build-verifier.md +1 -1
- package/presets/claude/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/claude/ios-swift/agents/debugger.md +1 -1
- package/presets/claude/ios-swift/agents/feature-developer.md +1 -1
- package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
- package/presets/claude/ios-swift/commands/README.md +1 -0
- package/presets/claude/ios-swift/commands/task-continue.md +9 -0
- package/presets/claude/ios-swift/commands/technical-retro.md +8 -0
- package/presets/claude/ios-swift/commands/update.md +39 -0
- package/presets/claude/ios-swift/hooks/README.md +1 -0
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +285 -35
- package/presets/claude/ios-swift/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/ios-swift/hooks/examples/README.md +1 -1
- package/presets/claude/ios-swift/mcp.json +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +7 -154
- package/presets/claude/ios-swift/settings.json +14 -1
- package/presets/claude/ios-swift/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/ios-swift/team/README.md +2 -6
- package/presets/claude/ios-swift/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/claude/java/CLAUDE.md +2 -2
- package/presets/claude/java/REPO_AGENTS.md +14 -0
- package/presets/claude/java/agents/build-verifier.md +1 -1
- package/presets/claude/java/agents/code-reviewer.md +1 -1
- package/presets/claude/java/agents/debugger.md +1 -1
- package/presets/claude/java/agents/feature-developer.md +1 -1
- package/presets/claude/java/agents/task-analyst.md +1 -1
- package/presets/claude/java/commands/README.md +1 -0
- package/presets/claude/java/commands/task-continue.md +9 -0
- package/presets/claude/java/commands/technical-retro.md +8 -0
- package/presets/claude/java/commands/update.md +39 -0
- package/presets/claude/java/hooks/README.md +1 -0
- package/presets/claude/java/hooks/chain-team-phases.sh +290 -34
- package/presets/claude/java/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/java/hooks/examples/README.md +1 -1
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +7 -29
- package/presets/claude/java/settings.json +14 -1
- package/presets/claude/java/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/java/team/README.md +2 -6
- package/presets/claude/mcp-ts/CLAUDE.md +1 -1
- package/presets/claude/mcp-ts/REPO_AGENTS.md +14 -0
- package/presets/claude/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/claude/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/claude/mcp-ts/commands/README.md +1 -0
- package/presets/claude/mcp-ts/commands/task-continue.md +9 -0
- package/presets/claude/mcp-ts/commands/technical-retro.md +8 -0
- package/presets/claude/mcp-ts/commands/update.md +39 -0
- package/presets/claude/mcp-ts/hooks/README.md +1 -0
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +289 -31
- package/presets/claude/mcp-ts/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +7 -15
- package/presets/claude/mcp-ts/settings.json +14 -1
- package/presets/claude/mcp-ts/team/README.md +2 -6
- package/presets/claude/next/CLAUDE.md +2 -1
- package/presets/claude/next/MCP.md +2 -2
- package/presets/claude/next/REPO_AGENTS.md +15 -1
- package/presets/claude/next/agents/build-verifier.md +1 -1
- package/presets/claude/next/agents/code-reviewer.md +1 -1
- package/presets/claude/next/agents/debugger.md +1 -1
- package/presets/claude/next/agents/feature-developer.md +1 -1
- package/presets/claude/next/agents/task-analyst.md +1 -1
- package/presets/claude/next/agents/task-router.md +1 -1
- package/presets/claude/next/commands/README.md +1 -0
- package/presets/claude/next/commands/task-continue.md +9 -0
- package/presets/claude/next/commands/technical-retro.md +8 -0
- package/presets/claude/next/commands/update.md +39 -0
- package/presets/claude/next/hooks/README.md +1 -0
- package/presets/claude/next/hooks/chain-team-phases.sh +209 -24
- package/presets/claude/next/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/next/hooks/examples/README.md +1 -1
- package/presets/claude/next/mcp.json +1 -1
- package/presets/claude/next/rules/anti-hallucination/react-next-anti-hallucination.md +21 -18
- package/presets/claude/next/rules/stack/next-app-router.md +27 -0
- package/presets/claude/next/rules/stack/next-static-export.md +16 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +7 -227
- package/presets/claude/next/rules/tooling-and-review/security-next.md +16 -2
- package/presets/claude/next/rules/ui-and-accessibility/component-catalog-gate.md +13 -0
- package/presets/claude/next/rules/ui-and-accessibility/forms-validation.md +12 -0
- package/presets/claude/next/settings.json +13 -0
- package/presets/claude/next/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/next/team/README.md +2 -6
- package/presets/claude/next/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/claude/next/team/fixtures/feature-light.json +2 -1
- package/presets/claude/next/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/claude/nuxt/CLAUDE.md +2 -1
- package/presets/claude/nuxt/MCP.md +2 -2
- package/presets/claude/nuxt/REPO_AGENTS.md +14 -0
- package/presets/claude/nuxt/agents/build-verifier.md +1 -1
- package/presets/claude/nuxt/agents/code-reviewer.md +1 -1
- package/presets/claude/nuxt/agents/debugger.md +1 -1
- package/presets/claude/nuxt/agents/feature-developer.md +1 -1
- package/presets/claude/nuxt/agents/task-analyst.md +1 -1
- package/presets/claude/nuxt/commands/README.md +1 -0
- package/presets/claude/nuxt/commands/task-continue.md +9 -0
- package/presets/claude/nuxt/commands/technical-retro.md +8 -0
- package/presets/claude/nuxt/commands/update.md +39 -0
- package/presets/claude/nuxt/hooks/README.md +1 -0
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +255 -25
- package/presets/claude/nuxt/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/nuxt/hooks/examples/README.md +1 -1
- package/presets/claude/nuxt/mcp.json +1 -1
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +7 -224
- package/presets/claude/nuxt/settings.json +13 -0
- package/presets/claude/nuxt/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/nuxt/team/README.md +2 -6
- package/presets/claude/nuxt/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/claude/php-hexagonal/CLAUDE.md +2 -2
- package/presets/claude/php-hexagonal/REPO_AGENTS.md +14 -0
- package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/claude/php-hexagonal/agents/debugger.md +1 -1
- package/presets/claude/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/claude/php-hexagonal/commands/README.md +1 -0
- package/presets/claude/php-hexagonal/commands/task-continue.md +9 -0
- package/presets/claude/php-hexagonal/commands/technical-retro.md +8 -0
- package/presets/claude/php-hexagonal/commands/update.md +39 -0
- package/presets/claude/php-hexagonal/hooks/README.md +1 -0
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +290 -34
- package/presets/claude/php-hexagonal/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/php-hexagonal/hooks/examples/README.md +1 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +7 -29
- package/presets/claude/php-hexagonal/settings.json +14 -1
- package/presets/claude/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/php-hexagonal/team/README.md +2 -6
- package/presets/claude/php-laravel/CLAUDE.md +1 -1
- package/presets/claude/php-laravel/REPO_AGENTS.md +14 -0
- package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
- package/presets/claude/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/claude/php-laravel/agents/debugger.md +1 -1
- package/presets/claude/php-laravel/agents/feature-developer.md +1 -1
- package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
- package/presets/claude/php-laravel/commands/README.md +1 -0
- package/presets/claude/php-laravel/commands/task-continue.md +9 -0
- package/presets/claude/php-laravel/commands/technical-retro.md +8 -0
- package/presets/claude/php-laravel/commands/update.md +39 -0
- package/presets/claude/php-laravel/hooks/README.md +1 -0
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +290 -34
- package/presets/claude/php-laravel/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/php-laravel/hooks/examples/README.md +1 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +7 -30
- package/presets/claude/php-laravel/settings.json +14 -1
- package/presets/claude/php-laravel/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/php-laravel/team/README.md +2 -6
- package/presets/claude/svelte/CLAUDE.md +2 -1
- package/presets/claude/svelte/MCP.md +2 -2
- package/presets/claude/svelte/REPO_AGENTS.md +14 -0
- package/presets/claude/svelte/agents/build-verifier.md +1 -1
- package/presets/claude/svelte/agents/code-reviewer.md +1 -1
- package/presets/claude/svelte/agents/debugger.md +1 -1
- package/presets/claude/svelte/agents/feature-developer.md +1 -1
- package/presets/claude/svelte/agents/task-analyst.md +1 -1
- package/presets/claude/svelte/commands/README.md +1 -0
- package/presets/claude/svelte/commands/task-continue.md +9 -0
- package/presets/claude/svelte/commands/technical-retro.md +8 -0
- package/presets/claude/svelte/commands/update.md +39 -0
- package/presets/claude/svelte/hooks/README.md +1 -0
- package/presets/claude/svelte/hooks/chain-team-phases.sh +255 -25
- package/presets/claude/svelte/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/svelte/hooks/examples/README.md +1 -1
- package/presets/claude/svelte/mcp.json +1 -1
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +7 -224
- package/presets/claude/svelte/settings.json +13 -0
- package/presets/claude/svelte/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/svelte/team/README.md +2 -6
- package/presets/claude/svelte/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/cursor/android-kotlin/AGENTS.md +1 -0
- package/presets/cursor/android-kotlin/MCP.md +2 -2
- package/presets/cursor/android-kotlin/REPO_AGENTS.md +14 -0
- package/presets/cursor/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/cursor/android-kotlin/agents/debugger.md +1 -1
- package/presets/cursor/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/cursor/android-kotlin/commands/README.md +1 -0
- package/presets/cursor/android-kotlin/commands/task-continue.md +9 -0
- package/presets/cursor/android-kotlin/commands/technical-retro.md +8 -0
- package/presets/cursor/android-kotlin/commands/update.md +39 -0
- package/presets/cursor/android-kotlin/hooks/README.md +5 -1
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +257 -25
- package/presets/cursor/android-kotlin/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/android-kotlin/hooks/examples/README.md +1 -1
- package/presets/cursor/android-kotlin/hooks.json +6 -0
- package/presets/cursor/android-kotlin/mcp.json +1 -1
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/android-kotlin/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/android-kotlin/team/README.md +2 -0
- package/presets/cursor/android-kotlin/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/cursor/go/MCP.md +2 -2
- package/presets/cursor/go/REPO_AGENTS.md +14 -0
- package/presets/cursor/go/agents/build-verifier.md +1 -1
- package/presets/cursor/go/agents/code-reviewer.md +1 -1
- package/presets/cursor/go/agents/debugger.md +1 -1
- package/presets/cursor/go/agents/feature-developer.md +1 -1
- package/presets/cursor/go/agents/task-analyst.md +1 -1
- package/presets/cursor/go/commands/README.md +1 -0
- package/presets/cursor/go/commands/task-continue.md +9 -0
- package/presets/cursor/go/commands/technical-retro.md +8 -0
- package/presets/cursor/go/commands/update.md +39 -0
- package/presets/cursor/go/hooks/README.md +5 -1
- package/presets/cursor/go/hooks/chain-team-phases.sh +282 -26
- package/presets/cursor/go/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/go/hooks/examples/README.md +1 -1
- package/presets/cursor/go/hooks.json +6 -0
- package/presets/cursor/go/mcp.json +1 -1
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/go/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/go/team/README.md +2 -0
- package/presets/cursor/ios-swift/AGENTS.md +1 -0
- package/presets/cursor/ios-swift/MCP.md +2 -2
- package/presets/cursor/ios-swift/REPO_AGENTS.md +14 -0
- package/presets/cursor/ios-swift/agents/build-verifier.md +1 -1
- package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/cursor/ios-swift/agents/debugger.md +1 -1
- package/presets/cursor/ios-swift/agents/feature-developer.md +1 -1
- package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
- package/presets/cursor/ios-swift/commands/README.md +1 -0
- package/presets/cursor/ios-swift/commands/task-continue.md +9 -0
- package/presets/cursor/ios-swift/commands/technical-retro.md +8 -0
- package/presets/cursor/ios-swift/commands/update.md +39 -0
- package/presets/cursor/ios-swift/hooks/README.md +5 -1
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +257 -25
- package/presets/cursor/ios-swift/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/ios-swift/hooks/examples/README.md +1 -1
- package/presets/cursor/ios-swift/hooks.json +6 -0
- package/presets/cursor/ios-swift/mcp.json +1 -1
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/ios-swift/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/ios-swift/team/README.md +2 -0
- package/presets/cursor/ios-swift/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/cursor/java/AGENTS.md +1 -1
- package/presets/cursor/java/REPO_AGENTS.md +14 -0
- package/presets/cursor/java/agents/build-verifier.md +1 -1
- package/presets/cursor/java/agents/code-reviewer.md +1 -1
- package/presets/cursor/java/agents/debugger.md +1 -1
- package/presets/cursor/java/agents/feature-developer.md +1 -1
- package/presets/cursor/java/agents/task-analyst.md +1 -1
- package/presets/cursor/java/commands/README.md +1 -0
- package/presets/cursor/java/commands/task-continue.md +9 -0
- package/presets/cursor/java/commands/technical-retro.md +8 -0
- package/presets/cursor/java/commands/update.md +39 -0
- package/presets/cursor/java/hooks/README.md +5 -1
- package/presets/cursor/java/hooks/chain-team-phases.sh +282 -26
- package/presets/cursor/java/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/java/hooks/examples/README.md +1 -1
- package/presets/cursor/java/hooks.json +6 -0
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/java/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/java/team/README.md +2 -0
- package/presets/cursor/mcp-ts/REPO_AGENTS.md +14 -0
- package/presets/cursor/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/cursor/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/cursor/mcp-ts/commands/README.md +1 -0
- package/presets/cursor/mcp-ts/commands/task-continue.md +9 -0
- package/presets/cursor/mcp-ts/commands/technical-retro.md +8 -0
- package/presets/cursor/mcp-ts/commands/update.md +39 -0
- package/presets/cursor/mcp-ts/hooks/README.md +5 -1
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +286 -28
- package/presets/cursor/mcp-ts/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/mcp-ts/hooks.json +6 -0
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/mcp-ts/team/README.md +2 -0
- package/presets/cursor/next/AGENTS.md +1 -0
- package/presets/cursor/next/MCP.md +2 -2
- package/presets/cursor/next/REPO_AGENTS.md +15 -1
- package/presets/cursor/next/agents/build-verifier.md +1 -1
- package/presets/cursor/next/agents/code-reviewer.md +1 -1
- package/presets/cursor/next/agents/debugger.md +1 -1
- package/presets/cursor/next/agents/feature-developer.md +1 -1
- package/presets/cursor/next/agents/task-analyst.md +1 -1
- package/presets/cursor/next/agents/task-router.md +1 -1
- package/presets/cursor/next/commands/README.md +1 -0
- package/presets/cursor/next/commands/task-continue.md +9 -0
- package/presets/cursor/next/commands/technical-retro.md +8 -0
- package/presets/cursor/next/commands/update.md +39 -0
- package/presets/cursor/next/hooks/README.md +6 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +206 -23
- package/presets/cursor/next/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/next/hooks/examples/README.md +1 -1
- package/presets/cursor/next/hooks.json +6 -0
- package/presets/cursor/next/mcp.json +1 -1
- package/presets/cursor/next/rules/README.md +3 -1
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/next/rules/component-catalog-gate.mdc +13 -0
- package/presets/cursor/next/rules/forms-validation.mdc +12 -0
- package/presets/cursor/next/rules/next-app-router.mdc +27 -0
- package/presets/cursor/next/rules/next-static-export.mdc +16 -0
- package/presets/cursor/next/rules/react-next-anti-hallucination.mdc +21 -18
- package/presets/cursor/next/rules/security-next.mdc +16 -2
- package/presets/cursor/next/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/next/team/README.md +2 -0
- package/presets/cursor/next/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/cursor/next/team/fixtures/feature-light.json +2 -1
- package/presets/cursor/next/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/cursor/nuxt/AGENTS.md +1 -0
- package/presets/cursor/nuxt/MCP.md +2 -2
- package/presets/cursor/nuxt/REPO_AGENTS.md +14 -0
- package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
- package/presets/cursor/nuxt/agents/code-reviewer.md +1 -1
- package/presets/cursor/nuxt/agents/debugger.md +1 -1
- package/presets/cursor/nuxt/agents/feature-developer.md +1 -1
- package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
- package/presets/cursor/nuxt/commands/README.md +1 -0
- package/presets/cursor/nuxt/commands/task-continue.md +9 -0
- package/presets/cursor/nuxt/commands/technical-retro.md +8 -0
- package/presets/cursor/nuxt/commands/update.md +39 -0
- package/presets/cursor/nuxt/hooks/README.md +4 -0
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +252 -24
- package/presets/cursor/nuxt/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/nuxt/hooks/examples/README.md +1 -1
- package/presets/cursor/nuxt/hooks.json +6 -0
- package/presets/cursor/nuxt/mcp.json +1 -1
- package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/nuxt/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/nuxt/team/README.md +2 -0
- package/presets/cursor/nuxt/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/cursor/php-hexagonal/AGENTS.md +1 -1
- package/presets/cursor/php-hexagonal/REPO_AGENTS.md +14 -0
- package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/cursor/php-hexagonal/agents/debugger.md +1 -1
- package/presets/cursor/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/cursor/php-hexagonal/commands/README.md +1 -0
- package/presets/cursor/php-hexagonal/commands/task-continue.md +9 -0
- package/presets/cursor/php-hexagonal/commands/technical-retro.md +8 -0
- package/presets/cursor/php-hexagonal/commands/update.md +39 -0
- package/presets/cursor/php-hexagonal/hooks/README.md +5 -1
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +282 -26
- package/presets/cursor/php-hexagonal/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/php-hexagonal/hooks/examples/README.md +1 -1
- package/presets/cursor/php-hexagonal/hooks.json +6 -0
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/php-hexagonal/team/README.md +2 -0
- package/presets/cursor/php-laravel/AGENTS.md +1 -1
- package/presets/cursor/php-laravel/REPO_AGENTS.md +14 -0
- package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
- package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/cursor/php-laravel/agents/debugger.md +1 -1
- package/presets/cursor/php-laravel/agents/feature-developer.md +1 -1
- package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
- package/presets/cursor/php-laravel/commands/README.md +1 -0
- package/presets/cursor/php-laravel/commands/task-continue.md +9 -0
- package/presets/cursor/php-laravel/commands/technical-retro.md +8 -0
- package/presets/cursor/php-laravel/commands/update.md +39 -0
- package/presets/cursor/php-laravel/hooks/README.md +5 -1
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +282 -26
- package/presets/cursor/php-laravel/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/php-laravel/hooks/examples/README.md +1 -1
- package/presets/cursor/php-laravel/hooks.json +6 -0
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/php-laravel/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/php-laravel/team/README.md +2 -0
- package/presets/cursor/svelte/AGENTS.md +1 -0
- package/presets/cursor/svelte/MCP.md +2 -2
- package/presets/cursor/svelte/REPO_AGENTS.md +14 -0
- package/presets/cursor/svelte/agents/build-verifier.md +1 -1
- package/presets/cursor/svelte/agents/code-reviewer.md +1 -1
- package/presets/cursor/svelte/agents/debugger.md +1 -1
- package/presets/cursor/svelte/agents/feature-developer.md +1 -1
- package/presets/cursor/svelte/agents/task-analyst.md +1 -1
- package/presets/cursor/svelte/commands/README.md +1 -0
- package/presets/cursor/svelte/commands/task-continue.md +9 -0
- package/presets/cursor/svelte/commands/technical-retro.md +8 -0
- package/presets/cursor/svelte/commands/update.md +39 -0
- package/presets/cursor/svelte/hooks/README.md +4 -0
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +252 -24
- package/presets/cursor/svelte/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/svelte/hooks/examples/README.md +1 -1
- package/presets/cursor/svelte/hooks.json +6 -0
- package/presets/cursor/svelte/mcp.json +1 -1
- package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/svelte/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/svelte/team/README.md +2 -0
- package/presets/cursor/svelte/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/mavis/android-kotlin/MAVIS.md +1 -0
- package/presets/mavis/android-kotlin/MCP.md +2 -2
- package/presets/mavis/android-kotlin/REPO_AGENTS.md +14 -0
- package/presets/mavis/android-kotlin/adapter-map.json +17 -1
- package/presets/mavis/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/mavis/android-kotlin/agents/debugger.md +1 -1
- package/presets/mavis/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/mavis/android-kotlin/commands/README.md +1 -0
- package/presets/mavis/android-kotlin/commands/task-continue.md +9 -0
- package/presets/mavis/android-kotlin/commands/technical-retro.md +8 -0
- package/presets/mavis/android-kotlin/commands/update.md +34 -0
- package/presets/mavis/android-kotlin/hooks/README.md +3 -0
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +257 -25
- package/presets/mavis/android-kotlin/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/android-kotlin/mcp.json +1 -1
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/android-kotlin/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/android-kotlin/team/README.md +2 -0
- package/presets/mavis/android-kotlin/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/mavis/go/MCP.md +2 -2
- package/presets/mavis/go/REPO_AGENTS.md +14 -0
- package/presets/mavis/go/adapter-map.json +17 -1
- package/presets/mavis/go/agents/build-verifier.md +1 -1
- package/presets/mavis/go/agents/code-reviewer.md +1 -1
- package/presets/mavis/go/agents/debugger.md +1 -1
- package/presets/mavis/go/agents/feature-developer.md +1 -1
- package/presets/mavis/go/agents/task-analyst.md +1 -1
- package/presets/mavis/go/commands/README.md +1 -0
- package/presets/mavis/go/commands/task-continue.md +9 -0
- package/presets/mavis/go/commands/technical-retro.md +8 -0
- package/presets/mavis/go/commands/update.md +34 -0
- package/presets/mavis/go/hooks/README.md +3 -0
- package/presets/mavis/go/hooks/chain-team-phases.sh +282 -26
- package/presets/mavis/go/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/go/mcp.json +1 -1
- package/presets/mavis/go/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/go/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/go/team/README.md +2 -0
- package/presets/mavis/ios-swift/MAVIS.md +1 -0
- package/presets/mavis/ios-swift/MCP.md +2 -2
- package/presets/mavis/ios-swift/REPO_AGENTS.md +14 -0
- package/presets/mavis/ios-swift/adapter-map.json +17 -1
- package/presets/mavis/ios-swift/agents/build-verifier.md +1 -1
- package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/mavis/ios-swift/agents/debugger.md +1 -1
- package/presets/mavis/ios-swift/agents/feature-developer.md +1 -1
- package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
- package/presets/mavis/ios-swift/commands/README.md +1 -0
- package/presets/mavis/ios-swift/commands/task-continue.md +9 -0
- package/presets/mavis/ios-swift/commands/technical-retro.md +8 -0
- package/presets/mavis/ios-swift/commands/update.md +34 -0
- package/presets/mavis/ios-swift/hooks/README.md +3 -0
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +257 -25
- package/presets/mavis/ios-swift/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/ios-swift/mcp.json +1 -1
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/ios-swift/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/ios-swift/team/README.md +2 -0
- package/presets/mavis/ios-swift/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/mavis/java/REPO_AGENTS.md +14 -0
- package/presets/mavis/java/adapter-map.json +17 -1
- package/presets/mavis/java/agents/build-verifier.md +1 -1
- package/presets/mavis/java/agents/code-reviewer.md +1 -1
- package/presets/mavis/java/agents/debugger.md +1 -1
- package/presets/mavis/java/agents/feature-developer.md +1 -1
- package/presets/mavis/java/agents/task-analyst.md +1 -1
- package/presets/mavis/java/commands/README.md +1 -0
- package/presets/mavis/java/commands/task-continue.md +9 -0
- package/presets/mavis/java/commands/technical-retro.md +8 -0
- package/presets/mavis/java/commands/update.md +34 -0
- package/presets/mavis/java/hooks/README.md +3 -0
- package/presets/mavis/java/hooks/chain-team-phases.sh +282 -26
- package/presets/mavis/java/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/java/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/java/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/java/team/README.md +2 -0
- package/presets/mavis/mcp-ts/REPO_AGENTS.md +14 -0
- package/presets/mavis/mcp-ts/adapter-map.json +17 -1
- package/presets/mavis/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/mavis/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/mavis/mcp-ts/commands/README.md +1 -0
- package/presets/mavis/mcp-ts/commands/task-continue.md +9 -0
- package/presets/mavis/mcp-ts/commands/technical-retro.md +8 -0
- package/presets/mavis/mcp-ts/commands/update.md +34 -0
- package/presets/mavis/mcp-ts/hooks/README.md +3 -0
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +286 -28
- package/presets/mavis/mcp-ts/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/mcp-ts/team/README.md +2 -0
- package/presets/mavis/next/MAVIS.md +1 -0
- package/presets/mavis/next/MCP.md +2 -2
- package/presets/mavis/next/REPO_AGENTS.md +15 -1
- package/presets/mavis/next/adapter-map.json +25 -1
- package/presets/mavis/next/agents/build-verifier.md +1 -1
- package/presets/mavis/next/agents/code-reviewer.md +1 -1
- package/presets/mavis/next/agents/debugger.md +1 -1
- package/presets/mavis/next/agents/feature-developer.md +1 -1
- package/presets/mavis/next/agents/task-analyst.md +1 -1
- package/presets/mavis/next/agents/task-router.md +1 -1
- package/presets/mavis/next/commands/README.md +1 -0
- package/presets/mavis/next/commands/task-continue.md +9 -0
- package/presets/mavis/next/commands/technical-retro.md +8 -0
- package/presets/mavis/next/commands/update.md +34 -0
- package/presets/mavis/next/hooks/README.md +3 -0
- package/presets/mavis/next/hooks/chain-team-phases.sh +206 -23
- package/presets/mavis/next/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/next/mcp.json +1 -1
- package/presets/mavis/next/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/next/rules/component-catalog-gate.md +13 -0
- package/presets/mavis/next/rules/forms-validation.md +12 -0
- package/presets/mavis/next/rules/next-app-router.md +27 -0
- package/presets/mavis/next/rules/next-static-export.md +16 -0
- package/presets/mavis/next/rules/react-next-anti-hallucination.md +20 -18
- package/presets/mavis/next/rules/security-next.md +13 -0
- package/presets/mavis/next/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/next/team/README.md +2 -0
- package/presets/mavis/next/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/mavis/next/team/fixtures/feature-light.json +2 -1
- package/presets/mavis/next/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/mavis/nuxt/MAVIS.md +1 -0
- package/presets/mavis/nuxt/MCP.md +2 -2
- package/presets/mavis/nuxt/REPO_AGENTS.md +14 -0
- package/presets/mavis/nuxt/adapter-map.json +17 -1
- package/presets/mavis/nuxt/agents/build-verifier.md +1 -1
- package/presets/mavis/nuxt/agents/code-reviewer.md +1 -1
- package/presets/mavis/nuxt/agents/debugger.md +1 -1
- package/presets/mavis/nuxt/agents/feature-developer.md +1 -1
- package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
- package/presets/mavis/nuxt/commands/README.md +1 -0
- package/presets/mavis/nuxt/commands/task-continue.md +9 -0
- package/presets/mavis/nuxt/commands/technical-retro.md +8 -0
- package/presets/mavis/nuxt/commands/update.md +34 -0
- package/presets/mavis/nuxt/hooks/README.md +3 -0
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +252 -24
- package/presets/mavis/nuxt/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/nuxt/mcp.json +1 -1
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/nuxt/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/nuxt/team/README.md +2 -0
- package/presets/mavis/nuxt/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/mavis/php-hexagonal/REPO_AGENTS.md +14 -0
- package/presets/mavis/php-hexagonal/adapter-map.json +17 -1
- package/presets/mavis/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/mavis/php-hexagonal/agents/debugger.md +1 -1
- package/presets/mavis/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/mavis/php-hexagonal/commands/README.md +1 -0
- package/presets/mavis/php-hexagonal/commands/task-continue.md +9 -0
- package/presets/mavis/php-hexagonal/commands/technical-retro.md +8 -0
- package/presets/mavis/php-hexagonal/commands/update.md +34 -0
- package/presets/mavis/php-hexagonal/hooks/README.md +3 -0
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +282 -26
- package/presets/mavis/php-hexagonal/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/php-hexagonal/team/README.md +2 -0
- package/presets/mavis/php-laravel/REPO_AGENTS.md +14 -0
- package/presets/mavis/php-laravel/adapter-map.json +17 -1
- package/presets/mavis/php-laravel/agents/build-verifier.md +1 -1
- package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/mavis/php-laravel/agents/debugger.md +1 -1
- package/presets/mavis/php-laravel/agents/feature-developer.md +1 -1
- package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
- package/presets/mavis/php-laravel/commands/README.md +1 -0
- package/presets/mavis/php-laravel/commands/task-continue.md +9 -0
- package/presets/mavis/php-laravel/commands/technical-retro.md +8 -0
- package/presets/mavis/php-laravel/commands/update.md +34 -0
- package/presets/mavis/php-laravel/hooks/README.md +3 -0
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +282 -26
- package/presets/mavis/php-laravel/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/php-laravel/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/php-laravel/team/README.md +2 -0
- package/presets/mavis/svelte/MAVIS.md +1 -0
- package/presets/mavis/svelte/MCP.md +2 -2
- package/presets/mavis/svelte/REPO_AGENTS.md +14 -0
- package/presets/mavis/svelte/adapter-map.json +17 -1
- package/presets/mavis/svelte/agents/build-verifier.md +1 -1
- package/presets/mavis/svelte/agents/code-reviewer.md +1 -1
- package/presets/mavis/svelte/agents/debugger.md +1 -1
- package/presets/mavis/svelte/agents/feature-developer.md +1 -1
- package/presets/mavis/svelte/agents/task-analyst.md +1 -1
- package/presets/mavis/svelte/commands/README.md +1 -0
- package/presets/mavis/svelte/commands/task-continue.md +9 -0
- package/presets/mavis/svelte/commands/technical-retro.md +8 -0
- package/presets/mavis/svelte/commands/update.md +34 -0
- package/presets/mavis/svelte/hooks/README.md +3 -0
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +252 -24
- package/presets/mavis/svelte/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/svelte/mcp.json +1 -1
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/svelte/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/svelte/team/README.md +2 -0
- package/presets/mavis/svelte/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/opencode/android-kotlin/MCP.md +2 -2
- package/presets/opencode/android-kotlin/OPENCODE.md +15 -6
- package/presets/opencode/android-kotlin/REPO_AGENTS.md +14 -0
- package/presets/opencode/android-kotlin/adapter-map.json +17 -1
- package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
- package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/opencode/android-kotlin/commands/README.md +1 -0
- package/presets/opencode/android-kotlin/commands/task-continue.md +9 -0
- package/presets/opencode/android-kotlin/commands/technical-retro.md +8 -0
- package/presets/opencode/android-kotlin/commands/update.md +42 -0
- package/presets/opencode/android-kotlin/hooks/README.md +3 -0
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +257 -25
- package/presets/opencode/android-kotlin/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/android-kotlin/opencode.json +3 -13
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/android-kotlin/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/android-kotlin/team/README.md +2 -0
- package/presets/opencode/android-kotlin/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/opencode/go/MCP.md +2 -2
- package/presets/opencode/go/OPENCODE.md +14 -6
- package/presets/opencode/go/REPO_AGENTS.md +14 -0
- package/presets/opencode/go/adapter-map.json +17 -1
- package/presets/opencode/go/agents/build-verifier.md +1 -1
- package/presets/opencode/go/agents/code-reviewer.md +1 -1
- package/presets/opencode/go/agents/debugger.md +1 -1
- package/presets/opencode/go/agents/feature-developer.md +1 -1
- package/presets/opencode/go/agents/task-analyst.md +1 -1
- package/presets/opencode/go/commands/README.md +1 -0
- package/presets/opencode/go/commands/task-continue.md +9 -0
- package/presets/opencode/go/commands/technical-retro.md +8 -0
- package/presets/opencode/go/commands/update.md +42 -0
- package/presets/opencode/go/hooks/README.md +3 -0
- package/presets/opencode/go/hooks/chain-team-phases.sh +282 -26
- package/presets/opencode/go/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/go/opencode.json +3 -13
- package/presets/opencode/go/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/go/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/go/team/README.md +2 -0
- package/presets/opencode/ios-swift/MCP.md +2 -2
- package/presets/opencode/ios-swift/OPENCODE.md +15 -6
- package/presets/opencode/ios-swift/REPO_AGENTS.md +14 -0
- package/presets/opencode/ios-swift/adapter-map.json +17 -1
- package/presets/opencode/ios-swift/agents/build-verifier.md +1 -1
- package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/opencode/ios-swift/agents/debugger.md +1 -1
- package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
- package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
- package/presets/opencode/ios-swift/commands/README.md +1 -0
- package/presets/opencode/ios-swift/commands/task-continue.md +9 -0
- package/presets/opencode/ios-swift/commands/technical-retro.md +8 -0
- package/presets/opencode/ios-swift/commands/update.md +42 -0
- package/presets/opencode/ios-swift/hooks/README.md +3 -0
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +257 -25
- package/presets/opencode/ios-swift/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/ios-swift/opencode.json +3 -13
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/ios-swift/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/ios-swift/team/README.md +2 -0
- package/presets/opencode/ios-swift/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/opencode/java/OPENCODE.md +14 -6
- package/presets/opencode/java/REPO_AGENTS.md +14 -0
- package/presets/opencode/java/adapter-map.json +17 -1
- package/presets/opencode/java/agents/build-verifier.md +1 -1
- package/presets/opencode/java/agents/code-reviewer.md +1 -1
- package/presets/opencode/java/agents/debugger.md +1 -1
- package/presets/opencode/java/agents/feature-developer.md +1 -1
- package/presets/opencode/java/agents/task-analyst.md +1 -1
- package/presets/opencode/java/commands/README.md +1 -0
- package/presets/opencode/java/commands/task-continue.md +9 -0
- package/presets/opencode/java/commands/technical-retro.md +8 -0
- package/presets/opencode/java/commands/update.md +42 -0
- package/presets/opencode/java/hooks/README.md +3 -0
- package/presets/opencode/java/hooks/chain-team-phases.sh +282 -26
- package/presets/opencode/java/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/java/opencode.json +2 -12
- package/presets/opencode/java/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/java/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/java/team/README.md +2 -0
- package/presets/opencode/mcp-ts/OPENCODE.md +14 -6
- package/presets/opencode/mcp-ts/REPO_AGENTS.md +14 -0
- package/presets/opencode/mcp-ts/adapter-map.json +17 -1
- package/presets/opencode/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/opencode/mcp-ts/commands/README.md +1 -0
- package/presets/opencode/mcp-ts/commands/task-continue.md +9 -0
- package/presets/opencode/mcp-ts/commands/technical-retro.md +8 -0
- package/presets/opencode/mcp-ts/commands/update.md +42 -0
- package/presets/opencode/mcp-ts/hooks/README.md +3 -0
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +286 -28
- package/presets/opencode/mcp-ts/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/mcp-ts/opencode.json +2 -12
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/mcp-ts/team/README.md +2 -0
- package/presets/opencode/next/MCP.md +2 -2
- package/presets/opencode/next/OPENCODE.md +15 -6
- package/presets/opencode/next/REPO_AGENTS.md +15 -1
- package/presets/opencode/next/adapter-map.json +25 -1
- package/presets/opencode/next/agents/build-verifier.md +1 -1
- package/presets/opencode/next/agents/code-reviewer.md +1 -1
- package/presets/opencode/next/agents/debugger.md +1 -1
- package/presets/opencode/next/agents/feature-developer.md +1 -1
- package/presets/opencode/next/agents/task-analyst.md +1 -1
- package/presets/opencode/next/agents/task-router.md +1 -1
- package/presets/opencode/next/commands/README.md +1 -0
- package/presets/opencode/next/commands/task-continue.md +9 -0
- package/presets/opencode/next/commands/technical-retro.md +8 -0
- package/presets/opencode/next/commands/update.md +42 -0
- package/presets/opencode/next/hooks/README.md +3 -0
- package/presets/opencode/next/hooks/chain-team-phases.sh +206 -23
- package/presets/opencode/next/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/next/opencode.json +3 -13
- package/presets/opencode/next/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/next/rules/component-catalog-gate.md +13 -0
- package/presets/opencode/next/rules/forms-validation.md +12 -0
- package/presets/opencode/next/rules/next-app-router.md +27 -0
- package/presets/opencode/next/rules/next-static-export.md +16 -0
- package/presets/opencode/next/rules/react-next-anti-hallucination.md +20 -18
- package/presets/opencode/next/rules/security-next.md +13 -0
- package/presets/opencode/next/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/next/team/README.md +2 -0
- package/presets/opencode/next/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/opencode/next/team/fixtures/feature-light.json +2 -1
- package/presets/opencode/next/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/opencode/nuxt/MCP.md +2 -2
- package/presets/opencode/nuxt/OPENCODE.md +15 -6
- package/presets/opencode/nuxt/REPO_AGENTS.md +14 -0
- package/presets/opencode/nuxt/adapter-map.json +17 -1
- package/presets/opencode/nuxt/agents/build-verifier.md +1 -1
- package/presets/opencode/nuxt/agents/code-reviewer.md +1 -1
- package/presets/opencode/nuxt/agents/debugger.md +1 -1
- package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
- package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
- package/presets/opencode/nuxt/commands/README.md +1 -0
- package/presets/opencode/nuxt/commands/task-continue.md +9 -0
- package/presets/opencode/nuxt/commands/technical-retro.md +8 -0
- package/presets/opencode/nuxt/commands/update.md +42 -0
- package/presets/opencode/nuxt/hooks/README.md +3 -0
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +252 -24
- package/presets/opencode/nuxt/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/nuxt/opencode.json +3 -13
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/nuxt/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/nuxt/team/README.md +2 -0
- package/presets/opencode/nuxt/team/fixtures/artifact-manifest.example.json +1 -0
- package/presets/opencode/php-hexagonal/OPENCODE.md +14 -6
- package/presets/opencode/php-hexagonal/REPO_AGENTS.md +14 -0
- package/presets/opencode/php-hexagonal/adapter-map.json +17 -1
- package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/debugger.md +1 -1
- package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/opencode/php-hexagonal/commands/README.md +1 -0
- package/presets/opencode/php-hexagonal/commands/task-continue.md +9 -0
- package/presets/opencode/php-hexagonal/commands/technical-retro.md +8 -0
- package/presets/opencode/php-hexagonal/commands/update.md +42 -0
- package/presets/opencode/php-hexagonal/hooks/README.md +3 -0
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +282 -26
- package/presets/opencode/php-hexagonal/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/php-hexagonal/opencode.json +2 -12
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/php-hexagonal/team/README.md +2 -0
- package/presets/opencode/php-laravel/OPENCODE.md +14 -6
- package/presets/opencode/php-laravel/REPO_AGENTS.md +14 -0
- package/presets/opencode/php-laravel/adapter-map.json +17 -1
- package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
- package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/opencode/php-laravel/agents/debugger.md +1 -1
- package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
- package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
- package/presets/opencode/php-laravel/commands/README.md +1 -0
- package/presets/opencode/php-laravel/commands/task-continue.md +9 -0
- package/presets/opencode/php-laravel/commands/technical-retro.md +8 -0
- package/presets/opencode/php-laravel/commands/update.md +42 -0
- package/presets/opencode/php-laravel/hooks/README.md +3 -0
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +282 -26
- package/presets/opencode/php-laravel/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/php-laravel/opencode.json +2 -12
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/php-laravel/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/php-laravel/team/README.md +2 -0
- package/presets/opencode/svelte/MCP.md +2 -2
- package/presets/opencode/svelte/OPENCODE.md +15 -6
- package/presets/opencode/svelte/REPO_AGENTS.md +14 -0
- package/presets/opencode/svelte/adapter-map.json +17 -1
- package/presets/opencode/svelte/agents/build-verifier.md +1 -1
- package/presets/opencode/svelte/agents/code-reviewer.md +1 -1
- package/presets/opencode/svelte/agents/debugger.md +1 -1
- package/presets/opencode/svelte/agents/feature-developer.md +1 -1
- package/presets/opencode/svelte/agents/task-analyst.md +1 -1
- package/presets/opencode/svelte/commands/README.md +1 -0
- package/presets/opencode/svelte/commands/task-continue.md +9 -0
- package/presets/opencode/svelte/commands/technical-retro.md +8 -0
- package/presets/opencode/svelte/commands/update.md +42 -0
- package/presets/opencode/svelte/hooks/README.md +3 -0
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +252 -24
- package/presets/opencode/svelte/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/svelte/opencode.json +3 -13
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/svelte/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/svelte/team/README.md +2 -0
- package/presets/opencode/svelte/team/fixtures/artifact-manifest.example.json +1 -0
- package/scripts/check-product-specs.sh +115 -9
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# preset: mcp-ts (TypeScript MCP) — chain handoffs use build-verifier + security-reviewer; no contract-test-*
|
|
3
|
+
# mcp-ts Phase-1 chain: validation via typecheck/tests + security-reviewer (no contract-test-* handoffs)
|
|
4
|
+
# Phase-2 reserved: debugger / ci-investigator are not in mcp-ts Phase 1 roster.
|
|
3
5
|
# Chains agent team steps from pipeline.json after subagentStop.
|
|
4
6
|
# Falls back to legacy phase-based flow when pipeline.json is absent.
|
|
5
7
|
|
|
@@ -12,7 +14,6 @@ const fs = require('fs');
|
|
|
12
14
|
const path = require('path');
|
|
13
15
|
const crypto = require('crypto');
|
|
14
16
|
|
|
15
|
-
// mcp-ts Phase-1 chain: validation via typecheck/tests + security-reviewer (no contract-test-* handoffs)
|
|
16
17
|
const TEAM_ROOT = path.join(process.cwd(), '.ai.local', 'team');
|
|
17
18
|
|
|
18
19
|
const inputRaw = process.env.INPUT || '';
|
|
@@ -174,7 +175,21 @@ function mutateMetrics(mutator) {
|
|
|
174
175
|
try { metrics = JSON.parse(fs.readFileSync(METRICS_PATH, 'utf8')); } catch {
|
|
175
176
|
const runId = status.metricsRunId || `${slug}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
176
177
|
status.metricsRunId = runId;
|
|
177
|
-
|
|
178
|
+
// Resolve profile from pipeline.json (preferred) or status.json, falling back to 'unknown'.
|
|
179
|
+
// The router/agent must never write profile into status.json — pipeline.json is the SoT.
|
|
180
|
+
let profile = 'unknown';
|
|
181
|
+
try {
|
|
182
|
+
if (fs.existsSync(pipelinePath)) {
|
|
183
|
+
const pipe = JSON.parse(fs.readFileSync(pipelinePath, 'utf8'));
|
|
184
|
+
if (pipe && (pipe.profile === 'light' || pipe.profile === 'standard' || pipe.profile === 'full')) {
|
|
185
|
+
profile = pipe.profile;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
} catch {}
|
|
189
|
+
if (profile === 'unknown' && (status.profile === 'light' || status.profile === 'standard' || status.profile === 'full')) {
|
|
190
|
+
profile = status.profile;
|
|
191
|
+
}
|
|
192
|
+
metrics = { schemaVersion: 1, task: { runId, slug, preset: 'ai-rules', stack: STACK, platform: PLATFORM, intent: status.intent || 'unknown', profile }, events: [] };
|
|
178
193
|
metrics.events.push({ eventId: `${runId}:task_started`, type: 'task_started', at: now, source: 'hook', attributionConfidence: 'high' });
|
|
179
194
|
}
|
|
180
195
|
mutator(metrics);
|
|
@@ -231,21 +246,119 @@ function resolvedAttempt() {
|
|
|
231
246
|
const active = status.activeAttempts || {}; const entries = Object.entries(active);
|
|
232
247
|
const stableAttemptId = hookInput.attemptId;
|
|
233
248
|
if (stableAttemptId) {
|
|
234
|
-
return active[stableAttemptId]
|
|
249
|
+
return active[stableAttemptId]
|
|
250
|
+
? { attemptId: stableAttemptId, entry: active[stableAttemptId], confidence: 'high' }
|
|
251
|
+
: null;
|
|
235
252
|
}
|
|
236
253
|
if (entries.length === 1) return { attemptId: entries[0][0], entry: entries[0][1], confidence: 'high' };
|
|
237
254
|
try { const receipts = JSON.parse(fs.readFileSync(path.join(taskDir, '.metrics-receipts.json'), 'utf8')); const receipt = Array.isArray(receipts) ? receipts.find((item) => active[item.attemptId]) : null; if (receipt) return { attemptId: receipt.attemptId, entry: active[receipt.attemptId], confidence: 'fallback', source: 'agent' }; } catch {}
|
|
238
255
|
return null;
|
|
239
256
|
}
|
|
257
|
+
let artifactStallMessage = null;
|
|
258
|
+
|
|
259
|
+
// A1: seed the manifest a modern pipeline expects instead of advancing without
|
|
260
|
+
// one. Exclusive publish via hard link so a producer that wrote the file in the
|
|
261
|
+
// meantime is never overwritten; returns null on success (or when the file
|
|
262
|
+
// appeared) and the fs error otherwise.
|
|
263
|
+
function writeSkeletonManifest(manifestPath) {
|
|
264
|
+
const temporary = `${manifestPath}.${process.pid}.${Date.now()}.seed`;
|
|
265
|
+
const body = JSON.stringify({ schemaVersion: 1, slug, artifacts: [] }, null, 2) + '\n';
|
|
266
|
+
let descriptor = null;
|
|
267
|
+
try {
|
|
268
|
+
descriptor = fs.openSync(temporary, 'wx');
|
|
269
|
+
try { fs.writeSync(descriptor, body); try { fs.fsyncSync(descriptor); } catch {} } finally { fs.closeSync(descriptor); descriptor = null; }
|
|
270
|
+
fs.linkSync(temporary, manifestPath);
|
|
271
|
+
fs.unlinkSync(temporary);
|
|
272
|
+
return null;
|
|
273
|
+
} catch (error) {
|
|
274
|
+
if (descriptor !== null) { try { fs.closeSync(descriptor); } catch {} }
|
|
275
|
+
try { fs.unlinkSync(temporary); } catch {}
|
|
276
|
+
if (error && error.code === 'EEXIST' && fs.existsSync(manifestPath)) return null;
|
|
277
|
+
return String(error && error.message ? error.message : error);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// A2: a `completed` receipt must cite evidence the harness can inspect. Order is
|
|
282
|
+
// the message order — the first failing predicate wins, so the operator sees one
|
|
283
|
+
// actionable line. `authoritativePaths[]` stays task-dir-relative; external
|
|
284
|
+
// references belong in `evidencePaths[]`.
|
|
285
|
+
function validateCompletedArtifact(entry) {
|
|
286
|
+
const artifactId = entry && entry.id ? entry.id : '(unnamed)';
|
|
287
|
+
const entryStatus = entry && entry.status;
|
|
288
|
+
if (entryStatus !== 'completed') {
|
|
289
|
+
return `[chain-team-phases] ${slug}: receipt "${artifactId}" has receipt.outcome "completed" but entry status "${entryStatus}". Make entry.status and receipt.outcome agree, then resume with: /task-continue ${slug}`;
|
|
290
|
+
}
|
|
291
|
+
const authoritativePaths = entry && Array.isArray(entry.authoritativePaths) ? entry.authoritativePaths : [];
|
|
292
|
+
if (authoritativePaths.length === 0) {
|
|
293
|
+
return `[chain-team-phases] ${slug}: receipt "${artifactId}" is "completed" but authoritativePaths[] is empty. Record at least one file you produced under .ai.local/team/tasks/${slug}/, then resume with: /task-continue ${slug}`;
|
|
294
|
+
}
|
|
295
|
+
for (const cited of authoritativePaths) {
|
|
296
|
+
const value = typeof cited === 'string' ? cited.trim() : '';
|
|
297
|
+
const resolvedPath = value ? path.resolve(taskDir, value) : taskDir;
|
|
298
|
+
const relative = path.relative(taskDir, resolvedPath);
|
|
299
|
+
const escapes = !value || path.isAbsolute(value) || relative === '' || relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative);
|
|
300
|
+
if (escapes) {
|
|
301
|
+
return `[chain-team-phases] ${slug}: receipt "${artifactId}" cites "${value}", which resolves outside .ai.local/team/tasks/${slug}/ (relative: "${relative}"). Cite a task-relative path; keep external references in evidencePaths[]. Then resume with: /task-continue ${slug}`;
|
|
302
|
+
}
|
|
303
|
+
let stat = null;
|
|
304
|
+
try { stat = fs.statSync(resolvedPath); } catch {}
|
|
305
|
+
if (!stat || !stat.isFile()) {
|
|
306
|
+
return `[chain-team-phases] ${slug}: receipt "${artifactId}" cites "${value}" but no such file exists under .ai.local/team/tasks/${slug}/. Write the file, then resume with: /task-continue ${slug}`;
|
|
307
|
+
}
|
|
308
|
+
if (/\.md[c]?$/i.test(value)) {
|
|
309
|
+
let content = '';
|
|
310
|
+
try { content = fs.readFileSync(resolvedPath, 'utf8'); } catch {}
|
|
311
|
+
if (!/\S/.test(content)) {
|
|
312
|
+
return `[chain-team-phases] ${slug}: receipt "${artifactId}" is "completed" but authoritative path "${value}" has no non-whitespace content. Produce the artifact, then resume with: /task-continue ${slug}`;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return null;
|
|
317
|
+
}
|
|
318
|
+
|
|
240
319
|
function readBoundReceiptOutcome(agent, step, resolved) {
|
|
241
320
|
if (!agent || !resolved) return { outcome: null, receiptRequired: false };
|
|
242
321
|
const manifestPath = path.join(taskDir, 'artifact-manifest.json');
|
|
243
|
-
|
|
322
|
+
const expectedOutputId = artifactOutputIdFor(step, agent);
|
|
323
|
+
if (!fs.existsSync(manifestPath)) {
|
|
324
|
+
// A1: absent manifest + a parsed modern pipeline denies silent advancement.
|
|
325
|
+
// Legacy/step-less pipelines keep their previous behaviour (legacyFlow owns them).
|
|
326
|
+
if (!(Array.isArray(steps) && steps.length > 0)) return { outcome: null, receiptRequired: false };
|
|
327
|
+
const seeded = writeSkeletonManifest(manifestPath);
|
|
328
|
+
const stepIndex = typeof resolved.entry.stepIndex === 'number' ? resolved.entry.stepIndex : 0;
|
|
329
|
+
if (seeded) {
|
|
330
|
+
return { outcome: null, receiptRequired: true, stallMessage: `[chain-team-phases] ${slug}: artifact-manifest.json is missing and the skeleton could not be written (${seeded}). Create .ai.local/team/tasks/${slug}/artifact-manifest.json with {schemaVersion:1, slug, artifacts:[]}, add the receipt for artifactOutputId "${expectedOutputId}", then resume with: /task-continue ${slug}` };
|
|
331
|
+
}
|
|
332
|
+
return { outcome: null, receiptRequired: true, stallMessage: `[chain-team-phases] ${slug}: no artifact-manifest.json for step ${stepIndex} (${agent}). Wrote a skeleton {schemaVersion:1, slug, artifacts:[]}. Expected artifactOutputId "${expectedOutputId}". Write the artifact and its receipt, then resume with: /task-continue ${slug}` };
|
|
333
|
+
}
|
|
244
334
|
try {
|
|
245
335
|
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
336
|
+
// Guard: the schema key is `artifacts` (see agent-artifact-contracts.md). A top-level
|
|
337
|
+
// `entries` key is a silent bug — producer wrote to a wrong field, hook would not
|
|
338
|
+
// see the receipt, and the step hangs in `awaiting_artifact_receipt`. Warn loudly.
|
|
339
|
+
if (manifest && typeof manifest === 'object' && !Array.isArray(manifest.artifacts) && Array.isArray(manifest.entries)) {
|
|
340
|
+
process.stderr.write(`WARNING: ${manifestPath} has top-level "entries" but no "artifacts" array; reading only "artifacts" per schema. The producer likely upserted into the wrong key. See agent-artifact-contracts.md (Schema field name).` + '\n');
|
|
341
|
+
} else if (manifest && typeof manifest === 'object' && Array.isArray(manifest.entries) && Array.isArray(manifest.artifacts)) {
|
|
342
|
+
process.stderr.write(`WARNING: ${manifestPath} has both "artifacts" and "entries" keys; reading only "artifacts" per schema. Foreign "entries" content is ignored.` + '\n');
|
|
343
|
+
}
|
|
246
344
|
const artifacts = Array.isArray(manifest.artifacts) ? manifest.artifacts : [];
|
|
247
|
-
const expectedOutputId = artifactOutputIdFor(step, agent);
|
|
248
345
|
const attemptStartedAt = Date.parse(resolved.entry.startedAt);
|
|
346
|
+
// Pre-scan: warn on the silent-bug classes the filter below would otherwise drop.
|
|
347
|
+
// A receipt with a non-matching attemptId is dropped silently; without this warning,
|
|
348
|
+
// the step hangs in `awaiting_artifact_receipt` with no signal of why. Same for
|
|
349
|
+
// receipts whose terminal timestamp is older than the active attempt (stale retry).
|
|
350
|
+
const activeIds = new Set(Object.keys(status.activeAttempts || {}));
|
|
351
|
+
for (const entry of artifacts) {
|
|
352
|
+
if (!entry || entry.producer !== agent || !entry.receipt || typeof entry.receipt.outcome !== 'string') continue;
|
|
353
|
+
const rid = entry.receipt.attemptId;
|
|
354
|
+
if (typeof rid === 'string' && rid !== resolved.attemptId && !activeIds.has(rid)) {
|
|
355
|
+
process.stderr.write(`WARNING: ${manifestPath} receipt for producer "${agent}" id "${entry.id}" carries attemptId "${rid}" that does not match the active attempt "${resolved.attemptId}". The receipt is being dropped; step will hang in \`awaiting_artifact_receipt\` unless the producer retries. Common cause: agent reused an attemptId from a prior failed attempt. See agent-artifact-contracts.md (Receipt binding).` + '\n');
|
|
356
|
+
}
|
|
357
|
+
const terminalAt = Date.parse(entry.timestamps?.completedAt || entry.timestamps?.updatedAt || '');
|
|
358
|
+
if (Number.isFinite(attemptStartedAt) && Number.isFinite(terminalAt) && terminalAt < attemptStartedAt) {
|
|
359
|
+
process.stderr.write(`WARNING: ${manifestPath} receipt for producer "${agent}" id "${entry.id}" has timestamps.completedAt older than the active attempt's startedAt. Likely a stale receipt from a previous attempt; it is being dropped. See agent-artifact-contracts.md (Receipt binding).` + '\n');
|
|
360
|
+
}
|
|
361
|
+
}
|
|
249
362
|
const owned = artifacts
|
|
250
363
|
.filter((entry) => {
|
|
251
364
|
if (!entry || entry.producer !== agent || !entry.receipt || typeof entry.receipt.outcome !== 'string') return false;
|
|
@@ -260,19 +373,33 @@ function readBoundReceiptOutcome(agent, step, resolved) {
|
|
|
260
373
|
const tb = Date.parse(b.timestamps?.completedAt || b.timestamps?.updatedAt || 0) || 0;
|
|
261
374
|
return tb - ta;
|
|
262
375
|
});
|
|
263
|
-
|
|
376
|
+
// Bonus: warn if the active attempt's receipts all lack attemptId in a non-parallel step.
|
|
377
|
+
// The orchestrator always provides attemptId, so a missing one means the agent dropped it
|
|
378
|
+
// (model output, JSON.stringify omission, etc.). boundByOutput still binds the receipt by
|
|
379
|
+
// expectedOutputId, so this is not fatal — but it is a contract violation worth flagging.
|
|
380
|
+
if (owned.length > 0 && owned[0].receipt.attemptId == null && !(step && step.parallel && Array.isArray(getStepAgents(step)) && getStepAgents(step).length > 1)) {
|
|
381
|
+
process.stderr.write(`WARNING: ${manifestPath} receipt for producer "${agent}" id "${owned[0].id}" lacks entry.receipt.attemptId on a non-parallel step. The receipt is bound by output-id fallback; the agent should always include the attemptId the orchestrator provides. See agent-artifact-contracts.md (Receipt binding).` + '\n');
|
|
382
|
+
}
|
|
383
|
+
const outcome = owned[0]?.receipt?.outcome || null;
|
|
384
|
+
if (outcome === 'completed') {
|
|
385
|
+
const stallMessage = validateCompletedArtifact(owned[0]);
|
|
386
|
+
if (stallMessage) return { outcome: null, receiptRequired: true, stallMessage };
|
|
387
|
+
}
|
|
388
|
+
return { outcome, receiptRequired: true };
|
|
264
389
|
} catch {
|
|
265
390
|
return { outcome: null, receiptRequired: false };
|
|
266
391
|
}
|
|
267
392
|
}
|
|
268
393
|
function reconcileStatusFromManifest(agent, step, resolved) {
|
|
269
394
|
const terminal = new Set(['completed', 'blocked', 'changes_requested', 'validation_failed']);
|
|
270
|
-
|
|
395
|
+
artifactStallMessage = null;
|
|
396
|
+
const { outcome, receiptRequired, stallMessage } = readBoundReceiptOutcome(agent, step, resolved);
|
|
271
397
|
if (terminal.has(outcome)) {
|
|
272
398
|
status.state = outcome;
|
|
273
399
|
return outcome;
|
|
274
400
|
}
|
|
275
401
|
if (receiptRequired) {
|
|
402
|
+
artifactStallMessage = stallMessage || null;
|
|
276
403
|
status.state = 'awaiting_artifact_receipt';
|
|
277
404
|
status.phase = 'blocked';
|
|
278
405
|
return status.state;
|
|
@@ -293,6 +420,34 @@ function finishActiveAttempt(forced) {
|
|
|
293
420
|
appendMetric({ type: 'attempt_finished', at: now, attemptId: resolved.attemptId, outcome, durationMs: Number.isFinite(durationMs) && durationMs >= 0 ? durationMs : null, retryAfterFix: status.retryAfterFix || null, source: resolved.source || 'hook', attributionConfidence: resolved.confidence });
|
|
294
421
|
const active = { ...(status.activeAttempts || {}) }; delete active[resolved.attemptId]; status.activeAttempts = active; status.lastCompletedAttempt = { attemptId: resolved.attemptId, completedAt: now }; return { ...resolved, outcome };
|
|
295
422
|
}
|
|
423
|
+
function missingConsumerArtifacts() {
|
|
424
|
+
const file = path.join(process.cwd(), '.ai.local', 'pipeline-gates.json');
|
|
425
|
+
if (!fs.existsSync(file)) return [];
|
|
426
|
+
let parsed;
|
|
427
|
+
try { parsed = JSON.parse(fs.readFileSync(file, 'utf8')); } catch { return []; }
|
|
428
|
+
const required = Array.isArray(parsed && parsed.requireArtifacts) ? parsed.requireArtifacts : [];
|
|
429
|
+
const ids = required.filter((id) => typeof id === 'string' && /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(id));
|
|
430
|
+
if (ids.length === 0) return [];
|
|
431
|
+
let manifest = { artifacts: [] };
|
|
432
|
+
try { manifest = JSON.parse(fs.readFileSync(path.join(taskDir, 'artifact-manifest.json'), 'utf8')); } catch {}
|
|
433
|
+
const done = new Set(
|
|
434
|
+
(manifest.artifacts || [])
|
|
435
|
+
.filter((artifact) => artifact && artifact.status === 'completed' && ids.includes(artifact.id))
|
|
436
|
+
.map((artifact) => artifact.id),
|
|
437
|
+
);
|
|
438
|
+
return ids.filter((id) => !done.has(id));
|
|
439
|
+
}
|
|
440
|
+
function completePipeline(statusPatch) {
|
|
441
|
+
const missing = missingConsumerArtifacts();
|
|
442
|
+
if (missing.length > 0) {
|
|
443
|
+
writeStatus({ ...statusPatch, phase: 'blocked', state: 'blocked', currentAgent: null, awaitingHumanGate: false });
|
|
444
|
+
out(`Pipeline blocked for "${slug}": .ai.local/pipeline-gates.json requireArtifacts missing completed receipt(s): ${missing.join(', ')}.`);
|
|
445
|
+
process.exit(0);
|
|
446
|
+
}
|
|
447
|
+
writeStatus(statusPatch);
|
|
448
|
+
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
449
|
+
process.exit(0);
|
|
450
|
+
}
|
|
296
451
|
function beginHumanGate() { const eventId = `${status.metricsRunId || slug}:gate:${Date.now()}`; appendMetric({ eventId, type: 'human_gate_started', at: now, source: 'hook', attributionConfidence: 'high' }); status.activeHumanGateEventId = eventId; }
|
|
297
452
|
function endHumanGateIfResumed() {
|
|
298
453
|
if (!status.activeHumanGateEventId || status.awaitingHumanGate || status.state === 'awaiting_approval') return;
|
|
@@ -331,6 +486,15 @@ function out(message) {
|
|
|
331
486
|
process.stdout.write(JSON.stringify({ followup_message: message }));
|
|
332
487
|
}
|
|
333
488
|
|
|
489
|
+
// The stall text always reaches stderr so a second, different rejection is never
|
|
490
|
+
// silent; `out()` fires only when the stop enters the stall, so the follow-up
|
|
491
|
+
// message cannot loop.
|
|
492
|
+
function emitArtifactStall(message, announce) {
|
|
493
|
+
if (message) process.stderr.write(message + '\n');
|
|
494
|
+
if (message && announce) out(message);
|
|
495
|
+
else process.stdout.write('{}');
|
|
496
|
+
}
|
|
497
|
+
|
|
334
498
|
function readArtifact(name) {
|
|
335
499
|
const p = path.join(taskDir, name);
|
|
336
500
|
if (!fs.existsSync(p)) return '';
|
|
@@ -348,7 +512,6 @@ function getStepAgents(step) {
|
|
|
348
512
|
|
|
349
513
|
function skipIfMatches(skipIf, dir) {
|
|
350
514
|
if (!skipIf) return false;
|
|
351
|
-
// Phase-2 reserved: debugger / ci-investigator are not in mcp-ts Phase 1 roster.
|
|
352
515
|
if (skipIf === 'debugger.fixed') {
|
|
353
516
|
const text = readArtifact('debug-report.md');
|
|
354
517
|
return /fixApplied:\s*true/i.test(text) || /\*\*Fix applied:\*\*\s*true/i.test(text);
|
|
@@ -578,21 +741,23 @@ const AGENT_HANDOFF = {
|
|
|
578
741
|
`Invoke solution-architect for slug "${s}". Read brief.md; write architecture.md for MCP tool/resource/prompt contracts and module boundaries. Upsert the owned terminal receipt in artifact-manifest.json; do not mutate status.json lifecycle fields.`,
|
|
579
742
|
'feature-developer': (s) =>
|
|
580
743
|
`Invoke feature-developer for slug "${s}". Read brief.md, decomposition.md, validation-report.md, architecture.md, security-review.md, debug-report.md if present. ` +
|
|
581
|
-
`Follow feature-delivery
|
|
744
|
+
`Follow architecture/feature-delivery.md and architecture/reference-features.md. Mandatory flow: contract → schema → handler → registration → unit/contract verification → package validation. ` +
|
|
582
745
|
`Include schema/handler unit tests before handoff. Upsert the owned terminal receipt in artifact-manifest.json; do not mutate status.json lifecycle fields.`,
|
|
583
746
|
'build-verifier': (s) =>
|
|
584
|
-
`Invoke build-verifier (readonly) for slug "${s}". Follow mcp-ts-tooling.
|
|
747
|
+
`Invoke build-verifier (readonly) for slug "${s}". Follow tooling-and-review/mcp-ts-tooling.md and tooling-and-review/post-change-test.md. ` +
|
|
585
748
|
`Discover package manager; run typecheck + project tests — never Playwright/XCUITest/Next lint recipes/Go tools as required gates. ` +
|
|
586
749
|
`Write validation-report.md and emit receipt outcome completed or validation_failed. Do not edit production code.`,
|
|
587
750
|
'security-reviewer': (s) =>
|
|
588
|
-
`Invoke security-reviewer (readonly) for slug "${s}". Follow security-mcp.
|
|
751
|
+
`Invoke security-reviewer (readonly) for slug "${s}". Follow tooling-and-review/security-mcp.md and api-and-data/mcp-auth-secrets.md; write security-review.md. Upsert the owned terminal receipt in artifact-manifest.json; do not mutate status.json lifecycle fields.`,
|
|
589
752
|
};
|
|
590
753
|
|
|
591
754
|
const REVIEW_AGENTS = new Set([
|
|
755
|
+
'code-reviewer',
|
|
756
|
+
'accessibility-reviewer',
|
|
592
757
|
'security-reviewer',
|
|
758
|
+
'api-contract-reviewer',
|
|
593
759
|
]);
|
|
594
760
|
|
|
595
|
-
|
|
596
761
|
function metricsHandoff(agent) {
|
|
597
762
|
const matches = Object.entries(status.activeAttempts || {}).filter(([, entry]) => entry.agent === agent);
|
|
598
763
|
if (matches.length === 1) {
|
|
@@ -750,9 +915,7 @@ if (hookInput.action === 'end_human_gate') {
|
|
|
750
915
|
if (pendingStepIndexes().length === 0) {
|
|
751
916
|
status.state = 'completed';
|
|
752
917
|
completeTaskMetrics();
|
|
753
|
-
|
|
754
|
-
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
755
|
-
process.exit(0);
|
|
918
|
+
completePipeline({ pipelineIndex: resumeSteps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
|
|
756
919
|
}
|
|
757
920
|
out(noProgressNotice());
|
|
758
921
|
process.exit(0);
|
|
@@ -778,15 +941,13 @@ if (hookInput.action === 'end_human_gate') {
|
|
|
778
941
|
// pipeline instead of leaving it in_progress forever.
|
|
779
942
|
status.state = 'completed';
|
|
780
943
|
completeTaskMetrics();
|
|
781
|
-
|
|
944
|
+
completePipeline({
|
|
782
945
|
pipelineIndex: resumeSteps.length,
|
|
783
946
|
phase: 'done',
|
|
784
947
|
state: 'completed',
|
|
785
948
|
currentAgent: null,
|
|
786
949
|
awaitingHumanGate: false,
|
|
787
950
|
});
|
|
788
|
-
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
789
|
-
process.exit(0);
|
|
790
951
|
}
|
|
791
952
|
}
|
|
792
953
|
// A2 (retro §8): if gate closes the final human gate of the pipeline
|
|
@@ -866,10 +1027,11 @@ const completingAgentHint = (() => {
|
|
|
866
1027
|
return getStepAgents(initialStep)[0];
|
|
867
1028
|
})();
|
|
868
1029
|
const reconcilingAttempt = resolvedAttempt();
|
|
1030
|
+
const wasWaitingForReceipt = status.state === 'awaiting_artifact_receipt';
|
|
869
1031
|
reconcileStatusFromManifest(completingAgentHint, initialStep, reconcilingAttempt);
|
|
870
1032
|
if (status.state === 'awaiting_artifact_receipt') {
|
|
871
1033
|
writeStatus({});
|
|
872
|
-
|
|
1034
|
+
emitArtifactStall(artifactStallMessage, !wasWaitingForReceipt);
|
|
873
1035
|
process.exit(0);
|
|
874
1036
|
}
|
|
875
1037
|
let finishedAttempt = finishActiveAttempt();
|
|
@@ -879,6 +1041,11 @@ if (!finishedAttempt && activeAttemptCountBeforeFinish > 0) {
|
|
|
879
1041
|
if (repaired) {
|
|
880
1042
|
appendMetric({ type: 'parallel_attribution_repair', at: now, attemptIds: [repaired.attemptId], source: 'hook', attributionConfidence: 'fallback' });
|
|
881
1043
|
reconcileStatusFromManifest(repaired.entry.agent, steps[repaired.entry.stepIndex], repaired);
|
|
1044
|
+
if (status.state === 'awaiting_artifact_receipt') {
|
|
1045
|
+
writeStatus({});
|
|
1046
|
+
emitArtifactStall(artifactStallMessage, true);
|
|
1047
|
+
process.exit(0);
|
|
1048
|
+
}
|
|
882
1049
|
finishedAttempt = finishActiveAttempt(repaired);
|
|
883
1050
|
} else {
|
|
884
1051
|
writeStatus({});
|
|
@@ -935,6 +1102,7 @@ const waveIndexes = activeWave
|
|
|
935
1102
|
? [idx]
|
|
936
1103
|
: (isGraphMode() && finishedAttempt ? [completedStepIndex] : null));
|
|
937
1104
|
|
|
1105
|
+
|
|
938
1106
|
if (waveIndexes) {
|
|
939
1107
|
const waveAgents = waveIndexes.flatMap((i) => getStepAgents(steps[i]));
|
|
940
1108
|
const done = [...(status.parallelCompleted || [])];
|
|
@@ -987,6 +1155,20 @@ if (waveIndexes) {
|
|
|
987
1155
|
}
|
|
988
1156
|
|
|
989
1157
|
const retryReviewer = waveAgents.find((agent) => outcomes[agent]?.outcome === 'changes_requested');
|
|
1158
|
+
if (retryReviewer === 'mockup-reviewer') {
|
|
1159
|
+
beginHumanGate();
|
|
1160
|
+
writeStatus({
|
|
1161
|
+
awaitingHumanGate: true,
|
|
1162
|
+
state: 'awaiting_approval',
|
|
1163
|
+
currentAgent: 'mockup-reviewer',
|
|
1164
|
+
parallelCompleted: [],
|
|
1165
|
+
parallelOutcomes: {},
|
|
1166
|
+
waveSteps: [],
|
|
1167
|
+
waveId: null,
|
|
1168
|
+
});
|
|
1169
|
+
out(`Mockup review FAIL for slug "${slug}". Read mockup-review.md. Resume only via /task-continue. Do not retry feature-developer.`);
|
|
1170
|
+
process.exit(0);
|
|
1171
|
+
}
|
|
990
1172
|
if (retryReviewer) {
|
|
991
1173
|
if (isGraphMode()) {
|
|
992
1174
|
const reviewerStepIndex = waveIndexes.find((i) => getStepAgents(steps[i]).includes(retryReviewer));
|
|
@@ -1070,9 +1252,7 @@ if (waveIndexes) {
|
|
|
1070
1252
|
}
|
|
1071
1253
|
if (pendingStepIndexes().length === 0) {
|
|
1072
1254
|
completeTaskMetrics();
|
|
1073
|
-
|
|
1074
|
-
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
1075
|
-
process.exit(0);
|
|
1255
|
+
completePipeline({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
|
|
1076
1256
|
}
|
|
1077
1257
|
out(noProgressNotice());
|
|
1078
1258
|
process.exit(0);
|
|
@@ -1093,6 +1273,17 @@ if (status.state === 'blocked') {
|
|
|
1093
1273
|
process.exit(0);
|
|
1094
1274
|
}
|
|
1095
1275
|
|
|
1276
|
+
if (status.state === 'changes_requested' && (completedAgent === 'mockup-reviewer' || status.currentAgent === 'mockup-reviewer')) {
|
|
1277
|
+
beginHumanGate();
|
|
1278
|
+
writeStatus({
|
|
1279
|
+
awaitingHumanGate: true,
|
|
1280
|
+
state: 'awaiting_approval',
|
|
1281
|
+
currentAgent: 'mockup-reviewer',
|
|
1282
|
+
});
|
|
1283
|
+
out(`Mockup review FAIL for slug "${slug}". Read mockup-review.md. Resume only via /task-continue. Do not retry feature-developer.`);
|
|
1284
|
+
process.exit(0);
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1096
1287
|
if (status.state === 'changes_requested') {
|
|
1097
1288
|
const reviewer = status.currentAgent || finishedAttempt?.entry?.agent;
|
|
1098
1289
|
if (!reviewer) {
|
|
@@ -1153,9 +1344,7 @@ if (status.state === 'completed' && status.retryAfterFix) {
|
|
|
1153
1344
|
}
|
|
1154
1345
|
|
|
1155
1346
|
if (!currentStep) {
|
|
1156
|
-
|
|
1157
|
-
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
1158
|
-
process.exit(0);
|
|
1347
|
+
completePipeline({ phase: 'done', state: 'completed', currentAgent: null });
|
|
1159
1348
|
}
|
|
1160
1349
|
|
|
1161
1350
|
if (hasGateAfterStep(currentStep, pipeline.humanGates)) {
|
|
@@ -1177,9 +1366,7 @@ if (isGraphMode()) {
|
|
|
1177
1366
|
if (dispatchReadyWave()) process.exit(0);
|
|
1178
1367
|
if (pendingStepIndexes().length === 0) {
|
|
1179
1368
|
completeTaskMetrics();
|
|
1180
|
-
|
|
1181
|
-
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
1182
|
-
process.exit(0);
|
|
1369
|
+
completePipeline({ pipelineIndex: steps.length, phase: 'done', state: 'completed', currentAgent: null, awaitingHumanGate: false });
|
|
1183
1370
|
}
|
|
1184
1371
|
out(noProgressNotice());
|
|
1185
1372
|
process.exit(0);
|
|
@@ -1188,15 +1375,13 @@ if (isGraphMode()) {
|
|
|
1188
1375
|
const next = findNextExecutableStep(steps, idx + 1, taskDir);
|
|
1189
1376
|
if (!next) {
|
|
1190
1377
|
completeTaskMetrics();
|
|
1191
|
-
|
|
1378
|
+
completePipeline({
|
|
1192
1379
|
pipelineIndex: steps.length,
|
|
1193
1380
|
phase: 'done',
|
|
1194
1381
|
state: 'completed',
|
|
1195
1382
|
currentAgent: null,
|
|
1196
1383
|
awaitingHumanGate: false,
|
|
1197
1384
|
});
|
|
1198
|
-
out(`Pipeline complete for "${slug}". Run /technical-retro ${slug}.`);
|
|
1199
|
-
process.exit(0);
|
|
1200
1385
|
}
|
|
1201
1386
|
|
|
1202
1387
|
const { step: nextStep, index: nextIdx } = next;
|
|
@@ -1218,3 +1403,76 @@ if (nextStep.parallel && nextAgents.length > 1) {
|
|
|
1218
1403
|
out(handoffForAgent(nextAgents[0], nextStep.scope, nextStep));
|
|
1219
1404
|
}
|
|
1220
1405
|
NODE
|
|
1406
|
+
|
|
1407
|
+
# --- In-task self-learning postflight ----------------------------------------
|
|
1408
|
+
# One loop run per completed stop, as a second process: capture must not depend
|
|
1409
|
+
# on an agent remembering to run it. The child's stdout is forwarded to stderr
|
|
1410
|
+
# so the hook's own stdout contract (the JSON above) is untouched; `|| true`
|
|
1411
|
+
# plus an unconditional exit 0 keep a loop failure from failing the task; and
|
|
1412
|
+
# `--strict` is never passed — a gate must not live in a hook.
|
|
1413
|
+
INPUT="$input" node <<'POSTFLIGHT' || true
|
|
1414
|
+
const fs = require('fs');
|
|
1415
|
+
const path = require('path');
|
|
1416
|
+
const { spawnSync } = require('child_process');
|
|
1417
|
+
|
|
1418
|
+
let input;
|
|
1419
|
+
try {
|
|
1420
|
+
input = JSON.parse(process.env.INPUT || '');
|
|
1421
|
+
} catch {
|
|
1422
|
+
process.exit(0);
|
|
1423
|
+
}
|
|
1424
|
+
if (!input || input.status !== 'completed') {
|
|
1425
|
+
process.exit(0);
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
// Ratchet: off for `light` pipelines and `spike` intents. A policy skip is
|
|
1429
|
+
// silent on purpose — a warning on every light receipt would make the
|
|
1430
|
+
// containment warnings below unreadable.
|
|
1431
|
+
let pipeline = null;
|
|
1432
|
+
try {
|
|
1433
|
+
const teamRoot = path.join(process.cwd(), '.ai.local', 'team');
|
|
1434
|
+
const active = JSON.parse(fs.readFileSync(path.join(teamRoot, 'active-task.json'), 'utf8'));
|
|
1435
|
+
const pipelineSlug = typeof active.slug === 'string' ? active.slug : '';
|
|
1436
|
+
// Same pattern as `SLUG_RE` at the top of this file: `tasks/<slug>` is
|
|
1437
|
+
// re-derived from `active-task.json` here too, so an unchecked slug could
|
|
1438
|
+
// escape the tree on this path exactly as it could there.
|
|
1439
|
+
const POSTFLIGHT_SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
1440
|
+
if (pipelineSlug.length <= 48 && POSTFLIGHT_SLUG_RE.test(pipelineSlug)) {
|
|
1441
|
+
pipeline = JSON.parse(fs.readFileSync(path.join(teamRoot, 'tasks', pipelineSlug, 'pipeline.json'), 'utf8'));
|
|
1442
|
+
}
|
|
1443
|
+
} catch {
|
|
1444
|
+
pipeline = null;
|
|
1445
|
+
}
|
|
1446
|
+
if (pipeline && (pipeline.profile === 'light' || pipeline.intent === 'spike')) {
|
|
1447
|
+
process.exit(0);
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
if (!fs.existsSync(path.join(process.cwd(), '.ai.local', 'scripts', 'run.mjs'))) {
|
|
1451
|
+
process.stderr.write(
|
|
1452
|
+
'WARNING: self-learning loop skipped: .ai.local/scripts/run.mjs is missing (install it with `npx @bonesofspring/ai-rules init <tool> --preset <stack>`)\n',
|
|
1453
|
+
);
|
|
1454
|
+
process.exit(0);
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
// Relative argv[1] + `cwd` keeps `run.mjs`'s own entry guard (pathToFileURL
|
|
1458
|
+
// comparison) satisfied even when the project path traverses a symlink.
|
|
1459
|
+
// SIGKILL, not the SIGTERM default: a child that ignores SIGTERM would hold the
|
|
1460
|
+
// hook for its whole runtime while the warning below still reported 15 s.
|
|
1461
|
+
const result = spawnSync(process.execPath, ['.ai.local/scripts/run.mjs'], {
|
|
1462
|
+
cwd: process.cwd(),
|
|
1463
|
+
encoding: 'utf8',
|
|
1464
|
+
timeout: 15000,
|
|
1465
|
+
killSignal: 'SIGKILL',
|
|
1466
|
+
});
|
|
1467
|
+
if (result.stdout) process.stderr.write(result.stdout);
|
|
1468
|
+
if (result.stderr) process.stderr.write(result.stderr);
|
|
1469
|
+
if (result.error) {
|
|
1470
|
+
const timedOut = result.error.code === 'ETIMEDOUT';
|
|
1471
|
+
process.stderr.write(
|
|
1472
|
+
`WARNING: self-learning loop ${timedOut ? 'timed out after 15s' : `failed: ${result.error.message}`}\n`,
|
|
1473
|
+
);
|
|
1474
|
+
} else if (result.status !== 0) {
|
|
1475
|
+
process.stderr.write(`WARNING: self-learning loop exited ${result.status}\n`);
|
|
1476
|
+
}
|
|
1477
|
+
process.exit(0);
|
|
1478
|
+
POSTFLIGHT
|