@bonesofspring/ai-rules 0.2.65 → 0.2.67
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 +56 -0
- package/README.md +21 -11
- package/bin/cli.js +9 -1
- package/bin/lib/engine-scripts.js +34 -7
- package/bin/lib/engine-upgrade.js +5 -2
- package/bin/lib/seed-ai-local-team.js +32 -3
- package/docs/OPENCODE-COMPATIBILITY.md +1 -0
- package/docs/OPENCODE.md +31 -10
- package/docs/TEAM-DB.md +54 -14
- package/docs/TOKEN-ECONOMY.md +110 -0
- package/docs/openapi/team-db.v1.json +5 -5
- package/package.json +16 -3
- package/presets/_shared/ai-local/scripts/dump-output.mjs +422 -0
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +3 -3
- package/presets/_shared/ai-local/scripts/team-db-tracker.mjs +2 -0
- package/presets/_shared/ai-local/scripts/team-db.mjs +82 -2
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +3 -1
- package/presets/_shared/core/architecture/feature-delivery-workflow.md +4 -0
- package/presets/_shared/core/quality/context-and-iteration.md +1 -0
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +9 -2
- package/presets/_shared/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +9 -2
- 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 +3 -1
- package/presets/claude/go/agents/task-analyst.md +1 -1
- package/presets/claude/go/hooks/chain-team-phases.sh +9 -2
- package/presets/claude/go/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/go/rules/architecture/feature-delivery.md +4 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
- package/presets/claude/ios-swift/agents/task-analyst.md +1 -1
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +9 -2
- package/presets/claude/ios-swift/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/ios-swift/rules/architecture/feature-delivery.md +4 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
- package/presets/claude/java/agents/task-analyst.md +1 -1
- package/presets/claude/java/hooks/chain-team-phases.sh +9 -2
- package/presets/claude/java/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/java/rules/architecture/feature-delivery.md +4 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
- package/presets/claude/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +9 -2
- package/presets/claude/mcp-ts/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/mcp-ts/rules/architecture/feature-delivery.md +4 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
- package/presets/claude/mol/agents/task-analyst.md +1 -1
- package/presets/claude/mol/hooks/chain-team-phases.sh +9 -2
- package/presets/claude/mol/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/mol/rules/architecture/feature-delivery-workflow.md +4 -0
- package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
- package/presets/claude/next/agents/ci-investigator.md +5 -2
- package/presets/claude/next/agents/debugger.md +5 -2
- package/presets/claude/next/agents/feature-developer.md +5 -2
- package/presets/claude/next/agents/task-analyst.md +1 -1
- package/presets/claude/next/commands/README.md +1 -1
- package/presets/claude/next/commands/task.md +1 -1
- package/presets/claude/next/hooks/chain-team-phases.sh +9 -2
- package/presets/claude/next/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/next/rules/architecture/feature-delivery-workflow.md +8 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
- package/presets/claude/next/team/README.md +7 -3
- package/presets/claude/nuxt/agents/task-analyst.md +1 -1
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +9 -2
- package/presets/claude/nuxt/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/nuxt/rules/architecture/feature-delivery-workflow.md +4 -0
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
- package/presets/claude/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +9 -2
- package/presets/claude/php-hexagonal/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/php-hexagonal/rules/architecture/feature-delivery.md +4 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
- package/presets/claude/php-laravel/agents/task-analyst.md +1 -1
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +9 -2
- package/presets/claude/php-laravel/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/php-laravel/rules/architecture/feature-delivery.md +4 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
- package/presets/claude/svelte/agents/task-analyst.md +1 -1
- package/presets/claude/svelte/hooks/chain-team-phases.sh +9 -2
- package/presets/claude/svelte/hooks/list-ai-local.mjs +17 -0
- package/presets/claude/svelte/rules/architecture/feature-delivery-workflow.md +4 -0
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +3 -1
- package/presets/cursor/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +9 -2
- package/presets/cursor/android-kotlin/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/go/agents/task-analyst.md +1 -1
- package/presets/cursor/go/hooks/chain-team-phases.sh +9 -2
- package/presets/cursor/go/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/ios-swift/agents/task-analyst.md +1 -1
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +9 -2
- package/presets/cursor/ios-swift/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/java/agents/task-analyst.md +1 -1
- package/presets/cursor/java/hooks/chain-team-phases.sh +9 -2
- package/presets/cursor/java/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +9 -2
- package/presets/cursor/mcp-ts/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/mol/agents/task-analyst.md +1 -1
- package/presets/cursor/mol/hooks/chain-team-phases.sh +9 -2
- package/presets/cursor/mol/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/next/agents/task-analyst.md +1 -1
- package/presets/cursor/next/commands/README.md +1 -1
- package/presets/cursor/next/commands/task.md +1 -1
- package/presets/cursor/next/hooks/chain-team-phases.sh +9 -2
- package/presets/cursor/next/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +3 -1
- package/presets/cursor/next/rules/feature-delivery-workflow.mdc +4 -0
- package/presets/cursor/next/team/README.md +7 -3
- package/presets/cursor/nuxt/agents/task-analyst.md +1 -1
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +9 -2
- package/presets/cursor/nuxt/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +9 -2
- package/presets/cursor/php-hexagonal/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/php-laravel/agents/task-analyst.md +1 -1
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +9 -2
- package/presets/cursor/php-laravel/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/svelte/agents/task-analyst.md +1 -1
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +9 -2
- package/presets/cursor/svelte/hooks/list-ai-local.mjs +17 -0
- package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +9 -2
- package/presets/mavis/android-kotlin/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +3 -1
- package/presets/mavis/go/adapter-map.json +1 -1
- package/presets/mavis/go/agents/task-analyst.md +1 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +9 -2
- package/presets/mavis/go/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/go/rules/agent-team-orchestrator.md +3 -1
- package/presets/mavis/go/rules/feature-delivery-workflow.md +4 -0
- package/presets/mavis/ios-swift/adapter-map.json +1 -1
- package/presets/mavis/ios-swift/agents/task-analyst.md +1 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +9 -2
- package/presets/mavis/ios-swift/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +3 -1
- package/presets/mavis/ios-swift/rules/feature-delivery-workflow.md +4 -0
- package/presets/mavis/java/adapter-map.json +1 -1
- package/presets/mavis/java/agents/task-analyst.md +1 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +9 -2
- package/presets/mavis/java/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/java/rules/agent-team-orchestrator.md +3 -1
- package/presets/mavis/java/rules/feature-delivery-workflow.md +4 -0
- package/presets/mavis/mcp-ts/adapter-map.json +1 -1
- package/presets/mavis/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +9 -2
- package/presets/mavis/mcp-ts/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +3 -1
- package/presets/mavis/mcp-ts/rules/feature-delivery-workflow.md +4 -0
- package/presets/mavis/mol/adapter-map.json +1 -1
- package/presets/mavis/mol/agents/task-analyst.md +1 -1
- package/presets/mavis/mol/hooks/chain-team-phases.sh +9 -2
- package/presets/mavis/mol/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/mol/rules/agent-team-orchestrator.md +3 -1
- package/presets/mavis/mol/rules/feature-delivery-workflow.md +4 -0
- package/presets/mavis/next/adapter-map.json +9 -1
- package/presets/mavis/next/agents/ci-investigator.md +5 -2
- package/presets/mavis/next/agents/debugger.md +5 -2
- package/presets/mavis/next/agents/feature-developer.md +5 -2
- package/presets/mavis/next/agents/task-analyst.md +1 -1
- package/presets/mavis/next/commands/README.md +1 -1
- package/presets/mavis/next/commands/task.md +1 -1
- package/presets/mavis/next/hooks/chain-team-phases.sh +9 -2
- package/presets/mavis/next/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/next/rules/agent-team-orchestrator.md +3 -1
- package/presets/mavis/next/rules/feature-delivery-workflow.md +8 -0
- package/presets/mavis/next/team/README.md +7 -3
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/agents/task-analyst.md +1 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +9 -2
- package/presets/mavis/nuxt/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +3 -1
- package/presets/mavis/nuxt/rules/feature-delivery-workflow.md +4 -0
- package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
- package/presets/mavis/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +9 -2
- package/presets/mavis/php-hexagonal/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +3 -1
- package/presets/mavis/php-hexagonal/rules/feature-delivery-workflow.md +4 -0
- package/presets/mavis/php-laravel/adapter-map.json +1 -1
- package/presets/mavis/php-laravel/agents/task-analyst.md +1 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +9 -2
- package/presets/mavis/php-laravel/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +3 -1
- package/presets/mavis/php-laravel/rules/feature-delivery-workflow.md +4 -0
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/agents/task-analyst.md +1 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +9 -2
- package/presets/mavis/svelte/hooks/list-ai-local.mjs +17 -0
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +3 -1
- package/presets/mavis/svelte/rules/feature-delivery-workflow.md +4 -0
- package/presets/opencode/android-kotlin/adapter-map.json +1 -1
- package/presets/opencode/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +9 -2
- package/presets/opencode/android-kotlin/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +3 -1
- package/presets/opencode/go/adapter-map.json +1 -1
- package/presets/opencode/go/agents/task-analyst.md +1 -1
- package/presets/opencode/go/hooks/chain-team-phases.sh +9 -2
- package/presets/opencode/go/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/go/rules/agent-team-orchestrator.md +3 -1
- package/presets/opencode/go/rules/feature-delivery-workflow.md +4 -0
- package/presets/opencode/ios-swift/adapter-map.json +1 -1
- package/presets/opencode/ios-swift/agents/task-analyst.md +1 -1
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +9 -2
- package/presets/opencode/ios-swift/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +3 -1
- package/presets/opencode/ios-swift/rules/feature-delivery-workflow.md +4 -0
- package/presets/opencode/java/adapter-map.json +1 -1
- package/presets/opencode/java/agents/task-analyst.md +1 -1
- package/presets/opencode/java/hooks/chain-team-phases.sh +9 -2
- package/presets/opencode/java/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/java/rules/agent-team-orchestrator.md +3 -1
- package/presets/opencode/java/rules/feature-delivery-workflow.md +4 -0
- package/presets/opencode/mcp-ts/adapter-map.json +1 -1
- package/presets/opencode/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +9 -2
- package/presets/opencode/mcp-ts/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +3 -1
- package/presets/opencode/mcp-ts/rules/feature-delivery-workflow.md +4 -0
- package/presets/opencode/mol/adapter-map.json +1 -1
- package/presets/opencode/mol/agents/task-analyst.md +1 -1
- package/presets/opencode/mol/hooks/chain-team-phases.sh +9 -2
- package/presets/opencode/mol/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/mol/rules/agent-team-orchestrator.md +3 -1
- package/presets/opencode/mol/rules/feature-delivery-workflow.md +4 -0
- package/presets/opencode/next/adapter-map.json +9 -1
- package/presets/opencode/next/agents/ci-investigator.md +5 -2
- package/presets/opencode/next/agents/debugger.md +5 -2
- package/presets/opencode/next/agents/feature-developer.md +5 -2
- package/presets/opencode/next/agents/task-analyst.md +1 -1
- package/presets/opencode/next/commands/README.md +1 -1
- package/presets/opencode/next/commands/task.md +1 -1
- package/presets/opencode/next/hooks/chain-team-phases.sh +9 -2
- package/presets/opencode/next/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/next/rules/agent-team-orchestrator.md +3 -1
- package/presets/opencode/next/rules/feature-delivery-workflow.md +8 -0
- package/presets/opencode/next/team/README.md +7 -3
- package/presets/opencode/nuxt/adapter-map.json +1 -1
- package/presets/opencode/nuxt/agents/task-analyst.md +1 -1
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +9 -2
- package/presets/opencode/nuxt/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +3 -1
- package/presets/opencode/nuxt/rules/feature-delivery-workflow.md +4 -0
- package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
- package/presets/opencode/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +9 -2
- package/presets/opencode/php-hexagonal/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +3 -1
- package/presets/opencode/php-hexagonal/rules/feature-delivery-workflow.md +4 -0
- package/presets/opencode/php-laravel/adapter-map.json +1 -1
- package/presets/opencode/php-laravel/agents/task-analyst.md +1 -1
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +9 -2
- package/presets/opencode/php-laravel/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +3 -1
- package/presets/opencode/php-laravel/rules/feature-delivery-workflow.md +4 -0
- package/presets/opencode/plugins/output-guard/README.md +43 -0
- package/presets/opencode/plugins/output-guard/index.ts +300 -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/README.md +23 -11
- package/presets/opencode/plugins/task-status/details-data.ts +64 -46
- package/presets/opencode/plugins/task-status/details.tsx +12 -2
- package/presets/opencode/plugins/task-status/format.ts +16 -0
- package/presets/opencode/plugins/task-status/prompt-text.ts +37 -0
- package/presets/opencode/plugins/task-status/task-view.ts +281 -179
- package/presets/opencode/plugins/task-status/tui.tsx +60 -16
- package/presets/opencode/plugins/task-status/types.ts +74 -0
- package/presets/opencode/svelte/adapter-map.json +1 -1
- package/presets/opencode/svelte/agents/task-analyst.md +1 -1
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +9 -2
- package/presets/opencode/svelte/hooks/list-ai-local.mjs +17 -0
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +3 -1
- package/presets/opencode/svelte/rules/feature-delivery-workflow.md +4 -0
- package/presets/zcode/android-kotlin/adapter-map.json +1 -1
- package/presets/zcode/android-kotlin/agents/task-analyst.md +1 -1
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +9 -2
- package/presets/zcode/android-kotlin/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +3 -1
- package/presets/zcode/go/adapter-map.json +1 -1
- package/presets/zcode/go/agents/task-analyst.md +1 -1
- package/presets/zcode/go/hooks/chain-team-phases.sh +9 -2
- package/presets/zcode/go/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/go/rules/agent-team-orchestrator.md +3 -1
- package/presets/zcode/go/rules/feature-delivery-workflow.md +4 -0
- package/presets/zcode/ios-swift/adapter-map.json +1 -1
- package/presets/zcode/ios-swift/agents/task-analyst.md +1 -1
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +9 -2
- package/presets/zcode/ios-swift/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +3 -1
- package/presets/zcode/ios-swift/rules/feature-delivery-workflow.md +4 -0
- package/presets/zcode/java/adapter-map.json +1 -1
- package/presets/zcode/java/agents/task-analyst.md +1 -1
- package/presets/zcode/java/hooks/chain-team-phases.sh +9 -2
- package/presets/zcode/java/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/java/rules/agent-team-orchestrator.md +3 -1
- package/presets/zcode/java/rules/feature-delivery-workflow.md +4 -0
- package/presets/zcode/mcp-ts/adapter-map.json +1 -1
- package/presets/zcode/mcp-ts/agents/task-analyst.md +1 -1
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +9 -2
- package/presets/zcode/mcp-ts/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +3 -1
- package/presets/zcode/mcp-ts/rules/feature-delivery-workflow.md +4 -0
- package/presets/zcode/mol/adapter-map.json +1 -1
- package/presets/zcode/mol/agents/task-analyst.md +1 -1
- package/presets/zcode/mol/hooks/chain-team-phases.sh +9 -2
- package/presets/zcode/mol/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/mol/rules/agent-team-orchestrator.md +3 -1
- package/presets/zcode/mol/rules/feature-delivery-workflow.md +4 -0
- package/presets/zcode/next/adapter-map.json +9 -1
- package/presets/zcode/next/agents/ci-investigator.md +5 -2
- package/presets/zcode/next/agents/debugger.md +5 -2
- package/presets/zcode/next/agents/feature-developer.md +5 -2
- package/presets/zcode/next/agents/task-analyst.md +1 -1
- package/presets/zcode/next/commands/README.md +1 -1
- package/presets/zcode/next/commands/task.md +1 -1
- package/presets/zcode/next/hooks/chain-team-phases.sh +9 -2
- package/presets/zcode/next/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/next/rules/agent-team-orchestrator.md +3 -1
- package/presets/zcode/next/rules/feature-delivery-workflow.md +8 -0
- package/presets/zcode/next/team/README.md +7 -3
- package/presets/zcode/nuxt/adapter-map.json +1 -1
- package/presets/zcode/nuxt/agents/task-analyst.md +1 -1
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +9 -2
- package/presets/zcode/nuxt/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +3 -1
- package/presets/zcode/nuxt/rules/feature-delivery-workflow.md +4 -0
- package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
- package/presets/zcode/php-hexagonal/agents/task-analyst.md +1 -1
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +9 -2
- package/presets/zcode/php-hexagonal/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +3 -1
- package/presets/zcode/php-hexagonal/rules/feature-delivery-workflow.md +4 -0
- package/presets/zcode/php-laravel/adapter-map.json +1 -1
- package/presets/zcode/php-laravel/agents/task-analyst.md +1 -1
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +9 -2
- package/presets/zcode/php-laravel/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +3 -1
- package/presets/zcode/php-laravel/rules/feature-delivery-workflow.md +4 -0
- package/presets/zcode/svelte/adapter-map.json +1 -1
- package/presets/zcode/svelte/agents/task-analyst.md +1 -1
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +9 -2
- package/presets/zcode/svelte/hooks/list-ai-local.mjs +17 -0
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +3 -1
- package/presets/zcode/svelte/rules/feature-delivery-workflow.md +4 -0
- package/scripts/report-context-cost.mjs +432 -0
- package/presets/_shared/ai-local/scripts/upstream-research.mjs +0 -2964
- package/presets/claude/next/commands/upstream-research.md +0 -23
- package/presets/claude/next/team/upstream/config.json +0 -31
- package/presets/claude/next/team/upstream/digest-template.md +0 -55
- package/presets/claude/next/team/upstream/jobs.json +0 -34
- package/presets/claude/next/team/upstream/opencode.json +0 -34
- package/presets/claude/next/team/upstream/projects.json +0 -4
- package/presets/claude/next/team/upstream/prompt.md +0 -77
- package/presets/claude/next/team/upstream/signatures.json +0 -9
- package/presets/cursor/next/commands/upstream-research.md +0 -23
- package/presets/cursor/next/team/upstream/config.json +0 -31
- package/presets/cursor/next/team/upstream/digest-template.md +0 -55
- package/presets/cursor/next/team/upstream/jobs.json +0 -34
- package/presets/cursor/next/team/upstream/opencode.json +0 -34
- package/presets/cursor/next/team/upstream/projects.json +0 -4
- package/presets/cursor/next/team/upstream/prompt.md +0 -77
- package/presets/cursor/next/team/upstream/signatures.json +0 -9
- package/presets/mavis/next/commands/upstream-research.md +0 -18
- package/presets/mavis/next/team/upstream/config.json +0 -31
- package/presets/mavis/next/team/upstream/digest-template.md +0 -55
- package/presets/mavis/next/team/upstream/jobs.json +0 -34
- package/presets/mavis/next/team/upstream/opencode.json +0 -34
- package/presets/mavis/next/team/upstream/projects.json +0 -4
- package/presets/mavis/next/team/upstream/prompt.md +0 -77
- package/presets/mavis/next/team/upstream/signatures.json +0 -9
- package/presets/opencode/next/commands/upstream-research.md +0 -26
- package/presets/opencode/next/team/upstream/config.json +0 -31
- package/presets/opencode/next/team/upstream/digest-template.md +0 -55
- package/presets/opencode/next/team/upstream/jobs.json +0 -34
- package/presets/opencode/next/team/upstream/opencode.json +0 -34
- package/presets/opencode/next/team/upstream/projects.json +0 -4
- package/presets/opencode/next/team/upstream/prompt.md +0 -77
- package/presets/opencode/next/team/upstream/signatures.json +0 -9
- package/presets/zcode/next/commands/upstream-research.md +0 -26
- package/presets/zcode/next/team/upstream/config.json +0 -31
- package/presets/zcode/next/team/upstream/digest-template.md +0 -55
- package/presets/zcode/next/team/upstream/jobs.json +0 -34
- package/presets/zcode/next/team/upstream/opencode.json +0 -34
- package/presets/zcode/next/team/upstream/projects.json +0 -4
- package/presets/zcode/next/team/upstream/prompt.md +0 -77
- package/presets/zcode/next/team/upstream/signatures.json +0 -9
|
@@ -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 })),
|
|
@@ -19,6 +19,10 @@ Typical feature with data and UI. Concrete directories and rule stems — in the
|
|
|
19
19
|
6. **Tests** — unit for mappers / non-trivial logic; e2e/UI per stack convention.
|
|
20
20
|
7. **Completion** — stack post-change gate (lint/build) + package/toolchain rules. 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.
|
|
21
21
|
|
|
22
|
+
## Context hygiene
|
|
23
|
+
|
|
24
|
+
A command whose output can exceed ~4 KB — a test run, a build/lint log, `git log`, a diff — is piped through `.ai.local/scripts/dump-output.mjs --task <slug>` instead of being read whole. Work from its ≤40-line head and the stored file (grep it or use `team-db.mjs search`), and when that output informed a decision, record the repo-relative `outputs/…` path in `implementation.md` or `validation-report.md`; a `code-reviewer` may ask for that path. Do not read the whole output into context.
|
|
25
|
+
|
|
22
26
|
## Iterative refinement loop
|
|
23
27
|
|
|
24
28
|
Every stage runs the named loop **draft → evaluate against named criteria → refine**:
|
|
@@ -156,7 +156,7 @@ Replanning is a **named, auditable operation** — never a silent reorder. Trigg
|
|
|
156
156
|
|
|
157
157
|
## Context budget & checkpoint/resume
|
|
158
158
|
|
|
159
|
-
Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. An **interrupted producer** (tool abort, killed session) is resumed, not restarted: run the stack's compile gate on the working tree first, and when it is red hand the failing output to the same producer with a `fix and finish` brief instead of starting a second parallel attempt. When the host runtime writes no `status.json` (manual-hook hosts such as OpenCode), the resume checkpoint is `artifact-manifest.json` + `.memlog.md`; never gate a resume on a file the runtime does not produce. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
|
|
159
|
+
Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. A large command output (log, diff, test run, `git log`) is piped through `.ai.local/scripts/dump-output.mjs` instead of being read whole: take its ≤40-line head, then `grep -n` the stored file or find it with `team-db.mjs search "<term>"`. An **interrupted producer** (tool abort, killed session) is resumed, not restarted: run the stack's compile gate on the working tree first, and when it is red hand the failing output to the same producer with a `fix and finish` brief instead of starting a second parallel attempt. When the host runtime writes no `status.json` (manual-hook hosts such as OpenCode), the resume checkpoint is `artifact-manifest.json` + `.memlog.md`; never gate a resume on a file the runtime does not produce. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
|
|
160
160
|
|
|
161
161
|
## Self-review & context hygiene
|
|
162
162
|
|
|
@@ -223,6 +223,8 @@ Additional states: `blocked` — a step (or a parallel producer) cannot proceed;
|
|
|
223
223
|
|
|
224
224
|
On each `subagentStop`, the hook reconciles `status.state` from the completing producer's terminal `artifact-manifest.json` receipt (`completed` \| `changes_requested` \| `validation_failed`) when agents left lifecycle fields untouched. Parent orchestrators must wait for that handoff before invoking the next step.
|
|
225
225
|
|
|
226
|
+
**A dispatch is not a completion.** When the host hands back a session handle, a job id, or control before the specialist's turn ends, the step is still open: do not dispatch the next step, do not report the step done, and do not run the chain hook until the specialist reports back and the hook records the receipt. A background handle is a start signal only.
|
|
227
|
+
|
|
226
228
|
## Pipeline step options
|
|
227
229
|
|
|
228
230
|
| Field | Use |
|
|
@@ -48,7 +48,7 @@ Decompose as a **dependency graph**: each task carries `dependsOn[]`, the edges
|
|
|
48
48
|
|
|
49
49
|
<!-- shared-core: quality/context-and-iteration.md -->
|
|
50
50
|
|
|
51
|
-
Work in bounded waves; delegate mechanical waves to repo scripts. **Checkpoint** progress to `.memlog.md` and record produced paths on the `implementation` manifest entry `authoritativePaths`, so a run can resume from `artifact-manifest.json` + `.memlog.md` without re-deriving state. Refine with the named loop **draft → evaluate against named criteria → refine**.
|
|
51
|
+
Work in bounded waves; delegate mechanical waves to repo scripts. A large command output (log, diff, test run, `git log`) is piped through `.ai.local/scripts/dump-output.mjs` instead of being read whole: take its ≤40-line head, then `grep -n` the stored file or find it with `team-db.mjs search "<term>"`. **Checkpoint** progress to `.memlog.md` and record produced paths on the `implementation` manifest entry `authoritativePaths`, so a run can resume from `artifact-manifest.json` + `.memlog.md` without re-deriving state. Refine with the named loop **draft → evaluate against named criteria → refine**.
|
|
52
52
|
|
|
53
53
|
## Self-review & context hygiene
|
|
54
54
|
|
|
@@ -1288,11 +1288,15 @@ function focusDigestMarkdown(dir, statusSnapshot) {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
} catch {}
|
|
1290
1290
|
}
|
|
1291
|
+
// Five entries is enough to resume; a longer list is a status dump, not a
|
|
1292
|
+
// pointer. The line budget below still bounds a single entry with many paths.
|
|
1293
|
+
const MAX_FOCUS_ENTRIES = 5;
|
|
1294
|
+
const shownIncomplete = incomplete.slice(0, MAX_FOCUS_ENTRIES);
|
|
1291
1295
|
const pathLines = [];
|
|
1292
1296
|
if (incomplete.length === 0) pathLines.push(' - (none)');
|
|
1293
1297
|
else {
|
|
1294
|
-
for (let index = 0; index <
|
|
1295
|
-
const item =
|
|
1298
|
+
for (let index = 0; index < shownIncomplete.length; index += 1) {
|
|
1299
|
+
const item = shownIncomplete[index];
|
|
1296
1300
|
if (item.paths.length === 0) pathLines.push(' - ' + item.id + ': (none)');
|
|
1297
1301
|
else {
|
|
1298
1302
|
for (let pathIndex = 0; pathIndex < item.paths.length; pathIndex += 1) {
|
|
@@ -1300,6 +1304,9 @@ function focusDigestMarkdown(dir, statusSnapshot) {
|
|
|
1300
1304
|
}
|
|
1301
1305
|
}
|
|
1302
1306
|
}
|
|
1307
|
+
if (incomplete.length > shownIncomplete.length) {
|
|
1308
|
+
pathLines.push(' - (+' + String(incomplete.length - shownIncomplete.length) + ' more incomplete entries)');
|
|
1309
|
+
}
|
|
1303
1310
|
}
|
|
1304
1311
|
let readyLine = '- decomposition ready set: (none)';
|
|
1305
1312
|
try {
|
|
@@ -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 })),
|
|
@@ -19,6 +19,10 @@ Typical feature with data and UI. Concrete directories and rule stems — in the
|
|
|
19
19
|
6. **Tests** — unit for mappers / non-trivial logic; e2e/UI per stack convention.
|
|
20
20
|
7. **Completion** — stack post-change gate (lint/build) + package/toolchain rules. 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.
|
|
21
21
|
|
|
22
|
+
## Context hygiene
|
|
23
|
+
|
|
24
|
+
A command whose output can exceed ~4 KB — a test run, a build/lint log, `git log`, a diff — is piped through `.ai.local/scripts/dump-output.mjs --task <slug>` instead of being read whole. Work from its ≤40-line head and the stored file (grep it or use `team-db.mjs search`), and when that output informed a decision, record the repo-relative `outputs/…` path in `implementation.md` or `validation-report.md`; a `code-reviewer` may ask for that path. Do not read the whole output into context.
|
|
25
|
+
|
|
22
26
|
## Iterative refinement loop
|
|
23
27
|
|
|
24
28
|
Every stage runs the named loop **draft → evaluate against named criteria → refine**:
|
|
@@ -156,7 +156,7 @@ Replanning is a **named, auditable operation** — never a silent reorder. Trigg
|
|
|
156
156
|
|
|
157
157
|
## Context budget & checkpoint/resume
|
|
158
158
|
|
|
159
|
-
Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. An **interrupted producer** (tool abort, killed session) is resumed, not restarted: run the stack's compile gate on the working tree first, and when it is red hand the failing output to the same producer with a `fix and finish` brief instead of starting a second parallel attempt. When the host runtime writes no `status.json` (manual-hook hosts such as OpenCode), the resume checkpoint is `artifact-manifest.json` + `.memlog.md`; never gate a resume on a file the runtime does not produce. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
|
|
159
|
+
Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. A large command output (log, diff, test run, `git log`) is piped through `.ai.local/scripts/dump-output.mjs` instead of being read whole: take its ≤40-line head, then `grep -n` the stored file or find it with `team-db.mjs search "<term>"`. An **interrupted producer** (tool abort, killed session) is resumed, not restarted: run the stack's compile gate on the working tree first, and when it is red hand the failing output to the same producer with a `fix and finish` brief instead of starting a second parallel attempt. When the host runtime writes no `status.json` (manual-hook hosts such as OpenCode), the resume checkpoint is `artifact-manifest.json` + `.memlog.md`; never gate a resume on a file the runtime does not produce. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
|
|
160
160
|
|
|
161
161
|
## Self-review & context hygiene
|
|
162
162
|
|
|
@@ -223,6 +223,8 @@ Additional states: `blocked` — a step (or a parallel producer) cannot proceed;
|
|
|
223
223
|
|
|
224
224
|
On each `subagentStop`, the hook reconciles `status.state` from the completing producer's terminal `artifact-manifest.json` receipt (`completed` \| `changes_requested` \| `validation_failed`) when agents left lifecycle fields untouched. Parent orchestrators must wait for that handoff before invoking the next step.
|
|
225
225
|
|
|
226
|
+
**A dispatch is not a completion.** When the host hands back a session handle, a job id, or control before the specialist's turn ends, the step is still open: do not dispatch the next step, do not report the step done, and do not run the chain hook until the specialist reports back and the hook records the receipt. A background handle is a start signal only.
|
|
227
|
+
|
|
226
228
|
## Pipeline step options
|
|
227
229
|
|
|
228
230
|
| Field | Use |
|
|
@@ -56,7 +56,7 @@ Whenever decomposition Files cover edits to Cursor mol `openspec-author` / `task
|
|
|
56
56
|
|
|
57
57
|
<!-- shared-core: quality/context-and-iteration.md -->
|
|
58
58
|
|
|
59
|
-
Work in bounded waves; delegate mechanical waves to repo scripts. **Checkpoint** progress to `.memlog.md` and record produced paths on the `implementation` manifest entry `authoritativePaths`. On resume, read `.ai.local/team/tasks/<slug>/focus.md` first as a resume aid only. It is a view, not the system of record, and it includes one decomposition ready-set line and one archive index line. The run still resumes from `artifact-manifest.json` + `.memlog.md` without re-deriving state. Refine with the named loop **draft → evaluate against named criteria → refine**.
|
|
59
|
+
Work in bounded waves; delegate mechanical waves to repo scripts. A large command output (log, diff, test run, `git log`) is piped through `.ai.local/scripts/dump-output.mjs` instead of being read whole: take its ≤40-line head, then `grep -n` the stored file or find it with `team-db.mjs search "<term>"`. **Checkpoint** progress to `.memlog.md` and record produced paths on the `implementation` manifest entry `authoritativePaths`. On resume, read `.ai.local/team/tasks/<slug>/focus.md` first as a resume aid only. It is a view, not the system of record, and it includes one decomposition ready-set line and one archive index line. The run still resumes from `artifact-manifest.json` + `.memlog.md` without re-deriving state. Refine with the named loop **draft → evaluate against named criteria → refine**.
|
|
60
60
|
|
|
61
61
|
## Self-review & context hygiene
|
|
62
62
|
|
|
@@ -1301,11 +1301,15 @@ function focusDigestMarkdown(dir, statusSnapshot) {
|
|
|
1301
1301
|
}
|
|
1302
1302
|
} catch {}
|
|
1303
1303
|
}
|
|
1304
|
+
// Five entries is enough to resume; a longer list is a status dump, not a
|
|
1305
|
+
// pointer. The line budget below still bounds a single entry with many paths.
|
|
1306
|
+
const MAX_FOCUS_ENTRIES = 5;
|
|
1307
|
+
const shownIncomplete = incomplete.slice(0, MAX_FOCUS_ENTRIES);
|
|
1304
1308
|
const pathLines = [];
|
|
1305
1309
|
if (incomplete.length === 0) pathLines.push(' - (none)');
|
|
1306
1310
|
else {
|
|
1307
|
-
for (let index = 0; index <
|
|
1308
|
-
const item =
|
|
1311
|
+
for (let index = 0; index < shownIncomplete.length; index += 1) {
|
|
1312
|
+
const item = shownIncomplete[index];
|
|
1309
1313
|
if (item.paths.length === 0) pathLines.push(' - ' + item.id + ': (none)');
|
|
1310
1314
|
else {
|
|
1311
1315
|
for (let pathIndex = 0; pathIndex < item.paths.length; pathIndex += 1) {
|
|
@@ -1313,6 +1317,9 @@ function focusDigestMarkdown(dir, statusSnapshot) {
|
|
|
1313
1317
|
}
|
|
1314
1318
|
}
|
|
1315
1319
|
}
|
|
1320
|
+
if (incomplete.length > shownIncomplete.length) {
|
|
1321
|
+
pathLines.push(' - (+' + String(incomplete.length - shownIncomplete.length) + ' more incomplete entries)');
|
|
1322
|
+
}
|
|
1316
1323
|
}
|
|
1317
1324
|
let readyLine = '- decomposition ready set: (none)';
|
|
1318
1325
|
try {
|
|
@@ -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 })),
|
|
@@ -19,6 +19,10 @@ Typical feature with data and UI. Concrete directories and rule stems — in the
|
|
|
19
19
|
6. **Tests** — unit for mappers / non-trivial logic; e2e/UI per stack convention.
|
|
20
20
|
7. **Completion** — stack post-change gate (lint/build) + package/toolchain rules. 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.
|
|
21
21
|
|
|
22
|
+
## Context hygiene
|
|
23
|
+
|
|
24
|
+
A command whose output can exceed ~4 KB — a test run, a build/lint log, `git log`, a diff — is piped through `.ai.local/scripts/dump-output.mjs --task <slug>` instead of being read whole. Work from its ≤40-line head and the stored file (grep it or use `team-db.mjs search`), and when that output informed a decision, record the repo-relative `outputs/…` path in `implementation.md` or `validation-report.md`; a `code-reviewer` may ask for that path. Do not read the whole output into context.
|
|
25
|
+
|
|
22
26
|
## Iterative refinement loop
|
|
23
27
|
|
|
24
28
|
Every stage runs the named loop **draft → evaluate against named criteria → refine**:
|
|
@@ -156,7 +156,7 @@ Replanning is a **named, auditable operation** — never a silent reorder. Trigg
|
|
|
156
156
|
|
|
157
157
|
## Context budget & checkpoint/resume
|
|
158
158
|
|
|
159
|
-
Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. An **interrupted producer** (tool abort, killed session) is resumed, not restarted: run the stack's compile gate on the working tree first, and when it is red hand the failing output to the same producer with a `fix and finish` brief instead of starting a second parallel attempt. When the host runtime writes no `status.json` (manual-hook hosts such as OpenCode), the resume checkpoint is `artifact-manifest.json` + `.memlog.md`; never gate a resume on a file the runtime does not produce. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
|
|
159
|
+
Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. A large command output (log, diff, test run, `git log`) is piped through `.ai.local/scripts/dump-output.mjs` instead of being read whole: take its ≤40-line head, then `grep -n` the stored file or find it with `team-db.mjs search "<term>"`. An **interrupted producer** (tool abort, killed session) is resumed, not restarted: run the stack's compile gate on the working tree first, and when it is red hand the failing output to the same producer with a `fix and finish` brief instead of starting a second parallel attempt. When the host runtime writes no `status.json` (manual-hook hosts such as OpenCode), the resume checkpoint is `artifact-manifest.json` + `.memlog.md`; never gate a resume on a file the runtime does not produce. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
|
|
160
160
|
|
|
161
161
|
## Self-review & context hygiene
|
|
162
162
|
|
|
@@ -223,6 +223,8 @@ Additional states: `blocked` — a step (or a parallel producer) cannot proceed;
|
|
|
223
223
|
|
|
224
224
|
On each `subagentStop`, the hook reconciles `status.state` from the completing producer's terminal `artifact-manifest.json` receipt (`completed` \| `changes_requested` \| `validation_failed`) when agents left lifecycle fields untouched. Parent orchestrators must wait for that handoff before invoking the next step.
|
|
225
225
|
|
|
226
|
+
**A dispatch is not a completion.** When the host hands back a session handle, a job id, or control before the specialist's turn ends, the step is still open: do not dispatch the next step, do not report the step done, and do not run the chain hook until the specialist reports back and the hook records the receipt. A background handle is a start signal only.
|
|
227
|
+
|
|
226
228
|
## Pipeline step options
|
|
227
229
|
|
|
228
230
|
| Field | Use |
|
|
@@ -14,10 +14,13 @@ This subagent does **not** inherit the parent session context or `CLAUDE.md`. Re
|
|
|
14
14
|
- `.claude/rules/tooling-and-review/ai-local-overlay.md`
|
|
15
15
|
- `.claude/rules/architecture/architecture-boundaries.md` — layer boundaries and allowed imports
|
|
16
16
|
- `.claude/rules/architecture/feature-delivery-workflow.md` — layer order, mockup gate, ux-design gate
|
|
17
|
-
- `.claude/rules/architecture/reference-features.md` — analog files first
|
|
18
|
-
- `.claude/rules/tooling-and-review/anti-sycophancy-discipline.md` — procedural anti-sycophancy rules
|
|
19
17
|
- `.claude/rules/tooling-and-review/anti-hallucination-contract.md` — do not invent signatures, imports, schemas, or evidence
|
|
20
18
|
- `.claude/rules/tooling-and-review/post-change-lint.md` — lint/type-check after code edits
|
|
19
|
+
|
|
20
|
+
Read when the task reaches the matching zone:
|
|
21
|
+
|
|
22
|
+
- `.claude/rules/architecture/reference-features.md` — analog files first
|
|
23
|
+
- `.claude/rules/tooling-and-review/anti-sycophancy-discipline.md` — procedural anti-sycophancy rules
|
|
21
24
|
- `.claude/rules/tooling-and-review/mcp-usage.md` — when verifying third-party APIs (Context7)
|
|
22
25
|
- `.claude/rules/architecture/public-imports.md` — @/types, @/api barrels
|
|
23
26
|
- `.claude/rules/ui-and-accessibility/react-ui.md` — UI component style (no FC, no spread, decomposition)
|
|
@@ -14,10 +14,13 @@ This subagent does **not** inherit the parent session context or `CLAUDE.md`. Re
|
|
|
14
14
|
- `.claude/rules/tooling-and-review/ai-local-overlay.md`
|
|
15
15
|
- `.claude/rules/architecture/architecture-boundaries.md` — layer boundaries and allowed imports
|
|
16
16
|
- `.claude/rules/architecture/feature-delivery-workflow.md` — layer order, mockup gate, ux-design gate
|
|
17
|
-
- `.claude/rules/architecture/reference-features.md` — analog files first
|
|
18
|
-
- `.claude/rules/tooling-and-review/anti-sycophancy-discipline.md` — procedural anti-sycophancy rules
|
|
19
17
|
- `.claude/rules/tooling-and-review/anti-hallucination-contract.md` — do not invent signatures, imports, schemas, or evidence
|
|
20
18
|
- `.claude/rules/tooling-and-review/post-change-lint.md` — lint/type-check after code edits
|
|
19
|
+
|
|
20
|
+
Read when the task reaches the matching zone:
|
|
21
|
+
|
|
22
|
+
- `.claude/rules/architecture/reference-features.md` — analog files first
|
|
23
|
+
- `.claude/rules/tooling-and-review/anti-sycophancy-discipline.md` — procedural anti-sycophancy rules
|
|
21
24
|
- `.claude/rules/tooling-and-review/mcp-usage.md` — when verifying third-party APIs (Context7)
|
|
22
25
|
- `.claude/rules/architecture/public-imports.md` — @/types, @/api barrels
|
|
23
26
|
- `.claude/rules/ui-and-accessibility/react-ui.md` — UI component style (no FC, no spread, decomposition)
|
|
@@ -14,10 +14,13 @@ This subagent does **not** inherit the parent session context or `CLAUDE.md`. Re
|
|
|
14
14
|
- `.claude/rules/tooling-and-review/ai-local-overlay.md`
|
|
15
15
|
- `.claude/rules/architecture/architecture-boundaries.md` — layer boundaries and allowed imports
|
|
16
16
|
- `.claude/rules/architecture/feature-delivery-workflow.md` — layer order, mockup gate, ux-design gate
|
|
17
|
-
- `.claude/rules/architecture/reference-features.md` — analog files first
|
|
18
|
-
- `.claude/rules/tooling-and-review/anti-sycophancy-discipline.md` — procedural anti-sycophancy rules
|
|
19
17
|
- `.claude/rules/tooling-and-review/anti-hallucination-contract.md` — do not invent signatures, imports, schemas, or evidence
|
|
20
18
|
- `.claude/rules/tooling-and-review/post-change-lint.md` — lint/type-check after code edits
|
|
19
|
+
|
|
20
|
+
Read when the task reaches the matching zone:
|
|
21
|
+
|
|
22
|
+
- `.claude/rules/architecture/reference-features.md` — analog files first
|
|
23
|
+
- `.claude/rules/tooling-and-review/anti-sycophancy-discipline.md` — procedural anti-sycophancy rules
|
|
21
24
|
- `.claude/rules/tooling-and-review/mcp-usage.md` — when verifying third-party APIs (Context7)
|
|
22
25
|
- `.claude/rules/architecture/public-imports.md` — @/types, @/api barrels
|
|
23
26
|
- `.claude/rules/ui-and-accessibility/react-ui.md` — UI component style (no FC, no spread, decomposition)
|
|
@@ -64,7 +64,7 @@ Whenever decomposition Files cover edits to Cursor next `openspec-author` / `tas
|
|
|
64
64
|
|
|
65
65
|
<!-- shared-core: quality/context-and-iteration.md -->
|
|
66
66
|
|
|
67
|
-
Work in bounded waves; delegate mechanical waves to repo scripts. **Checkpoint** progress to `.memlog.md` and record produced paths on the `implementation` manifest entry `authoritativePaths`. On resume, read `.ai.local/team/tasks/<slug>/focus.md` first as a resume aid only. It is a view, not the system of record, and it includes one decomposition ready-set line and one archive index line. The run still resumes from `artifact-manifest.json` + `.memlog.md` without re-deriving state. Refine with the named loop **draft → evaluate against named criteria → refine**.
|
|
67
|
+
Work in bounded waves; delegate mechanical waves to repo scripts. A large command output (log, diff, test run, `git log`) is piped through `.ai.local/scripts/dump-output.mjs` instead of being read whole: take its ≤40-line head, then `grep -n` the stored file or find it with `team-db.mjs search "<term>"`. **Checkpoint** progress to `.memlog.md` and record produced paths on the `implementation` manifest entry `authoritativePaths`. On resume, read `.ai.local/team/tasks/<slug>/focus.md` first as a resume aid only. It is a view, not the system of record, and it includes one decomposition ready-set line and one archive index line. The run still resumes from `artifact-manifest.json` + `.memlog.md` without re-deriving state. Refine with the named loop **draft → evaluate against named criteria → refine**.
|
|
68
68
|
|
|
69
69
|
## Self-review & context hygiene
|
|
70
70
|
|
|
@@ -9,7 +9,7 @@ Slash-command definitions and on-demand scenarios. Copied to `.claude/commands/`
|
|
|
9
9
|
| `task-continue.md` | Resume after human gate / pause via `pipeline.json` |
|
|
10
10
|
| `technical-retro.md` | Technical retro facilitation, including the “Agent work” block |
|
|
11
11
|
| `update.md` | Reinstall each installed tool with the preset recorded at init |
|
|
12
|
-
| `/upstream-research` |
|
|
12
|
+
| `/upstream-research` | Repository-only (not in the published package): queue the weekly upstream evolution review; run one `schedule --once` tick when the timer is offline |
|
|
13
13
|
| `migrate-tasks.md` | Create or reconcile `.ai.local/team/team.db`; writes only the delta |
|
|
14
14
|
| `/ui-start` | Start the shipped dashboard in the background on loopback; no Docker, no build step |
|
|
15
15
|
| `/ui-stop` | Stop the server this repository started, then clear its marker |
|
|
@@ -42,7 +42,7 @@ Examples:
|
|
|
42
42
|
- confirm `pipeline.json` and `active-task.json`;
|
|
43
43
|
- **do not** write lifecycle fields in `status.json` / `metrics.json` yourself — orchestration runtime/hook owns them (see **agent-artifact-contracts**). If `status.json` is missing, only minimal bootstrap is allowed (`slug`, `intent`, `pipelineIndex: 0`, `currentAgent: steps[0]`, `state: in_progress`) — **do not** increment `pipelineIndex` manually;
|
|
44
44
|
- invoke subagent for `pipeline.steps[0].agent` (slug, artifact paths, scope).
|
|
45
|
-
7. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until hook returns `followup_message`).
|
|
45
|
+
7. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until hook returns `followup_message`). A Task call that returns a session handle has only **started** the agent: keep the step open until it reports back.
|
|
46
46
|
8. **Human gate** — if there is a gate in `humanGates` after the current step (`after:<agent>`), **stop** after the agent finishes and ask for `/task-continue <slug>`.
|
|
47
47
|
|
|
48
48
|
## Plan contract
|
|
@@ -1301,11 +1301,15 @@ function focusDigestMarkdown(dir, statusSnapshot) {
|
|
|
1301
1301
|
}
|
|
1302
1302
|
} catch {}
|
|
1303
1303
|
}
|
|
1304
|
+
// Five entries is enough to resume; a longer list is a status dump, not a
|
|
1305
|
+
// pointer. The line budget below still bounds a single entry with many paths.
|
|
1306
|
+
const MAX_FOCUS_ENTRIES = 5;
|
|
1307
|
+
const shownIncomplete = incomplete.slice(0, MAX_FOCUS_ENTRIES);
|
|
1304
1308
|
const pathLines = [];
|
|
1305
1309
|
if (incomplete.length === 0) pathLines.push(' - (none)');
|
|
1306
1310
|
else {
|
|
1307
|
-
for (let index = 0; index <
|
|
1308
|
-
const item =
|
|
1311
|
+
for (let index = 0; index < shownIncomplete.length; index += 1) {
|
|
1312
|
+
const item = shownIncomplete[index];
|
|
1309
1313
|
if (item.paths.length === 0) pathLines.push(' - ' + item.id + ': (none)');
|
|
1310
1314
|
else {
|
|
1311
1315
|
for (let pathIndex = 0; pathIndex < item.paths.length; pathIndex += 1) {
|
|
@@ -1313,6 +1317,9 @@ function focusDigestMarkdown(dir, statusSnapshot) {
|
|
|
1313
1317
|
}
|
|
1314
1318
|
}
|
|
1315
1319
|
}
|
|
1320
|
+
if (incomplete.length > shownIncomplete.length) {
|
|
1321
|
+
pathLines.push(' - (+' + String(incomplete.length - shownIncomplete.length) + ' more incomplete entries)');
|
|
1322
|
+
}
|
|
1316
1323
|
}
|
|
1317
1324
|
let readyLine = '- decomposition ready set: (none)';
|
|
1318
1325
|
try {
|
|
@@ -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 })),
|
|
@@ -19,6 +19,10 @@ Typical feature with data and UI. Concrete directories and rule stems — in the
|
|
|
19
19
|
6. **Tests** — unit for mappers / non-trivial logic; e2e/UI per stack convention.
|
|
20
20
|
7. **Completion** — stack post-change gate (lint/build) + package/toolchain rules. 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.
|
|
21
21
|
|
|
22
|
+
## Context hygiene
|
|
23
|
+
|
|
24
|
+
A command whose output can exceed ~4 KB — a test run, a build/lint log, `git log`, a diff — is piped through `.ai.local/scripts/dump-output.mjs --task <slug>` instead of being read whole. Work from its ≤40-line head and the stored file (grep it or use `team-db.mjs search`), and when that output informed a decision, record the repo-relative `outputs/…` path in `implementation.md` or `validation-report.md`; a `code-reviewer` may ask for that path. Do not read the whole output into context.
|
|
25
|
+
|
|
22
26
|
## Iterative refinement loop
|
|
23
27
|
|
|
24
28
|
Every stage runs the named loop **draft → evaluate against named criteria → refine**:
|
|
@@ -103,6 +107,10 @@ Typical feature with backend data and shared state. Layer details — `architect
|
|
|
103
107
|
8. **Tests** — unit for mappers (`testing/tests-unit.md`); e2e from `*.cases.md` (`testing/tests-e2e-structure.md`, `testing/playwright-agents.md`).
|
|
104
108
|
9. **Completion** — **`tooling-and-review/post-change-lint.md`**: `lint:js` + `lint:css` + `type-check`; package manager — `tooling-and-review/package-manager.md`. When the current WP spans **more than one** layer or module, `implementation.md` includes a **Code Map** (3–8 annotated paths) and **Suggested Review Order** (`concern | path:line | ≤15 word note`). Omit both for a single-file or single-layer WP.
|
|
105
109
|
|
|
110
|
+
## Context hygiene
|
|
111
|
+
|
|
112
|
+
A command whose output can exceed ~4 KB — a test run, a build/lint log, `git log`, a diff — is piped through `.ai.local/scripts/dump-output.mjs --task <slug>` instead of being read whole. Work from its ≤40-line head and the stored file (`grep -n` or `team-db.mjs search`), and record the repo-relative `outputs/…` path in `implementation.md` or `validation-report.md` when it informed a decision. Do not read the whole output into context.
|
|
113
|
+
|
|
106
114
|
## Data flow (orientation)
|
|
107
115
|
|
|
108
116
|
```mermaid
|
|
@@ -156,7 +156,7 @@ Replanning is a **named, auditable operation** — never a silent reorder. Trigg
|
|
|
156
156
|
|
|
157
157
|
## Context budget & checkpoint/resume
|
|
158
158
|
|
|
159
|
-
Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. An **interrupted producer** (tool abort, killed session) is resumed, not restarted: run the stack's compile gate on the working tree first, and when it is red hand the failing output to the same producer with a `fix and finish` brief instead of starting a second parallel attempt. When the host runtime writes no `status.json` (manual-hook hosts such as OpenCode), the resume checkpoint is `artifact-manifest.json` + `.memlog.md`; never gate a resume on a file the runtime does not produce. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
|
|
159
|
+
Work in bounded waves (one artifact class across the target surface). **Checkpoint** each completed wave to `.memlog.md` (`## <date>` + an `event:` line) and record the produced paths on the `implementation` manifest entry (`authoritativePaths`). That checkpoint is the hook `writeStatus` path: it rewrites `.ai.local/team/tasks/<slug>/focus.md`. `focus.md` is a view, not the system of record. It lists slug, pipeline step index, authoritative paths for incomplete manifest ids, the last `.memlog.md` `event:` line, the next gate, one decomposition ready-set line, and one archive index line, and it stays under 100 lines. `status.json`, `metrics.json`, `artifact-manifest.json`, and `.memlog.md` stay the system of record. A resumed run (`/task-continue`) reads `focus.md` first, then `artifact-manifest.json` and `.memlog.md`, and continues at the first stage whose exit criteria are unmet — never re-derive state from the chat. A completed manifest entry keeps id, status, and `authoritativePaths`, and the default resume read omits that entry's markdown body; closing it appends one new `.memlog.md` event: line, moves the bulky body to `.ai.local/team/tasks/<slug>/archive/YYYY-MM-DD/`, and leaves earlier memlog lines, the human-readable slug and artifact ids, and the manifest entry in place, with no Beads hash ids and no Taskmaster tags. Mechanical waves (generation, embed sync) are delegated to repo scripts. A large command output (log, diff, test run, `git log`) is piped through `.ai.local/scripts/dump-output.mjs` instead of being read whole: take its ≤40-line head, then `grep -n` the stored file or find it with `team-db.mjs search "<term>"`. An **interrupted producer** (tool abort, killed session) is resumed, not restarted: run the stack's compile gate on the working tree first, and when it is red hand the failing output to the same producer with a `fix and finish` brief instead of starting a second parallel attempt. When the host runtime writes no `status.json` (manual-hook hosts such as OpenCode), the resume checkpoint is `artifact-manifest.json` + `.memlog.md`; never gate a resume on a file the runtime does not produce. See **context-and-iteration** for the budget, checkpoint, resume, and refinement loop.
|
|
160
160
|
|
|
161
161
|
## Self-review & context hygiene
|
|
162
162
|
|
|
@@ -223,6 +223,8 @@ Additional states: `blocked` — a step (or a parallel producer) cannot proceed;
|
|
|
223
223
|
|
|
224
224
|
On each `subagentStop`, the hook reconciles `status.state` from the completing producer's terminal `artifact-manifest.json` receipt (`completed` \| `changes_requested` \| `validation_failed`) when agents left lifecycle fields untouched. Parent orchestrators must wait for that handoff before invoking the next step.
|
|
225
225
|
|
|
226
|
+
**A dispatch is not a completion.** When the host hands back a session handle, a job id, or control before the specialist's turn ends, the step is still open: do not dispatch the next step, do not report the step done, and do not run the chain hook until the specialist reports back and the hook records the receipt. A background handle is a start signal only.
|
|
227
|
+
|
|
226
228
|
## Pipeline step options
|
|
227
229
|
|
|
228
230
|
| Field | Use |
|
|
@@ -21,7 +21,7 @@ Shared `/task` runtime for Cursor, Claude, Mavis, and OpenCode. Seeded at **`.ai
|
|
|
21
21
|
brief.md, decomposition.md, implementation.md, review.md, …
|
|
22
22
|
figma-contract.json # frozen Figma node map + per-node spec (writer: mockup-reviewer)
|
|
23
23
|
.memlog.md # optional agent notes (hook does not parse)
|
|
24
|
-
upstream/
|
|
24
|
+
upstream/ # repository-only; not in the published package
|
|
25
25
|
prompt.md # upstream-review prompt (preset-owned; refreshed on init/update)
|
|
26
26
|
opencode.json # read-only upstream-researcher agent (preset-owned; refreshed)
|
|
27
27
|
digest-template.md # digest skeleton (preset-owned; refreshed)
|
|
@@ -35,9 +35,13 @@ Shared `/task` runtime for Cursor, Claude, Mavis, and OpenCode. Seeded at **`.ai
|
|
|
35
35
|
state.json # scheduler last-fire state (git-ignored; never commit)
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
## Upstream research
|
|
38
|
+
## Upstream research (repository-only)
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
This workflow exists only in the `@bonesofspring/ai-rules` repository: the published npm package
|
|
41
|
+
excludes the runner, the `/upstream-research` command, and the `upstream/` templates. The
|
|
42
|
+
`scheduler/jobs.json` seed is likewise absent for a consumer.
|
|
43
|
+
|
|
44
|
+
The `upstream-research` scheduler job runs `node ../scripts/upstream-research.mjs`, reads `upstream/projects.json` and `upstream/config.json`, and writes evidence under `scheduler/runs/upstream-research/<runId>/` plus one committed digest at `docs/upstream/digest-<runId>.md`.
|
|
41
45
|
|
|
42
46
|
- `init`/`update` refresh `prompt.md`, `opencode.json`, and `digest-template.md`; they seed `projects.json`, `config.json`, `signatures.json`, and `scheduler/jobs.json` only when absent.
|
|
43
47
|
- `upstream/cursor.json` is git-ignored. A lost cursor is rebuilt from the newest `report.json`, then degrades to a bounded baseline.
|
|
@@ -52,7 +52,7 @@ Decompose as a **dependency graph**: each task carries `dependsOn[]`, the edges
|
|
|
52
52
|
|
|
53
53
|
<!-- shared-core: quality/context-and-iteration.md -->
|
|
54
54
|
|
|
55
|
-
Work in bounded waves; delegate mechanical waves to repo scripts. **Checkpoint** progress to `.memlog.md` and record produced paths on the `implementation` manifest entry `authoritativePaths`, so a run can resume from `artifact-manifest.json` + `.memlog.md` without re-deriving state. Refine with the named loop **draft → evaluate against named criteria → refine**.
|
|
55
|
+
Work in bounded waves; delegate mechanical waves to repo scripts. A large command output (log, diff, test run, `git log`) is piped through `.ai.local/scripts/dump-output.mjs` instead of being read whole: take its ≤40-line head, then `grep -n` the stored file or find it with `team-db.mjs search "<term>"`. **Checkpoint** progress to `.memlog.md` and record produced paths on the `implementation` manifest entry `authoritativePaths`, so a run can resume from `artifact-manifest.json` + `.memlog.md` without re-deriving state. Refine with the named loop **draft → evaluate against named criteria → refine**.
|
|
56
56
|
|
|
57
57
|
## Self-review & context hygiene
|
|
58
58
|
|
|
@@ -1301,11 +1301,15 @@ function focusDigestMarkdown(dir, statusSnapshot) {
|
|
|
1301
1301
|
}
|
|
1302
1302
|
} catch {}
|
|
1303
1303
|
}
|
|
1304
|
+
// Five entries is enough to resume; a longer list is a status dump, not a
|
|
1305
|
+
// pointer. The line budget below still bounds a single entry with many paths.
|
|
1306
|
+
const MAX_FOCUS_ENTRIES = 5;
|
|
1307
|
+
const shownIncomplete = incomplete.slice(0, MAX_FOCUS_ENTRIES);
|
|
1304
1308
|
const pathLines = [];
|
|
1305
1309
|
if (incomplete.length === 0) pathLines.push(' - (none)');
|
|
1306
1310
|
else {
|
|
1307
|
-
for (let index = 0; index <
|
|
1308
|
-
const item =
|
|
1311
|
+
for (let index = 0; index < shownIncomplete.length; index += 1) {
|
|
1312
|
+
const item = shownIncomplete[index];
|
|
1309
1313
|
if (item.paths.length === 0) pathLines.push(' - ' + item.id + ': (none)');
|
|
1310
1314
|
else {
|
|
1311
1315
|
for (let pathIndex = 0; pathIndex < item.paths.length; pathIndex += 1) {
|
|
@@ -1313,6 +1317,9 @@ function focusDigestMarkdown(dir, statusSnapshot) {
|
|
|
1313
1317
|
}
|
|
1314
1318
|
}
|
|
1315
1319
|
}
|
|
1320
|
+
if (incomplete.length > shownIncomplete.length) {
|
|
1321
|
+
pathLines.push(' - (+' + String(incomplete.length - shownIncomplete.length) + ' more incomplete entries)');
|
|
1322
|
+
}
|
|
1316
1323
|
}
|
|
1317
1324
|
let readyLine = '- decomposition ready set: (none)';
|
|
1318
1325
|
try {
|
|
@@ -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 })),
|