@bonesofspring/ai-rules 0.2.51 → 0.2.52
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 +68 -0
- package/bin/cli.js +14 -1
- package/bin/lib/ai-local-drift.js +55 -14
- package/bin/lib/seed-ai-local-team.js +18 -7
- package/bin/mavis-install.js +2 -0
- package/bin/opencode-install.js +2 -0
- package/docs/LOCAL-OVERLAY.md +1 -1
- package/docs/PRESET-CONTRIBUTION.md +11 -9
- package/package.json +5 -1
- package/presets/_shared/ai-local/scripts/manifest.mjs +13 -3
- package/presets/_shared/ai-local/scripts/rule-improver.mjs +428 -91
- package/presets/_shared/ai-local/scripts/run.mjs +22 -4
- package/presets/_shared/ai-local/scripts/signals.mjs +4 -1
- package/presets/_shared/core/meta/preset-pr-checklist.md +1 -1
- package/presets/_shared/core/quality/interactive-questions.md +8 -8
- package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -0
- package/presets/claude/android-kotlin/rules/tooling-and-review/interactive-questions.md +8 -8
- package/presets/claude/android-kotlin/rules/tooling-and-review/language-policy.md +1 -1
- package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/go/agents/code-reviewer.md +1 -0
- package/presets/claude/go/rules/tooling-and-review/interactive-questions.md +8 -8
- package/presets/claude/go/rules/tooling-and-review/language-policy.md +1 -1
- package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/ios-swift/agents/code-reviewer.md +1 -0
- package/presets/claude/ios-swift/rules/tooling-and-review/interactive-questions.md +8 -8
- package/presets/claude/ios-swift/rules/tooling-and-review/language-policy.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/post-change-build.md +1 -1
- package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/java/agents/code-reviewer.md +1 -0
- package/presets/claude/java/rules/tooling-and-review/interactive-questions.md +8 -8
- package/presets/claude/java/rules/tooling-and-review/language-policy.md +1 -1
- package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/interactive-questions.md +8 -8
- package/presets/claude/mcp-ts/rules/tooling-and-review/language-policy.md +1 -1
- package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/next/MCP.md +7 -0
- package/presets/claude/next/README.md +1 -1
- package/presets/claude/next/REPO_AGENTS.md +1 -1
- package/presets/claude/next/agents/README.md +3 -3
- package/presets/claude/next/agents/build-verifier.md +9 -3
- package/presets/claude/next/agents/code-reviewer.md +2 -1
- package/presets/claude/next/agents/codebase-analyzer.md +1 -1
- package/presets/claude/next/agents/feature-developer.md +18 -8
- package/presets/claude/next/agents/openspec-author.md +1 -1
- package/presets/claude/next/agents/playwright-test-generator.md +22 -68
- package/presets/claude/next/agents/playwright-test-healer.md +27 -54
- package/presets/claude/next/agents/playwright-test-planner.md +18 -51
- package/presets/claude/next/agents/task-analyst.md +25 -9
- package/presets/claude/next/agents/task-router.md +1 -1
- package/presets/claude/next/agents/tech-writer.md +1 -1
- package/presets/claude/next/mcp.json +3 -3
- package/presets/claude/next/rules/anti-hallucination/react-next-anti-hallucination.md +1 -1
- package/presets/claude/next/rules/architecture/layer-barrel-exports.md +1 -1
- package/presets/claude/next/rules/architecture/reference-features.md +1 -1
- package/presets/claude/next/rules/stack/navigation-router-ui.md +1 -1
- package/presets/claude/next/rules/stack/navigation-router.md +14 -0
- package/presets/claude/next/rules/stack/next-app-core.md +19 -17
- package/presets/claude/next/rules/stack/next-app-router.md +5 -17
- package/presets/claude/next/rules/stack/next-static-export.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/interactive-questions.md +8 -8
- package/presets/claude/next/rules/tooling-and-review/language-policy.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/security-next.md +28 -3
- package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +1 -1
- package/presets/claude/next/rules/ui-and-accessibility/design-tokens-binding.md +4 -4
- package/presets/claude/next/rules/ui-and-accessibility/forms-validation.md +2 -2
- package/presets/claude/next/team/README.md +11 -0
- package/presets/claude/next/team/fixtures/feature-with-figma-url.json +10 -0
- package/presets/claude/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
- package/presets/claude/next/team/fixtures/mockup-review-standalone.json +9 -0
- package/presets/claude/next/team/fixtures/ux-design-standalone.json +9 -0
- package/presets/claude/nuxt/agents/code-reviewer.md +1 -0
- package/presets/claude/nuxt/rules/architecture/layer-barrel-exports.md +1 -1
- package/presets/claude/nuxt/rules/stack/navigation-router-ui.md +1 -1
- package/presets/claude/nuxt/rules/tooling-and-review/interactive-questions.md +8 -8
- package/presets/claude/nuxt/rules/tooling-and-review/language-policy.md +1 -1
- package/presets/claude/nuxt/rules/tooling-and-review/post-change-lint.md +1 -1
- package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -0
- package/presets/claude/php-hexagonal/rules/tooling-and-review/interactive-questions.md +8 -8
- package/presets/claude/php-hexagonal/rules/tooling-and-review/language-policy.md +1 -1
- package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/php-laravel/agents/code-reviewer.md +1 -0
- package/presets/claude/php-laravel/rules/tooling-and-review/interactive-questions.md +8 -8
- package/presets/claude/php-laravel/rules/tooling-and-review/language-policy.md +1 -1
- package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/claude/svelte/agents/code-reviewer.md +1 -0
- package/presets/claude/svelte/rules/architecture/layer-barrel-exports.md +1 -1
- package/presets/claude/svelte/rules/tooling-and-review/interactive-questions.md +8 -8
- package/presets/claude/svelte/rules/tooling-and-review/language-policy.md +1 -1
- package/presets/claude/svelte/rules/tooling-and-review/post-change-lint.md +1 -1
- package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +1 -1
- package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -0
- package/presets/cursor/android-kotlin/rules/README.md +1 -0
- package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +3 -3
- package/presets/cursor/android-kotlin/rules/interactive-questions.mdc +8 -8
- package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/go/agents/code-reviewer.md +1 -0
- package/presets/cursor/go/rules/agent-team-orchestrator.mdc +2 -2
- package/presets/cursor/go/rules/interactive-questions.mdc +8 -8
- package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -0
- package/presets/cursor/ios-swift/rules/README.md +1 -0
- package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +3 -3
- package/presets/cursor/ios-swift/rules/interactive-questions.mdc +8 -8
- package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/java/agents/code-reviewer.md +1 -0
- package/presets/cursor/java/rules/agent-team-orchestrator.mdc +2 -2
- package/presets/cursor/java/rules/interactive-questions.mdc +8 -8
- package/presets/cursor/java/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +2 -2
- package/presets/cursor/mcp-ts/rules/interactive-questions.mdc +8 -8
- package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/next/MCP.md +7 -0
- package/presets/cursor/next/REPO_AGENTS.md +1 -1
- package/presets/cursor/next/agents/code-reviewer.md +1 -0
- package/presets/cursor/next/agents/playwright-test-healer.md +1 -0
- package/presets/cursor/next/ai-local/rules-library/router-pages.md +5 -5
- package/presets/cursor/next/mcp.json +3 -3
- package/presets/cursor/next/rules/README.md +1 -1
- package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/next/rules/css-property-order-stylelint.mdc +1 -1
- package/presets/cursor/next/rules/design-tokens-binding.mdc +4 -4
- package/presets/cursor/next/rules/forms-validation.mdc +2 -2
- package/presets/cursor/next/rules/interactive-questions.mdc +8 -8
- package/presets/cursor/next/rules/navigation-router-stack.mdc +14 -1
- package/presets/cursor/next/rules/next-app-core.mdc +19 -17
- package/presets/cursor/next/rules/next-app-router.mdc +5 -17
- package/presets/cursor/next/rules/next-static-export.mdc +1 -1
- package/presets/cursor/next/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/next/rules/preset-token-budget.mdc +1 -1
- package/presets/cursor/next/rules/react-next-anti-hallucination.mdc +1 -1
- package/presets/cursor/next/rules/reference-features.mdc +1 -1
- package/presets/cursor/next/rules/security-next.mdc +28 -3
- package/presets/cursor/next/team/README.md +11 -0
- package/presets/cursor/next/team/fixtures/feature-with-figma-url.json +10 -0
- package/presets/cursor/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
- package/presets/cursor/next/team/fixtures/mockup-review-standalone.json +9 -0
- package/presets/cursor/next/team/fixtures/ux-design-standalone.json +9 -0
- package/presets/cursor/nuxt/agents/code-reviewer.md +1 -0
- package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/nuxt/rules/interactive-questions.mdc +8 -8
- package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -0
- package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +2 -2
- package/presets/cursor/php-hexagonal/rules/interactive-questions.mdc +8 -8
- package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -0
- package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +2 -2
- package/presets/cursor/php-laravel/rules/interactive-questions.mdc +8 -8
- package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +1 -1
- package/presets/cursor/svelte/agents/code-reviewer.md +1 -0
- package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
- package/presets/cursor/svelte/rules/interactive-questions.mdc +8 -8
- package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +1 -1
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -0
- package/presets/mavis/android-kotlin/rules/interactive-questions.md +8 -8
- package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/go/adapter-map.json +1 -1
- package/presets/mavis/go/agents/code-reviewer.md +1 -0
- package/presets/mavis/go/rules/interactive-questions.md +8 -8
- package/presets/mavis/go/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/ios-swift/adapter-map.json +1 -1
- package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -0
- package/presets/mavis/ios-swift/rules/interactive-questions.md +8 -8
- package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/java/adapter-map.json +1 -1
- package/presets/mavis/java/agents/code-reviewer.md +1 -0
- package/presets/mavis/java/rules/interactive-questions.md +8 -8
- package/presets/mavis/java/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/mcp-ts/adapter-map.json +1 -1
- package/presets/mavis/mcp-ts/rules/interactive-questions.md +8 -8
- package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/next/MCP.md +7 -0
- package/presets/mavis/next/REPO_AGENTS.md +1 -1
- package/presets/mavis/next/adapter-map.json +1 -1
- package/presets/mavis/next/agents/code-reviewer.md +1 -0
- package/presets/mavis/next/agents/playwright-test-healer.md +1 -0
- package/presets/mavis/next/ai-local/rules-library/router-pages.md +5 -5
- package/presets/mavis/next/mcp.json +3 -3
- package/presets/mavis/next/rules/css-property-order-stylelint.md +1 -1
- package/presets/mavis/next/rules/design-tokens-binding.md +4 -4
- package/presets/mavis/next/rules/forms-validation.md +2 -2
- package/presets/mavis/next/rules/interactive-questions.md +8 -8
- package/presets/mavis/next/rules/navigation-router-stack.md +12 -0
- package/presets/mavis/next/rules/next-app-core.md +18 -17
- package/presets/mavis/next/rules/next-app-router.md +4 -17
- package/presets/mavis/next/rules/next-static-export.md +1 -1
- package/presets/mavis/next/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/next/rules/react-next-anti-hallucination.md +1 -1
- package/presets/mavis/next/rules/reference-features.md +1 -1
- package/presets/mavis/next/rules/security-next.md +24 -3
- package/presets/mavis/next/team/README.md +11 -0
- package/presets/mavis/next/team/fixtures/feature-with-figma-url.json +10 -0
- package/presets/mavis/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
- package/presets/mavis/next/team/fixtures/mockup-review-standalone.json +9 -0
- package/presets/mavis/next/team/fixtures/ux-design-standalone.json +9 -0
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/agents/code-reviewer.md +1 -0
- package/presets/mavis/nuxt/rules/interactive-questions.md +8 -8
- package/presets/mavis/nuxt/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
- package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -0
- package/presets/mavis/php-hexagonal/rules/interactive-questions.md +8 -8
- package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/php-laravel/adapter-map.json +1 -1
- package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -0
- package/presets/mavis/php-laravel/rules/interactive-questions.md +8 -8
- package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +1 -1
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/agents/code-reviewer.md +1 -0
- package/presets/mavis/svelte/rules/interactive-questions.md +8 -8
- package/presets/mavis/svelte/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/android-kotlin/adapter-map.json +1 -1
- package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -0
- package/presets/opencode/android-kotlin/rules/interactive-questions.md +8 -8
- package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/go/adapter-map.json +1 -1
- package/presets/opencode/go/agents/code-reviewer.md +1 -0
- package/presets/opencode/go/rules/interactive-questions.md +8 -8
- package/presets/opencode/go/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/ios-swift/adapter-map.json +1 -1
- package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -0
- package/presets/opencode/ios-swift/rules/interactive-questions.md +8 -8
- package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/java/adapter-map.json +1 -1
- package/presets/opencode/java/agents/code-reviewer.md +1 -0
- package/presets/opencode/java/rules/interactive-questions.md +8 -8
- package/presets/opencode/java/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/mcp-ts/adapter-map.json +1 -1
- package/presets/opencode/mcp-ts/rules/interactive-questions.md +8 -8
- package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/next/MCP.md +7 -0
- package/presets/opencode/next/REPO_AGENTS.md +1 -1
- package/presets/opencode/next/adapter-map.json +1 -1
- package/presets/opencode/next/agents/code-reviewer.md +1 -0
- package/presets/opencode/next/agents/playwright-test-healer.md +1 -0
- package/presets/opencode/next/ai-local/rules-library/router-pages.md +5 -5
- package/presets/opencode/next/opencode.json +3 -3
- package/presets/opencode/next/rules/css-property-order-stylelint.md +1 -1
- package/presets/opencode/next/rules/design-tokens-binding.md +4 -4
- package/presets/opencode/next/rules/forms-validation.md +2 -2
- package/presets/opencode/next/rules/interactive-questions.md +8 -8
- package/presets/opencode/next/rules/navigation-router-stack.md +12 -0
- package/presets/opencode/next/rules/next-app-core.md +18 -17
- package/presets/opencode/next/rules/next-app-router.md +4 -17
- package/presets/opencode/next/rules/next-static-export.md +1 -1
- package/presets/opencode/next/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/next/rules/react-next-anti-hallucination.md +1 -1
- package/presets/opencode/next/rules/reference-features.md +1 -1
- package/presets/opencode/next/rules/security-next.md +24 -3
- package/presets/opencode/next/team/README.md +11 -0
- package/presets/opencode/next/team/fixtures/feature-with-figma-url.json +10 -0
- package/presets/opencode/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
- package/presets/opencode/next/team/fixtures/mockup-review-standalone.json +9 -0
- package/presets/opencode/next/team/fixtures/ux-design-standalone.json +9 -0
- package/presets/opencode/nuxt/adapter-map.json +1 -1
- package/presets/opencode/nuxt/agents/code-reviewer.md +1 -0
- package/presets/opencode/nuxt/rules/interactive-questions.md +8 -8
- package/presets/opencode/nuxt/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
- package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -0
- package/presets/opencode/php-hexagonal/rules/interactive-questions.md +8 -8
- package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/php-laravel/adapter-map.json +1 -1
- package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -0
- package/presets/opencode/php-laravel/rules/interactive-questions.md +8 -8
- package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +1 -1
- package/presets/opencode/svelte/adapter-map.json +1 -1
- package/presets/opencode/svelte/agents/code-reviewer.md +1 -0
- package/presets/opencode/svelte/rules/interactive-questions.md +8 -8
- package/presets/opencode/svelte/rules/preset-pr-checklist.md +1 -1
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
MAX_ACTIVE_RULES,
|
|
32
32
|
MAX_TOTAL_LINES,
|
|
33
33
|
canonicalSignature,
|
|
34
|
-
|
|
34
|
+
collectScriptReport,
|
|
35
35
|
countRulesAndLines,
|
|
36
36
|
evaluateEnvelope,
|
|
37
37
|
formatLessonStatus,
|
|
@@ -210,6 +210,8 @@ export function statusReport({ baseDir = DEFAULT_BASE_DIR } = {}) {
|
|
|
210
210
|
const signalsPath = path.join(baseDir, 'signals.jsonl');
|
|
211
211
|
const rulesDir = path.join(baseDir, 'rules');
|
|
212
212
|
const conventionsPath = path.join(baseDir, 'conventions.md');
|
|
213
|
+
// The engine resolves lesson paths against the overlay's project root, so
|
|
214
|
+
// the status report must use the same root or it reports a different lesson.
|
|
213
215
|
const rootDir = path.dirname(baseDir);
|
|
214
216
|
const aliasPath = path.join(baseDir, 'signature-aliases.json');
|
|
215
217
|
const catalogPath = path.join(baseDir, 'signature-catalog.json');
|
|
@@ -219,7 +221,8 @@ export function statusReport({ baseDir = DEFAULT_BASE_DIR } = {}) {
|
|
|
219
221
|
const canonical = (signature) => canonicalSignature(signature, aliasLoad.aliases);
|
|
220
222
|
const { groups, errors } = groupSignatures({ signalsPath, canonical });
|
|
221
223
|
const catalogLoad = loadCatalog(catalogPath);
|
|
222
|
-
const
|
|
224
|
+
const scriptReport = collectScriptReport(rootDir);
|
|
225
|
+
const scriptNames = scriptReport.names;
|
|
223
226
|
const signalsByGroup = signalsByCanonicalSignature({ signalsPath, canonical });
|
|
224
227
|
const lastCapture = lastCaptureBySignature({ signalsPath });
|
|
225
228
|
const storeLineCount = groups.reduce((total, group) => total + group.count, 0);
|
|
@@ -231,8 +234,17 @@ export function statusReport({ baseDir = DEFAULT_BASE_DIR } = {}) {
|
|
|
231
234
|
? 'empty — 0 signals captured'
|
|
232
235
|
: `ok — ${storeLineCount} signal(s), ${errors.length} malformed line(s)`;
|
|
233
236
|
|
|
234
|
-
|
|
235
|
-
|
|
237
|
+
// The engine fails closed on an unreadable rule; the read-only report must
|
|
238
|
+
// still print, so the envelope degrades to `unreadable` instead of throwing.
|
|
239
|
+
let envelope;
|
|
240
|
+
let envelopeState;
|
|
241
|
+
try {
|
|
242
|
+
envelope = countRulesAndLines({ rulesDir, conventionsPath });
|
|
243
|
+
envelopeState = evaluateEnvelope({ ruleCount: envelope.ruleCount, lineCount: envelope.lineCount });
|
|
244
|
+
} catch (error) {
|
|
245
|
+
envelope = { ruleCount: 0, lineCount: 0 };
|
|
246
|
+
envelopeState = { reason: `unreadable — ${error instanceof Error ? error.message : String(error)}` };
|
|
247
|
+
}
|
|
236
248
|
const pending = deriveGateSignals({ baseDir }).signals.length;
|
|
237
249
|
|
|
238
250
|
const lines = ['Self-learning loop — status (read-only)', ''];
|
|
@@ -244,6 +256,12 @@ export function statusReport({ baseDir = DEFAULT_BASE_DIR } = {}) {
|
|
|
244
256
|
for (const error of errors) {
|
|
245
257
|
lines.push(` - malformed store line ${error.line}: ${error.reason}`);
|
|
246
258
|
}
|
|
259
|
+
for (const error of scriptReport.errors) {
|
|
260
|
+
lines.push(` - package scripts: ${error}`);
|
|
261
|
+
}
|
|
262
|
+
if (catalogLoad.error) {
|
|
263
|
+
lines.push(` - signature catalog: ${catalogLoad.error}`);
|
|
264
|
+
}
|
|
247
265
|
|
|
248
266
|
if (groups.length === 0) {
|
|
249
267
|
lines.push('');
|
|
@@ -182,7 +182,10 @@ export function appendSignal(signal, { signalsPath = DEFAULT_SIGNALS_PATH, dedup
|
|
|
182
182
|
fs.writeSync(fd, existing + `${JSON.stringify(signal)}\n`);
|
|
183
183
|
try { fs.fsyncSync(fd); } catch {}
|
|
184
184
|
} finally {
|
|
185
|
-
fs.closeSync(fd);
|
|
185
|
+
try { fs.closeSync(fd); } catch (error) {
|
|
186
|
+
try { fs.unlinkSync(temporary); } catch { /* the close error is the one to surface */ }
|
|
187
|
+
throw error;
|
|
188
|
+
}
|
|
186
189
|
}
|
|
187
190
|
fs.renameSync(temporary, signalsPath);
|
|
188
191
|
return { path: signalsPath, signal, appended: true };
|
|
@@ -25,7 +25,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
|
|
|
25
25
|
- [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
|
|
26
26
|
- [ ] **Packaging:** every installable preset ships `REPO_AGENTS.md`; default `hooks.json` does not reference `hooks/examples/`; `_shared/assets/docs-specs/` ships `INDEX.md` + `_templates/{page,feature}.md`; `product-specs` / `product-specs-authoring` stay requestable
|
|
27
27
|
- [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
|
|
28
|
-
- [ ] **Rule eval (
|
|
28
|
+
- [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
|
|
29
29
|
- [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn check:preset-structure`. Every role loads `anti-hallucination-contract`. Writer roles, including `code-reviewer`, also load `STACK_FLOOR_STEMS`. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`) or the gate FAILs.
|
|
30
30
|
- [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
|
|
31
31
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Interactive questions (requestable)
|
|
2
2
|
|
|
3
|
-
How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool
|
|
3
|
+
How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool. The always-on quality rule keeps the short preference; this file carries the full contract.
|
|
4
4
|
|
|
5
5
|
## When to ask
|
|
6
6
|
|
|
@@ -10,16 +10,16 @@ How to put a user-only decision to the user. Load when the answer blocks the wor
|
|
|
10
10
|
|
|
11
11
|
## Widget format
|
|
12
12
|
|
|
13
|
-
4. **Header** → a short label
|
|
14
|
-
5. **Option label** →
|
|
13
|
+
4. **Header** → a short label. Stay inside the host schema's length limit.
|
|
14
|
+
5. **Option label** → a few words, in the user's terms, inside the host schema's label limit.
|
|
15
15
|
6. **Option description** → the consequence or the trade-off, not a restatement of the label.
|
|
16
|
-
7. **
|
|
17
|
-
8. **Multi-select** only when the choices are not mutually exclusive.
|
|
16
|
+
7. **Option count** → the host schema's range. Put the option you recommend first and justify it in its description; do not pad the list with options you cannot defend.
|
|
17
|
+
8. **Multi-select** only when the choices are not mutually exclusive. A free-form entry the host adds itself does not count toward the range.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Free-form is a property of the host
|
|
20
20
|
|
|
21
|
-
9.
|
|
22
|
-
10. A host
|
|
21
|
+
9. Use the host's free-form channel. When that channel already accepts typed text, do not add an option labeled "Other": a plain option returns its label, and the typed text belongs in the host's free-form field.
|
|
22
|
+
10. A host with no free-form channel (an enum that returns only the selected label, a headless run) needs an explicit "Other" whose selection opens a text prompt — or prose when the answer cannot be enumerated.
|
|
23
23
|
|
|
24
24
|
## Fallback
|
|
25
25
|
|
|
@@ -91,6 +91,7 @@ Findings carry `path:line`, severity, `confidence`, and a fix direction — rule
|
|
|
91
91
|
## Depth passes
|
|
92
92
|
| Pass | Outcome | Evidence or reason |
|
|
93
93
|
|------|---------|--------------------|
|
|
94
|
+
| Call-site sweep | `no finding` | what was searched or read |
|
|
94
95
|
|
|
95
96
|
## AC coverage
|
|
96
97
|
| Criterion | Status | Notes |
|
|
@@ -7,7 +7,7 @@ paths: []
|
|
|
7
7
|
|
|
8
8
|
# Interactive questions (requestable)
|
|
9
9
|
|
|
10
|
-
How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool
|
|
10
|
+
How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool. The always-on quality rule keeps the short preference; this file carries the full contract.
|
|
11
11
|
|
|
12
12
|
## When to ask
|
|
13
13
|
|
|
@@ -17,16 +17,16 @@ How to put a user-only decision to the user. Load when the answer blocks the wor
|
|
|
17
17
|
|
|
18
18
|
## Widget format
|
|
19
19
|
|
|
20
|
-
4. **Header** → a short label
|
|
21
|
-
5. **Option label** →
|
|
20
|
+
4. **Header** → a short label. Stay inside the host schema's length limit.
|
|
21
|
+
5. **Option label** → a few words, in the user's terms, inside the host schema's label limit.
|
|
22
22
|
6. **Option description** → the consequence or the trade-off, not a restatement of the label.
|
|
23
|
-
7. **
|
|
24
|
-
8. **Multi-select** only when the choices are not mutually exclusive.
|
|
23
|
+
7. **Option count** → the host schema's range. Put the option you recommend first and justify it in its description; do not pad the list with options you cannot defend.
|
|
24
|
+
8. **Multi-select** only when the choices are not mutually exclusive. A free-form entry the host adds itself does not count toward the range.
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Free-form is a property of the host
|
|
27
27
|
|
|
28
|
-
9.
|
|
29
|
-
10. A host
|
|
28
|
+
9. Use the host's free-form channel. When that channel already accepts typed text, do not add an option labeled "Other": a plain option returns its label, and the typed text belongs in the host's free-form field.
|
|
29
|
+
10. A host with no free-form channel (an enum that returns only the selected label, a headless run) needs an explicit "Other" whose selection opens a text prompt — or prose when the answer cannot be enumerated.
|
|
30
30
|
|
|
31
31
|
## Fallback
|
|
32
32
|
|
|
@@ -35,7 +35,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
|
|
|
35
35
|
- [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
|
|
36
36
|
- [ ] **Packaging:** every installable preset ships `REPO_AGENTS.md`; default `hooks.json` does not reference `hooks/examples/`; `_shared/assets/docs-specs/` ships `INDEX.md` + `_templates/{page,feature}.md`; `product-specs` / `product-specs-authoring` stay requestable
|
|
37
37
|
- [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
|
|
38
|
-
- [ ] **Rule eval (
|
|
38
|
+
- [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
|
|
39
39
|
- [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn check:preset-structure`. Every role loads `anti-hallucination-contract`. Writer roles, including `code-reviewer`, also load `STACK_FLOOR_STEMS`. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`) or the gate FAILs.
|
|
40
40
|
- [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
|
|
41
41
|
|
|
@@ -90,6 +90,7 @@ Findings carry `path:line`, severity, `confidence`, and a fix direction — rule
|
|
|
90
90
|
## Depth passes
|
|
91
91
|
| Pass | Outcome | Evidence or reason |
|
|
92
92
|
|------|---------|--------------------|
|
|
93
|
+
| Call-site sweep | `no finding` | what was searched or read |
|
|
93
94
|
|
|
94
95
|
## AC coverage
|
|
95
96
|
| Criterion | Status | Notes |
|
|
@@ -7,7 +7,7 @@ paths: []
|
|
|
7
7
|
|
|
8
8
|
# Interactive questions (requestable)
|
|
9
9
|
|
|
10
|
-
How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool
|
|
10
|
+
How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool. The always-on quality rule keeps the short preference; this file carries the full contract.
|
|
11
11
|
|
|
12
12
|
## When to ask
|
|
13
13
|
|
|
@@ -17,16 +17,16 @@ How to put a user-only decision to the user. Load when the answer blocks the wor
|
|
|
17
17
|
|
|
18
18
|
## Widget format
|
|
19
19
|
|
|
20
|
-
4. **Header** → a short label
|
|
21
|
-
5. **Option label** →
|
|
20
|
+
4. **Header** → a short label. Stay inside the host schema's length limit.
|
|
21
|
+
5. **Option label** → a few words, in the user's terms, inside the host schema's label limit.
|
|
22
22
|
6. **Option description** → the consequence or the trade-off, not a restatement of the label.
|
|
23
|
-
7. **
|
|
24
|
-
8. **Multi-select** only when the choices are not mutually exclusive.
|
|
23
|
+
7. **Option count** → the host schema's range. Put the option you recommend first and justify it in its description; do not pad the list with options you cannot defend.
|
|
24
|
+
8. **Multi-select** only when the choices are not mutually exclusive. A free-form entry the host adds itself does not count toward the range.
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Free-form is a property of the host
|
|
27
27
|
|
|
28
|
-
9.
|
|
29
|
-
10. A host
|
|
28
|
+
9. Use the host's free-form channel. When that channel already accepts typed text, do not add an option labeled "Other": a plain option returns its label, and the typed text belongs in the host's free-form field.
|
|
29
|
+
10. A host with no free-form channel (an enum that returns only the selected label, a headless run) needs an explicit "Other" whose selection opens a text prompt — or prose when the answer cannot be enumerated.
|
|
30
30
|
|
|
31
31
|
## Fallback
|
|
32
32
|
|
|
@@ -35,7 +35,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
|
|
|
35
35
|
- [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
|
|
36
36
|
- [ ] **Packaging:** every installable preset ships `REPO_AGENTS.md`; default `hooks.json` does not reference `hooks/examples/`; `_shared/assets/docs-specs/` ships `INDEX.md` + `_templates/{page,feature}.md`; `product-specs` / `product-specs-authoring` stay requestable
|
|
37
37
|
- [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
|
|
38
|
-
- [ ] **Rule eval (
|
|
38
|
+
- [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
|
|
39
39
|
- [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn check:preset-structure`. Every role loads `anti-hallucination-contract`. Writer roles, including `code-reviewer`, also load `STACK_FLOOR_STEMS`. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`) or the gate FAILs.
|
|
40
40
|
- [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
|
|
41
41
|
|
|
@@ -91,6 +91,7 @@ Findings carry `path:line`, severity, `confidence`, and a fix direction — rule
|
|
|
91
91
|
## Depth passes
|
|
92
92
|
| Pass | Outcome | Evidence or reason |
|
|
93
93
|
|------|---------|--------------------|
|
|
94
|
+
| Call-site sweep | `no finding` | what was searched or read |
|
|
94
95
|
|
|
95
96
|
## AC coverage
|
|
96
97
|
| Criterion | Status | Notes |
|
|
@@ -7,7 +7,7 @@ paths: []
|
|
|
7
7
|
|
|
8
8
|
# Interactive questions (requestable)
|
|
9
9
|
|
|
10
|
-
How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool
|
|
10
|
+
How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool. The always-on quality rule keeps the short preference; this file carries the full contract.
|
|
11
11
|
|
|
12
12
|
## When to ask
|
|
13
13
|
|
|
@@ -17,16 +17,16 @@ How to put a user-only decision to the user. Load when the answer blocks the wor
|
|
|
17
17
|
|
|
18
18
|
## Widget format
|
|
19
19
|
|
|
20
|
-
4. **Header** → a short label
|
|
21
|
-
5. **Option label** →
|
|
20
|
+
4. **Header** → a short label. Stay inside the host schema's length limit.
|
|
21
|
+
5. **Option label** → a few words, in the user's terms, inside the host schema's label limit.
|
|
22
22
|
6. **Option description** → the consequence or the trade-off, not a restatement of the label.
|
|
23
|
-
7. **
|
|
24
|
-
8. **Multi-select** only when the choices are not mutually exclusive.
|
|
23
|
+
7. **Option count** → the host schema's range. Put the option you recommend first and justify it in its description; do not pad the list with options you cannot defend.
|
|
24
|
+
8. **Multi-select** only when the choices are not mutually exclusive. A free-form entry the host adds itself does not count toward the range.
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Free-form is a property of the host
|
|
27
27
|
|
|
28
|
-
9.
|
|
29
|
-
10. A host
|
|
28
|
+
9. Use the host's free-form channel. When that channel already accepts typed text, do not add an option labeled "Other": a plain option returns its label, and the typed text belongs in the host's free-form field.
|
|
29
|
+
10. A host with no free-form channel (an enum that returns only the selected label, a headless run) needs an explicit "Other" whose selection opens a text prompt — or prose when the answer cannot be enumerated.
|
|
30
30
|
|
|
31
31
|
## Fallback
|
|
32
32
|
|
|
@@ -9,7 +9,7 @@ paths: []
|
|
|
9
9
|
|
|
10
10
|
After changes to Swift sources / Xcode project files / `Package.swift` that affect compilation or style.
|
|
11
11
|
|
|
12
|
-
Exceptions: docs-only, README, `.
|
|
12
|
+
Exceptions: docs-only, README, `.claude/rules/**` without app-code edits.
|
|
13
13
|
|
|
14
14
|
**Pipeline:** if the next step is a separate verifier/CI agent, touched targets are enough; in single-agent mode — a full reasonable run as in the repo.
|
|
15
15
|
|
|
@@ -35,7 +35,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
|
|
|
35
35
|
- [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
|
|
36
36
|
- [ ] **Packaging:** every installable preset ships `REPO_AGENTS.md`; default `hooks.json` does not reference `hooks/examples/`; `_shared/assets/docs-specs/` ships `INDEX.md` + `_templates/{page,feature}.md`; `product-specs` / `product-specs-authoring` stay requestable
|
|
37
37
|
- [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
|
|
38
|
-
- [ ] **Rule eval (
|
|
38
|
+
- [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
|
|
39
39
|
- [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn check:preset-structure`. Every role loads `anti-hallucination-contract`. Writer roles, including `code-reviewer`, also load `STACK_FLOOR_STEMS`. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`) or the gate FAILs.
|
|
40
40
|
- [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
|
|
41
41
|
|
|
@@ -90,6 +90,7 @@ Findings carry `path:line`, severity, `confidence`, and a fix direction — rule
|
|
|
90
90
|
## Depth passes
|
|
91
91
|
| Pass | Outcome | Evidence or reason |
|
|
92
92
|
|------|---------|--------------------|
|
|
93
|
+
| Call-site sweep | `no finding` | what was searched or read |
|
|
93
94
|
|
|
94
95
|
## AC coverage
|
|
95
96
|
| Criterion | Status | Notes |
|
|
@@ -7,7 +7,7 @@ paths: []
|
|
|
7
7
|
|
|
8
8
|
# Interactive questions (requestable)
|
|
9
9
|
|
|
10
|
-
How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool
|
|
10
|
+
How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool. The always-on quality rule keeps the short preference; this file carries the full contract.
|
|
11
11
|
|
|
12
12
|
## When to ask
|
|
13
13
|
|
|
@@ -17,16 +17,16 @@ How to put a user-only decision to the user. Load when the answer blocks the wor
|
|
|
17
17
|
|
|
18
18
|
## Widget format
|
|
19
19
|
|
|
20
|
-
4. **Header** → a short label
|
|
21
|
-
5. **Option label** →
|
|
20
|
+
4. **Header** → a short label. Stay inside the host schema's length limit.
|
|
21
|
+
5. **Option label** → a few words, in the user's terms, inside the host schema's label limit.
|
|
22
22
|
6. **Option description** → the consequence or the trade-off, not a restatement of the label.
|
|
23
|
-
7. **
|
|
24
|
-
8. **Multi-select** only when the choices are not mutually exclusive.
|
|
23
|
+
7. **Option count** → the host schema's range. Put the option you recommend first and justify it in its description; do not pad the list with options you cannot defend.
|
|
24
|
+
8. **Multi-select** only when the choices are not mutually exclusive. A free-form entry the host adds itself does not count toward the range.
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Free-form is a property of the host
|
|
27
27
|
|
|
28
|
-
9.
|
|
29
|
-
10. A host
|
|
28
|
+
9. Use the host's free-form channel. When that channel already accepts typed text, do not add an option labeled "Other": a plain option returns its label, and the typed text belongs in the host's free-form field.
|
|
29
|
+
10. A host with no free-form channel (an enum that returns only the selected label, a headless run) needs an explicit "Other" whose selection opens a text prompt — or prose when the answer cannot be enumerated.
|
|
30
30
|
|
|
31
31
|
## Fallback
|
|
32
32
|
|
|
@@ -35,7 +35,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
|
|
|
35
35
|
- [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
|
|
36
36
|
- [ ] **Packaging:** every installable preset ships `REPO_AGENTS.md`; default `hooks.json` does not reference `hooks/examples/`; `_shared/assets/docs-specs/` ships `INDEX.md` + `_templates/{page,feature}.md`; `product-specs` / `product-specs-authoring` stay requestable
|
|
37
37
|
- [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
|
|
38
|
-
- [ ] **Rule eval (
|
|
38
|
+
- [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
|
|
39
39
|
- [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn check:preset-structure`. Every role loads `anti-hallucination-contract`. Writer roles, including `code-reviewer`, also load `STACK_FLOOR_STEMS`. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`) or the gate FAILs.
|
|
40
40
|
- [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
|
|
41
41
|
|
|
@@ -7,7 +7,7 @@ paths: []
|
|
|
7
7
|
|
|
8
8
|
# Interactive questions (requestable)
|
|
9
9
|
|
|
10
|
-
How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool
|
|
10
|
+
How to put a user-only decision to the user. Load when the answer blocks the work and the host offers an interactive question tool. The always-on quality rule keeps the short preference; this file carries the full contract.
|
|
11
11
|
|
|
12
12
|
## When to ask
|
|
13
13
|
|
|
@@ -17,16 +17,16 @@ How to put a user-only decision to the user. Load when the answer blocks the wor
|
|
|
17
17
|
|
|
18
18
|
## Widget format
|
|
19
19
|
|
|
20
|
-
4. **Header** → a short label
|
|
21
|
-
5. **Option label** →
|
|
20
|
+
4. **Header** → a short label. Stay inside the host schema's length limit.
|
|
21
|
+
5. **Option label** → a few words, in the user's terms, inside the host schema's label limit.
|
|
22
22
|
6. **Option description** → the consequence or the trade-off, not a restatement of the label.
|
|
23
|
-
7. **
|
|
24
|
-
8. **Multi-select** only when the choices are not mutually exclusive.
|
|
23
|
+
7. **Option count** → the host schema's range. Put the option you recommend first and justify it in its description; do not pad the list with options you cannot defend.
|
|
24
|
+
8. **Multi-select** only when the choices are not mutually exclusive. A free-form entry the host adds itself does not count toward the range.
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Free-form is a property of the host
|
|
27
27
|
|
|
28
|
-
9.
|
|
29
|
-
10. A host
|
|
28
|
+
9. Use the host's free-form channel. When that channel already accepts typed text, do not add an option labeled "Other": a plain option returns its label, and the typed text belongs in the host's free-form field.
|
|
29
|
+
10. A host with no free-form channel (an enum that returns only the selected label, a headless run) needs an explicit "Other" whose selection opens a text prompt — or prose when the answer cannot be enumerated.
|
|
30
30
|
|
|
31
31
|
## Fallback
|
|
32
32
|
|
|
@@ -35,7 +35,7 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
|
|
|
35
35
|
- [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
|
|
36
36
|
- [ ] **Packaging:** every installable preset ships `REPO_AGENTS.md`; default `hooks.json` does not reference `hooks/examples/`; `_shared/assets/docs-specs/` ships `INDEX.md` + `_templates/{page,feature}.md`; `product-specs` / `product-specs-authoring` stay requestable
|
|
37
37
|
- [ ] **UI-only surfaces:** `mockup-reviewer`, `accessibility-reviewer`, `ux-design`, and the stack performance skill ship only on UI stacks (`check-preset-leakage.sh`)
|
|
38
|
-
- [ ] **Rule eval (
|
|
38
|
+
- [ ] **Rule eval (hard):** `node packages/ai-rules/scripts/check-rule-eval.mjs` runs inside `yarn check:preset-structure`; keep every registered golden stem paired
|
|
39
39
|
- [ ] **Anti-hallucination:** `check-anti-hallucination-coverage.mjs` is green inside `yarn check:preset-structure`. Every role loads `anti-hallucination-contract`. Writer roles, including `code-reviewer`, also load `STACK_FLOOR_STEMS`. Register a new skill family in `SKILL_CONTRACT_CLASS` (`writer` or `reader`) or the gate FAILs.
|
|
40
40
|
- [ ] **Gate:** `yarn check:preset-structure` from `packages/ai-rules/` (twin-map, token-budget, leakage, drift, i18n, local overlay, anti-hallucination coverage)
|
|
41
41
|
|
|
@@ -16,6 +16,13 @@ Do not commit secrets. Optional: `CONTEXT7_API_KEY`. Figma — local desktop ser
|
|
|
16
16
|
For the full Playwright Test Agents loop (`planner_*` / `generator_*` / `test_*`) additionally: `npx playwright init-agents --loop=claude` in an app with `@playwright/test`.
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
## Pin policy
|
|
20
|
+
|
|
21
|
+
- Pins live in `mcp.json` (Cursor, Claude) and in the generated `mcp` block of `opencode.json` — never in rule prose.
|
|
22
|
+
- Bump by reading the registry (`npm view <package> version`), editing `presets/cursor/next/mcp.json` and `presets/claude/next/mcp.json`, then running `yarn fix:generated` followed by `node scripts/test-cli-mcp-merge.mjs`, `node scripts/test-cli-init-clean.mjs`, and `node scripts/check-generated-drift.mjs`.
|
|
23
|
+
- Never write `@latest`. A package that fails to resolve, or that breaks the merge test, keeps its last working pin; record the exact command and the failure in the change that attempted the bump.
|
|
24
|
+
- A bumped pin changes the CLI goldens — recapture with `node scripts/capture-cli-golden.mjs <tool> next`; never edit a golden by hand.
|
|
25
|
+
|
|
19
26
|
## Agent usage
|
|
20
27
|
|
|
21
28
|
Load requestable rule `mcp-usage`. The **session MCP catalog** is source of truth (this file and `mcp.json` are hints). Discover tool schemas before calling; never invent them.
|
|
@@ -14,4 +14,4 @@ npx @bonesofspring/ai-rules init claude --preset next
|
|
|
14
14
|
| `REPO_AGENTS.md` | root `AGENTS.md` |
|
|
15
15
|
| `team/` | **`.ai.local/team/`** (shared; slugs preserved) |
|
|
16
16
|
|
|
17
|
-
Session-start (3–10, no `paths:`): `next-app-core`, `package-manager`, `code-quality`. Living gotchas: `.ai.local/conventions.md`. `/task` artifacts: `.ai.local/team/tasks/<slug>/`. No Bugbot — use skill `code-review`. Catalog: [`rules/README.md`](./rules/README.md).
|
|
17
|
+
Session-start (3–10, no `paths:`): `next-app-core`, `package-manager`, `code-quality` (`code-quality-and-refactoring`), `ai-local-overlay`. Living gotchas: `.ai.local/conventions.md`. `/task` artifacts: `.ai.local/team/tasks/<slug>/`. No Bugbot — use skill `code-review`. Catalog: [`rules/README.md`](./rules/README.md).
|
|
@@ -88,7 +88,7 @@ Gotchas, local patterns, and team decisions: **`.ai.local/conventions.md`** (fil
|
|
|
88
88
|
|
|
89
89
|
## Seed library (`.ai.local/rules-library/`)
|
|
90
90
|
|
|
91
|
-
`init` copies `ai-local/rules/*.md` into `.ai.local/rules/` and does not overwrite an existing file. The next stack ships `task-levels` there, so L0–L3 selection is active on install. `init` also copies `router-pages` into `.ai.local/rules/` when `output: 'export'` and a Pages `_app` are both present; an existing `.ai.local/rules/router-pages.md` is left untouched and every other seed stays inactive. `init` seeds **staged-inactive** rule templates here (Cursor `.mdc` sources analog: `presets/cursor/next/ai-local/rules-library/**`). They are **not** active until moved into `.ai.local/rules/`. When a seed matches the task scope, apply it and tell the owner to move it. Typical seeds: `router-pages` (Pages Router override), `no-react-fc`, `component-child-decomposition`, `single-source-copy-constants`, `commit-hygiene`, `pre-pr-checklist`, `api-contract-source`, `agent-pipeline-gates`, `analytics-events`, `feature-flags-experiments`, `pwa-service-worker`, `qa-test-cases`, and the `storybook-*` set. (`forms-validation` is an active preset rule, not a seed. `task-levels` is an active overlay rule, not a seed.)
|
|
91
|
+
`init` copies `ai-local/rules/*.md` into `.ai.local/rules/` and does not overwrite an existing file. `init` and `update` also write `.ai.local/.template-base.json`, and a flagged drift run may write `.ai.local/.rollback/template-drift/**`. Neither write replaces an existing rule file. The next stack ships `task-levels` there, so L0–L3 selection is active on install. `init` also copies `router-pages` into `.ai.local/rules/` when `output: 'export'` and a Pages `_app` are both present; an existing `.ai.local/rules/router-pages.md` is left untouched and every other seed stays inactive. `init` seeds **staged-inactive** rule templates here (Cursor `.mdc` sources analog: `presets/cursor/next/ai-local/rules-library/**`). They are **not** active until moved into `.ai.local/rules/`. When a seed matches the task scope, apply it and tell the owner to move it. Typical seeds: `router-pages` (Pages Router override), `no-react-fc`, `component-child-decomposition`, `single-source-copy-constants`, `commit-hygiene`, `pre-pr-checklist`, `api-contract-source`, `agent-pipeline-gates`, `analytics-events`, `feature-flags-experiments`, `pwa-service-worker`, `qa-test-cases`, and the `storybook-*` set. (`forms-validation` is an active preset rule, not a seed. `task-levels` is an active overlay rule, not a seed.)
|
|
92
92
|
|
|
93
93
|
## Managed vs preserved
|
|
94
94
|
|
|
@@ -64,14 +64,14 @@ Default SoT — YAML `model` in each agent file. Optional `steps[].model` (`chea
|
|
|
64
64
|
|
|
65
65
|
| Tier | Default frontmatter | Agents |
|
|
66
66
|
|------|---------------------|--------|
|
|
67
|
-
| **cheap** | `
|
|
67
|
+
| **cheap** | `haiku` | `task-router`, `task-analyst`, `build-verifier`, `code-reviewer`, `tech-writer`, `codebase-analyzer` |
|
|
68
68
|
| **standard** | `inherit` or `sonnet` | `feature-developer`, `debugger`, `ci-investigator`, `api-contract-reviewer`, `accessibility-reviewer`, `qa-tester`, `unit-test-*`, `playwright-test-*`, `openspec-author` (`sonnet` where already pinned) |
|
|
69
69
|
| **strong** | `opus` | `solution-architect`, `migration-specialist`, `security-reviewer`, `performance-auditor`, `mockup-reviewer` |
|
|
70
70
|
|
|
71
71
|
**Notes**
|
|
72
72
|
|
|
73
|
-
- Claude Code aliases: `haiku` / `sonnet` / `opus` / `inherit` (full IDs also OK).
|
|
74
|
-
- Resolution order (Claude Code):
|
|
73
|
+
- Claude Code aliases: `haiku` / `sonnet` / `opus` / `inherit` (full IDs also OK). Cheap agents pin `haiku`; an unknown value is substituted with the parent model, so the cheap tier is not delivered. Cursor keeps its own `fast` tier, which is not a Claude alias.
|
|
74
|
+
- Resolution order (Claude Code): per-invocation `model` → frontmatter `model` → env `CLAUDE_CODE_SUBAGENT_MODEL` → parent session.
|
|
75
75
|
- Never put `strong` on `build-verifier` / `tech-writer` / `task-router`.
|
|
76
76
|
|
|
77
77
|
## Orchestration
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: build-verifier
|
|
3
|
-
description: Validation gate specialist. Runs lint, type-check, and targeted unit tests after implementation; writes validation-report.md. Writes
|
|
4
|
-
model:
|
|
3
|
+
description: Validation gate specialist. Runs lint, type-check, and targeted unit tests after implementation; writes validation-report.md. Writes validation-report/status under team; never fixes app source.
|
|
4
|
+
model: haiku
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Rules to load (subagent context)
|
|
@@ -22,6 +22,10 @@ This subagent does **not** inherit the parent session context or `CLAUDE.md`. Re
|
|
|
22
22
|
|
|
23
23
|
Also read matching `.ai.local/rules/*.md` (local overlay) for the active zone, and the project strict rules if present.
|
|
24
24
|
|
|
25
|
+
<!-- shared-core: quality/anti-hallucination-load-line.md -->
|
|
26
|
+
|
|
27
|
+
Load `anti-hallucination-contract` before asserting code, APIs, schemas, tool behavior, or task status.
|
|
28
|
+
|
|
25
29
|
You are a build verification specialist. You **validate** implementation quality before code review — you do not edit production code or tests.
|
|
26
30
|
|
|
27
31
|
**SSOT for full validation in pipeline:** run complete **`lint:js`**, **`lint:css`**, and **`type-check`** from `app/` even if feature-developer ran scoped checks.
|
|
@@ -34,7 +38,7 @@ You are a build verification specialist. You **validate** implementation quality
|
|
|
34
38
|
|
|
35
39
|
## Commands (from `app/`)
|
|
36
40
|
|
|
37
|
-
Use **`
|
|
41
|
+
Use **`package-manager.md`** for the repo package manager.
|
|
38
42
|
|
|
39
43
|
1. **`lint:js`** — full ESLint.
|
|
40
44
|
2. **`lint:css`** — full Stylelint.
|
|
@@ -44,6 +48,8 @@ Use **`rules/tooling-and-review/package-manager.md`** for the repo package manag
|
|
|
44
48
|
|
|
45
49
|
Prefer **`lint`** (= js + css + type-check) before handoff on large changes.
|
|
46
50
|
|
|
51
|
+
- **Preset twin/golden DoD.** When the change-set edits Cursor next agents and/or `presets/_shared/hooks/**` (or other generated twin surfaces), require `node scripts/fix-generated.mjs` then `yarn check:preset-structure` from `packages/ai-rules` with exit 0 before validation PASS.
|
|
52
|
+
|
|
47
53
|
## Verification before completion
|
|
48
54
|
|
|
49
55
|
<!-- shared-core: quality/verification-before-completion.md -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-reviewer
|
|
3
3
|
description: Expert code review specialist. Reviews after feature development using code-review-mr checklist. Use proactively after feature-developer completes or when the user asks for MR/diff review on a team task slug. Writes only review artifacts/status; never edits production code.
|
|
4
|
-
model:
|
|
4
|
+
model: haiku
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Rules to load (subagent context)
|
|
@@ -90,6 +90,7 @@ Findings carry `path:line`, severity, `confidence`, and a fix direction — rule
|
|
|
90
90
|
## Depth passes
|
|
91
91
|
| Pass | Outcome | Evidence or reason |
|
|
92
92
|
|------|---------|--------------------|
|
|
93
|
+
| Call-site sweep | `no finding` | what was searched or read |
|
|
93
94
|
|
|
94
95
|
## Figma parity (UI)
|
|
95
96
|
- Scope: default | full — viewports compared: …
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: codebase-analyzer
|
|
3
3
|
description: Explains HOW existing code works as-is. Use when the user asks how something works, to trace data flow, or document architecture — without suggesting changes. Prefer over /task for pure questions.
|
|
4
4
|
readonly: false
|
|
5
|
-
model:
|
|
5
|
+
model: haiku
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
## Rules to load (subagent context)
|