@bonesofspring/ai-rules 0.2.60 → 0.2.63
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 +102 -0
- package/README.md +62 -29
- package/bin/cli.js +368 -59
- package/bin/lib/ai-local-drift.js +18 -0
- package/bin/lib/engine-scripts.js +22 -5
- package/bin/lib/engine-upgrade.js +279 -0
- package/bin/lib/mcp/catalog.js +66 -5
- package/bin/lib/mcp/clients.js +4 -4
- package/bin/lib/mcp/credentials.js +88 -0
- package/bin/lib/mcp/doctor.js +100 -8
- package/bin/lib/mcp/npx.js +17 -0
- package/bin/lib/mcp/registry.js +2 -0
- package/bin/lib/merged-config.js +38 -0
- package/bin/lib/seed-ai-local-team.js +32 -14
- package/bin/mavis-install.js +3 -1
- package/bin/opencode-install.js +3 -1
- package/bin/zcode-install.js +3 -1
- package/docs/MAVIS.md +5 -2
- package/docs/MCP-CATALOG.md +30 -2
- package/docs/MCP-SETUP.md +30 -6
- package/docs/OPENCODE.md +27 -4
- package/docs/PLATFORMS.md +38 -0
- package/docs/PRESET-CONTRIBUTION.md +27 -14
- package/docs/TEAM-DB.md +194 -21
- package/docs/openapi/team-db.v1.json +4443 -2083
- package/mcp/defectdojo-mcp.mjs +353 -0
- package/mcp/gitlab.mjs +5 -1
- package/mcp/lib/defectdojo.mjs +249 -0
- package/mcp/lib/yandex.mjs +39 -15
- package/package.json +11 -5
- package/presets/_shared/ai-local/scripts/check-write-scope.mjs +176 -28
- package/presets/_shared/ai-local/scripts/lock.mjs +128 -69
- package/presets/_shared/ai-local/scripts/signals.mjs +17 -1
- package/presets/_shared/ai-local/scripts/team-db-api.mjs +496 -67
- package/presets/_shared/ai-local/scripts/team-db-dashboard.mjs +816 -5
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +761 -6
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +10 -0
- package/presets/_shared/ai-local/scripts/team-db-scheduler.mjs +2360 -0
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +87 -0
- package/presets/_shared/ai-local/scripts/team-db.mjs +151 -9
- package/presets/_shared/ai-local/scripts/upstream-research.mjs +2961 -0
- package/presets/_shared/core/agent-team/agent-artifact-contracts.md +17 -0
- package/presets/_shared/core/agent-team/agent-team-intake.md +1 -0
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +5 -2
- package/presets/_shared/core/meta/preset-pr-checklist.md +4 -4
- package/presets/_shared/core/meta/preset-twin-sync.md +1 -1
- package/presets/_shared/hooks/README.md +23 -3
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +57 -3
- package/presets/_shared/hooks/check-preset-update.mjs +4 -3
- package/presets/{claude/nuxt/hooks/guard-shell-command.sh → _shared/hooks/guard-shell-command.mjs.tmpl} +29 -35
- package/presets/_shared/hooks/run-hook.mjs +102 -0
- package/presets/claude/android-kotlin/hooks/README.md +4 -3
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/android-kotlin/hooks/examples/README.md +2 -2
- package/presets/claude/android-kotlin/hooks/guard-shell-command.mjs +96 -0
- package/presets/claude/android-kotlin/hooks/run-hook.mjs +102 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/android-kotlin/settings.json +2 -2
- package/presets/claude/android-kotlin/team/README.md +5 -0
- package/presets/claude/go/hooks/README.md +4 -3
- package/presets/claude/go/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/go/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/go/hooks/examples/README.md +2 -2
- package/presets/claude/go/hooks/guard-shell-command.mjs +95 -0
- package/presets/claude/go/hooks/run-hook.mjs +102 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/go/settings.json +2 -2
- package/presets/claude/go/team/README.md +5 -0
- package/presets/claude/ios-swift/hooks/README.md +4 -3
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/ios-swift/hooks/examples/README.md +2 -2
- package/presets/claude/ios-swift/hooks/guard-shell-command.mjs +95 -0
- package/presets/claude/ios-swift/hooks/run-hook.mjs +102 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/ios-swift/settings.json +2 -2
- package/presets/claude/ios-swift/team/README.md +5 -0
- package/presets/claude/java/hooks/README.md +4 -3
- package/presets/claude/java/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/java/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/java/hooks/examples/README.md +2 -2
- package/presets/claude/java/hooks/{guard-shell-command.sh → guard-shell-command.mjs} +31 -38
- package/presets/claude/java/hooks/run-hook.mjs +102 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/java/settings.json +2 -2
- package/presets/claude/java/team/README.md +5 -0
- package/presets/claude/mcp-ts/hooks/README.md +4 -3
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/mcp-ts/hooks/examples/README.md +1 -1
- package/presets/claude/mcp-ts/hooks/guard-shell-command.mjs +95 -0
- package/presets/claude/mcp-ts/hooks/run-hook.mjs +102 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/mcp-ts/settings.json +2 -2
- package/presets/claude/mcp-ts/team/README.md +5 -0
- package/presets/claude/mol/hooks/README.md +20 -0
- package/presets/claude/mol/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/{svelte/hooks/guard-shell-command.sh → mol/hooks/guard-shell-command.mjs} +29 -35
- package/presets/claude/mol/hooks/run-hook.mjs +102 -0
- package/presets/claude/mol/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/mol/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/mol/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/mol/settings.json +2 -2
- package/presets/claude/mol/team/README.md +5 -0
- package/presets/claude/next/agents/build-verifier.md +18 -3
- package/presets/claude/next/agents/code-reviewer.md +2 -0
- package/presets/claude/next/agents/feature-developer.md +3 -1
- package/presets/claude/next/agents/task-analyst.md +6 -0
- package/presets/claude/next/agents/task-router.md +5 -3
- package/presets/claude/next/commands/README.md +1 -0
- package/presets/claude/next/commands/task-continue.md +1 -1
- package/presets/claude/next/commands/upstream-research.md +23 -0
- package/presets/claude/next/hooks/README.md +4 -3
- package/presets/claude/next/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/next/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/next/hooks/examples/README.md +2 -2
- package/presets/claude/next/hooks/guard-shell-command.mjs +94 -0
- package/presets/claude/next/hooks/run-hook.mjs +102 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/next/settings.json +2 -2
- package/presets/claude/next/team/README.md +23 -0
- package/presets/claude/next/team/upstream/config.json +31 -0
- package/presets/claude/next/team/upstream/digest-template.md +55 -0
- package/presets/claude/next/team/upstream/opencode.json +34 -0
- package/presets/claude/next/team/upstream/projects.json +4 -0
- package/presets/claude/next/team/upstream/prompt.md +77 -0
- package/presets/claude/next/team/upstream/signatures.json +9 -0
- package/presets/claude/nuxt/hooks/README.md +4 -3
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/nuxt/hooks/examples/README.md +2 -2
- package/presets/claude/{ios-swift/hooks/guard-shell-command.sh → nuxt/hooks/guard-shell-command.mjs} +29 -37
- package/presets/claude/nuxt/hooks/run-hook.mjs +102 -0
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/nuxt/settings.json +2 -2
- package/presets/claude/nuxt/team/README.md +5 -0
- package/presets/claude/php-hexagonal/hooks/README.md +4 -3
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/php-hexagonal/hooks/examples/README.md +2 -2
- package/presets/claude/php-hexagonal/hooks/guard-shell-command.mjs +96 -0
- package/presets/claude/php-hexagonal/hooks/run-hook.mjs +102 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/php-hexagonal/settings.json +2 -2
- package/presets/claude/php-hexagonal/team/README.md +5 -0
- package/presets/claude/php-laravel/hooks/README.md +4 -3
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/php-laravel/hooks/examples/README.md +2 -2
- package/presets/claude/php-laravel/hooks/guard-shell-command.mjs +96 -0
- package/presets/claude/php-laravel/hooks/run-hook.mjs +102 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/php-laravel/settings.json +2 -2
- package/presets/claude/php-laravel/team/README.md +5 -0
- package/presets/claude/svelte/hooks/README.md +4 -3
- package/presets/claude/svelte/hooks/chain-team-phases.sh +57 -3
- package/presets/claude/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/claude/svelte/hooks/examples/README.md +2 -2
- package/presets/claude/svelte/hooks/guard-shell-command.mjs +94 -0
- package/presets/claude/svelte/hooks/run-hook.mjs +102 -0
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-intake.md +1 -0
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +5 -2
- package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +4 -4
- package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +1 -1
- package/presets/claude/svelte/settings.json +2 -2
- package/presets/claude/svelte/team/README.md +5 -0
- package/presets/cursor/android-kotlin/hooks/README.md +2 -1
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/android-kotlin/hooks/examples/README.md +1 -1
- package/presets/cursor/android-kotlin/hooks/guard-shell-command.mjs +96 -0
- package/presets/cursor/android-kotlin/hooks/run-hook.mjs +102 -0
- package/presets/cursor/android-kotlin/hooks.json +2 -2
- package/presets/cursor/android-kotlin/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/android-kotlin/team/README.md +5 -0
- package/presets/cursor/go/hooks/README.md +2 -1
- package/presets/cursor/go/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/go/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/go/hooks/examples/README.md +1 -1
- package/presets/cursor/go/hooks/guard-shell-command.mjs +95 -0
- package/presets/cursor/go/hooks/run-hook.mjs +102 -0
- package/presets/cursor/go/hooks.json +2 -2
- package/presets/cursor/go/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/go/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/go/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/go/team/README.md +5 -0
- package/presets/cursor/ios-swift/hooks/README.md +2 -1
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/ios-swift/hooks/examples/README.md +1 -1
- package/presets/cursor/ios-swift/hooks/guard-shell-command.mjs +95 -0
- package/presets/cursor/ios-swift/hooks/run-hook.mjs +102 -0
- package/presets/cursor/ios-swift/hooks.json +2 -2
- package/presets/cursor/ios-swift/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/ios-swift/team/README.md +5 -0
- package/presets/cursor/java/hooks/README.md +2 -1
- package/presets/cursor/java/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/java/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/java/hooks/examples/README.md +1 -1
- package/presets/cursor/java/hooks/guard-shell-command.mjs +96 -0
- package/presets/cursor/java/hooks/run-hook.mjs +102 -0
- package/presets/cursor/java/hooks.json +2 -2
- package/presets/cursor/java/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/java/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/java/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/java/team/README.md +5 -0
- package/presets/cursor/mcp-ts/hooks/README.md +2 -1
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/mcp-ts/hooks/guard-shell-command.mjs +95 -0
- package/presets/cursor/mcp-ts/hooks/run-hook.mjs +102 -0
- package/presets/cursor/mcp-ts/hooks.json +2 -2
- package/presets/cursor/mcp-ts/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/mcp-ts/team/README.md +5 -0
- package/presets/cursor/mol/hooks/README.md +2 -1
- package/presets/cursor/mol/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/mol/hooks/examples/README.md +1 -1
- package/presets/{claude/next/hooks/guard-shell-command.sh → cursor/mol/hooks/guard-shell-command.mjs} +29 -35
- package/presets/cursor/mol/hooks/run-hook.mjs +102 -0
- package/presets/cursor/mol/hooks.json +2 -2
- package/presets/cursor/mol/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/mol/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/mol/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/mol/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/mol/team/README.md +5 -0
- package/presets/cursor/next/agents/build-verifier.md +18 -3
- package/presets/cursor/next/agents/code-reviewer.md +2 -0
- package/presets/cursor/next/agents/feature-developer.md +3 -1
- package/presets/cursor/next/agents/task-analyst.md +6 -0
- package/presets/cursor/next/agents/task-router.md +5 -3
- package/presets/cursor/next/commands/README.md +1 -0
- package/presets/cursor/next/commands/task-continue.md +1 -1
- package/presets/cursor/next/commands/upstream-research.md +23 -0
- package/presets/cursor/next/hooks/README.md +2 -1
- package/presets/cursor/next/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/next/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/next/hooks/examples/README.md +1 -1
- package/presets/cursor/next/hooks/guard-shell-command.mjs +94 -0
- package/presets/cursor/next/hooks/run-hook.mjs +102 -0
- package/presets/cursor/next/hooks.json +2 -2
- package/presets/cursor/next/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/next/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/next/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/next/team/README.md +23 -0
- package/presets/cursor/next/team/upstream/config.json +31 -0
- package/presets/cursor/next/team/upstream/digest-template.md +55 -0
- package/presets/cursor/next/team/upstream/opencode.json +34 -0
- package/presets/cursor/next/team/upstream/projects.json +4 -0
- package/presets/cursor/next/team/upstream/prompt.md +77 -0
- package/presets/cursor/next/team/upstream/signatures.json +9 -0
- package/presets/cursor/nuxt/hooks/README.md +2 -1
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/nuxt/hooks/examples/README.md +1 -1
- package/presets/cursor/nuxt/hooks/guard-shell-command.mjs +94 -0
- package/presets/cursor/nuxt/hooks/run-hook.mjs +102 -0
- package/presets/cursor/nuxt/hooks.json +2 -2
- package/presets/cursor/nuxt/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/nuxt/team/README.md +5 -0
- package/presets/cursor/php-hexagonal/hooks/README.md +2 -1
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/php-hexagonal/hooks/examples/README.md +1 -1
- package/presets/cursor/php-hexagonal/hooks/guard-shell-command.mjs +96 -0
- package/presets/cursor/php-hexagonal/hooks/run-hook.mjs +102 -0
- package/presets/cursor/php-hexagonal/hooks.json +2 -2
- package/presets/cursor/php-hexagonal/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/php-hexagonal/team/README.md +5 -0
- package/presets/cursor/php-laravel/hooks/README.md +2 -1
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/php-laravel/hooks/examples/README.md +1 -1
- package/presets/cursor/php-laravel/hooks/guard-shell-command.mjs +96 -0
- package/presets/cursor/php-laravel/hooks/run-hook.mjs +102 -0
- package/presets/cursor/php-laravel/hooks.json +2 -2
- package/presets/cursor/php-laravel/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/php-laravel/team/README.md +5 -0
- package/presets/cursor/svelte/hooks/README.md +2 -1
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +57 -3
- package/presets/cursor/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/cursor/svelte/hooks/examples/README.md +1 -1
- package/presets/cursor/svelte/hooks/guard-shell-command.mjs +94 -0
- package/presets/cursor/svelte/hooks/run-hook.mjs +102 -0
- package/presets/cursor/svelte/hooks.json +2 -2
- package/presets/cursor/svelte/rules/agent-team-intake.mdc +1 -0
- package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +2 -1
- package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +4 -4
- package/presets/cursor/svelte/rules/preset-twin-sync.mdc +1 -1
- package/presets/cursor/svelte/team/README.md +5 -0
- package/presets/mavis/android-kotlin/adapter-map.json +11 -3
- package/presets/mavis/android-kotlin/hooks/README.md +2 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/android-kotlin/rules/agent-team-intake.md +1 -0
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/android-kotlin/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/android-kotlin/team/README.md +5 -0
- package/presets/mavis/go/adapter-map.json +11 -3
- package/presets/mavis/go/hooks/README.md +2 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/go/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/go/rules/agent-team-intake.md +1 -0
- package/presets/mavis/go/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/go/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/go/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/go/team/README.md +5 -0
- package/presets/mavis/ios-swift/adapter-map.json +11 -3
- package/presets/mavis/ios-swift/hooks/README.md +2 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/ios-swift/rules/agent-team-intake.md +1 -0
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/ios-swift/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/ios-swift/team/README.md +5 -0
- package/presets/mavis/java/adapter-map.json +11 -3
- package/presets/mavis/java/hooks/README.md +2 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/java/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/java/rules/agent-team-intake.md +1 -0
- package/presets/mavis/java/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/java/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/java/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/java/team/README.md +5 -0
- package/presets/mavis/mcp-ts/adapter-map.json +11 -3
- package/presets/mavis/mcp-ts/hooks/README.md +2 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/mcp-ts/rules/agent-team-intake.md +1 -0
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/mcp-ts/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/mcp-ts/team/README.md +5 -0
- package/presets/mavis/mol/adapter-map.json +11 -3
- package/presets/mavis/mol/hooks/README.md +2 -1
- package/presets/mavis/mol/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/mol/rules/agent-team-intake.md +1 -0
- package/presets/mavis/mol/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/mol/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/mol/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/mol/team/README.md +5 -0
- package/presets/mavis/next/adapter-map.json +67 -3
- package/presets/mavis/next/agents/build-verifier.md +18 -3
- package/presets/mavis/next/agents/code-reviewer.md +2 -0
- package/presets/mavis/next/agents/feature-developer.md +3 -1
- package/presets/mavis/next/agents/task-analyst.md +6 -0
- package/presets/mavis/next/agents/task-router.md +5 -3
- package/presets/mavis/next/commands/README.md +1 -0
- package/presets/mavis/next/commands/task-continue.md +1 -1
- package/presets/mavis/next/commands/upstream-research.md +18 -0
- package/presets/mavis/next/hooks/README.md +2 -1
- package/presets/mavis/next/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/next/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/next/rules/agent-team-intake.md +1 -0
- package/presets/mavis/next/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/next/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/next/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/next/team/README.md +23 -0
- package/presets/mavis/next/team/upstream/config.json +31 -0
- package/presets/mavis/next/team/upstream/digest-template.md +55 -0
- package/presets/mavis/next/team/upstream/opencode.json +34 -0
- package/presets/mavis/next/team/upstream/projects.json +4 -0
- package/presets/mavis/next/team/upstream/prompt.md +77 -0
- package/presets/mavis/next/team/upstream/signatures.json +9 -0
- package/presets/mavis/nuxt/adapter-map.json +11 -3
- package/presets/mavis/nuxt/hooks/README.md +2 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/nuxt/rules/agent-team-intake.md +1 -0
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/nuxt/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/nuxt/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/nuxt/team/README.md +5 -0
- package/presets/mavis/php-hexagonal/adapter-map.json +11 -3
- package/presets/mavis/php-hexagonal/hooks/README.md +2 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/php-hexagonal/rules/agent-team-intake.md +1 -0
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/php-hexagonal/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/php-hexagonal/team/README.md +5 -0
- package/presets/mavis/php-laravel/adapter-map.json +11 -3
- package/presets/mavis/php-laravel/hooks/README.md +2 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/php-laravel/rules/agent-team-intake.md +1 -0
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/php-laravel/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/php-laravel/team/README.md +5 -0
- package/presets/mavis/svelte/adapter-map.json +11 -3
- package/presets/mavis/svelte/hooks/README.md +2 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +57 -3
- package/presets/mavis/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/mavis/svelte/rules/agent-team-intake.md +1 -0
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +5 -2
- package/presets/mavis/svelte/rules/preset-pr-checklist.md +4 -4
- package/presets/mavis/svelte/rules/preset-twin-sync.md +1 -1
- package/presets/mavis/svelte/team/README.md +5 -0
- package/presets/opencode/android-kotlin/OPENCODE.md +1 -1
- package/presets/opencode/android-kotlin/README.md +1 -1
- package/presets/opencode/android-kotlin/adapter-map.json +11 -3
- package/presets/opencode/android-kotlin/hooks/README.md +3 -2
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/android-kotlin/rules/agent-team-intake.md +1 -0
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/android-kotlin/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/android-kotlin/team/README.md +5 -0
- package/presets/opencode/go/OPENCODE.md +1 -1
- package/presets/opencode/go/README.md +1 -1
- package/presets/opencode/go/adapter-map.json +11 -3
- package/presets/opencode/go/hooks/README.md +3 -2
- package/presets/opencode/go/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/go/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/go/rules/agent-team-intake.md +1 -0
- package/presets/opencode/go/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/go/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/go/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/go/team/README.md +5 -0
- package/presets/opencode/ios-swift/OPENCODE.md +1 -1
- package/presets/opencode/ios-swift/README.md +1 -1
- package/presets/opencode/ios-swift/adapter-map.json +11 -3
- package/presets/opencode/ios-swift/hooks/README.md +3 -2
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/ios-swift/rules/agent-team-intake.md +1 -0
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/ios-swift/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/ios-swift/team/README.md +5 -0
- package/presets/opencode/java/OPENCODE.md +1 -1
- package/presets/opencode/java/README.md +1 -1
- package/presets/opencode/java/adapter-map.json +11 -3
- package/presets/opencode/java/hooks/README.md +3 -2
- package/presets/opencode/java/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/java/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/java/rules/agent-team-intake.md +1 -0
- package/presets/opencode/java/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/java/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/java/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/java/team/README.md +5 -0
- package/presets/opencode/mcp-ts/OPENCODE.md +1 -1
- package/presets/opencode/mcp-ts/README.md +1 -1
- package/presets/opencode/mcp-ts/adapter-map.json +11 -3
- package/presets/opencode/mcp-ts/hooks/README.md +3 -2
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/mcp-ts/rules/agent-team-intake.md +1 -0
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/mcp-ts/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/mcp-ts/team/README.md +5 -0
- package/presets/opencode/mol/OPENCODE.md +1 -1
- package/presets/opencode/mol/README.md +1 -1
- package/presets/opencode/mol/adapter-map.json +11 -3
- package/presets/opencode/mol/hooks/README.md +3 -2
- package/presets/opencode/mol/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/mol/rules/agent-team-intake.md +1 -0
- package/presets/opencode/mol/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/mol/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/mol/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/mol/team/README.md +5 -0
- package/presets/opencode/next/OPENCODE.md +1 -1
- package/presets/opencode/next/README.md +1 -1
- package/presets/opencode/next/adapter-map.json +67 -3
- package/presets/opencode/next/agents/build-verifier.md +18 -3
- package/presets/opencode/next/agents/code-reviewer.md +2 -0
- package/presets/opencode/next/agents/feature-developer.md +3 -1
- package/presets/opencode/next/agents/task-analyst.md +6 -0
- package/presets/opencode/next/agents/task-router.md +5 -3
- package/presets/opencode/next/commands/README.md +1 -0
- package/presets/opencode/next/commands/task-continue.md +1 -1
- package/presets/opencode/next/commands/upstream-research.md +26 -0
- package/presets/opencode/next/hooks/README.md +3 -2
- package/presets/opencode/next/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/next/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/next/rules/agent-team-intake.md +1 -0
- package/presets/opencode/next/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/next/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/next/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/next/team/README.md +23 -0
- package/presets/opencode/next/team/upstream/config.json +31 -0
- package/presets/opencode/next/team/upstream/digest-template.md +55 -0
- package/presets/opencode/next/team/upstream/opencode.json +34 -0
- package/presets/opencode/next/team/upstream/projects.json +4 -0
- package/presets/opencode/next/team/upstream/prompt.md +77 -0
- package/presets/opencode/next/team/upstream/signatures.json +9 -0
- package/presets/opencode/nuxt/OPENCODE.md +1 -1
- package/presets/opencode/nuxt/README.md +1 -1
- package/presets/opencode/nuxt/adapter-map.json +11 -3
- package/presets/opencode/nuxt/hooks/README.md +3 -2
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/nuxt/rules/agent-team-intake.md +1 -0
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/nuxt/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/nuxt/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/nuxt/team/README.md +5 -0
- package/presets/opencode/php-hexagonal/OPENCODE.md +1 -1
- package/presets/opencode/php-hexagonal/README.md +1 -1
- package/presets/opencode/php-hexagonal/adapter-map.json +11 -3
- package/presets/opencode/php-hexagonal/hooks/README.md +3 -2
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/php-hexagonal/rules/agent-team-intake.md +1 -0
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/php-hexagonal/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/php-hexagonal/team/README.md +5 -0
- package/presets/opencode/php-laravel/OPENCODE.md +1 -1
- package/presets/opencode/php-laravel/README.md +1 -1
- package/presets/opencode/php-laravel/adapter-map.json +11 -3
- package/presets/opencode/php-laravel/hooks/README.md +3 -2
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/php-laravel/rules/agent-team-intake.md +1 -0
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/php-laravel/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/php-laravel/team/README.md +5 -0
- package/presets/opencode/svelte/OPENCODE.md +1 -1
- package/presets/opencode/svelte/README.md +1 -1
- package/presets/opencode/svelte/adapter-map.json +11 -3
- package/presets/opencode/svelte/hooks/README.md +3 -2
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +57 -3
- package/presets/opencode/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/opencode/svelte/rules/agent-team-intake.md +1 -0
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +5 -2
- package/presets/opencode/svelte/rules/preset-pr-checklist.md +4 -4
- package/presets/opencode/svelte/rules/preset-twin-sync.md +1 -1
- package/presets/opencode/svelte/team/README.md +5 -0
- package/presets/zcode/android-kotlin/adapter-map.json +11 -3
- package/presets/zcode/android-kotlin/hooks/README.md +2 -1
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/android-kotlin/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/android-kotlin/rules/agent-team-intake.md +1 -0
- package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/android-kotlin/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/android-kotlin/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/android-kotlin/team/README.md +5 -0
- package/presets/zcode/go/adapter-map.json +11 -3
- package/presets/zcode/go/hooks/README.md +2 -1
- package/presets/zcode/go/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/go/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/go/rules/agent-team-intake.md +1 -0
- package/presets/zcode/go/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/go/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/go/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/go/team/README.md +5 -0
- package/presets/zcode/ios-swift/adapter-map.json +11 -3
- package/presets/zcode/ios-swift/hooks/README.md +2 -1
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/ios-swift/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/ios-swift/rules/agent-team-intake.md +1 -0
- package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/ios-swift/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/ios-swift/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/ios-swift/team/README.md +5 -0
- package/presets/zcode/java/adapter-map.json +11 -3
- package/presets/zcode/java/hooks/README.md +2 -1
- package/presets/zcode/java/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/java/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/java/rules/agent-team-intake.md +1 -0
- package/presets/zcode/java/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/java/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/java/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/java/team/README.md +5 -0
- package/presets/zcode/mcp-ts/adapter-map.json +11 -3
- package/presets/zcode/mcp-ts/hooks/README.md +2 -1
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/mcp-ts/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/mcp-ts/rules/agent-team-intake.md +1 -0
- package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/mcp-ts/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/mcp-ts/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/mcp-ts/team/README.md +5 -0
- package/presets/zcode/mol/adapter-map.json +11 -3
- package/presets/zcode/mol/hooks/README.md +2 -1
- package/presets/zcode/mol/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/mol/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/mol/rules/agent-team-intake.md +1 -0
- package/presets/zcode/mol/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/mol/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/mol/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/mol/team/README.md +5 -0
- package/presets/zcode/next/adapter-map.json +67 -3
- package/presets/zcode/next/agents/build-verifier.md +18 -3
- package/presets/zcode/next/agents/code-reviewer.md +2 -0
- package/presets/zcode/next/agents/feature-developer.md +3 -1
- package/presets/zcode/next/agents/task-analyst.md +6 -0
- package/presets/zcode/next/agents/task-router.md +5 -3
- package/presets/zcode/next/commands/README.md +1 -0
- package/presets/zcode/next/commands/task-continue.md +1 -1
- package/presets/zcode/next/commands/upstream-research.md +26 -0
- package/presets/zcode/next/hooks/README.md +2 -1
- package/presets/zcode/next/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/next/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/next/rules/agent-team-intake.md +1 -0
- package/presets/zcode/next/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/next/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/next/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/next/team/README.md +23 -0
- package/presets/zcode/next/team/upstream/config.json +31 -0
- package/presets/zcode/next/team/upstream/digest-template.md +55 -0
- package/presets/zcode/next/team/upstream/opencode.json +34 -0
- package/presets/zcode/next/team/upstream/projects.json +4 -0
- package/presets/zcode/next/team/upstream/prompt.md +77 -0
- package/presets/zcode/next/team/upstream/signatures.json +9 -0
- package/presets/zcode/nuxt/adapter-map.json +11 -3
- package/presets/zcode/nuxt/hooks/README.md +2 -1
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/nuxt/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/nuxt/rules/agent-team-intake.md +1 -0
- package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/nuxt/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/nuxt/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/nuxt/team/README.md +5 -0
- package/presets/zcode/php-hexagonal/adapter-map.json +11 -3
- package/presets/zcode/php-hexagonal/hooks/README.md +2 -1
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/php-hexagonal/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/php-hexagonal/rules/agent-team-intake.md +1 -0
- package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/php-hexagonal/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/php-hexagonal/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/php-hexagonal/team/README.md +5 -0
- package/presets/zcode/php-laravel/adapter-map.json +11 -3
- package/presets/zcode/php-laravel/hooks/README.md +2 -1
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/php-laravel/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/php-laravel/rules/agent-team-intake.md +1 -0
- package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/php-laravel/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/php-laravel/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/php-laravel/team/README.md +5 -0
- package/presets/zcode/svelte/adapter-map.json +11 -3
- package/presets/zcode/svelte/hooks/README.md +2 -1
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +57 -3
- package/presets/zcode/svelte/hooks/check-preset-update.mjs +4 -3
- package/presets/zcode/svelte/rules/agent-team-intake.md +1 -0
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +5 -2
- package/presets/zcode/svelte/rules/preset-pr-checklist.md +4 -4
- package/presets/zcode/svelte/rules/preset-twin-sync.md +1 -1
- package/presets/zcode/svelte/team/README.md +5 -0
- package/presets/claude/android-kotlin/hooks/guard-shell-command.sh +0 -103
- package/presets/claude/go/hooks/guard-shell-command.sh +0 -102
- package/presets/claude/mcp-ts/hooks/guard-shell-command.sh +0 -102
- package/presets/claude/php-hexagonal/hooks/guard-shell-command.sh +0 -103
- package/presets/claude/php-laravel/hooks/guard-shell-command.sh +0 -103
- package/presets/cursor/android-kotlin/hooks/guard-shell-command.sh +0 -80
- package/presets/cursor/go/hooks/guard-shell-command.sh +0 -79
- package/presets/cursor/ios-swift/hooks/guard-shell-command.sh +0 -79
- package/presets/cursor/java/hooks/guard-shell-command.sh +0 -80
- package/presets/cursor/mcp-ts/hooks/guard-shell-command.sh +0 -79
- package/presets/cursor/mol/hooks/guard-shell-command.sh +0 -77
- package/presets/cursor/next/hooks/guard-shell-command.sh +0 -77
- package/presets/cursor/nuxt/hooks/guard-shell-command.sh +0 -77
- package/presets/cursor/php-hexagonal/hooks/guard-shell-command.sh +0 -80
- package/presets/cursor/php-laravel/hooks/guard-shell-command.sh +0 -80
- package/presets/cursor/svelte/hooks/guard-shell-command.sh +0 -77
package/bin/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ const { cmdInitMavis, cmdCleanMavis } = require('./mavis-install');
|
|
|
10
10
|
const { cmdInitOpencode, cmdCleanOpencode } = require('./opencode-install');
|
|
11
11
|
const { cmdInitZcode, cmdCleanZcode } = require('./zcode-install');
|
|
12
12
|
const { seedAiLocalTeam } = require('./lib/seed-ai-local-team');
|
|
13
|
-
const { flushAiLocalDriftSummary, flushAllAiLocalDriftSummaries } = require('./lib/ai-local-drift');
|
|
13
|
+
const { flushAiLocalDriftSummary, flushAllAiLocalDriftSummaries, ownEngineCheck } = require('./lib/ai-local-drift');
|
|
14
14
|
const { assertSafeDest, escapesRoot, resolveManagedPath } = require('./lib/safe-path');
|
|
15
15
|
const {
|
|
16
16
|
createInstallTransaction,
|
|
@@ -32,7 +32,7 @@ const {
|
|
|
32
32
|
stripMergedConfigs,
|
|
33
33
|
} = require('./lib/merged-config');
|
|
34
34
|
const { otherToolInstallPresent, TOOL_INSTALL_MARKERS } = require('./lib/tool-installs');
|
|
35
|
-
const {
|
|
35
|
+
const { planEngineUpgrade, applyEngineUpgrade } = require('./lib/engine-upgrade');
|
|
36
36
|
const {
|
|
37
37
|
CLIENT_IDS,
|
|
38
38
|
serverBySlug,
|
|
@@ -109,15 +109,15 @@ Usage:
|
|
|
109
109
|
ai-rules init <cursor|claude|mavis|opencode|zcode|multi> [--preset <name>]
|
|
110
110
|
ai-rules init <cursor|claude|mavis|opencode|zcode|multi> <preset-name>
|
|
111
111
|
ai-rules init mcp <name...|--all> [--tools <list>] [--cwd <dir>]
|
|
112
|
-
ai-rules update [--merge-ai-local | --check] [--cwd <dir>]
|
|
113
|
-
ai-rules doctor [--json] [--cwd <dir>]
|
|
112
|
+
ai-rules update [--fix | --merge-ai-local | --check] [--no-backup] [--cwd <dir>]
|
|
113
|
+
ai-rules doctor [--json] [--fix] [--cwd <dir>]
|
|
114
114
|
ai-rules clean <cursor|claude|mavis|opencode|zcode> [--cwd <dir>]
|
|
115
|
-
ai-rules mcp setup <gitlab|github|yandex|all> [--tools <list>] [--yes] [--replace] [--url <url>] [--org-id <id>] [--json] [--cwd <dir>]
|
|
116
|
-
ai-rules mcp add <gitlab|github|yandex|all> [--tools <list>] [--replace] [--json] [--cwd <dir>]
|
|
117
|
-
ai-rules mcp remove <gitlab|github|yandex|all> [--tools <list>] [--purge] [--json] [--cwd <dir>]
|
|
118
|
-
ai-rules mcp doctor [gitlab|github|yandex|all] [--json] [--cwd <dir>]
|
|
115
|
+
ai-rules mcp setup <gitlab|github|yandex|defectdojo|all> [--tools <list>] [--yes] [--replace] [--url <url>] [--org-id <id>] [--json] [--cwd <dir>]
|
|
116
|
+
ai-rules mcp add <gitlab|github|yandex|defectdojo|all> [--tools <list>] [--replace] [--json] [--cwd <dir>]
|
|
117
|
+
ai-rules mcp remove <gitlab|github|yandex|defectdojo|all> [--tools <list>] [--purge] [--json] [--cwd <dir>]
|
|
118
|
+
ai-rules mcp doctor [gitlab|github|yandex|defectdojo|all] [--json] [--cwd <dir>]
|
|
119
119
|
ai-rules mcp refresh yandex [--print] [--json] [--yc-bin <path>] [--cwd <dir>]
|
|
120
|
-
ai-rules mcp run <gitlab|github|yandex-tracker|yandex-wiki> [--print-env] (internal — used by the client config)
|
|
120
|
+
ai-rules mcp run <gitlab|github|yandex-tracker|yandex-wiki|defectdojo> [--print-env] (internal — used by the client config)
|
|
121
121
|
|
|
122
122
|
Options:
|
|
123
123
|
--preset <name> Preset name (default: ${DEFAULT_PRESET})
|
|
@@ -128,6 +128,10 @@ Options:
|
|
|
128
128
|
--check Print each .ai.local/ drift rel and write nothing
|
|
129
129
|
the preset template; a file you edited is kept and its diff is
|
|
130
130
|
written to .ai.local/.rollback/template-drift/
|
|
131
|
+
--fix Write the seeded .ai.local/scripts/ modules whose bytes still
|
|
132
|
+
match the recorded shipped base (update and doctor)
|
|
133
|
+
--no-backup update --fix: skip the durable .ai.local/.rollback/engine-<stamp>/
|
|
134
|
+
backup (failure atomicity and safe-path refusal stay on)
|
|
131
135
|
|
|
132
136
|
Notes:
|
|
133
137
|
init merges into the target directory; same-named preset files are overwritten (no backups are kept).
|
|
@@ -157,8 +161,8 @@ Notes:
|
|
|
157
161
|
OpenCode init copies into .opencode/ plus REPO_AGENTS.md → <cwd>/AGENTS.md; MCP merges into <cwd>/opencode.json (never ~/.config/opencode/**).
|
|
158
162
|
All init targets also copy REPO_AGENTS.md → <cwd>/AGENTS.md (repo-root cross-tool agents file; overwrite; all next platforms ship the same file).
|
|
159
163
|
init multi installs every platform that has released the preset (cursor, claude, plus mavis/opencode when listed in releasedStacks). Not a clean target.
|
|
160
|
-
update reinstalls each tool that already has <tool>/.ai-rules-install.json, using the preset field that init wrote. Tools without a manifest stay uninstalled. The recorded preset is kept. update does not accept --preset or a tool name; --merge-ai-local is allowed on update and on init.
|
|
161
|
-
doctor
|
|
164
|
+
update reinstalls each tool that already has <tool>/.ai-rules-install.json, using the preset field that init wrote. Tools without a manifest stay uninstalled. The recorded preset is kept. update does not accept --preset or a tool name; --merge-ai-local is allowed on update and on init. update --fix upgrades a seeded .ai.local/scripts/ module only when its bytes still match the recorded shipped base in .ai.local/.template-base.json: a consumer-edited module is kept as modified, a module with no recorded base is never written, and every overwritten module is backed up to .ai.local/.rollback/engine-<stamp>/ (keep the 5 newest runs; --no-backup skips the durable copy). Restore with: cp -R .ai.local/.rollback/engine-<stamp>/.ai.local .
|
|
165
|
+
doctor reports for every installed platform missing/modified managed files, a manifest/package version mismatch, and the shared .ai.local/scripts/ engine set (stale-engine = safely upgradeable, missing-engine, modified = your edit); every finding carries fixable in --json. doctor --fix applies the same plan and writer as update --fix, then re-runs the check and prints the post-state; exit 0 = clean, 1 = findings, 2 = usage error. --json prints one object with an additive fix field when --fix ran.
|
|
162
166
|
When <cwd>/docs/specs/ is absent, init also seeds INDEX.md stub + _templates/* from package assets (never overwrites an existing INDEX).
|
|
163
167
|
clean removes only files the last init copied and that are unchanged since; consumer files are kept.
|
|
164
168
|
Merged configs are never deleted wholesale: clean strips the entries init added (shipped MCP servers, preset
|
|
@@ -166,11 +170,14 @@ Notes:
|
|
|
166
170
|
else is left in a file init created. Shared <cwd>/AGENTS.md is removed only when no other tool install remains.
|
|
167
171
|
Command forms: "init cursor --preset next", "init cursor next", "--preset next init cursor", "cursor init --preset next".
|
|
168
172
|
init mcp <name> registers a third-party server from the shipped catalog into every installed client
|
|
169
|
-
(or --tools only). Names: context7, playwright, chrome-devtools,
|
|
170
|
-
|
|
173
|
+
(or --tools only). Names: context7, playwright, chrome-devtools, next-devtools, semgrep, sentry,
|
|
174
|
+
figma-desktop (alias: figma), figma-cloud, storybook, defectdojo, gitlab, github, yandex-tracker,
|
|
175
|
+
yandex-wiki; --all selects every one. Runtime entries (defectdojo, gitlab, github, yandex-*) need the
|
|
176
|
+
mcp setup command for credentials. Entries merge like init: extra servers and consumer env/headers stay.
|
|
171
177
|
mcp setup obtains and validates credentials, writes the client entries and runs the doctor. GitLab credentials live in
|
|
172
178
|
.ai-rules/mcp/credentials.env (0600); Yandex settings live in .ai-rules/mcp/config.env (no token); the GitHub token is read
|
|
173
|
-
from the shell or from .env.github in the project root and is never written by the package. The
|
|
179
|
+
from the shell or from .env.github in the project root and is never written by the package. The DefectDojo URL and token are
|
|
180
|
+
read from the shell or from .env.defectdojo and are never written by the package. The two settings files sit in a
|
|
174
181
|
self-ignoring .ai-rules/ (the root .gitignore is never modified). Only clients already installed are registered; --tools
|
|
175
182
|
narrows or names a client explicitly. mcp commands require Node 20+ (the GitLab child declares engines >=20).
|
|
176
183
|
|
|
@@ -212,6 +219,7 @@ Examples:
|
|
|
212
219
|
npx @bonesofspring/ai-rules mcp setup gitlab
|
|
213
220
|
npx @bonesofspring/ai-rules mcp setup github
|
|
214
221
|
npx @bonesofspring/ai-rules mcp setup yandex
|
|
222
|
+
npx @bonesofspring/ai-rules mcp setup defectdojo
|
|
215
223
|
npx @bonesofspring/ai-rules mcp doctor
|
|
216
224
|
npx @bonesofspring/ai-rules mcp refresh yandex
|
|
217
225
|
`);
|
|
@@ -272,6 +280,14 @@ function parseArgs(argv, options = {}) {
|
|
|
272
280
|
args.checkAiLocal = true;
|
|
273
281
|
continue;
|
|
274
282
|
}
|
|
283
|
+
if (a === '--fix') {
|
|
284
|
+
args.fix = true;
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
if (a === '--no-backup') {
|
|
288
|
+
args.noBackup = true;
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
275
291
|
if (a === '--json') {
|
|
276
292
|
if (options.json) args.json = true;
|
|
277
293
|
else args.unknownOption = a;
|
|
@@ -740,6 +756,21 @@ function updatePresetReady(tool, presetName) {
|
|
|
740
756
|
* Validates the whole plan before the first init so a bad manifest does not partially update.
|
|
741
757
|
*/
|
|
742
758
|
function cmdUpdate(cwdOption, opts) {
|
|
759
|
+
const fix = Boolean(opts && opts.fix);
|
|
760
|
+
const noBackup = Boolean(opts && opts.noBackup);
|
|
761
|
+
const check = Boolean(opts && opts.checkAiLocal);
|
|
762
|
+
if (fix && opts.checkAiLocal) {
|
|
763
|
+
console.error('update: --fix and --check cannot be combined.');
|
|
764
|
+
process.exit(2);
|
|
765
|
+
}
|
|
766
|
+
if (fix && opts.mergeAiLocal) {
|
|
767
|
+
console.error('update: --fix and --merge-ai-local cannot be combined.');
|
|
768
|
+
process.exit(2);
|
|
769
|
+
}
|
|
770
|
+
if (noBackup && !fix) {
|
|
771
|
+
console.error('update: --no-backup requires --fix.');
|
|
772
|
+
process.exit(2);
|
|
773
|
+
}
|
|
743
774
|
const cwd = resolveTargetCwd(cwdOption);
|
|
744
775
|
const errors = [];
|
|
745
776
|
const found = [];
|
|
@@ -795,6 +826,15 @@ function cmdUpdate(cwdOption, opts) {
|
|
|
795
826
|
|
|
796
827
|
const plan = found.map((item) => `${item.tool} (${item.preset})`).join(', ');
|
|
797
828
|
console.log(`update: reinstalling ${plan}`);
|
|
829
|
+
const packageRoot = getPackageRoot();
|
|
830
|
+
// One plan per command: the engine classifier reads the record before any pass
|
|
831
|
+
// can adopt a rel, and `applyEngineUpgrade` writes after the last pass. `--check`
|
|
832
|
+
// previews the engine lines from this same plan — the drift pass must not
|
|
833
|
+
// classify them a second time with a source that may not match the record.
|
|
834
|
+
const enginePlan = fix || check ? planEngineUpgrade({ cwd, packageRoot }) : null;
|
|
835
|
+
if (check) {
|
|
836
|
+
ownEngineCheck(cwd, new Set(enginePlan.entries.map((entry) => entry.rel)));
|
|
837
|
+
}
|
|
798
838
|
// One command, one tree, one summary: each tool's pass accumulates, this flushes.
|
|
799
839
|
const passOpts = { ...opts, deferAiLocalSummary: true };
|
|
800
840
|
for (const item of found) {
|
|
@@ -802,17 +842,129 @@ function cmdUpdate(cwdOption, opts) {
|
|
|
802
842
|
cmdInit(item.tool, item.preset, cwdOption, passOpts);
|
|
803
843
|
}
|
|
804
844
|
flushAiLocalDriftSummary(cwd);
|
|
845
|
+
if (enginePlan && check) {
|
|
846
|
+
printEngineCheckResult(enginePlan);
|
|
847
|
+
}
|
|
848
|
+
if (enginePlan && fix) {
|
|
849
|
+
let result;
|
|
850
|
+
try {
|
|
851
|
+
result = runEngineFix({ cwd, packageRoot, plan: enginePlan, backup: !noBackup });
|
|
852
|
+
} catch (error) {
|
|
853
|
+
console.error(`update --fix: ${error instanceof Error ? error.message : String(error)}`);
|
|
854
|
+
process.exit(1);
|
|
855
|
+
}
|
|
856
|
+
printEngineFixResult(result);
|
|
857
|
+
const symlinkNote = result.skippedSymlinks.length > 0
|
|
858
|
+
? `, ${result.skippedSymlinks.length} skipped symlink`
|
|
859
|
+
: '';
|
|
860
|
+
console.log(
|
|
861
|
+
`engine: ${result.fixed.length} fixed, ${result.keptModified.length} kept modified, ${result.current} current${symlinkNote}`,
|
|
862
|
+
);
|
|
863
|
+
}
|
|
805
864
|
console.log(`\nDone. update reinstalled ${plan}`);
|
|
806
865
|
}
|
|
807
866
|
|
|
867
|
+
/** Run the engine writer through a failure-atomic transaction; throws on failure. */
|
|
868
|
+
function runEngineFix({ cwd, packageRoot, plan, backup }) {
|
|
869
|
+
const stamp = runStamp();
|
|
870
|
+
if (plan.writable.length === 0) {
|
|
871
|
+
return applyEngineUpgrade({ cwd, packageRoot, plan, backup, stamp });
|
|
872
|
+
}
|
|
873
|
+
const tx = createInstallTransaction(
|
|
874
|
+
cwd,
|
|
875
|
+
path.join(cwd, '.ai.local', '.rollback', `.engine-tx-${stamp}`),
|
|
876
|
+
);
|
|
877
|
+
try {
|
|
878
|
+
const result = applyEngineUpgrade({ cwd, packageRoot, plan, backup, stamp, tx });
|
|
879
|
+
tx.commit();
|
|
880
|
+
return result;
|
|
881
|
+
} catch (error) {
|
|
882
|
+
try {
|
|
883
|
+
tx.rollback();
|
|
884
|
+
} catch {
|
|
885
|
+
// applyEngineUpgrade already restored the run; the original error is reported.
|
|
886
|
+
}
|
|
887
|
+
throw error;
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
function printEngineFixResult(result) {
|
|
892
|
+
for (const item of result.fixed) {
|
|
893
|
+
console.log(item.backup ? `fixed ${item.rel} (backup ${item.backup})` : `fixed ${item.rel}`);
|
|
894
|
+
}
|
|
895
|
+
for (const rel of result.keptModified) {
|
|
896
|
+
console.log(`kept modified ${rel}`);
|
|
897
|
+
}
|
|
898
|
+
for (const rel of result.unattributed) {
|
|
899
|
+
console.log(`unattributable ${rel} (no recorded base; delete it and re-run init)`);
|
|
900
|
+
}
|
|
901
|
+
for (const rel of result.skippedSymlinks) {
|
|
902
|
+
console.log(`skipped symlink ${rel} (never written through)`);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
/** Preview the engine lines from the same plan `update --fix` writes with. */
|
|
907
|
+
function printEngineCheckResult(plan) {
|
|
908
|
+
for (const entry of plan.entries) {
|
|
909
|
+
if (!entry.checkOutcome || entry.checkOutcome === 'noop') continue;
|
|
910
|
+
console.log(`check ${entry.checkOutcome} ${entry.rel}`);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
|
|
808
914
|
/**
|
|
809
|
-
*
|
|
915
|
+
* Host prerequisites the shipped surfaces rely on. `ok` here is advisory: the
|
|
916
|
+
* install-state `state.ok` stays about managed files and the engine set, so a
|
|
917
|
+
* clean install on a host without `perl` (or with an old Node) still exits 0.
|
|
918
|
+
*/
|
|
919
|
+
const PREREQUISITE_PROBES = [
|
|
920
|
+
{ name: 'git', args: ['--version'], next: 'install Git: https://git-scm.com/downloads' },
|
|
921
|
+
{ name: 'bash', args: ['--version'], next: 'install bash (Git Bash on Windows; the chain hook needs it)' },
|
|
922
|
+
{
|
|
923
|
+
name: 'perl',
|
|
924
|
+
args: ['-e', 'exit 0'],
|
|
925
|
+
optional: true,
|
|
926
|
+
next: 'optional: the engine lock falls back to a directory lock without perl',
|
|
927
|
+
},
|
|
928
|
+
];
|
|
929
|
+
|
|
930
|
+
function collectPrerequisiteState() {
|
|
931
|
+
const items = [];
|
|
932
|
+
const nodeMajor = Number.parseInt(process.versions.node.split('.')[0], 10);
|
|
933
|
+
items.push(
|
|
934
|
+
nodeMajor >= 20
|
|
935
|
+
? { name: 'node', status: 'ok', detail: process.versions.node, next: null }
|
|
936
|
+
: {
|
|
937
|
+
name: 'node',
|
|
938
|
+
status: 'warn',
|
|
939
|
+
detail: `${process.versions.node} is below the supported floor (>=20)`,
|
|
940
|
+
next: 'install Node 20 LTS or newer',
|
|
941
|
+
},
|
|
942
|
+
);
|
|
943
|
+
for (const probe of PREREQUISITE_PROBES) {
|
|
944
|
+
const result = spawnSync(probe.name, probe.args, { stdio: 'ignore' });
|
|
945
|
+
if (!result.error && result.status === 0) {
|
|
946
|
+
items.push({ name: probe.name, status: 'ok', detail: 'found on PATH', next: null });
|
|
947
|
+
continue;
|
|
948
|
+
}
|
|
949
|
+
items.push({
|
|
950
|
+
name: probe.name,
|
|
951
|
+
status: 'warn',
|
|
952
|
+
detail: probe.optional ? 'not found on PATH (optional)' : 'not found on PATH',
|
|
953
|
+
next: probe.next,
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
return { ok: items.every((item) => item.status === 'ok'), items };
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
/**
|
|
960
|
+
* Install-state doctor.
|
|
810
961
|
*
|
|
811
962
|
* Per installed platform (`.ai-rules-install.json`): missing or modified managed
|
|
812
963
|
* files and a `packageVersion` mismatch. Once per project: the shared engine set
|
|
813
|
-
* (`.ai.local/scripts/`
|
|
814
|
-
*
|
|
815
|
-
*
|
|
964
|
+
* (`.ai.local/scripts/`) classified by the same `planEngineUpgrade` predicate
|
|
965
|
+
* `update --fix` writes with, so `stale-engine` means safely upgradeable and a
|
|
966
|
+
* consumer edit is `modified`. Every finding carries `fixable`. The report alone
|
|
967
|
+
* is read-only; `doctor --fix` runs the writer, then re-runs this collector.
|
|
816
968
|
*/
|
|
817
969
|
function collectDoctorState(cwd, packageRoot) {
|
|
818
970
|
const packageVersion = getPackageVersion(packageRoot);
|
|
@@ -830,13 +982,14 @@ function collectDoctorState(cwd, packageRoot) {
|
|
|
830
982
|
manifest = null;
|
|
831
983
|
}
|
|
832
984
|
if (!manifest) {
|
|
833
|
-
findings.push({ code: 'missing', path: rel, detail: 'install manifest is not readable JSON' });
|
|
985
|
+
findings.push({ code: 'missing', path: rel, detail: 'install manifest is not readable JSON', fixable: false });
|
|
834
986
|
} else {
|
|
835
987
|
if (typeof manifest.packageVersion === 'string' && manifest.packageVersion !== packageVersion) {
|
|
836
988
|
findings.push({
|
|
837
989
|
code: 'version-mismatch',
|
|
838
990
|
path: rel,
|
|
839
991
|
detail: `manifest records ${manifest.packageVersion}, package is ${packageVersion}`,
|
|
992
|
+
fixable: false,
|
|
840
993
|
});
|
|
841
994
|
}
|
|
842
995
|
if (typeof manifest.schemaVersion === 'number' && manifest.schemaVersion < MANIFEST_SCHEMA_VERSION) {
|
|
@@ -844,22 +997,24 @@ function collectDoctorState(cwd, packageRoot) {
|
|
|
844
997
|
code: 'legacy-manifest',
|
|
845
998
|
path: rel,
|
|
846
999
|
detail: 'schema v1 hashes consumer files too; re-run init to record a current manifest',
|
|
1000
|
+
fixable: false,
|
|
847
1001
|
});
|
|
848
1002
|
} else if (!isPlainObject(manifest.managedFiles) || Object.keys(manifest.managedFiles).length === 0) {
|
|
849
1003
|
findings.push({
|
|
850
1004
|
code: 'missing',
|
|
851
1005
|
path: rel,
|
|
852
1006
|
detail: 'schema v2 manifest has no managedFiles map; re-run init for this platform',
|
|
1007
|
+
fixable: false,
|
|
853
1008
|
});
|
|
854
1009
|
} else {
|
|
855
1010
|
for (const [managedRel, expectedHash] of Object.entries(manifest.managedFiles)) {
|
|
856
1011
|
const managedAbs = resolveManagedPath(cwd, managedRel);
|
|
857
1012
|
if (!managedAbs || !fs.existsSync(managedAbs) || !fs.lstatSync(managedAbs).isFile()) {
|
|
858
|
-
findings.push({ code: 'missing', path: managedRel, detail: 'managed file is absent' });
|
|
1013
|
+
findings.push({ code: 'missing', path: managedRel, detail: 'managed file is absent', fixable: false });
|
|
859
1014
|
continue;
|
|
860
1015
|
}
|
|
861
1016
|
if (typeof expectedHash === 'string' && sha256File(managedAbs) !== expectedHash) {
|
|
862
|
-
findings.push({ code: 'modified', path: managedRel, detail: 'bytes differ from the install manifest' });
|
|
1017
|
+
findings.push({ code: 'modified', path: managedRel, detail: 'bytes differ from the install manifest', fixable: false });
|
|
863
1018
|
}
|
|
864
1019
|
}
|
|
865
1020
|
}
|
|
@@ -877,28 +1032,34 @@ function collectDoctorState(cwd, packageRoot) {
|
|
|
877
1032
|
const engineFindings = [];
|
|
878
1033
|
const engineRel = '.ai.local/scripts';
|
|
879
1034
|
const engineDir = resolveManagedPath(cwd, engineRel);
|
|
880
|
-
const sourceDir = path.join(packageRoot, 'presets', ...ENGINE_SOURCE_RELATIVE.split('/'));
|
|
881
1035
|
const engineInstalled = Boolean(engineDir && fs.existsSync(engineDir) && fs.statSync(engineDir).isDirectory());
|
|
882
1036
|
if (platforms.length === 0 && !engineInstalled) {
|
|
883
1037
|
// Nothing is installed; a missing engine is not a finding for a bare tree.
|
|
884
1038
|
} else if (!engineInstalled) {
|
|
885
|
-
engineFindings.push({ code: 'missing-engine', path: engineRel, detail: 'engine directory is absent' });
|
|
1039
|
+
engineFindings.push({ code: 'missing-engine', path: engineRel, detail: 'engine directory is absent', fixable: false });
|
|
886
1040
|
} else {
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
if (
|
|
892
|
-
engineFindings.push({ code: 'missing-engine', path: rel, detail: `engine module ${name} is absent` });
|
|
1041
|
+
// Eligibility comes from the same classifier `update --fix` writes with: a
|
|
1042
|
+
// consumer edit is `modified`, never a `stale-engine` that a fix could overwrite.
|
|
1043
|
+
const enginePlan = planEngineUpgrade({ cwd, packageRoot });
|
|
1044
|
+
for (const entry of enginePlan.entries) {
|
|
1045
|
+
if (entry.state === 'current') {
|
|
893
1046
|
continue;
|
|
894
1047
|
}
|
|
895
|
-
if (
|
|
1048
|
+
if (entry.state === 'missing') {
|
|
896
1049
|
engineFindings.push({
|
|
897
|
-
code: '
|
|
898
|
-
path: rel,
|
|
899
|
-
detail:
|
|
1050
|
+
code: 'missing-engine',
|
|
1051
|
+
path: entry.rel,
|
|
1052
|
+
detail: entry.detail,
|
|
1053
|
+
fixable: false,
|
|
900
1054
|
});
|
|
1055
|
+
continue;
|
|
901
1056
|
}
|
|
1057
|
+
engineFindings.push({
|
|
1058
|
+
code: entry.state === 'stale' ? 'stale-engine' : 'modified',
|
|
1059
|
+
path: entry.rel,
|
|
1060
|
+
detail: entry.detail,
|
|
1061
|
+
fixable: entry.state === 'stale',
|
|
1062
|
+
});
|
|
902
1063
|
}
|
|
903
1064
|
}
|
|
904
1065
|
|
|
@@ -909,11 +1070,12 @@ function collectDoctorState(cwd, packageRoot) {
|
|
|
909
1070
|
ok: platforms.every((platform) => platform.ok) && engine.ok,
|
|
910
1071
|
platforms,
|
|
911
1072
|
engine,
|
|
1073
|
+
prerequisites: collectPrerequisiteState(),
|
|
912
1074
|
};
|
|
913
1075
|
}
|
|
914
1076
|
|
|
915
|
-
function printDoctorReport(state) {
|
|
916
|
-
console.log(
|
|
1077
|
+
function printDoctorReport(state, opts = {}) {
|
|
1078
|
+
console.log(`@bonesofspring/ai-rules doctor${opts.fix ? ' --fix (post-state)' : ' (read-only)'}`);
|
|
917
1079
|
console.log(`package: ${state.packageVersion}`);
|
|
918
1080
|
if (state.platforms.length === 0) {
|
|
919
1081
|
console.log('installed platforms: none (.ai-rules-install.json not found)');
|
|
@@ -930,6 +1092,13 @@ function printDoctorReport(state) {
|
|
|
930
1092
|
for (const finding of state.engine.findings) {
|
|
931
1093
|
console.log(` ${finding.code} ${finding.path} — ${finding.detail}`);
|
|
932
1094
|
}
|
|
1095
|
+
const prerequisites = state.prerequisites ?? { ok: true, items: [] };
|
|
1096
|
+
const warnings = prerequisites.items.filter((item) => item.status !== 'ok').length;
|
|
1097
|
+
console.log(`prerequisites: ${prerequisites.ok ? 'OK' : `${warnings} warning(s)`}`);
|
|
1098
|
+
for (const item of prerequisites.items) {
|
|
1099
|
+
const suffix = item.status === 'ok' || !item.next ? '' : ` — ${item.next}`;
|
|
1100
|
+
console.log(` ${item.name}: ${item.detail}${suffix}`);
|
|
1101
|
+
}
|
|
933
1102
|
const total = state.platforms.reduce((sum, platform) => sum + platform.findings.length, 0)
|
|
934
1103
|
+ state.engine.findings.length;
|
|
935
1104
|
console.log(`result: ${state.ok ? 'OK' : `FINDINGS (${total})`}`);
|
|
@@ -937,11 +1106,37 @@ function printDoctorReport(state) {
|
|
|
937
1106
|
|
|
938
1107
|
function cmdDoctor(cwdOption, opts) {
|
|
939
1108
|
const cwd = resolveTargetCwd(cwdOption, 2);
|
|
940
|
-
const
|
|
1109
|
+
const packageRoot = getPackageRoot();
|
|
1110
|
+
let fix = null;
|
|
1111
|
+
let fixResult = null;
|
|
1112
|
+
if (opts && opts.fix) {
|
|
1113
|
+
const plan = planEngineUpgrade({ cwd, packageRoot });
|
|
1114
|
+
try {
|
|
1115
|
+
fixResult = runEngineFix({ cwd, packageRoot, plan, backup: true });
|
|
1116
|
+
} catch (error) {
|
|
1117
|
+
console.error(`doctor --fix: ${error instanceof Error ? error.message : String(error)}`);
|
|
1118
|
+
process.exit(1);
|
|
1119
|
+
}
|
|
1120
|
+
fix = {
|
|
1121
|
+
backup: fixResult.backup,
|
|
1122
|
+
fixed: fixResult.fixed.map((item) => item.rel),
|
|
1123
|
+
keptModified: fixResult.keptModified,
|
|
1124
|
+
unattributed: fixResult.unattributed,
|
|
1125
|
+
skippedSymlinks: fixResult.skippedSymlinks,
|
|
1126
|
+
current: fixResult.current,
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
const state = collectDoctorState(cwd, packageRoot);
|
|
941
1130
|
if (opts && opts.json) {
|
|
1131
|
+
if (fix) {
|
|
1132
|
+
state.fix = fix;
|
|
1133
|
+
}
|
|
942
1134
|
console.log(JSON.stringify(state, null, 2));
|
|
943
1135
|
} else {
|
|
944
|
-
|
|
1136
|
+
if (fixResult) {
|
|
1137
|
+
printEngineFixResult(fixResult);
|
|
1138
|
+
}
|
|
1139
|
+
printDoctorReport(state, { fix: Boolean(fix) });
|
|
945
1140
|
}
|
|
946
1141
|
process.exit(state.ok ? 0 : 1);
|
|
947
1142
|
}
|
|
@@ -1294,12 +1489,12 @@ function printMcpHelp() {
|
|
|
1294
1489
|
console.log(`ai-rules mcp
|
|
1295
1490
|
|
|
1296
1491
|
Usage:
|
|
1297
|
-
ai-rules mcp setup <gitlab|github|yandex|all> [--tools <list>] [--yes] [--replace] [--url <url>] [--org-id <id>] [--json] [--cwd <dir>]
|
|
1298
|
-
ai-rules mcp add <gitlab|github|yandex|all> [--tools <list>] [--replace] [--json] [--cwd <dir>]
|
|
1299
|
-
ai-rules mcp remove <gitlab|github|yandex|all> [--tools <list>] [--purge] [--json] [--cwd <dir>]
|
|
1300
|
-
ai-rules mcp doctor [gitlab|github|yandex|all] [--json] [--cwd <dir>]
|
|
1492
|
+
ai-rules mcp setup <gitlab|github|yandex|defectdojo|all> [--tools <list>] [--yes] [--replace] [--url <url>] [--org-id <id>] [--json] [--cwd <dir>]
|
|
1493
|
+
ai-rules mcp add <gitlab|github|yandex|defectdojo|all> [--tools <list>] [--replace] [--json] [--cwd <dir>]
|
|
1494
|
+
ai-rules mcp remove <gitlab|github|yandex|defectdojo|all> [--tools <list>] [--purge] [--json] [--cwd <dir>]
|
|
1495
|
+
ai-rules mcp doctor [gitlab|github|yandex|defectdojo|all] [--json] [--cwd <dir>]
|
|
1301
1496
|
ai-rules mcp refresh yandex [--print] [--json] [--yc-bin <path>] [--cwd <dir>]
|
|
1302
|
-
ai-rules mcp run <gitlab|github|yandex-tracker|yandex-wiki> [--print-env]
|
|
1497
|
+
ai-rules mcp run <gitlab|github|yandex-tracker|yandex-wiki|defectdojo> [--print-env]
|
|
1303
1498
|
|
|
1304
1499
|
Options:
|
|
1305
1500
|
--tools <list> Comma-separated clients (cursor, claude, mavis, opencode); default: detected
|
|
@@ -1338,6 +1533,22 @@ function printInitMcpHelp() {
|
|
|
1338
1533
|
if (server.aliases && server.aliases.length > 0) {
|
|
1339
1534
|
notes.push(`alias: ${server.aliases.join(', ')}`);
|
|
1340
1535
|
}
|
|
1536
|
+
if (server.runtime === 'defectdojo') {
|
|
1537
|
+
notes.push(`setup: ${credentials.DEFECTDOJO_CREDENTIALS_REL}`);
|
|
1538
|
+
} else if (server.runtime === 'gitlab' || server.runtime === 'github') {
|
|
1539
|
+
notes.push(`setup: ai-rules mcp setup ${server.runtime}`);
|
|
1540
|
+
} else if (server.runtime && server.runtime.startsWith('yandex')) {
|
|
1541
|
+
notes.push('setup: ai-rules mcp setup yandex');
|
|
1542
|
+
}
|
|
1543
|
+
if (server.slug === 'next-devtools') {
|
|
1544
|
+
notes.push('needs: next dev, Next.js 16+');
|
|
1545
|
+
}
|
|
1546
|
+
if (server.slug === 'semgrep') {
|
|
1547
|
+
notes.push('needs: semgrep CLI');
|
|
1548
|
+
}
|
|
1549
|
+
if (server.slug === 'sentry') {
|
|
1550
|
+
notes.push('auth: OAuth');
|
|
1551
|
+
}
|
|
1341
1552
|
const suffix = notes.length > 0 ? ` (${notes.join('; ')})` : '';
|
|
1342
1553
|
return ` ${server.slug.padEnd(width)} ${server.title}${suffix}`;
|
|
1343
1554
|
});
|
|
@@ -1357,7 +1568,9 @@ Options:
|
|
|
1357
1568
|
-h, --help Print this help
|
|
1358
1569
|
|
|
1359
1570
|
Each client gets its native shape; entries merge like init, so other servers and consumer
|
|
1360
|
-
env/headers stay.
|
|
1571
|
+
env/headers stay. Runtime entries (GitLab, GitHub, Yandex, DefectDojo) are registered without
|
|
1572
|
+
credentials: run the printed setup command once per provider before first use. Next.js DevTools
|
|
1573
|
+
needs a running next dev server on Next.js 16+; Semgrep needs the semgrep CLI; Sentry uses OAuth.
|
|
1361
1574
|
`);
|
|
1362
1575
|
}
|
|
1363
1576
|
|
|
@@ -1474,7 +1687,12 @@ function cmdInitMcp(argv) {
|
|
|
1474
1687
|
|
|
1475
1688
|
let registration;
|
|
1476
1689
|
try {
|
|
1477
|
-
registration = registerCatalogServers({
|
|
1690
|
+
registration = registerCatalogServers({
|
|
1691
|
+
cwd,
|
|
1692
|
+
clients: selection.clients,
|
|
1693
|
+
servers,
|
|
1694
|
+
version: packageVersion(getPackageRoot()),
|
|
1695
|
+
});
|
|
1478
1696
|
} catch (error) {
|
|
1479
1697
|
console.error(`init mcp failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
1480
1698
|
process.exit(1);
|
|
@@ -1490,9 +1708,54 @@ function cmdInitMcp(argv) {
|
|
|
1490
1708
|
printer.ok('registration', `wrote ${rel}`);
|
|
1491
1709
|
}
|
|
1492
1710
|
}
|
|
1711
|
+
reportCatalogCredentials(cwd, servers, printer);
|
|
1493
1712
|
printer.next('restart the MCP server in your client');
|
|
1494
1713
|
}
|
|
1495
1714
|
|
|
1715
|
+
/**
|
|
1716
|
+
* Runtime entries (GitLab, Yandex, DefectDojo) are registered without
|
|
1717
|
+
* credentials so one `init mcp --all` is enough to wire every client. Name the
|
|
1718
|
+
* setup command for each provider that has no local configuration yet.
|
|
1719
|
+
*/
|
|
1720
|
+
function reportCatalogCredentials(cwd, servers, printer) {
|
|
1721
|
+
const cached = (rel) => fs.existsSync(path.join(cwd, rel));
|
|
1722
|
+
const fromEnv = (key) => typeof process.env[key] === 'string' && process.env[key] !== '';
|
|
1723
|
+
const missing = [];
|
|
1724
|
+
if (
|
|
1725
|
+
servers.some((server) => server.runtime === 'gitlab')
|
|
1726
|
+
&& !cached('.ai-rules/mcp/credentials.env')
|
|
1727
|
+
&& !fromEnv('GITLAB_TOKEN')
|
|
1728
|
+
) {
|
|
1729
|
+
missing.push('gitlab');
|
|
1730
|
+
}
|
|
1731
|
+
if (
|
|
1732
|
+
servers.some((server) => server.runtime === 'github')
|
|
1733
|
+
&& !cached('.env.github')
|
|
1734
|
+
&& !fromEnv('GITHUB_TOKEN')
|
|
1735
|
+
&& !fromEnv('GITHUB_PERSONAL_ACCESS_TOKEN')
|
|
1736
|
+
) {
|
|
1737
|
+
missing.push('github');
|
|
1738
|
+
}
|
|
1739
|
+
if (
|
|
1740
|
+
servers.some((server) => server.runtime === 'yandex-tracker' || server.runtime === 'yandex-wiki')
|
|
1741
|
+
&& !cached('.ai-rules/mcp/config.env')
|
|
1742
|
+
&& !fromEnv('YANDEX_ORG_ID')
|
|
1743
|
+
) {
|
|
1744
|
+
missing.push('yandex');
|
|
1745
|
+
}
|
|
1746
|
+
if (
|
|
1747
|
+
servers.some((server) => server.runtime === 'defectdojo')
|
|
1748
|
+
&& !cached('.env.defectdojo')
|
|
1749
|
+
&& !fromEnv('DEFECTDOJO_TOKEN')
|
|
1750
|
+
) {
|
|
1751
|
+
missing.push('defectdojo');
|
|
1752
|
+
}
|
|
1753
|
+
for (const provider of missing) {
|
|
1754
|
+
printer.warn('credentials', `${provider} is registered but not configured`);
|
|
1755
|
+
printer.next(`ai-rules mcp setup ${provider}`);
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1496
1759
|
const MCP_COMMANDS = new Set(['setup', 'add', 'remove', 'doctor', 'refresh', 'run']);
|
|
1497
1760
|
const MCP_VALUE_OPTIONS = new Set(['--tools', '--url', '--org-id', '--yc-bin', '--cwd']);
|
|
1498
1761
|
const MCP_BOOL_OPTIONS = new Set(['--yes', '--json', '--replace', '--purge', '--print', '--print-env', '--help', '-h']);
|
|
@@ -1600,7 +1863,8 @@ async function loadPackModules(packageRoot) {
|
|
|
1600
1863
|
const envfile = await import(pathToFileURL(path.join(packageRoot, 'mcp', 'lib', 'envfile.mjs')).href);
|
|
1601
1864
|
const yandex = await import(pathToFileURL(path.join(packageRoot, 'mcp', 'lib', 'yandex.mjs')).href);
|
|
1602
1865
|
const github = await import(pathToFileURL(path.join(packageRoot, 'mcp', 'lib', 'github.mjs')).href);
|
|
1603
|
-
|
|
1866
|
+
const defectdojo = await import(pathToFileURL(path.join(packageRoot, 'mcp', 'lib', 'defectdojo.mjs')).href);
|
|
1867
|
+
return { envfile, yandex, github, defectdojo };
|
|
1604
1868
|
}
|
|
1605
1869
|
|
|
1606
1870
|
function parseMcpTools(value) {
|
|
@@ -1648,7 +1912,9 @@ function registerProvider({ cwd, provider, options, version, printer, selection:
|
|
|
1648
1912
|
}
|
|
1649
1913
|
|
|
1650
1914
|
async function cmdMcpSetup({ cwd, provider, options, printer, packageRoot, modules, version }) {
|
|
1651
|
-
const providers = provider === 'all'
|
|
1915
|
+
const providers = provider === 'all'
|
|
1916
|
+
? ['gitlab', 'yandex', 'github', 'defectdojo']
|
|
1917
|
+
: [provider];
|
|
1652
1918
|
const results = [];
|
|
1653
1919
|
|
|
1654
1920
|
for (const current of providers) {
|
|
@@ -1660,11 +1926,22 @@ async function cmdMcpSetup({ cwd, provider, options, printer, packageRoot, modul
|
|
|
1660
1926
|
process.exit(1);
|
|
1661
1927
|
}
|
|
1662
1928
|
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
:
|
|
1666
|
-
|
|
1667
|
-
|
|
1929
|
+
let credentialResult;
|
|
1930
|
+
if (current === 'gitlab') {
|
|
1931
|
+
credentialResult = await credentials.setupGitlab({ cwd, options, envfile: modules.envfile });
|
|
1932
|
+
} else if (current === 'github') {
|
|
1933
|
+
credentialResult = await credentials.setupGithub({ cwd, options, github: modules.github });
|
|
1934
|
+
} else if (current === 'defectdojo') {
|
|
1935
|
+
credentialResult = await credentials.setupDefectdojo({ cwd, defectdojo: modules.defectdojo });
|
|
1936
|
+
} else {
|
|
1937
|
+
credentialResult = await credentials.setupYandex({
|
|
1938
|
+
cwd,
|
|
1939
|
+
options,
|
|
1940
|
+
io: {},
|
|
1941
|
+
yandex: modules.yandex,
|
|
1942
|
+
envfile: modules.envfile,
|
|
1943
|
+
});
|
|
1944
|
+
}
|
|
1668
1945
|
|
|
1669
1946
|
for (const warning of credentialResult.warnings || []) {
|
|
1670
1947
|
printer.warn('credentials', warning);
|
|
@@ -1693,6 +1970,7 @@ async function cmdMcpSetup({ cwd, provider, options, printer, packageRoot, modul
|
|
|
1693
1970
|
envfile: modules.envfile,
|
|
1694
1971
|
yandex: modules.yandex,
|
|
1695
1972
|
github: modules.github,
|
|
1973
|
+
defectdojo: modules.defectdojo,
|
|
1696
1974
|
options,
|
|
1697
1975
|
});
|
|
1698
1976
|
renderDoctor(doctor, printer);
|
|
@@ -1709,7 +1987,7 @@ async function cmdMcpSetup({ cwd, provider, options, printer, packageRoot, modul
|
|
|
1709
1987
|
(server) => ['runtime', 'registration', 'credentials'].some((area) => server.checks[area].status === 'fail'),
|
|
1710
1988
|
);
|
|
1711
1989
|
const upstreamCredentialClass = doctor.servers.some(
|
|
1712
|
-
(server) => server.checks.upstream.status === 'fail' && /401|organization/i.test(server.checks.upstream.detail),
|
|
1990
|
+
(server) => server.checks.upstream.status === 'fail' && /401|403|organization/i.test(server.checks.upstream.detail),
|
|
1713
1991
|
);
|
|
1714
1992
|
if (credentialClass || upstreamCredentialClass) {
|
|
1715
1993
|
printer.result({ command: 'setup', ok: false, providers: results });
|
|
@@ -1774,6 +2052,7 @@ async function cmdMcpDoctor({ cwd, provider, options, printer, packageRoot, modu
|
|
|
1774
2052
|
envfile: modules.envfile,
|
|
1775
2053
|
yandex: modules.yandex,
|
|
1776
2054
|
github: modules.github,
|
|
2055
|
+
defectdojo: modules.defectdojo,
|
|
1777
2056
|
options,
|
|
1778
2057
|
});
|
|
1779
2058
|
renderDoctor(doctor, printer);
|
|
@@ -1822,7 +2101,7 @@ function cmdMcpRefresh({ cwd, options, packageRoot }) {
|
|
|
1822
2101
|
async function cmdMcpRun({ slug, options, packageRoot }) {
|
|
1823
2102
|
const server = serverBySlug(slug);
|
|
1824
2103
|
if (!server) {
|
|
1825
|
-
console.error(`Unknown server: ${slug ?? '(none)'}. Use gitlab, github, yandex-tracker,
|
|
2104
|
+
console.error(`Unknown server: ${slug ?? '(none)'}. Use gitlab, github, yandex-tracker, yandex-wiki, or defectdojo.`);
|
|
1826
2105
|
process.exit(1);
|
|
1827
2106
|
}
|
|
1828
2107
|
if (!options.printEnv && (process.stdin.isTTY || process.stdout.isTTY)) {
|
|
@@ -1830,8 +2109,8 @@ async function cmdMcpRun({ slug, options, packageRoot }) {
|
|
|
1830
2109
|
console.error('next: ai-rules mcp doctor');
|
|
1831
2110
|
process.exit(1);
|
|
1832
2111
|
}
|
|
1833
|
-
if (options.printEnv && !['gitlab', 'github'].includes(server.provider)) {
|
|
1834
|
-
console.error('--print-env is supported for gitlab and
|
|
2112
|
+
if (options.printEnv && !['gitlab', 'github', 'defectdojo'].includes(server.provider)) {
|
|
2113
|
+
console.error('--print-env is supported for gitlab, github, and defectdojo only.');
|
|
1835
2114
|
process.exit(1);
|
|
1836
2115
|
}
|
|
1837
2116
|
const entry = runtimeEntryPath(packageRoot, server.entry);
|
|
@@ -1873,6 +2152,18 @@ async function cmdMcpRun({ slug, options, packageRoot }) {
|
|
|
1873
2152
|
}
|
|
1874
2153
|
}
|
|
1875
2154
|
|
|
2155
|
+
if (server.provider === 'defectdojo') {
|
|
2156
|
+
const modules = await loadPackModules(packageRoot);
|
|
2157
|
+
try {
|
|
2158
|
+
modules.defectdojo.loadDefectDojoConfig({ root: resolveProjectRoot() });
|
|
2159
|
+
} catch (error) {
|
|
2160
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
2161
|
+
console.error(`fail runtime ${detail}`);
|
|
2162
|
+
console.error('next: add DEFECTDOJO_URL and DEFECTDOJO_TOKEN to .env.defectdojo in the project root, then rerun ai-rules mcp setup defectdojo');
|
|
2163
|
+
process.exit(1);
|
|
2164
|
+
}
|
|
2165
|
+
}
|
|
2166
|
+
|
|
1876
2167
|
const args = [entry, ...server.argv];
|
|
1877
2168
|
if (options.printEnv) {
|
|
1878
2169
|
args.push('--print-env');
|
|
@@ -1969,13 +2260,13 @@ async function cmdMcp(argv) {
|
|
|
1969
2260
|
provider = providerArg ?? 'all';
|
|
1970
2261
|
} else {
|
|
1971
2262
|
if (providerArg === undefined) {
|
|
1972
|
-
console.error(`Missing provider. Use: mcp ${command} <gitlab|github|yandex|all>`);
|
|
2263
|
+
console.error(`Missing provider. Use: mcp ${command} <gitlab|github|yandex|defectdojo|all>`);
|
|
1973
2264
|
process.exit(1);
|
|
1974
2265
|
}
|
|
1975
2266
|
provider = providerArg;
|
|
1976
2267
|
}
|
|
1977
|
-
if (!['gitlab', 'github', 'yandex', 'all'].includes(provider)) {
|
|
1978
|
-
console.error(`Unknown provider: ${provider}. Use gitlab, github, yandex, or all.`);
|
|
2268
|
+
if (!['gitlab', 'github', 'yandex', 'defectdojo', 'all'].includes(provider)) {
|
|
2269
|
+
console.error(`Unknown provider: ${provider}. Use gitlab, github, yandex, defectdojo, or all.`);
|
|
1979
2270
|
process.exit(1);
|
|
1980
2271
|
}
|
|
1981
2272
|
|
|
@@ -2027,8 +2318,12 @@ function main() {
|
|
|
2027
2318
|
console.error(`Unknown option: ${parsed.unknownOption}`);
|
|
2028
2319
|
process.exit(2);
|
|
2029
2320
|
}
|
|
2321
|
+
if (parsed.mergeAiLocal || parsed.checkAiLocal || parsed.noBackup) {
|
|
2322
|
+
console.error('doctor takes --json, --fix, and --cwd only.');
|
|
2323
|
+
process.exit(2);
|
|
2324
|
+
}
|
|
2030
2325
|
if (parsed.preset || parsed.presetError || parsed.cwdError) {
|
|
2031
|
-
console.error('doctor takes --json and --cwd only.');
|
|
2326
|
+
console.error('doctor takes --json, --fix, and --cwd only.');
|
|
2032
2327
|
process.exit(2);
|
|
2033
2328
|
}
|
|
2034
2329
|
if (parsed._.length > 0) {
|
|
@@ -2061,6 +2356,16 @@ function main() {
|
|
|
2061
2356
|
const { command, tool, preset } = normalizeInitClean(parsed);
|
|
2062
2357
|
|
|
2063
2358
|
if (command === 'init') {
|
|
2359
|
+
if (parsed.fix) {
|
|
2360
|
+
console.error(
|
|
2361
|
+
'init does not take --fix; run update --fix to upgrade a seeded .ai.local/scripts/ module.',
|
|
2362
|
+
);
|
|
2363
|
+
process.exit(1);
|
|
2364
|
+
}
|
|
2365
|
+
if (parsed.noBackup) {
|
|
2366
|
+
console.error('init does not take --no-backup; --no-backup applies to update --fix.');
|
|
2367
|
+
process.exit(1);
|
|
2368
|
+
}
|
|
2064
2369
|
if (!tool || !INIT_TARGETS.has(tool)) {
|
|
2065
2370
|
console.error(
|
|
2066
2371
|
'Missing or invalid tool. Use: init cursor|claude|mavis|opencode|zcode|multi [--preset next]',
|
|
@@ -2093,6 +2398,10 @@ function main() {
|
|
|
2093
2398
|
console.error('--merge-ai-local and --check apply to init and update.');
|
|
2094
2399
|
process.exit(1);
|
|
2095
2400
|
}
|
|
2401
|
+
if (parsed.fix || parsed.noBackup) {
|
|
2402
|
+
console.error('--fix and --no-backup apply to update and doctor.');
|
|
2403
|
+
process.exit(1);
|
|
2404
|
+
}
|
|
2096
2405
|
if (tool === 'multi') {
|
|
2097
2406
|
console.error('clean multi is not supported. Clean each tool: cursor, claude, mavis, opencode.');
|
|
2098
2407
|
process.exit(1);
|