@bonesofspring/ai-rules 0.2.66 → 0.2.68
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 +72 -0
- package/README.md +6 -4
- package/bin/cli.js +9 -1
- package/bin/lib/engine-scripts.js +3 -10
- package/bin/lib/seed-ai-local-team.js +27 -1
- package/docs/OPENCODE-COMPATIBILITY.md +1 -0
- package/docs/OPENCODE.md +14 -1
- package/docs/PRESET-CONTRIBUTION.md +15 -8
- package/docs/TEAM-DB.md +107 -106
- package/docs/TOKEN-ECONOMY.md +36 -3
- package/docs/openapi/team-db.v1.json +3910 -1471
- package/package.json +13 -5
- package/presets/_shared/ai-local/scripts/dump-output.mjs +63 -12
- package/presets/_shared/ai-local/scripts/processes.mjs +467 -55
- package/presets/_shared/ai-local/scripts/team-db-api.mjs +564 -10
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +819 -50
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +659 -5
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +135 -0
- package/presets/_shared/ai-local/scripts/team-db-task-runner.mjs +11 -6
- package/presets/_shared/ai-local/scripts/team-db-tracker.mjs +2 -0
- package/presets/_shared/ai-local/scripts/team-db.mjs +16 -54
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +5 -5
- package/presets/_shared/core/architecture/feature-delivery-workflow.md +3 -7
- package/presets/_shared/core/meta/preset-pr-checklist.md +2 -2
- package/presets/_shared/core/quality/code-quality-and-refactoring.md +2 -6
- package/presets/_shared/core/quality/verification-before-completion.md +20 -3
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +21 -5
- package/presets/_shared/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/android-kotlin/REPO_AGENTS.md +7 -47
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +21 -5
- package/presets/claude/android-kotlin/hooks/list-ai-local.mjs +17 -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/code-quality.md +2 -6
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +2 -2
- package/presets/claude/go/REPO_AGENTS.md +7 -47
- package/presets/claude/go/hooks/chain-team-phases.sh +21 -5
- package/presets/claude/go/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/go/rules/architecture/feature-delivery.md +3 -7
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/go/rules/tooling-and-review/code-quality.md +2 -6
- package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +2 -2
- package/presets/claude/ios-swift/REPO_AGENTS.md +7 -47
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +21 -5
- package/presets/claude/ios-swift/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/ios-swift/rules/architecture/feature-delivery.md +3 -7
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +2 -6
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +2 -2
- package/presets/claude/java/REPO_AGENTS.md +7 -47
- package/presets/claude/java/hooks/chain-team-phases.sh +21 -5
- package/presets/claude/java/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/java/rules/architecture/feature-delivery.md +3 -7
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/java/rules/tooling-and-review/code-quality.md +2 -6
- package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +2 -2
- package/presets/claude/mcp-ts/REPO_AGENTS.md +7 -47
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +21 -5
- package/presets/claude/mcp-ts/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/mcp-ts/rules/architecture/feature-delivery.md +3 -7
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/mcp-ts/rules/tooling-and-review/code-quality.md +2 -6
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +2 -2
- package/presets/claude/mol/REPO_AGENTS.md +9 -49
- package/presets/claude/mol/hooks/chain-team-phases.sh +21 -5
- package/presets/claude/mol/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/mol/rules/architecture/feature-delivery-workflow.md +3 -7
- package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/mol/rules/tooling-and-review/code-quality.md +2 -6
- package/presets/claude/mol/rules/tooling-and-review/preset-pr-checklist.md +2 -2
- package/presets/claude/next/REPO_AGENTS.md +10 -50
- package/presets/claude/next/agents/accessibility-reviewer.md +0 -1
- package/presets/claude/next/agents/api-contract-reviewer.md +0 -1
- package/presets/claude/next/agents/build-verifier.md +12 -8
- package/presets/claude/next/agents/ci-investigator.md +5 -2
- package/presets/claude/next/agents/code-reviewer.md +1 -1
- package/presets/claude/next/agents/codebase-analyzer.md +0 -1
- package/presets/claude/next/agents/debugger.md +5 -2
- package/presets/claude/next/agents/feature-developer.md +11 -8
- package/presets/claude/next/agents/migration-specialist.md +0 -1
- package/presets/claude/next/agents/mockup-reviewer.md +0 -1
- package/presets/claude/next/agents/openspec-author.md +0 -1
- package/presets/claude/next/agents/performance-auditor.md +0 -1
- package/presets/claude/next/agents/playwright-test-generator.md +0 -1
- package/presets/claude/next/agents/playwright-test-healer.md +0 -1
- package/presets/claude/next/agents/playwright-test-planner.md +0 -1
- package/presets/claude/next/agents/qa-tester.md +3 -3
- package/presets/claude/next/agents/security-reviewer.md +0 -1
- package/presets/claude/next/agents/solution-architect.md +0 -1
- package/presets/claude/next/agents/task-analyst.md +0 -1
- package/presets/claude/next/agents/task-router.md +8 -7
- package/presets/claude/next/agents/tech-writer.md +0 -1
- package/presets/claude/next/agents/unit-test-generator.md +0 -1
- package/presets/claude/next/agents/unit-test-healer.md +0 -1
- package/presets/claude/next/agents/unit-test-planner.md +0 -1
- package/presets/claude/next/commands/README.md +0 -6
- package/presets/claude/next/hooks/chain-team-phases.sh +21 -5
- package/presets/claude/next/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +9 -9
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/next/rules/tooling-and-review/code-quality.md +2 -6
- package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +12 -16
- package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +2 -2
- package/presets/claude/next/skills/feature-delivery/SKILL.md +1 -1
- package/presets/claude/next/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/claude/next/skills/unit-testing/SKILL.md +1 -1
- package/presets/claude/nuxt/REPO_AGENTS.md +8 -48
- package/presets/claude/nuxt/agents/accessibility-reviewer.md +0 -1
- package/presets/claude/nuxt/agents/api-contract-reviewer.md +0 -1
- package/presets/claude/nuxt/agents/build-verifier.md +5 -3
- package/presets/claude/nuxt/agents/ci-investigator.md +1 -1
- package/presets/claude/nuxt/agents/code-reviewer.md +0 -1
- package/presets/claude/nuxt/agents/codebase-analyzer.md +0 -1
- package/presets/claude/nuxt/agents/debugger.md +1 -1
- package/presets/claude/nuxt/agents/feature-developer.md +6 -6
- package/presets/claude/nuxt/agents/migration-specialist.md +0 -1
- package/presets/claude/nuxt/agents/mockup-reviewer.md +0 -1
- package/presets/claude/nuxt/agents/openspec-author.md +0 -1
- package/presets/claude/nuxt/agents/performance-auditor.md +0 -1
- package/presets/claude/nuxt/agents/playwright-test-generator.md +0 -1
- package/presets/claude/nuxt/agents/playwright-test-healer.md +0 -1
- package/presets/claude/nuxt/agents/playwright-test-planner.md +0 -1
- package/presets/claude/nuxt/agents/qa-tester.md +3 -3
- package/presets/claude/nuxt/agents/security-reviewer.md +0 -1
- package/presets/claude/nuxt/agents/solution-architect.md +0 -1
- package/presets/claude/nuxt/agents/task-analyst.md +0 -1
- package/presets/claude/nuxt/agents/task-router.md +8 -7
- package/presets/claude/nuxt/agents/tech-writer.md +0 -1
- package/presets/claude/nuxt/agents/unit-test-generator.md +0 -1
- package/presets/claude/nuxt/agents/unit-test-healer.md +0 -1
- package/presets/claude/nuxt/agents/unit-test-planner.md +0 -1
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +21 -5
- package/presets/claude/nuxt/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/nuxt/rules/architecture/feature-delivery-workflow.md +3 -7
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/nuxt/rules/tooling-and-review/code-quality.md +2 -6
- package/presets/claude/nuxt/rules/tooling-and-review/post-change-lint.md +14 -14
- package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +2 -2
- package/presets/claude/nuxt/skills/feature-delivery/SKILL.md +1 -1
- package/presets/claude/nuxt/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/claude/nuxt/skills/unit-testing/SKILL.md +1 -1
- package/presets/claude/php-hexagonal/REPO_AGENTS.md +7 -47
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +21 -5
- package/presets/claude/php-hexagonal/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/php-hexagonal/rules/architecture/feature-delivery.md +3 -7
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/php-hexagonal/rules/tooling-and-review/code-quality.md +2 -6
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +2 -2
- package/presets/claude/php-laravel/REPO_AGENTS.md +7 -47
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +21 -5
- package/presets/claude/php-laravel/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/php-laravel/rules/architecture/feature-delivery.md +3 -7
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/php-laravel/rules/tooling-and-review/code-quality.md +2 -6
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +2 -2
- package/presets/claude/svelte/REPO_AGENTS.md +8 -48
- package/presets/claude/svelte/agents/accessibility-reviewer.md +0 -1
- package/presets/claude/svelte/agents/api-contract-reviewer.md +0 -1
- package/presets/claude/svelte/agents/build-verifier.md +5 -3
- package/presets/claude/svelte/agents/ci-investigator.md +1 -1
- package/presets/claude/svelte/agents/code-reviewer.md +0 -1
- package/presets/claude/svelte/agents/codebase-analyzer.md +0 -1
- package/presets/claude/svelte/agents/debugger.md +1 -1
- package/presets/claude/svelte/agents/feature-developer.md +6 -6
- package/presets/claude/svelte/agents/migration-specialist.md +0 -1
- package/presets/claude/svelte/agents/mockup-reviewer.md +0 -1
- package/presets/claude/svelte/agents/openspec-author.md +0 -1
- package/presets/claude/svelte/agents/performance-auditor.md +0 -1
- package/presets/claude/svelte/agents/playwright-test-generator.md +0 -1
- package/presets/claude/svelte/agents/playwright-test-healer.md +0 -1
- package/presets/claude/svelte/agents/playwright-test-planner.md +0 -1
- package/presets/claude/svelte/agents/qa-tester.md +3 -3
- package/presets/claude/svelte/agents/security-reviewer.md +0 -1
- package/presets/claude/svelte/agents/solution-architect.md +0 -1
- package/presets/claude/svelte/agents/task-analyst.md +0 -1
- package/presets/claude/svelte/agents/task-router.md +8 -7
- package/presets/claude/svelte/agents/tech-writer.md +0 -1
- package/presets/claude/svelte/agents/unit-test-generator.md +0 -1
- package/presets/claude/svelte/agents/unit-test-healer.md +0 -1
- package/presets/claude/svelte/agents/unit-test-planner.md +0 -1
- package/presets/claude/svelte/hooks/chain-team-phases.sh +21 -5
- package/presets/claude/svelte/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/svelte/rules/architecture/feature-delivery-workflow.md +3 -7
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +5 -5
- package/presets/claude/svelte/rules/tooling-and-review/code-quality.md +2 -6
- package/presets/claude/svelte/rules/tooling-and-review/post-change-lint.md +14 -14
- package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +2 -2
- package/presets/claude/svelte/skills/feature-delivery/SKILL.md +1 -1
- package/presets/claude/svelte/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/claude/svelte/skills/unit-testing/SKILL.md +1 -1
- package/presets/cursor/android-kotlin/AGENTS.md +0 -10
- package/presets/cursor/android-kotlin/REPO_AGENTS.md +7 -47
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +21 -5
- package/presets/cursor/android-kotlin/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/android-kotlin/rules/code-quality-and-refactoring.mdc +2 -6
- package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +2 -2
- package/presets/cursor/go/AGENTS.md +0 -8
- package/presets/cursor/go/REPO_AGENTS.md +7 -47
- package/presets/cursor/go/hooks/chain-team-phases.sh +21 -5
- package/presets/cursor/go/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/go/rules/code-quality-and-refactoring.mdc +2 -6
- package/presets/cursor/go/rules/preset-pr-checklist.mdc +2 -2
- package/presets/cursor/ios-swift/AGENTS.md +0 -10
- package/presets/cursor/ios-swift/REPO_AGENTS.md +7 -47
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +21 -5
- package/presets/cursor/ios-swift/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +2 -6
- package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +2 -2
- package/presets/cursor/java/AGENTS.md +0 -8
- package/presets/cursor/java/REPO_AGENTS.md +7 -47
- package/presets/cursor/java/hooks/chain-team-phases.sh +21 -5
- package/presets/cursor/java/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/java/rules/code-quality-and-refactoring.mdc +2 -6
- package/presets/cursor/java/rules/preset-pr-checklist.mdc +2 -2
- package/presets/cursor/mcp-ts/AGENTS.md +0 -6
- package/presets/cursor/mcp-ts/REPO_AGENTS.md +7 -47
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +21 -5
- package/presets/cursor/mcp-ts/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/mcp-ts/rules/code-quality-and-refactoring.mdc +2 -6
- package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +2 -2
- package/presets/cursor/mol/AGENTS.md +0 -11
- package/presets/cursor/mol/REPO_AGENTS.md +9 -49
- package/presets/cursor/mol/hooks/chain-team-phases.sh +21 -5
- package/presets/cursor/mol/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/mol/rules/code-quality-and-refactoring.mdc +2 -6
- package/presets/cursor/mol/rules/preset-pr-checklist.mdc +2 -2
- package/presets/cursor/next/AGENTS.md +1 -12
- package/presets/cursor/next/REPO_AGENTS.md +10 -50
- package/presets/cursor/next/agents/build-verifier.md +11 -7
- package/presets/cursor/next/agents/code-reviewer.md +1 -0
- package/presets/cursor/next/agents/feature-developer.md +6 -6
- package/presets/cursor/next/agents/qa-tester.md +3 -2
- package/presets/cursor/next/agents/task-router.md +8 -6
- package/presets/cursor/next/commands/README.md +0 -6
- package/presets/cursor/next/hooks/chain-team-phases.sh +21 -5
- package/presets/cursor/next/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +4 -4
- package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +2 -6
- package/presets/cursor/next/rules/feature-delivery-workflow.mdc +6 -2
- package/presets/cursor/next/rules/post-change-lint.mdc +12 -16
- package/presets/cursor/next/rules/preset-pr-checklist.mdc +2 -2
- package/presets/cursor/next/skills/feature-delivery/SKILL.md +1 -1
- package/presets/cursor/next/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/cursor/next/skills/unit-testing/SKILL.md +1 -1
- package/presets/cursor/nuxt/AGENTS.md +1 -12
- package/presets/cursor/nuxt/REPO_AGENTS.md +8 -48
- package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
- package/presets/cursor/nuxt/agents/feature-developer.md +2 -2
- package/presets/cursor/nuxt/agents/qa-tester.md +3 -2
- package/presets/cursor/nuxt/agents/task-router.md +8 -6
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +21 -5
- package/presets/cursor/nuxt/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/nuxt/rules/code-quality-and-refactoring.mdc +2 -6
- package/presets/cursor/nuxt/rules/post-change-lint.mdc +14 -14
- package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +2 -2
- package/presets/cursor/nuxt/skills/feature-delivery/SKILL.md +1 -1
- package/presets/cursor/nuxt/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/cursor/nuxt/skills/unit-testing/SKILL.md +1 -1
- package/presets/cursor/php-hexagonal/AGENTS.md +0 -8
- package/presets/cursor/php-hexagonal/REPO_AGENTS.md +7 -47
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +21 -5
- package/presets/cursor/php-hexagonal/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/php-hexagonal/rules/code-quality-and-refactoring.mdc +2 -6
- package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +2 -2
- package/presets/cursor/php-laravel/AGENTS.md +0 -8
- package/presets/cursor/php-laravel/REPO_AGENTS.md +7 -47
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +21 -5
- package/presets/cursor/php-laravel/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/php-laravel/rules/code-quality-and-refactoring.mdc +2 -6
- package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +2 -2
- package/presets/cursor/svelte/AGENTS.md +1 -12
- package/presets/cursor/svelte/REPO_AGENTS.md +8 -48
- package/presets/cursor/svelte/agents/build-verifier.md +1 -1
- package/presets/cursor/svelte/agents/feature-developer.md +2 -2
- package/presets/cursor/svelte/agents/qa-tester.md +3 -2
- package/presets/cursor/svelte/agents/task-router.md +8 -6
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +21 -5
- package/presets/cursor/svelte/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/svelte/rules/code-quality-and-refactoring.mdc +2 -6
- package/presets/cursor/svelte/rules/post-change-lint.mdc +14 -14
- package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +2 -2
- package/presets/cursor/svelte/skills/feature-delivery/SKILL.md +1 -1
- package/presets/cursor/svelte/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/cursor/svelte/skills/unit-testing/SKILL.md +1 -1
- package/presets/mavis/android-kotlin/MAVIS.md +0 -2
- package/presets/mavis/android-kotlin/REPO_AGENTS.md +7 -47
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +21 -5
- package/presets/mavis/android-kotlin/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/android-kotlin/rules/code-quality-and-refactoring.md +2 -6
- package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +2 -2
- package/presets/mavis/go/MAVIS.md +8 -0
- package/presets/mavis/go/REPO_AGENTS.md +7 -47
- package/presets/mavis/go/adapter-map.json +1 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +21 -5
- package/presets/mavis/go/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/go/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/go/rules/code-quality-and-refactoring.md +2 -6
- package/presets/mavis/go/rules/feature-delivery-workflow.md +3 -7
- package/presets/mavis/go/rules/preset-pr-checklist.md +2 -2
- package/presets/mavis/ios-swift/MAVIS.md +0 -2
- package/presets/mavis/ios-swift/REPO_AGENTS.md +7 -47
- package/presets/mavis/ios-swift/adapter-map.json +1 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +21 -5
- package/presets/mavis/ios-swift/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/ios-swift/rules/code-quality-and-refactoring.md +2 -6
- package/presets/mavis/ios-swift/rules/feature-delivery-workflow.md +3 -7
- package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +2 -2
- package/presets/mavis/java/MAVIS.md +14 -0
- package/presets/mavis/java/REPO_AGENTS.md +7 -47
- package/presets/mavis/java/adapter-map.json +1 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +21 -5
- package/presets/mavis/java/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/java/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/java/rules/code-quality-and-refactoring.md +2 -6
- package/presets/mavis/java/rules/feature-delivery-workflow.md +3 -7
- package/presets/mavis/java/rules/preset-pr-checklist.md +2 -2
- package/presets/mavis/mcp-ts/MAVIS.md +6 -0
- package/presets/mavis/mcp-ts/REPO_AGENTS.md +7 -47
- package/presets/mavis/mcp-ts/adapter-map.json +1 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +21 -5
- package/presets/mavis/mcp-ts/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/mcp-ts/rules/code-quality-and-refactoring.md +2 -6
- package/presets/mavis/mcp-ts/rules/feature-delivery-workflow.md +3 -7
- package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +2 -2
- package/presets/mavis/mol/MAVIS.md +1 -5
- package/presets/mavis/mol/REPO_AGENTS.md +9 -49
- package/presets/mavis/mol/adapter-map.json +1 -1
- package/presets/mavis/mol/hooks/chain-team-phases.sh +21 -5
- package/presets/mavis/mol/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/mol/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/mol/rules/code-quality-and-refactoring.md +2 -6
- package/presets/mavis/mol/rules/feature-delivery-workflow.md +3 -7
- package/presets/mavis/mol/rules/preset-pr-checklist.md +2 -2
- package/presets/mavis/next/MAVIS.md +2 -6
- package/presets/mavis/next/REPO_AGENTS.md +10 -50
- package/presets/mavis/next/adapter-map.json +1 -17
- package/presets/mavis/next/agents/accessibility-reviewer.md +0 -1
- package/presets/mavis/next/agents/api-contract-reviewer.md +0 -1
- package/presets/mavis/next/agents/build-verifier.md +12 -8
- package/presets/mavis/next/agents/ci-investigator.md +5 -2
- package/presets/mavis/next/agents/code-reviewer.md +1 -1
- package/presets/mavis/next/agents/codebase-analyzer.md +0 -1
- package/presets/mavis/next/agents/debugger.md +5 -2
- package/presets/mavis/next/agents/feature-developer.md +11 -8
- package/presets/mavis/next/agents/migration-specialist.md +0 -1
- package/presets/mavis/next/agents/mockup-reviewer.md +0 -1
- package/presets/mavis/next/agents/openspec-author.md +0 -1
- package/presets/mavis/next/agents/performance-auditor.md +0 -1
- package/presets/mavis/next/agents/playwright-test-generator.md +0 -1
- package/presets/mavis/next/agents/playwright-test-healer.md +0 -1
- package/presets/mavis/next/agents/playwright-test-planner.md +0 -1
- package/presets/mavis/next/agents/qa-tester.md +3 -3
- package/presets/mavis/next/agents/security-reviewer.md +0 -1
- package/presets/mavis/next/agents/solution-architect.md +0 -1
- package/presets/mavis/next/agents/task-analyst.md +0 -1
- package/presets/mavis/next/agents/task-router.md +8 -7
- package/presets/mavis/next/agents/tech-writer.md +0 -1
- package/presets/mavis/next/agents/unit-test-generator.md +0 -1
- package/presets/mavis/next/agents/unit-test-healer.md +0 -1
- package/presets/mavis/next/agents/unit-test-planner.md +0 -1
- package/presets/mavis/next/commands/README.md +0 -6
- package/presets/mavis/next/hooks/chain-team-phases.sh +21 -5
- package/presets/mavis/next/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/next/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/next/rules/code-quality-and-refactoring.md +2 -6
- package/presets/mavis/next/rules/feature-delivery-workflow.md +9 -9
- package/presets/mavis/next/rules/post-change-lint.md +11 -15
- package/presets/mavis/next/rules/preset-pr-checklist.md +2 -2
- package/presets/mavis/next/skills/feature-delivery/SKILL.md +1 -1
- package/presets/mavis/next/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/mavis/next/skills/unit-testing/SKILL.md +1 -1
- package/presets/mavis/nuxt/MAVIS.md +2 -6
- package/presets/mavis/nuxt/REPO_AGENTS.md +8 -48
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/agents/accessibility-reviewer.md +0 -1
- package/presets/mavis/nuxt/agents/api-contract-reviewer.md +0 -1
- package/presets/mavis/nuxt/agents/build-verifier.md +2 -2
- package/presets/mavis/nuxt/agents/ci-investigator.md +1 -1
- package/presets/mavis/nuxt/agents/code-reviewer.md +0 -1
- package/presets/mavis/nuxt/agents/codebase-analyzer.md +0 -1
- package/presets/mavis/nuxt/agents/debugger.md +1 -1
- package/presets/mavis/nuxt/agents/feature-developer.md +3 -3
- package/presets/mavis/nuxt/agents/migration-specialist.md +0 -1
- package/presets/mavis/nuxt/agents/mockup-reviewer.md +0 -1
- package/presets/mavis/nuxt/agents/openspec-author.md +0 -1
- package/presets/mavis/nuxt/agents/performance-auditor.md +0 -1
- package/presets/mavis/nuxt/agents/playwright-test-generator.md +0 -1
- package/presets/mavis/nuxt/agents/playwright-test-healer.md +0 -1
- package/presets/mavis/nuxt/agents/playwright-test-planner.md +0 -1
- package/presets/mavis/nuxt/agents/qa-tester.md +3 -3
- package/presets/mavis/nuxt/agents/security-reviewer.md +0 -1
- package/presets/mavis/nuxt/agents/solution-architect.md +0 -1
- package/presets/mavis/nuxt/agents/task-analyst.md +0 -1
- package/presets/mavis/nuxt/agents/task-router.md +8 -7
- package/presets/mavis/nuxt/agents/tech-writer.md +0 -1
- package/presets/mavis/nuxt/agents/unit-test-generator.md +0 -1
- package/presets/mavis/nuxt/agents/unit-test-healer.md +0 -1
- package/presets/mavis/nuxt/agents/unit-test-planner.md +0 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +21 -5
- package/presets/mavis/nuxt/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/nuxt/rules/code-quality-and-refactoring.md +2 -6
- package/presets/mavis/nuxt/rules/feature-delivery-workflow.md +3 -7
- package/presets/mavis/nuxt/rules/post-change-lint.md +13 -13
- package/presets/mavis/nuxt/rules/preset-pr-checklist.md +2 -2
- package/presets/mavis/nuxt/skills/feature-delivery/SKILL.md +1 -1
- package/presets/mavis/nuxt/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/mavis/nuxt/skills/unit-testing/SKILL.md +1 -1
- package/presets/mavis/php-hexagonal/MAVIS.md +16 -0
- package/presets/mavis/php-hexagonal/REPO_AGENTS.md +7 -47
- package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +21 -5
- package/presets/mavis/php-hexagonal/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/php-hexagonal/rules/code-quality-and-refactoring.md +2 -6
- package/presets/mavis/php-hexagonal/rules/feature-delivery-workflow.md +3 -7
- package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +2 -2
- package/presets/mavis/php-laravel/MAVIS.md +16 -0
- package/presets/mavis/php-laravel/REPO_AGENTS.md +7 -47
- package/presets/mavis/php-laravel/adapter-map.json +1 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +21 -5
- package/presets/mavis/php-laravel/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/php-laravel/rules/code-quality-and-refactoring.md +2 -6
- package/presets/mavis/php-laravel/rules/feature-delivery-workflow.md +3 -7
- package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +2 -2
- package/presets/mavis/svelte/MAVIS.md +2 -6
- package/presets/mavis/svelte/REPO_AGENTS.md +8 -48
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/agents/accessibility-reviewer.md +0 -1
- package/presets/mavis/svelte/agents/api-contract-reviewer.md +0 -1
- package/presets/mavis/svelte/agents/build-verifier.md +2 -2
- package/presets/mavis/svelte/agents/ci-investigator.md +1 -1
- package/presets/mavis/svelte/agents/code-reviewer.md +0 -1
- package/presets/mavis/svelte/agents/codebase-analyzer.md +0 -1
- package/presets/mavis/svelte/agents/debugger.md +1 -1
- package/presets/mavis/svelte/agents/feature-developer.md +3 -3
- package/presets/mavis/svelte/agents/migration-specialist.md +0 -1
- package/presets/mavis/svelte/agents/mockup-reviewer.md +0 -1
- package/presets/mavis/svelte/agents/openspec-author.md +0 -1
- package/presets/mavis/svelte/agents/performance-auditor.md +0 -1
- package/presets/mavis/svelte/agents/playwright-test-generator.md +0 -1
- package/presets/mavis/svelte/agents/playwright-test-healer.md +0 -1
- package/presets/mavis/svelte/agents/playwright-test-planner.md +0 -1
- package/presets/mavis/svelte/agents/qa-tester.md +3 -3
- package/presets/mavis/svelte/agents/security-reviewer.md +0 -1
- package/presets/mavis/svelte/agents/solution-architect.md +0 -1
- package/presets/mavis/svelte/agents/task-analyst.md +0 -1
- package/presets/mavis/svelte/agents/task-router.md +8 -7
- package/presets/mavis/svelte/agents/tech-writer.md +0 -1
- package/presets/mavis/svelte/agents/unit-test-generator.md +0 -1
- package/presets/mavis/svelte/agents/unit-test-healer.md +0 -1
- package/presets/mavis/svelte/agents/unit-test-planner.md +0 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +21 -5
- package/presets/mavis/svelte/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +5 -5
- package/presets/mavis/svelte/rules/code-quality-and-refactoring.md +2 -6
- package/presets/mavis/svelte/rules/feature-delivery-workflow.md +3 -7
- package/presets/mavis/svelte/rules/post-change-lint.md +13 -13
- package/presets/mavis/svelte/rules/preset-pr-checklist.md +2 -2
- package/presets/mavis/svelte/skills/feature-delivery/SKILL.md +1 -1
- package/presets/mavis/svelte/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/mavis/svelte/skills/unit-testing/SKILL.md +1 -1
- package/presets/opencode/android-kotlin/OPENCODE.md +1 -43
- package/presets/opencode/android-kotlin/REPO_AGENTS.md +7 -47
- package/presets/opencode/android-kotlin/adapter-map.json +1 -1
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +21 -5
- package/presets/opencode/android-kotlin/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +5 -5
- package/presets/opencode/android-kotlin/rules/code-quality-and-refactoring.md +2 -6
- package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +2 -2
- package/presets/opencode/go/OPENCODE.md +7 -39
- package/presets/opencode/go/REPO_AGENTS.md +7 -47
- package/presets/opencode/go/adapter-map.json +1 -1
- package/presets/opencode/go/hooks/chain-team-phases.sh +21 -5
- package/presets/opencode/go/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/go/rules/agent-team-orchestrator.md +5 -5
- package/presets/opencode/go/rules/code-quality-and-refactoring.md +2 -6
- package/presets/opencode/go/rules/feature-delivery-workflow.md +3 -7
- package/presets/opencode/go/rules/preset-pr-checklist.md +2 -2
- package/presets/opencode/ios-swift/OPENCODE.md +1 -43
- package/presets/opencode/ios-swift/REPO_AGENTS.md +7 -47
- package/presets/opencode/ios-swift/adapter-map.json +1 -1
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +21 -5
- package/presets/opencode/ios-swift/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +5 -5
- package/presets/opencode/ios-swift/rules/code-quality-and-refactoring.md +2 -6
- package/presets/opencode/ios-swift/rules/feature-delivery-workflow.md +3 -7
- package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +2 -2
- package/presets/opencode/java/OPENCODE.md +12 -38
- package/presets/opencode/java/REPO_AGENTS.md +7 -47
- package/presets/opencode/java/adapter-map.json +1 -1
- package/presets/opencode/java/hooks/chain-team-phases.sh +21 -5
- package/presets/opencode/java/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/java/rules/agent-team-orchestrator.md +5 -5
- package/presets/opencode/java/rules/code-quality-and-refactoring.md +2 -6
- package/presets/opencode/java/rules/feature-delivery-workflow.md +3 -7
- package/presets/opencode/java/rules/preset-pr-checklist.md +2 -2
- package/presets/opencode/mcp-ts/OPENCODE.md +5 -39
- package/presets/opencode/mcp-ts/REPO_AGENTS.md +7 -47
- package/presets/opencode/mcp-ts/adapter-map.json +1 -1
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +21 -5
- package/presets/opencode/mcp-ts/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +5 -5
- package/presets/opencode/mcp-ts/rules/code-quality-and-refactoring.md +2 -6
- package/presets/opencode/mcp-ts/rules/feature-delivery-workflow.md +3 -7
- package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +2 -2
- package/presets/opencode/mol/OPENCODE.md +1 -44
- package/presets/opencode/mol/REPO_AGENTS.md +9 -49
- package/presets/opencode/mol/adapter-map.json +1 -1
- package/presets/opencode/mol/hooks/chain-team-phases.sh +21 -5
- package/presets/opencode/mol/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/mol/rules/agent-team-orchestrator.md +5 -5
- package/presets/opencode/mol/rules/code-quality-and-refactoring.md +2 -6
- package/presets/opencode/mol/rules/feature-delivery-workflow.md +3 -7
- package/presets/opencode/mol/rules/preset-pr-checklist.md +2 -2
- package/presets/opencode/next/OPENCODE.md +2 -45
- package/presets/opencode/next/REPO_AGENTS.md +10 -50
- package/presets/opencode/next/adapter-map.json +1 -17
- package/presets/opencode/next/agents/accessibility-reviewer.md +0 -1
- package/presets/opencode/next/agents/api-contract-reviewer.md +0 -1
- package/presets/opencode/next/agents/build-verifier.md +12 -8
- package/presets/opencode/next/agents/ci-investigator.md +5 -2
- package/presets/opencode/next/agents/code-reviewer.md +1 -1
- package/presets/opencode/next/agents/codebase-analyzer.md +0 -1
- package/presets/opencode/next/agents/debugger.md +5 -2
- package/presets/opencode/next/agents/feature-developer.md +11 -8
- package/presets/opencode/next/agents/migration-specialist.md +0 -1
- package/presets/opencode/next/agents/mockup-reviewer.md +0 -1
- package/presets/opencode/next/agents/openspec-author.md +0 -1
- package/presets/opencode/next/agents/performance-auditor.md +0 -1
- package/presets/opencode/next/agents/playwright-test-generator.md +0 -1
- package/presets/opencode/next/agents/playwright-test-healer.md +0 -1
- package/presets/opencode/next/agents/playwright-test-planner.md +0 -1
- package/presets/opencode/next/agents/qa-tester.md +3 -3
- package/presets/opencode/next/agents/security-reviewer.md +0 -1
- package/presets/opencode/next/agents/solution-architect.md +0 -1
- package/presets/opencode/next/agents/task-analyst.md +0 -1
- package/presets/opencode/next/agents/task-router.md +8 -7
- package/presets/opencode/next/agents/tech-writer.md +0 -1
- package/presets/opencode/next/agents/unit-test-generator.md +0 -1
- package/presets/opencode/next/agents/unit-test-healer.md +0 -1
- package/presets/opencode/next/agents/unit-test-planner.md +0 -1
- package/presets/opencode/next/commands/README.md +0 -6
- package/presets/opencode/next/hooks/chain-team-phases.sh +21 -5
- package/presets/opencode/next/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/next/rules/agent-team-orchestrator.md +5 -5
- package/presets/opencode/next/rules/code-quality-and-refactoring.md +2 -6
- package/presets/opencode/next/rules/feature-delivery-workflow.md +9 -9
- package/presets/opencode/next/rules/post-change-lint.md +11 -15
- package/presets/opencode/next/rules/preset-pr-checklist.md +2 -2
- package/presets/opencode/next/skills/feature-delivery/SKILL.md +1 -1
- package/presets/opencode/next/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/opencode/next/skills/unit-testing/SKILL.md +1 -1
- package/presets/opencode/nuxt/OPENCODE.md +2 -45
- package/presets/opencode/nuxt/REPO_AGENTS.md +8 -48
- package/presets/opencode/nuxt/adapter-map.json +1 -1
- package/presets/opencode/nuxt/agents/accessibility-reviewer.md +0 -1
- package/presets/opencode/nuxt/agents/api-contract-reviewer.md +0 -1
- package/presets/opencode/nuxt/agents/build-verifier.md +2 -2
- package/presets/opencode/nuxt/agents/ci-investigator.md +1 -1
- package/presets/opencode/nuxt/agents/code-reviewer.md +0 -1
- package/presets/opencode/nuxt/agents/codebase-analyzer.md +0 -1
- package/presets/opencode/nuxt/agents/debugger.md +1 -1
- package/presets/opencode/nuxt/agents/feature-developer.md +3 -3
- package/presets/opencode/nuxt/agents/migration-specialist.md +0 -1
- package/presets/opencode/nuxt/agents/mockup-reviewer.md +0 -1
- package/presets/opencode/nuxt/agents/openspec-author.md +0 -1
- package/presets/opencode/nuxt/agents/performance-auditor.md +0 -1
- package/presets/opencode/nuxt/agents/playwright-test-generator.md +0 -1
- package/presets/opencode/nuxt/agents/playwright-test-healer.md +0 -1
- package/presets/opencode/nuxt/agents/playwright-test-planner.md +0 -1
- package/presets/opencode/nuxt/agents/qa-tester.md +3 -3
- package/presets/opencode/nuxt/agents/security-reviewer.md +0 -1
- package/presets/opencode/nuxt/agents/solution-architect.md +0 -1
- package/presets/opencode/nuxt/agents/task-analyst.md +0 -1
- package/presets/opencode/nuxt/agents/task-router.md +8 -7
- package/presets/opencode/nuxt/agents/tech-writer.md +0 -1
- package/presets/opencode/nuxt/agents/unit-test-generator.md +0 -1
- package/presets/opencode/nuxt/agents/unit-test-healer.md +0 -1
- package/presets/opencode/nuxt/agents/unit-test-planner.md +0 -1
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +21 -5
- package/presets/opencode/nuxt/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +5 -5
- package/presets/opencode/nuxt/rules/code-quality-and-refactoring.md +2 -6
- package/presets/opencode/nuxt/rules/feature-delivery-workflow.md +3 -7
- package/presets/opencode/nuxt/rules/post-change-lint.md +13 -13
- package/presets/opencode/nuxt/rules/preset-pr-checklist.md +2 -2
- package/presets/opencode/nuxt/skills/feature-delivery/SKILL.md +1 -1
- package/presets/opencode/nuxt/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/opencode/nuxt/skills/unit-testing/SKILL.md +1 -1
- package/presets/opencode/php-hexagonal/OPENCODE.md +14 -38
- package/presets/opencode/php-hexagonal/REPO_AGENTS.md +7 -47
- package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +21 -5
- package/presets/opencode/php-hexagonal/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +5 -5
- package/presets/opencode/php-hexagonal/rules/code-quality-and-refactoring.md +2 -6
- package/presets/opencode/php-hexagonal/rules/feature-delivery-workflow.md +3 -7
- package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +2 -2
- package/presets/opencode/php-laravel/OPENCODE.md +14 -38
- package/presets/opencode/php-laravel/REPO_AGENTS.md +7 -47
- package/presets/opencode/php-laravel/adapter-map.json +1 -1
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +21 -5
- package/presets/opencode/php-laravel/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +5 -5
- package/presets/opencode/php-laravel/rules/code-quality-and-refactoring.md +2 -6
- package/presets/opencode/php-laravel/rules/feature-delivery-workflow.md +3 -7
- package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +2 -2
- package/presets/opencode/plugins/output-guard/README.md +43 -0
- package/presets/opencode/plugins/output-guard/index.ts +306 -0
- package/presets/opencode/plugins/output-guard/ledger.ts +43 -0
- package/presets/opencode/plugins/output-guard/package.json +9 -0
- package/presets/opencode/plugins/output-guard/rewrite.ts +149 -0
- package/presets/opencode/plugins/task-status/economy.ts +112 -0
- package/presets/opencode/plugins/task-status/task-view.ts +86 -20
- package/presets/opencode/plugins/task-status/tui.tsx +19 -5
- package/presets/opencode/plugins/task-status/types.ts +3 -1
- package/presets/opencode/svelte/OPENCODE.md +2 -45
- package/presets/opencode/svelte/REPO_AGENTS.md +8 -48
- package/presets/opencode/svelte/adapter-map.json +1 -1
- package/presets/opencode/svelte/agents/accessibility-reviewer.md +0 -1
- package/presets/opencode/svelte/agents/api-contract-reviewer.md +0 -1
- package/presets/opencode/svelte/agents/build-verifier.md +2 -2
- package/presets/opencode/svelte/agents/ci-investigator.md +1 -1
- package/presets/opencode/svelte/agents/code-reviewer.md +0 -1
- package/presets/opencode/svelte/agents/codebase-analyzer.md +0 -1
- package/presets/opencode/svelte/agents/debugger.md +1 -1
- package/presets/opencode/svelte/agents/feature-developer.md +3 -3
- package/presets/opencode/svelte/agents/migration-specialist.md +0 -1
- package/presets/opencode/svelte/agents/mockup-reviewer.md +0 -1
- package/presets/opencode/svelte/agents/openspec-author.md +0 -1
- package/presets/opencode/svelte/agents/performance-auditor.md +0 -1
- package/presets/opencode/svelte/agents/playwright-test-generator.md +0 -1
- package/presets/opencode/svelte/agents/playwright-test-healer.md +0 -1
- package/presets/opencode/svelte/agents/playwright-test-planner.md +0 -1
- package/presets/opencode/svelte/agents/qa-tester.md +3 -3
- package/presets/opencode/svelte/agents/security-reviewer.md +0 -1
- package/presets/opencode/svelte/agents/solution-architect.md +0 -1
- package/presets/opencode/svelte/agents/task-analyst.md +0 -1
- package/presets/opencode/svelte/agents/task-router.md +8 -7
- package/presets/opencode/svelte/agents/tech-writer.md +0 -1
- package/presets/opencode/svelte/agents/unit-test-generator.md +0 -1
- package/presets/opencode/svelte/agents/unit-test-healer.md +0 -1
- package/presets/opencode/svelte/agents/unit-test-planner.md +0 -1
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +21 -5
- package/presets/opencode/svelte/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +5 -5
- package/presets/opencode/svelte/rules/code-quality-and-refactoring.md +2 -6
- package/presets/opencode/svelte/rules/feature-delivery-workflow.md +3 -7
- package/presets/opencode/svelte/rules/post-change-lint.md +13 -13
- package/presets/opencode/svelte/rules/preset-pr-checklist.md +2 -2
- package/presets/opencode/svelte/skills/feature-delivery/SKILL.md +1 -1
- package/presets/opencode/svelte/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/opencode/svelte/skills/unit-testing/SKILL.md +1 -1
- package/presets/zcode/android-kotlin/REPO_AGENTS.md +7 -47
- package/presets/zcode/android-kotlin/adapter-map.json +1 -1
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +21 -5
- package/presets/zcode/android-kotlin/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/android-kotlin/rules/code-quality-and-refactoring.md +2 -6
- package/presets/zcode/android-kotlin/rules/preset-pr-checklist.md +2 -2
- package/presets/zcode/go/REPO_AGENTS.md +7 -47
- package/presets/zcode/go/adapter-map.json +1 -1
- package/presets/zcode/go/hooks/chain-team-phases.sh +21 -5
- package/presets/zcode/go/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/go/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/go/rules/code-quality-and-refactoring.md +2 -6
- package/presets/zcode/go/rules/feature-delivery-workflow.md +3 -7
- package/presets/zcode/go/rules/preset-pr-checklist.md +2 -2
- package/presets/zcode/ios-swift/REPO_AGENTS.md +7 -47
- package/presets/zcode/ios-swift/adapter-map.json +1 -1
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +21 -5
- package/presets/zcode/ios-swift/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/ios-swift/rules/code-quality-and-refactoring.md +2 -6
- package/presets/zcode/ios-swift/rules/feature-delivery-workflow.md +3 -7
- package/presets/zcode/ios-swift/rules/preset-pr-checklist.md +2 -2
- package/presets/zcode/java/REPO_AGENTS.md +7 -47
- package/presets/zcode/java/adapter-map.json +1 -1
- package/presets/zcode/java/hooks/chain-team-phases.sh +21 -5
- package/presets/zcode/java/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/java/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/java/rules/code-quality-and-refactoring.md +2 -6
- package/presets/zcode/java/rules/feature-delivery-workflow.md +3 -7
- package/presets/zcode/java/rules/preset-pr-checklist.md +2 -2
- package/presets/zcode/mcp-ts/REPO_AGENTS.md +7 -47
- package/presets/zcode/mcp-ts/adapter-map.json +1 -1
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +21 -5
- package/presets/zcode/mcp-ts/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/mcp-ts/rules/code-quality-and-refactoring.md +2 -6
- package/presets/zcode/mcp-ts/rules/feature-delivery-workflow.md +3 -7
- package/presets/zcode/mcp-ts/rules/preset-pr-checklist.md +2 -2
- package/presets/zcode/mol/REPO_AGENTS.md +9 -49
- package/presets/zcode/mol/adapter-map.json +1 -1
- package/presets/zcode/mol/hooks/chain-team-phases.sh +21 -5
- package/presets/zcode/mol/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/mol/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/mol/rules/code-quality-and-refactoring.md +2 -6
- package/presets/zcode/mol/rules/feature-delivery-workflow.md +3 -7
- package/presets/zcode/mol/rules/preset-pr-checklist.md +2 -2
- package/presets/zcode/next/REPO_AGENTS.md +10 -50
- package/presets/zcode/next/adapter-map.json +1 -17
- package/presets/zcode/next/agents/accessibility-reviewer.md +0 -1
- package/presets/zcode/next/agents/api-contract-reviewer.md +0 -1
- package/presets/zcode/next/agents/build-verifier.md +12 -8
- package/presets/zcode/next/agents/ci-investigator.md +5 -2
- package/presets/zcode/next/agents/code-reviewer.md +1 -1
- package/presets/zcode/next/agents/codebase-analyzer.md +0 -1
- package/presets/zcode/next/agents/debugger.md +5 -2
- package/presets/zcode/next/agents/feature-developer.md +11 -8
- package/presets/zcode/next/agents/migration-specialist.md +0 -1
- package/presets/zcode/next/agents/mockup-reviewer.md +0 -1
- package/presets/zcode/next/agents/openspec-author.md +0 -1
- package/presets/zcode/next/agents/performance-auditor.md +0 -1
- package/presets/zcode/next/agents/playwright-test-generator.md +0 -1
- package/presets/zcode/next/agents/playwright-test-healer.md +0 -1
- package/presets/zcode/next/agents/playwright-test-planner.md +0 -1
- package/presets/zcode/next/agents/qa-tester.md +3 -3
- package/presets/zcode/next/agents/security-reviewer.md +0 -1
- package/presets/zcode/next/agents/solution-architect.md +0 -1
- package/presets/zcode/next/agents/task-analyst.md +0 -1
- package/presets/zcode/next/agents/task-router.md +8 -7
- package/presets/zcode/next/agents/tech-writer.md +0 -1
- package/presets/zcode/next/agents/unit-test-generator.md +0 -1
- package/presets/zcode/next/agents/unit-test-healer.md +0 -1
- package/presets/zcode/next/agents/unit-test-planner.md +0 -1
- package/presets/zcode/next/commands/README.md +0 -6
- package/presets/zcode/next/hooks/chain-team-phases.sh +21 -5
- package/presets/zcode/next/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/next/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/next/rules/code-quality-and-refactoring.md +2 -6
- package/presets/zcode/next/rules/feature-delivery-workflow.md +9 -9
- package/presets/zcode/next/rules/post-change-lint.md +11 -15
- package/presets/zcode/next/rules/preset-pr-checklist.md +2 -2
- package/presets/zcode/next/skills/feature-delivery/SKILL.md +1 -1
- package/presets/zcode/next/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/zcode/next/skills/unit-testing/SKILL.md +1 -1
- package/presets/zcode/nuxt/REPO_AGENTS.md +8 -48
- package/presets/zcode/nuxt/adapter-map.json +1 -1
- package/presets/zcode/nuxt/agents/accessibility-reviewer.md +0 -1
- package/presets/zcode/nuxt/agents/api-contract-reviewer.md +0 -1
- package/presets/zcode/nuxt/agents/build-verifier.md +2 -2
- package/presets/zcode/nuxt/agents/ci-investigator.md +1 -1
- package/presets/zcode/nuxt/agents/code-reviewer.md +0 -1
- package/presets/zcode/nuxt/agents/codebase-analyzer.md +0 -1
- package/presets/zcode/nuxt/agents/debugger.md +1 -1
- package/presets/zcode/nuxt/agents/feature-developer.md +3 -3
- package/presets/zcode/nuxt/agents/migration-specialist.md +0 -1
- package/presets/zcode/nuxt/agents/mockup-reviewer.md +0 -1
- package/presets/zcode/nuxt/agents/openspec-author.md +0 -1
- package/presets/zcode/nuxt/agents/performance-auditor.md +0 -1
- package/presets/zcode/nuxt/agents/playwright-test-generator.md +0 -1
- package/presets/zcode/nuxt/agents/playwright-test-healer.md +0 -1
- package/presets/zcode/nuxt/agents/playwright-test-planner.md +0 -1
- package/presets/zcode/nuxt/agents/qa-tester.md +3 -3
- package/presets/zcode/nuxt/agents/security-reviewer.md +0 -1
- package/presets/zcode/nuxt/agents/solution-architect.md +0 -1
- package/presets/zcode/nuxt/agents/task-analyst.md +0 -1
- package/presets/zcode/nuxt/agents/task-router.md +8 -7
- package/presets/zcode/nuxt/agents/tech-writer.md +0 -1
- package/presets/zcode/nuxt/agents/unit-test-generator.md +0 -1
- package/presets/zcode/nuxt/agents/unit-test-healer.md +0 -1
- package/presets/zcode/nuxt/agents/unit-test-planner.md +0 -1
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +21 -5
- package/presets/zcode/nuxt/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/nuxt/rules/code-quality-and-refactoring.md +2 -6
- package/presets/zcode/nuxt/rules/feature-delivery-workflow.md +3 -7
- package/presets/zcode/nuxt/rules/post-change-lint.md +13 -13
- package/presets/zcode/nuxt/rules/preset-pr-checklist.md +2 -2
- package/presets/zcode/nuxt/skills/feature-delivery/SKILL.md +1 -1
- package/presets/zcode/nuxt/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/zcode/nuxt/skills/unit-testing/SKILL.md +1 -1
- package/presets/zcode/php-hexagonal/REPO_AGENTS.md +7 -47
- package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +21 -5
- package/presets/zcode/php-hexagonal/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/php-hexagonal/rules/code-quality-and-refactoring.md +2 -6
- package/presets/zcode/php-hexagonal/rules/feature-delivery-workflow.md +3 -7
- package/presets/zcode/php-hexagonal/rules/preset-pr-checklist.md +2 -2
- package/presets/zcode/php-laravel/REPO_AGENTS.md +7 -47
- package/presets/zcode/php-laravel/adapter-map.json +1 -1
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +21 -5
- package/presets/zcode/php-laravel/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/php-laravel/rules/code-quality-and-refactoring.md +2 -6
- package/presets/zcode/php-laravel/rules/feature-delivery-workflow.md +3 -7
- package/presets/zcode/php-laravel/rules/preset-pr-checklist.md +2 -2
- package/presets/zcode/svelte/REPO_AGENTS.md +8 -48
- package/presets/zcode/svelte/adapter-map.json +1 -1
- package/presets/zcode/svelte/agents/accessibility-reviewer.md +0 -1
- package/presets/zcode/svelte/agents/api-contract-reviewer.md +0 -1
- package/presets/zcode/svelte/agents/build-verifier.md +2 -2
- package/presets/zcode/svelte/agents/ci-investigator.md +1 -1
- package/presets/zcode/svelte/agents/code-reviewer.md +0 -1
- package/presets/zcode/svelte/agents/codebase-analyzer.md +0 -1
- package/presets/zcode/svelte/agents/debugger.md +1 -1
- package/presets/zcode/svelte/agents/feature-developer.md +3 -3
- package/presets/zcode/svelte/agents/migration-specialist.md +0 -1
- package/presets/zcode/svelte/agents/mockup-reviewer.md +0 -1
- package/presets/zcode/svelte/agents/openspec-author.md +0 -1
- package/presets/zcode/svelte/agents/performance-auditor.md +0 -1
- package/presets/zcode/svelte/agents/playwright-test-generator.md +0 -1
- package/presets/zcode/svelte/agents/playwright-test-healer.md +0 -1
- package/presets/zcode/svelte/agents/playwright-test-planner.md +0 -1
- package/presets/zcode/svelte/agents/qa-tester.md +3 -3
- package/presets/zcode/svelte/agents/security-reviewer.md +0 -1
- package/presets/zcode/svelte/agents/solution-architect.md +0 -1
- package/presets/zcode/svelte/agents/task-analyst.md +0 -1
- package/presets/zcode/svelte/agents/task-router.md +8 -7
- package/presets/zcode/svelte/agents/tech-writer.md +0 -1
- package/presets/zcode/svelte/agents/unit-test-generator.md +0 -1
- package/presets/zcode/svelte/agents/unit-test-healer.md +0 -1
- package/presets/zcode/svelte/agents/unit-test-planner.md +0 -1
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +21 -5
- package/presets/zcode/svelte/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +5 -5
- package/presets/zcode/svelte/rules/code-quality-and-refactoring.md +2 -6
- package/presets/zcode/svelte/rules/feature-delivery-workflow.md +3 -7
- package/presets/zcode/svelte/rules/post-change-lint.md +13 -13
- package/presets/zcode/svelte/rules/preset-pr-checklist.md +2 -2
- package/presets/zcode/svelte/skills/feature-delivery/SKILL.md +1 -1
- package/presets/zcode/svelte/skills/playwright-e2e/SKILL.md +1 -1
- package/presets/zcode/svelte/skills/unit-testing/SKILL.md +1 -1
- package/scripts/report-context-cost.mjs +432 -0
- package/presets/_shared/ai-local/scripts/team-db-dashboard.mjs +0 -2103
- package/presets/_shared/ai-local/scripts/team-db-ui.mjs +0 -750
- package/presets/claude/next/commands/ui-start.md +0 -78
- package/presets/claude/next/commands/ui-stop.md +0 -71
- package/presets/cursor/next/commands/ui-start.md +0 -78
- package/presets/cursor/next/commands/ui-stop.md +0 -71
- package/presets/mavis/next/commands/ui-start.md +0 -73
- package/presets/mavis/next/commands/ui-stop.md +0 -66
- package/presets/opencode/next/commands/ui-start.md +0 -81
- package/presets/opencode/next/commands/ui-stop.md +0 -74
- package/presets/zcode/next/commands/ui-start.md +0 -81
- package/presets/zcode/next/commands/ui-stop.md +0 -74
|
@@ -582,6 +582,135 @@ CREATE INDEX idx_tracker_item_tasks_task ON tracker_item_tasks(task_slug);
|
|
|
582
582
|
CREATE INDEX idx_tracker_item_tasks_decision ON tracker_item_tasks(decision);
|
|
583
583
|
`;
|
|
584
584
|
|
|
585
|
+
export const EFFICIENCY_SQL = SQL`-- Extend the source grain (D4). Every column is nullable: no usage is the normal state.
|
|
586
|
+
ALTER TABLE attempts ADD COLUMN input_tokens INTEGER;
|
|
587
|
+
ALTER TABLE attempts ADD COLUMN output_tokens INTEGER;
|
|
588
|
+
ALTER TABLE attempts ADD COLUMN reasoning_tokens INTEGER;
|
|
589
|
+
ALTER TABLE attempts ADD COLUMN cache_read_tokens INTEGER;
|
|
590
|
+
ALTER TABLE attempts ADD COLUMN cache_write_tokens INTEGER;
|
|
591
|
+
ALTER TABLE attempts ADD COLUMN cost_usd REAL;
|
|
592
|
+
ALTER TABLE attempts ADD COLUMN usage_origin TEXT; -- measured | estimated
|
|
593
|
+
ALTER TABLE attempts ADD COLUMN usage_source TEXT; -- host | cli
|
|
594
|
+
ALTER TABLE attempts ADD COLUMN usage_turn_count INTEGER;
|
|
595
|
+
ALTER TABLE attempts ADD COLUMN model_provider TEXT;
|
|
596
|
+
ALTER TABLE attempts ADD COLUMN model_id TEXT;
|
|
597
|
+
|
|
598
|
+
ALTER TABLE gates ADD COLUMN outcome TEXT; -- derived
|
|
599
|
+
ALTER TABLE gates ADD COLUMN outcome_derived INTEGER NOT NULL DEFAULT 1;
|
|
600
|
+
|
|
601
|
+
CREATE TABLE tool_calls (
|
|
602
|
+
call_key TEXT PRIMARY KEY,
|
|
603
|
+
session_id TEXT NOT NULL,
|
|
604
|
+
call_id TEXT NOT NULL,
|
|
605
|
+
tool TEXT NOT NULL,
|
|
606
|
+
category TEXT NOT NULL,
|
|
607
|
+
raw_bytes INTEGER NOT NULL,
|
|
608
|
+
returned_bytes INTEGER NOT NULL,
|
|
609
|
+
kept_out_bytes INTEGER NOT NULL,
|
|
610
|
+
replaced INTEGER NOT NULL,
|
|
611
|
+
origin TEXT NOT NULL DEFAULT 'measured',
|
|
612
|
+
observed_at TEXT NOT NULL,
|
|
613
|
+
day TEXT NOT NULL,
|
|
614
|
+
task_slug TEXT,
|
|
615
|
+
attribution TEXT NOT NULL DEFAULT 'unmapped'
|
|
616
|
+
) STRICT;
|
|
617
|
+
|
|
618
|
+
CREATE INDEX idx_tool_calls_day ON tool_calls(day);
|
|
619
|
+
CREATE INDEX idx_tool_calls_tool_day ON tool_calls(tool, day);
|
|
620
|
+
CREATE INDEX idx_tool_calls_task_day ON tool_calls(task_slug, day);
|
|
621
|
+
CREATE INDEX idx_tool_calls_raw ON tool_calls(raw_bytes DESC);
|
|
622
|
+
|
|
623
|
+
CREATE TABLE usage_turns (
|
|
624
|
+
turn_key TEXT PRIMARY KEY,
|
|
625
|
+
session_id TEXT NOT NULL,
|
|
626
|
+
message_id TEXT NOT NULL,
|
|
627
|
+
agent TEXT,
|
|
628
|
+
provider_id TEXT,
|
|
629
|
+
model_id TEXT,
|
|
630
|
+
model_variant TEXT,
|
|
631
|
+
input_tokens INTEGER NOT NULL,
|
|
632
|
+
output_tokens INTEGER NOT NULL,
|
|
633
|
+
reasoning_tokens INTEGER NOT NULL,
|
|
634
|
+
cache_read_tokens INTEGER NOT NULL,
|
|
635
|
+
cache_write_tokens INTEGER NOT NULL,
|
|
636
|
+
cost_usd REAL NOT NULL,
|
|
637
|
+
finish TEXT,
|
|
638
|
+
origin TEXT NOT NULL DEFAULT 'measured',
|
|
639
|
+
observed_at TEXT NOT NULL,
|
|
640
|
+
event_at TEXT,
|
|
641
|
+
day TEXT NOT NULL,
|
|
642
|
+
task_slug TEXT,
|
|
643
|
+
attribution TEXT NOT NULL DEFAULT 'unmapped'
|
|
644
|
+
) STRICT;
|
|
645
|
+
|
|
646
|
+
CREATE INDEX idx_usage_turns_day ON usage_turns(day);
|
|
647
|
+
CREATE INDEX idx_usage_turns_task_day ON usage_turns(task_slug, day);
|
|
648
|
+
CREATE INDEX idx_usage_turns_session ON usage_turns(session_id);
|
|
649
|
+
|
|
650
|
+
CREATE TABLE session_tasks (
|
|
651
|
+
session_id TEXT NOT NULL,
|
|
652
|
+
task_slug TEXT NOT NULL,
|
|
653
|
+
first_seen_at TEXT NOT NULL,
|
|
654
|
+
last_seen_at TEXT NOT NULL,
|
|
655
|
+
PRIMARY KEY (session_id, task_slug)
|
|
656
|
+
) STRICT;
|
|
657
|
+
|
|
658
|
+
CREATE TABLE telemetry_sources (
|
|
659
|
+
source_path TEXT PRIMARY KEY,
|
|
660
|
+
kind TEXT NOT NULL, -- results | usage | ab | context-cost
|
|
661
|
+
size_bytes INTEGER NOT NULL,
|
|
662
|
+
mtime_ms INTEGER NOT NULL,
|
|
663
|
+
last_key TEXT,
|
|
664
|
+
rows INTEGER NOT NULL DEFAULT 0,
|
|
665
|
+
ingested_at TEXT NOT NULL
|
|
666
|
+
) STRICT;
|
|
667
|
+
|
|
668
|
+
CREATE TABLE efficiency_runs (
|
|
669
|
+
run_key TEXT PRIMARY KEY,
|
|
670
|
+
generated_at TEXT NOT NULL,
|
|
671
|
+
model TEXT NOT NULL,
|
|
672
|
+
runs_per_cell INTEGER NOT NULL,
|
|
673
|
+
threshold_bytes INTEGER NOT NULL,
|
|
674
|
+
schema_version INTEGER NOT NULL,
|
|
675
|
+
decision TEXT NOT NULL,
|
|
676
|
+
reason TEXT,
|
|
677
|
+
quality_passed INTEGER NOT NULL,
|
|
678
|
+
quality_total INTEGER NOT NULL,
|
|
679
|
+
quality_rate REAL NOT NULL,
|
|
680
|
+
task_count INTEGER NOT NULL,
|
|
681
|
+
tokens_off REAL, tokens_on REAL,
|
|
682
|
+
cost_off REAL, cost_on REAL,
|
|
683
|
+
bytes_off REAL, bytes_on REAL,
|
|
684
|
+
tokens_delta_pct REAL, cost_delta_pct REAL
|
|
685
|
+
) STRICT;
|
|
686
|
+
|
|
687
|
+
CREATE INDEX idx_efficiency_runs_generated ON efficiency_runs(generated_at);
|
|
688
|
+
|
|
689
|
+
CREATE TABLE efficiency_run_cells (
|
|
690
|
+
run_key TEXT NOT NULL REFERENCES efficiency_runs(run_key) ON DELETE CASCADE,
|
|
691
|
+
task_id TEXT NOT NULL,
|
|
692
|
+
arm TEXT NOT NULL, -- off | on
|
|
693
|
+
median_tokens REAL NOT NULL,
|
|
694
|
+
median_cost_usd REAL NOT NULL,
|
|
695
|
+
median_raw_bytes REAL NOT NULL,
|
|
696
|
+
median_returned_bytes REAL NOT NULL,
|
|
697
|
+
median_turns REAL NOT NULL,
|
|
698
|
+
passed INTEGER NOT NULL,
|
|
699
|
+
total INTEGER NOT NULL,
|
|
700
|
+
PRIMARY KEY (run_key, task_id, arm)
|
|
701
|
+
) STRICT;
|
|
702
|
+
|
|
703
|
+
CREATE TABLE context_cost_hosts (
|
|
704
|
+
snapshot_at TEXT NOT NULL,
|
|
705
|
+
host TEXT NOT NULL,
|
|
706
|
+
rule TEXT,
|
|
707
|
+
always_on_files INTEGER NOT NULL,
|
|
708
|
+
always_on_bytes INTEGER NOT NULL,
|
|
709
|
+
estimated_tokens INTEGER NOT NULL,
|
|
710
|
+
PRIMARY KEY (snapshot_at, host)
|
|
711
|
+
) STRICT;
|
|
712
|
+
`;
|
|
713
|
+
|
|
585
714
|
const sha256 = (value) => crypto.createHash('sha256').update(value).digest('hex');
|
|
586
715
|
|
|
587
716
|
/**
|
|
@@ -613,6 +742,12 @@ export const MIGRATIONS = [
|
|
|
613
742
|
sql: TRACKER_SQL,
|
|
614
743
|
checksum: '641f18c269a1595d1fb1e4878f9919e9d41a257d030cf1f65ee07fb99ac55552',
|
|
615
744
|
},
|
|
745
|
+
{
|
|
746
|
+
version: 5,
|
|
747
|
+
name: '0005-efficiency',
|
|
748
|
+
sql: EFFICIENCY_SQL,
|
|
749
|
+
checksum: '7ae3d8509a88c77bc0ed225601b83d9a0a26748551b3e420167ea6d038ec14b1',
|
|
750
|
+
},
|
|
616
751
|
];
|
|
617
752
|
|
|
618
753
|
/** Highest migration version shipped by this module. */
|
|
@@ -222,7 +222,7 @@ const isStaleRun = (run) => {
|
|
|
222
222
|
if (!Number.isFinite(age)) return true;
|
|
223
223
|
if (run.pid === null || run.pid === undefined) return age > CLAIMED_GRACE_MS;
|
|
224
224
|
if (!pidIsAlive(run.pid)) return true;
|
|
225
|
-
return run.state === 'running' && !ownedRunProcess(run
|
|
225
|
+
return run.state === 'running' && !ownedRunProcess(run);
|
|
226
226
|
};
|
|
227
227
|
|
|
228
228
|
/** Mark abandoned manifests as interrupted before a new start or a stop. */
|
|
@@ -242,12 +242,17 @@ export function activeTaskRun(teamRoot, taskSlug) {
|
|
|
242
242
|
return listTaskRuns(teamRoot, taskSlug).find((run) => ACTIVE_RUN_STATES.includes(run.state) && !isStaleRun(run)) ?? null;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
const ownedRunProcess = (
|
|
246
|
-
|
|
245
|
+
const ownedRunProcess = (run) => {
|
|
246
|
+
const pid = run.pid;
|
|
247
|
+
if (!Number.isInteger(pid) || !pidIsAlive(pid)) return false;
|
|
247
248
|
const result = spawnSync('ps', ['-p', String(pid), '-o', 'command='], { encoding: 'utf8' });
|
|
248
249
|
if (result.status !== 0) return false;
|
|
249
250
|
const command = result.stdout.trim();
|
|
250
|
-
|
|
251
|
+
// The manifest records the detached runner's pid (the group stop targets it),
|
|
252
|
+
// so its own argv is the primary ownership proof; the supervisor stays accepted.
|
|
253
|
+
const recorded = Array.isArray(run.argv) ? run.argv.join(' ').trim() : '';
|
|
254
|
+
if (recorded !== '' && command === recorded) return true;
|
|
255
|
+
return /team-db\.mjs\s+task-run\s+supervise\b/.test(command) && command.includes(run.taskSlug);
|
|
251
256
|
};
|
|
252
257
|
|
|
253
258
|
const linkLanguage = (teamRoot, linkId) => {
|
|
@@ -457,7 +462,7 @@ export function stopTaskRun(teamRoot, taskSlug) {
|
|
|
457
462
|
reject('E_VALIDATION', 'taskSlug must match the slug grammar');
|
|
458
463
|
}
|
|
459
464
|
const rawActive = listTaskRuns(teamRoot, taskSlug).find((run) => ACTIVE_RUN_STATES.includes(run.state));
|
|
460
|
-
if (rawActive && typeof rawActive.pid === 'number' && pidIsAlive(rawActive.pid) && !ownedRunProcess(rawActive
|
|
465
|
+
if (rawActive && typeof rawActive.pid === 'number' && pidIsAlive(rawActive.pid) && !ownedRunProcess(rawActive)) {
|
|
461
466
|
return {
|
|
462
467
|
ok: false,
|
|
463
468
|
code: 'E_RUNNER_PID_MISMATCH',
|
|
@@ -483,7 +488,7 @@ export function stopTaskRun(teamRoot, taskSlug) {
|
|
|
483
488
|
});
|
|
484
489
|
return { ok: true, stopped: true, sentinel: true, runId: active.runId };
|
|
485
490
|
}
|
|
486
|
-
if (!ownedRunProcess(active
|
|
491
|
+
if (!ownedRunProcess(active)) {
|
|
487
492
|
return {
|
|
488
493
|
ok: false,
|
|
489
494
|
code: 'E_RUNNER_PID_MISMATCH',
|
|
@@ -1953,6 +1953,8 @@ export function runTrackerCommand(subcommand, positionalId, options = {}) {
|
|
|
1953
1953
|
status: annotated.item.status,
|
|
1954
1954
|
effectiveStatus: annotated.effectiveStatus,
|
|
1955
1955
|
priority: annotated.item.priority,
|
|
1956
|
+
labels: annotated.item.labels,
|
|
1957
|
+
sourceRefs: annotated.item.sourceRefs,
|
|
1956
1958
|
ready: annotated.ready,
|
|
1957
1959
|
waitingOn: annotated.waitingOn,
|
|
1958
1960
|
createdAt: annotated.item.createdAt,
|
|
@@ -8,16 +8,14 @@
|
|
|
8
8
|
* query the projection, read-only
|
|
9
9
|
* sync [--root <team-dir>] [--slug <slug>] [--quiet] [--json]
|
|
10
10
|
* [--maintain] [--prune] [--vacuum] [--rebuild | --no-rebuild]
|
|
11
|
-
* [--deadline-ms <n>]
|
|
11
|
+
* [--telemetry | --no-telemetry] [--deadline-ms <n>]
|
|
12
|
+
* project files into the database
|
|
12
13
|
* delete --slug <slug> [--root <team-dir>] [--json]
|
|
13
14
|
* delete one task folder, then its rows
|
|
14
15
|
* migrate-tasks [--root <team-dir>] [--quiet] [--json]
|
|
15
16
|
* [--rebuild | --no-rebuild] create or reconcile the database
|
|
16
17
|
* serve [--root <team-dir>] [--host <addr>] [--port <n>] [--allow-remote]
|
|
17
|
-
*
|
|
18
|
-
* ui start|restart [--host <loopback>] [--port <n>] [--open] [--json]
|
|
19
|
-
* [--quiet] [--root <team-dir>] detached dashboard + marker
|
|
20
|
-
* ui stop|status [--json] [--quiet] [--root <team-dir>]
|
|
18
|
+
* loopback API
|
|
21
19
|
* jobs list [--root <team-dir>] [--enabled] [--json] [--quiet]
|
|
22
20
|
* jobs get <id> [--root <team-dir>] [--json]
|
|
23
21
|
* jobs put --file <path|-> [--root <team-dir>] [--json] [--dry-run] [--quiet]
|
|
@@ -33,8 +31,6 @@
|
|
|
33
31
|
* Exit codes: 0 ok, 1 at least one task failed, a delete refusal (unknown slug,
|
|
34
32
|
* active-task guard, kill switch, folder-delete failure) or a migration
|
|
35
33
|
* checksum drifted, 2 database-level failure, 3 usage, 4 deadline or busy.
|
|
36
|
-
* The `ui` verbs reuse 0/1/2/3: 0 ok or a no-op, 1 a refusal (`E_UI_*` except a
|
|
37
|
-
* start failure), 2 a start failure, 3 usage.
|
|
38
34
|
* The tracker verbs reuse the same vocabulary: 0 ok, 1 a validation refusal
|
|
39
35
|
* (each with its named `E_TRACKER_*`/`E_SCHEMA`/`E_ID_COLLISION` code), 3
|
|
40
36
|
* usage, 4 the tree lock was contended (`E_TRACKER_BUSY`).
|
|
@@ -53,8 +49,6 @@ import fs from 'node:fs';
|
|
|
53
49
|
import path from 'node:path';
|
|
54
50
|
import { fileURLToPath } from 'node:url';
|
|
55
51
|
|
|
56
|
-
import { spawn } from 'node:child_process';
|
|
57
|
-
|
|
58
52
|
import {
|
|
59
53
|
DB_FILE,
|
|
60
54
|
DEFAULT_TEAM_ROOT,
|
|
@@ -83,15 +77,12 @@ const USAGE = `usage:
|
|
|
83
77
|
team-db.mjs search <query> [--limit <n>] [--json] [--root <team-dir>]
|
|
84
78
|
team-db.mjs sync [--root <team-dir>] [--slug <slug>] [--quiet] [--json]
|
|
85
79
|
[--maintain] [--prune] [--vacuum] [--rebuild | --no-rebuild]
|
|
86
|
-
[--deadline-ms <n>]
|
|
80
|
+
[--telemetry | --no-telemetry] [--deadline-ms <n>]
|
|
87
81
|
team-db.mjs delete --slug <slug> [--root <team-dir>] [--json]
|
|
88
82
|
team-db.mjs migrate-tasks [--root <team-dir>] [--quiet] [--json]
|
|
89
83
|
[--rebuild | --no-rebuild]
|
|
90
84
|
team-db.mjs serve [--root <team-dir>] [--host <addr>] [--port <n>]
|
|
91
|
-
[--allow-remote]
|
|
92
|
-
team-db.mjs ui start|restart [--root <team-dir>] [--json] [--quiet]
|
|
93
|
-
[--host <loopback>] [--port <n>] [--open]
|
|
94
|
-
team-db.mjs ui stop|status [--root <team-dir>] [--json] [--quiet]
|
|
85
|
+
[--allow-remote]
|
|
95
86
|
team-db.mjs jobs list [--root <team-dir>] [--enabled] [--json] [--quiet]
|
|
96
87
|
team-db.mjs jobs get <id> [--root <team-dir>] [--json]
|
|
97
88
|
team-db.mjs jobs put --file <path|-> [--root <team-dir>] [--json] [--dry-run] [--quiet]
|
|
@@ -142,8 +133,9 @@ const BOOLEAN_FLAGS = new Set([
|
|
|
142
133
|
'vacuum',
|
|
143
134
|
'rebuild',
|
|
144
135
|
'no-rebuild',
|
|
136
|
+
'telemetry',
|
|
137
|
+
'no-telemetry',
|
|
145
138
|
'allow-remote',
|
|
146
|
-
'open',
|
|
147
139
|
'enabled',
|
|
148
140
|
'dry-run',
|
|
149
141
|
'keep-runs',
|
|
@@ -151,22 +143,19 @@ const BOOLEAN_FLAGS = new Set([
|
|
|
151
143
|
'ready',
|
|
152
144
|
'claim',
|
|
153
145
|
]);
|
|
154
|
-
const COMMANDS = new Set(['init', 'check', 'search', 'sync', 'delete', 'migrate-tasks', 'serve', 'jobs', 'schedule', 'tracker', 'task-run'
|
|
146
|
+
const COMMANDS = new Set(['init', 'check', 'search', 'sync', 'delete', 'migrate-tasks', 'serve', 'jobs', 'schedule', 'tracker', 'task-run']);
|
|
155
147
|
const ALLOWED_FLAGS = {
|
|
156
148
|
init: new Set(['root', 'rebuild']),
|
|
157
149
|
check: new Set(['root']),
|
|
158
150
|
search: new Set(['root', 'limit', 'json']),
|
|
159
|
-
sync: new Set(['root', 'slug', 'quiet', 'json', 'maintain', 'prune', 'vacuum', 'rebuild', 'no-rebuild', 'deadline-ms']),
|
|
151
|
+
sync: new Set(['root', 'slug', 'quiet', 'json', 'maintain', 'prune', 'vacuum', 'rebuild', 'no-rebuild', 'telemetry', 'no-telemetry', 'deadline-ms']),
|
|
160
152
|
delete: new Set(['root', 'slug', 'json']),
|
|
161
153
|
'migrate-tasks': new Set(['root', 'quiet', 'json', 'rebuild', 'no-rebuild']),
|
|
162
|
-
serve: new Set(['root', 'host', 'port', 'allow-remote'
|
|
154
|
+
serve: new Set(['root', 'host', 'port', 'allow-remote']),
|
|
163
155
|
jobs: new Set(['root', 'json', 'quiet', 'enabled', 'file', 'id', 'dry-run', 'keep-runs']),
|
|
164
156
|
schedule: new Set(['root', 'json', 'quiet', 'once', 'interval-ms', 'grace-ms', 'drain-ms']),
|
|
165
157
|
tracker: new Set(['root', 'json', 'quiet', 'file', 'dry-run', 'older-than', 'status', 'ready', 'claim']),
|
|
166
158
|
'task-run': new Set(['root', 'json', 'task', 'item', 'link', 'run']),
|
|
167
|
-
// The union across the four verbs: `team-db-ui.mjs` owns the per-verb reach
|
|
168
|
-
// table, and `--allow-remote` is absent so it never parses for a `ui` verb.
|
|
169
|
-
ui: new Set(['root', 'json', 'quiet', 'host', 'port', 'open']),
|
|
170
159
|
};
|
|
171
160
|
|
|
172
161
|
const JOBS_POSITIONALS = new Set([
|
|
@@ -201,13 +190,10 @@ const TRACKER_POSITIONALS = new Set([
|
|
|
201
190
|
|
|
202
191
|
const TASK_RUN_POSITIONALS = new Set(['start', 'stop', 'supervise', 'list', 'show', 'status', 'ensure']);
|
|
203
192
|
|
|
204
|
-
const UI_POSITIONALS = new Set(['start', 'stop', 'status', 'restart']);
|
|
205
|
-
|
|
206
193
|
const POSITIONAL_VERBS = {
|
|
207
194
|
jobs: JOBS_POSITIONALS,
|
|
208
195
|
tracker: TRACKER_POSITIONALS,
|
|
209
196
|
'task-run': TASK_RUN_POSITIONALS,
|
|
210
|
-
ui: UI_POSITIONALS,
|
|
211
197
|
};
|
|
212
198
|
|
|
213
199
|
const parseArgs = (argv) => {
|
|
@@ -228,8 +214,8 @@ const parseArgs = (argv) => {
|
|
|
228
214
|
positionals.push(token);
|
|
229
215
|
continue;
|
|
230
216
|
}
|
|
231
|
-
// `jobs <verb> [id]`, `tracker <verb> [id|entryId]` and `
|
|
232
|
-
// only commands with positional arguments.
|
|
217
|
+
// `jobs <verb> [id]`, `tracker <verb> [id|entryId]` and `task-run <verb>`
|
|
218
|
+
// are the only commands with positional arguments.
|
|
233
219
|
const verbs = POSITIONAL_VERBS[command];
|
|
234
220
|
if (verbs && positionals.length < 2) {
|
|
235
221
|
if (positionals.length === 0 && !verbs.has(token)) {
|
|
@@ -395,6 +381,7 @@ const runSync = (flags) => {
|
|
|
395
381
|
vacuum: Boolean(flags.vacuum),
|
|
396
382
|
rebuild: Boolean(flags.rebuild),
|
|
397
383
|
noRebuild: Boolean(flags['no-rebuild']),
|
|
384
|
+
telemetry: flags.telemetry ? true : flags['no-telemetry'] ? false : undefined,
|
|
398
385
|
deadlineMs: flags['deadline-ms'],
|
|
399
386
|
});
|
|
400
387
|
} catch (error) {
|
|
@@ -599,21 +586,6 @@ const runSchedule = async (flags) => {
|
|
|
599
586
|
}
|
|
600
587
|
};
|
|
601
588
|
|
|
602
|
-
const openDashboard = (url) => {
|
|
603
|
-
try {
|
|
604
|
-
const command = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'explorer' : 'xdg-open';
|
|
605
|
-
const child = spawn(command, [url], { detached: true, stdio: 'ignore' });
|
|
606
|
-
// A missing opener is reported on the child, not thrown by spawn: without
|
|
607
|
-
// this listener an unhandled `error` kills the whole server (F-7).
|
|
608
|
-
child.on('error', (error) => {
|
|
609
|
-
process.stderr.write(`team-db: could not open ${url} (${error.code ?? error.message}); open it manually\n`);
|
|
610
|
-
});
|
|
611
|
-
child.unref();
|
|
612
|
-
} catch {
|
|
613
|
-
/* opening a browser is a convenience, never a failure */
|
|
614
|
-
}
|
|
615
|
-
};
|
|
616
|
-
|
|
617
589
|
const runServe = async (flags) => {
|
|
618
590
|
if (isKillSwitchSet(process.env)) {
|
|
619
591
|
disabledLine();
|
|
@@ -623,13 +595,12 @@ const runServe = async (flags) => {
|
|
|
623
595
|
unavailableLine();
|
|
624
596
|
return 0;
|
|
625
597
|
}
|
|
626
|
-
//
|
|
627
|
-
//
|
|
628
|
-
// EPIPE error event.
|
|
598
|
+
// A detached caller closes both pipes right after the serving line; a later
|
|
599
|
+
// diagnostic write must not crash the server with an EPIPE error event.
|
|
629
600
|
process.stdout.on('error', () => {});
|
|
630
601
|
process.stderr.on('error', () => {});
|
|
631
602
|
// Loaded here, not at module scope: `init`, `sync` and `check` must not pay
|
|
632
|
-
// for the server
|
|
603
|
+
// for the server or the OpenAPI document.
|
|
633
604
|
const api = await import('./team-db-api.mjs');
|
|
634
605
|
const host = typeof flags.host === 'string' ? flags.host.trim() : api.DEFAULT_HOST;
|
|
635
606
|
const allowRemote = Boolean(flags['allow-remote']);
|
|
@@ -647,7 +618,6 @@ const runServe = async (flags) => {
|
|
|
647
618
|
if (!api.LOOPBACK_HOSTS.includes(info.host)) {
|
|
648
619
|
process.stderr.write(`WARNING: team-db is bound to ${info.host}:${info.port}, not loopback\n`);
|
|
649
620
|
}
|
|
650
|
-
if (flags.open) openDashboard(info.url);
|
|
651
621
|
const shutdown = () => {
|
|
652
622
|
info.close().then(() => process.exit(0));
|
|
653
623
|
};
|
|
@@ -656,13 +626,6 @@ const runServe = async (flags) => {
|
|
|
656
626
|
return new Promise(() => {});
|
|
657
627
|
};
|
|
658
628
|
|
|
659
|
-
const runUi = async (flags, positionals) => {
|
|
660
|
-
// Loaded here, not at module scope: `init`, `sync` and `check` never load the
|
|
661
|
-
// supervisor or the server it probes.
|
|
662
|
-
const { runUiCommand } = await import('./team-db-ui.mjs');
|
|
663
|
-
return runUiCommand({ flags, positionals });
|
|
664
|
-
};
|
|
665
|
-
|
|
666
629
|
export async function runCli(argv) {
|
|
667
630
|
const { command, flags, positionals } = parseArgs(argv);
|
|
668
631
|
if (command === 'help') {
|
|
@@ -678,7 +641,6 @@ export async function runCli(argv) {
|
|
|
678
641
|
if (command === 'jobs') return runJobs(flags, positionals);
|
|
679
642
|
if (command === 'tracker') return runTracker(flags, positionals);
|
|
680
643
|
if (command === 'task-run') return runTaskRunner(flags, positionals);
|
|
681
|
-
if (command === 'ui') return runUi(flags, positionals);
|
|
682
644
|
if (command === 'schedule') return runSchedule(flags);
|
|
683
645
|
return runSync(flags);
|
|
684
646
|
}
|
|
@@ -195,8 +195,8 @@ Additional states: `blocked` — a step (or a parallel producer) cannot proceed;
|
|
|
195
195
|
| `in_progress` | Current step running |
|
|
196
196
|
| `completed` | Current step done; hook advances |
|
|
197
197
|
| `awaiting_approval` | Human gate; wait for `/task-continue` |
|
|
198
|
-
| `changes_requested` | Reviewer blocked; re-run developer
|
|
199
|
-
| `validation_failed` | build-verifier failed; re-run developer then build-verifier |
|
|
198
|
+
| `changes_requested` | Reviewer blocked; re-run developer → `build-verifier` (delta) → same reviewer when the fix touches code/tests; docs/artifacts only → same reviewer |
|
|
199
|
+
| `validation_failed` | build-verifier failed; re-run developer then `build-verifier` (delta) |
|
|
200
200
|
| `blocked` | Pipeline / step cannot proceed (e.g. `pipeline_parse_error`, completion of a parallel step whose producer's receipt was missing — see `agent-artifact-contracts.md` § Completion receipts) |
|
|
201
201
|
| `awaiting_artifact_receipt` | Producer stopped but the bound or assigned-output receipt was missing or stale; hook keeps the attempt active and does not advance. See `agent-artifact-contracts.md` (Schema field name + Receipt binding) for the silent-bug class that lands here. |
|
|
202
202
|
| `paused` | Operator sentinel engaged; the hook recorded the pause and refused to advance or hand off. Remove the sentinel and run `/task-continue`. |
|
|
@@ -236,8 +236,8 @@ On each `subagentStop`, the hook reconciles `status.state` from the completing p
|
|
|
236
236
|
3. One role per Task call — **except** parallel steps: multiple Task calls in one message.
|
|
237
237
|
4. **Never** skip `humanGates` without `/task-continue` or explicit user approval.
|
|
238
238
|
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`.
|
|
239
|
-
6. On `changes_requested` from reviewers: hook sets `retryAfterFix` → developer → same reviewer. 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.
|
|
240
|
-
7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier.
|
|
239
|
+
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.
|
|
240
|
+
7. On `validation_failed` from `build-verifier`: hook sets `retryAfterFix: build-verifier` → developer → build-verifier (delta).
|
|
241
241
|
8. When all steps complete, suggest `/technical-retro <slug>`.
|
|
242
242
|
9. If `autoChain: false` in pipeline, do not rely on hook — manual step only.
|
|
243
243
|
10. **Persist the verbatim original prompt.** Every `/task` and every routed work request writes the user's raw prompt to `.ai.local/team/tasks/<slug>/prompt.md` during slug bootstrap (write-if-absent; never overwrite on resume). It is not a manifest `artifacts[]` body — register the path on the `routing` entry. See **agent-artifact-contracts** § Prompt artifact. Also append every **subsequent user-authored** prompt for the same slug — a new user message while the slug is active, `/task-continue` arguments, human-gate feedback, a clarification answer — to the append-only `.ai.local/team/tasks/<slug>/prompt-log.md` (`seq` = max + 1; never rewrite or duplicate an entry; never log machine-generated hook `followup_message` or empty/argument-less invocations). Register its path on the `routing` entry. See **agent-artifact-contracts** § Prompt log. A message that explicitly addresses a **closed** slug follows the same ledger with the `post-terminal` marker — append-only, no reopen, one bounded `sync --slug`; see § Team artifact I/O.
|
|
@@ -274,7 +274,7 @@ Use Task tool or `/agent-name`. Pass: slug, artifact paths, step `scope` if set.
|
|
|
274
274
|
**Token usage.** When the host exposes token counts, append a `usage_recorded` event next to the attempt:
|
|
275
275
|
|
|
276
276
|
```bash
|
|
277
|
-
node .ai.local/scripts/record-usage.mjs --task <slug> --attempt <attemptId> --input <n> --output <n> [--cached <n>] [--model <id>]
|
|
277
|
+
node .ai.local/scripts/record-usage.mjs --task <slug> --attempt <attemptId> --input <n> --output <n> [--cached <n>] [--cache-write <n>] [--reasoning <n>] [--turn <turnId>] [--model <id>]
|
|
278
278
|
```
|
|
279
279
|
|
|
280
280
|
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.
|
|
@@ -10,7 +10,7 @@ Typical feature with data and UI. Concrete directories and rule stems — in the
|
|
|
10
10
|
4. **State** — store / ViewModel / use cases; no direct HTTP and no DTOs in UI.
|
|
11
11
|
5. **UI** — thin views/components; data via state; design system. If the prompt or `brief.md` contains a `figma.com` URL, **mockup review must complete** (or the user must continue past FAIL/`BLOCKED_MCP` via `/task-continue`) **before UI work**. When required-signal and **no** `figma.com`, **`ux-design.md` must exist** (not `INCOMPLETE`) before UI work — else blocked, hand back to analyst. Non-UI tasks no-op these gates. When a mockup contract exists for the WP, the UI step consumes it (per-node spec = the binding baseline) and a post-implementation verification gate runs against it (scope per `mockup-review` § Post-implementation gate) — screenshot / value / state / structural-parity diff plus a freeze re-check; unmapped implemented components are findings, not silent additions.
|
|
12
12
|
6. **Tests** — unit for mappers / non-trivial logic; e2e/UI per stack convention.
|
|
13
|
-
7. **Completion** —
|
|
13
|
+
7. **Completion** — closure gate: `build-verifier` runs the stack gate set **once**, after the last authoring step. During Build (steps 1–6) do not run project lint/test/build; author code and tests. When the current WP spans **more than one** layer or module, `implementation.md` includes a **Code Map** (3–8 annotated repo-relative paths) and **Suggested Review Order** (`concern | path:line | ≤15 word note`). Omit both for a single-file or single-layer WP.
|
|
14
14
|
|
|
15
15
|
## Context hygiene
|
|
16
16
|
|
|
@@ -18,13 +18,9 @@ A command whose output can exceed ~4 KB — a test run, a build/lint log, `git l
|
|
|
18
18
|
|
|
19
19
|
## Iterative refinement loop
|
|
20
20
|
|
|
21
|
-
Every stage runs the named loop **draft →
|
|
21
|
+
Every stage runs the named loop **draft → structural evaluation → refine** against a named oracle: reference-feature parity, layer/import shape, schema/contract parity, or review. The oracle is **not** a project test run. Tests are authored in the stage and executed by the closure gate; a failing test is closure evidence, not a per-stage trigger. When `implementationRail: tdd` is explicitly on, targeted tests are the documented cadence exception.
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
- **Evaluate** it against the stage's "done when" / exit criteria with the **named oracle** — a structural gate, a reviewer parity check, a test suite, or a human approval.
|
|
25
|
-
- **Refine** and re-evaluate until the oracle passes or the human re-scopes; loop back to the owning task, never forward past a failed oracle.
|
|
26
|
-
|
|
27
|
-
**Exit criteria:** a layer or stage is complete only when its named criteria hold (mapper tests green, parity check passes, gate output clean). Do not advance to the next checklist step while the current step's oracle fails; a repeatedly failing oracle triggers **plan revision**.
|
|
23
|
+
**Exit criteria:** a layer or stage is complete only when its structural criteria hold (reference parity, barrel/import shape, authored test present). Do not advance to the next checklist step while the current step's oracle fails; a repeatedly failing oracle triggers **plan revision**.
|
|
28
24
|
|
|
29
25
|
## Data flow (orientation)
|
|
30
26
|
|
|
@@ -27,7 +27,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
|
|
|
27
27
|
- [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
|
|
28
28
|
- [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn release:gate`; keep every registered golden stem paired
|
|
29
29
|
- [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn release:gate`. Every role loads `anti-hallucination-contract`. Writer roles, including `code-reviewer`, also load `STACK_FLOOR_STEMS`. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`) or the gate FAILs.
|
|
30
|
-
- [ ] **Gate:** `yarn check:
|
|
30
|
+
- [ ] **Gate:** `yarn check:task <slug>` (or `yarn check:changed` on a clean tree) and the gates it names; `yarn check:fast` only when it names none; `yarn release:gate` from `packages/ai-rules/` before a release (full composite: twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
|
|
31
31
|
|
|
32
32
|
## Pointers
|
|
33
33
|
|
|
@@ -37,7 +37,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
|
|
|
37
37
|
- Sync: `preset-twin-sync`
|
|
38
38
|
- Budget: `preset-token-budget`
|
|
39
39
|
- Leakage: `preset-no-cross-stack-leakage`
|
|
40
|
-
- Validation: `
|
|
40
|
+
- Validation: same `check:task` / `check:changed` loop; `yarn release:gate` before a release (`packages/ai-rules/scripts/release-gate.sh`)
|
|
41
41
|
- Dogfood scripts: `packages/ai-rules/scripts/sync-dogfood-cursor.sh`, `sync-dogfood-claude.sh`, `sync-dogfood-mavis.sh`, `sync-dogfood-opencode.sh`
|
|
42
42
|
- Drift script: `packages/ai-rules/scripts/check-shared-core-drift.sh`
|
|
43
43
|
- Orchestrator: when editing presets, load this checklist + twin-sync
|
|
@@ -5,12 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
# Principles
|
|
7
7
|
|
|
8
|
-
- **KISS:** the simplest change in the repository’s patterns.
|
|
9
|
-
- **
|
|
10
|
-
- **YAGNI:** no APIs, flags, or “for later” layers without a current requirement.
|
|
11
|
-
- **SOLID:** S — one reason to change; O — composition/new implementations; L — subtype contract; I — narrow ports; D — abstractions (ports), details in stack adapters.
|
|
12
|
-
- **CUPID:** Composable; Unix philosophy (one responsibility); Predictable; Idiomatic (repo); Domain-based.
|
|
13
|
-
- **Composition over inheritance;** Law of Demeter — no `a.b.c.d` chains; via public API / facade.
|
|
8
|
+
- **KISS / YAGNI / DRY (Rule of Three):** the simplest change in the repository’s patterns; share after the 3rd repetition; no “for later” APIs, flags, or layers.
|
|
9
|
+
- **SOLID / CUPID, applied:** composition over inheritance; one reason to change; narrow ports; no `a.b.c.d` chains — go through a public API or facade.
|
|
14
10
|
|
|
15
11
|
# Over-abstraction guardrails
|
|
16
12
|
|
|
@@ -4,6 +4,21 @@ Stack-agnostic evidence gate. Requestable via agents (`feature-developer`, `buil
|
|
|
4
4
|
|
|
5
5
|
Do not claim done, fixed, passing, or verified without **fresh command evidence in the same turn**.
|
|
6
6
|
|
|
7
|
+
## Gate cadence
|
|
8
|
+
|
|
9
|
+
Feature work has three phases. The phase decides who may run a project gate: `lint`, `type-check`, test, e2e, or `build`.
|
|
10
|
+
|
|
11
|
+
| Phase | Owner | Rule |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| **Build** | implementer / test author | Author code and tests. Do **not** run a project gate. |
|
|
14
|
+
| **Closure** | `build-verifier` | Run the full gate set **once**, after the last authoring step. |
|
|
15
|
+
| **Delta** | `build-verifier` | After a fix, run only the commands whose inputs changed; record the base and every skipped gate. |
|
|
16
|
+
|
|
17
|
+
- A test authored during Build is executed at Closure. "Authored" is Build evidence; "green" belongs to Closure.
|
|
18
|
+
- A second full closure pass needs a named reason: gate config or dependency change, rebase, or branch change. Record it in `validation-report.md`.
|
|
19
|
+
- Exceptions: debug/CI reproduction may run the single failing check; test-only or test-healing intent may run the targeted spec; an explicit user request runs exactly what was asked. Record each exception.
|
|
20
|
+
- `implementation.md` carries changed files and authored tests. Gate commands and exits live only in `validation-report.md`.
|
|
21
|
+
|
|
7
22
|
## Gate (in order)
|
|
8
23
|
|
|
9
24
|
1. **IDENTIFY** the command that would falsify the claim (test, lint, type-check, or the preset-structure script named in the task).
|
|
@@ -20,9 +35,11 @@ Do not claim done, fixed, passing, or verified without **fresh command evidence
|
|
|
20
35
|
|
|
21
36
|
## Who runs what
|
|
22
37
|
|
|
23
|
-
- **feature-developer:**
|
|
24
|
-
- **build-verifier:** the
|
|
25
|
-
- **
|
|
38
|
+
- **feature-developer:** authors code and tests; runs no project gate. Handoff evidence is the diff plus the authored test paths.
|
|
39
|
+
- **build-verifier:** the only closure executor; runs the full set once, then delta. Records every command, exit, timestamp, tree, and `gatePass` in `validation-report.md`.
|
|
40
|
+
- **qa-tester / test authors:** author tests; run the targeted spec only for a test-authoring or test-healing intent. The closure gate runs the affected suite.
|
|
41
|
+
- **debugger / ci-investigator:** reproduce the single failing check; bounded, then delta.
|
|
42
|
+
- **code-reviewer:** reads `validation-report.md`; does not run a gate to form a verdict.
|
|
26
43
|
|
|
27
44
|
## Companion: self-review
|
|
28
45
|
|
|
@@ -1264,11 +1264,15 @@ function focusDigestMarkdown(dir, statusSnapshot) {
|
|
|
1264
1264
|
}
|
|
1265
1265
|
} catch {}
|
|
1266
1266
|
}
|
|
1267
|
+
// Five entries is enough to resume; a longer list is a status dump, not a
|
|
1268
|
+
// pointer. The line budget below still bounds a single entry with many paths.
|
|
1269
|
+
const MAX_FOCUS_ENTRIES = 5;
|
|
1270
|
+
const shownIncomplete = incomplete.slice(0, MAX_FOCUS_ENTRIES);
|
|
1267
1271
|
const pathLines = [];
|
|
1268
1272
|
if (incomplete.length === 0) pathLines.push(' - (none)');
|
|
1269
1273
|
else {
|
|
1270
|
-
for (let index = 0; index <
|
|
1271
|
-
const item =
|
|
1274
|
+
for (let index = 0; index < shownIncomplete.length; index += 1) {
|
|
1275
|
+
const item = shownIncomplete[index];
|
|
1272
1276
|
if (item.paths.length === 0) pathLines.push(' - ' + item.id + ': (none)');
|
|
1273
1277
|
else {
|
|
1274
1278
|
for (let pathIndex = 0; pathIndex < item.paths.length; pathIndex += 1) {
|
|
@@ -1276,6 +1280,9 @@ function focusDigestMarkdown(dir, statusSnapshot) {
|
|
|
1276
1280
|
}
|
|
1277
1281
|
}
|
|
1278
1282
|
}
|
|
1283
|
+
if (incomplete.length > shownIncomplete.length) {
|
|
1284
|
+
pathLines.push(' - (+' + String(incomplete.length - shownIncomplete.length) + ' more incomplete entries)');
|
|
1285
|
+
}
|
|
1279
1286
|
}
|
|
1280
1287
|
let readyLine = '- decomposition ready set: (none)';
|
|
1281
1288
|
try {
|
|
@@ -2504,7 +2511,16 @@ if (status.state === 'changes_requested') {
|
|
|
2504
2511
|
process.stdout.write('{}');
|
|
2505
2512
|
process.exit(0);
|
|
2506
2513
|
}
|
|
2507
|
-
const
|
|
2514
|
+
const reviewerStepIndex = typeof status.pipelineIndex === 'number' ? status.pipelineIndex : 0;
|
|
2515
|
+
let verifierStepIndex = -1;
|
|
2516
|
+
for (let index = reviewerStepIndex - 1; index >= 0; index -= 1) {
|
|
2517
|
+
if (getStepAgents(steps[index]).includes('build-verifier')) {
|
|
2518
|
+
verifierStepIndex = index;
|
|
2519
|
+
break;
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2522
|
+
const retryGate = verifierStepIndex >= 0 ? 'build-verifier' : reviewer;
|
|
2523
|
+
const retryAfterFixStepIndex = verifierStepIndex >= 0 ? verifierStepIndex : reviewerStepIndex;
|
|
2508
2524
|
const developerIndex = scheduleRetry('feature-developer', reviewer, finishedAttempt);
|
|
2509
2525
|
if (developerIndex < 0) {
|
|
2510
2526
|
beginHumanGate();
|
|
@@ -2517,10 +2533,10 @@ if (status.state === 'changes_requested') {
|
|
|
2517
2533
|
currentAgent: 'feature-developer',
|
|
2518
2534
|
state: 'in_progress',
|
|
2519
2535
|
phase: 'executing',
|
|
2520
|
-
retryAfterFix:
|
|
2536
|
+
retryAfterFix: retryGate,
|
|
2521
2537
|
retryAfterFixStepIndex,
|
|
2522
2538
|
});
|
|
2523
|
-
out(handoffForAgent('feature-developer', steps[developerIndex]?.scope, steps[developerIndex]) + ` After fixes, re-run ${
|
|
2539
|
+
out(handoffForAgent('feature-developer', steps[developerIndex]?.scope, steps[developerIndex]) + ` After fixes, re-run ${retryGate}.`);
|
|
2524
2540
|
process.exit(0);
|
|
2525
2541
|
}
|
|
2526
2542
|
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import fs from 'node:fs';
|
|
16
16
|
import path from 'node:path';
|
|
17
|
+
import crypto from 'node:crypto';
|
|
17
18
|
import { fileURLToPath } from 'node:url';
|
|
18
19
|
|
|
19
20
|
export const OUTPUT_CAP = 4096;
|
|
@@ -29,6 +30,15 @@ const isRealDirectory = (target) => {
|
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
32
|
|
|
33
|
+
/** First 8 hex of the file body; a session-local re-read gate, not a security hash. */
|
|
34
|
+
const shortHash = (file) => {
|
|
35
|
+
try {
|
|
36
|
+
return crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex').slice(0, 8);
|
|
37
|
+
} catch {
|
|
38
|
+
return '????????';
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
32
42
|
const insideRoot = (root, abs) => {
|
|
33
43
|
const relative = path.relative(root, abs);
|
|
34
44
|
return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));
|
|
@@ -168,6 +178,13 @@ export const renderReport = (root, inputs) => {
|
|
|
168
178
|
}
|
|
169
179
|
if (blocks.length === 0) return { text: 'overlays=0', chains: [], read: [] };
|
|
170
180
|
const lines = [`overlays=${overlaySet.size}`, ...blocks.flatMap((block) => block.lines)];
|
|
181
|
+
const readSet = new Set(read);
|
|
182
|
+
if (readSet.size > 0) {
|
|
183
|
+
lines.push('hashes:');
|
|
184
|
+
for (const file of [...readSet].sort()) {
|
|
185
|
+
lines.push(`${file} ${shortHash(path.join(root, file))}`);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
171
188
|
return {
|
|
172
189
|
text: lines.join('\n'),
|
|
173
190
|
chains: blocks.map((block) => ({ for: block.for, overlays: block.overlays })),
|