@bonesofspring/ai-rules 0.2.78 → 0.2.84
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 +97 -0
- package/README.md +4 -2
- package/bin/lib/engine-scripts.js +6 -0
- package/bin/lib/merged-config.js +49 -0
- package/bin/lib/seed-ai-local-team.js +4 -0
- package/bin/mavis-install.js +53 -3
- package/docs/MAVIS-COMPATIBILITY.md +136 -8
- package/docs/PRESET-CONTRIBUTION.md +9 -0
- package/docs/TEAM-DB.md +118 -15
- package/docs/openapi/team-db.v1.json +2879 -1858
- package/package.json +8 -1
- package/presets/_shared/ai-local/scripts/check-task-repositories.mjs +282 -0
- package/presets/_shared/ai-local/scripts/check-verification.mjs +13 -6
- package/presets/_shared/ai-local/scripts/rr-migrate-repositories.mjs +531 -0
- package/presets/_shared/ai-local/scripts/run-compact.mjs +38 -10
- 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/core/agent-team/agent-team-orchestrator.md +1 -0
- package/presets/_shared/core/review/code-review-mr.md +19 -4
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +109 -1
- package/presets/_shared/hooks/compact-shell-output.mjs +16 -1
- package/presets/claude/android-kotlin/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +109 -1
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +1 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/code-review.md +19 -4
- package/presets/claude/android-kotlin/skills/code-review/SKILL.md +2 -1
- package/presets/claude/go/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +109 -1
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +1 -0
- package/presets/claude/go/rules/tooling-and-review/code-review.md +19 -4
- package/presets/claude/go/skills/code-review/SKILL.md +2 -1
- package/presets/claude/ios-swift/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +109 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +1 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +19 -4
- package/presets/claude/ios-swift/skills/code-review/SKILL.md +2 -1
- package/presets/claude/java/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/claude/java/hooks/chain-team-phases.sh +109 -1
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +1 -0
- package/presets/claude/java/rules/tooling-and-review/code-review.md +19 -4
- package/presets/claude/java/skills/code-review/SKILL.md +2 -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/commands/update.md +1 -0
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +109 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +1 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/code-review.md +19 -4
- package/presets/claude/mol/REPO_AGENTS.md +1 -1
- package/presets/claude/mol/agents/code-reviewer.md +5 -1
- package/presets/claude/mol/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/claude/mol/hooks/chain-team-phases.sh +109 -1
- package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +1 -0
- package/presets/claude/mol/rules/tooling-and-review/code-review-mr.md +19 -4
- package/presets/claude/mol/skills/code-review/SKILL.md +2 -1
- package/presets/claude/next/REPO_AGENTS.md +1 -1
- package/presets/claude/next/agents/code-reviewer.md +5 -1
- package/presets/claude/next/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/claude/next/hooks/chain-team-phases.sh +109 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +1 -0
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +19 -4
- package/presets/claude/next/skills/code-review/SKILL.md +2 -1
- package/presets/claude/nuxt/agents/code-reviewer.md +5 -1
- package/presets/claude/nuxt/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +109 -1
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +1 -0
- package/presets/claude/nuxt/rules/tooling-and-review/code-review-mr.md +19 -4
- package/presets/claude/nuxt/skills/code-review/SKILL.md +2 -1
- package/presets/claude/php-hexagonal/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +109 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +1 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/code-review.md +19 -4
- package/presets/claude/php-hexagonal/skills/code-review/SKILL.md +2 -1
- package/presets/claude/php-laravel/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +109 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +1 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/code-review.md +19 -4
- package/presets/claude/php-laravel/skills/code-review/SKILL.md +2 -1
- package/presets/claude/svelte/agents/code-reviewer.md +5 -1
- package/presets/claude/svelte/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/claude/svelte/hooks/chain-team-phases.sh +109 -1
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +1 -0
- package/presets/claude/svelte/rules/tooling-and-review/code-review-mr.md +19 -4
- package/presets/claude/svelte/skills/code-review/SKILL.md +2 -1
- package/presets/cursor/android-kotlin/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +109 -1
- package/presets/cursor/android-kotlin/hooks/compact-shell-output.mjs +16 -1
- package/presets/cursor/android-kotlin/rules/code-review-mr.mdc +19 -4
- package/presets/cursor/android-kotlin/skills/code-review/SKILL.md +2 -1
- package/presets/cursor/go/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/cursor/go/hooks/chain-team-phases.sh +109 -1
- package/presets/cursor/go/hooks/compact-shell-output.mjs +16 -1
- package/presets/cursor/go/rules/code-review-mr.mdc +19 -4
- package/presets/cursor/go/skills/code-review/SKILL.md +2 -1
- package/presets/cursor/ios-swift/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +109 -1
- package/presets/cursor/ios-swift/hooks/compact-shell-output.mjs +16 -1
- package/presets/cursor/ios-swift/rules/code-review-mr.mdc +19 -4
- package/presets/cursor/ios-swift/skills/code-review/SKILL.md +2 -1
- package/presets/cursor/java/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/cursor/java/hooks/chain-team-phases.sh +109 -1
- package/presets/cursor/java/hooks/compact-shell-output.mjs +16 -1
- package/presets/cursor/java/rules/code-review-mr.mdc +19 -4
- package/presets/cursor/java/skills/code-review/SKILL.md +2 -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/commands/update.md +1 -0
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +109 -1
- package/presets/cursor/mcp-ts/hooks/compact-shell-output.mjs +16 -1
- package/presets/cursor/mcp-ts/rules/code-review-mr.mdc +19 -4
- package/presets/cursor/mol/REPO_AGENTS.md +1 -1
- package/presets/cursor/mol/agents/code-reviewer.md +5 -1
- package/presets/cursor/mol/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/cursor/mol/hooks/chain-team-phases.sh +109 -1
- package/presets/cursor/mol/hooks/compact-shell-output.mjs +16 -1
- package/presets/cursor/mol/rules/code-review-mr.mdc +19 -4
- package/presets/cursor/mol/skills/code-review/SKILL.md +2 -1
- package/presets/cursor/next/REPO_AGENTS.md +1 -1
- package/presets/cursor/next/agents/code-reviewer.md +5 -1
- package/presets/cursor/next/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/cursor/next/hooks/README.md +2 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +109 -1
- package/presets/cursor/next/hooks/compact-shell-output.mjs +16 -1
- package/presets/cursor/next/rules/code-review-mr.mdc +19 -4
- package/presets/cursor/next/skills/code-review/SKILL.md +2 -1
- package/presets/cursor/nuxt/agents/code-reviewer.md +5 -1
- package/presets/cursor/nuxt/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +109 -1
- package/presets/cursor/nuxt/hooks/compact-shell-output.mjs +16 -1
- package/presets/cursor/nuxt/rules/code-review-mr.mdc +19 -4
- package/presets/cursor/nuxt/skills/code-review/SKILL.md +2 -1
- package/presets/cursor/php-hexagonal/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +109 -1
- package/presets/cursor/php-hexagonal/hooks/compact-shell-output.mjs +16 -1
- package/presets/cursor/php-hexagonal/rules/code-review-mr.mdc +19 -4
- package/presets/cursor/php-hexagonal/skills/code-review/SKILL.md +2 -1
- package/presets/cursor/php-laravel/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +109 -1
- package/presets/cursor/php-laravel/hooks/compact-shell-output.mjs +16 -1
- package/presets/cursor/php-laravel/rules/code-review-mr.mdc +19 -4
- package/presets/cursor/php-laravel/skills/code-review/SKILL.md +2 -1
- package/presets/cursor/svelte/agents/code-reviewer.md +5 -1
- package/presets/cursor/svelte/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +109 -1
- package/presets/cursor/svelte/hooks/compact-shell-output.mjs +16 -1
- package/presets/cursor/svelte/rules/code-review-mr.mdc +19 -4
- package/presets/cursor/svelte/skills/code-review/SKILL.md +2 -1
- package/presets/mavis/android-kotlin/MAVIS.md +9 -3
- package/presets/mavis/android-kotlin/README.md +3 -1
- package/presets/mavis/android-kotlin/adapter-map.json +111 -43
- package/presets/mavis/android-kotlin/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/mavis/android-kotlin/hooks/README.md +29 -7
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +109 -1
- package/presets/mavis/android-kotlin/hooks/mavis-chain-hook.mjs +143 -0
- package/presets/mavis/android-kotlin/hooks/run-hook.mjs +103 -0
- package/presets/mavis/android-kotlin/minimax-hooks/hooks.json +28 -0
- package/presets/mavis/android-kotlin/native-skills/README.md +15 -0
- package/presets/mavis/android-kotlin/native-skills/ci-investigation/SKILL.md +53 -0
- package/presets/mavis/android-kotlin/native-skills/code-review/SKILL.md +62 -0
- package/presets/mavis/android-kotlin/native-skills/debug-investigation/SKILL.md +72 -0
- package/presets/mavis/android-kotlin/native-skills/feature-delivery/SKILL.md +51 -0
- package/presets/mavis/android-kotlin/native-skills/instrumentation-ui-e2e/SKILL.md +23 -0
- package/presets/mavis/android-kotlin/native-skills/migrate-tasks/SKILL.md +43 -0
- package/presets/mavis/android-kotlin/native-skills/mockup-review/SKILL.md +34 -0
- package/presets/mavis/android-kotlin/native-skills/rr-migrate-repositories/SKILL.md +61 -0
- package/presets/mavis/android-kotlin/native-skills/rr-scheduler-start/SKILL.md +34 -0
- package/presets/mavis/android-kotlin/native-skills/spec-authoring/SKILL.md +31 -0
- package/presets/mavis/android-kotlin/native-skills/spec-discovery/SKILL.md +63 -0
- package/presets/mavis/android-kotlin/native-skills/spec-start/SKILL.md +31 -0
- package/presets/mavis/android-kotlin/native-skills/task/SKILL.md +79 -0
- package/presets/mavis/android-kotlin/native-skills/task-continue/SKILL.md +74 -0
- package/presets/mavis/android-kotlin/native-skills/technical-retro/SKILL.md +72 -0
- package/presets/mavis/android-kotlin/native-skills/unit-testing/SKILL.md +38 -0
- package/presets/mavis/android-kotlin/native-skills/update/SKILL.md +44 -0
- package/presets/mavis/android-kotlin/native-skills/ux-design/SKILL.md +41 -0
- package/presets/mavis/android-kotlin/native-skills/write-adr/SKILL.md +46 -0
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +1 -0
- package/presets/mavis/android-kotlin/rules/code-review-mr.md +19 -4
- package/presets/mavis/android-kotlin/skills/code-review/SKILL.md +2 -1
- package/presets/mavis/go/MAVIS.md +9 -3
- package/presets/mavis/go/README.md +3 -1
- package/presets/mavis/go/adapter-map.json +101 -39
- package/presets/mavis/go/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/mavis/go/hooks/README.md +29 -7
- package/presets/mavis/go/hooks/chain-team-phases.sh +109 -1
- package/presets/mavis/go/hooks/mavis-chain-hook.mjs +143 -0
- package/presets/mavis/go/hooks/run-hook.mjs +103 -0
- package/presets/mavis/go/minimax-hooks/hooks.json +28 -0
- package/presets/mavis/go/native-skills/README.md +15 -0
- package/presets/mavis/go/native-skills/ci-investigation/SKILL.md +24 -0
- package/presets/mavis/go/native-skills/code-review/SKILL.md +48 -0
- package/presets/mavis/go/native-skills/debug-investigation/SKILL.md +55 -0
- package/presets/mavis/go/native-skills/feature-delivery/SKILL.md +43 -0
- package/presets/mavis/go/native-skills/integration-testing/SKILL.md +21 -0
- package/presets/mavis/go/native-skills/migrate-tasks/SKILL.md +43 -0
- package/presets/mavis/go/native-skills/rr-migrate-repositories/SKILL.md +61 -0
- package/presets/mavis/go/native-skills/rr-scheduler-start/SKILL.md +34 -0
- package/presets/mavis/go/native-skills/spec-authoring/SKILL.md +31 -0
- package/presets/mavis/go/native-skills/spec-discovery/SKILL.md +63 -0
- package/presets/mavis/go/native-skills/spec-start/SKILL.md +31 -0
- package/presets/mavis/go/native-skills/task/SKILL.md +77 -0
- package/presets/mavis/go/native-skills/task-continue/SKILL.md +72 -0
- package/presets/mavis/go/native-skills/technical-retro/SKILL.md +72 -0
- package/presets/mavis/go/native-skills/unit-testing/SKILL.md +20 -0
- package/presets/mavis/go/native-skills/update/SKILL.md +44 -0
- package/presets/mavis/go/native-skills/write-adr/SKILL.md +46 -0
- package/presets/mavis/go/rules/agent-team-orchestrator.md +1 -0
- package/presets/mavis/go/rules/code-review-mr.md +19 -4
- package/presets/mavis/go/skills/code-review/SKILL.md +2 -1
- package/presets/mavis/ios-swift/MAVIS.md +9 -3
- package/presets/mavis/ios-swift/README.md +3 -1
- package/presets/mavis/ios-swift/adapter-map.json +111 -43
- package/presets/mavis/ios-swift/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/mavis/ios-swift/hooks/README.md +29 -7
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +109 -1
- package/presets/mavis/ios-swift/hooks/mavis-chain-hook.mjs +143 -0
- package/presets/mavis/ios-swift/hooks/run-hook.mjs +103 -0
- package/presets/mavis/ios-swift/minimax-hooks/hooks.json +28 -0
- package/presets/mavis/ios-swift/native-skills/README.md +15 -0
- package/presets/mavis/ios-swift/native-skills/ci-investigation/SKILL.md +53 -0
- package/presets/mavis/ios-swift/native-skills/code-review/SKILL.md +62 -0
- package/presets/mavis/ios-swift/native-skills/debug-investigation/SKILL.md +72 -0
- package/presets/mavis/ios-swift/native-skills/feature-delivery/SKILL.md +51 -0
- package/presets/mavis/ios-swift/native-skills/migrate-tasks/SKILL.md +43 -0
- package/presets/mavis/ios-swift/native-skills/mockup-review/SKILL.md +34 -0
- package/presets/mavis/ios-swift/native-skills/rr-migrate-repositories/SKILL.md +61 -0
- package/presets/mavis/ios-swift/native-skills/rr-scheduler-start/SKILL.md +34 -0
- package/presets/mavis/ios-swift/native-skills/spec-authoring/SKILL.md +31 -0
- package/presets/mavis/ios-swift/native-skills/spec-discovery/SKILL.md +63 -0
- package/presets/mavis/ios-swift/native-skills/spec-start/SKILL.md +31 -0
- package/presets/mavis/ios-swift/native-skills/task/SKILL.md +79 -0
- package/presets/mavis/ios-swift/native-skills/task-continue/SKILL.md +74 -0
- package/presets/mavis/ios-swift/native-skills/technical-retro/SKILL.md +72 -0
- package/presets/mavis/ios-swift/native-skills/unit-testing/SKILL.md +38 -0
- package/presets/mavis/ios-swift/native-skills/update/SKILL.md +44 -0
- package/presets/mavis/ios-swift/native-skills/ux-design/SKILL.md +41 -0
- package/presets/mavis/ios-swift/native-skills/write-adr/SKILL.md +46 -0
- package/presets/mavis/ios-swift/native-skills/xcuitest-e2e/SKILL.md +39 -0
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +1 -0
- package/presets/mavis/ios-swift/rules/code-review-mr.md +19 -4
- package/presets/mavis/ios-swift/skills/code-review/SKILL.md +2 -1
- package/presets/mavis/java/MAVIS.md +9 -3
- package/presets/mavis/java/README.md +3 -1
- package/presets/mavis/java/adapter-map.json +101 -39
- package/presets/mavis/java/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/mavis/java/hooks/README.md +29 -7
- package/presets/mavis/java/hooks/chain-team-phases.sh +109 -1
- package/presets/mavis/java/hooks/mavis-chain-hook.mjs +143 -0
- package/presets/mavis/java/hooks/run-hook.mjs +103 -0
- package/presets/mavis/java/minimax-hooks/hooks.json +28 -0
- package/presets/mavis/java/native-skills/README.md +15 -0
- package/presets/mavis/java/native-skills/ci-investigation/SKILL.md +24 -0
- package/presets/mavis/java/native-skills/code-review/SKILL.md +48 -0
- package/presets/mavis/java/native-skills/debug-investigation/SKILL.md +55 -0
- package/presets/mavis/java/native-skills/feature-delivery/SKILL.md +43 -0
- package/presets/mavis/java/native-skills/integration-testing/SKILL.md +21 -0
- package/presets/mavis/java/native-skills/migrate-tasks/SKILL.md +43 -0
- package/presets/mavis/java/native-skills/rr-migrate-repositories/SKILL.md +61 -0
- package/presets/mavis/java/native-skills/rr-scheduler-start/SKILL.md +34 -0
- package/presets/mavis/java/native-skills/spec-authoring/SKILL.md +31 -0
- package/presets/mavis/java/native-skills/spec-discovery/SKILL.md +63 -0
- package/presets/mavis/java/native-skills/spec-start/SKILL.md +31 -0
- package/presets/mavis/java/native-skills/task/SKILL.md +77 -0
- package/presets/mavis/java/native-skills/task-continue/SKILL.md +72 -0
- package/presets/mavis/java/native-skills/technical-retro/SKILL.md +72 -0
- package/presets/mavis/java/native-skills/unit-testing/SKILL.md +20 -0
- package/presets/mavis/java/native-skills/update/SKILL.md +44 -0
- package/presets/mavis/java/native-skills/write-adr/SKILL.md +46 -0
- package/presets/mavis/java/rules/agent-team-orchestrator.md +1 -0
- package/presets/mavis/java/rules/code-review-mr.md +19 -4
- package/presets/mavis/java/skills/code-review/SKILL.md +2 -1
- package/presets/mavis/mcp-ts/MAVIS.md +9 -3
- package/presets/mavis/mcp-ts/README.md +3 -1
- package/presets/mavis/mcp-ts/adapter-map.json +84 -31
- 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/commands/update.md +1 -0
- package/presets/mavis/mcp-ts/hooks/README.md +29 -7
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +109 -1
- package/presets/mavis/mcp-ts/hooks/mavis-chain-hook.mjs +143 -0
- package/presets/mavis/mcp-ts/hooks/run-hook.mjs +103 -0
- package/presets/mavis/mcp-ts/minimax-hooks/hooks.json +28 -0
- package/presets/mavis/mcp-ts/native-skills/README.md +15 -0
- package/presets/mavis/mcp-ts/native-skills/code-review/SKILL.md +31 -0
- package/presets/mavis/mcp-ts/native-skills/debug-investigation/SKILL.md +51 -0
- package/presets/mavis/mcp-ts/native-skills/feature-delivery/SKILL.md +42 -0
- package/presets/mavis/mcp-ts/native-skills/migrate-tasks/SKILL.md +43 -0
- package/presets/mavis/mcp-ts/native-skills/rr-migrate-repositories/SKILL.md +61 -0
- package/presets/mavis/mcp-ts/native-skills/rr-scheduler-start/SKILL.md +34 -0
- package/presets/mavis/mcp-ts/native-skills/spec-authoring/SKILL.md +31 -0
- package/presets/mavis/mcp-ts/native-skills/spec-discovery/SKILL.md +63 -0
- package/presets/mavis/mcp-ts/native-skills/spec-start/SKILL.md +31 -0
- package/presets/mavis/mcp-ts/native-skills/task/SKILL.md +77 -0
- package/presets/mavis/mcp-ts/native-skills/task-continue/SKILL.md +72 -0
- package/presets/mavis/mcp-ts/native-skills/technical-retro/SKILL.md +95 -0
- package/presets/mavis/mcp-ts/native-skills/unit-testing/SKILL.md +22 -0
- package/presets/mavis/mcp-ts/native-skills/update/SKILL.md +44 -0
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +1 -0
- package/presets/mavis/mcp-ts/rules/code-review-mr.md +19 -4
- package/presets/mavis/mol/MAVIS.md +9 -3
- package/presets/mavis/mol/README.md +3 -1
- package/presets/mavis/mol/REPO_AGENTS.md +1 -1
- package/presets/mavis/mol/adapter-map.json +101 -39
- package/presets/mavis/mol/agents/code-reviewer.md +5 -1
- package/presets/mavis/mol/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/mavis/mol/hooks/README.md +29 -7
- package/presets/mavis/mol/hooks/chain-team-phases.sh +109 -1
- package/presets/mavis/mol/hooks/mavis-chain-hook.mjs +143 -0
- package/presets/mavis/mol/hooks/run-hook.mjs +103 -0
- package/presets/mavis/mol/minimax-hooks/hooks.json +28 -0
- package/presets/mavis/mol/native-skills/README.md +15 -0
- package/presets/mavis/mol/native-skills/ci-investigation/SKILL.md +49 -0
- package/presets/mavis/mol/native-skills/code-review/SKILL.md +61 -0
- package/presets/mavis/mol/native-skills/debug-investigation/SKILL.md +63 -0
- package/presets/mavis/mol/native-skills/feature-delivery/SKILL.md +44 -0
- package/presets/mavis/mol/native-skills/migrate-tasks/SKILL.md +43 -0
- package/presets/mavis/mol/native-skills/rr-migrate-repositories/SKILL.md +61 -0
- package/presets/mavis/mol/native-skills/rr-scheduler-start/SKILL.md +34 -0
- package/presets/mavis/mol/native-skills/spec-authoring/SKILL.md +31 -0
- package/presets/mavis/mol/native-skills/spec-discovery/SKILL.md +63 -0
- package/presets/mavis/mol/native-skills/spec-start/SKILL.md +31 -0
- package/presets/mavis/mol/native-skills/task/SKILL.md +82 -0
- package/presets/mavis/mol/native-skills/task-continue/SKILL.md +74 -0
- package/presets/mavis/mol/native-skills/task-evil/SKILL.md +89 -0
- package/presets/mavis/mol/native-skills/technical-retro/SKILL.md +72 -0
- package/presets/mavis/mol/native-skills/unit-testing/SKILL.md +38 -0
- package/presets/mavis/mol/native-skills/update/SKILL.md +44 -0
- package/presets/mavis/mol/native-skills/write-adr/SKILL.md +46 -0
- package/presets/mavis/mol/rules/agent-team-orchestrator.md +1 -0
- package/presets/mavis/mol/rules/code-review-mr.md +19 -4
- package/presets/mavis/mol/skills/code-review/SKILL.md +2 -1
- package/presets/mavis/next/MAVIS.md +9 -3
- package/presets/mavis/next/README.md +3 -1
- package/presets/mavis/next/REPO_AGENTS.md +1 -1
- package/presets/mavis/next/adapter-map.json +135 -52
- package/presets/mavis/next/agents/code-reviewer.md +5 -1
- package/presets/mavis/next/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/mavis/next/hooks/README.md +29 -7
- package/presets/mavis/next/hooks/chain-team-phases.sh +109 -1
- package/presets/mavis/next/hooks/mavis-chain-hook.mjs +143 -0
- package/presets/mavis/next/hooks/run-hook.mjs +103 -0
- package/presets/mavis/next/minimax-hooks/hooks.json +28 -0
- package/presets/mavis/next/native-skills/README.md +15 -0
- package/presets/mavis/next/native-skills/ci-investigation/SKILL.md +50 -0
- package/presets/mavis/next/native-skills/code-review/SKILL.md +62 -0
- package/presets/mavis/next/native-skills/debug-investigation/SKILL.md +64 -0
- package/presets/mavis/next/native-skills/feature-delivery/SKILL.md +45 -0
- package/presets/mavis/next/native-skills/figma-fidelity/SKILL.md +131 -0
- package/presets/mavis/next/native-skills/migrate-tasks/SKILL.md +43 -0
- package/presets/mavis/next/native-skills/mockup-review/SKILL.md +44 -0
- package/presets/mavis/next/native-skills/playwright-e2e/SKILL.md +39 -0
- package/presets/mavis/next/native-skills/react-performance/SKILL.md +49 -0
- package/presets/mavis/next/native-skills/rr-migrate-repositories/SKILL.md +61 -0
- package/presets/mavis/next/native-skills/rr-scheduler-start/SKILL.md +34 -0
- package/presets/mavis/next/native-skills/spec-authoring/SKILL.md +31 -0
- package/presets/mavis/next/native-skills/spec-discovery/SKILL.md +63 -0
- package/presets/mavis/next/native-skills/spec-start/SKILL.md +31 -0
- package/presets/mavis/next/native-skills/task/SKILL.md +88 -0
- package/presets/mavis/next/native-skills/task-continue/SKILL.md +87 -0
- package/presets/mavis/next/native-skills/task-evil/SKILL.md +89 -0
- package/presets/mavis/next/native-skills/technical-retro/SKILL.md +72 -0
- package/presets/mavis/next/native-skills/ui-start/SKILL.md +64 -0
- package/presets/mavis/next/native-skills/ui-stop/SKILL.md +48 -0
- package/presets/mavis/next/native-skills/unit-testing/SKILL.md +40 -0
- package/presets/mavis/next/native-skills/update/SKILL.md +44 -0
- package/presets/mavis/next/native-skills/ux-design/SKILL.md +41 -0
- package/presets/mavis/next/native-skills/write-adr/SKILL.md +46 -0
- package/presets/mavis/next/rules/agent-team-orchestrator.md +1 -0
- package/presets/mavis/next/rules/code-review-mr.md +19 -4
- package/presets/mavis/next/skills/code-review/SKILL.md +2 -1
- package/presets/mavis/nuxt/MAVIS.md +9 -3
- package/presets/mavis/nuxt/README.md +3 -1
- package/presets/mavis/nuxt/adapter-map.json +116 -45
- package/presets/mavis/nuxt/agents/code-reviewer.md +5 -1
- package/presets/mavis/nuxt/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/mavis/nuxt/hooks/README.md +29 -7
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +109 -1
- package/presets/mavis/nuxt/hooks/mavis-chain-hook.mjs +143 -0
- package/presets/mavis/nuxt/hooks/run-hook.mjs +103 -0
- package/presets/mavis/nuxt/minimax-hooks/hooks.json +28 -0
- package/presets/mavis/nuxt/native-skills/README.md +15 -0
- package/presets/mavis/nuxt/native-skills/ci-investigation/SKILL.md +50 -0
- package/presets/mavis/nuxt/native-skills/code-review/SKILL.md +61 -0
- package/presets/mavis/nuxt/native-skills/debug-investigation/SKILL.md +64 -0
- package/presets/mavis/nuxt/native-skills/feature-delivery/SKILL.md +52 -0
- package/presets/mavis/nuxt/native-skills/migrate-tasks/SKILL.md +43 -0
- package/presets/mavis/nuxt/native-skills/mockup-review/SKILL.md +34 -0
- package/presets/mavis/nuxt/native-skills/playwright-e2e/SKILL.md +43 -0
- package/presets/mavis/nuxt/native-skills/rr-migrate-repositories/SKILL.md +61 -0
- package/presets/mavis/nuxt/native-skills/rr-scheduler-start/SKILL.md +34 -0
- package/presets/mavis/nuxt/native-skills/spec-authoring/SKILL.md +31 -0
- package/presets/mavis/nuxt/native-skills/spec-discovery/SKILL.md +63 -0
- package/presets/mavis/nuxt/native-skills/spec-start/SKILL.md +31 -0
- package/presets/mavis/nuxt/native-skills/task/SKILL.md +79 -0
- package/presets/mavis/nuxt/native-skills/task-continue/SKILL.md +74 -0
- package/presets/mavis/nuxt/native-skills/technical-retro/SKILL.md +72 -0
- package/presets/mavis/nuxt/native-skills/unit-testing/SKILL.md +38 -0
- package/presets/mavis/nuxt/native-skills/update/SKILL.md +44 -0
- package/presets/mavis/nuxt/native-skills/ux-design/SKILL.md +41 -0
- package/presets/mavis/nuxt/native-skills/vue-performance/SKILL.md +58 -0
- package/presets/mavis/nuxt/native-skills/write-adr/SKILL.md +46 -0
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +1 -0
- package/presets/mavis/nuxt/rules/code-review-mr.md +19 -4
- package/presets/mavis/nuxt/skills/code-review/SKILL.md +2 -1
- package/presets/mavis/php-hexagonal/MAVIS.md +9 -3
- package/presets/mavis/php-hexagonal/README.md +3 -1
- package/presets/mavis/php-hexagonal/adapter-map.json +101 -39
- package/presets/mavis/php-hexagonal/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/mavis/php-hexagonal/hooks/README.md +29 -7
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +109 -1
- package/presets/mavis/php-hexagonal/hooks/mavis-chain-hook.mjs +143 -0
- package/presets/mavis/php-hexagonal/hooks/run-hook.mjs +103 -0
- package/presets/mavis/php-hexagonal/minimax-hooks/hooks.json +28 -0
- package/presets/mavis/php-hexagonal/native-skills/README.md +15 -0
- package/presets/mavis/php-hexagonal/native-skills/ci-investigation/SKILL.md +24 -0
- package/presets/mavis/php-hexagonal/native-skills/code-review/SKILL.md +48 -0
- package/presets/mavis/php-hexagonal/native-skills/debug-investigation/SKILL.md +55 -0
- package/presets/mavis/php-hexagonal/native-skills/feature-delivery/SKILL.md +43 -0
- package/presets/mavis/php-hexagonal/native-skills/integration-testing/SKILL.md +21 -0
- package/presets/mavis/php-hexagonal/native-skills/migrate-tasks/SKILL.md +43 -0
- package/presets/mavis/php-hexagonal/native-skills/rr-migrate-repositories/SKILL.md +61 -0
- package/presets/mavis/php-hexagonal/native-skills/rr-scheduler-start/SKILL.md +34 -0
- package/presets/mavis/php-hexagonal/native-skills/spec-authoring/SKILL.md +31 -0
- package/presets/mavis/php-hexagonal/native-skills/spec-discovery/SKILL.md +63 -0
- package/presets/mavis/php-hexagonal/native-skills/spec-start/SKILL.md +31 -0
- package/presets/mavis/php-hexagonal/native-skills/task/SKILL.md +77 -0
- package/presets/mavis/php-hexagonal/native-skills/task-continue/SKILL.md +72 -0
- package/presets/mavis/php-hexagonal/native-skills/technical-retro/SKILL.md +72 -0
- package/presets/mavis/php-hexagonal/native-skills/unit-testing/SKILL.md +20 -0
- package/presets/mavis/php-hexagonal/native-skills/update/SKILL.md +44 -0
- package/presets/mavis/php-hexagonal/native-skills/write-adr/SKILL.md +46 -0
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +1 -0
- package/presets/mavis/php-hexagonal/rules/code-review-mr.md +19 -4
- package/presets/mavis/php-hexagonal/skills/code-review/SKILL.md +2 -1
- package/presets/mavis/php-laravel/MAVIS.md +9 -3
- package/presets/mavis/php-laravel/README.md +3 -1
- package/presets/mavis/php-laravel/adapter-map.json +101 -39
- package/presets/mavis/php-laravel/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/mavis/php-laravel/hooks/README.md +29 -7
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +109 -1
- package/presets/mavis/php-laravel/hooks/mavis-chain-hook.mjs +143 -0
- package/presets/mavis/php-laravel/hooks/run-hook.mjs +103 -0
- package/presets/mavis/php-laravel/minimax-hooks/hooks.json +28 -0
- package/presets/mavis/php-laravel/native-skills/README.md +15 -0
- package/presets/mavis/php-laravel/native-skills/ci-investigation/SKILL.md +24 -0
- package/presets/mavis/php-laravel/native-skills/code-review/SKILL.md +48 -0
- package/presets/mavis/php-laravel/native-skills/debug-investigation/SKILL.md +55 -0
- package/presets/mavis/php-laravel/native-skills/feature-delivery/SKILL.md +43 -0
- package/presets/mavis/php-laravel/native-skills/integration-testing/SKILL.md +21 -0
- package/presets/mavis/php-laravel/native-skills/migrate-tasks/SKILL.md +43 -0
- package/presets/mavis/php-laravel/native-skills/rr-migrate-repositories/SKILL.md +61 -0
- package/presets/mavis/php-laravel/native-skills/rr-scheduler-start/SKILL.md +34 -0
- package/presets/mavis/php-laravel/native-skills/spec-authoring/SKILL.md +31 -0
- package/presets/mavis/php-laravel/native-skills/spec-discovery/SKILL.md +63 -0
- package/presets/mavis/php-laravel/native-skills/spec-start/SKILL.md +31 -0
- package/presets/mavis/php-laravel/native-skills/task/SKILL.md +77 -0
- package/presets/mavis/php-laravel/native-skills/task-continue/SKILL.md +72 -0
- package/presets/mavis/php-laravel/native-skills/technical-retro/SKILL.md +72 -0
- package/presets/mavis/php-laravel/native-skills/unit-testing/SKILL.md +20 -0
- package/presets/mavis/php-laravel/native-skills/update/SKILL.md +44 -0
- package/presets/mavis/php-laravel/native-skills/write-adr/SKILL.md +46 -0
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +1 -0
- package/presets/mavis/php-laravel/rules/code-review-mr.md +19 -4
- package/presets/mavis/php-laravel/skills/code-review/SKILL.md +2 -1
- package/presets/mavis/platform-contract.json +18 -5
- package/presets/mavis/svelte/MAVIS.md +9 -3
- package/presets/mavis/svelte/README.md +3 -1
- package/presets/mavis/svelte/adapter-map.json +116 -45
- package/presets/mavis/svelte/agents/code-reviewer.md +5 -1
- package/presets/mavis/svelte/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/mavis/svelte/hooks/README.md +29 -7
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +109 -1
- package/presets/mavis/svelte/hooks/mavis-chain-hook.mjs +143 -0
- package/presets/mavis/svelte/hooks/run-hook.mjs +103 -0
- package/presets/mavis/svelte/minimax-hooks/hooks.json +28 -0
- package/presets/mavis/svelte/native-skills/README.md +15 -0
- package/presets/mavis/svelte/native-skills/ci-investigation/SKILL.md +50 -0
- package/presets/mavis/svelte/native-skills/code-review/SKILL.md +61 -0
- package/presets/mavis/svelte/native-skills/debug-investigation/SKILL.md +64 -0
- package/presets/mavis/svelte/native-skills/feature-delivery/SKILL.md +52 -0
- package/presets/mavis/svelte/native-skills/migrate-tasks/SKILL.md +43 -0
- package/presets/mavis/svelte/native-skills/mockup-review/SKILL.md +34 -0
- package/presets/mavis/svelte/native-skills/playwright-e2e/SKILL.md +43 -0
- package/presets/mavis/svelte/native-skills/rr-migrate-repositories/SKILL.md +61 -0
- package/presets/mavis/svelte/native-skills/rr-scheduler-start/SKILL.md +34 -0
- package/presets/mavis/svelte/native-skills/spec-authoring/SKILL.md +31 -0
- package/presets/mavis/svelte/native-skills/spec-discovery/SKILL.md +63 -0
- package/presets/mavis/svelte/native-skills/spec-start/SKILL.md +31 -0
- package/presets/mavis/svelte/native-skills/svelte-performance/SKILL.md +57 -0
- package/presets/mavis/svelte/native-skills/task/SKILL.md +79 -0
- package/presets/mavis/svelte/native-skills/task-continue/SKILL.md +74 -0
- package/presets/mavis/svelte/native-skills/technical-retro/SKILL.md +72 -0
- package/presets/mavis/svelte/native-skills/unit-testing/SKILL.md +38 -0
- package/presets/mavis/svelte/native-skills/update/SKILL.md +44 -0
- package/presets/mavis/svelte/native-skills/ux-design/SKILL.md +41 -0
- package/presets/mavis/svelte/native-skills/write-adr/SKILL.md +46 -0
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +1 -0
- package/presets/mavis/svelte/rules/code-review-mr.md +19 -4
- package/presets/mavis/svelte/skills/code-review/SKILL.md +2 -1
- package/presets/opencode/android-kotlin/adapter-map.json +9 -1
- package/presets/opencode/android-kotlin/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +109 -1
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +1 -0
- package/presets/opencode/android-kotlin/rules/code-review-mr.md +19 -4
- package/presets/opencode/android-kotlin/skills/code-review/SKILL.md +2 -1
- package/presets/opencode/go/adapter-map.json +9 -1
- package/presets/opencode/go/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/opencode/go/hooks/chain-team-phases.sh +109 -1
- package/presets/opencode/go/rules/agent-team-orchestrator.md +1 -0
- package/presets/opencode/go/rules/code-review-mr.md +19 -4
- package/presets/opencode/go/skills/code-review/SKILL.md +2 -1
- package/presets/opencode/ios-swift/adapter-map.json +9 -1
- package/presets/opencode/ios-swift/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +109 -1
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +1 -0
- package/presets/opencode/ios-swift/rules/code-review-mr.md +19 -4
- package/presets/opencode/ios-swift/skills/code-review/SKILL.md +2 -1
- package/presets/opencode/java/adapter-map.json +9 -1
- package/presets/opencode/java/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/opencode/java/hooks/chain-team-phases.sh +109 -1
- package/presets/opencode/java/rules/agent-team-orchestrator.md +1 -0
- package/presets/opencode/java/rules/code-review-mr.md +19 -4
- package/presets/opencode/java/skills/code-review/SKILL.md +2 -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/commands/update.md +1 -0
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +109 -1
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +1 -0
- package/presets/opencode/mcp-ts/rules/code-review-mr.md +19 -4
- package/presets/opencode/mol/REPO_AGENTS.md +1 -1
- package/presets/opencode/mol/adapter-map.json +9 -1
- package/presets/opencode/mol/agents/code-reviewer.md +5 -1
- package/presets/opencode/mol/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/opencode/mol/hooks/chain-team-phases.sh +109 -1
- package/presets/opencode/mol/rules/agent-team-orchestrator.md +1 -0
- package/presets/opencode/mol/rules/code-review-mr.md +19 -4
- package/presets/opencode/mol/skills/code-review/SKILL.md +2 -1
- package/presets/opencode/next/REPO_AGENTS.md +1 -1
- package/presets/opencode/next/adapter-map.json +9 -1
- package/presets/opencode/next/agents/code-reviewer.md +5 -1
- package/presets/opencode/next/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/opencode/next/hooks/chain-team-phases.sh +109 -1
- package/presets/opencode/next/rules/agent-team-orchestrator.md +1 -0
- package/presets/opencode/next/rules/code-review-mr.md +19 -4
- package/presets/opencode/next/skills/code-review/SKILL.md +2 -1
- package/presets/opencode/nuxt/adapter-map.json +9 -1
- package/presets/opencode/nuxt/agents/code-reviewer.md +5 -1
- package/presets/opencode/nuxt/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +109 -1
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +1 -0
- package/presets/opencode/nuxt/rules/code-review-mr.md +19 -4
- package/presets/opencode/nuxt/skills/code-review/SKILL.md +2 -1
- package/presets/opencode/php-hexagonal/adapter-map.json +9 -1
- package/presets/opencode/php-hexagonal/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +109 -1
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +1 -0
- package/presets/opencode/php-hexagonal/rules/code-review-mr.md +19 -4
- package/presets/opencode/php-hexagonal/skills/code-review/SKILL.md +2 -1
- package/presets/opencode/php-laravel/adapter-map.json +9 -1
- package/presets/opencode/php-laravel/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +109 -1
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +1 -0
- package/presets/opencode/php-laravel/rules/code-review-mr.md +19 -4
- package/presets/opencode/php-laravel/skills/code-review/SKILL.md +2 -1
- package/presets/opencode/plugins/task-status/README.md +16 -7
- package/presets/opencode/plugins/task-status/deepseek.ts +217 -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/code-reviewer.md +5 -1
- package/presets/opencode/svelte/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +109 -1
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +1 -0
- package/presets/opencode/svelte/rules/code-review-mr.md +19 -4
- package/presets/opencode/svelte/skills/code-review/SKILL.md +2 -1
- package/presets/zcode/android-kotlin/adapter-map.json +9 -1
- package/presets/zcode/android-kotlin/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +109 -1
- package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +1 -0
- package/presets/zcode/android-kotlin/rules/code-review-mr.md +19 -4
- package/presets/zcode/android-kotlin/skills/code-review/SKILL.md +2 -1
- package/presets/zcode/go/adapter-map.json +9 -1
- package/presets/zcode/go/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/zcode/go/hooks/chain-team-phases.sh +109 -1
- package/presets/zcode/go/rules/agent-team-orchestrator.md +1 -0
- package/presets/zcode/go/rules/code-review-mr.md +19 -4
- package/presets/zcode/go/skills/code-review/SKILL.md +2 -1
- package/presets/zcode/ios-swift/adapter-map.json +9 -1
- package/presets/zcode/ios-swift/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +109 -1
- package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +1 -0
- package/presets/zcode/ios-swift/rules/code-review-mr.md +19 -4
- package/presets/zcode/ios-swift/skills/code-review/SKILL.md +2 -1
- package/presets/zcode/java/adapter-map.json +9 -1
- package/presets/zcode/java/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/zcode/java/hooks/chain-team-phases.sh +109 -1
- package/presets/zcode/java/rules/agent-team-orchestrator.md +1 -0
- package/presets/zcode/java/rules/code-review-mr.md +19 -4
- package/presets/zcode/java/skills/code-review/SKILL.md +2 -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/commands/update.md +1 -0
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +109 -1
- package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +1 -0
- package/presets/zcode/mcp-ts/rules/code-review-mr.md +19 -4
- package/presets/zcode/mol/REPO_AGENTS.md +1 -1
- package/presets/zcode/mol/adapter-map.json +9 -1
- package/presets/zcode/mol/agents/code-reviewer.md +5 -1
- package/presets/zcode/mol/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/zcode/mol/hooks/chain-team-phases.sh +109 -1
- package/presets/zcode/mol/rules/agent-team-orchestrator.md +1 -0
- package/presets/zcode/mol/rules/code-review-mr.md +19 -4
- package/presets/zcode/mol/skills/code-review/SKILL.md +2 -1
- package/presets/zcode/next/REPO_AGENTS.md +1 -1
- package/presets/zcode/next/adapter-map.json +9 -1
- package/presets/zcode/next/agents/code-reviewer.md +5 -1
- package/presets/zcode/next/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/zcode/next/hooks/chain-team-phases.sh +109 -1
- package/presets/zcode/next/rules/agent-team-orchestrator.md +1 -0
- package/presets/zcode/next/rules/code-review-mr.md +19 -4
- package/presets/zcode/next/skills/code-review/SKILL.md +2 -1
- package/presets/zcode/nuxt/adapter-map.json +9 -1
- package/presets/zcode/nuxt/agents/code-reviewer.md +5 -1
- package/presets/zcode/nuxt/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +109 -1
- package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +1 -0
- package/presets/zcode/nuxt/rules/code-review-mr.md +19 -4
- package/presets/zcode/nuxt/skills/code-review/SKILL.md +2 -1
- package/presets/zcode/php-hexagonal/adapter-map.json +9 -1
- package/presets/zcode/php-hexagonal/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +109 -1
- package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +1 -0
- package/presets/zcode/php-hexagonal/rules/code-review-mr.md +19 -4
- package/presets/zcode/php-hexagonal/skills/code-review/SKILL.md +2 -1
- package/presets/zcode/php-laravel/adapter-map.json +9 -1
- package/presets/zcode/php-laravel/agents/code-reviewer.md +5 -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/commands/update.md +1 -0
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +109 -1
- package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +1 -0
- package/presets/zcode/php-laravel/rules/code-review-mr.md +19 -4
- package/presets/zcode/php-laravel/skills/code-review/SKILL.md +2 -1
- package/presets/zcode/svelte/adapter-map.json +9 -1
- package/presets/zcode/svelte/agents/code-reviewer.md +5 -1
- package/presets/zcode/svelte/agents/task-router.md +3 -1
- 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/commands/update.md +1 -0
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +109 -1
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +1 -0
- package/presets/zcode/svelte/rules/code-review-mr.md +19 -4
- package/presets/zcode/svelte/skills/code-review/SKILL.md +2 -1
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `/rr-migrate-repositories`: turn the repositories already on disk into
|
|
4
|
+
* registry records, then project the file into the team database.
|
|
5
|
+
*
|
|
6
|
+
* The registry file stays local-only and is never committed. This script does
|
|
7
|
+
* not write it directly: it sends one `repositories apply` envelope for the
|
|
8
|
+
* missing records, one `repositories put` per changed record, and finishes with
|
|
9
|
+
* `repositories project`, so the lock-guarded verb remains the only writer
|
|
10
|
+
* (ADR 0006 / ADR 0007).
|
|
11
|
+
*
|
|
12
|
+
* Scan rules:
|
|
13
|
+
* - a directory with `.git` is a repository; the walk does not descend into it;
|
|
14
|
+
* - a `.git` file that points at `.git/modules/**` or `.git/worktrees/**` is a
|
|
15
|
+
* submodule or a linked worktree, not a repository of its own, and is skipped;
|
|
16
|
+
* - hidden directories, `node_modules`, and symlinked directories are skipped;
|
|
17
|
+
* - repositories with one remote are collapsed to the shallowest clone.
|
|
18
|
+
* - a remote URL is stored without its clone-time credentials, so a token in
|
|
19
|
+
* `remote.origin.url` never reaches the registry or the projection.
|
|
20
|
+
*
|
|
21
|
+
* Records are never deleted: a repository absent from the current scan may have
|
|
22
|
+
* been moved, or the scan may cover only part of the disk. An absent record's id
|
|
23
|
+
* is reused only with `--reuse-orphan-ids`: a same-named clone can just as well
|
|
24
|
+
* be a different repository, and a silent reuse re-points every task link.
|
|
25
|
+
*
|
|
26
|
+
* Usage:
|
|
27
|
+
* node .ai.local/scripts/rr-migrate-repositories.mjs [options]
|
|
28
|
+
*
|
|
29
|
+
* Options:
|
|
30
|
+
* --scan <dir> directory to scan; repeatable (default: the parent of the repo root, or the repo root when that parent is $HOME)
|
|
31
|
+
* --depth <n> directory levels below a scan root (default 4)
|
|
32
|
+
* --team-root <dir> team store root (default: <repo-root>/.ai.local/team)
|
|
33
|
+
* --repo-root <dir> repository whose parent is scanned by default (default: git toplevel, else cwd)
|
|
34
|
+
* --dry-run print the plan and write nothing
|
|
35
|
+
* --no-update create missing records only; never update an existing one
|
|
36
|
+
* --reuse-orphan-ids reuse an absent record's id for a same-named clone (a renamed remote)
|
|
37
|
+
* --json machine-readable summary
|
|
38
|
+
* --help
|
|
39
|
+
*
|
|
40
|
+
* Exit codes: 0 ok (including the kill-switch and no-sqlite fallbacks), 1 a
|
|
41
|
+
* child verb failed, 2 usage.
|
|
42
|
+
*/
|
|
43
|
+
import { spawnSync } from 'node:child_process';
|
|
44
|
+
import fs from 'node:fs';
|
|
45
|
+
import os from 'node:os';
|
|
46
|
+
import path from 'node:path';
|
|
47
|
+
import { fileURLToPath } from 'node:url';
|
|
48
|
+
|
|
49
|
+
const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
50
|
+
const TEAM_DB = path.join(SCRIPT_DIR, 'team-db.mjs');
|
|
51
|
+
const MAX_ID_LENGTH = 48;
|
|
52
|
+
const MAX_NAME_LENGTH = 120;
|
|
53
|
+
const DEFAULT_DEPTH = 4;
|
|
54
|
+
const SKIP_DIRS = new Set(['node_modules', 'Library', 'Applications']);
|
|
55
|
+
const DISABLED_LINE = 'disabled by AI_RULES_TEAM_DB_DISABLE';
|
|
56
|
+
|
|
57
|
+
export const USAGE = `Usage: node .ai.local/scripts/rr-migrate-repositories.mjs [options]
|
|
58
|
+
|
|
59
|
+
--scan <dir> directory to scan; repeatable (default: the parent of the repo root, or the repo root when that parent is $HOME)
|
|
60
|
+
--depth <n> directory levels below a scan root (default ${DEFAULT_DEPTH})
|
|
61
|
+
--team-root <dir> team store root (default: <repo-root>/.ai.local/team)
|
|
62
|
+
--repo-root <dir> repository whose parent is scanned by default
|
|
63
|
+
--dry-run print the plan and write nothing
|
|
64
|
+
--no-update create missing records only; never update an existing one
|
|
65
|
+
--reuse-orphan-ids reuse an absent record's id for a same-named clone (a renamed remote)
|
|
66
|
+
--json machine-readable summary
|
|
67
|
+
--help this text`;
|
|
68
|
+
|
|
69
|
+
const usageError = (message) => {
|
|
70
|
+
console.error(`rr-migrate-repositories: ${message}\n\n${USAGE}`);
|
|
71
|
+
process.exit(2);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const isRemoteLocator = (value) => /^(git\+|git@|ssh:\/\/|https?:\/\/)/.test(value);
|
|
75
|
+
|
|
76
|
+
/** Case-, protocol-, and `.git`-insensitive remote identity. */
|
|
77
|
+
export const normaliseLocator = (locator) =>
|
|
78
|
+
String(locator)
|
|
79
|
+
.trim()
|
|
80
|
+
.toLowerCase()
|
|
81
|
+
.replace(/^git\+/, '')
|
|
82
|
+
.replace(/^ssh:\/\/git@/, '')
|
|
83
|
+
.replace(/^git@([^:]+):/, '$1/')
|
|
84
|
+
// A clone-time credential is not part of a repository's identity.
|
|
85
|
+
.replace(/^(?:https?|ssh|git):\/\/[^/@]*@/, '')
|
|
86
|
+
.replace(/^(?:https?|ssh|git):\/\//, '')
|
|
87
|
+
.replace(/\.git\/?$/, '')
|
|
88
|
+
.replace(/\/+$/, '');
|
|
89
|
+
|
|
90
|
+
/** The same locator with any clone-time credential removed. */
|
|
91
|
+
export const redactCredentials = (locator) =>
|
|
92
|
+
String(locator)
|
|
93
|
+
.trim()
|
|
94
|
+
.replace(/^(git\+)?(https?|ssh|git):\/\/[^/@]*@/i, '$1$2://');
|
|
95
|
+
|
|
96
|
+
/** A stable registry key for a remote URL or an absolute path. */
|
|
97
|
+
export const locatorKey = (locator) => {
|
|
98
|
+
const value = String(locator).trim();
|
|
99
|
+
return isRemoteLocator(value) ? `remote:${normaliseLocator(value)}` : `local:${path.resolve(value)}`;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const slugify = (value) => {
|
|
103
|
+
const slug = String(value)
|
|
104
|
+
.toLowerCase()
|
|
105
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
106
|
+
.replace(/^-+|-+$/g, '');
|
|
107
|
+
return slug.slice(0, MAX_ID_LENGTH).replace(/-+$/, '') || 'repository';
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const depthOf = (value) => value.split(/[\\/]/).filter(Boolean).length;
|
|
111
|
+
|
|
112
|
+
const repoMarker = (directory) => {
|
|
113
|
+
const marker = path.join(directory, '.git');
|
|
114
|
+
let stat;
|
|
115
|
+
try {
|
|
116
|
+
stat = fs.lstatSync(marker);
|
|
117
|
+
} catch {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
if (stat.isDirectory()) return { kind: 'directory' };
|
|
121
|
+
if (!stat.isFile()) return null;
|
|
122
|
+
const firstLine = fs.readFileSync(marker, 'utf8').split('\n')[0] ?? '';
|
|
123
|
+
const target = firstLine.replace(/^gitdir:\s*/, '').replace(/\\/g, '/');
|
|
124
|
+
return /\/(?:modules|worktrees)\//.test(target) ? { kind: 'linked' } : { kind: 'file' };
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const gitValue = (directory, args) => {
|
|
128
|
+
const result = spawnSync('git', ['-C', directory, ...args], { encoding: 'utf8' });
|
|
129
|
+
return result.status === 0 ? result.stdout.trim() : '';
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/** `isTruthy` in team-db-schema.mjs: only these spellings disable writes. */
|
|
133
|
+
const isDisabled = (value) => {
|
|
134
|
+
if (typeof value !== 'string') return false;
|
|
135
|
+
return ['1', 'true', 'yes'].includes(value.trim().toLowerCase());
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
/** Walk one scan root. A repository is reported and never descended into. */
|
|
139
|
+
export const collectFromRoot = (root, depth) => {
|
|
140
|
+
const found = [];
|
|
141
|
+
const skipped = [];
|
|
142
|
+
|
|
143
|
+
const visit = (directory, remaining) => {
|
|
144
|
+
let real;
|
|
145
|
+
try {
|
|
146
|
+
real = fs.realpathSync(directory);
|
|
147
|
+
} catch {
|
|
148
|
+
skipped.push({ path: directory, reason: 'unreadable' });
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const marker = repoMarker(directory);
|
|
152
|
+
if (marker !== null) {
|
|
153
|
+
if (marker.kind === 'linked') {
|
|
154
|
+
skipped.push({ path: directory, reason: 'submodule-or-worktree' });
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const remote = redactCredentials(gitValue(directory, ['config', '--get', 'remote.origin.url']));
|
|
158
|
+
found.push({
|
|
159
|
+
path: directory,
|
|
160
|
+
real,
|
|
161
|
+
name: path.basename(directory),
|
|
162
|
+
remote,
|
|
163
|
+
locator: remote || real,
|
|
164
|
+
});
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (remaining <= 0) return;
|
|
168
|
+
let entries;
|
|
169
|
+
try {
|
|
170
|
+
entries = fs.readdirSync(directory, { withFileTypes: true });
|
|
171
|
+
} catch {
|
|
172
|
+
skipped.push({ path: directory, reason: 'unreadable' });
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
for (const entry of entries.sort((left, right) => left.name.localeCompare(right.name))) {
|
|
176
|
+
if (!entry.isDirectory()) continue;
|
|
177
|
+
if (entry.name.startsWith('.')) continue;
|
|
178
|
+
if (SKIP_DIRS.has(entry.name)) continue;
|
|
179
|
+
visit(path.join(directory, entry.name), remaining - 1);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
visit(root, depth);
|
|
184
|
+
return { found, skipped };
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/** Collapse clones of one remote (or one local path); keep the shallowest path. */
|
|
188
|
+
export const dedupeRepositories = (found) => {
|
|
189
|
+
const groups = new Map();
|
|
190
|
+
for (const entry of found) {
|
|
191
|
+
const key = locatorKey(entry.locator);
|
|
192
|
+
if (!groups.has(key)) groups.set(key, []);
|
|
193
|
+
groups.get(key).push(entry);
|
|
194
|
+
}
|
|
195
|
+
const repositories = [];
|
|
196
|
+
const duplicates = [];
|
|
197
|
+
for (const group of groups.values()) {
|
|
198
|
+
group.sort((left, right) => depthOf(left.path) - depthOf(right.path) || left.path.localeCompare(right.path));
|
|
199
|
+
const [representative, ...rest] = group;
|
|
200
|
+
repositories.push(representative);
|
|
201
|
+
for (const entry of rest) duplicates.push({ path: entry.path, duplicateOf: representative.path });
|
|
202
|
+
}
|
|
203
|
+
repositories.sort((left, right) => left.path.localeCompare(right.path));
|
|
204
|
+
return { repositories, duplicates };
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
const limitId = (value) => value.slice(0, MAX_ID_LENGTH).replace(/-+$/, '') || 'repository';
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Assign an id to every scanned repository. A record whose locator already
|
|
211
|
+
* exists keeps its id, so a re-run never renames or duplicates a record.
|
|
212
|
+
*/
|
|
213
|
+
export const assignIds = (repositories, existingRecords, { reuseOrphanIds = false } = {}) => {
|
|
214
|
+
const existingByKey = new Map();
|
|
215
|
+
const existingById = new Map();
|
|
216
|
+
for (const record of existingRecords) {
|
|
217
|
+
existingByKey.set(locatorKey(record.locator), record);
|
|
218
|
+
existingById.set(record.id, record);
|
|
219
|
+
}
|
|
220
|
+
const matched = new Set();
|
|
221
|
+
for (const entry of repositories) {
|
|
222
|
+
const known = existingByKey.get(locatorKey(entry.locator));
|
|
223
|
+
if (known !== undefined) matched.add(known.id);
|
|
224
|
+
}
|
|
225
|
+
const used = new Set(existingRecords.map((record) => record.id));
|
|
226
|
+
const reused = new Set();
|
|
227
|
+
const planned = [];
|
|
228
|
+
|
|
229
|
+
for (const entry of repositories) {
|
|
230
|
+
const key = locatorKey(entry.locator);
|
|
231
|
+
const known = existingByKey.get(key);
|
|
232
|
+
let id = known ? known.id : slugify(entry.name);
|
|
233
|
+
let orphanCandidate = null;
|
|
234
|
+
if (!known) {
|
|
235
|
+
// An absent record whose directory name matches is a candidate for a
|
|
236
|
+
// renamed remote — reported, and reused only on request, because the same
|
|
237
|
+
// name can just as well be a different repository.
|
|
238
|
+
const orphan = existingById.get(id);
|
|
239
|
+
if (orphan !== undefined && !matched.has(id) && !reused.has(id)) {
|
|
240
|
+
orphanCandidate = { id: orphan.id, locator: orphan.locator };
|
|
241
|
+
}
|
|
242
|
+
if (orphanCandidate !== null && reuseOrphanIds) {
|
|
243
|
+
reused.add(id);
|
|
244
|
+
} else if (used.has(id)) {
|
|
245
|
+
const parent = slugify(path.basename(path.dirname(entry.path)));
|
|
246
|
+
let candidate = limitId(`${parent}-${id}`);
|
|
247
|
+
let counter = 2;
|
|
248
|
+
while (used.has(candidate)) {
|
|
249
|
+
const suffix = `-${counter}`;
|
|
250
|
+
candidate = limitId(`${id.slice(0, MAX_ID_LENGTH - suffix.length)}${suffix}`);
|
|
251
|
+
counter += 1;
|
|
252
|
+
}
|
|
253
|
+
id = candidate;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
used.add(id);
|
|
257
|
+
planned.push({
|
|
258
|
+
...entry,
|
|
259
|
+
id,
|
|
260
|
+
orphanCandidate,
|
|
261
|
+
orphanReused: orphanCandidate !== null && reuseOrphanIds,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
return planned;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
const trimName = (value) => {
|
|
268
|
+
const name = String(value).trim();
|
|
269
|
+
return (name.length > MAX_NAME_LENGTH ? name.slice(0, MAX_NAME_LENGTH) : name) || 'repository';
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
/** Split the planned scan into create / update / unchanged against the file. */
|
|
273
|
+
export const derivePlan = (planned, existingRecords, { update = true } = {}) => {
|
|
274
|
+
const existingById = new Map(existingRecords.map((record) => [record.id, record]));
|
|
275
|
+
const create = [];
|
|
276
|
+
const updateRows = [];
|
|
277
|
+
const unchanged = [];
|
|
278
|
+
|
|
279
|
+
for (const entry of planned) {
|
|
280
|
+
const name = trimName(entry.name);
|
|
281
|
+
const prior = existingById.get(entry.id) ?? null;
|
|
282
|
+
if (prior === null) {
|
|
283
|
+
create.push({
|
|
284
|
+
id: entry.id,
|
|
285
|
+
name,
|
|
286
|
+
locator: entry.locator,
|
|
287
|
+
description: null,
|
|
288
|
+
labels: null,
|
|
289
|
+
status: 'active',
|
|
290
|
+
});
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
const same =
|
|
294
|
+
prior.name === name &&
|
|
295
|
+
locatorKey(prior.locator) === locatorKey(entry.locator) &&
|
|
296
|
+
// A credential-bearing locator written by an older run is rewritten.
|
|
297
|
+
prior.locator === entry.locator &&
|
|
298
|
+
prior.status === 'active';
|
|
299
|
+
if (same) {
|
|
300
|
+
unchanged.push(entry.id);
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
if (!update) {
|
|
304
|
+
unchanged.push(entry.id);
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
updateRows.push({
|
|
308
|
+
id: entry.id,
|
|
309
|
+
name,
|
|
310
|
+
locator: entry.locator,
|
|
311
|
+
description: prior.description ?? null,
|
|
312
|
+
labels: prior.labels ?? null,
|
|
313
|
+
status: 'active',
|
|
314
|
+
revision: prior.revision,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const scannedIds = new Set(planned.map((entry) => entry.id));
|
|
319
|
+
const notOnDisk = existingRecords.filter((record) => !scannedIds.has(record.id)).map((record) => record.id);
|
|
320
|
+
return { create, update: updateRows, unchanged, notOnDisk };
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
const parseArgs = (argv) => {
|
|
324
|
+
const options = {
|
|
325
|
+
scans: [],
|
|
326
|
+
depth: DEFAULT_DEPTH,
|
|
327
|
+
teamRoot: null,
|
|
328
|
+
repoRoot: null,
|
|
329
|
+
dryRun: false,
|
|
330
|
+
update: true,
|
|
331
|
+
reuseOrphanIds: false,
|
|
332
|
+
json: false,
|
|
333
|
+
};
|
|
334
|
+
const value = (token, index) => {
|
|
335
|
+
const next = argv[index + 1];
|
|
336
|
+
if (next === undefined || next.startsWith('-')) usageError(`${token} needs a value`);
|
|
337
|
+
return next;
|
|
338
|
+
};
|
|
339
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
340
|
+
const token = argv[index];
|
|
341
|
+
if (token === '--scan') {
|
|
342
|
+
options.scans.push(path.resolve(value(token, index)));
|
|
343
|
+
index += 1;
|
|
344
|
+
} else if (token === '--depth') {
|
|
345
|
+
const raw = value(token, index);
|
|
346
|
+
if (!/^\d+$/.test(raw)) usageError('--depth must be a non-negative integer');
|
|
347
|
+
options.depth = Number(raw);
|
|
348
|
+
index += 1;
|
|
349
|
+
} else if (token === '--team-root') {
|
|
350
|
+
options.teamRoot = path.resolve(value(token, index));
|
|
351
|
+
index += 1;
|
|
352
|
+
} else if (token === '--repo-root') {
|
|
353
|
+
options.repoRoot = path.resolve(value(token, index));
|
|
354
|
+
index += 1;
|
|
355
|
+
} else if (token === '--dry-run') {
|
|
356
|
+
options.dryRun = true;
|
|
357
|
+
} else if (token === '--no-update') {
|
|
358
|
+
options.update = false;
|
|
359
|
+
} else if (token === '--reuse-orphan-ids') {
|
|
360
|
+
options.reuseOrphanIds = true;
|
|
361
|
+
} else if (token === '--json') {
|
|
362
|
+
options.json = true;
|
|
363
|
+
} else if (token === '--help' || token === '-h') {
|
|
364
|
+
console.log(USAGE);
|
|
365
|
+
process.exit(0);
|
|
366
|
+
} else {
|
|
367
|
+
usageError(`unknown option ${token}`);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return options;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
const gitToplevel = (directory) => {
|
|
374
|
+
const top = gitValue(directory, ['rev-parse', '--show-toplevel']);
|
|
375
|
+
return top === '' ? null : path.resolve(top);
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
/** Siblings of the repo; a repo directly in `$HOME` scans itself, not the whole home. */
|
|
379
|
+
const defaultScanRoot = (repoRoot) => {
|
|
380
|
+
const parent = path.dirname(repoRoot);
|
|
381
|
+
return parent === os.homedir() ? repoRoot : parent;
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
const parseJsonOutput = (text) => {
|
|
385
|
+
const lines = String(text)
|
|
386
|
+
.split('\n')
|
|
387
|
+
.map((line) => line.trim())
|
|
388
|
+
.filter(Boolean);
|
|
389
|
+
for (let index = lines.length - 1; index >= 0; index -= 1) {
|
|
390
|
+
if (!lines[index].startsWith('{')) continue;
|
|
391
|
+
try {
|
|
392
|
+
return JSON.parse(lines[index]);
|
|
393
|
+
} catch {
|
|
394
|
+
// keep looking for the machine-readable line
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return null;
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
const runTeamDb = (args, input) => {
|
|
401
|
+
if (!fs.existsSync(TEAM_DB)) {
|
|
402
|
+
console.error(`rr-migrate-repositories: missing ${TEAM_DB}`);
|
|
403
|
+
process.exit(1);
|
|
404
|
+
}
|
|
405
|
+
const result = spawnSync(process.execPath, [TEAM_DB, ...args, '--json'], {
|
|
406
|
+
input,
|
|
407
|
+
encoding: 'utf8',
|
|
408
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
409
|
+
});
|
|
410
|
+
if (result.error) {
|
|
411
|
+
console.error(`rr-migrate-repositories: ${result.error.message}`);
|
|
412
|
+
process.exit(1);
|
|
413
|
+
}
|
|
414
|
+
if (result.status !== 0) {
|
|
415
|
+
const message = (result.stderr || result.stdout || '').trim();
|
|
416
|
+
console.error(`rr-migrate-repositories: repositories ${args[1]} failed (exit ${result.status})`);
|
|
417
|
+
if (message !== '') console.error(message);
|
|
418
|
+
process.exit(1);
|
|
419
|
+
}
|
|
420
|
+
return { summary: parseJsonOutput(result.stdout) };
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
function main() {
|
|
424
|
+
const options = parseArgs(process.argv.slice(2));
|
|
425
|
+
if (!fs.existsSync(TEAM_DB)) {
|
|
426
|
+
console.error(`rr-migrate-repositories: ${TEAM_DB} not found; run this from an installed preset`);
|
|
427
|
+
process.exit(1);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
const repoRoot = options.repoRoot ?? gitToplevel(process.cwd()) ?? process.cwd();
|
|
431
|
+
const teamRoot =
|
|
432
|
+
options.teamRoot ??
|
|
433
|
+
(process.env.AI_RULES_TEAM_ROOT ? path.resolve(process.env.AI_RULES_TEAM_ROOT) : path.join(repoRoot, '.ai.local', 'team'));
|
|
434
|
+
const roots = options.scans.length > 0 ? options.scans : [defaultScanRoot(repoRoot)];
|
|
435
|
+
for (const root of roots) {
|
|
436
|
+
if (!fs.existsSync(root) || !fs.statSync(root).isDirectory()) usageError(`scan root is not a directory: ${root}`);
|
|
437
|
+
if (path.parse(root).root === root) usageError(`refusing to scan a filesystem root: ${root}`);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
const collected = [];
|
|
441
|
+
const skipped = [];
|
|
442
|
+
for (const root of roots) {
|
|
443
|
+
const result = collectFromRoot(root, options.depth);
|
|
444
|
+
collected.push(...result.found);
|
|
445
|
+
skipped.push(...result.skipped);
|
|
446
|
+
}
|
|
447
|
+
const { repositories, duplicates } = dedupeRepositories(collected);
|
|
448
|
+
|
|
449
|
+
const listed = runTeamDb(['repositories', 'list', '--root', teamRoot]).summary;
|
|
450
|
+
const existing = Array.isArray(listed?.repositories) ? listed.repositories : [];
|
|
451
|
+
const planned = assignIds(repositories, existing, { reuseOrphanIds: options.reuseOrphanIds });
|
|
452
|
+
const plan = derivePlan(planned, existing, { update: options.update });
|
|
453
|
+
const orphanCandidates = planned
|
|
454
|
+
.filter((entry) => entry.orphanCandidate !== null)
|
|
455
|
+
.map((entry) => ({
|
|
456
|
+
id: entry.orphanCandidate.id,
|
|
457
|
+
previousLocator: entry.orphanCandidate.locator,
|
|
458
|
+
locator: entry.locator,
|
|
459
|
+
path: entry.path,
|
|
460
|
+
reused: entry.orphanReused,
|
|
461
|
+
}));
|
|
462
|
+
|
|
463
|
+
const disabled = isDisabled(process.env.AI_RULES_TEAM_DB_DISABLE);
|
|
464
|
+
const summary = {
|
|
465
|
+
ok: true,
|
|
466
|
+
dryRun: options.dryRun || disabled,
|
|
467
|
+
disabled,
|
|
468
|
+
roots,
|
|
469
|
+
teamRoot,
|
|
470
|
+
scanned: collected.length,
|
|
471
|
+
repositories: planned.length,
|
|
472
|
+
duplicates: duplicates.length,
|
|
473
|
+
skipped: skipped.length,
|
|
474
|
+
orphanCandidates,
|
|
475
|
+
registry: {
|
|
476
|
+
existing: existing.length,
|
|
477
|
+
create: plan.create.length,
|
|
478
|
+
update: plan.update.length,
|
|
479
|
+
unchanged: plan.unchanged.length,
|
|
480
|
+
notOnDisk: plan.notOnDisk.length,
|
|
481
|
+
},
|
|
482
|
+
applied: { created: 0, updated: 0 },
|
|
483
|
+
projection: null,
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
if (!options.dryRun && !disabled) {
|
|
487
|
+
if (plan.create.length > 0) {
|
|
488
|
+
const applied = runTeamDb(
|
|
489
|
+
['repositories', 'apply', '--file', '-', '--root', teamRoot],
|
|
490
|
+
JSON.stringify({ repositories: plan.create }),
|
|
491
|
+
);
|
|
492
|
+
summary.applied.created = applied.summary?.repositories ?? plan.create.length;
|
|
493
|
+
}
|
|
494
|
+
for (const record of plan.update) {
|
|
495
|
+
runTeamDb(['repositories', 'put', '--file', '-', '--root', teamRoot], JSON.stringify(record));
|
|
496
|
+
summary.applied.updated += 1;
|
|
497
|
+
}
|
|
498
|
+
const projected = runTeamDb(['repositories', 'project', '--root', teamRoot]);
|
|
499
|
+
summary.projection = projected.summary?.projection ?? null;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
if (options.json) {
|
|
503
|
+
process.stdout.write(`${JSON.stringify(summary)}\n`);
|
|
504
|
+
} else {
|
|
505
|
+
console.log(`scan: roots=${roots.length} scanned=${summary.scanned} repositories=${summary.repositories} duplicates=${summary.duplicates} skipped=${summary.skipped}`);
|
|
506
|
+
console.log(
|
|
507
|
+
`registry: existing=${summary.registry.existing} create=${summary.registry.create} update=${summary.registry.update} unchanged=${summary.registry.unchanged} not-on-disk=${summary.registry.notOnDisk}`,
|
|
508
|
+
);
|
|
509
|
+
for (const candidate of orphanCandidates) {
|
|
510
|
+
console.log(
|
|
511
|
+
`orphan-id: ${candidate.id} ${candidate.reused ? 'reused' : 'available'} was=${candidate.previousLocator} now=${candidate.locator} path=${candidate.path}`,
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
if (!options.reuseOrphanIds && orphanCandidates.length > 0) {
|
|
515
|
+
console.log('orphan-id: pass --reuse-orphan-ids to treat a same-named clone as a renamed remote');
|
|
516
|
+
}
|
|
517
|
+
if (summary.dryRun) {
|
|
518
|
+
console.log(disabled ? DISABLED_LINE : 'dry-run: nothing written');
|
|
519
|
+
if (disabled) console.log('run with AI_RULES_TEAM_DB_DISABLE unset to write');
|
|
520
|
+
} else {
|
|
521
|
+
console.log(`apply: created=${summary.applied.created} updated=${summary.applied.updated}`);
|
|
522
|
+
if (summary.projection !== null) {
|
|
523
|
+
console.log(
|
|
524
|
+
`project: repositories=${summary.projection.repositories ?? 0} links=${summary.projection.links ?? 0} attributions=${summary.projection.attributions ?? 0}`,
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
if (process.argv[1] !== undefined && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) main();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Run a command, store its combined output, and print a short view.
|
|
3
3
|
// Exit with the child status so a passing store cannot hide a failing test.
|
|
4
|
+
// The child writes straight into a file: a buffer cap here would kill a verbose
|
|
5
|
+
// run and report a failure the command never produced.
|
|
4
6
|
|
|
5
7
|
import { spawnSync } from 'node:child_process';
|
|
6
8
|
import fs from 'node:fs';
|
|
@@ -12,7 +14,7 @@ import { resolveTeamRoot } from './dump-output.mjs';
|
|
|
12
14
|
const PASS_THROUGH_BYTES = 4096;
|
|
13
15
|
const HEAD_LINES = 40;
|
|
14
16
|
const HEAD_BYTES = 8 * 1024;
|
|
15
|
-
const
|
|
17
|
+
const SCAN_BYTES = 8 * 1024 * 1024;
|
|
16
18
|
const FAIL_LINE = /\b(FAIL|ERROR|Error|AssertionError)\b|✗|×/u;
|
|
17
19
|
|
|
18
20
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -50,6 +52,24 @@ const footerOf = (dumpStdout) =>
|
|
|
50
52
|
.filter((line) => line.startsWith('bytes: ') || line.startsWith('path: ') || line.startsWith('grep -n '))
|
|
51
53
|
.join('\n');
|
|
52
54
|
|
|
55
|
+
/** First `limit` bytes of a file, so a multi-gigabyte dump never lands in memory. */
|
|
56
|
+
const readHead = (file, limit) => {
|
|
57
|
+
const fd = fs.openSync(file, 'r');
|
|
58
|
+
try {
|
|
59
|
+
const size = Math.min(fs.fstatSync(fd).size, limit);
|
|
60
|
+
const buffer = Buffer.alloc(size);
|
|
61
|
+
let read = 0;
|
|
62
|
+
while (read < size) {
|
|
63
|
+
const chunk = fs.readSync(fd, buffer, read, size - read, read);
|
|
64
|
+
if (chunk === 0) break;
|
|
65
|
+
read += chunk;
|
|
66
|
+
}
|
|
67
|
+
return buffer.subarray(0, read).toString('utf8');
|
|
68
|
+
} finally {
|
|
69
|
+
fs.closeSync(fd);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
53
73
|
const failureLines = (text) => {
|
|
54
74
|
const lines = text.split('\n');
|
|
55
75
|
if (lines.length > 0 && lines[lines.length - 1] === '') lines.pop();
|
|
@@ -81,16 +101,24 @@ const viewFor = ({ dumpStdout, storedText, storedBytes }) => {
|
|
|
81
101
|
const run = ({ task, root, child }) => {
|
|
82
102
|
const teamRoot = root ? path.resolve(root) : resolveTeamRoot(process.cwd());
|
|
83
103
|
if (!teamRoot) usageFail('no .ai.local/team found above the current directory; pass --root <team-dir>');
|
|
84
|
-
const captured = spawnSync(child[0], child.slice(1), {
|
|
85
|
-
cwd: process.cwd(),
|
|
86
|
-
maxBuffer: CAPTURE_BYTES,
|
|
87
|
-
});
|
|
88
|
-
const status = captured.status ?? 128;
|
|
89
|
-
const body = Buffer.concat([captured.stdout ?? Buffer.alloc(0), captured.stderr ?? Buffer.alloc(0)]);
|
|
90
104
|
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'run-compact-'));
|
|
91
105
|
const input = path.join(dir, 'output.bin');
|
|
92
106
|
try {
|
|
93
|
-
fs.
|
|
107
|
+
const fd = fs.openSync(input, 'w');
|
|
108
|
+
let captured;
|
|
109
|
+
try {
|
|
110
|
+
captured = spawnSync(child[0], child.slice(1), {
|
|
111
|
+
cwd: process.cwd(),
|
|
112
|
+
stdio: ['ignore', fd, fd],
|
|
113
|
+
});
|
|
114
|
+
} finally {
|
|
115
|
+
fs.closeSync(fd);
|
|
116
|
+
}
|
|
117
|
+
if (captured.error) {
|
|
118
|
+
process.stderr.write(`run-compact: ${captured.error.message}\n`);
|
|
119
|
+
return 127;
|
|
120
|
+
}
|
|
121
|
+
const status = captured.status ?? 128;
|
|
94
122
|
const stored = spawnSync(
|
|
95
123
|
process.execPath,
|
|
96
124
|
[dumpScript, '--input', input, '--task', task, '--label', 'compact', '--root', teamRoot],
|
|
@@ -101,8 +129,8 @@ const run = ({ task, root, child }) => {
|
|
|
101
129
|
return status;
|
|
102
130
|
}
|
|
103
131
|
const storedBytesMatch = stored.stdout.match(/^bytes: (\d+)/m);
|
|
104
|
-
const storedBytes = storedBytesMatch ? Number(storedBytesMatch[1]) :
|
|
105
|
-
const storedText =
|
|
132
|
+
const storedBytes = storedBytesMatch ? Number(storedBytesMatch[1]) : fs.statSync(input).size;
|
|
133
|
+
const storedText = readHead(input, SCAN_BYTES);
|
|
106
134
|
const view = viewFor({ dumpStdout: stored.stdout, storedText, storedBytes });
|
|
107
135
|
const shownBytes = Buffer.byteLength(view);
|
|
108
136
|
process.stdout.write(view);
|