@bonesofspring/ai-rules 0.2.86 → 0.2.90
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 +60 -0
- package/README.md +9 -1
- package/bin/lib/engine-scripts.js +11 -0
- package/bin/lib/seed-ai-local-team.js +79 -2
- package/bin/opencode-install.js +14 -12
- package/docs/OPENCODE-COMPATIBILITY.md +6 -4
- package/docs/OPENCODE.md +15 -8
- package/docs/PRESET-CONTRIBUTION.md +6 -6
- package/docs/TOKEN-ECONOMY.md +20 -0
- package/docs/openapi/team-db.v1.json +2 -2
- package/package.json +1 -1
- package/presets/_shared/ai-local/env.example +54 -0
- package/presets/_shared/ai-local/scripts/aggregate-agent-task-metrics.mjs +34 -5
- package/presets/_shared/ai-local/scripts/check-task-repositories.mjs +25 -22
- package/presets/_shared/ai-local/scripts/process-lease.mjs +3 -2
- package/presets/_shared/ai-local/scripts/processes.mjs +52 -20
- package/presets/_shared/ai-local/scripts/report-step-cost.mjs +544 -0
- package/presets/_shared/ai-local/scripts/run.mjs +38 -6
- package/presets/_shared/ai-local/scripts/settings.mjs +246 -0
- package/presets/_shared/ai-local/scripts/task-worktree.mjs +364 -0
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +2 -2
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +87 -14
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +102 -12
- package/presets/_shared/ai-local/scripts/team-db-tracker.mjs +35 -0
- package/presets/_shared/ai-local/scripts/tracker-planned-drain.mjs +10 -1
- package/presets/_shared/ai-local/scripts/verification.mjs +106 -11
- package/presets/_shared/assets/model-tiers.json +6 -0
- package/presets/_shared/core/agent-team/agent-task-metrics.md +10 -2
- package/presets/_shared/core/agent-team/agent-team-intake.md +2 -0
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +5 -5
- package/presets/_shared/core/meta/preset-writing-style.md +8 -0
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +541 -61
- package/presets/_shared/hooks/guard-shell-command.mjs.tmpl +841 -97
- package/presets/_shared/hooks/prompt-autoroute.mjs.tmpl +153 -0
- package/presets/claude/android-kotlin/CLAUDE.md +2 -4
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/android-kotlin/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/android-kotlin/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/android-kotlin/settings.json +15 -5
- package/presets/claude/go/CLAUDE.md +2 -4
- package/presets/claude/go/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/go/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/go/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/go/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/go/settings.json +15 -5
- package/presets/claude/ios-swift/CLAUDE.md +2 -4
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/ios-swift/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/ios-swift/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/ios-swift/settings.json +15 -5
- package/presets/claude/java/CLAUDE.md +2 -4
- package/presets/claude/java/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/java/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/java/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/java/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/java/settings.json +15 -5
- package/presets/claude/mcp-ts/CLAUDE.md +2 -4
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/mcp-ts/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/mcp-ts/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/mcp-ts/settings.json +15 -5
- package/presets/claude/mol/CLAUDE.md +2 -4
- package/presets/claude/mol/agents/feature-developer.md +1 -1
- package/presets/claude/mol/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/claude/mol/commands/task-evil.md +8 -0
- package/presets/claude/mol/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/mol/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/mol/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/mol/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/mol/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/mol/settings.json +15 -4
- package/presets/claude/next/CLAUDE.md +2 -4
- package/presets/claude/next/REPO_AGENTS.md +2 -0
- package/presets/claude/next/agents/feature-developer.md +1 -1
- package/presets/claude/next/agents/task-analyst.md +1 -7
- package/presets/claude/next/agents/task-router.md +1 -1
- package/presets/claude/next/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/claude/next/commands/spec-start.md +3 -4
- package/presets/claude/next/commands/task-continue.md +9 -8
- package/presets/claude/next/commands/task-evil.md +8 -0
- package/presets/claude/next/commands/task.md +1 -1
- package/presets/claude/next/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/next/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/next/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/next/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/next/settings.json +15 -4
- package/presets/claude/next/team/README.md +1 -1
- package/presets/claude/nuxt/CLAUDE.md +2 -4
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/nuxt/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/nuxt/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/nuxt/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/nuxt/settings.json +15 -4
- package/presets/claude/php-hexagonal/CLAUDE.md +2 -4
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/php-hexagonal/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/php-hexagonal/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/php-hexagonal/settings.json +15 -5
- package/presets/claude/php-laravel/CLAUDE.md +2 -4
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/php-laravel/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/php-laravel/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/php-laravel/settings.json +15 -5
- package/presets/claude/svelte/CLAUDE.md +2 -4
- package/presets/claude/svelte/hooks/chain-team-phases.sh +541 -61
- package/presets/claude/svelte/hooks/guard-shell-command.mjs +841 -97
- package/presets/claude/svelte/hooks/prompt-autoroute.mjs +153 -0
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-intake.md +2 -0
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/svelte/rules/tooling-and-review/preset-writing-style.md +8 -0
- package/presets/claude/svelte/settings.json +15 -4
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/android-kotlin/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/android-kotlin/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/android-kotlin/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/go/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/go/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/go/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/ios-swift/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/ios-swift/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/java/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/java/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/java/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/java/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/mcp-ts/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/mcp-ts/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/mcp-ts/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/mol/agents/feature-developer.md +1 -1
- package/presets/cursor/mol/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/cursor/mol/commands/task-evil.md +8 -0
- package/presets/cursor/mol/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/mol/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/mol/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/mol/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/next/REPO_AGENTS.md +2 -0
- package/presets/cursor/next/agents/feature-developer.md +1 -1
- package/presets/cursor/next/agents/task-analyst.md +1 -7
- package/presets/cursor/next/agents/task-router.md +1 -1
- package/presets/cursor/next/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/cursor/next/commands/spec-start.md +3 -4
- package/presets/cursor/next/commands/task-continue.md +9 -8
- package/presets/cursor/next/commands/task-evil.md +8 -0
- package/presets/cursor/next/commands/task.md +1 -1
- package/presets/cursor/next/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/next/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/next/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +5 -5
- package/presets/cursor/next/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/next/team/README.md +1 -1
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/nuxt/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/nuxt/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/nuxt/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/php-hexagonal/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/php-hexagonal/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/php-laravel/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/php-laravel/rules/preset-writing-style.mdc +8 -0
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +541 -61
- package/presets/cursor/svelte/hooks/guard-shell-command.mjs +841 -97
- package/presets/cursor/svelte/rules/agent-team-intake.mdc +2 -0
- package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/svelte/rules/preset-writing-style.mdc +8 -0
- package/presets/mavis/android-kotlin/MAVIS.md +1 -1
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/android-kotlin/rules/agent-team-intake.md +2 -0
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/android-kotlin/rules/preset-writing-style.md +8 -0
- package/presets/mavis/go/MAVIS.md +1 -1
- package/presets/mavis/go/adapter-map.json +1 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/go/rules/agent-team-intake.md +2 -0
- package/presets/mavis/go/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/go/rules/preset-writing-style.md +8 -0
- package/presets/mavis/ios-swift/MAVIS.md +1 -1
- package/presets/mavis/ios-swift/adapter-map.json +1 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/ios-swift/rules/agent-team-intake.md +2 -0
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/ios-swift/rules/preset-writing-style.md +8 -0
- package/presets/mavis/java/MAVIS.md +1 -1
- package/presets/mavis/java/adapter-map.json +1 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/java/rules/agent-team-intake.md +2 -0
- package/presets/mavis/java/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/java/rules/preset-writing-style.md +8 -0
- package/presets/mavis/mcp-ts/MAVIS.md +1 -1
- package/presets/mavis/mcp-ts/adapter-map.json +1 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/mcp-ts/rules/agent-team-intake.md +2 -0
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/mcp-ts/rules/preset-writing-style.md +8 -0
- package/presets/mavis/mol/MAVIS.md +1 -1
- package/presets/mavis/mol/adapter-map.json +1 -1
- package/presets/mavis/mol/agents/feature-developer.md +1 -1
- package/presets/mavis/mol/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/mavis/mol/commands/task-evil.md +8 -0
- package/presets/mavis/mol/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/mol/native-skills/task-evil/SKILL.md +8 -0
- package/presets/mavis/mol/rules/agent-team-intake.md +2 -0
- package/presets/mavis/mol/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/mol/rules/preset-writing-style.md +8 -0
- package/presets/mavis/next/MAVIS.md +1 -1
- package/presets/mavis/next/REPO_AGENTS.md +2 -0
- package/presets/mavis/next/adapter-map.json +1 -1
- package/presets/mavis/next/agents/feature-developer.md +1 -1
- package/presets/mavis/next/agents/task-analyst.md +1 -7
- package/presets/mavis/next/agents/task-router.md +1 -1
- package/presets/mavis/next/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/mavis/next/commands/spec-start.md +3 -4
- package/presets/mavis/next/commands/task-continue.md +9 -8
- package/presets/mavis/next/commands/task-evil.md +8 -0
- package/presets/mavis/next/commands/task.md +1 -1
- package/presets/mavis/next/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/next/native-skills/spec-start/SKILL.md +3 -4
- package/presets/mavis/next/native-skills/task/SKILL.md +1 -1
- package/presets/mavis/next/native-skills/task-continue/SKILL.md +9 -8
- package/presets/mavis/next/native-skills/task-evil/SKILL.md +8 -0
- package/presets/mavis/next/rules/agent-team-intake.md +2 -0
- package/presets/mavis/next/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/next/rules/preset-writing-style.md +8 -0
- package/presets/mavis/next/team/README.md +1 -1
- package/presets/mavis/nuxt/MAVIS.md +1 -1
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/nuxt/rules/agent-team-intake.md +2 -0
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/nuxt/rules/preset-writing-style.md +8 -0
- package/presets/mavis/php-hexagonal/MAVIS.md +1 -1
- package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/php-hexagonal/rules/agent-team-intake.md +2 -0
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/php-hexagonal/rules/preset-writing-style.md +8 -0
- package/presets/mavis/php-laravel/MAVIS.md +1 -1
- package/presets/mavis/php-laravel/adapter-map.json +1 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/php-laravel/rules/agent-team-intake.md +2 -0
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/php-laravel/rules/preset-writing-style.md +8 -0
- package/presets/mavis/svelte/MAVIS.md +1 -1
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +541 -61
- package/presets/mavis/svelte/rules/agent-team-intake.md +2 -0
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/svelte/rules/preset-writing-style.md +8 -0
- package/presets/opencode/android-kotlin/OPENCODE.md +5 -66
- package/presets/opencode/android-kotlin/adapter-map.json +42 -42
- package/presets/opencode/android-kotlin/agents/accessibility-reviewer.md +1 -1
- package/presets/opencode/android-kotlin/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/opencode/android-kotlin/agents/ci-investigator.md +1 -1
- package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -1
- package/presets/opencode/android-kotlin/agents/codebase-analyzer.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/instrumentation-test-generator.md +1 -1
- package/presets/opencode/android-kotlin/agents/instrumentation-test-healer.md +1 -1
- package/presets/opencode/android-kotlin/agents/instrumentation-test-planner.md +1 -1
- package/presets/opencode/android-kotlin/agents/migration-specialist.md +1 -1
- package/presets/opencode/android-kotlin/agents/mockup-reviewer.md +1 -1
- package/presets/opencode/android-kotlin/agents/openspec-author.md +1 -1
- package/presets/opencode/android-kotlin/agents/performance-auditor.md +1 -1
- package/presets/opencode/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/opencode/android-kotlin/agents/security-reviewer.md +1 -1
- package/presets/opencode/android-kotlin/agents/solution-architect.md +1 -1
- package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/opencode/android-kotlin/agents/task-router.md +1 -1
- package/presets/opencode/android-kotlin/agents/tech-writer.md +1 -1
- package/presets/opencode/android-kotlin/agents/unit-test-generator.md +1 -1
- package/presets/opencode/android-kotlin/agents/unit-test-healer.md +1 -1
- package/presets/opencode/android-kotlin/agents/unit-test-planner.md +1 -1
- package/presets/opencode/android-kotlin/commands/task-continue.md +1 -1
- package/presets/opencode/android-kotlin/hooks/README.md +12 -1
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/android-kotlin/hooks/guard-shell-command.mjs +879 -0
- package/presets/opencode/android-kotlin/opencode.json +4 -4
- package/presets/opencode/android-kotlin/plugins/rule-attach/globs.json +167 -0
- package/presets/opencode/android-kotlin/rules/agent-team-intake.md +2 -0
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/android-kotlin/rules/preset-writing-style.md +8 -0
- package/presets/opencode/go/OPENCODE.md +5 -51
- package/presets/opencode/go/adapter-map.json +45 -45
- package/presets/opencode/go/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/go/agents/build-verifier.md +1 -1
- package/presets/opencode/go/agents/ci-investigator.md +1 -1
- package/presets/opencode/go/agents/code-reviewer.md +1 -1
- package/presets/opencode/go/agents/codebase-analyzer.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/integration-test-generator.md +1 -1
- package/presets/opencode/go/agents/integration-test-healer.md +1 -1
- package/presets/opencode/go/agents/integration-test-planner.md +1 -1
- package/presets/opencode/go/agents/migration-specialist.md +1 -1
- package/presets/opencode/go/agents/openspec-author.md +1 -1
- package/presets/opencode/go/agents/performance-auditor.md +1 -1
- package/presets/opencode/go/agents/qa-tester.md +1 -1
- package/presets/opencode/go/agents/security-reviewer.md +1 -1
- package/presets/opencode/go/agents/solution-architect.md +1 -1
- package/presets/opencode/go/agents/task-analyst.md +1 -1
- package/presets/opencode/go/agents/task-router.md +1 -1
- package/presets/opencode/go/agents/tech-writer.md +1 -1
- package/presets/opencode/go/agents/unit-test-generator.md +1 -1
- package/presets/opencode/go/agents/unit-test-healer.md +1 -1
- package/presets/opencode/go/agents/unit-test-planner.md +1 -1
- package/presets/opencode/go/commands/task-continue.md +1 -1
- package/presets/opencode/go/hooks/README.md +12 -1
- package/presets/opencode/go/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/go/hooks/guard-shell-command.mjs +878 -0
- package/presets/opencode/go/opencode.json +4 -4
- package/presets/opencode/go/plugins/rule-attach/globs.json +198 -0
- package/presets/opencode/go/rules/agent-team-intake.md +2 -0
- package/presets/opencode/go/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/go/rules/preset-writing-style.md +8 -0
- package/presets/opencode/ios-swift/OPENCODE.md +5 -66
- package/presets/opencode/ios-swift/adapter-map.json +41 -41
- package/presets/opencode/ios-swift/agents/accessibility-reviewer.md +1 -1
- package/presets/opencode/ios-swift/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/ios-swift/agents/build-verifier.md +1 -1
- package/presets/opencode/ios-swift/agents/ci-investigator.md +1 -1
- package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -1
- package/presets/opencode/ios-swift/agents/codebase-analyzer.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/migration-specialist.md +1 -1
- package/presets/opencode/ios-swift/agents/mockup-reviewer.md +1 -1
- package/presets/opencode/ios-swift/agents/openspec-author.md +1 -1
- package/presets/opencode/ios-swift/agents/performance-auditor.md +1 -1
- package/presets/opencode/ios-swift/agents/qa-tester.md +1 -1
- package/presets/opencode/ios-swift/agents/security-reviewer.md +1 -1
- package/presets/opencode/ios-swift/agents/solution-architect.md +1 -1
- package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
- package/presets/opencode/ios-swift/agents/task-router.md +1 -1
- package/presets/opencode/ios-swift/agents/tech-writer.md +1 -1
- package/presets/opencode/ios-swift/agents/unit-test-generator.md +1 -1
- package/presets/opencode/ios-swift/agents/unit-test-healer.md +1 -1
- package/presets/opencode/ios-swift/agents/unit-test-planner.md +1 -1
- package/presets/opencode/ios-swift/agents/xcuitest-test-generator.md +1 -1
- package/presets/opencode/ios-swift/agents/xcuitest-test-healer.md +1 -1
- package/presets/opencode/ios-swift/agents/xcuitest-test-planner.md +1 -1
- package/presets/opencode/ios-swift/commands/task-continue.md +1 -1
- package/presets/opencode/ios-swift/hooks/README.md +12 -1
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/ios-swift/hooks/guard-shell-command.mjs +878 -0
- package/presets/opencode/ios-swift/opencode.json +4 -4
- package/presets/opencode/ios-swift/plugins/rule-attach/globs.json +160 -0
- package/presets/opencode/ios-swift/rules/agent-team-intake.md +2 -0
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/ios-swift/rules/preset-writing-style.md +8 -0
- package/presets/opencode/java/OPENCODE.md +5 -58
- package/presets/opencode/java/adapter-map.json +45 -45
- package/presets/opencode/java/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/java/agents/build-verifier.md +1 -1
- package/presets/opencode/java/agents/ci-investigator.md +1 -1
- package/presets/opencode/java/agents/code-reviewer.md +1 -1
- package/presets/opencode/java/agents/codebase-analyzer.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/integration-test-generator.md +1 -1
- package/presets/opencode/java/agents/integration-test-healer.md +1 -1
- package/presets/opencode/java/agents/integration-test-planner.md +1 -1
- package/presets/opencode/java/agents/migration-specialist.md +1 -1
- package/presets/opencode/java/agents/openspec-author.md +1 -1
- package/presets/opencode/java/agents/performance-auditor.md +1 -1
- package/presets/opencode/java/agents/qa-tester.md +1 -1
- package/presets/opencode/java/agents/security-reviewer.md +1 -1
- package/presets/opencode/java/agents/solution-architect.md +1 -1
- package/presets/opencode/java/agents/task-analyst.md +1 -1
- package/presets/opencode/java/agents/task-router.md +1 -1
- package/presets/opencode/java/agents/tech-writer.md +1 -1
- package/presets/opencode/java/agents/unit-test-generator.md +1 -1
- package/presets/opencode/java/agents/unit-test-healer.md +1 -1
- package/presets/opencode/java/agents/unit-test-planner.md +1 -1
- package/presets/opencode/java/commands/task-continue.md +1 -1
- package/presets/opencode/java/hooks/README.md +12 -1
- package/presets/opencode/java/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/java/hooks/guard-shell-command.mjs +879 -0
- package/presets/opencode/java/opencode.json +4 -4
- package/presets/opencode/java/plugins/rule-attach/globs.json +230 -0
- package/presets/opencode/java/rules/agent-team-intake.md +2 -0
- package/presets/opencode/java/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/java/rules/preset-writing-style.md +8 -0
- package/presets/opencode/mcp-ts/OPENCODE.md +5 -48
- package/presets/opencode/mcp-ts/adapter-map.json +36 -36
- 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/security-reviewer.md +1 -1
- package/presets/opencode/mcp-ts/agents/solution-architect.md +1 -1
- package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/opencode/mcp-ts/agents/task-router.md +1 -1
- package/presets/opencode/mcp-ts/commands/task-continue.md +1 -1
- package/presets/opencode/mcp-ts/hooks/README.md +12 -1
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/mcp-ts/hooks/guard-shell-command.mjs +878 -0
- package/presets/opencode/mcp-ts/opencode.json +4 -4
- package/presets/opencode/mcp-ts/plugins/rule-attach/globs.json +151 -0
- package/presets/opencode/mcp-ts/rules/agent-team-intake.md +2 -0
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/mcp-ts/rules/preset-writing-style.md +8 -0
- package/presets/opencode/mol/OPENCODE.md +5 -56
- package/presets/opencode/mol/adapter-map.json +31 -31
- package/presets/opencode/mol/agents/accessibility-reviewer.md +1 -1
- package/presets/opencode/mol/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/mol/agents/build-verifier.md +1 -1
- package/presets/opencode/mol/agents/ci-investigator.md +1 -1
- package/presets/opencode/mol/agents/code-reviewer.md +1 -1
- package/presets/opencode/mol/agents/codebase-analyzer.md +1 -1
- package/presets/opencode/mol/agents/debugger.md +1 -1
- package/presets/opencode/mol/agents/feature-developer.md +2 -2
- package/presets/opencode/mol/agents/migration-specialist.md +1 -1
- package/presets/opencode/mol/agents/mockup-reviewer.md +1 -1
- package/presets/opencode/mol/agents/openspec-author.md +1 -1
- package/presets/opencode/mol/agents/performance-auditor.md +1 -1
- package/presets/opencode/mol/agents/playwright-test-generator.md +1 -1
- package/presets/opencode/mol/agents/playwright-test-healer.md +1 -1
- package/presets/opencode/mol/agents/playwright-test-planner.md +1 -1
- package/presets/opencode/mol/agents/qa-tester.md +1 -1
- package/presets/opencode/mol/agents/security-reviewer.md +1 -1
- package/presets/opencode/mol/agents/solution-architect.md +1 -1
- package/presets/opencode/mol/agents/task-analyst.md +1 -1
- package/presets/opencode/mol/agents/task-router.md +1 -1
- package/presets/opencode/mol/agents/tech-writer.md +1 -1
- package/presets/opencode/mol/agents/unit-test-generator.md +1 -1
- package/presets/opencode/mol/agents/unit-test-healer.md +1 -1
- package/presets/opencode/mol/agents/unit-test-planner.md +1 -1
- package/presets/opencode/mol/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/opencode/mol/commands/task-continue.md +1 -1
- package/presets/opencode/mol/commands/task-evil.md +8 -0
- package/presets/opencode/mol/hooks/README.md +12 -1
- package/presets/opencode/mol/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/mol/hooks/guard-shell-command.mjs +877 -0
- package/presets/opencode/mol/opencode.json +4 -4
- package/presets/opencode/mol/plugins/rule-attach/globs.json +112 -0
- package/presets/opencode/mol/rules/agent-team-intake.md +2 -0
- package/presets/opencode/mol/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/mol/rules/preset-writing-style.md +8 -0
- package/presets/opencode/next/OPENCODE.md +5 -55
- package/presets/opencode/next/REPO_AGENTS.md +2 -0
- package/presets/opencode/next/adapter-map.json +56 -56
- package/presets/opencode/next/agents/accessibility-reviewer.md +1 -1
- package/presets/opencode/next/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/next/agents/build-verifier.md +1 -1
- package/presets/opencode/next/agents/ci-investigator.md +1 -1
- package/presets/opencode/next/agents/code-reviewer.md +1 -1
- package/presets/opencode/next/agents/codebase-analyzer.md +1 -1
- package/presets/opencode/next/agents/debugger.md +1 -1
- package/presets/opencode/next/agents/feature-developer.md +2 -2
- package/presets/opencode/next/agents/migration-specialist.md +1 -1
- package/presets/opencode/next/agents/mockup-reviewer.md +1 -1
- package/presets/opencode/next/agents/openspec-author.md +1 -1
- package/presets/opencode/next/agents/performance-auditor.md +1 -1
- package/presets/opencode/next/agents/playwright-test-generator.md +1 -1
- package/presets/opencode/next/agents/playwright-test-healer.md +1 -1
- package/presets/opencode/next/agents/playwright-test-planner.md +1 -1
- package/presets/opencode/next/agents/qa-tester.md +1 -1
- package/presets/opencode/next/agents/security-reviewer.md +1 -1
- package/presets/opencode/next/agents/solution-architect.md +1 -1
- package/presets/opencode/next/agents/task-analyst.md +2 -8
- package/presets/opencode/next/agents/task-router.md +2 -2
- package/presets/opencode/next/agents/tech-writer.md +1 -1
- package/presets/opencode/next/agents/unit-test-generator.md +1 -1
- package/presets/opencode/next/agents/unit-test-healer.md +1 -1
- package/presets/opencode/next/agents/unit-test-planner.md +1 -1
- package/presets/opencode/next/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/opencode/next/commands/spec-start.md +3 -4
- package/presets/opencode/next/commands/task-continue.md +10 -9
- package/presets/opencode/next/commands/task-evil.md +8 -0
- package/presets/opencode/next/commands/task.md +1 -1
- package/presets/opencode/next/hooks/README.md +12 -1
- package/presets/opencode/next/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/next/hooks/guard-shell-command.mjs +877 -0
- package/presets/opencode/next/opencode.json +4 -4
- package/presets/opencode/next/plugins/rule-attach/globs.json +276 -0
- package/presets/opencode/next/rules/agent-team-intake.md +2 -0
- package/presets/opencode/next/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/next/rules/preset-writing-style.md +8 -0
- package/presets/opencode/next/team/README.md +1 -1
- package/presets/opencode/nuxt/OPENCODE.md +5 -54
- package/presets/opencode/nuxt/adapter-map.json +51 -51
- package/presets/opencode/nuxt/agents/accessibility-reviewer.md +1 -1
- package/presets/opencode/nuxt/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/nuxt/agents/build-verifier.md +1 -1
- package/presets/opencode/nuxt/agents/ci-investigator.md +1 -1
- package/presets/opencode/nuxt/agents/code-reviewer.md +1 -1
- package/presets/opencode/nuxt/agents/codebase-analyzer.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/migration-specialist.md +1 -1
- package/presets/opencode/nuxt/agents/mockup-reviewer.md +1 -1
- package/presets/opencode/nuxt/agents/openspec-author.md +1 -1
- package/presets/opencode/nuxt/agents/performance-auditor.md +1 -1
- package/presets/opencode/nuxt/agents/playwright-test-generator.md +1 -1
- package/presets/opencode/nuxt/agents/playwright-test-healer.md +1 -1
- package/presets/opencode/nuxt/agents/playwright-test-planner.md +1 -1
- package/presets/opencode/nuxt/agents/qa-tester.md +1 -1
- package/presets/opencode/nuxt/agents/security-reviewer.md +1 -1
- package/presets/opencode/nuxt/agents/solution-architect.md +1 -1
- package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
- package/presets/opencode/nuxt/agents/task-router.md +1 -1
- package/presets/opencode/nuxt/agents/tech-writer.md +1 -1
- package/presets/opencode/nuxt/agents/unit-test-generator.md +1 -1
- package/presets/opencode/nuxt/agents/unit-test-healer.md +1 -1
- package/presets/opencode/nuxt/agents/unit-test-planner.md +1 -1
- package/presets/opencode/nuxt/commands/task-continue.md +1 -1
- package/presets/opencode/nuxt/hooks/README.md +12 -1
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/nuxt/hooks/guard-shell-command.mjs +877 -0
- package/presets/opencode/nuxt/opencode.json +4 -4
- package/presets/opencode/nuxt/plugins/rule-attach/globs.json +266 -0
- package/presets/opencode/nuxt/rules/agent-team-intake.md +2 -0
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/nuxt/rules/preset-writing-style.md +8 -0
- package/presets/opencode/php-hexagonal/OPENCODE.md +5 -60
- package/presets/opencode/php-hexagonal/adapter-map.json +45 -45
- package/presets/opencode/php-hexagonal/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/opencode/php-hexagonal/agents/ci-investigator.md +1 -1
- package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/codebase-analyzer.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/integration-test-generator.md +1 -1
- package/presets/opencode/php-hexagonal/agents/integration-test-healer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/integration-test-planner.md +1 -1
- package/presets/opencode/php-hexagonal/agents/migration-specialist.md +1 -1
- package/presets/opencode/php-hexagonal/agents/openspec-author.md +1 -1
- package/presets/opencode/php-hexagonal/agents/performance-auditor.md +1 -1
- package/presets/opencode/php-hexagonal/agents/qa-tester.md +1 -1
- package/presets/opencode/php-hexagonal/agents/security-reviewer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/solution-architect.md +1 -1
- package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/opencode/php-hexagonal/agents/task-router.md +1 -1
- package/presets/opencode/php-hexagonal/agents/tech-writer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/unit-test-generator.md +1 -1
- package/presets/opencode/php-hexagonal/agents/unit-test-healer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/unit-test-planner.md +1 -1
- package/presets/opencode/php-hexagonal/commands/task-continue.md +1 -1
- package/presets/opencode/php-hexagonal/hooks/README.md +12 -1
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/php-hexagonal/hooks/guard-shell-command.mjs +879 -0
- package/presets/opencode/php-hexagonal/opencode.json +4 -4
- package/presets/opencode/php-hexagonal/plugins/rule-attach/globs.json +242 -0
- package/presets/opencode/php-hexagonal/rules/agent-team-intake.md +2 -0
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/php-hexagonal/rules/preset-writing-style.md +8 -0
- package/presets/opencode/php-laravel/OPENCODE.md +5 -60
- package/presets/opencode/php-laravel/adapter-map.json +45 -45
- package/presets/opencode/php-laravel/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
- package/presets/opencode/php-laravel/agents/ci-investigator.md +1 -1
- package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
- package/presets/opencode/php-laravel/agents/codebase-analyzer.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/integration-test-generator.md +1 -1
- package/presets/opencode/php-laravel/agents/integration-test-healer.md +1 -1
- package/presets/opencode/php-laravel/agents/integration-test-planner.md +1 -1
- package/presets/opencode/php-laravel/agents/migration-specialist.md +1 -1
- package/presets/opencode/php-laravel/agents/openspec-author.md +1 -1
- package/presets/opencode/php-laravel/agents/performance-auditor.md +1 -1
- package/presets/opencode/php-laravel/agents/qa-tester.md +1 -1
- package/presets/opencode/php-laravel/agents/security-reviewer.md +1 -1
- package/presets/opencode/php-laravel/agents/solution-architect.md +1 -1
- package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
- package/presets/opencode/php-laravel/agents/task-router.md +1 -1
- package/presets/opencode/php-laravel/agents/tech-writer.md +1 -1
- package/presets/opencode/php-laravel/agents/unit-test-generator.md +1 -1
- package/presets/opencode/php-laravel/agents/unit-test-healer.md +1 -1
- package/presets/opencode/php-laravel/agents/unit-test-planner.md +1 -1
- package/presets/opencode/php-laravel/commands/task-continue.md +1 -1
- package/presets/opencode/php-laravel/hooks/README.md +12 -1
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/php-laravel/hooks/guard-shell-command.mjs +879 -0
- package/presets/opencode/php-laravel/opencode.json +4 -4
- package/presets/opencode/php-laravel/plugins/rule-attach/globs.json +232 -0
- package/presets/opencode/php-laravel/rules/agent-team-intake.md +2 -0
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/php-laravel/rules/preset-writing-style.md +8 -0
- package/presets/opencode/platform-contract.json +4 -0
- package/presets/opencode/plugins/output-guard/README.md +1 -1
- package/presets/opencode/plugins/output-guard/index.ts +8 -2
- package/presets/opencode/plugins/output-guard/rewrite.ts +37 -0
- package/presets/opencode/plugins/rule-attach/README.md +34 -0
- package/presets/opencode/plugins/rule-attach/attach.ts +224 -0
- package/presets/opencode/plugins/rule-attach/index.ts +169 -0
- package/presets/opencode/plugins/rule-attach/package.json +9 -0
- package/presets/opencode/plugins/settings-guard/README.md +25 -0
- package/presets/opencode/plugins/settings-guard/index.ts +114 -0
- package/presets/opencode/plugins/settings-guard/package.json +9 -0
- package/presets/opencode/plugins/settings-guard/policy.mjs +85 -0
- package/presets/opencode/plugins/settings-guard/prompt-face.mjs +153 -0
- package/presets/opencode/plugins/task-status/README.md +9 -4
- package/presets/opencode/plugins/task-status/eta.ts +20 -7
- package/presets/opencode/plugins/task-status/index.ts +14 -1
- package/presets/opencode/plugins/task-status/task-view.ts +160 -5
- package/presets/opencode/plugins/task-status/timing.ts +244 -0
- package/presets/opencode/plugins/task-status/types.ts +6 -0
- package/presets/opencode/svelte/OPENCODE.md +5 -54
- package/presets/opencode/svelte/adapter-map.json +51 -51
- package/presets/opencode/svelte/agents/accessibility-reviewer.md +1 -1
- package/presets/opencode/svelte/agents/api-contract-reviewer.md +1 -1
- package/presets/opencode/svelte/agents/build-verifier.md +1 -1
- package/presets/opencode/svelte/agents/ci-investigator.md +1 -1
- package/presets/opencode/svelte/agents/code-reviewer.md +1 -1
- package/presets/opencode/svelte/agents/codebase-analyzer.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/migration-specialist.md +1 -1
- package/presets/opencode/svelte/agents/mockup-reviewer.md +1 -1
- package/presets/opencode/svelte/agents/openspec-author.md +1 -1
- package/presets/opencode/svelte/agents/performance-auditor.md +1 -1
- package/presets/opencode/svelte/agents/playwright-test-generator.md +1 -1
- package/presets/opencode/svelte/agents/playwright-test-healer.md +1 -1
- package/presets/opencode/svelte/agents/playwright-test-planner.md +1 -1
- package/presets/opencode/svelte/agents/qa-tester.md +1 -1
- package/presets/opencode/svelte/agents/security-reviewer.md +1 -1
- package/presets/opencode/svelte/agents/solution-architect.md +1 -1
- package/presets/opencode/svelte/agents/task-analyst.md +1 -1
- package/presets/opencode/svelte/agents/task-router.md +1 -1
- package/presets/opencode/svelte/agents/tech-writer.md +1 -1
- package/presets/opencode/svelte/agents/unit-test-generator.md +1 -1
- package/presets/opencode/svelte/agents/unit-test-healer.md +1 -1
- package/presets/opencode/svelte/agents/unit-test-planner.md +1 -1
- package/presets/opencode/svelte/commands/task-continue.md +1 -1
- package/presets/opencode/svelte/hooks/README.md +12 -1
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +541 -61
- package/presets/opencode/svelte/hooks/guard-shell-command.mjs +877 -0
- package/presets/opencode/svelte/opencode.json +4 -4
- package/presets/opencode/svelte/plugins/rule-attach/globs.json +245 -0
- package/presets/opencode/svelte/rules/agent-team-intake.md +2 -0
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +7 -7
- package/presets/opencode/svelte/rules/preset-writing-style.md +8 -0
- package/presets/zcode/android-kotlin/adapter-map.json +1 -1
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/android-kotlin/rules/agent-team-intake.md +2 -0
- package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/android-kotlin/rules/preset-writing-style.md +8 -0
- package/presets/zcode/go/adapter-map.json +1 -1
- package/presets/zcode/go/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/go/rules/agent-team-intake.md +2 -0
- package/presets/zcode/go/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/go/rules/preset-writing-style.md +8 -0
- package/presets/zcode/ios-swift/adapter-map.json +1 -1
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/ios-swift/rules/agent-team-intake.md +2 -0
- package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/ios-swift/rules/preset-writing-style.md +8 -0
- package/presets/zcode/java/adapter-map.json +1 -1
- package/presets/zcode/java/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/java/rules/agent-team-intake.md +2 -0
- package/presets/zcode/java/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/java/rules/preset-writing-style.md +8 -0
- package/presets/zcode/mcp-ts/adapter-map.json +1 -1
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/mcp-ts/rules/agent-team-intake.md +2 -0
- package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/mcp-ts/rules/preset-writing-style.md +8 -0
- package/presets/zcode/mol/adapter-map.json +1 -1
- package/presets/zcode/mol/agents/feature-developer.md +1 -1
- package/presets/zcode/mol/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/zcode/mol/commands/task-evil.md +8 -0
- package/presets/zcode/mol/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/mol/rules/agent-team-intake.md +2 -0
- package/presets/zcode/mol/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/mol/rules/preset-writing-style.md +8 -0
- package/presets/zcode/next/REPO_AGENTS.md +2 -0
- package/presets/zcode/next/adapter-map.json +1 -1
- package/presets/zcode/next/agents/feature-developer.md +1 -1
- package/presets/zcode/next/agents/task-analyst.md +1 -7
- package/presets/zcode/next/agents/task-router.md +1 -1
- package/presets/zcode/next/ai-local/rules-library/commit-hygiene.md +1 -1
- package/presets/zcode/next/commands/spec-start.md +3 -4
- package/presets/zcode/next/commands/task-continue.md +9 -8
- package/presets/zcode/next/commands/task-evil.md +8 -0
- package/presets/zcode/next/commands/task.md +1 -1
- package/presets/zcode/next/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/next/rules/agent-team-intake.md +2 -0
- package/presets/zcode/next/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/next/rules/preset-writing-style.md +8 -0
- package/presets/zcode/next/team/README.md +1 -1
- package/presets/zcode/nuxt/adapter-map.json +1 -1
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/nuxt/rules/agent-team-intake.md +2 -0
- package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/nuxt/rules/preset-writing-style.md +8 -0
- package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/php-hexagonal/rules/agent-team-intake.md +2 -0
- package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/php-hexagonal/rules/preset-writing-style.md +8 -0
- package/presets/zcode/php-laravel/adapter-map.json +1 -1
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/php-laravel/rules/agent-team-intake.md +2 -0
- package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/php-laravel/rules/preset-writing-style.md +8 -0
- package/presets/zcode/svelte/adapter-map.json +1 -1
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +541 -61
- package/presets/zcode/svelte/rules/agent-team-intake.md +2 -0
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/svelte/rules/preset-writing-style.md +8 -0
- package/scripts/report-context-cost.mjs +1 -20
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Claude `UserPromptSubmit` autoroute prompt face.
|
|
3
|
+
// Rendered from `presets/_shared/hooks/prompt-autoroute.mjs.tmpl`; edit the
|
|
4
|
+
// template, never a rendered copy.
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
|
+
|
|
9
|
+
const SETTING_KEY = 'AI_RULES_AUTOROUTE_UNCHAINED_PROMPTS';
|
|
10
|
+
const CAP_KEY = 'AI_RULES_MAX_PARALLEL_TASKS';
|
|
11
|
+
const DEFAULT_MAX_PARALLEL_TASKS = 4;
|
|
12
|
+
const MARKER = '[ai-rules:autoroute]';
|
|
13
|
+
// The chain hook's own terminal `status.json` states (`TERMINAL_RECEIPT_OUTCOMES`
|
|
14
|
+
// and the `terminal` set in `chain-team-phases.sh.tmpl`). A slug in one of these
|
|
15
|
+
// states is closed and must not suppress the wrap; every other state is live.
|
|
16
|
+
const TERMINAL_STATES = new Set(['completed', 'blocked', 'changes_requested', 'validation_failed']);
|
|
17
|
+
const TASK_COMMAND = /^\/(?:task|task-continue)(?:\s|$)/;
|
|
18
|
+
const SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
19
|
+
|
|
20
|
+
const directive = () =>
|
|
21
|
+
`${MARKER} This request arrived outside the task chain. Run the current request as /task before answering.`;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Default settings resolver: the same dynamic import of the seeded parser the
|
|
25
|
+
* shell guard uses. A missing or unimportable module yields `null`, so the hook
|
|
26
|
+
* stays inert instead of carrying a copy of the parser. The resolver returns
|
|
27
|
+
* the raw `{value, source}` setting so the boolean switch keeps its `=== true`
|
|
28
|
+
* coercion here while the numeric cap reads the value as-is (an old parser
|
|
29
|
+
* without the cap key yields the unknown-key `false`, and the cap stays at the
|
|
30
|
+
* default).
|
|
31
|
+
*
|
|
32
|
+
* @returns {Promise<((key: string) => { value: boolean | number, source: string }) | null>} `get(key)`, or `null`
|
|
33
|
+
*/
|
|
34
|
+
const importSettings = async ({ root, exists, readText }) => {
|
|
35
|
+
const file = path.join(root, '.ai.local', 'scripts', 'settings.mjs');
|
|
36
|
+
if (!exists(file)) return null;
|
|
37
|
+
try {
|
|
38
|
+
const module = await import(pathToFileURL(file).href);
|
|
39
|
+
if (typeof module.readSetting !== 'function') return null;
|
|
40
|
+
return (key) => module.readSetting(key, { root, exists, readText });
|
|
41
|
+
} catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Every live slug — the canonical scan over the task store (`tasks/*`), never
|
|
48
|
+
* the `active-task.json` pointer. A slug is live when `tasks/<name>/status.json`
|
|
49
|
+
* parses to a non-terminal `state`; a missing tasks directory, a non-slug name,
|
|
50
|
+
* or an unreadable status is not a live task.
|
|
51
|
+
*
|
|
52
|
+
* @returns {string[]} sorted live slugs
|
|
53
|
+
*/
|
|
54
|
+
const liveSlugs = ({ root, exists, readText, readDirNames }) => {
|
|
55
|
+
const tasksDir = path.join(root, '.ai.local', 'team', 'tasks');
|
|
56
|
+
let names;
|
|
57
|
+
try {
|
|
58
|
+
names = readDirNames(tasksDir);
|
|
59
|
+
} catch {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
const live = [];
|
|
63
|
+
for (const name of names) {
|
|
64
|
+
if (!SLUG_RE.test(name)) continue;
|
|
65
|
+
const statusFile = path.join(tasksDir, name, 'status.json');
|
|
66
|
+
if (!exists(statusFile)) continue;
|
|
67
|
+
try {
|
|
68
|
+
const status = JSON.parse(readText(statusFile));
|
|
69
|
+
const state = status && typeof status.state === 'string' ? status.state : null;
|
|
70
|
+
if (state !== null && !TERMINAL_STATES.has(state)) live.push(name);
|
|
71
|
+
} catch {
|
|
72
|
+
/* an unreadable status is not a live slug */
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return live.sort();
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The Claude envelope for one prompt event, or `null` when the hook stays
|
|
80
|
+
* silent. Never throws: every failure resolves to silence.
|
|
81
|
+
*
|
|
82
|
+
* @param {unknown} event
|
|
83
|
+
* @param {{ root?: string, exists?: (file: string) => boolean, readText?: (file: string) => string, settings?: Function }} [options]
|
|
84
|
+
* @returns {Promise<{ hookSpecificOutput: { hookEventName: string, additionalContext: string } } | null>}
|
|
85
|
+
*/
|
|
86
|
+
export const evaluate = async (event, options = {}) => {
|
|
87
|
+
const {
|
|
88
|
+
root = process.cwd(),
|
|
89
|
+
exists = (file) => fs.existsSync(file),
|
|
90
|
+
readText = (file) => fs.readFileSync(file, 'utf8'),
|
|
91
|
+
readDirNames = (dir) =>
|
|
92
|
+
fs
|
|
93
|
+
.readdirSync(dir, { withFileTypes: true })
|
|
94
|
+
.filter((entry) => entry.isDirectory())
|
|
95
|
+
.map((entry) => entry.name),
|
|
96
|
+
settings = importSettings,
|
|
97
|
+
} = options;
|
|
98
|
+
if (!event || typeof event !== 'object') return null;
|
|
99
|
+
const prompt = typeof event.prompt === 'string' ? event.prompt : '';
|
|
100
|
+
if (TASK_COMMAND.test(prompt.trimStart())) return null;
|
|
101
|
+
|
|
102
|
+
let enabled = false;
|
|
103
|
+
let cap = DEFAULT_MAX_PARALLEL_TASKS;
|
|
104
|
+
try {
|
|
105
|
+
const getSetting = await settings({ root, exists, readText });
|
|
106
|
+
if (typeof getSetting === 'function') {
|
|
107
|
+
const setting = getSetting(SETTING_KEY);
|
|
108
|
+
enabled = Boolean(setting) && setting.value === true;
|
|
109
|
+
const capSetting = getSetting(CAP_KEY);
|
|
110
|
+
if (Boolean(capSetting) && Number.isFinite(capSetting.value)) cap = capSetting.value;
|
|
111
|
+
}
|
|
112
|
+
} catch {
|
|
113
|
+
enabled = false;
|
|
114
|
+
}
|
|
115
|
+
if (!enabled) return null;
|
|
116
|
+
// Wrap while the live-slug count is below the cap; an explicit `0` cap is
|
|
117
|
+
// unlimited — only a configured bound suppresses the wrap.
|
|
118
|
+
if (cap !== 0 && liveSlugs({ root, exists, readText, readDirNames }).length >= cap) return null;
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
hookSpecificOutput: {
|
|
122
|
+
hookEventName: 'UserPromptSubmit',
|
|
123
|
+
additionalContext: directive(),
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const main = async () => {
|
|
129
|
+
let envelope = null;
|
|
130
|
+
try {
|
|
131
|
+
const parsed = JSON.parse(fs.readFileSync(0, 'utf8'));
|
|
132
|
+
envelope = await evaluate(parsed && typeof parsed === 'object' ? parsed : null, {
|
|
133
|
+
root: typeof parsed?.cwd === 'string' && parsed.cwd ? parsed.cwd : process.cwd(),
|
|
134
|
+
});
|
|
135
|
+
} catch {
|
|
136
|
+
envelope = null;
|
|
137
|
+
}
|
|
138
|
+
if (envelope) process.stdout.write(JSON.stringify(envelope));
|
|
139
|
+
process.exit(0);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const invokedDirectly = (() => {
|
|
143
|
+
if (process.argv[1] === undefined) return false;
|
|
144
|
+
try {
|
|
145
|
+
return fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url));
|
|
146
|
+
} catch {
|
|
147
|
+
return path.resolve(process.argv[1]) === path.resolve(fileURLToPath(import.meta.url));
|
|
148
|
+
}
|
|
149
|
+
})();
|
|
150
|
+
|
|
151
|
+
if (invokedDirectly) {
|
|
152
|
+
await main();
|
|
153
|
+
}
|
|
@@ -17,4 +17,6 @@ When the user message looks like a **work request** (implement, add, fix, refact
|
|
|
17
17
|
6. **Reuse the dialogue language already resolved on this turn** (always-on `ai-local-overlay` / **language-policy**). A question and a message without a slash command still resolve before you speak. When this request writes `prompt.md`, persist that tag once in the header (`language: <BCP-47>`) + a `.memlog.md` `event:` line. Development, reasoning, and artifacts stay English. The setting wins over a mid-task prompt switch (surface it once, never ask). See **language-policy**.
|
|
18
18
|
7. **Project the intake write.** After `prompt.md` is written for an inline (non-`/task`) work request, run `node .ai.local/scripts/team-db.mjs sync --slug <slug> --deadline-ms 4500` once, so the new task row and its prompt reach the database. A projection failure is reported to the user, never blocks the request; the next full sync remains the convergence path. Do not run a full sync from intake.
|
|
19
19
|
|
|
20
|
+
On Cursor, Mavis, OpenCode and ZCode — the hosts without a verified prompt hook — run a request that is not already `/task` or `/task-continue` as `/task` when `node .ai.local/scripts/settings.mjs get AI_RULES_AUTOROUTE_UNCHAINED_PROMPTS` prints `true` and the live-slug count (every `.ai.local/team/tasks/*/status.json` whose `state` is not one of `completed`, `blocked`, `changes_requested`, `validation_failed`) is below the `node .ai.local/scripts/settings.mjs get AI_RULES_MAX_PARALLEL_TASKS` cap (`4` by default; `0` = unlimited). A prompt that names an existing slug or is a resume intent (`continue` / `resume` / `продолжай` family, `.ai.local/rules/task-resume.md`) routes to `/task-continue <slug>` regardless of the cap. <!-- i18n-keep: E4 -->
|
|
21
|
+
|
|
20
22
|
Exceptions: user explicitly says “no pipeline”, “just do it”, or continues an active slug.
|
|
@@ -248,7 +248,7 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
|
|
|
248
248
|
3. One role per Task call — **except** parallel steps: multiple Task calls in one message.
|
|
249
249
|
4. **Never** skip `humanGates` without `/task-continue` or explicit user approval.
|
|
250
250
|
5. Persist handoffs to disk (`brief.md`, `decomposition.md`, `debug-report.md`, `validation-report.md`, `architecture.md`, `migration-plan.md`, `ci-report.md`, `a11y-review.md`, `perf-report.md`, `security-review.md`, `api-contract-review.md`, `unit-test-plan.md`, `documentation.md`, `review.md`, `mockup-review.md`, `ux-design.md`) and update the producer-owned terminal receipt in `artifact-manifest.json`.
|
|
251
|
-
6. On `changes_requested` from reviewers: hook sets `retryAfterFix` → developer → `build-verifier` (delta) → same reviewer when the fix touches code/tests; a docs/artifacts-only fix returns to the same reviewer without a code gate. Exception: embedded `mockup-reviewer` FAIL (`changes_requested` while the completed/current agent is `mockup-reviewer`) → `awaiting_approval` / `/task-continue` only — do **not** `retryAfterFix` to developer. A `mockup-reviewer` verdict `mockup-change-requested` (a defect whose fix belongs in the design source, not the implementation) routes the same way — `awaiting_approval`, no developer retry.
|
|
251
|
+
6. On `changes_requested` from reviewers: the first time that agent returns it, the hook sets `retryAfterFix` → developer → `build-verifier` (delta) → same reviewer when the fix touches code/tests; a docs/artifacts-only fix returns to the same reviewer without a code gate. The second `changes_requested` from the same agent is a human gate (`awaitingHumanGate`, `designEscalation`): do not dispatch the developer. Append `decision: replan rev N → N+1` to `.memlog.md` (the decision changes the model), then `/task-continue`, which the hook accepts only when that line is new. Exception: embedded `mockup-reviewer` FAIL (`changes_requested` while the completed/current agent is `mockup-reviewer`) → `awaiting_approval` / `/task-continue` only — do **not** `retryAfterFix` to developer. A `mockup-reviewer` verdict `mockup-change-requested` (a defect whose fix belongs in the design source, not the implementation) routes the same way — `awaiting_approval`, no developer retry.
|
|
252
252
|
7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier (delta).
|
|
253
253
|
8. When all steps complete, suggest `/technical-retro <slug>`.
|
|
254
254
|
9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
|
|
@@ -274,12 +274,12 @@ Use Task tool or `/agent-name`. Pass: slug, artifact paths, step `scope` if set.
|
|
|
274
274
|
### Model when invoking (Task)
|
|
275
275
|
|
|
276
276
|
1. Read `steps[i].model` if present; else use the agent’s frontmatter `model` (see `agents/README.md` matrix).
|
|
277
|
-
2. Resolve the tier through `.ai.local/team/model-tiers.json` → `tiers.<tier>` when that file
|
|
277
|
+
2. Resolve the tier through `.ai.local/team/model-tiers.json` → `tiers.<tier>` when that file is an approved map. An empty `tiers` object with an empty `approvedBy` is the unfilled template: omit the model and the session model applies. Once `approvedBy` is set or any tier value is set, the file is the map, so passing an explicit model is allowed. Pass the resolved `providerID/modelID` (or `providerID/modelID#variant`) to the Task/subagent tool.
|
|
278
278
|
- **`cheap`** → router, analyst, tech-writer, codebase-analyzer, and the review roles `code-reviewer`, `build-verifier`, `api-contract-reviewer`, `mockup-reviewer`. Resolve the provider through `.ai.local/team/model-tiers.json`. Do not write a provider id into the agent file. Pass the mapped id as written; do not append `#high`.
|
|
279
279
|
- **`standard`** → implementation and the other non-review specialists. `feature-developer` stays on this tier.
|
|
280
280
|
- **`strong`** → architecture, security, migration, performance. Never downgrade a `strong` step to the parent default, and do not put `mockup-reviewer` on `strong`.
|
|
281
|
-
- When `steps[i].model` is omitted and the agent file has no `model`, those four review roles stay `cheap` when
|
|
282
|
-
- If a tier is declared
|
|
281
|
+
- When `steps[i].model` is omitted and the agent file has no `model`, those four review roles stay `cheap` when the map has a `cheap` value. Without the file, or while the template is still empty, omit the model and the session model applies.
|
|
282
|
+
- If a tier is declared, the map is approved, and that tier has no mapping, **STOP** and report `model-tier-unmapped`; do not silently inherit the parent model.
|
|
283
283
|
3. If the tool does not accept a model (Cursor/Claude adapters), record the resolved tier in the handoff and let the platform pin apply.
|
|
284
284
|
4. Parallel steps: apply the step-level `model` to **each** agent in the array (or omit → each agent’s own frontmatter).
|
|
285
285
|
5. The tier never changes the step order, gates, receipts, or retry policy.
|
|
@@ -292,7 +292,7 @@ node .ai.local/scripts/record-usage.mjs --task <slug> --attempt <attemptId> --in
|
|
|
292
292
|
|
|
293
293
|
The chain hook also forwards a `usage` object from its input into the `attempt_finished` event. Never estimate or invent token counts; a missing usage record stays missing.
|
|
294
294
|
|
|
295
|
-
After each agent completes, verify its terminal manifest receipt, then let the orchestration runtime/hook reconcile `status.json` (`completed`, a blocking outcome, or `awaiting_approval`) from that receipt.
|
|
295
|
+
After each agent completes, verify its terminal manifest receipt, then let the orchestration runtime/hook reconcile `status.json` (`completed`, a blocking outcome, or `awaiting_approval`) from that receipt. **MUST: pass `TEAM_TASK_SLUG=<slug>` on every hook call** — `TEAM_TASK_SLUG=<slug> bash .opencode/hooks/chain-team-phases.sh` (or the host's hook path). With more than one live slug, an omitted env is a hook refusal (`active-task-pointer-ambiguous`, `ok:false`), never a silent reroute: re-run with the env set. The OpenCode task-status plugin pins each tab in `.ai.local/team/.session-leases/<session>.json` and injects `AI_RULES_SESSION_ID` on `shell.env`, so a later hook call in that tab resolves through the lease when `TEAM_TASK_SLUG` is omitted. `active-task.json` is the live-slug list, not a tab binding. Do not ask the agent to mutate shared lifecycle fields, and do not invoke the next specialist until the hook has written the handoff / updated `status.json`.
|
|
296
296
|
|
|
297
297
|
## Legacy mode
|
|
298
298
|
|
|
@@ -33,6 +33,14 @@ Write for two readers at once: an **agent** loading one file out of context, and
|
|
|
33
33
|
- No scenario storytelling, rhetorical questions, or meta-narration ("this section explains…").
|
|
34
34
|
- No duplicated rule text across stems — link instead.
|
|
35
35
|
|
|
36
|
+
## Shell guards
|
|
37
|
+
|
|
38
|
+
A write or execute guard allowlists the benign shapes and answers `ask` on anything it cannot classify. `allow` on an unknown shape is a defect.
|
|
39
|
+
|
|
40
|
+
- Name the bypass class — abbreviations, aliases, quoting, shell wrappers, config-injection options (`-c`, `--exec`, `--receive-pack`), value-consumption mismatch — not a list of spellings.
|
|
41
|
+
- Probe each shape with the flag on, the flag off, a sentinel, and an unreadable config. Quote the tool output. A green gate set is not that evidence.
|
|
42
|
+
- Compare every probed shape with the previous answer. A shape that asked before and allows now is a blocker.
|
|
43
|
+
|
|
36
44
|
## Size
|
|
37
45
|
|
|
38
46
|
- Shortest form that still changes behavior: if a bullet fits as a clause, make it a clause.
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
3
3
|
"permissions": {
|
|
4
4
|
"deny": [
|
|
5
|
-
"Bash(git commit *)",
|
|
6
|
-
"Bash(git commit)",
|
|
7
|
-
"Bash(git push *)",
|
|
8
|
-
"Bash(git push)",
|
|
9
5
|
"Bash(npx jest*)"
|
|
10
6
|
],
|
|
11
7
|
"ask": [
|
|
12
8
|
"Bash(*xargs kill*)",
|
|
9
|
+
"Bash(git commit *)",
|
|
10
|
+
"Bash(git commit)",
|
|
11
|
+
"Bash(git push *)",
|
|
12
|
+
"Bash(git push)",
|
|
13
13
|
"Bash(killall *)",
|
|
14
14
|
"Bash(pkill *)",
|
|
15
15
|
"Bash(xargs kill*)"
|
|
@@ -43,6 +43,17 @@
|
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
],
|
|
46
|
+
"UserPromptSubmit": [
|
|
47
|
+
{
|
|
48
|
+
"hooks": [
|
|
49
|
+
{
|
|
50
|
+
"type": "command",
|
|
51
|
+
"command": "node \"${CLAUDE_PROJECT_DIR}/.claude/hooks/prompt-autoroute.mjs\"",
|
|
52
|
+
"timeout": 2
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
],
|
|
46
57
|
"SubagentStop": [
|
|
47
58
|
{
|
|
48
59
|
"hooks": [
|
|
@@ -47,8 +47,6 @@ Copies `CLAUDE.md`, `rules/**`, `commands/**`, `agents/**`, `hooks/**`, `MCP.md`
|
|
|
47
47
|
filtered to stems that exist for this stack, using the nested
|
|
48
48
|
`.claude/rules/<topic>/<stem>.md` paths). Claude Code subagents inherit
|
|
49
49
|
no parent context, so this block is the authoritative mechanism.
|
|
50
|
-
- `.claude/settings.json` ships harness-level
|
|
51
|
-
`git commit/push deny`; JS stacks also `npx jest* deny` and `npm/npx/pnpm/bun`
|
|
52
|
-
ask). Re-init overwrites the file (consumer can edit afterwards); mirror
|
|
50
|
+
- `.claude/settings.json` ships harness-level checks (universal `git commit` / `git push` are `ask`; a plain commit or push is allowed only when `.ai.local/.env` sets `AI_RULES_ALLOW_GIT_WRITES=true`; JS stacks also `npx jest* deny` and `npm/npx/pnpm/bun` ask). Re-init overwrites the file (consumer can edit afterwards); mirror
|
|
53
51
|
with root `AGENTS.md` if you change the harness.
|
|
54
|
-
- **Pipeline hooks:** `.claude/settings.json` `hooks` wires `check-preset-update.mjs` (`SessionStart`; opens the reply with a level-2 heading and a blockquote naming the installed version, the latest version, and `/update` when the install is older), `guard-shell-command.mjs` (`PreToolUse` / `Bash`, `permissionDecision` `ask` or `allow`) and `chain-team-phases.sh` (`SubagentStop` for kebab-case `agent_type`). See `hooks/README.md`. No `hooks.json`.
|
|
52
|
+
- **Pipeline hooks:** `.claude/settings.json` `hooks` wires `check-preset-update.mjs` (`SessionStart`; opens the reply with a level-2 heading and a blockquote naming the installed version, the latest version, and `/update` when the install is older), `guard-shell-command.mjs` (`PreToolUse` / `Bash`, `permissionDecision` `ask` or `allow`), `prompt-autoroute.mjs` (`UserPromptSubmit`), and `chain-team-phases.sh` (`SubagentStop` for kebab-case `agent_type`). See `hooks/README.md`. No `hooks.json`.
|
|
@@ -38,6 +38,8 @@ A research fact **MUST** be written to `.ai.local/team/tasks/<slug>/analysis.md`
|
|
|
38
38
|
|
|
39
39
|
For **every** work request — with or without `/task` — persist the user's **verbatim** prompt to `.ai.local/team/tasks/<slug>/prompt.md` (write-if-absent; never overwrite on resume). Append each **subsequent** user-authored prompt for the same slug (a new message while the slug is active, `/task-continue` arguments, human-gate feedback, a clarification answer) verbatim to `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; never rewrite or duplicate an entry; never touch `prompt.md`). Never persist machine-generated hook messages or empty/argument-less invocations; pure questions and trivial one-liners are not work requests. Details: the `agent-team-intake` and `agent-team-orchestrator` rules.
|
|
40
40
|
|
|
41
|
+
On Cursor, Mavis, OpenCode and ZCode — the hosts without a verified prompt hook — run a request that is not already `/task` or `/task-continue` as `/task` when `node .ai.local/scripts/settings.mjs get AI_RULES_AUTOROUTE_UNCHAINED_PROMPTS` prints `true` and the live-slug count (every `.ai.local/team/tasks/*/status.json` whose `state` is not one of `completed`, `blocked`, `changes_requested`, `validation_failed`) is below the `node .ai.local/scripts/settings.mjs get AI_RULES_MAX_PARALLEL_TASKS` cap (`4` by default; `0` = unlimited). A prompt that names an existing slug or is a resume intent (`continue` / `resume` / `продолжай` family, `.ai.local/rules/task-resume.md`) routes to `/task-continue <slug>` regardless of the cap. <!-- i18n-keep: E4 -->
|
|
42
|
+
|
|
41
43
|
## Commands (test / lint / build)
|
|
42
44
|
|
|
43
45
|
Working directory for app scripts: **`app/`**. Detect the package manager from lockfile / `packageManager` (`package-manager` rule).
|
|
@@ -199,6 +199,6 @@ Shipped browser split: Playwright MCP for e2e specs/selectors; Chrome DevTools M
|
|
|
199
199
|
- **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for `brief.md`, `decomposition.md`, current scope, and applicable prior findings.
|
|
200
200
|
- **Owned outputs:** `implementation.md` plus changed implementation/test paths; upsert only the entry in `manifest.artifacts[]` assigned by handoff (`artifactOutputId`; fallback `implementation`) and preserve all foreign items in `manifest.artifacts[]`.
|
|
201
201
|
- **`implementation.md` budget:** ≤80 prose lines. Keep the gate table, changed files, and deviations; no work-package narrative and no diff restatement. Evidence tables do not count toward the cap.
|
|
202
|
-
- **Commit hygiene:**
|
|
202
|
+
- **Commit hygiene:** do not run `git commit` / `git push` unless `.ai.local/.env` sets `AI_RULES_ALLOW_GIT_WRITES=true`. At the end of the turn return a `## Human commits` block: files touched + a proposed commit message, split by area (source / artifacts / docs) with the owning slug/ticket in the subject. See the consumer `commit-hygiene` local rule.
|
|
203
203
|
- **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present. `authoritativePaths` are relative to the task folder (`brief.md`), not the repo root; put external files in `evidencePaths`.
|
|
204
204
|
- **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
|
|
@@ -193,13 +193,7 @@ rev: 1 — record each replan as `decision: replan rev N → N+1` in `.memlog.md
|
|
|
193
193
|
|
|
194
194
|
### Runtime state
|
|
195
195
|
|
|
196
|
-
The orchestration runtime/hook owns `status.json`; the analyst does not create or mutate lifecycle fields.
|
|
197
|
-
|
|
198
|
-
Also write `.ai.local/team/active-task.json`:
|
|
199
|
-
|
|
200
|
-
```json
|
|
201
|
-
{ "slug": "<slug>" }
|
|
202
|
-
```
|
|
196
|
+
The orchestration runtime/hook owns `status.json`; the analyst does not create or mutate lifecycle fields. `active-task.json` is a UI projection rebuilt by `team-db sync` — do not write it.
|
|
203
197
|
|
|
204
198
|
## Slug naming
|
|
205
199
|
|
|
@@ -236,7 +236,7 @@ When the task description or `brief.md` carries `Autonomy: auto`:
|
|
|
236
236
|
|
|
237
237
|
## Output
|
|
238
238
|
|
|
239
|
-
Write `.ai.local/team/tasks/<slug>/pipeline.json` and initialize the routing entry in `artifact-manifest.json
|
|
239
|
+
Write `.ai.local/team/tasks/<slug>/pipeline.json` and initialize the routing entry in `artifact-manifest.json`. The orchestration runtime creates and owns `status.json`.
|
|
240
240
|
|
|
241
241
|
## Handoff to orchestrator
|
|
242
242
|
|
|
@@ -6,7 +6,7 @@ glob: always
|
|
|
6
6
|
|
|
7
7
|
When committing or preparing a commit, acknowledge: `Using .ai.local: commit-hygiene(, …)*`.
|
|
8
8
|
|
|
9
|
-
Agents do not run `git commit`/`git push`. This rule constrains the **human commit step** and the agent's end-of-turn commit guidance.
|
|
9
|
+
Agents do not run `git commit`/`git push` unless `.ai.local/.env` sets `AI_RULES_ALLOW_GIT_WRITES=true`. This rule constrains the **human commit step** and the agent's end-of-turn commit guidance. `init` lists `.env` in `.ai.local/.gitignore` and leaves `.env.example` tracked. Committing `.ai.local/.env` is an explicit opt-in: remove that line, then add the file. A committed `true` enables git writes on every clone.
|
|
10
10
|
|
|
11
11
|
## Rules
|
|
12
12
|
|
|
@@ -12,10 +12,9 @@ Routes intent **`spec-gen`** (or bootstrap) → **task-analyst** in **author mod
|
|
|
12
12
|
1. Extract description from arguments after `/spec-start` (domain, page/feature ids, sources).
|
|
13
13
|
2. Generate a **slug** (kebab-case, ≤48 chars), e.g. `spec-<domain>-<id>`.
|
|
14
14
|
3. Ensure `.ai.local/team/tasks/<slug>/` exists (Write artifacts; not Shell mkdir).
|
|
15
|
-
4. Write
|
|
16
|
-
5.
|
|
17
|
-
6.
|
|
18
|
-
7. Wait for analyst. **Do not** invoke feature-developer until human gate passes.
|
|
15
|
+
4. Write minimal `pipeline.json`: task-analyst → (optional stop) → feature-developer only if user asked implement-after. **No separate spec-author agent.**
|
|
16
|
+
5. Invoke **task-analyst** with: author mode; load **`product-specs`** + **`product-specs-authoring`** + skill **`spec-authoring`**; Bootstrap if `docs/specs/` absent, else Generate. Optional: if arguments/AC ask research-before-spec, also load skill **`spec-discovery`** (not default).
|
|
17
|
+
6. Wait for analyst. **Do not** invoke feature-developer until human gate passes.
|
|
19
18
|
|
|
20
19
|
## Human gate
|
|
21
20
|
|
|
@@ -10,6 +10,7 @@ Resume the pipeline from `pipeline.json`.
|
|
|
10
10
|
## Arguments
|
|
11
11
|
|
|
12
12
|
`<slug>` — task identifier.
|
|
13
|
+
`--all` — repo-level resume: clears the repo-global sentinels and every per-slug sentinel.
|
|
13
14
|
|
|
14
15
|
## Preconditions
|
|
15
16
|
|
|
@@ -18,13 +19,12 @@ Resume the pipeline from `pipeline.json`.
|
|
|
18
19
|
- `awaitingHumanGate: true` or `state: awaiting_approval`, **or**
|
|
19
20
|
- `state: changes_requested` (after review), **or**
|
|
20
21
|
- `state: blocked` (a producer's terminal `blocked` receipt and the owner has resolved the blockers), **or**
|
|
21
|
-
- `state: paused` (the `.ai.local/STOP` / `.ai.local/ESTOP`
|
|
22
|
+
- `state: paused` (the per-slug sentinel `.ai.local/team/tasks/<slug>/STOP` is gone; a repo-global `.ai.local/STOP` / `.ai.local/ESTOP` is removed only by `--all`), **or**
|
|
22
23
|
- the task was interrupted and must resume from `pipelineIndex`.
|
|
23
24
|
|
|
24
25
|
## Algorithm
|
|
25
26
|
|
|
26
|
-
1.
|
|
27
|
-
2. **Human gate resume** (`awaitingHumanGate` / `awaiting_approval`):
|
|
27
|
+
1. **Human gate resume** (`awaitingHumanGate` / `awaiting_approval`):
|
|
28
28
|
1. **Do not** manually increment `pipelineIndex` or invent `currentAgent` first.
|
|
29
29
|
2. Close the gate + activate the next attempt via the **installed** hook (single authority for ledger + status):
|
|
30
30
|
|
|
@@ -34,9 +34,9 @@ printf '%s\n' '{"status":"completed","action":"end_human_gate","activateNext":tr
|
|
|
34
34
|
|
|
35
35
|
3. Re-read `status.json` (and the hook `followup_message`).
|
|
36
36
|
4. Invoke the subagent named in `status.currentAgent` / followup — do **not** advance the pipeline a second time.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
2. **Review `changes_requested`** (not a human gate): if `currentAgent` is **`mockup-reviewer`**, this is the FAIL-only mockup gate — do **not** retry `feature-developer`. Read `mockup-review.md` and resume via the human-gate path (`end_human_gate` / `activateNext`). Otherwise: set `currentAgent` to `feature-developer` (same index / find developer in steps), `state: in_progress`, then invoke developer. Do **not** call `end_human_gate` unless `activeHumanGateEventId` is set.
|
|
38
|
+
3. **`blocked` + `currentAgent: mockup-reviewer`** (`BLOCKED_MCP`): skip-forward via the same `end_human_gate`/`activateNext` path (explicit «proceed without MCP»). Do not invent DS claims. This exception keeps precedence: `resume_blocked` refuses this state and names the skip-forward.
|
|
39
|
+
4. **`state: blocked`** (every other producer): re-arm the blocked step through the **installed** hook — it activates attempt N+1 and is the **single authority** for the ledger:
|
|
40
40
|
1. **Do not** manually increment `pipelineIndex` or hand-write `status.json` fields.
|
|
41
41
|
|
|
42
42
|
```bash
|
|
@@ -46,8 +46,9 @@ printf '%s\n' '{"action":"resume_blocked"}' | TEAM_TASK_SLUG=<slug> bash .claude
|
|
|
46
46
|
2. `ok:false` with a `reason` (`is not blocked`, `pipeline.json`, `graph mode`, `already has an active attempt`) means nothing was armed: re-read `status.json` and act on the reason. A refusal carries no `followup_message` — never re-invoke a producer on it.
|
|
47
47
|
3. `ok:true` arms attempt N+1 on the same step: re-read `status.json`, then invoke the subagent named in `status.currentAgent` with the hook `followup_message`. Do **not** open the gate yourself: the retried receipt opens it (`awaiting_approval`) when the step has `after:<agent>` in `humanGates`, and advances the chain otherwise.
|
|
48
48
|
4. Fallback only for an installed hook that predates the action (the call answers `{}`): run `{"status":"completed","action":"bootstrap"}` then `{"status":"completed"}`. The second run opens the gate or advances; the retried producer is not ledgered, so record it in `.memlog.md`.
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
5. **Other resume**: restore `pipelineIndex` / `currentAgent` from status and invoke that agent.
|
|
50
|
+
6. **Paused** (`state: paused`, sentinel removed): resume is slug-scoped — remove **only** this slug's sentinel, `.ai.local/team/tasks/<slug>/STOP` (never ask the user to delete it by hand). Never remove the repo-global `.ai.local/STOP` / `.ai.local/ESTOP` on a per-slug resume: they pause every slug and only `--all` clears them. If `awaitingHumanGate` is still true, use the human-gate resume path above. Otherwise close the pause through the installed hook with `{"status":"completed"}` and no `action`, then re-read `status.json` and the hook `followup_message`; do not advance by hand.
|
|
51
|
+
7. **`--all` (repo-level resume)**: remove `.ai.local/STOP`, `.ai.local/ESTOP`, and every per-slug `.ai.local/team/tasks/<slug>/STOP`, appending one `.memlog.md` line per slug resumed (`event: operator pause cleared by resume intent (<slug>)`). Then resume each affected slug through its own `/task-continue <slug>` flow.
|
|
51
52
|
8. After the invoked agent completes, `chain-team-phases.sh` on `subagentStop` continues the chain when `autoChain: true`.
|
|
52
53
|
|
|
53
54
|
## Checkpoint & resume
|
|
@@ -18,6 +18,14 @@ Load `anti-hallucination-contract` before asserting code, APIs, schemas, tool be
|
|
|
18
18
|
|
|
19
19
|
Everything after `/task-evil` is the task description in natural language.
|
|
20
20
|
|
|
21
|
+
## Start precondition
|
|
22
|
+
|
|
23
|
+
Before the first task action:
|
|
24
|
+
|
|
25
|
+
1. Write the marker `.ai.local/team/.task-evil` (create `.ai.local/team/` if needed). If it cannot be written, write `blocked.md` and stop: the shell guard cannot tell an autonomous run apart without it.
|
|
26
|
+
2. Run `node .ai.local/scripts/settings.mjs get AI_RULES_ALLOW_GIT_WRITES`. If it prints `true`, write `blocked.md` naming the flag, remove the marker, and stop: an autonomous run cannot start while `AI_RULES_ALLOW_GIT_WRITES=true`.
|
|
27
|
+
3. Remove `.ai.local/team/.task-evil` when the run ends (completed or blocked). A stale marker keeps git writes gated, which is the safe direction.
|
|
28
|
+
|
|
21
29
|
## Procedure
|
|
22
30
|
|
|
23
31
|
1. **Slug** — kebab-case from the description (≤48 characters). Create `.ai.local/team/tasks/<slug>/` via **Write** (placeholder `pipeline.json` or empty marker), `prompt.md` (verbatim, write-if-absent), `goal.md` (Goal, User value, Success criteria, Non-goals, Derived from `prompt.md`), `autonomy.md` (the contract below), and `decisions.md` (the table header below). The runtime/hook owns `status.json`; do not create it with Shell.
|
|
@@ -39,7 +39,7 @@ Examples:
|
|
|
39
39
|
4. **Intent retro** — if `intent === "retro"`, run `/technical-retro` and **stop**.
|
|
40
40
|
5. **Confirm plan** — **stop** and ask the user to confirm the plan and the `goal.md` fields before any specialist runs. Wait for explicit approval before invoking `steps[0]`. A change to the plan at this point is a named `planRevision` (see Plan contract), not a silent edit. Record the confirmation verbatim in `prompt-log.md`.
|
|
41
41
|
6. **Start** — after confirmation:
|
|
42
|
-
- confirm `pipeline.json
|
|
42
|
+
- confirm `pipeline.json`; `active-task.json` is a UI projection rebuilt by `team-db sync` — do not write it;
|
|
43
43
|
- **do not** write lifecycle fields in `status.json` / `metrics.json` yourself — orchestration runtime/hook owns them (see **agent-artifact-contracts**). If `status.json` is missing, only minimal bootstrap is allowed (`slug`, `intent`, `pipelineIndex: 0`, `currentAgent: steps[0]`, `state: in_progress`) — **do not** increment `pipelineIndex` manually;
|
|
44
44
|
- invoke subagent for `pipeline.steps[0].agent` (slug, artifact paths, scope).
|
|
45
45
|
7. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until hook returns `followup_message`). A Task call that returns a session handle has only **started** the agent: keep the step open until it reports back.
|