@bonesofspring/ai-rules 0.2.78 → 0.2.80
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 +47 -0
- package/README.md +4 -2
- package/bin/lib/engine-scripts.js +6 -0
- package/bin/lib/seed-ai-local-team.js +2 -0
- package/docs/TEAM-DB.md +118 -15
- package/docs/openapi/team-db.v1.json +2879 -1858
- package/package.json +5 -1
- package/presets/_shared/ai-local/scripts/check-task-repositories.mjs +264 -0
- package/presets/_shared/ai-local/scripts/rr-migrate-repositories.mjs +481 -0
- package/presets/_shared/ai-local/scripts/team-db-api.mjs +211 -12
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +289 -3
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +857 -1
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +68 -0
- package/presets/_shared/ai-local/scripts/team-db-tracker.mjs +29 -10
- package/presets/_shared/ai-local/scripts/team-db.mjs +46 -1
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +69 -1
- package/presets/claude/android-kotlin/agents/task-router.md +2 -0
- package/presets/claude/android-kotlin/commands/README.md +1 -0
- package/presets/claude/android-kotlin/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/android-kotlin/commands/task.md +4 -0
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/go/agents/task-router.md +2 -0
- package/presets/claude/go/commands/README.md +1 -0
- package/presets/claude/go/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/go/commands/task.md +4 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/ios-swift/agents/task-router.md +2 -0
- package/presets/claude/ios-swift/commands/README.md +1 -0
- package/presets/claude/ios-swift/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/ios-swift/commands/task.md +4 -0
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/java/agents/task-router.md +2 -0
- package/presets/claude/java/commands/README.md +1 -0
- package/presets/claude/java/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/java/commands/task.md +4 -0
- package/presets/claude/java/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/mcp-ts/agents/task-router.md +2 -0
- package/presets/claude/mcp-ts/commands/README.md +1 -0
- package/presets/claude/mcp-ts/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/mcp-ts/commands/task.md +4 -0
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/mol/agents/task-router.md +2 -0
- package/presets/claude/mol/commands/README.md +1 -0
- package/presets/claude/mol/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/mol/commands/task.md +4 -0
- package/presets/claude/mol/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/next/agents/task-router.md +2 -0
- package/presets/claude/next/commands/README.md +1 -0
- package/presets/claude/next/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/next/commands/task.md +4 -0
- package/presets/claude/next/commands/ui-start.md +12 -4
- package/presets/claude/next/commands/ui-stop.md +5 -2
- package/presets/claude/next/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/nuxt/agents/task-router.md +2 -0
- package/presets/claude/nuxt/commands/README.md +1 -0
- package/presets/claude/nuxt/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/nuxt/commands/task.md +4 -0
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/php-hexagonal/agents/task-router.md +2 -0
- package/presets/claude/php-hexagonal/commands/README.md +1 -0
- package/presets/claude/php-hexagonal/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/php-hexagonal/commands/task.md +4 -0
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/php-laravel/agents/task-router.md +2 -0
- package/presets/claude/php-laravel/commands/README.md +1 -0
- package/presets/claude/php-laravel/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/php-laravel/commands/task.md +4 -0
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +69 -1
- package/presets/claude/svelte/agents/task-router.md +2 -0
- package/presets/claude/svelte/commands/README.md +1 -0
- package/presets/claude/svelte/commands/rr-migrate-repositories.md +59 -0
- package/presets/claude/svelte/commands/task.md +4 -0
- package/presets/claude/svelte/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/android-kotlin/agents/task-router.md +2 -0
- package/presets/cursor/android-kotlin/commands/README.md +1 -0
- package/presets/cursor/android-kotlin/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/android-kotlin/commands/task.md +4 -0
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/go/agents/task-router.md +2 -0
- package/presets/cursor/go/commands/README.md +1 -0
- package/presets/cursor/go/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/go/commands/task.md +4 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/ios-swift/agents/task-router.md +2 -0
- package/presets/cursor/ios-swift/commands/README.md +1 -0
- package/presets/cursor/ios-swift/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/ios-swift/commands/task.md +4 -0
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/java/agents/task-router.md +2 -0
- package/presets/cursor/java/commands/README.md +1 -0
- package/presets/cursor/java/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/java/commands/task.md +4 -0
- package/presets/cursor/java/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/mcp-ts/agents/task-router.md +2 -0
- package/presets/cursor/mcp-ts/commands/README.md +1 -0
- package/presets/cursor/mcp-ts/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/mcp-ts/commands/task.md +4 -0
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/mol/agents/task-router.md +2 -0
- package/presets/cursor/mol/commands/README.md +1 -0
- package/presets/cursor/mol/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/mol/commands/task.md +4 -0
- package/presets/cursor/mol/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/next/agents/task-router.md +2 -0
- package/presets/cursor/next/commands/README.md +1 -0
- package/presets/cursor/next/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/next/commands/task.md +4 -0
- package/presets/cursor/next/commands/ui-start.md +12 -4
- package/presets/cursor/next/commands/ui-stop.md +5 -2
- package/presets/cursor/next/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/nuxt/agents/task-router.md +2 -0
- package/presets/cursor/nuxt/commands/README.md +1 -0
- package/presets/cursor/nuxt/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/nuxt/commands/task.md +4 -0
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/php-hexagonal/agents/task-router.md +2 -0
- package/presets/cursor/php-hexagonal/commands/README.md +1 -0
- package/presets/cursor/php-hexagonal/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/php-hexagonal/commands/task.md +4 -0
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/php-laravel/agents/task-router.md +2 -0
- package/presets/cursor/php-laravel/commands/README.md +1 -0
- package/presets/cursor/php-laravel/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/php-laravel/commands/task.md +4 -0
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +69 -1
- package/presets/cursor/svelte/agents/task-router.md +2 -0
- package/presets/cursor/svelte/commands/README.md +1 -0
- package/presets/cursor/svelte/commands/rr-migrate-repositories.md +59 -0
- package/presets/cursor/svelte/commands/task.md +4 -0
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/android-kotlin/adapter-map.json +9 -1
- package/presets/mavis/android-kotlin/agents/task-router.md +2 -0
- package/presets/mavis/android-kotlin/commands/README.md +1 -0
- package/presets/mavis/android-kotlin/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/android-kotlin/commands/task.md +4 -0
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/go/adapter-map.json +9 -1
- package/presets/mavis/go/agents/task-router.md +2 -0
- package/presets/mavis/go/commands/README.md +1 -0
- package/presets/mavis/go/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/go/commands/task.md +4 -0
- package/presets/mavis/go/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/ios-swift/adapter-map.json +9 -1
- package/presets/mavis/ios-swift/agents/task-router.md +2 -0
- package/presets/mavis/ios-swift/commands/README.md +1 -0
- package/presets/mavis/ios-swift/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/ios-swift/commands/task.md +4 -0
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/java/adapter-map.json +9 -1
- package/presets/mavis/java/agents/task-router.md +2 -0
- package/presets/mavis/java/commands/README.md +1 -0
- package/presets/mavis/java/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/java/commands/task.md +4 -0
- package/presets/mavis/java/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/mcp-ts/adapter-map.json +9 -1
- package/presets/mavis/mcp-ts/agents/task-router.md +2 -0
- package/presets/mavis/mcp-ts/commands/README.md +1 -0
- package/presets/mavis/mcp-ts/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/mcp-ts/commands/task.md +4 -0
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/mol/adapter-map.json +9 -1
- package/presets/mavis/mol/agents/task-router.md +2 -0
- package/presets/mavis/mol/commands/README.md +1 -0
- package/presets/mavis/mol/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/mol/commands/task.md +4 -0
- package/presets/mavis/mol/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/next/adapter-map.json +9 -1
- package/presets/mavis/next/agents/task-router.md +2 -0
- package/presets/mavis/next/commands/README.md +1 -0
- package/presets/mavis/next/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/next/commands/task.md +4 -0
- package/presets/mavis/next/commands/ui-start.md +12 -4
- package/presets/mavis/next/commands/ui-stop.md +5 -2
- package/presets/mavis/next/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/nuxt/adapter-map.json +9 -1
- package/presets/mavis/nuxt/agents/task-router.md +2 -0
- package/presets/mavis/nuxt/commands/README.md +1 -0
- package/presets/mavis/nuxt/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/nuxt/commands/task.md +4 -0
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/php-hexagonal/adapter-map.json +9 -1
- package/presets/mavis/php-hexagonal/agents/task-router.md +2 -0
- package/presets/mavis/php-hexagonal/commands/README.md +1 -0
- package/presets/mavis/php-hexagonal/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/php-hexagonal/commands/task.md +4 -0
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/php-laravel/adapter-map.json +9 -1
- package/presets/mavis/php-laravel/agents/task-router.md +2 -0
- package/presets/mavis/php-laravel/commands/README.md +1 -0
- package/presets/mavis/php-laravel/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/php-laravel/commands/task.md +4 -0
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +69 -1
- package/presets/mavis/svelte/adapter-map.json +9 -1
- package/presets/mavis/svelte/agents/task-router.md +2 -0
- package/presets/mavis/svelte/commands/README.md +1 -0
- package/presets/mavis/svelte/commands/rr-migrate-repositories.md +54 -0
- package/presets/mavis/svelte/commands/task.md +4 -0
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/android-kotlin/adapter-map.json +9 -1
- package/presets/opencode/android-kotlin/agents/task-router.md +2 -0
- package/presets/opencode/android-kotlin/commands/README.md +1 -0
- package/presets/opencode/android-kotlin/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/android-kotlin/commands/task.md +4 -0
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/go/adapter-map.json +9 -1
- package/presets/opencode/go/agents/task-router.md +2 -0
- package/presets/opencode/go/commands/README.md +1 -0
- package/presets/opencode/go/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/go/commands/task.md +4 -0
- package/presets/opencode/go/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/ios-swift/adapter-map.json +9 -1
- package/presets/opencode/ios-swift/agents/task-router.md +2 -0
- package/presets/opencode/ios-swift/commands/README.md +1 -0
- package/presets/opencode/ios-swift/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/ios-swift/commands/task.md +4 -0
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/java/adapter-map.json +9 -1
- package/presets/opencode/java/agents/task-router.md +2 -0
- package/presets/opencode/java/commands/README.md +1 -0
- package/presets/opencode/java/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/java/commands/task.md +4 -0
- package/presets/opencode/java/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/mcp-ts/adapter-map.json +9 -1
- package/presets/opencode/mcp-ts/agents/task-router.md +2 -0
- package/presets/opencode/mcp-ts/commands/README.md +1 -0
- package/presets/opencode/mcp-ts/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/mcp-ts/commands/task.md +4 -0
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/mol/adapter-map.json +9 -1
- package/presets/opencode/mol/agents/task-router.md +2 -0
- package/presets/opencode/mol/commands/README.md +1 -0
- package/presets/opencode/mol/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/mol/commands/task.md +4 -0
- package/presets/opencode/mol/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/next/adapter-map.json +9 -1
- package/presets/opencode/next/agents/task-router.md +2 -0
- package/presets/opencode/next/commands/README.md +1 -0
- package/presets/opencode/next/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/next/commands/task.md +4 -0
- package/presets/opencode/next/commands/ui-start.md +12 -4
- package/presets/opencode/next/commands/ui-stop.md +5 -2
- package/presets/opencode/next/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/nuxt/adapter-map.json +9 -1
- package/presets/opencode/nuxt/agents/task-router.md +2 -0
- package/presets/opencode/nuxt/commands/README.md +1 -0
- package/presets/opencode/nuxt/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/nuxt/commands/task.md +4 -0
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/php-hexagonal/adapter-map.json +9 -1
- package/presets/opencode/php-hexagonal/agents/task-router.md +2 -0
- package/presets/opencode/php-hexagonal/commands/README.md +1 -0
- package/presets/opencode/php-hexagonal/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/php-hexagonal/commands/task.md +4 -0
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/php-laravel/adapter-map.json +9 -1
- package/presets/opencode/php-laravel/agents/task-router.md +2 -0
- package/presets/opencode/php-laravel/commands/README.md +1 -0
- package/presets/opencode/php-laravel/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/php-laravel/commands/task.md +4 -0
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +69 -1
- package/presets/opencode/plugins/task-status/README.md +15 -7
- package/presets/opencode/plugins/task-status/deepseek.ts +193 -0
- package/presets/opencode/plugins/task-status/details-data.ts +39 -2
- package/presets/opencode/plugins/task-status/prompt-text.ts +18 -8
- package/presets/opencode/plugins/task-status/task-view.ts +253 -63
- package/presets/opencode/plugins/task-status/tui.tsx +48 -11
- package/presets/opencode/svelte/adapter-map.json +9 -1
- package/presets/opencode/svelte/agents/task-router.md +2 -0
- package/presets/opencode/svelte/commands/README.md +1 -0
- package/presets/opencode/svelte/commands/rr-migrate-repositories.md +62 -0
- package/presets/opencode/svelte/commands/task.md +4 -0
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/android-kotlin/adapter-map.json +9 -1
- package/presets/zcode/android-kotlin/agents/task-router.md +2 -0
- package/presets/zcode/android-kotlin/commands/README.md +1 -0
- package/presets/zcode/android-kotlin/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/android-kotlin/commands/task.md +4 -0
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/go/adapter-map.json +9 -1
- package/presets/zcode/go/agents/task-router.md +2 -0
- package/presets/zcode/go/commands/README.md +1 -0
- package/presets/zcode/go/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/go/commands/task.md +4 -0
- package/presets/zcode/go/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/ios-swift/adapter-map.json +9 -1
- package/presets/zcode/ios-swift/agents/task-router.md +2 -0
- package/presets/zcode/ios-swift/commands/README.md +1 -0
- package/presets/zcode/ios-swift/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/ios-swift/commands/task.md +4 -0
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/java/adapter-map.json +9 -1
- package/presets/zcode/java/agents/task-router.md +2 -0
- package/presets/zcode/java/commands/README.md +1 -0
- package/presets/zcode/java/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/java/commands/task.md +4 -0
- package/presets/zcode/java/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/mcp-ts/adapter-map.json +9 -1
- package/presets/zcode/mcp-ts/agents/task-router.md +2 -0
- package/presets/zcode/mcp-ts/commands/README.md +1 -0
- package/presets/zcode/mcp-ts/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/mcp-ts/commands/task.md +4 -0
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/mol/adapter-map.json +9 -1
- package/presets/zcode/mol/agents/task-router.md +2 -0
- package/presets/zcode/mol/commands/README.md +1 -0
- package/presets/zcode/mol/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/mol/commands/task.md +4 -0
- package/presets/zcode/mol/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/next/adapter-map.json +9 -1
- package/presets/zcode/next/agents/task-router.md +2 -0
- package/presets/zcode/next/commands/README.md +1 -0
- package/presets/zcode/next/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/next/commands/task.md +4 -0
- package/presets/zcode/next/commands/ui-start.md +12 -4
- package/presets/zcode/next/commands/ui-stop.md +5 -2
- package/presets/zcode/next/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/nuxt/adapter-map.json +9 -1
- package/presets/zcode/nuxt/agents/task-router.md +2 -0
- package/presets/zcode/nuxt/commands/README.md +1 -0
- package/presets/zcode/nuxt/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/nuxt/commands/task.md +4 -0
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/php-hexagonal/adapter-map.json +9 -1
- package/presets/zcode/php-hexagonal/agents/task-router.md +2 -0
- package/presets/zcode/php-hexagonal/commands/README.md +1 -0
- package/presets/zcode/php-hexagonal/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/php-hexagonal/commands/task.md +4 -0
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/php-laravel/adapter-map.json +9 -1
- package/presets/zcode/php-laravel/agents/task-router.md +2 -0
- package/presets/zcode/php-laravel/commands/README.md +1 -0
- package/presets/zcode/php-laravel/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/php-laravel/commands/task.md +4 -0
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +69 -1
- package/presets/zcode/svelte/adapter-map.json +9 -1
- package/presets/zcode/svelte/agents/task-router.md +2 -0
- package/presets/zcode/svelte/commands/README.md +1 -0
- package/presets/zcode/svelte/commands/rr-migrate-repositories.md +62 -0
- package/presets/zcode/svelte/commands/task.md +4 -0
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +69 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonesofspring/ai-rules",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.80",
|
|
4
4
|
"description": "Presets of Cursor, Claude, Mavis, OpenCode, and ZCode rules/commands for Revy Ross personal use",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Revy Ross",
|
|
@@ -71,7 +71,11 @@
|
|
|
71
71
|
"check:semantic-parity": "node scripts/run-locked.mjs --label check:semantic-parity -- node scripts/check-semantic-parity.mjs",
|
|
72
72
|
"test:semantic-parity-fixtures": "node scripts/test-semantic-parity.mjs",
|
|
73
73
|
"check:intake": "node scripts/check-task-intake.mjs",
|
|
74
|
+
"check:task-repositories": "node scripts/check-task-repositories.mjs",
|
|
74
75
|
"test:task-intake-fixtures": "node scripts/test-task-intake.mjs",
|
|
76
|
+
"test:task-repositories-fixtures": "node scripts/test-task-repositories.mjs",
|
|
77
|
+
"test:backfill-repositories": "node scripts/test-backfill-repositories.mjs",
|
|
78
|
+
"test:rr-migrate-repositories": "node scripts/test-rr-migrate-repositories.mjs",
|
|
75
79
|
"check:product-specs": "bash scripts/check-product-specs.sh",
|
|
76
80
|
"check:product-specs:self-test": "bash scripts/check-product-specs.sh --self-test",
|
|
77
81
|
"check:product-specs:dogfood": "bash scripts/check-product-specs.sh ../../dogfood/mcp-ts-sample",
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Repository-intake invariant: a task folder that carries a `pipeline.json` must
|
|
4
|
+
* say which repositories the task touched — or say that it does not know.
|
|
5
|
+
*
|
|
6
|
+
* `pipeline.json` gained a mandatory `repositories` array and, when the array is
|
|
7
|
+
* empty, a `repositoriesInference: "unknown"` marker. Fixing the existing
|
|
8
|
+
* folders once fixes nothing — this gate is the part that keeps the rule true,
|
|
9
|
+
* and `check-task-repositories.mjs` is modelled on `check-task-intake.mjs` so an
|
|
10
|
+
* operator reads both gates the same way.
|
|
11
|
+
*
|
|
12
|
+
* A folder is a violation when, on or after the cutoff, its `pipeline.json`:
|
|
13
|
+
* - has no `repositories` field,
|
|
14
|
+
* - carries a value that is not an array of strings,
|
|
15
|
+
* - carries `[]` without `repositoriesInference: "unknown"`,
|
|
16
|
+
* - carries a non-empty list beside `"unknown"` (the verdict explains an empty
|
|
17
|
+
* list only),
|
|
18
|
+
* - names an id the registry does not hold (when `repositories.json` exists),
|
|
19
|
+
* - disagrees with the registry's `links[]` for that slug (the echo is
|
|
20
|
+
* derived, so a drift means someone edited the wrong file).
|
|
21
|
+
* A folder without `pipeline.json` is counted, never failed. Historical folders
|
|
22
|
+
* are counted, never failed: a folder whose first recorded artifact predates the
|
|
23
|
+
* cutoff belongs to the pre-invariant era. The date is the earliest of the
|
|
24
|
+
* folder's own artifacts (`status.json` `updatedAt`, `pipeline.json`,
|
|
25
|
+
* `prompt.md`, `goal.md`), because the chain hook rewrites `status.json` on
|
|
26
|
+
* every step and a rewritten status must not make a legacy folder look new.
|
|
27
|
+
*
|
|
28
|
+
* The slug named by `active-task.json` is excluded and printed: its intake is
|
|
29
|
+
* still in flight, the same exclusion the backfill applies (architecture §8.4),
|
|
30
|
+
* so it is judged once the task closes.
|
|
31
|
+
*
|
|
32
|
+
* Usage: node scripts/check-task-repositories.mjs [--tasks-root <dir>]
|
|
33
|
+
* [--registry <file>] [--cutoff YYYY-MM-DD] [--json]
|
|
34
|
+
* Exit 0 clean (legacy counted), 1 violation, 2 usage.
|
|
35
|
+
*/
|
|
36
|
+
import fs from 'node:fs';
|
|
37
|
+
import path from 'node:path';
|
|
38
|
+
import { fileURLToPath } from 'node:url';
|
|
39
|
+
|
|
40
|
+
const scriptDirectory = path.dirname(fileURLToPath(import.meta.url));
|
|
41
|
+
// Two homes: `packages/ai-rules/scripts` in this repository, and
|
|
42
|
+
// `<repo>/.ai.local/scripts` once `init` ships it to a consumer, where the task
|
|
43
|
+
// store sits two levels above the script rather than three.
|
|
44
|
+
const shippedToAiLocal = path.basename(path.dirname(scriptDirectory)) === '.ai.local';
|
|
45
|
+
const repoRoot = shippedToAiLocal
|
|
46
|
+
? path.dirname(path.dirname(scriptDirectory))
|
|
47
|
+
: path.resolve(scriptDirectory, '..', '..', '..');
|
|
48
|
+
|
|
49
|
+
const USAGE =
|
|
50
|
+
'Usage: node scripts/check-task-repositories.mjs [--tasks-root <dir>] [--registry <file>] [--cutoff YYYY-MM-DD] [--json]';
|
|
51
|
+
|
|
52
|
+
/** First day the repository-intake invariant applies; everything older is reported, not failed. */
|
|
53
|
+
export const TASK_REPOSITORIES_CUTOFF = '2026-11-22';
|
|
54
|
+
|
|
55
|
+
/** The only legal partner of an empty `repositories` list. */
|
|
56
|
+
export const EMPTY_LIST_INFERENCE = 'unknown';
|
|
57
|
+
|
|
58
|
+
const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
59
|
+
|
|
60
|
+
function usageError(message) {
|
|
61
|
+
console.error(`task-repositories: ${message}\n${USAGE}`);
|
|
62
|
+
process.exit(2);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function parseArgs(argv) {
|
|
66
|
+
const tasksRoot = path.join(repoRoot, '.ai.local', 'team', 'tasks');
|
|
67
|
+
const args = {
|
|
68
|
+
tasksRoot,
|
|
69
|
+
registry: path.join(path.dirname(tasksRoot), 'repositories.json'),
|
|
70
|
+
cutoff: TASK_REPOSITORIES_CUTOFF,
|
|
71
|
+
json: false,
|
|
72
|
+
explicitRoot: false,
|
|
73
|
+
};
|
|
74
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
75
|
+
const token = argv[index];
|
|
76
|
+
const value = () => {
|
|
77
|
+
const next = argv[index + 1];
|
|
78
|
+
if (next === undefined || next.startsWith('-')) usageError(`${token} needs a value`);
|
|
79
|
+
index += 1;
|
|
80
|
+
return next;
|
|
81
|
+
};
|
|
82
|
+
if (token === '--tasks-root') {
|
|
83
|
+
args.tasksRoot = path.resolve(value());
|
|
84
|
+
args.explicitRoot = true;
|
|
85
|
+
args.registry = path.join(path.dirname(args.tasksRoot), 'repositories.json');
|
|
86
|
+
} else if (token === '--registry') {
|
|
87
|
+
args.registry = path.resolve(value());
|
|
88
|
+
} else if (token === '--cutoff') {
|
|
89
|
+
const cutoff = value();
|
|
90
|
+
if (!DATE_ONLY.test(cutoff)) usageError(`--cutoff must be YYYY-MM-DD, got "${cutoff}"`);
|
|
91
|
+
args.cutoff = cutoff;
|
|
92
|
+
} else if (token === '--json') args.json = true;
|
|
93
|
+
else if (token === '--help' || token === '-h') {
|
|
94
|
+
console.log(USAGE);
|
|
95
|
+
process.exit(0);
|
|
96
|
+
} else usageError(`unknown option ${token}`);
|
|
97
|
+
}
|
|
98
|
+
return args;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The date one artifact records, or `null` when it is absent or undated.
|
|
103
|
+
*
|
|
104
|
+
* Known limit, not this gate's rule: only `status.json` is content-dated, every
|
|
105
|
+
* other artifact dates from mtime, so a restored or rsynced task store reads as
|
|
106
|
+
* new and its legacy folders turn into violations.
|
|
107
|
+
*/
|
|
108
|
+
function artifactDate(file) {
|
|
109
|
+
if (!fs.existsSync(file)) return null;
|
|
110
|
+
if (path.basename(file) === 'status.json') {
|
|
111
|
+
try {
|
|
112
|
+
const updatedAt = JSON.parse(fs.readFileSync(file, 'utf8')).updatedAt;
|
|
113
|
+
if (typeof updatedAt === 'string' && updatedAt.length >= 10) return updatedAt.slice(0, 10);
|
|
114
|
+
} catch {
|
|
115
|
+
/* an unreadable status.json is not the intake question */
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return fs.statSync(file).mtime.toISOString().slice(0, 10);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** The folder's own first date: the earliest artifact it carries. */
|
|
122
|
+
function folderDate(folder) {
|
|
123
|
+
const dates = ['status.json', 'pipeline.json', 'prompt.md', 'goal.md']
|
|
124
|
+
.map((name) => artifactDate(path.join(folder, name)))
|
|
125
|
+
.filter((date) => date !== null)
|
|
126
|
+
.sort();
|
|
127
|
+
return dates[0] ?? null;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function readJson(file) {
|
|
131
|
+
try {
|
|
132
|
+
const value = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
133
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? value : null;
|
|
134
|
+
} catch {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** The registry's view of one slug: the ids its links name, sorted. */
|
|
140
|
+
function linkedIds(registry, slug) {
|
|
141
|
+
if (registry === null) return null;
|
|
142
|
+
const ids = registry.links
|
|
143
|
+
.filter((link) => link.taskSlug === slug)
|
|
144
|
+
.map((link) => link.repositoryId)
|
|
145
|
+
.sort();
|
|
146
|
+
return ids;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function main() {
|
|
150
|
+
const args = parseArgs(process.argv.slice(2));
|
|
151
|
+
if (!fs.existsSync(args.tasksRoot)) {
|
|
152
|
+
if (args.explicitRoot) usageError(`--tasks-root is not a directory: ${args.tasksRoot}`);
|
|
153
|
+
// A fresh clone has no task store (`.ai.local/team/tasks/*` is gitignored):
|
|
154
|
+
// nothing to enforce is not a failure, and the line says which root was read.
|
|
155
|
+
console.log(`task-repositories: OK (no task store at ${args.tasksRoot})`);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const activeTaskFile = path.join(path.dirname(args.tasksRoot), 'active-task.json');
|
|
159
|
+
let activeSlug = null;
|
|
160
|
+
if (fs.existsSync(activeTaskFile)) {
|
|
161
|
+
const active = readJson(activeTaskFile);
|
|
162
|
+
if (active !== null && typeof active.slug === 'string') activeSlug = active.slug;
|
|
163
|
+
}
|
|
164
|
+
const registry = fs.existsSync(args.registry) ? readJson(args.registry) : null;
|
|
165
|
+
if (registry === undefined) usageError(`--registry is not valid JSON: ${args.registry}`);
|
|
166
|
+
const knownIds = registry === null ? null : new Set(registry.repositories.map((record) => record.id));
|
|
167
|
+
|
|
168
|
+
const folders = fs
|
|
169
|
+
.readdirSync(args.tasksRoot, { withFileTypes: true })
|
|
170
|
+
.filter((entry) => entry.isDirectory() && !entry.name.startsWith('.'))
|
|
171
|
+
.map((entry) => entry.name)
|
|
172
|
+
.sort();
|
|
173
|
+
|
|
174
|
+
const violations = [];
|
|
175
|
+
const legacy = [];
|
|
176
|
+
const excluded = [];
|
|
177
|
+
let checked = 0;
|
|
178
|
+
for (const name of folders) {
|
|
179
|
+
const folder = path.join(args.tasksRoot, name);
|
|
180
|
+
const pipelinePath = path.join(folder, 'pipeline.json');
|
|
181
|
+
if (!fs.existsSync(pipelinePath)) continue;
|
|
182
|
+
if (name === activeSlug) {
|
|
183
|
+
excluded.push(name);
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
checked += 1;
|
|
187
|
+
const pipeline = readJson(pipelinePath);
|
|
188
|
+
const date = folderDate(folder);
|
|
189
|
+
const report = (reason) => {
|
|
190
|
+
const row = { slug: name, date, reason };
|
|
191
|
+
if (date !== null && date < args.cutoff) legacy.push(row);
|
|
192
|
+
else violations.push(row);
|
|
193
|
+
};
|
|
194
|
+
if (pipeline === undefined) {
|
|
195
|
+
report('pipeline.json is not valid JSON');
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
if (!Object.prototype.hasOwnProperty.call(pipeline, 'repositories')) {
|
|
199
|
+
report('pipeline.json without repositories');
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
const listed = pipeline.repositories;
|
|
203
|
+
if (!Array.isArray(listed) || listed.some((id) => typeof id !== 'string' || id === '')) {
|
|
204
|
+
report('repositories must be an array of registry ids');
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
const inference = pipeline.repositoriesInference;
|
|
208
|
+
if (listed.length === 0) {
|
|
209
|
+
if (inference !== EMPTY_LIST_INFERENCE) {
|
|
210
|
+
report(`repositories: [] without repositoriesInference: "${EMPTY_LIST_INFERENCE}"`);
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
} else if (inference === EMPTY_LIST_INFERENCE) {
|
|
214
|
+
report('a non-empty repositories list cannot carry repositoriesInference: "unknown"');
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
if (knownIds !== null) {
|
|
218
|
+
const unknown = listed.find((id) => !knownIds.has(id));
|
|
219
|
+
if (unknown !== undefined) {
|
|
220
|
+
report(`repositories names "${unknown}", which the registry does not hold`);
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
const linked = linkedIds(registry, name);
|
|
224
|
+
const echoed = [...listed].sort();
|
|
225
|
+
if (linked !== null && linked.join('\u0000') !== echoed.join('\u0000')) {
|
|
226
|
+
report(
|
|
227
|
+
`repositories echo [${echoed.join(', ')}] disagrees with the registry links [${linked.join(', ')}]`,
|
|
228
|
+
);
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const summary = `${folders.length} task folders, ${checked} with pipeline.json${
|
|
235
|
+
legacy.length > 0 ? `, legacy before ${args.cutoff}: ${legacy.length}` : ''
|
|
236
|
+
}${excluded.length > 0 ? `, excluded (active): ${excluded.join(', ')}` : ''}`;
|
|
237
|
+
if (args.json) {
|
|
238
|
+
console.log(
|
|
239
|
+
JSON.stringify(
|
|
240
|
+
{
|
|
241
|
+
schemaVersion: 1,
|
|
242
|
+
tasksRoot: args.tasksRoot,
|
|
243
|
+
registry: registry === null ? null : args.registry,
|
|
244
|
+
cutoff: args.cutoff,
|
|
245
|
+
checked,
|
|
246
|
+
excluded,
|
|
247
|
+
violations,
|
|
248
|
+
legacy,
|
|
249
|
+
},
|
|
250
|
+
null,
|
|
251
|
+
2,
|
|
252
|
+
),
|
|
253
|
+
);
|
|
254
|
+
} else {
|
|
255
|
+
for (const row of violations) {
|
|
256
|
+
console.error(`FAIL ${row.slug}: ${row.reason}${row.date ? ` (last state ${row.date})` : ''}`);
|
|
257
|
+
}
|
|
258
|
+
if (violations.length > 0) console.error(`task-repositories: ${violations.length} violation(s) — ${summary}`);
|
|
259
|
+
else console.log(`task-repositories: OK (${summary})`);
|
|
260
|
+
}
|
|
261
|
+
if (violations.length > 0) process.exit(1);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
main();
|