@bonesofspring/ai-rules 0.2.48 → 0.2.51
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 +101 -0
- package/README.md +15 -2
- package/bin/cli.js +52 -13
- package/bin/lib/ai-local-drift.js +665 -0
- package/bin/lib/seed-ai-local-team.js +153 -35
- package/bin/mavis-install.js +6 -0
- package/bin/opencode-install.js +13 -2
- package/docs/LOCAL-OVERLAY.md +77 -1
- package/docs/PRESET-CONTRIBUTION.md +17 -4
- package/package.json +5 -1
- package/presets/_shared/ai-local/scripts/derive-gate-signals.mjs +1 -0
- package/presets/_shared/ai-local/scripts/efficacy-oracle.mjs +1 -1
- package/presets/_shared/ai-local/scripts/manifest.mjs +30 -9
- package/presets/_shared/ai-local/scripts/rule-improver.mjs +531 -60
- package/presets/_shared/ai-local/scripts/run.mjs +56 -1
- package/presets/_shared/ai-local/scripts/signals.mjs +125 -6
- package/presets/_shared/core/agent-team/agent-artifact-contracts.md +5 -2
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +1 -1
- package/presets/_shared/core/quality/anti-hallucination-contract.md +2 -0
- package/presets/_shared/core/quality/code-quality-and-refactoring.md +1 -8
- package/presets/_shared/core/quality/interactive-questions.md +27 -0
- package/presets/_shared/core/review/code-review-mr.md +20 -1
- package/presets/_shared/core/review/receiving-code-review.md +7 -0
- package/presets/_shared/core/review/technical-retro.md +2 -0
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +9 -0
- package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/claude/android-kotlin/agents/code-reviewer.md +15 -1
- package/presets/claude/android-kotlin/agents/debugger.md +1 -1
- package/presets/claude/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/claude/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/claude/android-kotlin/commands/technical-retro.md +1 -1
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +9 -0
- package/presets/claude/android-kotlin/rules/README.md +1 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/android-kotlin/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/code-quality.md +1 -8
- package/presets/claude/android-kotlin/rules/tooling-and-review/code-review.md +20 -1
- package/presets/claude/android-kotlin/rules/tooling-and-review/interactive-questions.md +34 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/android-kotlin/skills/code-review/SKILL.md +11 -1
- package/presets/claude/android-kotlin/skills/technical-retro/SKILL.md +1 -1
- package/presets/claude/go/agents/build-verifier.md +1 -1
- package/presets/claude/go/agents/code-reviewer.md +37 -3
- package/presets/claude/go/agents/debugger.md +1 -1
- package/presets/claude/go/agents/feature-developer.md +1 -1
- package/presets/claude/go/agents/qa-tester.md +1 -1
- package/presets/claude/go/commands/technical-retro.md +1 -1
- package/presets/claude/go/hooks/chain-team-phases.sh +9 -0
- package/presets/claude/go/rules/README.md +1 -0
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
- package/presets/claude/go/rules/tooling-and-review/code-quality.md +1 -8
- package/presets/claude/go/rules/tooling-and-review/code-review.md +20 -1
- package/presets/claude/go/rules/tooling-and-review/interactive-questions.md +34 -0
- package/presets/claude/go/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/go/skills/code-review/SKILL.md +10 -1
- package/presets/claude/go/skills/technical-retro/SKILL.md +1 -1
- package/presets/claude/ios-swift/agents/build-verifier.md +1 -1
- package/presets/claude/ios-swift/agents/code-reviewer.md +15 -1
- package/presets/claude/ios-swift/agents/debugger.md +1 -1
- package/presets/claude/ios-swift/agents/feature-developer.md +1 -1
- package/presets/claude/ios-swift/agents/qa-tester.md +1 -1
- package/presets/claude/ios-swift/commands/technical-retro.md +1 -1
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +9 -0
- package/presets/claude/ios-swift/rules/README.md +2 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/code-quality.md +1 -8
- package/presets/claude/ios-swift/rules/tooling-and-review/code-review.md +20 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/interactive-questions.md +34 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/ios-swift/skills/code-review/SKILL.md +11 -1
- package/presets/claude/ios-swift/skills/technical-retro/SKILL.md +1 -1
- package/presets/claude/java/agents/build-verifier.md +1 -1
- package/presets/claude/java/agents/code-reviewer.md +37 -3
- package/presets/claude/java/agents/debugger.md +1 -1
- package/presets/claude/java/agents/feature-developer.md +1 -1
- package/presets/claude/java/agents/qa-tester.md +1 -1
- package/presets/claude/java/commands/technical-retro.md +1 -1
- package/presets/claude/java/hooks/chain-team-phases.sh +9 -0
- package/presets/claude/java/rules/README.md +1 -0
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/java/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
- package/presets/claude/java/rules/tooling-and-review/code-quality.md +1 -8
- package/presets/claude/java/rules/tooling-and-review/code-review.md +20 -1
- package/presets/claude/java/rules/tooling-and-review/interactive-questions.md +34 -0
- package/presets/claude/java/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/java/skills/code-review/SKILL.md +10 -1
- package/presets/claude/java/skills/technical-retro/SKILL.md +1 -1
- package/presets/claude/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/claude/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/claude/mcp-ts/commands/technical-retro.md +1 -1
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +9 -0
- package/presets/claude/mcp-ts/rules/README.md +1 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/code-quality.md +1 -8
- package/presets/claude/mcp-ts/rules/tooling-and-review/code-review.md +20 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/interactive-questions.md +34 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/mcp-ts/skills/code-review/SKILL.md +8 -0
- package/presets/claude/next/agents/build-verifier.md +1 -1
- package/presets/claude/next/agents/code-reviewer.md +15 -1
- package/presets/claude/next/agents/debugger.md +1 -1
- package/presets/claude/next/agents/feature-developer.md +1 -1
- package/presets/claude/next/agents/qa-tester.md +1 -1
- package/presets/claude/next/commands/technical-retro.md +1 -1
- package/presets/claude/next/hooks/chain-team-phases.sh +9 -0
- package/presets/claude/next/rules/README.md +3 -1
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
- package/presets/claude/next/rules/tooling-and-review/code-quality.md +1 -8
- package/presets/claude/next/rules/tooling-and-review/code-review-mr.md +20 -1
- package/presets/claude/next/rules/tooling-and-review/interactive-questions.md +34 -0
- package/presets/claude/next/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/next/skills/code-review/SKILL.md +12 -2
- package/presets/claude/next/skills/technical-retro/SKILL.md +1 -1
- package/presets/claude/nuxt/agents/build-verifier.md +1 -1
- package/presets/claude/nuxt/agents/code-reviewer.md +15 -1
- package/presets/claude/nuxt/agents/debugger.md +1 -1
- package/presets/claude/nuxt/agents/feature-developer.md +1 -1
- package/presets/claude/nuxt/agents/qa-tester.md +1 -1
- package/presets/claude/nuxt/commands/technical-retro.md +1 -1
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +9 -0
- package/presets/claude/nuxt/rules/README.md +2 -0
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/nuxt/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
- package/presets/claude/nuxt/rules/tooling-and-review/code-quality.md +1 -8
- package/presets/claude/nuxt/rules/tooling-and-review/code-review-mr.md +20 -1
- package/presets/claude/nuxt/rules/tooling-and-review/interactive-questions.md +34 -0
- package/presets/claude/nuxt/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/nuxt/skills/code-review/SKILL.md +11 -1
- package/presets/claude/nuxt/skills/technical-retro/SKILL.md +1 -1
- package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/claude/php-hexagonal/agents/code-reviewer.md +37 -3
- package/presets/claude/php-hexagonal/agents/debugger.md +1 -1
- package/presets/claude/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/claude/php-hexagonal/agents/qa-tester.md +1 -1
- package/presets/claude/php-hexagonal/commands/technical-retro.md +1 -1
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +9 -0
- package/presets/claude/php-hexagonal/rules/README.md +1 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/code-quality.md +1 -8
- package/presets/claude/php-hexagonal/rules/tooling-and-review/code-review.md +20 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/interactive-questions.md +34 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/php-hexagonal/skills/code-review/SKILL.md +10 -1
- package/presets/claude/php-hexagonal/skills/technical-retro/SKILL.md +1 -1
- package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
- package/presets/claude/php-laravel/agents/code-reviewer.md +37 -3
- package/presets/claude/php-laravel/agents/debugger.md +1 -1
- package/presets/claude/php-laravel/agents/feature-developer.md +1 -1
- package/presets/claude/php-laravel/agents/qa-tester.md +1 -1
- package/presets/claude/php-laravel/commands/technical-retro.md +1 -1
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +9 -0
- package/presets/claude/php-laravel/rules/README.md +1 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/code-quality.md +1 -8
- package/presets/claude/php-laravel/rules/tooling-and-review/code-review.md +20 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/interactive-questions.md +34 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/php-laravel/skills/code-review/SKILL.md +10 -1
- package/presets/claude/php-laravel/skills/technical-retro/SKILL.md +1 -1
- package/presets/claude/svelte/agents/build-verifier.md +1 -1
- package/presets/claude/svelte/agents/code-reviewer.md +15 -1
- package/presets/claude/svelte/agents/debugger.md +1 -1
- package/presets/claude/svelte/agents/feature-developer.md +1 -1
- package/presets/claude/svelte/agents/qa-tester.md +1 -1
- package/presets/claude/svelte/commands/technical-retro.md +1 -1
- package/presets/claude/svelte/hooks/chain-team-phases.sh +9 -0
- package/presets/claude/svelte/rules/README.md +2 -0
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/svelte/rules/tooling-and-review/anti-hallucination-contract.md +2 -0
- package/presets/claude/svelte/rules/tooling-and-review/code-quality.md +1 -8
- package/presets/claude/svelte/rules/tooling-and-review/code-review-mr.md +20 -1
- package/presets/claude/svelte/rules/tooling-and-review/interactive-questions.md +34 -0
- package/presets/claude/svelte/rules/tooling-and-review/technical-retro.md +2 -0
- package/presets/claude/svelte/skills/code-review/SKILL.md +11 -1
- package/presets/claude/svelte/skills/technical-retro/SKILL.md +1 -1
- package/presets/cursor/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/cursor/android-kotlin/agents/code-reviewer.md +15 -1
- package/presets/cursor/android-kotlin/agents/debugger.md +1 -1
- package/presets/cursor/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/cursor/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/cursor/android-kotlin/commands/technical-retro.md +1 -1
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +9 -0
- package/presets/cursor/android-kotlin/rules/README.md +1 -0
- package/presets/cursor/android-kotlin/rules/anti-hallucination-contract.mdc +2 -0
- package/presets/cursor/android-kotlin/rules/code-quality-and-refactoring.mdc +1 -8
- package/presets/cursor/android-kotlin/rules/code-review-mr.mdc +20 -1
- package/presets/cursor/android-kotlin/rules/interactive-questions.mdc +34 -0
- package/presets/cursor/android-kotlin/rules/technical-retro.mdc +2 -0
- package/presets/cursor/android-kotlin/skills/code-review/SKILL.md +11 -1
- package/presets/cursor/android-kotlin/skills/technical-retro/SKILL.md +1 -1
- package/presets/cursor/go/agents/build-verifier.md +1 -1
- package/presets/cursor/go/agents/code-reviewer.md +37 -3
- package/presets/cursor/go/agents/debugger.md +1 -1
- package/presets/cursor/go/agents/feature-developer.md +1 -1
- package/presets/cursor/go/agents/qa-tester.md +1 -1
- package/presets/cursor/go/commands/technical-retro.md +1 -1
- package/presets/cursor/go/hooks/chain-team-phases.sh +9 -0
- package/presets/cursor/go/rules/README.md +2 -1
- package/presets/cursor/go/rules/anti-hallucination-contract.mdc +2 -0
- package/presets/cursor/go/rules/code-quality-and-refactoring.mdc +1 -8
- package/presets/cursor/go/rules/code-review-mr.mdc +20 -1
- package/presets/cursor/go/rules/interactive-questions.mdc +34 -0
- package/presets/cursor/go/rules/technical-retro.mdc +2 -0
- package/presets/cursor/go/skills/code-review/SKILL.md +10 -1
- package/presets/cursor/go/skills/technical-retro/SKILL.md +1 -1
- package/presets/cursor/ios-swift/agents/build-verifier.md +1 -1
- package/presets/cursor/ios-swift/agents/code-reviewer.md +15 -1
- package/presets/cursor/ios-swift/agents/debugger.md +1 -1
- package/presets/cursor/ios-swift/agents/feature-developer.md +1 -1
- package/presets/cursor/ios-swift/agents/qa-tester.md +1 -1
- package/presets/cursor/ios-swift/commands/technical-retro.md +1 -1
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +9 -0
- package/presets/cursor/ios-swift/rules/README.md +1 -0
- package/presets/cursor/ios-swift/rules/anti-hallucination-contract.mdc +2 -0
- package/presets/cursor/ios-swift/rules/code-quality-and-refactoring.mdc +1 -8
- package/presets/cursor/ios-swift/rules/code-review-mr.mdc +20 -1
- package/presets/cursor/ios-swift/rules/interactive-questions.mdc +34 -0
- package/presets/cursor/ios-swift/rules/technical-retro.mdc +2 -0
- package/presets/cursor/ios-swift/skills/code-review/SKILL.md +11 -1
- package/presets/cursor/ios-swift/skills/technical-retro/SKILL.md +1 -1
- package/presets/cursor/java/agents/build-verifier.md +1 -1
- package/presets/cursor/java/agents/code-reviewer.md +37 -3
- package/presets/cursor/java/agents/debugger.md +1 -1
- package/presets/cursor/java/agents/feature-developer.md +1 -1
- package/presets/cursor/java/agents/qa-tester.md +1 -1
- package/presets/cursor/java/commands/technical-retro.md +1 -1
- package/presets/cursor/java/hooks/chain-team-phases.sh +9 -0
- package/presets/cursor/java/rules/README.md +2 -1
- package/presets/cursor/java/rules/anti-hallucination-contract.mdc +2 -0
- package/presets/cursor/java/rules/code-quality-and-refactoring.mdc +1 -8
- package/presets/cursor/java/rules/code-review-mr.mdc +20 -1
- package/presets/cursor/java/rules/interactive-questions.mdc +34 -0
- package/presets/cursor/java/rules/technical-retro.mdc +2 -0
- package/presets/cursor/java/skills/code-review/SKILL.md +10 -1
- package/presets/cursor/java/skills/technical-retro/SKILL.md +1 -1
- package/presets/cursor/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/cursor/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/cursor/mcp-ts/commands/technical-retro.md +1 -1
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +9 -0
- package/presets/cursor/mcp-ts/rules/README.md +2 -1
- package/presets/cursor/mcp-ts/rules/anti-hallucination-contract.mdc +2 -0
- package/presets/cursor/mcp-ts/rules/code-quality-and-refactoring.mdc +1 -8
- package/presets/cursor/mcp-ts/rules/code-review-mr.mdc +20 -1
- package/presets/cursor/mcp-ts/rules/interactive-questions.mdc +34 -0
- package/presets/cursor/mcp-ts/rules/technical-retro.mdc +2 -0
- package/presets/cursor/mcp-ts/skills/code-review/SKILL.md +8 -0
- package/presets/cursor/next/agents/build-verifier.md +1 -1
- package/presets/cursor/next/agents/code-reviewer.md +15 -1
- package/presets/cursor/next/agents/debugger.md +1 -1
- package/presets/cursor/next/agents/feature-developer.md +1 -1
- package/presets/cursor/next/agents/qa-tester.md +1 -1
- package/presets/cursor/next/commands/technical-retro.md +1 -1
- package/presets/cursor/next/hooks/chain-team-phases.sh +9 -0
- package/presets/cursor/next/rules/README.md +2 -1
- package/presets/cursor/next/rules/anti-hallucination-contract.mdc +2 -0
- package/presets/cursor/next/rules/code-quality-and-refactoring.mdc +1 -8
- package/presets/cursor/next/rules/code-review-mr.mdc +20 -1
- package/presets/cursor/next/rules/interactive-questions.mdc +34 -0
- package/presets/cursor/next/rules/technical-retro.mdc +2 -0
- package/presets/cursor/next/skills/code-review/SKILL.md +12 -2
- package/presets/cursor/next/skills/technical-retro/SKILL.md +1 -1
- package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
- package/presets/cursor/nuxt/agents/code-reviewer.md +15 -1
- package/presets/cursor/nuxt/agents/debugger.md +1 -1
- package/presets/cursor/nuxt/agents/feature-developer.md +1 -1
- package/presets/cursor/nuxt/agents/qa-tester.md +1 -1
- package/presets/cursor/nuxt/commands/technical-retro.md +1 -1
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +9 -0
- package/presets/cursor/nuxt/rules/README.md +2 -1
- package/presets/cursor/nuxt/rules/anti-hallucination-contract.mdc +2 -0
- package/presets/cursor/nuxt/rules/code-quality-and-refactoring.mdc +1 -8
- package/presets/cursor/nuxt/rules/code-review-mr.mdc +20 -1
- package/presets/cursor/nuxt/rules/interactive-questions.mdc +34 -0
- package/presets/cursor/nuxt/rules/technical-retro.mdc +2 -0
- package/presets/cursor/nuxt/skills/code-review/SKILL.md +11 -1
- package/presets/cursor/nuxt/skills/technical-retro/SKILL.md +1 -1
- package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/cursor/php-hexagonal/agents/code-reviewer.md +37 -3
- package/presets/cursor/php-hexagonal/agents/debugger.md +1 -1
- package/presets/cursor/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/cursor/php-hexagonal/agents/qa-tester.md +1 -1
- package/presets/cursor/php-hexagonal/commands/technical-retro.md +1 -1
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +9 -0
- package/presets/cursor/php-hexagonal/rules/README.md +2 -1
- package/presets/cursor/php-hexagonal/rules/anti-hallucination-contract.mdc +2 -0
- package/presets/cursor/php-hexagonal/rules/code-quality-and-refactoring.mdc +1 -8
- package/presets/cursor/php-hexagonal/rules/code-review-mr.mdc +20 -1
- package/presets/cursor/php-hexagonal/rules/interactive-questions.mdc +34 -0
- package/presets/cursor/php-hexagonal/rules/technical-retro.mdc +2 -0
- package/presets/cursor/php-hexagonal/skills/code-review/SKILL.md +10 -1
- package/presets/cursor/php-hexagonal/skills/technical-retro/SKILL.md +1 -1
- package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
- package/presets/cursor/php-laravel/agents/code-reviewer.md +37 -3
- package/presets/cursor/php-laravel/agents/debugger.md +1 -1
- package/presets/cursor/php-laravel/agents/feature-developer.md +1 -1
- package/presets/cursor/php-laravel/agents/qa-tester.md +1 -1
- package/presets/cursor/php-laravel/commands/technical-retro.md +1 -1
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +9 -0
- package/presets/cursor/php-laravel/rules/README.md +2 -1
- package/presets/cursor/php-laravel/rules/anti-hallucination-contract.mdc +2 -0
- package/presets/cursor/php-laravel/rules/code-quality-and-refactoring.mdc +1 -8
- package/presets/cursor/php-laravel/rules/code-review-mr.mdc +20 -1
- package/presets/cursor/php-laravel/rules/interactive-questions.mdc +34 -0
- package/presets/cursor/php-laravel/rules/technical-retro.mdc +2 -0
- package/presets/cursor/php-laravel/skills/code-review/SKILL.md +10 -1
- package/presets/cursor/php-laravel/skills/technical-retro/SKILL.md +1 -1
- package/presets/cursor/svelte/agents/build-verifier.md +1 -1
- package/presets/cursor/svelte/agents/code-reviewer.md +15 -1
- package/presets/cursor/svelte/agents/debugger.md +1 -1
- package/presets/cursor/svelte/agents/feature-developer.md +1 -1
- package/presets/cursor/svelte/agents/qa-tester.md +1 -1
- package/presets/cursor/svelte/commands/technical-retro.md +1 -1
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +9 -0
- package/presets/cursor/svelte/rules/README.md +2 -1
- package/presets/cursor/svelte/rules/anti-hallucination-contract.mdc +2 -0
- package/presets/cursor/svelte/rules/code-quality-and-refactoring.mdc +1 -8
- package/presets/cursor/svelte/rules/code-review-mr.mdc +20 -1
- package/presets/cursor/svelte/rules/interactive-questions.mdc +34 -0
- package/presets/cursor/svelte/rules/technical-retro.mdc +2 -0
- package/presets/cursor/svelte/skills/code-review/SKILL.md +11 -1
- package/presets/cursor/svelte/skills/technical-retro/SKILL.md +1 -1
- package/presets/mavis/android-kotlin/adapter-map.json +10 -1
- package/presets/mavis/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/mavis/android-kotlin/agents/code-reviewer.md +15 -1
- package/presets/mavis/android-kotlin/agents/debugger.md +1 -1
- package/presets/mavis/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/mavis/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/mavis/android-kotlin/commands/technical-retro.md +1 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +9 -0
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/android-kotlin/rules/anti-hallucination-contract.md +2 -0
- package/presets/mavis/android-kotlin/rules/code-quality-and-refactoring.md +1 -8
- package/presets/mavis/android-kotlin/rules/code-review-mr.md +20 -1
- package/presets/mavis/android-kotlin/rules/interactive-questions.md +29 -0
- package/presets/mavis/android-kotlin/rules/technical-retro.md +2 -0
- package/presets/mavis/android-kotlin/skills/code-review/SKILL.md +11 -1
- package/presets/mavis/android-kotlin/skills/technical-retro/SKILL.md +1 -1
- package/presets/mavis/go/adapter-map.json +10 -1
- package/presets/mavis/go/agents/build-verifier.md +1 -1
- package/presets/mavis/go/agents/code-reviewer.md +37 -3
- package/presets/mavis/go/agents/debugger.md +1 -1
- package/presets/mavis/go/agents/feature-developer.md +1 -1
- package/presets/mavis/go/agents/qa-tester.md +1 -1
- package/presets/mavis/go/commands/technical-retro.md +1 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +9 -0
- package/presets/mavis/go/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/go/rules/anti-hallucination-contract.md +2 -0
- package/presets/mavis/go/rules/code-quality-and-refactoring.md +1 -8
- package/presets/mavis/go/rules/code-review-mr.md +20 -1
- package/presets/mavis/go/rules/interactive-questions.md +29 -0
- package/presets/mavis/go/rules/technical-retro.md +2 -0
- package/presets/mavis/go/skills/code-review/SKILL.md +10 -1
- package/presets/mavis/go/skills/technical-retro/SKILL.md +1 -1
- package/presets/mavis/ios-swift/adapter-map.json +10 -1
- package/presets/mavis/ios-swift/agents/build-verifier.md +1 -1
- package/presets/mavis/ios-swift/agents/code-reviewer.md +15 -1
- package/presets/mavis/ios-swift/agents/debugger.md +1 -1
- package/presets/mavis/ios-swift/agents/feature-developer.md +1 -1
- package/presets/mavis/ios-swift/agents/qa-tester.md +1 -1
- package/presets/mavis/ios-swift/commands/technical-retro.md +1 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +9 -0
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/ios-swift/rules/anti-hallucination-contract.md +2 -0
- package/presets/mavis/ios-swift/rules/code-quality-and-refactoring.md +1 -8
- package/presets/mavis/ios-swift/rules/code-review-mr.md +20 -1
- package/presets/mavis/ios-swift/rules/interactive-questions.md +29 -0
- package/presets/mavis/ios-swift/rules/technical-retro.md +2 -0
- package/presets/mavis/ios-swift/skills/code-review/SKILL.md +11 -1
- package/presets/mavis/ios-swift/skills/technical-retro/SKILL.md +1 -1
- package/presets/mavis/java/adapter-map.json +10 -1
- package/presets/mavis/java/agents/build-verifier.md +1 -1
- package/presets/mavis/java/agents/code-reviewer.md +37 -3
- package/presets/mavis/java/agents/debugger.md +1 -1
- package/presets/mavis/java/agents/feature-developer.md +1 -1
- package/presets/mavis/java/agents/qa-tester.md +1 -1
- package/presets/mavis/java/commands/technical-retro.md +1 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +9 -0
- package/presets/mavis/java/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/java/rules/anti-hallucination-contract.md +2 -0
- package/presets/mavis/java/rules/code-quality-and-refactoring.md +1 -8
- package/presets/mavis/java/rules/code-review-mr.md +20 -1
- package/presets/mavis/java/rules/interactive-questions.md +29 -0
- package/presets/mavis/java/rules/technical-retro.md +2 -0
- package/presets/mavis/java/skills/code-review/SKILL.md +10 -1
- package/presets/mavis/java/skills/technical-retro/SKILL.md +1 -1
- package/presets/mavis/mcp-ts/adapter-map.json +10 -1
- package/presets/mavis/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/mavis/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/mavis/mcp-ts/commands/technical-retro.md +1 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +9 -0
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/mcp-ts/rules/anti-hallucination-contract.md +2 -0
- package/presets/mavis/mcp-ts/rules/code-quality-and-refactoring.md +1 -8
- package/presets/mavis/mcp-ts/rules/code-review-mr.md +20 -1
- package/presets/mavis/mcp-ts/rules/interactive-questions.md +29 -0
- package/presets/mavis/mcp-ts/rules/technical-retro.md +2 -0
- package/presets/mavis/mcp-ts/skills/code-review/SKILL.md +8 -0
- package/presets/mavis/next/adapter-map.json +10 -1
- package/presets/mavis/next/agents/build-verifier.md +1 -1
- package/presets/mavis/next/agents/code-reviewer.md +15 -1
- package/presets/mavis/next/agents/debugger.md +1 -1
- package/presets/mavis/next/agents/feature-developer.md +1 -1
- package/presets/mavis/next/agents/qa-tester.md +1 -1
- package/presets/mavis/next/commands/technical-retro.md +1 -1
- package/presets/mavis/next/hooks/chain-team-phases.sh +9 -0
- package/presets/mavis/next/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/next/rules/anti-hallucination-contract.md +2 -0
- package/presets/mavis/next/rules/code-quality-and-refactoring.md +1 -8
- package/presets/mavis/next/rules/code-review-mr.md +20 -1
- package/presets/mavis/next/rules/interactive-questions.md +29 -0
- package/presets/mavis/next/rules/technical-retro.md +2 -0
- package/presets/mavis/next/skills/code-review/SKILL.md +12 -2
- package/presets/mavis/next/skills/technical-retro/SKILL.md +1 -1
- package/presets/mavis/nuxt/adapter-map.json +10 -1
- package/presets/mavis/nuxt/agents/build-verifier.md +1 -1
- package/presets/mavis/nuxt/agents/code-reviewer.md +15 -1
- package/presets/mavis/nuxt/agents/debugger.md +1 -1
- package/presets/mavis/nuxt/agents/feature-developer.md +1 -1
- package/presets/mavis/nuxt/agents/qa-tester.md +1 -1
- package/presets/mavis/nuxt/commands/technical-retro.md +1 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +9 -0
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/nuxt/rules/anti-hallucination-contract.md +2 -0
- package/presets/mavis/nuxt/rules/code-quality-and-refactoring.md +1 -8
- package/presets/mavis/nuxt/rules/code-review-mr.md +20 -1
- package/presets/mavis/nuxt/rules/interactive-questions.md +29 -0
- package/presets/mavis/nuxt/rules/technical-retro.md +2 -0
- package/presets/mavis/nuxt/skills/code-review/SKILL.md +11 -1
- package/presets/mavis/nuxt/skills/technical-retro/SKILL.md +1 -1
- package/presets/mavis/php-hexagonal/adapter-map.json +10 -1
- package/presets/mavis/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/mavis/php-hexagonal/agents/code-reviewer.md +37 -3
- package/presets/mavis/php-hexagonal/agents/debugger.md +1 -1
- package/presets/mavis/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/mavis/php-hexagonal/agents/qa-tester.md +1 -1
- package/presets/mavis/php-hexagonal/commands/technical-retro.md +1 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +9 -0
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/php-hexagonal/rules/anti-hallucination-contract.md +2 -0
- package/presets/mavis/php-hexagonal/rules/code-quality-and-refactoring.md +1 -8
- package/presets/mavis/php-hexagonal/rules/code-review-mr.md +20 -1
- package/presets/mavis/php-hexagonal/rules/interactive-questions.md +29 -0
- package/presets/mavis/php-hexagonal/rules/technical-retro.md +2 -0
- package/presets/mavis/php-hexagonal/skills/code-review/SKILL.md +10 -1
- package/presets/mavis/php-hexagonal/skills/technical-retro/SKILL.md +1 -1
- package/presets/mavis/php-laravel/adapter-map.json +10 -1
- package/presets/mavis/php-laravel/agents/build-verifier.md +1 -1
- package/presets/mavis/php-laravel/agents/code-reviewer.md +37 -3
- package/presets/mavis/php-laravel/agents/debugger.md +1 -1
- package/presets/mavis/php-laravel/agents/feature-developer.md +1 -1
- package/presets/mavis/php-laravel/agents/qa-tester.md +1 -1
- package/presets/mavis/php-laravel/commands/technical-retro.md +1 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +9 -0
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/php-laravel/rules/anti-hallucination-contract.md +2 -0
- package/presets/mavis/php-laravel/rules/code-quality-and-refactoring.md +1 -8
- package/presets/mavis/php-laravel/rules/code-review-mr.md +20 -1
- package/presets/mavis/php-laravel/rules/interactive-questions.md +29 -0
- package/presets/mavis/php-laravel/rules/technical-retro.md +2 -0
- package/presets/mavis/php-laravel/skills/code-review/SKILL.md +10 -1
- package/presets/mavis/php-laravel/skills/technical-retro/SKILL.md +1 -1
- package/presets/mavis/svelte/adapter-map.json +10 -1
- package/presets/mavis/svelte/agents/build-verifier.md +1 -1
- package/presets/mavis/svelte/agents/code-reviewer.md +15 -1
- package/presets/mavis/svelte/agents/debugger.md +1 -1
- package/presets/mavis/svelte/agents/feature-developer.md +1 -1
- package/presets/mavis/svelte/agents/qa-tester.md +1 -1
- package/presets/mavis/svelte/commands/technical-retro.md +1 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +9 -0
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/svelte/rules/anti-hallucination-contract.md +2 -0
- package/presets/mavis/svelte/rules/code-quality-and-refactoring.md +1 -8
- package/presets/mavis/svelte/rules/code-review-mr.md +20 -1
- package/presets/mavis/svelte/rules/interactive-questions.md +29 -0
- package/presets/mavis/svelte/rules/technical-retro.md +2 -0
- package/presets/mavis/svelte/skills/code-review/SKILL.md +11 -1
- package/presets/mavis/svelte/skills/technical-retro/SKILL.md +1 -1
- package/presets/opencode/android-kotlin/adapter-map.json +10 -1
- package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/opencode/android-kotlin/agents/code-reviewer.md +15 -1
- package/presets/opencode/android-kotlin/agents/debugger.md +1 -1
- package/presets/opencode/android-kotlin/agents/feature-developer.md +1 -1
- package/presets/opencode/android-kotlin/agents/qa-tester.md +1 -1
- package/presets/opencode/android-kotlin/commands/technical-retro.md +1 -1
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +9 -0
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/android-kotlin/rules/anti-hallucination-contract.md +2 -0
- package/presets/opencode/android-kotlin/rules/code-quality-and-refactoring.md +1 -8
- package/presets/opencode/android-kotlin/rules/code-review-mr.md +20 -1
- package/presets/opencode/android-kotlin/rules/interactive-questions.md +29 -0
- package/presets/opencode/android-kotlin/rules/technical-retro.md +2 -0
- package/presets/opencode/android-kotlin/skills/code-review/SKILL.md +11 -1
- package/presets/opencode/android-kotlin/skills/technical-retro/SKILL.md +1 -1
- package/presets/opencode/go/adapter-map.json +10 -1
- package/presets/opencode/go/agents/build-verifier.md +1 -1
- package/presets/opencode/go/agents/code-reviewer.md +37 -3
- package/presets/opencode/go/agents/debugger.md +1 -1
- package/presets/opencode/go/agents/feature-developer.md +1 -1
- package/presets/opencode/go/agents/qa-tester.md +1 -1
- package/presets/opencode/go/commands/technical-retro.md +1 -1
- package/presets/opencode/go/hooks/chain-team-phases.sh +9 -0
- package/presets/opencode/go/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/go/rules/anti-hallucination-contract.md +2 -0
- package/presets/opencode/go/rules/code-quality-and-refactoring.md +1 -8
- package/presets/opencode/go/rules/code-review-mr.md +20 -1
- package/presets/opencode/go/rules/interactive-questions.md +29 -0
- package/presets/opencode/go/rules/technical-retro.md +2 -0
- package/presets/opencode/go/skills/code-review/SKILL.md +10 -1
- package/presets/opencode/go/skills/technical-retro/SKILL.md +1 -1
- package/presets/opencode/ios-swift/adapter-map.json +10 -1
- package/presets/opencode/ios-swift/agents/build-verifier.md +1 -1
- package/presets/opencode/ios-swift/agents/code-reviewer.md +15 -1
- package/presets/opencode/ios-swift/agents/debugger.md +1 -1
- package/presets/opencode/ios-swift/agents/feature-developer.md +1 -1
- package/presets/opencode/ios-swift/agents/qa-tester.md +1 -1
- package/presets/opencode/ios-swift/commands/technical-retro.md +1 -1
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +9 -0
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/ios-swift/rules/anti-hallucination-contract.md +2 -0
- package/presets/opencode/ios-swift/rules/code-quality-and-refactoring.md +1 -8
- package/presets/opencode/ios-swift/rules/code-review-mr.md +20 -1
- package/presets/opencode/ios-swift/rules/interactive-questions.md +29 -0
- package/presets/opencode/ios-swift/rules/technical-retro.md +2 -0
- package/presets/opencode/ios-swift/skills/code-review/SKILL.md +11 -1
- package/presets/opencode/ios-swift/skills/technical-retro/SKILL.md +1 -1
- package/presets/opencode/java/adapter-map.json +10 -1
- package/presets/opencode/java/agents/build-verifier.md +1 -1
- package/presets/opencode/java/agents/code-reviewer.md +37 -3
- package/presets/opencode/java/agents/debugger.md +1 -1
- package/presets/opencode/java/agents/feature-developer.md +1 -1
- package/presets/opencode/java/agents/qa-tester.md +1 -1
- package/presets/opencode/java/commands/technical-retro.md +1 -1
- package/presets/opencode/java/hooks/chain-team-phases.sh +9 -0
- package/presets/opencode/java/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/java/rules/anti-hallucination-contract.md +2 -0
- package/presets/opencode/java/rules/code-quality-and-refactoring.md +1 -8
- package/presets/opencode/java/rules/code-review-mr.md +20 -1
- package/presets/opencode/java/rules/interactive-questions.md +29 -0
- package/presets/opencode/java/rules/technical-retro.md +2 -0
- package/presets/opencode/java/skills/code-review/SKILL.md +10 -1
- package/presets/opencode/java/skills/technical-retro/SKILL.md +1 -1
- package/presets/opencode/mcp-ts/adapter-map.json +10 -1
- package/presets/opencode/mcp-ts/agents/build-verifier.md +1 -1
- package/presets/opencode/mcp-ts/agents/feature-developer.md +1 -1
- package/presets/opencode/mcp-ts/commands/technical-retro.md +1 -1
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +9 -0
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/mcp-ts/rules/anti-hallucination-contract.md +2 -0
- package/presets/opencode/mcp-ts/rules/code-quality-and-refactoring.md +1 -8
- package/presets/opencode/mcp-ts/rules/code-review-mr.md +20 -1
- package/presets/opencode/mcp-ts/rules/interactive-questions.md +29 -0
- package/presets/opencode/mcp-ts/rules/technical-retro.md +2 -0
- package/presets/opencode/mcp-ts/skills/code-review/SKILL.md +8 -0
- package/presets/opencode/next/adapter-map.json +10 -1
- package/presets/opencode/next/agents/build-verifier.md +1 -1
- package/presets/opencode/next/agents/code-reviewer.md +15 -1
- package/presets/opencode/next/agents/debugger.md +1 -1
- package/presets/opencode/next/agents/feature-developer.md +1 -1
- package/presets/opencode/next/agents/qa-tester.md +1 -1
- package/presets/opencode/next/commands/technical-retro.md +1 -1
- package/presets/opencode/next/hooks/chain-team-phases.sh +9 -0
- package/presets/opencode/next/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/next/rules/anti-hallucination-contract.md +2 -0
- package/presets/opencode/next/rules/code-quality-and-refactoring.md +1 -8
- package/presets/opencode/next/rules/code-review-mr.md +20 -1
- package/presets/opencode/next/rules/interactive-questions.md +29 -0
- package/presets/opencode/next/rules/technical-retro.md +2 -0
- package/presets/opencode/next/skills/code-review/SKILL.md +12 -2
- package/presets/opencode/next/skills/technical-retro/SKILL.md +1 -1
- package/presets/opencode/nuxt/adapter-map.json +10 -1
- package/presets/opencode/nuxt/agents/build-verifier.md +1 -1
- package/presets/opencode/nuxt/agents/code-reviewer.md +15 -1
- package/presets/opencode/nuxt/agents/debugger.md +1 -1
- package/presets/opencode/nuxt/agents/feature-developer.md +1 -1
- package/presets/opencode/nuxt/agents/qa-tester.md +1 -1
- package/presets/opencode/nuxt/commands/technical-retro.md +1 -1
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +9 -0
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/nuxt/rules/anti-hallucination-contract.md +2 -0
- package/presets/opencode/nuxt/rules/code-quality-and-refactoring.md +1 -8
- package/presets/opencode/nuxt/rules/code-review-mr.md +20 -1
- package/presets/opencode/nuxt/rules/interactive-questions.md +29 -0
- package/presets/opencode/nuxt/rules/technical-retro.md +2 -0
- package/presets/opencode/nuxt/skills/code-review/SKILL.md +11 -1
- package/presets/opencode/nuxt/skills/technical-retro/SKILL.md +1 -1
- package/presets/opencode/php-hexagonal/adapter-map.json +10 -1
- package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/opencode/php-hexagonal/agents/code-reviewer.md +37 -3
- package/presets/opencode/php-hexagonal/agents/debugger.md +1 -1
- package/presets/opencode/php-hexagonal/agents/feature-developer.md +1 -1
- package/presets/opencode/php-hexagonal/agents/qa-tester.md +1 -1
- package/presets/opencode/php-hexagonal/commands/technical-retro.md +1 -1
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +9 -0
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/php-hexagonal/rules/anti-hallucination-contract.md +2 -0
- package/presets/opencode/php-hexagonal/rules/code-quality-and-refactoring.md +1 -8
- package/presets/opencode/php-hexagonal/rules/code-review-mr.md +20 -1
- package/presets/opencode/php-hexagonal/rules/interactive-questions.md +29 -0
- package/presets/opencode/php-hexagonal/rules/technical-retro.md +2 -0
- package/presets/opencode/php-hexagonal/skills/code-review/SKILL.md +10 -1
- package/presets/opencode/php-hexagonal/skills/technical-retro/SKILL.md +1 -1
- package/presets/opencode/php-laravel/adapter-map.json +10 -1
- package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
- package/presets/opencode/php-laravel/agents/code-reviewer.md +37 -3
- package/presets/opencode/php-laravel/agents/debugger.md +1 -1
- package/presets/opencode/php-laravel/agents/feature-developer.md +1 -1
- package/presets/opencode/php-laravel/agents/qa-tester.md +1 -1
- package/presets/opencode/php-laravel/commands/technical-retro.md +1 -1
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +9 -0
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/php-laravel/rules/anti-hallucination-contract.md +2 -0
- package/presets/opencode/php-laravel/rules/code-quality-and-refactoring.md +1 -8
- package/presets/opencode/php-laravel/rules/code-review-mr.md +20 -1
- package/presets/opencode/php-laravel/rules/interactive-questions.md +29 -0
- package/presets/opencode/php-laravel/rules/technical-retro.md +2 -0
- package/presets/opencode/php-laravel/skills/code-review/SKILL.md +10 -1
- package/presets/opencode/php-laravel/skills/technical-retro/SKILL.md +1 -1
- package/presets/opencode/svelte/adapter-map.json +10 -1
- package/presets/opencode/svelte/agents/build-verifier.md +1 -1
- package/presets/opencode/svelte/agents/code-reviewer.md +15 -1
- package/presets/opencode/svelte/agents/debugger.md +1 -1
- package/presets/opencode/svelte/agents/feature-developer.md +1 -1
- package/presets/opencode/svelte/agents/qa-tester.md +1 -1
- package/presets/opencode/svelte/commands/technical-retro.md +1 -1
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +9 -0
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/svelte/rules/anti-hallucination-contract.md +2 -0
- package/presets/opencode/svelte/rules/code-quality-and-refactoring.md +1 -8
- package/presets/opencode/svelte/rules/code-review-mr.md +20 -1
- package/presets/opencode/svelte/rules/interactive-questions.md +29 -0
- package/presets/opencode/svelte/rules/technical-retro.md +2 -0
- package/presets/opencode/svelte/skills/code-review/SKILL.md +11 -1
- package/presets/opencode/svelte/skills/technical-retro/SKILL.md +1 -1
|
@@ -16,7 +16,16 @@ import fs from 'node:fs';
|
|
|
16
16
|
import path from 'node:path';
|
|
17
17
|
import { pathToFileURL } from 'node:url';
|
|
18
18
|
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
SIGNATURE_RE,
|
|
21
|
+
ISSUE_BODY_RE,
|
|
22
|
+
groupSignatures,
|
|
23
|
+
validateSignal,
|
|
24
|
+
markSignalsApplied,
|
|
25
|
+
markSignalsRolledBack,
|
|
26
|
+
isRepoRelativePath,
|
|
27
|
+
isScriptCommandName,
|
|
28
|
+
} from './signals.mjs';
|
|
20
29
|
import { acquireLock, releaseLock } from './lock.mjs';
|
|
21
30
|
|
|
22
31
|
// --- Envelope caps (architecture.md §3) -------------------------------------
|
|
@@ -104,12 +113,37 @@ function writeFileAtomic(target, content) {
|
|
|
104
113
|
fs.renameSync(temporary, target);
|
|
105
114
|
}
|
|
106
115
|
|
|
116
|
+
/**
|
|
117
|
+
* The ledger is committed, so its `target` is repo-relative: a host path would
|
|
118
|
+
* leak the machine layout (`agent-artifacts-no-local-paths`). File I/O keeps
|
|
119
|
+
* absolute paths; only the serialized line is normalized.
|
|
120
|
+
*/
|
|
121
|
+
export function projectRootFor(ledgerPath) {
|
|
122
|
+
return path.dirname(path.dirname(path.resolve(ledgerPath)));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Absolute (or already project-relative) path -> the ledger's repo-relative form. */
|
|
126
|
+
export function toLedgerTarget(target, rootDir) {
|
|
127
|
+
const absolute = path.isAbsolute(target) ? target : path.resolve(rootDir, target);
|
|
128
|
+
const relative = path.relative(rootDir, absolute);
|
|
129
|
+
if (relative === '' || relative.startsWith('..') || path.isAbsolute(relative)) {
|
|
130
|
+
throw new Error(`ledger target escapes the project root: ${target}`);
|
|
131
|
+
}
|
|
132
|
+
return relative.split(path.sep).join('/');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Ledger form -> the absolute path file I/O needs; tolerates legacy absolute rows. */
|
|
136
|
+
export function resolveLedgerTarget(target, rootDir) {
|
|
137
|
+
return path.isAbsolute(target) ? target : path.resolve(rootDir, target);
|
|
138
|
+
}
|
|
139
|
+
|
|
107
140
|
function appendLedgerLine(ledgerPath, entry) {
|
|
141
|
+
const normalized = { ...entry, target: toLedgerTarget(entry.target, projectRootFor(ledgerPath)) };
|
|
108
142
|
const existing = readExisting(ledgerPath) ?? '';
|
|
109
143
|
const temporary = `${ledgerPath}.${process.pid}.${Date.now()}.tmp`;
|
|
110
144
|
const fd = fs.openSync(temporary, 'w');
|
|
111
145
|
try {
|
|
112
|
-
fs.writeSync(fd, existing + `${JSON.stringify(
|
|
146
|
+
fs.writeSync(fd, existing + `${JSON.stringify(normalized)}\n`);
|
|
113
147
|
try { fs.fsyncSync(fd); } catch {}
|
|
114
148
|
} finally {
|
|
115
149
|
try { fs.closeSync(fd); } catch {}
|
|
@@ -177,17 +211,221 @@ export function imperativeSentence(kind, phrase) {
|
|
|
177
211
|
return `${KIND_VERB[kind] ?? 'Fix'} ${phrase}.`;
|
|
178
212
|
}
|
|
179
213
|
|
|
214
|
+
function signatureKind(signature) {
|
|
215
|
+
return signature.slice(0, signature.indexOf(':'));
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export function loadAliasMap(filePath) {
|
|
219
|
+
let raw;
|
|
220
|
+
try {
|
|
221
|
+
raw = fs.readFileSync(filePath, 'utf8');
|
|
222
|
+
} catch (error) {
|
|
223
|
+
if (error && error.code === 'ENOENT') return { aliases: {}, error: null };
|
|
224
|
+
return { aliases: {}, error: error instanceof Error ? error.message : String(error) };
|
|
225
|
+
}
|
|
226
|
+
let data;
|
|
227
|
+
try {
|
|
228
|
+
data = JSON.parse(raw);
|
|
229
|
+
} catch {
|
|
230
|
+
return { aliases: {}, error: 'invalid JSON' };
|
|
231
|
+
}
|
|
232
|
+
if (
|
|
233
|
+
data === null
|
|
234
|
+
|| typeof data !== 'object'
|
|
235
|
+
|| data.version !== 1
|
|
236
|
+
|| typeof data.aliases !== 'object'
|
|
237
|
+
|| data.aliases === null
|
|
238
|
+
|| Array.isArray(data.aliases)
|
|
239
|
+
) {
|
|
240
|
+
return { aliases: {}, error: 'malformed alias map' };
|
|
241
|
+
}
|
|
242
|
+
const aliases = {};
|
|
243
|
+
for (const [from, to] of Object.entries(data.aliases)) {
|
|
244
|
+
if (typeof from !== 'string' || typeof to !== 'string' || !SIGNATURE_RE.test(from) || !SIGNATURE_RE.test(to)) {
|
|
245
|
+
return { aliases: {}, error: 'invalid alias entry' };
|
|
246
|
+
}
|
|
247
|
+
if (signatureKind(from) !== signatureKind(to)) {
|
|
248
|
+
return { aliases: {}, error: 'kind mismatch' };
|
|
249
|
+
}
|
|
250
|
+
aliases[from] = to;
|
|
251
|
+
}
|
|
252
|
+
return { aliases, error: null };
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export function canonicalSignature(signature, aliases) {
|
|
256
|
+
const visited = new Set();
|
|
257
|
+
let current = signature;
|
|
258
|
+
while (Object.prototype.hasOwnProperty.call(aliases, current)) {
|
|
259
|
+
if (visited.has(current)) throw new Error('alias cycle');
|
|
260
|
+
visited.add(current);
|
|
261
|
+
current = aliases[current];
|
|
262
|
+
}
|
|
263
|
+
return current;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export function loadCatalog(filePath) {
|
|
267
|
+
let raw;
|
|
268
|
+
try {
|
|
269
|
+
raw = fs.readFileSync(filePath, 'utf8');
|
|
270
|
+
} catch (error) {
|
|
271
|
+
if (error && error.code === 'ENOENT') return { entries: {}, error: null };
|
|
272
|
+
return { entries: {}, error: error instanceof Error ? error.message : String(error) };
|
|
273
|
+
}
|
|
274
|
+
let data;
|
|
275
|
+
try {
|
|
276
|
+
data = JSON.parse(raw);
|
|
277
|
+
} catch {
|
|
278
|
+
return { entries: {}, error: 'invalid JSON' };
|
|
279
|
+
}
|
|
280
|
+
if (
|
|
281
|
+
data === null
|
|
282
|
+
|| typeof data !== 'object'
|
|
283
|
+
|| data.version !== 1
|
|
284
|
+
|| typeof data.entries !== 'object'
|
|
285
|
+
|| data.entries === null
|
|
286
|
+
|| Array.isArray(data.entries)
|
|
287
|
+
) {
|
|
288
|
+
return { entries: {}, error: 'malformed catalog' };
|
|
289
|
+
}
|
|
290
|
+
const entries = {};
|
|
291
|
+
for (const [signature, entry] of Object.entries(data.entries)) {
|
|
292
|
+
if (!SIGNATURE_RE.test(signature)) return { entries: {}, error: 'invalid catalog signature' };
|
|
293
|
+
if (entry === null || typeof entry !== 'object' || Array.isArray(entry)) {
|
|
294
|
+
return { entries: {}, error: 'invalid catalog entry' };
|
|
295
|
+
}
|
|
296
|
+
let normalizedEntry = entry;
|
|
297
|
+
if (normalizedEntry.paths !== undefined) {
|
|
298
|
+
if (!Array.isArray(normalizedEntry.paths)) return { entries: {}, error: 'invalid catalog paths' };
|
|
299
|
+
normalizedEntry = {
|
|
300
|
+
...normalizedEntry,
|
|
301
|
+
paths: normalizedEntry.paths.filter((item) => isRepoRelativePath(item)),
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
if (
|
|
305
|
+
normalizedEntry.command !== undefined
|
|
306
|
+
&& normalizedEntry.command !== null
|
|
307
|
+
&& typeof normalizedEntry.command !== 'string'
|
|
308
|
+
) {
|
|
309
|
+
return { entries: {}, error: 'invalid catalog command' };
|
|
310
|
+
}
|
|
311
|
+
entries[signature] = normalizedEntry;
|
|
312
|
+
}
|
|
313
|
+
return { entries, error: null };
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function readPackageScriptNames(packagePath) {
|
|
317
|
+
try {
|
|
318
|
+
const data = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
|
|
319
|
+
if (data === null || typeof data !== 'object' || typeof data.scripts !== 'object' || data.scripts === null) {
|
|
320
|
+
return [];
|
|
321
|
+
}
|
|
322
|
+
return Object.keys(data.scripts);
|
|
323
|
+
} catch (error) {
|
|
324
|
+
if (error && error.code === 'ENOENT') return [];
|
|
325
|
+
return [];
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export function collectScriptNames(rootDir) {
|
|
330
|
+
const names = new Set();
|
|
331
|
+
for (const script of readPackageScriptNames(path.join(rootDir, 'package.json'))) names.add(script);
|
|
332
|
+
for (const script of readPackageScriptNames(path.join(rootDir, 'app', 'package.json'))) names.add(script);
|
|
333
|
+
let packageNames = [];
|
|
334
|
+
try {
|
|
335
|
+
packageNames = fs.readdirSync(path.join(rootDir, 'packages'));
|
|
336
|
+
} catch {}
|
|
337
|
+
for (const name of packageNames) {
|
|
338
|
+
for (const script of readPackageScriptNames(path.join(rootDir, 'packages', name, 'package.json'))) {
|
|
339
|
+
names.add(script);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return names;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
function repoRelativePathExists(rootDir, relPath) {
|
|
346
|
+
if (!isRepoRelativePath(relPath)) return false;
|
|
347
|
+
const rootAbs = path.resolve(rootDir);
|
|
348
|
+
const abs = path.resolve(rootAbs, relPath);
|
|
349
|
+
const relative = path.relative(rootAbs, abs);
|
|
350
|
+
if (relative === '' || relative.startsWith('..') || path.isAbsolute(relative)) return false;
|
|
351
|
+
try {
|
|
352
|
+
return fs.existsSync(abs);
|
|
353
|
+
} catch {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function normalizedScriptCommand(command) {
|
|
359
|
+
if (command === undefined || command === null) return null;
|
|
360
|
+
return isScriptCommandName(command) ? command : null;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export function resolveLesson({ signals, rootDir, catalogEntry, scriptNames }) {
|
|
364
|
+
const slugsByPath = new Map();
|
|
365
|
+
for (const signal of signals) {
|
|
366
|
+
if (!Array.isArray(signal.paths)) continue;
|
|
367
|
+
for (const item of signal.paths) {
|
|
368
|
+
const slugs = slugsByPath.get(item) ?? new Set();
|
|
369
|
+
slugs.add(signal.slug);
|
|
370
|
+
slugsByPath.set(item, slugs);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
const candidatePaths = new Set();
|
|
374
|
+
for (const [item, slugs] of slugsByPath) {
|
|
375
|
+
if (slugs.size >= 2) candidatePaths.add(item);
|
|
376
|
+
}
|
|
377
|
+
if (catalogEntry?.paths) {
|
|
378
|
+
for (const item of catalogEntry.paths) candidatePaths.add(item);
|
|
379
|
+
}
|
|
380
|
+
const paths = [...candidatePaths].filter((item) => repoRelativePathExists(rootDir, item)).sort();
|
|
381
|
+
if (paths.length === 0) return null;
|
|
382
|
+
|
|
383
|
+
let command = null;
|
|
384
|
+
if (catalogEntry?.command) {
|
|
385
|
+
command = normalizedScriptCommand(catalogEntry.command);
|
|
386
|
+
} else {
|
|
387
|
+
const slugsByCommand = new Map();
|
|
388
|
+
for (const signal of signals) {
|
|
389
|
+
const script = normalizedScriptCommand(signal.command);
|
|
390
|
+
if (script === null) continue;
|
|
391
|
+
const slugs = slugsByCommand.get(script) ?? new Set();
|
|
392
|
+
slugs.add(signal.slug);
|
|
393
|
+
slugsByCommand.set(script, slugs);
|
|
394
|
+
}
|
|
395
|
+
const agreed = [...slugsByCommand.entries()].filter(([, slugs]) => slugs.size >= 2);
|
|
396
|
+
if (agreed.length === 1) command = agreed[0][0];
|
|
397
|
+
}
|
|
398
|
+
if (command !== null && !scriptNames.has(command)) command = null;
|
|
399
|
+
return { paths, command };
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export function lessonSentence({ kind, issue, paths, command }) {
|
|
403
|
+
if (!Array.isArray(paths) || paths.length === 0) return null;
|
|
404
|
+
const pathLabel = paths.join('`, `');
|
|
405
|
+
const phrase = humanize(issue);
|
|
406
|
+
if (command) {
|
|
407
|
+
return `When editing \`${pathLabel}\`, run \`${command}\` before the receipt (${phrase}).`;
|
|
408
|
+
}
|
|
409
|
+
const first = phrase.split(' ')[0];
|
|
410
|
+
if (DIRECTIVE_PREFIXES.has(first)) return `When editing \`${pathLabel}\`, ${phrase}.`;
|
|
411
|
+
return `When editing \`${pathLabel}\`, ${(KIND_VERB[kind] ?? 'Fix').toLowerCase()} ${phrase}.`;
|
|
412
|
+
}
|
|
413
|
+
|
|
180
414
|
/**
|
|
181
415
|
* Re-derive the rule text from the signature via the canonical template
|
|
182
416
|
* (architecture.md §3). The only free-form input is the already-validated
|
|
183
417
|
* kebab-case `issue` and `stem`; `kind` comes from the fixed vocabulary, so
|
|
184
418
|
* no task/spec prose can reach the rule body.
|
|
185
419
|
*/
|
|
186
|
-
export function deriveRuleText({ stem, kind, issue, overrideKill = null }) {
|
|
420
|
+
export function deriveRuleText({ stem, kind, issue, overrideKill = null, paths, command = null }) {
|
|
187
421
|
validateStem(stem);
|
|
188
422
|
if (!KINDS.includes(kind)) throw new Error(`unknown kind "${kind}"`);
|
|
189
423
|
const phrase = humanize(issue);
|
|
190
|
-
const
|
|
424
|
+
const lessonPaths = (paths ?? []).filter((item) => isRepoRelativePath(item));
|
|
425
|
+
const lessonCommand = normalizedScriptCommand(command);
|
|
426
|
+
const sentence = lessonPaths.length > 0
|
|
427
|
+
? lessonSentence({ kind, issue, paths: lessonPaths, command: lessonCommand })
|
|
428
|
+
: imperativeSentence(kind, phrase);
|
|
191
429
|
const lines = [`# ${stem}`, ''];
|
|
192
430
|
if (overrideKill !== null) {
|
|
193
431
|
if (typeof overrideKill !== 'string' || !STEM_RE.test(overrideKill)) {
|
|
@@ -201,8 +439,16 @@ export function deriveRuleText({ stem, kind, issue, overrideKill = null }) {
|
|
|
201
439
|
return `${lines.join('\n')}\n`;
|
|
202
440
|
}
|
|
203
441
|
|
|
204
|
-
function deriveSeedText({ stem, kind, issue }) {
|
|
205
|
-
return `glob: always\n\n## Body\n\n${deriveRuleText({ stem, kind, issue })}`;
|
|
442
|
+
function deriveSeedText({ stem, kind, issue, paths, command }) {
|
|
443
|
+
return `glob: always\n\n## Body\n\n${deriveRuleText({ stem, kind, issue, paths, command })}`;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/** Read-only `--status` lesson line: `lesson: pending` or `lesson: app/src [lint:js]`. */
|
|
447
|
+
export function formatLessonStatus(lesson) {
|
|
448
|
+
if (lesson === null) return 'lesson: pending';
|
|
449
|
+
const pathLabel = lesson.paths.join(', ');
|
|
450
|
+
if (lesson.command) return `lesson: ${pathLabel} [${lesson.command}]`;
|
|
451
|
+
return `lesson: ${pathLabel}`;
|
|
206
452
|
}
|
|
207
453
|
|
|
208
454
|
// --- Guards ------------------------------------------------------------------
|
|
@@ -339,6 +585,120 @@ export function addConventionsEntry(content, section, entry) {
|
|
|
339
585
|
return `${content.slice(0, headerEnd)}\n\n- ${entry}${content.slice(headerEnd)}`;
|
|
340
586
|
}
|
|
341
587
|
|
|
588
|
+
export function addedLine(before, after) {
|
|
589
|
+
const prior = new Set(String(before ?? '').split('\n').map((row) => row.trim()).filter((row) => row !== ''));
|
|
590
|
+
const added = String(after ?? '').split('\n').map((row) => row.trim()).filter((row) => row !== '' && !prior.has(row));
|
|
591
|
+
return added.length === 1 ? added[0] : null;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
export function recurrenceSlugs({ signals, appliedAt }) {
|
|
595
|
+
const appliedMs = Date.parse(appliedAt);
|
|
596
|
+
const bySlug = new Map();
|
|
597
|
+
for (const signal of signals) {
|
|
598
|
+
if (signal.status === 'rejected' || signal.status === 'rolled_back') continue;
|
|
599
|
+
const list = bySlug.get(signal.slug) ?? [];
|
|
600
|
+
list.push(signal);
|
|
601
|
+
bySlug.set(signal.slug, list);
|
|
602
|
+
}
|
|
603
|
+
const recurring = [];
|
|
604
|
+
for (const [slug, rows] of bySlug) {
|
|
605
|
+
const hasAtOrBefore = rows.some((row) => Date.parse(row.at) <= appliedMs);
|
|
606
|
+
if (hasAtOrBefore) continue;
|
|
607
|
+
const hasAfter = rows.some((row) => Date.parse(row.at) > appliedMs);
|
|
608
|
+
if (hasAfter) recurring.push(slug);
|
|
609
|
+
}
|
|
610
|
+
return recurring.sort();
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
function removeTrimmedLineOnce(content, trimmedLine) {
|
|
614
|
+
const lines = content.split('\n');
|
|
615
|
+
let removed = false;
|
|
616
|
+
const next = lines.filter((line) => {
|
|
617
|
+
if (!removed && line.trim() === trimmedLine) {
|
|
618
|
+
removed = true;
|
|
619
|
+
return false;
|
|
620
|
+
}
|
|
621
|
+
return true;
|
|
622
|
+
});
|
|
623
|
+
if (!removed) return null;
|
|
624
|
+
return next.join('\n');
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
function conventionsFileHasTrimmedLine(content, trimmedLine) {
|
|
628
|
+
return content.split('\n').some((line) => line.trim() === trimmedLine);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
function readSignalsForSignature(signalsPath, signature, canonical) {
|
|
632
|
+
let raw = '';
|
|
633
|
+
try { raw = fs.readFileSync(signalsPath, 'utf8'); } catch (error) {
|
|
634
|
+
if (error && error.code === 'ENOENT') return [];
|
|
635
|
+
throw error;
|
|
636
|
+
}
|
|
637
|
+
const signals = [];
|
|
638
|
+
for (const line of raw.split('\n')) {
|
|
639
|
+
const trimmed = line.trim();
|
|
640
|
+
if (trimmed === '') continue;
|
|
641
|
+
let signal;
|
|
642
|
+
try { signal = JSON.parse(trimmed); validateSignal(signal); } catch { continue; }
|
|
643
|
+
let groupSignature;
|
|
644
|
+
try { groupSignature = canonical(signal.signature); } catch { continue; }
|
|
645
|
+
if (groupSignature !== signature) continue;
|
|
646
|
+
signals.push(signal);
|
|
647
|
+
}
|
|
648
|
+
return signals;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
function latestConventionsAddedBySignature(entries) {
|
|
652
|
+
const bySignature = new Map();
|
|
653
|
+
for (const entry of entries) {
|
|
654
|
+
if (!entry || typeof entry.signature !== 'string') continue;
|
|
655
|
+
if (entry.action === 'conventions-added') {
|
|
656
|
+
bySignature.set(entry.signature, entry);
|
|
657
|
+
} else if (entry.action === 'unloaded') {
|
|
658
|
+
bySignature.delete(entry.signature);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
return bySignature;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
function tryUnloadOne({
|
|
665
|
+
prior,
|
|
666
|
+
signalsPath,
|
|
667
|
+
conventionsPath,
|
|
668
|
+
ledgerPath,
|
|
669
|
+
now,
|
|
670
|
+
canonical,
|
|
671
|
+
}) {
|
|
672
|
+
const candidates = [...latestConventionsAddedBySignature(prior).entries()]
|
|
673
|
+
.sort(([a], [b]) => a.localeCompare(b));
|
|
674
|
+
for (const [signature, appliedEntry] of candidates) {
|
|
675
|
+
const line = addedLine(appliedEntry.before, appliedEntry.after);
|
|
676
|
+
if (line === null) continue;
|
|
677
|
+
const target = resolveLedgerTarget(appliedEntry.target, projectRootFor(ledgerPath));
|
|
678
|
+
const current = readExisting(target);
|
|
679
|
+
if (current === null || !conventionsFileHasTrimmedLine(current, line)) continue;
|
|
680
|
+
const signals = readSignalsForSignature(signalsPath, signature, canonical);
|
|
681
|
+
if (recurrenceSlugs({ signals, appliedAt: appliedEntry.at }).length < 2) continue;
|
|
682
|
+
const after = removeTrimmedLineOnce(current, line);
|
|
683
|
+
if (after === null) continue;
|
|
684
|
+
const entry = {
|
|
685
|
+
signature,
|
|
686
|
+
action: 'unloaded',
|
|
687
|
+
target: appliedEntry.target,
|
|
688
|
+
before: current,
|
|
689
|
+
after,
|
|
690
|
+
at: now(),
|
|
691
|
+
agent: appliedEntry.agent,
|
|
692
|
+
slug: appliedEntry.slug,
|
|
693
|
+
};
|
|
694
|
+
commitWrite({ ledgerPath, target, content: after, entry });
|
|
695
|
+
prior.push(entry);
|
|
696
|
+
markSignalsRolledBack(signature, { signalsPath, canonical });
|
|
697
|
+
return { signature, target: appliedEntry.target };
|
|
698
|
+
}
|
|
699
|
+
return null;
|
|
700
|
+
}
|
|
701
|
+
|
|
342
702
|
// --- Rollback inverse --------------------------------------------------------
|
|
343
703
|
|
|
344
704
|
export function rollbackInverse(entry, options = {}) {
|
|
@@ -358,13 +718,14 @@ export function rollbackInverse(entry, options = {}) {
|
|
|
358
718
|
at: now(),
|
|
359
719
|
};
|
|
360
720
|
const token = acquireLock(lockPath);
|
|
721
|
+
const target = resolveLedgerTarget(entry.target, projectRootFor(ledgerPath));
|
|
361
722
|
try {
|
|
362
723
|
if (inverse.after == null) {
|
|
363
|
-
try { fs.unlinkSync(
|
|
724
|
+
try { fs.unlinkSync(target); } catch (error) {
|
|
364
725
|
if (!error || error.code !== 'ENOENT') throw error;
|
|
365
726
|
}
|
|
366
727
|
} else {
|
|
367
|
-
writeFileAtomic(
|
|
728
|
+
writeFileAtomic(target, inverse.after);
|
|
368
729
|
}
|
|
369
730
|
appendLedgerLine(ledgerPath, inverse);
|
|
370
731
|
return inverse;
|
|
@@ -375,8 +736,23 @@ export function rollbackInverse(entry, options = {}) {
|
|
|
375
736
|
|
|
376
737
|
// --- Engine ------------------------------------------------------------------
|
|
377
738
|
|
|
378
|
-
function enrichGroups(groups, signalsPath) {
|
|
379
|
-
const bySignature = new Map(
|
|
739
|
+
function enrichGroups(groups, signalsPath, canonical = (signature) => signature) {
|
|
740
|
+
const bySignature = new Map(
|
|
741
|
+
groups.map((group) => [group.signature, {
|
|
742
|
+
signature: group.signature,
|
|
743
|
+
distinctSlugCount: group.distinctSlugCount,
|
|
744
|
+
slugs: group.slugs,
|
|
745
|
+
count: group.count,
|
|
746
|
+
signals: [],
|
|
747
|
+
severity: 'low',
|
|
748
|
+
severityRank: 0,
|
|
749
|
+
stem: null,
|
|
750
|
+
stems: [],
|
|
751
|
+
target: null,
|
|
752
|
+
targets: [],
|
|
753
|
+
agent: null,
|
|
754
|
+
}]),
|
|
755
|
+
);
|
|
380
756
|
let raw = '';
|
|
381
757
|
try { raw = fs.readFileSync(signalsPath, 'utf8'); } catch (error) {
|
|
382
758
|
if (error && error.code === 'ENOENT') raw = '';
|
|
@@ -388,9 +764,15 @@ function enrichGroups(groups, signalsPath) {
|
|
|
388
764
|
let signal;
|
|
389
765
|
try { signal = JSON.parse(trimmed); validateSignal(signal); } catch { continue; }
|
|
390
766
|
if (signal.status === 'rejected' || signal.status === 'rolled_back') continue;
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
767
|
+
let groupSignature;
|
|
768
|
+
try {
|
|
769
|
+
groupSignature = canonical(signal.signature);
|
|
770
|
+
} catch {
|
|
771
|
+
continue;
|
|
772
|
+
}
|
|
773
|
+
const entry = bySignature.get(groupSignature);
|
|
774
|
+
if (!entry) continue;
|
|
775
|
+
entry.signals.push(signal);
|
|
394
776
|
const rank = SEVERITY_RANK[signal.severity] ?? 0;
|
|
395
777
|
if (rank > entry.severityRank) { entry.severity = signal.severity; entry.severityRank = rank; }
|
|
396
778
|
if (signal.stem) {
|
|
@@ -402,34 +784,27 @@ function enrichGroups(groups, signalsPath) {
|
|
|
402
784
|
entry.targets.push(signal.target);
|
|
403
785
|
}
|
|
404
786
|
if (!entry.agent) entry.agent = signal.agent;
|
|
405
|
-
bySignature.set(signal.signature, entry);
|
|
406
787
|
}
|
|
407
|
-
return
|
|
408
|
-
const entry = bySignature.get(group.signature);
|
|
409
|
-
return {
|
|
410
|
-
signature: group.signature,
|
|
411
|
-
distinctSlugCount: group.distinctSlugCount,
|
|
412
|
-
slugs: group.slugs,
|
|
413
|
-
count: group.count,
|
|
414
|
-
severity: entry?.severity ?? 'low',
|
|
415
|
-
stem: entry?.stem ?? null,
|
|
416
|
-
stems: entry?.stems ?? [],
|
|
417
|
-
target: entry?.target ?? null,
|
|
418
|
-
targets: entry?.targets ?? [],
|
|
419
|
-
agent: entry?.agent ?? 'rule-improver',
|
|
420
|
-
};
|
|
421
|
-
});
|
|
788
|
+
return [...bySignature.values()];
|
|
422
789
|
}
|
|
423
790
|
|
|
424
791
|
function guardSurfaces(group, phrase, ruleText) {
|
|
425
792
|
return [group.signature, phrase, ruleText, ...(group.targets ?? []), ...(group.stems ?? [])];
|
|
426
793
|
}
|
|
427
794
|
|
|
428
|
-
function decide(group) {
|
|
795
|
+
function decide(group, { rootDir, catalogEntry, scriptNames }) {
|
|
429
796
|
const { kind, issue } = parseSignature(group.signature);
|
|
430
797
|
const phrase = humanize(issue);
|
|
431
798
|
const stem = validateStem(group.stem ?? issue);
|
|
432
|
-
const
|
|
799
|
+
const lesson = resolveLesson({
|
|
800
|
+
signals: group.signals,
|
|
801
|
+
rootDir,
|
|
802
|
+
catalogEntry,
|
|
803
|
+
scriptNames,
|
|
804
|
+
});
|
|
805
|
+
const paths = lesson?.paths;
|
|
806
|
+
const command = lesson?.command ?? null;
|
|
807
|
+
const ruleText = deriveRuleText({ stem, kind, issue, paths, command });
|
|
433
808
|
const surfaces = guardSurfaces(group, phrase, ruleText);
|
|
434
809
|
const denied = surfaces.some((text) => isDenied(text));
|
|
435
810
|
let compliance = null;
|
|
@@ -438,6 +813,9 @@ function decide(group) {
|
|
|
438
813
|
if (compliance) break;
|
|
439
814
|
}
|
|
440
815
|
const tier = thresholdAction(group.distinctSlugCount);
|
|
816
|
+
const conventionsEntry = lesson
|
|
817
|
+
? lessonSentence({ kind, issue, paths: lesson.paths, command: lesson.command })
|
|
818
|
+
: null;
|
|
441
819
|
return {
|
|
442
820
|
signature: group.signature,
|
|
443
821
|
kind,
|
|
@@ -447,8 +825,10 @@ function decide(group) {
|
|
|
447
825
|
tier,
|
|
448
826
|
denied,
|
|
449
827
|
compliance,
|
|
828
|
+
lesson,
|
|
829
|
+
conventionsEntry,
|
|
450
830
|
ruleText,
|
|
451
|
-
seedText: deriveSeedText({ stem, kind, issue }),
|
|
831
|
+
seedText: deriveSeedText({ stem, kind, issue, paths, command }),
|
|
452
832
|
severity: group.severity,
|
|
453
833
|
agent: group.agent,
|
|
454
834
|
slug: group.slugs[0] ?? group.signature,
|
|
@@ -458,7 +838,7 @@ function decide(group) {
|
|
|
458
838
|
function planConventions(ctx, decision) {
|
|
459
839
|
const target = ctx.conventionsPath;
|
|
460
840
|
const section = KIND_SECTION[decision.kind] ?? 'Patterns';
|
|
461
|
-
const entry = imperativeSentence(decision.kind, decision.phrase);
|
|
841
|
+
const entry = decision.conventionsEntry ?? imperativeSentence(decision.kind, decision.phrase);
|
|
462
842
|
const before = readExisting(target) ?? '';
|
|
463
843
|
if (conventionsEntryExists(before, entry)) {
|
|
464
844
|
return { type: 'skipped', reason: 'dedup: identical entry already present', target };
|
|
@@ -526,7 +906,7 @@ function proposedConventions(ctx, decision) {
|
|
|
526
906
|
const before = readExisting(ctx.conventionsPath);
|
|
527
907
|
if (before === null) return { before, after: null };
|
|
528
908
|
const section = KIND_SECTION[decision.kind] ?? 'Patterns';
|
|
529
|
-
const bullet = imperativeSentence(decision.kind, decision.phrase);
|
|
909
|
+
const bullet = decision.conventionsEntry ?? imperativeSentence(decision.kind, decision.phrase);
|
|
530
910
|
try {
|
|
531
911
|
return { before, after: addConventionsEntry(before, section, bullet) };
|
|
532
912
|
} catch {
|
|
@@ -596,7 +976,17 @@ function stageNewRule({ decision, ctx, prior, ledgerPath, now, staged, rulesDir
|
|
|
596
976
|
* Cap count, one-apply-per-run, and every write share one lock. The envelope
|
|
597
977
|
* and the ledger are read again here — not from the pre-lock snapshot.
|
|
598
978
|
*/
|
|
599
|
-
function applyDecisionsUnderLock({
|
|
979
|
+
function applyDecisionsUnderLock({
|
|
980
|
+
decisions,
|
|
981
|
+
rulesDir,
|
|
982
|
+
libraryDir,
|
|
983
|
+
conventionsPath,
|
|
984
|
+
ledgerPath,
|
|
985
|
+
lockPath,
|
|
986
|
+
signalsPath,
|
|
987
|
+
now,
|
|
988
|
+
canonical,
|
|
989
|
+
}) {
|
|
600
990
|
const token = acquireLock(lockPath);
|
|
601
991
|
try {
|
|
602
992
|
let envelope = countRulesAndLines({ rulesDir, conventionsPath });
|
|
@@ -605,9 +995,26 @@ function applyDecisionsUnderLock({ decisions, rulesDir, libraryDir, conventionsP
|
|
|
605
995
|
const applied = [];
|
|
606
996
|
const staged = [];
|
|
607
997
|
const skipped = [];
|
|
998
|
+
const unloaded = [];
|
|
608
999
|
let appliedThisRun = 0;
|
|
609
1000
|
|
|
610
|
-
|
|
1001
|
+
const unloadedOne = tryUnloadOne({
|
|
1002
|
+
prior,
|
|
1003
|
+
signalsPath,
|
|
1004
|
+
conventionsPath,
|
|
1005
|
+
ledgerPath,
|
|
1006
|
+
now,
|
|
1007
|
+
canonical,
|
|
1008
|
+
});
|
|
1009
|
+
let decisionsToApply = decisions;
|
|
1010
|
+
if (unloadedOne) {
|
|
1011
|
+
unloaded.push(unloadedOne);
|
|
1012
|
+
envelope = countRulesAndLines({ rulesDir, conventionsPath });
|
|
1013
|
+
ctx.envelope = envelope;
|
|
1014
|
+
decisionsToApply = decisions.filter((item) => item.signature !== unloadedOne.signature);
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
for (const decision of decisionsToApply) {
|
|
611
1018
|
if (decision.tier.action === 'create') {
|
|
612
1019
|
stageNewRule({ decision, ctx, prior, ledgerPath, now, staged, rulesDir });
|
|
613
1020
|
envelope = countRulesAndLines({ rulesDir, conventionsPath });
|
|
@@ -690,7 +1097,7 @@ function applyDecisionsUnderLock({ decisions, rulesDir, libraryDir, conventionsP
|
|
|
690
1097
|
ctx.envelope = envelope;
|
|
691
1098
|
}
|
|
692
1099
|
|
|
693
|
-
return { applied, staged, skipped, envelope };
|
|
1100
|
+
return { applied, staged, skipped, unloaded, envelope };
|
|
694
1101
|
} finally {
|
|
695
1102
|
releaseLock(lockPath, token);
|
|
696
1103
|
}
|
|
@@ -708,17 +1115,41 @@ export function runImprover(options = {}) {
|
|
|
708
1115
|
const conventionsPath = options.conventionsPath ?? path.join(baseDir, 'conventions.md');
|
|
709
1116
|
const ledgerPath = options.ledgerPath ?? path.join(baseDir, 'rule-changes.jsonl');
|
|
710
1117
|
const lockPath = options.lockPath ?? path.join(baseDir, '.rules.lock');
|
|
1118
|
+
const rootDir = options.rootDir ?? projectRootFor(ledgerPath);
|
|
1119
|
+
const aliasPath = options.aliasPath ?? path.join(baseDir, 'signature-aliases.json');
|
|
1120
|
+
const catalogPath = options.catalogPath ?? path.join(baseDir, 'signature-catalog.json');
|
|
711
1121
|
const now = options.now ?? (() => new Date().toISOString());
|
|
712
1122
|
|
|
713
|
-
const
|
|
1123
|
+
const errors = [];
|
|
1124
|
+
const aliasLoad = loadAliasMap(aliasPath);
|
|
1125
|
+
if (aliasLoad.error) {
|
|
1126
|
+
errors.push({ signature: 'signature-aliases', reason: aliasLoad.error });
|
|
1127
|
+
}
|
|
1128
|
+
const canonical = (signature) => canonicalSignature(signature, aliasLoad.aliases);
|
|
1129
|
+
|
|
1130
|
+
const grouped = groupSignatures({ signalsPath, canonical });
|
|
1131
|
+
errors.push(...grouped.errors);
|
|
1132
|
+
|
|
1133
|
+
const catalogLoad = loadCatalog(catalogPath);
|
|
1134
|
+
if (catalogLoad.error) {
|
|
1135
|
+
errors.push({ signature: 'signature-catalog', reason: catalogLoad.error });
|
|
1136
|
+
}
|
|
1137
|
+
const catalog = catalogLoad.entries;
|
|
1138
|
+
const scriptNames = collectScriptNames(rootDir);
|
|
1139
|
+
|
|
714
1140
|
const rejected = [];
|
|
715
1141
|
const decisions = [];
|
|
1142
|
+
const skipped = [];
|
|
716
1143
|
|
|
717
|
-
for (const group of enrichGroups(groups, signalsPath)) {
|
|
1144
|
+
for (const group of enrichGroups(grouped.groups, signalsPath, canonical)) {
|
|
718
1145
|
if (group.distinctSlugCount < 2) continue;
|
|
719
1146
|
let decision;
|
|
720
1147
|
try {
|
|
721
|
-
decision = decide(group
|
|
1148
|
+
decision = decide(group, {
|
|
1149
|
+
rootDir,
|
|
1150
|
+
catalogEntry: catalog[group.signature] ?? null,
|
|
1151
|
+
scriptNames,
|
|
1152
|
+
});
|
|
722
1153
|
} catch (error) {
|
|
723
1154
|
// A malformed/inconsistent signal (e.g. signature↔stem mismatch) must be
|
|
724
1155
|
// skipped + reported, never abort the whole loop (§5.2 robustness).
|
|
@@ -732,51 +1163,91 @@ export function runImprover(options = {}) {
|
|
|
732
1163
|
rejected.push({ signature: decision.signature, reason: 'denylist' });
|
|
733
1164
|
continue;
|
|
734
1165
|
}
|
|
1166
|
+
if (decision.lesson === null) {
|
|
1167
|
+
skipped.push({ signature: decision.signature, reason: 'pending-lesson' });
|
|
1168
|
+
continue;
|
|
1169
|
+
}
|
|
735
1170
|
decisions.push(decision);
|
|
736
1171
|
}
|
|
737
1172
|
|
|
738
1173
|
let applied = [];
|
|
739
1174
|
let staged = [];
|
|
740
|
-
let
|
|
1175
|
+
let applySkipped = [];
|
|
1176
|
+
let unloaded = [];
|
|
741
1177
|
let envelope;
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
1178
|
+
({ applied, staged, skipped: applySkipped, unloaded, envelope } = applyDecisionsUnderLock({
|
|
1179
|
+
decisions,
|
|
1180
|
+
rulesDir,
|
|
1181
|
+
libraryDir,
|
|
1182
|
+
conventionsPath,
|
|
1183
|
+
ledgerPath,
|
|
1184
|
+
lockPath,
|
|
1185
|
+
signalsPath,
|
|
1186
|
+
now,
|
|
1187
|
+
canonical,
|
|
1188
|
+
}));
|
|
1189
|
+
// Mark the signals that actually wrote a change as `applied` so a later
|
|
1190
|
+
// rejection/rollback can flip them to a non-qualifying status (W4).
|
|
1191
|
+
for (const item of applied) {
|
|
1192
|
+
markSignalsApplied(item.signature, { signalsPath, canonical });
|
|
753
1193
|
}
|
|
754
1194
|
|
|
1195
|
+
const allSkipped = [...skipped, ...applySkipped];
|
|
1196
|
+
|
|
755
1197
|
return {
|
|
756
1198
|
applied,
|
|
757
1199
|
staged,
|
|
758
|
-
skipped,
|
|
1200
|
+
skipped: allSkipped,
|
|
1201
|
+
unloaded,
|
|
759
1202
|
rejected,
|
|
760
1203
|
errors,
|
|
761
1204
|
envelope,
|
|
762
|
-
report: renderReport({
|
|
1205
|
+
report: renderReport({
|
|
1206
|
+
applied,
|
|
1207
|
+
staged,
|
|
1208
|
+
skipped: allSkipped,
|
|
1209
|
+
unloaded,
|
|
1210
|
+
rejected,
|
|
1211
|
+
errors,
|
|
1212
|
+
envelope,
|
|
1213
|
+
ledgerPath,
|
|
1214
|
+
}),
|
|
763
1215
|
};
|
|
764
1216
|
}
|
|
765
1217
|
|
|
766
|
-
function
|
|
1218
|
+
function renderTarget(target, ledgerPath) {
|
|
1219
|
+
if (typeof target !== 'string') return String(target);
|
|
1220
|
+
try {
|
|
1221
|
+
return toLedgerTarget(target, projectRootFor(ledgerPath));
|
|
1222
|
+
} catch {
|
|
1223
|
+
return target;
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
function appendSkipGroup(lines, items, heading) {
|
|
1228
|
+
if (items.length === 0) return;
|
|
1229
|
+
lines.push('', heading);
|
|
1230
|
+
for (const item of items) lines.push(` - ${item.signature} (${item.reason})`);
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
function renderReport({ applied, staged, skipped, rejected, unloaded = [], errors, envelope, ledgerPath }) {
|
|
767
1234
|
const lines = [
|
|
768
1235
|
'Self-learning rule improver',
|
|
769
1236
|
`envelope: ${envelope.ruleCount}/${MAX_ACTIVE_RULES} rules, ${envelope.lineCount}/${MAX_TOTAL_LINES} lines`,
|
|
770
1237
|
'',
|
|
771
1238
|
`applied (${applied.length}) — auto, low-risk, reversible`,
|
|
772
1239
|
];
|
|
773
|
-
for (const item of applied) lines.push(` - ${item.signature} → ${item.target}`);
|
|
1240
|
+
for (const item of applied) lines.push(` - ${item.signature} → ${renderTarget(item.target, ledgerPath)}`);
|
|
774
1241
|
lines.push('', `staged (${staged.length}) — human promote`);
|
|
775
|
-
for (const item of staged) lines.push(` - ${item.signature} → ${item.target} (${item.reason})`);
|
|
776
|
-
if (
|
|
777
|
-
lines.push('', `
|
|
778
|
-
for (const item of
|
|
1242
|
+
for (const item of staged) lines.push(` - ${item.signature} → ${renderTarget(item.target, ledgerPath)} (${item.reason})`);
|
|
1243
|
+
if (unloaded.length > 0) {
|
|
1244
|
+
lines.push('', `unloaded (${unloaded.length}) — lesson removed`);
|
|
1245
|
+
for (const item of unloaded) lines.push(` - ${item.signature} → ${renderTarget(item.target, ledgerPath)}`);
|
|
779
1246
|
}
|
|
1247
|
+
const pending = skipped.filter((item) => item.reason === 'pending-lesson');
|
|
1248
|
+
const deduped = skipped.filter((item) => item.reason !== 'pending-lesson');
|
|
1249
|
+
appendSkipGroup(lines, pending, `skipped (${pending.length}) — pending lesson`);
|
|
1250
|
+
appendSkipGroup(lines, deduped, `skipped (${deduped.length}) — dedup no-op`);
|
|
780
1251
|
lines.push('', `rejected (${rejected.length}) — denylist`);
|
|
781
1252
|
for (const item of rejected) lines.push(` - ${item.signature} (${item.reason})`);
|
|
782
1253
|
if (errors.length > 0) {
|