@bonesofspring/ai-rules 0.2.37 → 0.2.38
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 +38 -0
- package/README.md +23 -2
- package/bin/cli.js +106 -1
- package/bin/lib/engine-scripts.js +22 -0
- package/bin/lib/fs-utils.js +78 -11
- package/bin/lib/merged-config.js +30 -16
- package/bin/lib/seed-ai-local-team.js +160 -12
- package/bin/opencode-install.js +37 -52
- package/docs/OPENCODE.md +4 -4
- package/docs/specs/INDEX.md +5 -2
- package/package.json +4 -1
- package/presets/_shared/ai-local/scripts/derive-gate-signals.mjs +173 -0
- package/presets/_shared/ai-local/scripts/efficacy-oracle.mjs +576 -0
- package/presets/_shared/ai-local/scripts/lock.mjs +118 -0
- package/presets/_shared/ai-local/scripts/rule-improver.mjs +795 -0
- package/presets/_shared/ai-local/scripts/run.mjs +309 -0
- package/presets/_shared/ai-local/scripts/signals.mjs +256 -0
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +1 -1
- package/presets/_shared/core/quality/self-review-and-context-hygiene.md +8 -7
- package/presets/_shared/hooks/README.md +5 -0
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +107 -18
- package/presets/_shared/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/android-kotlin/CLAUDE.md +1 -1
- package/presets/claude/android-kotlin/REPO_AGENTS.md +14 -0
- package/presets/claude/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/claude/android-kotlin/commands/README.md +1 -0
- package/presets/claude/android-kotlin/commands/task-continue.md +9 -0
- package/presets/claude/android-kotlin/commands/technical-retro.md +8 -0
- package/presets/claude/android-kotlin/commands/update.md +39 -0
- package/presets/claude/android-kotlin/hooks/README.md +1 -0
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +107 -18
- package/presets/claude/android-kotlin/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/android-kotlin/hooks/examples/README.md +1 -1
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/android-kotlin/settings.json +14 -1
- package/presets/claude/android-kotlin/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/go/CLAUDE.md +1 -1
- package/presets/claude/go/REPO_AGENTS.md +14 -0
- package/presets/claude/go/agents/build-verifier.md +1 -1
- package/presets/claude/go/agents/code-reviewer.md +1 -1
- package/presets/claude/go/agents/debugger.md +1 -1
- package/presets/claude/go/agents/feature-developer.md +1 -1
- package/presets/claude/go/agents/task-analyst.md +1 -1
- package/presets/claude/go/commands/README.md +1 -0
- package/presets/claude/go/commands/task-continue.md +9 -0
- package/presets/claude/go/commands/technical-retro.md +8 -0
- package/presets/claude/go/commands/update.md +39 -0
- package/presets/claude/go/hooks/README.md +1 -0
- package/presets/claude/go/hooks/chain-team-phases.sh +107 -18
- package/presets/claude/go/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/go/hooks/examples/README.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/go/settings.json +14 -1
- package/presets/claude/go/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/ios-swift/CLAUDE.md +1 -1
- package/presets/claude/ios-swift/REPO_AGENTS.md +14 -0
- package/presets/claude/ios-swift/agents/build-verifier.md +1 -1
- package/presets/claude/ios-swift/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/claude/ios-swift/commands/README.md +1 -0
- package/presets/claude/ios-swift/commands/task-continue.md +9 -0
- package/presets/claude/ios-swift/commands/technical-retro.md +8 -0
- package/presets/claude/ios-swift/commands/update.md +39 -0
- package/presets/claude/ios-swift/hooks/README.md +1 -0
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +107 -18
- package/presets/claude/ios-swift/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/ios-swift/hooks/examples/README.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/ios-swift/settings.json +14 -1
- package/presets/claude/ios-swift/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/java/CLAUDE.md +2 -2
- package/presets/claude/java/REPO_AGENTS.md +14 -0
- package/presets/claude/java/agents/build-verifier.md +1 -1
- package/presets/claude/java/agents/code-reviewer.md +1 -1
- package/presets/claude/java/agents/debugger.md +1 -1
- package/presets/claude/java/agents/feature-developer.md +1 -1
- package/presets/claude/java/agents/task-analyst.md +1 -1
- package/presets/claude/java/commands/README.md +1 -0
- package/presets/claude/java/commands/task-continue.md +9 -0
- package/presets/claude/java/commands/technical-retro.md +8 -0
- package/presets/claude/java/commands/update.md +39 -0
- package/presets/claude/java/hooks/README.md +1 -0
- package/presets/claude/java/hooks/chain-team-phases.sh +107 -18
- package/presets/claude/java/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/java/hooks/examples/README.md +1 -1
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/java/settings.json +14 -1
- package/presets/claude/java/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/mcp-ts/CLAUDE.md +1 -1
- package/presets/claude/mcp-ts/REPO_AGENTS.md +14 -0
- 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/agents/task-analyst.md +1 -1
- package/presets/claude/mcp-ts/commands/README.md +1 -0
- package/presets/claude/mcp-ts/commands/task-continue.md +9 -0
- package/presets/claude/mcp-ts/commands/technical-retro.md +8 -0
- package/presets/claude/mcp-ts/commands/update.md +39 -0
- package/presets/claude/mcp-ts/hooks/README.md +1 -0
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +107 -18
- package/presets/claude/mcp-ts/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/mcp-ts/settings.json +14 -1
- package/presets/claude/next/CLAUDE.md +2 -1
- package/presets/claude/next/REPO_AGENTS.md +15 -1
- package/presets/claude/next/agents/build-verifier.md +1 -1
- package/presets/claude/next/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/claude/next/agents/task-router.md +1 -1
- package/presets/claude/next/commands/README.md +1 -0
- package/presets/claude/next/commands/task-continue.md +9 -0
- package/presets/claude/next/commands/technical-retro.md +8 -0
- package/presets/claude/next/commands/update.md +39 -0
- package/presets/claude/next/hooks/README.md +1 -0
- package/presets/claude/next/hooks/chain-team-phases.sh +107 -18
- package/presets/claude/next/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/next/hooks/examples/README.md +1 -1
- package/presets/claude/next/rules/anti-hallucination/react-next-anti-hallucination.md +21 -18
- package/presets/claude/next/rules/stack/next-app-router.md +27 -0
- package/presets/claude/next/rules/stack/next-static-export.md +16 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/security-next.md +16 -2
- package/presets/claude/next/rules/ui-and-accessibility/component-catalog-gate.md +13 -0
- package/presets/claude/next/rules/ui-and-accessibility/forms-validation.md +12 -0
- package/presets/claude/next/settings.json +13 -0
- package/presets/claude/next/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/next/team/fixtures/feature-light.json +2 -1
- package/presets/claude/next/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/claude/nuxt/CLAUDE.md +2 -1
- package/presets/claude/nuxt/REPO_AGENTS.md +14 -0
- package/presets/claude/nuxt/agents/build-verifier.md +1 -1
- package/presets/claude/nuxt/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/claude/nuxt/commands/README.md +1 -0
- package/presets/claude/nuxt/commands/task-continue.md +9 -0
- package/presets/claude/nuxt/commands/technical-retro.md +8 -0
- package/presets/claude/nuxt/commands/update.md +39 -0
- package/presets/claude/nuxt/hooks/README.md +1 -0
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +107 -18
- package/presets/claude/nuxt/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/nuxt/hooks/examples/README.md +1 -1
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/nuxt/settings.json +13 -0
- package/presets/claude/nuxt/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/php-hexagonal/CLAUDE.md +2 -2
- package/presets/claude/php-hexagonal/REPO_AGENTS.md +14 -0
- package/presets/claude/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -1
- 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/task-analyst.md +1 -1
- package/presets/claude/php-hexagonal/commands/README.md +1 -0
- package/presets/claude/php-hexagonal/commands/task-continue.md +9 -0
- package/presets/claude/php-hexagonal/commands/technical-retro.md +8 -0
- package/presets/claude/php-hexagonal/commands/update.md +39 -0
- package/presets/claude/php-hexagonal/hooks/README.md +1 -0
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +107 -18
- package/presets/claude/php-hexagonal/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/php-hexagonal/hooks/examples/README.md +1 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/php-hexagonal/settings.json +14 -1
- package/presets/claude/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/php-laravel/CLAUDE.md +1 -1
- package/presets/claude/php-laravel/REPO_AGENTS.md +14 -0
- package/presets/claude/php-laravel/agents/build-verifier.md +1 -1
- package/presets/claude/php-laravel/agents/code-reviewer.md +1 -1
- 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/task-analyst.md +1 -1
- package/presets/claude/php-laravel/commands/README.md +1 -0
- package/presets/claude/php-laravel/commands/task-continue.md +9 -0
- package/presets/claude/php-laravel/commands/technical-retro.md +8 -0
- package/presets/claude/php-laravel/commands/update.md +39 -0
- package/presets/claude/php-laravel/hooks/README.md +1 -0
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +107 -18
- package/presets/claude/php-laravel/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/php-laravel/hooks/examples/README.md +1 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/php-laravel/settings.json +14 -1
- package/presets/claude/php-laravel/skills/technical-retro/SKILL.md +2 -0
- package/presets/claude/svelte/CLAUDE.md +2 -1
- package/presets/claude/svelte/REPO_AGENTS.md +14 -0
- package/presets/claude/svelte/agents/build-verifier.md +1 -1
- package/presets/claude/svelte/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/claude/svelte/commands/README.md +1 -0
- package/presets/claude/svelte/commands/task-continue.md +9 -0
- package/presets/claude/svelte/commands/technical-retro.md +8 -0
- package/presets/claude/svelte/commands/update.md +39 -0
- package/presets/claude/svelte/hooks/README.md +1 -0
- package/presets/claude/svelte/hooks/chain-team-phases.sh +107 -18
- package/presets/claude/svelte/hooks/check-preset-update.mjs +227 -0
- package/presets/claude/svelte/hooks/examples/README.md +1 -1
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/svelte/settings.json +13 -0
- package/presets/claude/svelte/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/android-kotlin/AGENTS.md +1 -0
- package/presets/cursor/android-kotlin/REPO_AGENTS.md +14 -0
- package/presets/cursor/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/cursor/android-kotlin/commands/README.md +1 -0
- package/presets/cursor/android-kotlin/commands/task-continue.md +9 -0
- package/presets/cursor/android-kotlin/commands/technical-retro.md +8 -0
- package/presets/cursor/android-kotlin/commands/update.md +39 -0
- package/presets/cursor/android-kotlin/hooks/README.md +5 -1
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +107 -18
- package/presets/cursor/android-kotlin/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/android-kotlin/hooks/examples/README.md +1 -1
- package/presets/cursor/android-kotlin/hooks.json +6 -0
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/android-kotlin/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/go/REPO_AGENTS.md +14 -0
- package/presets/cursor/go/agents/build-verifier.md +1 -1
- package/presets/cursor/go/agents/code-reviewer.md +1 -1
- package/presets/cursor/go/agents/debugger.md +1 -1
- package/presets/cursor/go/agents/feature-developer.md +1 -1
- package/presets/cursor/go/agents/task-analyst.md +1 -1
- package/presets/cursor/go/commands/README.md +1 -0
- package/presets/cursor/go/commands/task-continue.md +9 -0
- package/presets/cursor/go/commands/technical-retro.md +8 -0
- package/presets/cursor/go/commands/update.md +39 -0
- package/presets/cursor/go/hooks/README.md +5 -1
- package/presets/cursor/go/hooks/chain-team-phases.sh +107 -18
- package/presets/cursor/go/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/go/hooks/examples/README.md +1 -1
- package/presets/cursor/go/hooks.json +6 -0
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/go/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/ios-swift/AGENTS.md +1 -0
- package/presets/cursor/ios-swift/REPO_AGENTS.md +14 -0
- package/presets/cursor/ios-swift/agents/build-verifier.md +1 -1
- package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/cursor/ios-swift/commands/README.md +1 -0
- package/presets/cursor/ios-swift/commands/task-continue.md +9 -0
- package/presets/cursor/ios-swift/commands/technical-retro.md +8 -0
- package/presets/cursor/ios-swift/commands/update.md +39 -0
- package/presets/cursor/ios-swift/hooks/README.md +5 -1
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +107 -18
- package/presets/cursor/ios-swift/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/ios-swift/hooks/examples/README.md +1 -1
- package/presets/cursor/ios-swift/hooks.json +6 -0
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/ios-swift/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/java/AGENTS.md +1 -1
- package/presets/cursor/java/REPO_AGENTS.md +14 -0
- package/presets/cursor/java/agents/build-verifier.md +1 -1
- package/presets/cursor/java/agents/code-reviewer.md +1 -1
- package/presets/cursor/java/agents/debugger.md +1 -1
- package/presets/cursor/java/agents/feature-developer.md +1 -1
- package/presets/cursor/java/agents/task-analyst.md +1 -1
- package/presets/cursor/java/commands/README.md +1 -0
- package/presets/cursor/java/commands/task-continue.md +9 -0
- package/presets/cursor/java/commands/technical-retro.md +8 -0
- package/presets/cursor/java/commands/update.md +39 -0
- package/presets/cursor/java/hooks/README.md +5 -1
- package/presets/cursor/java/hooks/chain-team-phases.sh +107 -18
- package/presets/cursor/java/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/java/hooks/examples/README.md +1 -1
- package/presets/cursor/java/hooks.json +6 -0
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/java/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/mcp-ts/REPO_AGENTS.md +14 -0
- 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/agents/task-analyst.md +1 -1
- package/presets/cursor/mcp-ts/commands/README.md +1 -0
- package/presets/cursor/mcp-ts/commands/task-continue.md +9 -0
- package/presets/cursor/mcp-ts/commands/technical-retro.md +8 -0
- package/presets/cursor/mcp-ts/commands/update.md +39 -0
- package/presets/cursor/mcp-ts/hooks/README.md +5 -1
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +107 -18
- package/presets/cursor/mcp-ts/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/mcp-ts/hooks.json +6 -0
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/next/AGENTS.md +1 -0
- package/presets/cursor/next/REPO_AGENTS.md +15 -1
- package/presets/cursor/next/agents/build-verifier.md +1 -1
- package/presets/cursor/next/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/cursor/next/agents/task-router.md +1 -1
- package/presets/cursor/next/commands/README.md +1 -0
- package/presets/cursor/next/commands/task-continue.md +9 -0
- package/presets/cursor/next/commands/technical-retro.md +8 -0
- package/presets/cursor/next/commands/update.md +39 -0
- package/presets/cursor/next/hooks/README.md +6 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +107 -18
- package/presets/cursor/next/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/next/hooks/examples/README.md +1 -1
- package/presets/cursor/next/hooks.json +6 -0
- package/presets/cursor/next/rules/README.md +3 -1
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/next/rules/component-catalog-gate.mdc +13 -0
- package/presets/cursor/next/rules/forms-validation.mdc +12 -0
- package/presets/cursor/next/rules/next-app-router.mdc +27 -0
- package/presets/cursor/next/rules/next-static-export.mdc +16 -0
- package/presets/cursor/next/rules/react-next-anti-hallucination.mdc +21 -18
- package/presets/cursor/next/rules/security-next.mdc +16 -2
- package/presets/cursor/next/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/next/team/fixtures/feature-light.json +2 -1
- package/presets/cursor/next/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/cursor/nuxt/AGENTS.md +1 -0
- package/presets/cursor/nuxt/REPO_AGENTS.md +14 -0
- package/presets/cursor/nuxt/agents/build-verifier.md +1 -1
- package/presets/cursor/nuxt/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/cursor/nuxt/commands/README.md +1 -0
- package/presets/cursor/nuxt/commands/task-continue.md +9 -0
- package/presets/cursor/nuxt/commands/technical-retro.md +8 -0
- package/presets/cursor/nuxt/commands/update.md +39 -0
- package/presets/cursor/nuxt/hooks/README.md +4 -0
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +107 -18
- package/presets/cursor/nuxt/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/nuxt/hooks/examples/README.md +1 -1
- package/presets/cursor/nuxt/hooks.json +6 -0
- package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/nuxt/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/php-hexagonal/AGENTS.md +1 -1
- package/presets/cursor/php-hexagonal/REPO_AGENTS.md +14 -0
- package/presets/cursor/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -1
- 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/task-analyst.md +1 -1
- package/presets/cursor/php-hexagonal/commands/README.md +1 -0
- package/presets/cursor/php-hexagonal/commands/task-continue.md +9 -0
- package/presets/cursor/php-hexagonal/commands/technical-retro.md +8 -0
- package/presets/cursor/php-hexagonal/commands/update.md +39 -0
- package/presets/cursor/php-hexagonal/hooks/README.md +5 -1
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +107 -18
- package/presets/cursor/php-hexagonal/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/php-hexagonal/hooks/examples/README.md +1 -1
- package/presets/cursor/php-hexagonal/hooks.json +6 -0
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/php-laravel/AGENTS.md +1 -1
- package/presets/cursor/php-laravel/REPO_AGENTS.md +14 -0
- package/presets/cursor/php-laravel/agents/build-verifier.md +1 -1
- package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -1
- 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/task-analyst.md +1 -1
- package/presets/cursor/php-laravel/commands/README.md +1 -0
- package/presets/cursor/php-laravel/commands/task-continue.md +9 -0
- package/presets/cursor/php-laravel/commands/technical-retro.md +8 -0
- package/presets/cursor/php-laravel/commands/update.md +39 -0
- package/presets/cursor/php-laravel/hooks/README.md +5 -1
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +107 -18
- package/presets/cursor/php-laravel/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/php-laravel/hooks/examples/README.md +1 -1
- package/presets/cursor/php-laravel/hooks.json +6 -0
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/php-laravel/skills/technical-retro/SKILL.md +2 -0
- package/presets/cursor/svelte/AGENTS.md +1 -0
- package/presets/cursor/svelte/REPO_AGENTS.md +14 -0
- package/presets/cursor/svelte/agents/build-verifier.md +1 -1
- package/presets/cursor/svelte/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/cursor/svelte/commands/README.md +1 -0
- package/presets/cursor/svelte/commands/task-continue.md +9 -0
- package/presets/cursor/svelte/commands/technical-retro.md +8 -0
- package/presets/cursor/svelte/commands/update.md +39 -0
- package/presets/cursor/svelte/hooks/README.md +4 -0
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +107 -18
- package/presets/cursor/svelte/hooks/check-preset-update.mjs +227 -0
- package/presets/cursor/svelte/hooks/examples/README.md +1 -1
- package/presets/cursor/svelte/hooks.json +6 -0
- package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/svelte/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/android-kotlin/MAVIS.md +1 -0
- package/presets/mavis/android-kotlin/REPO_AGENTS.md +14 -0
- package/presets/mavis/android-kotlin/adapter-map.json +17 -1
- package/presets/mavis/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/mavis/android-kotlin/commands/README.md +1 -0
- package/presets/mavis/android-kotlin/commands/task-continue.md +9 -0
- package/presets/mavis/android-kotlin/commands/technical-retro.md +8 -0
- package/presets/mavis/android-kotlin/commands/update.md +34 -0
- package/presets/mavis/android-kotlin/hooks/README.md +3 -0
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +107 -18
- package/presets/mavis/android-kotlin/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/android-kotlin/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/go/REPO_AGENTS.md +14 -0
- package/presets/mavis/go/adapter-map.json +17 -1
- package/presets/mavis/go/agents/build-verifier.md +1 -1
- package/presets/mavis/go/agents/code-reviewer.md +1 -1
- package/presets/mavis/go/agents/debugger.md +1 -1
- package/presets/mavis/go/agents/feature-developer.md +1 -1
- package/presets/mavis/go/agents/task-analyst.md +1 -1
- package/presets/mavis/go/commands/README.md +1 -0
- package/presets/mavis/go/commands/task-continue.md +9 -0
- package/presets/mavis/go/commands/technical-retro.md +8 -0
- package/presets/mavis/go/commands/update.md +34 -0
- package/presets/mavis/go/hooks/README.md +3 -0
- package/presets/mavis/go/hooks/chain-team-phases.sh +107 -18
- package/presets/mavis/go/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/go/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/go/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/ios-swift/MAVIS.md +1 -0
- package/presets/mavis/ios-swift/REPO_AGENTS.md +14 -0
- package/presets/mavis/ios-swift/adapter-map.json +17 -1
- package/presets/mavis/ios-swift/agents/build-verifier.md +1 -1
- package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/mavis/ios-swift/commands/README.md +1 -0
- package/presets/mavis/ios-swift/commands/task-continue.md +9 -0
- package/presets/mavis/ios-swift/commands/technical-retro.md +8 -0
- package/presets/mavis/ios-swift/commands/update.md +34 -0
- package/presets/mavis/ios-swift/hooks/README.md +3 -0
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +107 -18
- package/presets/mavis/ios-swift/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/ios-swift/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/java/REPO_AGENTS.md +14 -0
- package/presets/mavis/java/adapter-map.json +17 -1
- package/presets/mavis/java/agents/build-verifier.md +1 -1
- package/presets/mavis/java/agents/code-reviewer.md +1 -1
- package/presets/mavis/java/agents/debugger.md +1 -1
- package/presets/mavis/java/agents/feature-developer.md +1 -1
- package/presets/mavis/java/agents/task-analyst.md +1 -1
- package/presets/mavis/java/commands/README.md +1 -0
- package/presets/mavis/java/commands/task-continue.md +9 -0
- package/presets/mavis/java/commands/technical-retro.md +8 -0
- package/presets/mavis/java/commands/update.md +34 -0
- package/presets/mavis/java/hooks/README.md +3 -0
- package/presets/mavis/java/hooks/chain-team-phases.sh +107 -18
- package/presets/mavis/java/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/java/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/java/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/mcp-ts/REPO_AGENTS.md +14 -0
- package/presets/mavis/mcp-ts/adapter-map.json +17 -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/agents/task-analyst.md +1 -1
- package/presets/mavis/mcp-ts/commands/README.md +1 -0
- package/presets/mavis/mcp-ts/commands/task-continue.md +9 -0
- package/presets/mavis/mcp-ts/commands/technical-retro.md +8 -0
- package/presets/mavis/mcp-ts/commands/update.md +34 -0
- package/presets/mavis/mcp-ts/hooks/README.md +3 -0
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +107 -18
- package/presets/mavis/mcp-ts/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/next/MAVIS.md +1 -0
- package/presets/mavis/next/REPO_AGENTS.md +15 -1
- package/presets/mavis/next/adapter-map.json +25 -1
- package/presets/mavis/next/agents/build-verifier.md +1 -1
- package/presets/mavis/next/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/mavis/next/agents/task-router.md +1 -1
- package/presets/mavis/next/commands/README.md +1 -0
- package/presets/mavis/next/commands/task-continue.md +9 -0
- package/presets/mavis/next/commands/technical-retro.md +8 -0
- package/presets/mavis/next/commands/update.md +34 -0
- package/presets/mavis/next/hooks/README.md +3 -0
- package/presets/mavis/next/hooks/chain-team-phases.sh +107 -18
- package/presets/mavis/next/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/next/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/next/rules/component-catalog-gate.md +13 -0
- package/presets/mavis/next/rules/forms-validation.md +12 -0
- package/presets/mavis/next/rules/next-app-router.md +27 -0
- package/presets/mavis/next/rules/next-static-export.md +16 -0
- package/presets/mavis/next/rules/react-next-anti-hallucination.md +20 -18
- package/presets/mavis/next/rules/security-next.md +13 -0
- package/presets/mavis/next/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/next/team/fixtures/feature-light.json +2 -1
- package/presets/mavis/next/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/mavis/nuxt/MAVIS.md +1 -0
- package/presets/mavis/nuxt/REPO_AGENTS.md +14 -0
- package/presets/mavis/nuxt/adapter-map.json +17 -1
- package/presets/mavis/nuxt/agents/build-verifier.md +1 -1
- package/presets/mavis/nuxt/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/mavis/nuxt/commands/README.md +1 -0
- package/presets/mavis/nuxt/commands/task-continue.md +9 -0
- package/presets/mavis/nuxt/commands/technical-retro.md +8 -0
- package/presets/mavis/nuxt/commands/update.md +34 -0
- package/presets/mavis/nuxt/hooks/README.md +3 -0
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +107 -18
- package/presets/mavis/nuxt/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/nuxt/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/php-hexagonal/REPO_AGENTS.md +14 -0
- package/presets/mavis/php-hexagonal/adapter-map.json +17 -1
- package/presets/mavis/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -1
- 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/task-analyst.md +1 -1
- package/presets/mavis/php-hexagonal/commands/README.md +1 -0
- package/presets/mavis/php-hexagonal/commands/task-continue.md +9 -0
- package/presets/mavis/php-hexagonal/commands/technical-retro.md +8 -0
- package/presets/mavis/php-hexagonal/commands/update.md +34 -0
- package/presets/mavis/php-hexagonal/hooks/README.md +3 -0
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +107 -18
- package/presets/mavis/php-hexagonal/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/php-laravel/REPO_AGENTS.md +14 -0
- package/presets/mavis/php-laravel/adapter-map.json +17 -1
- package/presets/mavis/php-laravel/agents/build-verifier.md +1 -1
- package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -1
- 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/task-analyst.md +1 -1
- package/presets/mavis/php-laravel/commands/README.md +1 -0
- package/presets/mavis/php-laravel/commands/task-continue.md +9 -0
- package/presets/mavis/php-laravel/commands/technical-retro.md +8 -0
- package/presets/mavis/php-laravel/commands/update.md +34 -0
- package/presets/mavis/php-laravel/hooks/README.md +3 -0
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +107 -18
- package/presets/mavis/php-laravel/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/php-laravel/skills/technical-retro/SKILL.md +2 -0
- package/presets/mavis/svelte/MAVIS.md +1 -0
- package/presets/mavis/svelte/REPO_AGENTS.md +14 -0
- package/presets/mavis/svelte/adapter-map.json +17 -1
- package/presets/mavis/svelte/agents/build-verifier.md +1 -1
- package/presets/mavis/svelte/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/mavis/svelte/commands/README.md +1 -0
- package/presets/mavis/svelte/commands/task-continue.md +9 -0
- package/presets/mavis/svelte/commands/technical-retro.md +8 -0
- package/presets/mavis/svelte/commands/update.md +34 -0
- package/presets/mavis/svelte/hooks/README.md +3 -0
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +107 -18
- package/presets/mavis/svelte/hooks/check-preset-update.mjs +227 -0
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/svelte/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/android-kotlin/OPENCODE.md +15 -6
- package/presets/opencode/android-kotlin/REPO_AGENTS.md +14 -0
- package/presets/opencode/android-kotlin/adapter-map.json +17 -1
- package/presets/opencode/android-kotlin/agents/build-verifier.md +1 -1
- package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/opencode/android-kotlin/commands/README.md +1 -0
- package/presets/opencode/android-kotlin/commands/task-continue.md +9 -0
- package/presets/opencode/android-kotlin/commands/technical-retro.md +8 -0
- package/presets/opencode/android-kotlin/commands/update.md +42 -0
- package/presets/opencode/android-kotlin/hooks/README.md +3 -0
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +107 -18
- package/presets/opencode/android-kotlin/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/android-kotlin/opencode.json +2 -12
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/android-kotlin/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/go/OPENCODE.md +14 -6
- package/presets/opencode/go/REPO_AGENTS.md +14 -0
- package/presets/opencode/go/adapter-map.json +17 -1
- package/presets/opencode/go/agents/build-verifier.md +1 -1
- package/presets/opencode/go/agents/code-reviewer.md +1 -1
- package/presets/opencode/go/agents/debugger.md +1 -1
- package/presets/opencode/go/agents/feature-developer.md +1 -1
- package/presets/opencode/go/agents/task-analyst.md +1 -1
- package/presets/opencode/go/commands/README.md +1 -0
- package/presets/opencode/go/commands/task-continue.md +9 -0
- package/presets/opencode/go/commands/technical-retro.md +8 -0
- package/presets/opencode/go/commands/update.md +42 -0
- package/presets/opencode/go/hooks/README.md +3 -0
- package/presets/opencode/go/hooks/chain-team-phases.sh +107 -18
- package/presets/opencode/go/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/go/opencode.json +2 -12
- package/presets/opencode/go/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/go/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/ios-swift/OPENCODE.md +15 -6
- package/presets/opencode/ios-swift/REPO_AGENTS.md +14 -0
- package/presets/opencode/ios-swift/adapter-map.json +17 -1
- package/presets/opencode/ios-swift/agents/build-verifier.md +1 -1
- package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/opencode/ios-swift/commands/README.md +1 -0
- package/presets/opencode/ios-swift/commands/task-continue.md +9 -0
- package/presets/opencode/ios-swift/commands/technical-retro.md +8 -0
- package/presets/opencode/ios-swift/commands/update.md +42 -0
- package/presets/opencode/ios-swift/hooks/README.md +3 -0
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +107 -18
- package/presets/opencode/ios-swift/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/ios-swift/opencode.json +2 -12
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/ios-swift/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/java/OPENCODE.md +14 -6
- package/presets/opencode/java/REPO_AGENTS.md +14 -0
- package/presets/opencode/java/adapter-map.json +17 -1
- package/presets/opencode/java/agents/build-verifier.md +1 -1
- package/presets/opencode/java/agents/code-reviewer.md +1 -1
- package/presets/opencode/java/agents/debugger.md +1 -1
- package/presets/opencode/java/agents/feature-developer.md +1 -1
- package/presets/opencode/java/agents/task-analyst.md +1 -1
- package/presets/opencode/java/commands/README.md +1 -0
- package/presets/opencode/java/commands/task-continue.md +9 -0
- package/presets/opencode/java/commands/technical-retro.md +8 -0
- package/presets/opencode/java/commands/update.md +42 -0
- package/presets/opencode/java/hooks/README.md +3 -0
- package/presets/opencode/java/hooks/chain-team-phases.sh +107 -18
- package/presets/opencode/java/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/java/opencode.json +2 -12
- package/presets/opencode/java/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/java/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/mcp-ts/OPENCODE.md +14 -6
- package/presets/opencode/mcp-ts/REPO_AGENTS.md +14 -0
- package/presets/opencode/mcp-ts/adapter-map.json +17 -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/agents/task-analyst.md +1 -1
- package/presets/opencode/mcp-ts/commands/README.md +1 -0
- package/presets/opencode/mcp-ts/commands/task-continue.md +9 -0
- package/presets/opencode/mcp-ts/commands/technical-retro.md +8 -0
- package/presets/opencode/mcp-ts/commands/update.md +42 -0
- package/presets/opencode/mcp-ts/hooks/README.md +3 -0
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +107 -18
- package/presets/opencode/mcp-ts/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/mcp-ts/opencode.json +2 -12
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/next/OPENCODE.md +15 -6
- package/presets/opencode/next/REPO_AGENTS.md +15 -1
- package/presets/opencode/next/adapter-map.json +25 -1
- package/presets/opencode/next/agents/build-verifier.md +1 -1
- package/presets/opencode/next/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/opencode/next/agents/task-router.md +1 -1
- package/presets/opencode/next/commands/README.md +1 -0
- package/presets/opencode/next/commands/task-continue.md +9 -0
- package/presets/opencode/next/commands/technical-retro.md +8 -0
- package/presets/opencode/next/commands/update.md +42 -0
- package/presets/opencode/next/hooks/README.md +3 -0
- package/presets/opencode/next/hooks/chain-team-phases.sh +107 -18
- package/presets/opencode/next/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/next/opencode.json +2 -12
- package/presets/opencode/next/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/next/rules/component-catalog-gate.md +13 -0
- package/presets/opencode/next/rules/forms-validation.md +12 -0
- package/presets/opencode/next/rules/next-app-router.md +27 -0
- package/presets/opencode/next/rules/next-static-export.md +16 -0
- package/presets/opencode/next/rules/react-next-anti-hallucination.md +20 -18
- package/presets/opencode/next/rules/security-next.md +13 -0
- package/presets/opencode/next/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/next/team/fixtures/feature-light.json +2 -1
- package/presets/opencode/next/team/fixtures/feature-ui-standard.json +24 -0
- package/presets/opencode/nuxt/OPENCODE.md +15 -6
- package/presets/opencode/nuxt/REPO_AGENTS.md +14 -0
- package/presets/opencode/nuxt/adapter-map.json +17 -1
- package/presets/opencode/nuxt/agents/build-verifier.md +1 -1
- package/presets/opencode/nuxt/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/opencode/nuxt/commands/README.md +1 -0
- package/presets/opencode/nuxt/commands/task-continue.md +9 -0
- package/presets/opencode/nuxt/commands/technical-retro.md +8 -0
- package/presets/opencode/nuxt/commands/update.md +42 -0
- package/presets/opencode/nuxt/hooks/README.md +3 -0
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +107 -18
- package/presets/opencode/nuxt/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/nuxt/opencode.json +2 -12
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/nuxt/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/php-hexagonal/OPENCODE.md +14 -6
- package/presets/opencode/php-hexagonal/REPO_AGENTS.md +14 -0
- package/presets/opencode/php-hexagonal/adapter-map.json +17 -1
- package/presets/opencode/php-hexagonal/agents/build-verifier.md +1 -1
- package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -1
- 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/task-analyst.md +1 -1
- package/presets/opencode/php-hexagonal/commands/README.md +1 -0
- package/presets/opencode/php-hexagonal/commands/task-continue.md +9 -0
- package/presets/opencode/php-hexagonal/commands/technical-retro.md +8 -0
- package/presets/opencode/php-hexagonal/commands/update.md +42 -0
- package/presets/opencode/php-hexagonal/hooks/README.md +3 -0
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +107 -18
- package/presets/opencode/php-hexagonal/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/php-hexagonal/opencode.json +2 -12
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/php-hexagonal/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/php-laravel/OPENCODE.md +14 -6
- package/presets/opencode/php-laravel/REPO_AGENTS.md +14 -0
- package/presets/opencode/php-laravel/adapter-map.json +17 -1
- package/presets/opencode/php-laravel/agents/build-verifier.md +1 -1
- package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -1
- 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/task-analyst.md +1 -1
- package/presets/opencode/php-laravel/commands/README.md +1 -0
- package/presets/opencode/php-laravel/commands/task-continue.md +9 -0
- package/presets/opencode/php-laravel/commands/technical-retro.md +8 -0
- package/presets/opencode/php-laravel/commands/update.md +42 -0
- package/presets/opencode/php-laravel/hooks/README.md +3 -0
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +107 -18
- package/presets/opencode/php-laravel/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/php-laravel/opencode.json +2 -12
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/php-laravel/skills/technical-retro/SKILL.md +2 -0
- package/presets/opencode/svelte/OPENCODE.md +15 -6
- package/presets/opencode/svelte/REPO_AGENTS.md +14 -0
- package/presets/opencode/svelte/adapter-map.json +17 -1
- package/presets/opencode/svelte/agents/build-verifier.md +1 -1
- package/presets/opencode/svelte/agents/code-reviewer.md +1 -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/task-analyst.md +1 -1
- package/presets/opencode/svelte/commands/README.md +1 -0
- package/presets/opencode/svelte/commands/task-continue.md +9 -0
- package/presets/opencode/svelte/commands/technical-retro.md +8 -0
- package/presets/opencode/svelte/commands/update.md +42 -0
- package/presets/opencode/svelte/hooks/README.md +3 -0
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +107 -18
- package/presets/opencode/svelte/hooks/check-preset-update.mjs +227 -0
- package/presets/opencode/svelte/opencode.json +2 -12
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/svelte/skills/technical-retro/SKILL.md +2 -0
- package/scripts/check-product-specs.sh +115 -9
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single entrypoint for the in-task self-learning loop (O8b).
|
|
3
|
+
*
|
|
4
|
+
* Chains derive → append/validate → improve → report in one command:
|
|
5
|
+
* 1. derive gate signals (read-only over metrics + store),
|
|
6
|
+
* 2. append each derived signal via `appendSignal` (each acquires/releases
|
|
7
|
+
* its OWN lock),
|
|
8
|
+
* 3. run the improver (`runImprover`, its own lock),
|
|
9
|
+
* 4. print a combined report (derive summary + improver report + a read-only
|
|
10
|
+
* seed-backlog notice when staged seeds ≥ SEED_BACKLOG_THRESHOLD).
|
|
11
|
+
*
|
|
12
|
+
* No lock is held across the chain, and the loop never writes
|
|
13
|
+
* `status.json` / `metrics.json`; the seed report is read-only over
|
|
14
|
+
* `rules-library/`.
|
|
15
|
+
*
|
|
16
|
+
* Two read-only modes inspect capture without running it:
|
|
17
|
+
* `node run.mjs --status` — per signature: distinct slugs, tier + next
|
|
18
|
+
* action, last capture, malformed-line count, cohort readiness, envelope, and
|
|
19
|
+
* how many derivable signals are not in the store yet.
|
|
20
|
+
* `node run.mjs --strict` — exit 1 when capture is broken (see
|
|
21
|
+
* `CAPTURE_WINDOW`), 0 otherwise. Never passed by the chain hook: a gate must
|
|
22
|
+
* not live in a hook.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import fs from 'node:fs';
|
|
26
|
+
import path from 'node:path';
|
|
27
|
+
import { pathToFileURL } from 'node:url';
|
|
28
|
+
|
|
29
|
+
import { appendSignal, groupSignatures } from './signals.mjs';
|
|
30
|
+
import {
|
|
31
|
+
MAX_ACTIVE_RULES,
|
|
32
|
+
MAX_TOTAL_LINES,
|
|
33
|
+
countRulesAndLines,
|
|
34
|
+
evaluateEnvelope,
|
|
35
|
+
runImprover,
|
|
36
|
+
thresholdAction,
|
|
37
|
+
} from './rule-improver.mjs';
|
|
38
|
+
import { deriveGateSignals } from './derive-gate-signals.mjs';
|
|
39
|
+
import { MIN_COHORT_SIZE, oracle, readAllTasks } from './efficacy-oracle.mjs';
|
|
40
|
+
|
|
41
|
+
export const DEFAULT_BASE_DIR = path.join(process.cwd(), '.ai.local');
|
|
42
|
+
export const SEED_BACKLOG_THRESHOLD = 20;
|
|
43
|
+
|
|
44
|
+
// N consecutive completed tasks that produced 0 signals while gate evidence
|
|
45
|
+
// existed. Fixed at the Rule of Three the improver already encodes: a tunable N
|
|
46
|
+
// would be a knob this surface must not introduce.
|
|
47
|
+
export const CAPTURE_WINDOW = 3;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Count staged seed files (`*.md`) under `libraryDir`. Read-only; returns 0
|
|
51
|
+
* when the directory is absent.
|
|
52
|
+
*/
|
|
53
|
+
export function countStagedSeeds({ libraryDir } = {}) {
|
|
54
|
+
let names = [];
|
|
55
|
+
try {
|
|
56
|
+
names = fs.readdirSync(libraryDir);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (!error || error.code !== 'ENOENT') throw error;
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
61
|
+
let count = 0;
|
|
62
|
+
for (const name of names) {
|
|
63
|
+
if (name.endsWith('.md')) count += 1;
|
|
64
|
+
}
|
|
65
|
+
return count;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Render the combined loop report: derive summary + improver report + a
|
|
70
|
+
* seed-backlog notice when `seedCount` is at/above the threshold.
|
|
71
|
+
*/
|
|
72
|
+
export function renderReport({ derived, appended, appendErrors, improver, seedCount }) {
|
|
73
|
+
const denied = derived.skipped.filter((item) => item.reason === 'denylist').length;
|
|
74
|
+
const deduped = derived.skipped.length - denied;
|
|
75
|
+
const lines = [
|
|
76
|
+
'Self-learning loop — derive → append → improve',
|
|
77
|
+
'',
|
|
78
|
+
`gate derivation: ${derived.signals.length} derived, ${denied} denied, ${deduped} deduped, ${derived.errors.length} errors`,
|
|
79
|
+
];
|
|
80
|
+
for (const item of derived.skipped) {
|
|
81
|
+
lines.push(` - skipped ${item.slug} (${item.kind}): ${item.reason}`);
|
|
82
|
+
}
|
|
83
|
+
for (const error of derived.errors) {
|
|
84
|
+
lines.push(` - error: ${error.reason}`);
|
|
85
|
+
}
|
|
86
|
+
lines.push(`appended: ${appended.length}`);
|
|
87
|
+
for (const error of appendErrors) {
|
|
88
|
+
lines.push(` - append error: ${error.signature}: ${error.reason}`);
|
|
89
|
+
}
|
|
90
|
+
lines.push('');
|
|
91
|
+
lines.push(improver.report.trimEnd());
|
|
92
|
+
if (seedCount >= SEED_BACKLOG_THRESHOLD) {
|
|
93
|
+
lines.push(`seed backlog: ${seedCount} staged seeds in rules-library/ (threshold ${SEED_BACKLOG_THRESHOLD}) — human promote/prune`);
|
|
94
|
+
}
|
|
95
|
+
return `${lines.join('\n')}\n`;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Run the full loop. Every write (each `appendSignal`, `runImprover`) owns its
|
|
100
|
+
* own lock; nothing is held across the chain. Returns the derive/append/
|
|
101
|
+
* improver results, the seed count, and the combined report.
|
|
102
|
+
*/
|
|
103
|
+
export function runLoop({ baseDir = DEFAULT_BASE_DIR } = {}) {
|
|
104
|
+
const signalsPath = path.join(baseDir, 'signals.jsonl');
|
|
105
|
+
const libraryDir = path.join(baseDir, 'rules-library');
|
|
106
|
+
|
|
107
|
+
const derived = deriveGateSignals({ baseDir });
|
|
108
|
+
|
|
109
|
+
const appended = [];
|
|
110
|
+
const appendErrors = [];
|
|
111
|
+
for (const signal of derived.signals) {
|
|
112
|
+
try {
|
|
113
|
+
appendSignal(signal, { signalsPath });
|
|
114
|
+
appended.push(signal);
|
|
115
|
+
} catch (error) {
|
|
116
|
+
appendErrors.push({ signature: signal.signature, reason: error instanceof Error ? error.message : String(error) });
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const improver = runImprover({ baseDir });
|
|
121
|
+
|
|
122
|
+
const seedCount = countStagedSeeds({ libraryDir });
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
derived,
|
|
126
|
+
appended,
|
|
127
|
+
appendErrors,
|
|
128
|
+
improver,
|
|
129
|
+
seedCount,
|
|
130
|
+
report: renderReport({ derived, appended, appendErrors, improver, seedCount }),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// --- Read-only inspection (`--status`, `--strict`) -----------------------------
|
|
135
|
+
|
|
136
|
+
/** `{ [signature]: iso }` of the newest valid signal per signature. Read-only. */
|
|
137
|
+
function lastCaptureBySignature({ signalsPath }) {
|
|
138
|
+
const latest = new Map();
|
|
139
|
+
let raw = '';
|
|
140
|
+
try {
|
|
141
|
+
raw = fs.readFileSync(signalsPath, 'utf8');
|
|
142
|
+
} catch (error) {
|
|
143
|
+
if (!error || error.code !== 'ENOENT') throw error;
|
|
144
|
+
return latest;
|
|
145
|
+
}
|
|
146
|
+
for (const line of raw.split('\n')) {
|
|
147
|
+
const trimmed = line.trim();
|
|
148
|
+
if (trimmed === '') continue;
|
|
149
|
+
let signal;
|
|
150
|
+
try { signal = JSON.parse(trimmed); } catch { continue; }
|
|
151
|
+
if (typeof signal.signature !== 'string' || typeof signal.at !== 'string') continue;
|
|
152
|
+
if (signal.status === 'rejected' || signal.status === 'rolled_back') continue;
|
|
153
|
+
const previous = latest.get(signal.signature);
|
|
154
|
+
if (!previous || Date.parse(signal.at) > Date.parse(previous)) latest.set(signal.signature, signal.at);
|
|
155
|
+
}
|
|
156
|
+
return latest;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Render the read-only `--status` report. Never writes. */
|
|
160
|
+
export function statusReport({ baseDir = DEFAULT_BASE_DIR } = {}) {
|
|
161
|
+
const signalsPath = path.join(baseDir, 'signals.jsonl');
|
|
162
|
+
const rulesDir = path.join(baseDir, 'rules');
|
|
163
|
+
const conventionsPath = path.join(baseDir, 'conventions.md');
|
|
164
|
+
|
|
165
|
+
const storeExists = fs.existsSync(signalsPath);
|
|
166
|
+
const { groups, errors } = groupSignatures({ signalsPath });
|
|
167
|
+
const lastCapture = lastCaptureBySignature({ signalsPath });
|
|
168
|
+
const storeLineCount = groups.reduce((total, group) => total + group.count, 0);
|
|
169
|
+
const storeState = !storeExists
|
|
170
|
+
? 'absent — no .ai.local/signals.jsonl yet (capture never ran)'
|
|
171
|
+
: storeLineCount === 0 && errors.length > 0
|
|
172
|
+
? `malformed — 0 readable signals, ${errors.length} malformed line(s)`
|
|
173
|
+
: storeLineCount === 0
|
|
174
|
+
? 'empty — 0 signals captured'
|
|
175
|
+
: `ok — ${storeLineCount} signal(s), ${errors.length} malformed line(s)`;
|
|
176
|
+
|
|
177
|
+
const envelope = countRulesAndLines({ rulesDir, conventionsPath });
|
|
178
|
+
const envelopeState = evaluateEnvelope({ ruleCount: envelope.ruleCount, lineCount: envelope.lineCount });
|
|
179
|
+
const pending = deriveGateSignals({ baseDir }).signals.length;
|
|
180
|
+
|
|
181
|
+
const lines = ['Self-learning loop — status (read-only)', ''];
|
|
182
|
+
lines.push(`store: ${storeState}`);
|
|
183
|
+
lines.push(`pending derivations: ${pending}` + (pending > 0 ? ' (evidence not captured yet)' : ''));
|
|
184
|
+
lines.push(
|
|
185
|
+
`envelope: ${envelope.ruleCount}/${MAX_ACTIVE_RULES} rules, ${envelope.lineCount}/${MAX_TOTAL_LINES} lines — ${envelopeState.reason}`,
|
|
186
|
+
);
|
|
187
|
+
for (const error of errors) {
|
|
188
|
+
lines.push(` - malformed store line ${error.line}: ${error.reason}`);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (groups.length === 0) {
|
|
192
|
+
lines.push('');
|
|
193
|
+
lines.push('no signatures captured yet — `node .ai.local/scripts/run.mjs` derives them from metrics.json');
|
|
194
|
+
return `${lines.join('\n')}\n`;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
for (const group of groups) {
|
|
198
|
+
const { tier, action } = thresholdAction(group.distinctSlugCount);
|
|
199
|
+
const verdict = oracle({ baseDir, rule: group.signature });
|
|
200
|
+
const ready = verdict.cohort.pre >= MIN_COHORT_SIZE && verdict.cohort.post >= MIN_COHORT_SIZE;
|
|
201
|
+
lines.push('');
|
|
202
|
+
lines.push(`${group.signature} — tier ${tier} → ${action}`);
|
|
203
|
+
lines.push(` slugs: ${group.distinctSlugCount} (threshold 3)`);
|
|
204
|
+
lines.push(` last capture: ${lastCapture.get(group.signature) ?? '(none)'}`);
|
|
205
|
+
lines.push(` errors: ${errors.length}`);
|
|
206
|
+
lines.push(
|
|
207
|
+
` cohort: pre ${verdict.cohort.pre} / post ${verdict.cohort.post} — ${ready ? 'ready' : `not ready (needs >= ${MIN_COHORT_SIZE} per side)`}; oracle: ${verdict.verdict}`,
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
return `${lines.join('\n')}\n`;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Capture health over the last `window` completed tasks. Read-only: no lock, no
|
|
215
|
+
* append, no improve. `broken` is true only when every task in a full window
|
|
216
|
+
* produced 0 signals **and** either the store is absent or one of those tasks
|
|
217
|
+
* carries a mappable gate outcome — three clean `completed` runs never map to a
|
|
218
|
+
* signature, so they must not read as a broken capture.
|
|
219
|
+
*/
|
|
220
|
+
export function captureHealth({ baseDir = DEFAULT_BASE_DIR, window = CAPTURE_WINDOW } = {}) {
|
|
221
|
+
const signalsPath = path.join(baseDir, 'signals.jsonl');
|
|
222
|
+
const storeExists = fs.existsSync(signalsPath);
|
|
223
|
+
const { tasks } = readAllTasks(path.join(baseDir, 'team', 'tasks'));
|
|
224
|
+
const completed = tasks
|
|
225
|
+
.filter((task) => typeof task.completedAt === 'string' && !Number.isNaN(Date.parse(task.completedAt)))
|
|
226
|
+
.sort((left, right) => Date.parse(right.completedAt) - Date.parse(left.completedAt));
|
|
227
|
+
const windowSlugs = completed.slice(0, window).map((task) => task.slug);
|
|
228
|
+
|
|
229
|
+
const capturedSlugs = new Set();
|
|
230
|
+
if (storeExists) {
|
|
231
|
+
for (const line of fs.readFileSync(signalsPath, 'utf8').split('\n')) {
|
|
232
|
+
const trimmed = line.trim();
|
|
233
|
+
if (trimmed === '') continue;
|
|
234
|
+
try {
|
|
235
|
+
const signal = JSON.parse(trimmed);
|
|
236
|
+
if (typeof signal.slug === 'string') capturedSlugs.add(signal.slug);
|
|
237
|
+
} catch { /* a malformed line is reported by --status, not counted here */ }
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const derived = deriveGateSignals({ baseDir });
|
|
242
|
+
const mappableSlugs = new Set([
|
|
243
|
+
...derived.signals.map((signal) => signal.slug),
|
|
244
|
+
...derived.skipped.map((item) => item.slug),
|
|
245
|
+
]);
|
|
246
|
+
|
|
247
|
+
const windowHasSignals = windowSlugs.some((slug) => capturedSlugs.has(slug));
|
|
248
|
+
const windowHasGateEvidence = windowSlugs.some((slug) => mappableSlugs.has(slug));
|
|
249
|
+
const fullWindow = windowSlugs.length === window;
|
|
250
|
+
const broken = fullWindow && !windowHasSignals && (!storeExists || windowHasGateEvidence);
|
|
251
|
+
|
|
252
|
+
return {
|
|
253
|
+
broken,
|
|
254
|
+
window,
|
|
255
|
+
windowSlugs,
|
|
256
|
+
storeExists,
|
|
257
|
+
windowHasGateEvidence,
|
|
258
|
+
pendingDerivations: derived.signals.length,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export function strictReport(health) {
|
|
263
|
+
const lines = ['Self-learning loop — strict', ''];
|
|
264
|
+
lines.push(`window: ${health.windowSlugs.length}/${health.window} completed task(s) — ${health.windowSlugs.join(', ') || '(none)'}`);
|
|
265
|
+
lines.push(`store: ${health.storeExists ? 'present' : 'absent'}`);
|
|
266
|
+
lines.push(`pending derivations: ${health.pendingDerivations}`);
|
|
267
|
+
lines.push(
|
|
268
|
+
`gate evidence in window: ${health.windowHasGateEvidence ? 'yes' : 'no'}`,
|
|
269
|
+
);
|
|
270
|
+
if (health.windowSlugs.length < health.window) {
|
|
271
|
+
lines.push(`verdict: OK — fewer than ${health.window} completed tasks, capture cannot be judged yet`);
|
|
272
|
+
} else if (health.broken) {
|
|
273
|
+
lines.push(
|
|
274
|
+
health.storeExists
|
|
275
|
+
? `verdict: CAPTURE BROKEN — ${health.window} consecutive completed tasks produced 0 signals while gate evidence exists`
|
|
276
|
+
: `verdict: CAPTURE BROKEN — no signals store after ${health.window} completed tasks (capture never ran)`,
|
|
277
|
+
);
|
|
278
|
+
} else {
|
|
279
|
+
lines.push('verdict: OK — capture is live');
|
|
280
|
+
}
|
|
281
|
+
return `${lines.join('\n')}\n`;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const CLI_USAGE = `Usage: node .ai.local/scripts/run.mjs [--status | --strict]
|
|
285
|
+
|
|
286
|
+
(no flag) run derive → append → improve and print the combined report
|
|
287
|
+
--status read-only report: per-signature slugs, tier, next action, last
|
|
288
|
+
capture, errors, cohort readiness, envelope, pending derivations
|
|
289
|
+
--strict read-only capture check; exit 1 when capture is broken
|
|
290
|
+
|
|
291
|
+
Both inspection modes are write-free and must not be invoked by the chain hook.
|
|
292
|
+
`;
|
|
293
|
+
|
|
294
|
+
// CLI entry: `node run.mjs` runs the loop; `--status` / `--strict` inspect it.
|
|
295
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
296
|
+
const args = process.argv.slice(2);
|
|
297
|
+
if (args.length === 0) {
|
|
298
|
+
process.stdout.write(runLoop().report);
|
|
299
|
+
} else if (args.length === 1 && args[0] === '--status') {
|
|
300
|
+
process.stdout.write(statusReport());
|
|
301
|
+
} else if (args.length === 1 && args[0] === '--strict') {
|
|
302
|
+
const health = captureHealth();
|
|
303
|
+
process.stdout.write(strictReport(health));
|
|
304
|
+
process.exitCode = health.broken ? 1 : 0;
|
|
305
|
+
} else {
|
|
306
|
+
process.stderr.write(CLI_USAGE);
|
|
307
|
+
process.exitCode = 2;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-learning signal store: append-only JSON-Lines ledger + signature grouper.
|
|
3
|
+
*
|
|
4
|
+
* Captures recurring agent mistakes (wrong-turn taxonomy) so the in-task
|
|
5
|
+
* rule-improvement loop can enforce a machine-checkable Rule of Three
|
|
6
|
+
* (>=2 distinct tasks → edit; >=3 → new rule). See
|
|
7
|
+
* `.ai.local/team/tasks/self-learning-agents/architecture.md` §1.
|
|
8
|
+
*
|
|
9
|
+
* Concurrency: writes to `.ai.local/signals.jsonl` go through the shared
|
|
10
|
+
* ownership-token advisory lock (`.ai.local/scripts/lock.mjs`) and a
|
|
11
|
+
* temp-file + atomic rename, mirroring `waitForMetricsLock` in
|
|
12
|
+
* `.opencode/hooks/chain-team-phases.sh`. The store is never partially written.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import fs from 'node:fs';
|
|
16
|
+
import path from 'node:path';
|
|
17
|
+
import { pathToFileURL } from 'node:url';
|
|
18
|
+
|
|
19
|
+
import { acquireLock, releaseLock } from './lock.mjs';
|
|
20
|
+
|
|
21
|
+
const SIGNALS_FILE = 'signals.jsonl';
|
|
22
|
+
export const DEFAULT_SIGNALS_PATH = path.join(process.cwd(), '.ai.local', SIGNALS_FILE);
|
|
23
|
+
|
|
24
|
+
const KINDS = ['correction', 'retry', 'waste', 'reversal', 'dead-end'];
|
|
25
|
+
const SEVERITIES = ['high', 'med', 'low'];
|
|
26
|
+
const SOURCES = ['self-review', 'gate', 'technical-retro', 'user'];
|
|
27
|
+
const STATUSES = ['proposed', 'staged', 'applied', 'rolled_back', 'rejected'];
|
|
28
|
+
|
|
29
|
+
// Shared kebab-case issue body (no leading/trailing/consecutive hyphens). The
|
|
30
|
+
// signature (`signals.mjs`) and the rule stem (`rule-improver.mjs`) must agree
|
|
31
|
+
// on this shape so a signal that passes signature validation can never fail
|
|
32
|
+
// stem validation later (or vice versa) — see ADR 0001 guard 1.
|
|
33
|
+
const ISSUE_BODY = '[a-z0-9]+(?:-[a-z0-9]+)*';
|
|
34
|
+
export const ISSUE_BODY_RE = new RegExp(`^${ISSUE_BODY}$`);
|
|
35
|
+
|
|
36
|
+
// Canonical dedup key: `kind:normalized-issue`. The issue body is the shared
|
|
37
|
+
// kebab pattern bounded to 2..63 chars. The fixed kind vocabulary + length
|
|
38
|
+
// bound guard the injection surface (architecture.md §5).
|
|
39
|
+
export const SIGNATURE_RE = new RegExp(`^(?:${KINDS.join('|')}):(?=[a-z0-9-]{2,63}$)${ISSUE_BODY}$`);
|
|
40
|
+
|
|
41
|
+
const KEBAB_RE = ISSUE_BODY_RE;
|
|
42
|
+
const SIGNAL_KEYS = ['id', 'at', 'slug', 'agent', 'kind', 'severity', 'confidence', 'signature', 'target', 'stem', 'source', 'status'];
|
|
43
|
+
|
|
44
|
+
function requireString(signal, key) {
|
|
45
|
+
if (typeof signal[key] !== 'string' || signal[key].length === 0) {
|
|
46
|
+
throw new Error(`"${key}" must be a non-empty string`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Validate a signal against the stable field contract. Throws on any
|
|
52
|
+
* malformed, missing, or unknown field; never writes.
|
|
53
|
+
*/
|
|
54
|
+
export function validateSignal(signal) {
|
|
55
|
+
if (signal === null || typeof signal !== 'object' || Array.isArray(signal)) {
|
|
56
|
+
throw new Error('signal must be a JSON object');
|
|
57
|
+
}
|
|
58
|
+
for (const key of Object.keys(signal)) {
|
|
59
|
+
if (!SIGNAL_KEYS.includes(key)) throw new Error(`unknown field "${key}"`);
|
|
60
|
+
}
|
|
61
|
+
requireString(signal, 'id');
|
|
62
|
+
requireString(signal, 'agent');
|
|
63
|
+
requireString(signal, 'target');
|
|
64
|
+
if (typeof signal.at !== 'string' || Number.isNaN(Date.parse(signal.at))) {
|
|
65
|
+
throw new Error('"at" must be an ISO timestamp');
|
|
66
|
+
}
|
|
67
|
+
if (typeof signal.slug !== 'string' || !KEBAB_RE.test(signal.slug)) {
|
|
68
|
+
throw new Error('"slug" must be kebab-case');
|
|
69
|
+
}
|
|
70
|
+
if (!KINDS.includes(signal.kind)) throw new Error(`"kind" must be one of: ${KINDS.join(' | ')}`);
|
|
71
|
+
if (!SEVERITIES.includes(signal.severity)) throw new Error(`"severity" must be one of: ${SEVERITIES.join(' | ')}`);
|
|
72
|
+
if (!Number.isInteger(signal.confidence) || signal.confidence < 0 || signal.confidence > 100) {
|
|
73
|
+
throw new Error('"confidence" must be an integer in 0..100');
|
|
74
|
+
}
|
|
75
|
+
if (typeof signal.signature !== 'string' || !SIGNATURE_RE.test(signal.signature)) {
|
|
76
|
+
throw new Error(`"signature" must match ${SIGNATURE_RE}`);
|
|
77
|
+
}
|
|
78
|
+
if (!signal.signature.startsWith(`${signal.kind}:`)) {
|
|
79
|
+
throw new Error(`"signature" must start with "${signal.kind}:"`);
|
|
80
|
+
}
|
|
81
|
+
if (signal.stem !== null && (typeof signal.stem !== 'string' || signal.stem.length === 0)) {
|
|
82
|
+
throw new Error('"stem" must be null or a non-empty string');
|
|
83
|
+
}
|
|
84
|
+
if (!SOURCES.includes(signal.source)) throw new Error(`"source" must be one of: ${SOURCES.join(' | ')}`);
|
|
85
|
+
if (!STATUSES.includes(signal.status)) throw new Error(`"status" must be one of: ${STATUSES.join(' | ')}`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Append one validated signal to the JSON-Lines store under the advisory lock.
|
|
90
|
+
* Returns `{ path, signal }`; throws on an invalid signal or lock timeout.
|
|
91
|
+
*/
|
|
92
|
+
export function appendSignal(signal, { signalsPath = DEFAULT_SIGNALS_PATH } = {}) {
|
|
93
|
+
validateSignal(signal);
|
|
94
|
+
const lockPath = `${signalsPath}.lock`;
|
|
95
|
+
const token = acquireLock(lockPath);
|
|
96
|
+
try {
|
|
97
|
+
let existing = '';
|
|
98
|
+
try {
|
|
99
|
+
existing = fs.readFileSync(signalsPath, 'utf8');
|
|
100
|
+
} catch (error) {
|
|
101
|
+
if (!error || error.code !== 'ENOENT') throw error;
|
|
102
|
+
}
|
|
103
|
+
const temporary = `${signalsPath}.${process.pid}.${Date.now()}.tmp`;
|
|
104
|
+
const fd = fs.openSync(temporary, 'w');
|
|
105
|
+
try {
|
|
106
|
+
fs.writeSync(fd, existing + `${JSON.stringify(signal)}\n`);
|
|
107
|
+
try { fs.fsyncSync(fd); } catch {}
|
|
108
|
+
} finally {
|
|
109
|
+
fs.closeSync(fd);
|
|
110
|
+
}
|
|
111
|
+
fs.renameSync(temporary, signalsPath);
|
|
112
|
+
return { path: signalsPath, signal };
|
|
113
|
+
} finally {
|
|
114
|
+
releaseLock(lockPath, token);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Mark every `proposed`/`staged` signal carrying `signature` as `status:
|
|
120
|
+
* applied` (idempotent, under the advisory lock). Called by the improver after
|
|
121
|
+
* it actually writes a mutation, so a later rejection/rollback can flip the
|
|
122
|
+
* status and `groupSignatures` will exclude it from re-qualifying (W4).
|
|
123
|
+
*/
|
|
124
|
+
export function markSignalsApplied(signature, { signalsPath = DEFAULT_SIGNALS_PATH } = {}) {
|
|
125
|
+
const lockPath = `${signalsPath}.lock`;
|
|
126
|
+
const token = acquireLock(lockPath);
|
|
127
|
+
try {
|
|
128
|
+
let raw;
|
|
129
|
+
try {
|
|
130
|
+
raw = fs.readFileSync(signalsPath, 'utf8');
|
|
131
|
+
} catch (error) {
|
|
132
|
+
if (!error || error.code !== 'ENOENT') throw error;
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const lines = raw.split('\n');
|
|
136
|
+
let changed = false;
|
|
137
|
+
const updated = lines.map((line) => {
|
|
138
|
+
if (line.trim() === '') return line;
|
|
139
|
+
let signal;
|
|
140
|
+
try { signal = JSON.parse(line); } catch { return line; }
|
|
141
|
+
if (
|
|
142
|
+
signal.signature === signature
|
|
143
|
+
&& (signal.status === 'proposed' || signal.status === 'staged')
|
|
144
|
+
) {
|
|
145
|
+
signal.status = 'applied';
|
|
146
|
+
changed = true;
|
|
147
|
+
}
|
|
148
|
+
return JSON.stringify(signal);
|
|
149
|
+
});
|
|
150
|
+
if (!changed) return;
|
|
151
|
+
const temporary = `${signalsPath}.${process.pid}.${Date.now()}.tmp`;
|
|
152
|
+
const fd = fs.openSync(temporary, 'w');
|
|
153
|
+
try {
|
|
154
|
+
fs.writeSync(fd, updated.join('\n'));
|
|
155
|
+
try { fs.fsyncSync(fd); } catch {}
|
|
156
|
+
} finally {
|
|
157
|
+
try { fs.closeSync(fd); } catch {}
|
|
158
|
+
}
|
|
159
|
+
fs.renameSync(temporary, signalsPath);
|
|
160
|
+
} finally {
|
|
161
|
+
releaseLock(lockPath, token);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Read the store, group valid signals by `signature`, and count distinct
|
|
167
|
+
* `slug`s per signature (Rule-of-Three input). `rejected` and `rolled_back`
|
|
168
|
+
* lines are valid but not counted. Malformed lines are returned in `errors`,
|
|
169
|
+
* never silently dropped.
|
|
170
|
+
*
|
|
171
|
+
* Returns `{ groups, errors }`; each group is
|
|
172
|
+
* `{ signature, distinctSlugCount, slugs, count }`.
|
|
173
|
+
*/
|
|
174
|
+
export function groupSignatures({ signalsPath = DEFAULT_SIGNALS_PATH } = {}) {
|
|
175
|
+
let raw;
|
|
176
|
+
try {
|
|
177
|
+
raw = fs.readFileSync(signalsPath, 'utf8');
|
|
178
|
+
} catch (error) {
|
|
179
|
+
if (error && error.code === 'ENOENT') return { groups: [], errors: [] };
|
|
180
|
+
throw error;
|
|
181
|
+
}
|
|
182
|
+
const groups = new Map();
|
|
183
|
+
const errors = [];
|
|
184
|
+
raw.split('\n').forEach((line, index) => {
|
|
185
|
+
const trimmed = line.trim();
|
|
186
|
+
if (trimmed === '') return;
|
|
187
|
+
let signal;
|
|
188
|
+
try {
|
|
189
|
+
signal = JSON.parse(trimmed);
|
|
190
|
+
validateSignal(signal);
|
|
191
|
+
} catch (error) {
|
|
192
|
+
errors.push({ line: index + 1, reason: error instanceof Error ? error.message : String(error) });
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (signal.status === 'rejected' || signal.status === 'rolled_back') return;
|
|
196
|
+
const entry = groups.get(signal.signature) ?? { signature: signal.signature, slugs: new Set(), count: 0 };
|
|
197
|
+
entry.slugs.add(signal.slug);
|
|
198
|
+
entry.count += 1;
|
|
199
|
+
groups.set(signal.signature, entry);
|
|
200
|
+
});
|
|
201
|
+
return {
|
|
202
|
+
groups: [...groups.values()]
|
|
203
|
+
.map((entry) => ({
|
|
204
|
+
signature: entry.signature,
|
|
205
|
+
distinctSlugCount: entry.slugs.size,
|
|
206
|
+
slugs: [...entry.slugs].sort(),
|
|
207
|
+
count: entry.count,
|
|
208
|
+
}))
|
|
209
|
+
.sort((a, b) => a.signature.localeCompare(b.signature)),
|
|
210
|
+
errors,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// --- Append CLI (O1a) ---------------------------------------------------------
|
|
215
|
+
|
|
216
|
+
const CLI_USAGE = `Usage: node .ai.local/scripts/signals.mjs --append <json|file>
|
|
217
|
+
|
|
218
|
+
Append one signal to .ai.local/signals.jsonl under the advisory lock.
|
|
219
|
+
|
|
220
|
+
--append <json> inline JSON signal object (the arg starts with '{')
|
|
221
|
+
--append <file> path to a file containing a single JSON signal object
|
|
222
|
+
|
|
223
|
+
The signal is validated via validateSignal then appended via appendSignal.
|
|
224
|
+
Exits non-zero on invalid input and leaves the store untouched.
|
|
225
|
+
`;
|
|
226
|
+
|
|
227
|
+
// CLI entry: `node signals.mjs --append <json|file>`. Reuses `validateSignal` +
|
|
228
|
+
// `appendSignal`; the capture write stays byte-identical to the library path.
|
|
229
|
+
//
|
|
230
|
+
// The `-e`/`--eval` exclusion keeps this from firing when the module is loaded
|
|
231
|
+
// as a library by an eval child that passes this path as `process.argv[1]`
|
|
232
|
+
// (the concurrency suite's `import(process.argv[1])` pattern) — that is a
|
|
233
|
+
// library import, not a CLI invocation.
|
|
234
|
+
if (
|
|
235
|
+
process.argv[1]
|
|
236
|
+
&& import.meta.url === pathToFileURL(process.argv[1]).href
|
|
237
|
+
&& !process.execArgv.some((flag) => flag === '-e' || flag === '--eval')
|
|
238
|
+
) {
|
|
239
|
+
const args = process.argv.slice(2);
|
|
240
|
+
if (args.length !== 2 || args[0] !== '--append') {
|
|
241
|
+
process.stderr.write(CLI_USAGE);
|
|
242
|
+
process.exitCode = 1;
|
|
243
|
+
} else {
|
|
244
|
+
const value = args[1];
|
|
245
|
+
try {
|
|
246
|
+
const signal = value.startsWith('{')
|
|
247
|
+
? JSON.parse(value)
|
|
248
|
+
: JSON.parse(fs.readFileSync(value, 'utf8'));
|
|
249
|
+
appendSignal(signal);
|
|
250
|
+
process.stdout.write(`${JSON.stringify(signal)}\n`);
|
|
251
|
+
} catch (error) {
|
|
252
|
+
process.stderr.write(`error: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
253
|
+
process.exitCode = 1;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
@@ -121,7 +121,7 @@ Each producing agent runs a **pre-receipt self-review** of its own output — go
|
|
|
121
121
|
|
|
122
122
|
- **Context loss vs excess/noise.** *Loss* = a dropped/misattributed AC or constraint, a stale plan vs the current request, a forgotten prior decision. *Excess/noise* = irrelevant/tangent reads, scope creep beyond the frame, duplicated or bloated artifacts, chat state that belongs on disk.
|
|
123
123
|
- **Re-anchor.** On detected drift, return the run to the framed task: re-read the `task-framing` goal frame + the current `decomposition.md` → repair the drift → re-run the affected gate → record append-only in `.memlog.md` (`event:` line; `decision: replan rev N → N+1` when the plan changes). Re-anchor is a **trigger source of the existing `plan-graph` `replan`** — no second orchestrator, no `status.json`/`metrics.json` field.
|
|
124
|
-
- **Recording & ratchet.** The producer writes a `## Self-review` block in the artifact it owns; the correction lives only in `.memlog.md` (hook-only lifecycle preserved). No self-review, context-health pass, or re-anchor for `bounded`/`spike` tasks (or the `light` profile) — ratchet up for `standard`/`architectural`, never down past a required verification gate. See the requestable `quality/self-review-and-context-hygiene` contract — including the optional
|
|
124
|
+
- **Recording & ratchet.** The producer writes a `## Self-review` block in the artifact it owns; the correction lives only in `.memlog.md` (hook-only lifecycle preserved). No self-review, context-health pass, or re-anchor for `bounded`/`spike` tasks (or the `light` profile) — ratchet up for `standard`/`architectural`, never down past a required verification gate. See the requestable `quality/self-review-and-context-hygiene` contract — including the optional loop. In-task self-learning loop: run `node .ai.local/scripts/run.mjs` at the pre-receipt self-review when the engine exists; capture one wrong-turn with `node .ai.local/scripts/signals.mjs --append '<json>'` and inspect read-only with `node .ai.local/scripts/run.mjs --status`.
|
|
125
125
|
|
|
126
126
|
## status.json (pipeline mode)
|
|
127
127
|
|
|
@@ -44,15 +44,16 @@ multi-wave work). It ratchets down for bounded/spike tasks (see § Ratchet).
|
|
|
44
44
|
(`event:` line; or `decision: replan rev N → N+1` when the plan changes).
|
|
45
45
|
- Adds **no** `status.json` / `metrics.json` field (hook-only lifecycle preserved).
|
|
46
46
|
|
|
47
|
-
## In-task
|
|
47
|
+
## In-task self-learning loop (optional)
|
|
48
48
|
|
|
49
|
-
- **Opt-in and conditional — only when
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- The
|
|
49
|
+
- **Opt-in and conditional — only when the engine exists.** In-task self-learning loop: run
|
|
50
|
+
`node .ai.local/scripts/run.mjs` at the pre-receipt self-review when the engine exists; capture one wrong-turn
|
|
51
|
+
with `node .ai.local/scripts/signals.mjs --append '<json>'` and inspect read-only with
|
|
52
|
+
`node .ai.local/scripts/run.mjs --status`.
|
|
53
|
+
- The engine enforces the Rule of Three (≥2 distinct tasks → edit a local rule or `conventions.md` gotcha; ≥3 →
|
|
54
54
|
stage a new rule) and applies or stages per the two-band autonomy policy. Never count the threshold by hand; never
|
|
55
|
-
edit the
|
|
55
|
+
edit the engine. Engine absent → nothing to run; say so in the receipt instead of guessing. Not a new pipeline
|
|
56
|
+
step and not a lifecycle field.
|
|
56
57
|
- **Ratchet.** Inherits the § Ratchet — `bounded`/`spike`/`light` tasks skip this exactly as they skip self-review.
|
|
57
58
|
|
|
58
59
|
## Ratchet (bounded / spike)
|
|
@@ -5,6 +5,11 @@ The 40 committed hooks are artifacts: **never** edit one by hand, and never add
|
|
|
5
5
|
hook body under a `presets/<platform>` tree. `init` copies the rendered hooks
|
|
6
6
|
only — `presets/_shared/**` is not a preset, so nothing here ships to consumers.
|
|
7
7
|
|
|
8
|
+
`check-preset-update.mjs` is the other shared hook. It is copied verbatim into
|
|
9
|
+
every platform stack (`yarn fix:generated`); do not edit a copy. Cursor wires it
|
|
10
|
+
on `sessionStart`, Claude on `SessionStart`. Mavis and OpenCode ship the file
|
|
11
|
+
for the agent to run on the first reply.
|
|
12
|
+
|
|
8
13
|
## What the template owns
|
|
9
14
|
|
|
10
15
|
`chain-team-phases.sh.tmpl` is the whole hook body (contract machinery, A1 seed,
|