code-ai-installer 4.0.0 → 4.0.1-a
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/README.md +83 -67
- package/dist/index.js +2 -0
- package/dist/mcp/audit_ledger.d.ts +12 -0
- package/dist/mcp/audit_ledger.js +82 -0
- package/dist/mcp/cli.js +7 -1
- package/dist/mcp/config.d.ts +23 -0
- package/dist/mcp/config.js +36 -0
- package/dist/mcp/index.d.ts +1 -2
- package/dist/mcp/index.js +1 -2
- package/dist/mcp/paths.d.ts +20 -2
- package/dist/mcp/paths.js +29 -5
- package/dist/mcp/proposal_dedup.d.ts +32 -0
- package/dist/mcp/proposal_dedup.js +102 -0
- package/dist/mcp/proposal_store.d.ts +18 -0
- package/dist/mcp/proposal_store.js +74 -0
- package/dist/mcp/scorecard.d.ts +140 -0
- package/dist/mcp/scorecard.js +103 -0
- package/dist/mcp/skill_invocations.d.ts +15 -0
- package/dist/mcp/skill_invocations.js +28 -0
- package/dist/mcp/task_state.d.ts +77 -2
- package/dist/mcp/tools/_subprocess.d.ts +16 -0
- package/dist/mcp/tools/_subprocess.js +56 -0
- package/dist/mcp/tools/advance_gate.js +2 -2
- package/dist/mcp/tools/aggregate_run_metrics.d.ts +19 -0
- package/dist/mcp/tools/aggregate_run_metrics.js +139 -0
- package/dist/mcp/tools/apply_diff.d.ts +2 -0
- package/dist/mcp/tools/apply_diff.js +29 -0
- package/dist/mcp/tools/audit_bilocale_parity.d.ts +2 -0
- package/dist/mcp/tools/audit_bilocale_parity.js +146 -0
- package/dist/mcp/tools/audit_budget_compliance.d.ts +35 -0
- package/dist/mcp/tools/audit_budget_compliance.js +172 -0
- package/dist/mcp/tools/build.d.ts +2 -0
- package/dist/mcp/tools/build.js +47 -0
- package/dist/mcp/tools/check_lint.d.ts +2 -0
- package/dist/mcp/tools/check_lint.js +23 -0
- package/dist/mcp/tools/classify_gate.js +2 -2
- package/dist/mcp/tools/current_gate.js +2 -2
- package/dist/mcp/tools/dependency_supply_chain.d.ts +2 -0
- package/dist/mcp/tools/dependency_supply_chain.js +59 -0
- package/dist/mcp/tools/docker_compose.d.ts +2 -0
- package/dist/mcp/tools/docker_compose.js +24 -0
- package/dist/mcp/tools/e2e_playwright.d.ts +2 -0
- package/dist/mcp/tools/e2e_playwright.js +88 -0
- package/dist/mcp/tools/get_skill.js +17 -0
- package/dist/mcp/tools/git_commit.d.ts +2 -0
- package/dist/mcp/tools/git_commit.js +30 -0
- package/dist/mcp/tools/list_proposals.d.ts +6 -0
- package/dist/mcp/tools/list_proposals.js +16 -0
- package/dist/mcp/tools/list_skills.js +9 -1
- package/dist/mcp/tools/load_role.d.ts +3 -4
- package/dist/mcp/tools/load_role.js +11 -13
- package/dist/mcp/tools/propose_change.d.ts +8 -0
- package/dist/mcp/tools/propose_change.js +36 -0
- package/dist/mcp/tools/record_decision.js +25 -25
- package/dist/mcp/tools/review_proposal.d.ts +17 -0
- package/dist/mcp/tools/review_proposal.js +99 -0
- package/dist/mcp/tools/run_drift_audit.d.ts +11 -0
- package/dist/mcp/tools/run_drift_audit.js +79 -0
- package/dist/mcp/tools/run_tests.d.ts +2 -0
- package/dist/mcp/tools/run_tests.js +92 -0
- package/dist/mcp/tools/sign_off.js +14 -2
- package/dist/mcp/tools/stubs.js +30 -9
- package/dist/mcp/tools/verify_claim.js +33 -6
- package/dist/mcp_setup.d.ts +8 -0
- package/dist/mcp_setup.js +4 -1
- package/dist/shared/frontmatter.d.ts +44 -2
- package/dist/shared/frontmatter.js +54 -6
- package/dist/shared/index.d.ts +0 -5
- package/dist/shared/index.js +0 -5
- package/dist/shared/persona.d.ts +2 -2
- package/dist/shared/persona.js +1 -1
- package/dist/shared/pipeline.d.ts +46 -1
- package/dist/shared/tools.d.ts +1382 -16
- package/dist/shared/tools.js +229 -0
- package/dist/shared/vocabulary.d.ts +99 -4
- package/dist/shared/vocabulary.js +94 -5
- package/domains/analytics/.agents/skills/ansoff-matrix/SKILL.md +316 -300
- package/domains/analytics/.agents/skills/bcg-matrix/SKILL.md +345 -329
- package/domains/analytics/.agents/skills/blue-ocean-strategy/SKILL.md +432 -416
- package/domains/analytics/.agents/skills/board/SKILL.md +22 -0
- package/domains/analytics/.agents/skills/cohort-analysis/SKILL.md +338 -322
- package/domains/analytics/.agents/skills/competitive-analysis/SKILL.md +413 -395
- package/domains/analytics/.agents/skills/customer-journey-mapping/SKILL.md +347 -331
- package/domains/analytics/.agents/skills/gates/SKILL.md +388 -366
- package/domains/analytics/.agents/skills/handoff/SKILL.md +402 -380
- package/domains/analytics/.agents/skills/html-pdf-report/SKILL.md +21 -289
- package/domains/analytics/.agents/skills/html-pdf-report-reference/SKILL.md +325 -0
- package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/claude.json +17 -0
- package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/copilot.json +17 -0
- package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/gemini.json +17 -0
- package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/kimi.yaml +15 -0
- package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/openai.yaml +10 -0
- package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/qwen.json +17 -0
- package/domains/analytics/.agents/skills/html-pdf-report-reference/agents/skill.yaml +23 -0
- package/domains/analytics/.agents/skills/icp-buyer-persona/SKILL.md +407 -390
- package/domains/analytics/.agents/skills/jtbd-analysis/SKILL.md +357 -341
- package/domains/analytics/.agents/skills/karpathy-guidelines/SKILL.md +32 -0
- package/domains/analytics/.agents/skills/pest-analysis/SKILL.md +324 -305
- package/domains/analytics/.agents/skills/porters-five-forces/SKILL.md +377 -361
- package/domains/analytics/.agents/skills/report-design/SKILL.md +416 -398
- package/domains/analytics/.agents/skills/rfm-analysis/SKILL.md +330 -314
- package/domains/analytics/.agents/skills/session-prompt-generator/SKILL.md +400 -378
- package/domains/analytics/.agents/skills/swot-analysis/SKILL.md +340 -324
- package/domains/analytics/.agents/skills/tam-sam-som/SKILL.md +329 -312
- package/domains/analytics/.agents/skills/trend-analysis/SKILL.md +347 -331
- package/domains/analytics/.agents/skills/unit-economics/SKILL.md +430 -413
- package/domains/analytics/.agents/skills/value-chain-analysis/SKILL.md +346 -330
- package/domains/analytics/.agents/skills/web-research/SKILL.md +323 -308
- package/domains/analytics/AGENTS.md +1 -0
- package/domains/analytics/agents/auditor.md +76 -0
- package/domains/analytics/agents/conductor.md +11 -0
- package/domains/analytics/agents/data_analyst.md +11 -0
- package/domains/analytics/agents/designer.md +11 -0
- package/domains/analytics/agents/interviewer.md +11 -0
- package/domains/analytics/agents/layouter.md +11 -0
- package/domains/analytics/agents/mediator.md +11 -0
- package/domains/analytics/agents/researcher.md +11 -0
- package/domains/analytics/agents/strategist.md +11 -0
- package/domains/analytics/locales/en/.agents/skills/ansoff-matrix/SKILL.md +316 -300
- package/domains/analytics/locales/en/.agents/skills/bcg-matrix/SKILL.md +345 -329
- package/domains/analytics/locales/en/.agents/skills/blue-ocean-strategy/SKILL.md +432 -416
- package/domains/analytics/locales/en/.agents/skills/board/SKILL.md +22 -0
- package/domains/analytics/locales/en/.agents/skills/cohort-analysis/SKILL.md +338 -322
- package/domains/analytics/locales/en/.agents/skills/competitive-analysis/SKILL.md +413 -395
- package/domains/analytics/locales/en/.agents/skills/customer-journey-mapping/SKILL.md +347 -331
- package/domains/analytics/locales/en/.agents/skills/gates/SKILL.md +388 -366
- package/domains/analytics/locales/en/.agents/skills/handoff/SKILL.md +402 -380
- package/domains/analytics/locales/en/.agents/skills/html-pdf-report/SKILL.md +21 -289
- package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/SKILL.md +325 -0
- package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/claude.json +17 -0
- package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/copilot.json +17 -0
- package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/gemini.json +17 -0
- package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/kimi.yaml +15 -0
- package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/openai.yaml +10 -0
- package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/qwen.json +17 -0
- package/domains/analytics/locales/en/.agents/skills/html-pdf-report-reference/agents/skill.yaml +29 -0
- package/domains/analytics/locales/en/.agents/skills/icp-buyer-persona/SKILL.md +407 -390
- package/domains/analytics/locales/en/.agents/skills/jtbd-analysis/SKILL.md +357 -341
- package/domains/analytics/locales/en/.agents/skills/karpathy-guidelines/SKILL.md +32 -0
- package/domains/analytics/locales/en/.agents/skills/pest-analysis/SKILL.md +324 -305
- package/domains/analytics/locales/en/.agents/skills/porters-five-forces/SKILL.md +377 -361
- package/domains/analytics/locales/en/.agents/skills/report-design/SKILL.md +416 -398
- package/domains/analytics/locales/en/.agents/skills/rfm-analysis/SKILL.md +330 -314
- package/domains/analytics/locales/en/.agents/skills/session-prompt-generator/SKILL.md +400 -378
- package/domains/analytics/locales/en/.agents/skills/swot-analysis/SKILL.md +340 -324
- package/domains/analytics/locales/en/.agents/skills/tam-sam-som/SKILL.md +329 -312
- package/domains/analytics/locales/en/.agents/skills/trend-analysis/SKILL.md +347 -331
- package/domains/analytics/locales/en/.agents/skills/unit-economics/SKILL.md +430 -413
- package/domains/analytics/locales/en/.agents/skills/value-chain-analysis/SKILL.md +366 -350
- package/domains/analytics/locales/en/.agents/skills/web-research/SKILL.md +324 -309
- package/domains/analytics/locales/en/AGENTS.md +1 -0
- package/domains/analytics/locales/en/agents/auditor.md +76 -0
- package/domains/analytics/locales/en/agents/conductor.md +27 -0
- package/domains/analytics/locales/en/agents/data_analyst.md +29 -0
- package/domains/analytics/locales/en/agents/designer.md +27 -0
- package/domains/analytics/locales/en/agents/interviewer.md +11 -0
- package/domains/analytics/locales/en/agents/layouter.md +11 -0
- package/domains/analytics/locales/en/agents/mediator.md +11 -0
- package/domains/analytics/locales/en/agents/researcher.md +11 -0
- package/domains/analytics/locales/en/agents/strategist.md +11 -0
- package/domains/analytics/persona/persona-base.md +94 -0
- package/domains/analytics/pipeline.yaml +102 -0
- package/domains/content/.agents/skills/audience-analysis/SKILL.md +15 -0
- package/domains/content/.agents/skills/board/SKILL.md +20 -0
- package/domains/content/.agents/skills/brand-compliance/SKILL.md +15 -0
- package/domains/content/.agents/skills/brand-guidelines/SKILL.md +17 -0
- package/domains/content/.agents/skills/competitor-content-analysis/SKILL.md +15 -0
- package/domains/content/.agents/skills/content-brief/SKILL.md +15 -0
- package/domains/content/.agents/skills/content-calendar/SKILL.md +15 -0
- package/domains/content/.agents/skills/content-release-gate/SKILL.md +15 -0
- package/domains/content/.agents/skills/content-review-checklist/SKILL.md +15 -0
- package/domains/content/.agents/skills/cta-optimization/SKILL.md +15 -0
- package/domains/content/.agents/skills/data-storytelling/SKILL.md +15 -0
- package/domains/content/.agents/skills/email-copywriting/SKILL.md +15 -0
- package/domains/content/.agents/skills/email-engagement-tiers/SKILL.md +15 -0
- package/domains/content/.agents/skills/fact-checking/SKILL.md +15 -0
- package/domains/content/.agents/skills/gates/SKILL.md +20 -0
- package/domains/content/.agents/skills/google-stitch-content/SKILL.md +15 -0
- package/domains/content/.agents/skills/handoff/SKILL.md +24 -0
- package/domains/content/.agents/skills/headline-formulas/SKILL.md +15 -0
- package/domains/content/.agents/skills/image-prompt-engineering/SKILL.md +15 -0
- package/domains/content/.agents/skills/karpathy-guidelines/SKILL.md +28 -0
- package/domains/content/.agents/skills/mailerlite-email-ops/SKILL.md +15 -0
- package/domains/content/.agents/skills/marketing-psychology/SKILL.md +15 -0
- package/domains/content/.agents/skills/moodboard/SKILL.md +15 -0
- package/domains/content/.agents/skills/platform-compliance/SKILL.md +15 -0
- package/domains/content/.agents/skills/platform-strategy/SKILL.md +15 -0
- package/domains/content/.agents/skills/platform-visual-specs/SKILL.md +15 -0
- package/domains/content/.agents/skills/readability-scoring/SKILL.md +15 -0
- package/domains/content/.agents/skills/seo-copywriting/SKILL.md +15 -0
- package/domains/content/.agents/skills/social-media-formats/SKILL.md +15 -0
- package/domains/content/.agents/skills/source-verification/SKILL.md +15 -0
- package/domains/content/.agents/skills/storytelling-framework/SKILL.md +15 -0
- package/domains/content/.agents/skills/tone-of-voice/SKILL.md +15 -0
- package/domains/content/.agents/skills/topic-research/SKILL.md +15 -0
- package/domains/content/.agents/skills/trend-research/SKILL.md +15 -0
- package/domains/content/.agents/skills/visual-brief/SKILL.md +15 -0
- package/domains/content/AGENTS.md +4 -0
- package/domains/content/agents/auditor.md +76 -0
- package/domains/content/agents/conductor.md +11 -0
- package/domains/content/agents/copywriter.md +11 -0
- package/domains/content/agents/researcher.md +11 -0
- package/domains/content/agents/reviewer.md +11 -0
- package/domains/content/agents/strategist.md +11 -0
- package/domains/content/agents/visual_concept.md +11 -0
- package/domains/content/locales/en/.agents/skills/audience-analysis/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/board/SKILL.md +20 -0
- package/domains/content/locales/en/.agents/skills/brand-compliance/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/brand-guidelines/SKILL.md +17 -0
- package/domains/content/locales/en/.agents/skills/competitor-content-analysis/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/content-brief/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/content-calendar/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/content-release-gate/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/content-review-checklist/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/cta-optimization/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/data-storytelling/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/email-copywriting/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/email-engagement-tiers/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/fact-checking/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/gates/SKILL.md +20 -0
- package/domains/content/locales/en/.agents/skills/google-stitch-content/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/handoff/SKILL.md +24 -0
- package/domains/content/locales/en/.agents/skills/headline-formulas/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/image-prompt-engineering/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/karpathy-guidelines/SKILL.md +30 -1
- package/domains/content/locales/en/.agents/skills/mailerlite-email-ops/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/marketing-psychology/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/moodboard/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/platform-compliance/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/platform-strategy/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/platform-visual-specs/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/readability-scoring/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/seo-copywriting/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/social-media-formats/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/source-verification/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/storytelling-framework/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/tone-of-voice/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/topic-research/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/trend-research/SKILL.md +15 -0
- package/domains/content/locales/en/.agents/skills/visual-brief/SKILL.md +15 -0
- package/domains/content/locales/en/AGENTS.md +4 -0
- package/domains/content/locales/en/agents/auditor.md +76 -0
- package/domains/content/locales/en/agents/conductor.md +12 -0
- package/domains/content/locales/en/agents/copywriter.md +12 -0
- package/domains/content/locales/en/agents/researcher.md +12 -0
- package/domains/content/locales/en/agents/reviewer.md +12 -0
- package/domains/content/locales/en/agents/strategist.md +12 -0
- package/domains/content/locales/en/agents/visual_concept.md +12 -0
- package/domains/content/persona/persona-base.md +94 -0
- package/domains/content/pipeline.yaml +96 -0
- package/domains/development/.agents/skills/adr-log/SKILL.md +1 -0
- package/domains/development/.agents/skills/design-intake/SKILL.md +0 -4
- package/domains/development/.agents/skills/karpathy-guidelines/SKILL.md +2 -1
- package/domains/development/.agents/skills/lava-flow-legacy-detection/SKILL.md +15 -1
- package/domains/development/.agents/skills/mcp-integration/SKILL.md +211 -0
- package/domains/development/.agents/skills/mcp-integration/agents/claude.json +22 -0
- package/domains/development/.agents/skills/mcp-integration/agents/copilot.json +22 -0
- package/domains/development/.agents/skills/mcp-integration/agents/gemini.json +22 -0
- package/domains/development/.agents/skills/mcp-integration/agents/kimi.yaml +18 -0
- package/domains/development/.agents/skills/mcp-integration/agents/openai.yaml +8 -0
- package/domains/development/.agents/skills/mcp-integration/agents/qwen.json +22 -0
- package/domains/development/.agents/skills/mcp-integration/agents/skill.yaml +26 -0
- package/domains/development/.agents/skills/qa-ui-a11y-smoke/SKILL.md +1 -1
- package/domains/development/.agents/skills/ui-a11y-smoke-review/SKILL.md +1 -1
- package/domains/development/AGENTS.md +1 -0
- package/domains/development/AGENTS.yaml +1 -0
- package/domains/development/agents/architect.md +13 -1
- package/domains/development/agents/auditor.md +74 -0
- package/domains/development/agents/conductor.md +14 -3
- package/domains/development/agents/devops.md +8 -9
- package/domains/development/agents/reviewer.md +12 -0
- package/domains/development/agents/senior_full_stack.md +12 -0
- package/domains/development/agents/tester.md +10 -16
- package/domains/development/locales/en/.agents/skills/adr-log/SKILL.md +1 -0
- package/domains/development/locales/en/.agents/skills/current-state-analysis/SKILL.md +256 -172
- package/domains/development/locales/en/.agents/skills/karpathy-guidelines/SKILL.md +2 -1
- package/domains/development/locales/en/.agents/skills/lava-flow-legacy-detection/SKILL.md +15 -1
- package/domains/development/locales/en/.agents/skills/mcp-integration/SKILL.md +211 -0
- package/domains/development/locales/en/.agents/skills/mcp-integration/agents/claude.json +22 -0
- package/domains/development/locales/en/.agents/skills/mcp-integration/agents/copilot.json +22 -0
- package/domains/development/locales/en/.agents/skills/mcp-integration/agents/gemini.json +22 -0
- package/domains/development/locales/en/.agents/skills/mcp-integration/agents/kimi.yaml +18 -0
- package/domains/development/locales/en/.agents/skills/mcp-integration/agents/openai.yaml +8 -0
- package/domains/development/locales/en/.agents/skills/mcp-integration/agents/qwen.json +22 -0
- package/domains/development/locales/en/.agents/skills/mcp-integration/agents/skill.yaml +26 -0
- package/domains/development/locales/en/.agents/skills/qa-ui-a11y-smoke/SKILL.md +1 -1
- package/domains/development/locales/en/.agents/skills/ui-a11y-smoke-review/SKILL.md +1 -1
- package/domains/development/locales/en/AGENTS.md +5 -0
- package/domains/development/locales/en/AGENTS.yaml +1 -0
- package/domains/development/locales/en/agents/architect.md +13 -1
- package/domains/development/locales/en/agents/auditor.md +74 -0
- package/domains/development/locales/en/agents/conductor.md +14 -3
- package/domains/development/locales/en/agents/devops.md +8 -9
- package/domains/development/locales/en/agents/reviewer.md +12 -0
- package/domains/development/locales/en/agents/senior_full_stack.md +12 -0
- package/domains/development/locales/en/agents/tester.md +10 -16
- package/domains/development/persona/persona-base.md +94 -0
- package/domains/product/.agents/skills/aarrr-metrics/SKILL.md +451 -433
- package/domains/product/.agents/skills/ab-test-design/SKILL.md +428 -412
- package/domains/product/.agents/skills/acceptance-criteria/SKILL.md +422 -406
- package/domains/product/.agents/skills/assumption-mapping/SKILL.md +323 -307
- package/domains/product/.agents/skills/board/SKILL.md +24 -0
- package/domains/product/.agents/skills/design-brief/SKILL.md +433 -418
- package/domains/product/.agents/skills/epic-breakdown/SKILL.md +435 -420
- package/domains/product/.agents/skills/gates/SKILL.md +470 -446
- package/domains/product/.agents/skills/gtm-brief/SKILL.md +18 -321
- package/domains/product/.agents/skills/gtm-brief-reference/SKILL.md +348 -0
- package/domains/product/.agents/skills/gtm-brief-reference/agents/claude.json +17 -0
- package/domains/product/.agents/skills/gtm-brief-reference/agents/copilot.json +17 -0
- package/domains/product/.agents/skills/gtm-brief-reference/agents/gemini.json +17 -0
- package/domains/product/.agents/skills/gtm-brief-reference/agents/kimi.yaml +15 -0
- package/domains/product/.agents/skills/gtm-brief-reference/agents/openai.yaml +10 -0
- package/domains/product/.agents/skills/gtm-brief-reference/agents/qwen.json +17 -0
- package/domains/product/.agents/skills/gtm-brief-reference/agents/skill.yaml +22 -0
- package/domains/product/.agents/skills/handoff/SKILL.md +463 -439
- package/domains/product/.agents/skills/html-pdf-report/SKILL.md +21 -663
- package/domains/product/.agents/skills/html-pdf-report-reference/SKILL.md +699 -0
- package/domains/product/.agents/skills/html-pdf-report-reference/agents/claude.json +17 -0
- package/domains/product/.agents/skills/html-pdf-report-reference/agents/copilot.json +17 -0
- package/domains/product/.agents/skills/html-pdf-report-reference/agents/gemini.json +17 -0
- package/domains/product/.agents/skills/html-pdf-report-reference/agents/kimi.yaml +15 -0
- package/domains/product/.agents/skills/html-pdf-report-reference/agents/openai.yaml +10 -0
- package/domains/product/.agents/skills/html-pdf-report-reference/agents/qwen.json +17 -0
- package/domains/product/.agents/skills/html-pdf-report-reference/agents/skill.yaml +22 -0
- package/domains/product/.agents/skills/hypothesis-template/SKILL.md +484 -469
- package/domains/product/.agents/skills/jtbd-canvas/SKILL.md +274 -258
- package/domains/product/.agents/skills/kano-model/SKILL.md +370 -355
- package/domains/product/.agents/skills/karpathy-guidelines/SKILL.md +36 -0
- package/domains/product/.agents/skills/launch-checklist/SKILL.md +434 -419
- package/domains/product/.agents/skills/moscow-prioritization/SKILL.md +407 -392
- package/domains/product/.agents/skills/north-star-metric/SKILL.md +317 -301
- package/domains/product/.agents/skills/okr-framework/SKILL.md +299 -284
- package/domains/product/.agents/skills/opportunity-solution-tree/SKILL.md +472 -456
- package/domains/product/.agents/skills/prd-template/SKILL.md +18 -258
- package/domains/product/.agents/skills/prd-template-reference/SKILL.md +285 -0
- package/domains/product/.agents/skills/prd-template-reference/agents/claude.json +17 -0
- package/domains/product/.agents/skills/prd-template-reference/agents/copilot.json +17 -0
- package/domains/product/.agents/skills/prd-template-reference/agents/gemini.json +17 -0
- package/domains/product/.agents/skills/prd-template-reference/agents/kimi.yaml +16 -0
- package/domains/product/.agents/skills/prd-template-reference/agents/openai.yaml +10 -0
- package/domains/product/.agents/skills/prd-template-reference/agents/qwen.json +17 -0
- package/domains/product/.agents/skills/prd-template-reference/agents/skill.yaml +23 -0
- package/domains/product/.agents/skills/problem-statement/SKILL.md +327 -312
- package/domains/product/.agents/skills/product-roadmap/SKILL.md +320 -304
- package/domains/product/.agents/skills/product-vision/SKILL.md +409 -394
- package/domains/product/.agents/skills/release-notes/SKILL.md +18 -258
- package/domains/product/.agents/skills/release-notes-reference/SKILL.md +285 -0
- package/domains/product/.agents/skills/release-notes-reference/agents/claude.json +17 -0
- package/domains/product/.agents/skills/release-notes-reference/agents/copilot.json +17 -0
- package/domains/product/.agents/skills/release-notes-reference/agents/gemini.json +17 -0
- package/domains/product/.agents/skills/release-notes-reference/agents/kimi.yaml +15 -0
- package/domains/product/.agents/skills/release-notes-reference/agents/openai.yaml +10 -0
- package/domains/product/.agents/skills/release-notes-reference/agents/qwen.json +17 -0
- package/domains/product/.agents/skills/release-notes-reference/agents/skill.yaml +22 -0
- package/domains/product/.agents/skills/report-design/SKILL.md +17 -307
- package/domains/product/.agents/skills/report-design-reference/SKILL.md +331 -0
- package/domains/product/.agents/skills/report-design-reference/agents/claude.json +17 -0
- package/domains/product/.agents/skills/report-design-reference/agents/copilot.json +17 -0
- package/domains/product/.agents/skills/report-design-reference/agents/gemini.json +17 -0
- package/domains/product/.agents/skills/report-design-reference/agents/kimi.yaml +15 -0
- package/domains/product/.agents/skills/report-design-reference/agents/openai.yaml +10 -0
- package/domains/product/.agents/skills/report-design-reference/agents/qwen.json +17 -0
- package/domains/product/.agents/skills/report-design-reference/agents/skill.yaml +22 -0
- package/domains/product/.agents/skills/rice-scoring/SKILL.md +266 -251
- package/domains/product/.agents/skills/saas-metrics/SKILL.md +422 -404
- package/domains/product/.agents/skills/session-prompt-generator/SKILL.md +474 -450
- package/domains/product/.agents/skills/user-flow/SKILL.md +491 -476
- package/domains/product/.agents/skills/user-interview-script/SKILL.md +315 -298
- package/domains/product/.agents/skills/user-story/SKILL.md +401 -385
- package/domains/product/.agents/skills/wsjf-scoring/SKILL.md +333 -315
- package/domains/product/AGENTS.md +5 -0
- package/domains/product/AGENTS.yaml +1 -0
- package/domains/product/agents/auditor.md +76 -0
- package/domains/product/agents/conductor.md +11 -0
- package/domains/product/agents/data_analyst.md +11 -0
- package/domains/product/agents/designer.md +11 -0
- package/domains/product/agents/discovery.md +11 -0
- package/domains/product/agents/layouter.md +11 -0
- package/domains/product/agents/mediator.md +11 -0
- package/domains/product/agents/pm.md +11 -0
- package/domains/product/agents/product_strategist.md +11 -0
- package/domains/product/agents/tech_lead.md +11 -0
- package/domains/product/agents/ux_designer.md +11 -0
- package/domains/product/locales/en/.agents/skills/aarrr-metrics/SKILL.md +451 -433
- package/domains/product/locales/en/.agents/skills/ab-test-design/SKILL.md +428 -412
- package/domains/product/locales/en/.agents/skills/acceptance-criteria/SKILL.md +422 -406
- package/domains/product/locales/en/.agents/skills/assumption-mapping/SKILL.md +323 -307
- package/domains/product/locales/en/.agents/skills/board/SKILL.md +24 -0
- package/domains/product/locales/en/.agents/skills/design-brief/SKILL.md +433 -418
- package/domains/product/locales/en/.agents/skills/epic-breakdown/SKILL.md +435 -420
- package/domains/product/locales/en/.agents/skills/gates/SKILL.md +470 -446
- package/domains/product/locales/en/.agents/skills/gtm-brief/SKILL.md +18 -321
- package/domains/product/locales/en/.agents/skills/gtm-brief-reference/SKILL.md +348 -0
- package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/claude.json +17 -0
- package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/copilot.json +17 -0
- package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/gemini.json +17 -0
- package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/kimi.yaml +15 -0
- package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/openai.yaml +10 -0
- package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/qwen.json +17 -0
- package/domains/product/locales/en/.agents/skills/gtm-brief-reference/agents/skill.yaml +22 -0
- package/domains/product/locales/en/.agents/skills/handoff/SKILL.md +463 -439
- package/domains/product/locales/en/.agents/skills/html-pdf-report/SKILL.md +21 -663
- package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/SKILL.md +699 -0
- package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/claude.json +17 -0
- package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/copilot.json +17 -0
- package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/gemini.json +17 -0
- package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/kimi.yaml +15 -0
- package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/openai.yaml +10 -0
- package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/qwen.json +17 -0
- package/domains/product/locales/en/.agents/skills/html-pdf-report-reference/agents/skill.yaml +22 -0
- package/domains/product/locales/en/.agents/skills/hypothesis-template/SKILL.md +484 -469
- package/domains/product/locales/en/.agents/skills/jtbd-canvas/SKILL.md +273 -257
- package/domains/product/locales/en/.agents/skills/kano-model/SKILL.md +370 -355
- package/domains/product/locales/en/.agents/skills/karpathy-guidelines/SKILL.md +36 -0
- package/domains/product/locales/en/.agents/skills/launch-checklist/SKILL.md +434 -419
- package/domains/product/locales/en/.agents/skills/moscow-prioritization/SKILL.md +407 -392
- package/domains/product/locales/en/.agents/skills/north-star-metric/SKILL.md +317 -301
- package/domains/product/locales/en/.agents/skills/okr-framework/SKILL.md +299 -284
- package/domains/product/locales/en/.agents/skills/opportunity-solution-tree/SKILL.md +472 -456
- package/domains/product/locales/en/.agents/skills/prd-template/SKILL.md +18 -258
- package/domains/product/locales/en/.agents/skills/prd-template-reference/SKILL.md +285 -0
- package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/claude.json +16 -0
- package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/copilot.json +16 -0
- package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/gemini.json +16 -0
- package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/kimi.yaml +15 -0
- package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/openai.yaml +10 -0
- package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/qwen.json +16 -0
- package/domains/product/locales/en/.agents/skills/prd-template-reference/agents/skill.yaml +22 -0
- package/domains/product/locales/en/.agents/skills/problem-statement/SKILL.md +327 -312
- package/domains/product/locales/en/.agents/skills/product-roadmap/SKILL.md +321 -305
- package/domains/product/locales/en/.agents/skills/product-vision/SKILL.md +410 -395
- package/domains/product/locales/en/.agents/skills/release-notes/SKILL.md +18 -258
- package/domains/product/locales/en/.agents/skills/release-notes-reference/SKILL.md +285 -0
- package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/claude.json +16 -0
- package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/copilot.json +16 -0
- package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/gemini.json +16 -0
- package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/kimi.yaml +14 -0
- package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/openai.yaml +10 -0
- package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/qwen.json +16 -0
- package/domains/product/locales/en/.agents/skills/release-notes-reference/agents/skill.yaml +21 -0
- package/domains/product/locales/en/.agents/skills/report-design/SKILL.md +17 -307
- package/domains/product/locales/en/.agents/skills/report-design-reference/SKILL.md +331 -0
- package/domains/product/locales/en/.agents/skills/report-design-reference/agents/claude.json +17 -0
- package/domains/product/locales/en/.agents/skills/report-design-reference/agents/copilot.json +17 -0
- package/domains/product/locales/en/.agents/skills/report-design-reference/agents/gemini.json +17 -0
- package/domains/product/locales/en/.agents/skills/report-design-reference/agents/kimi.yaml +15 -0
- package/domains/product/locales/en/.agents/skills/report-design-reference/agents/openai.yaml +10 -0
- package/domains/product/locales/en/.agents/skills/report-design-reference/agents/qwen.json +17 -0
- package/domains/product/locales/en/.agents/skills/report-design-reference/agents/skill.yaml +22 -0
- package/domains/product/locales/en/.agents/skills/rice-scoring/SKILL.md +266 -251
- package/domains/product/locales/en/.agents/skills/saas-metrics/SKILL.md +422 -404
- package/domains/product/locales/en/.agents/skills/session-prompt-generator/SKILL.md +474 -450
- package/domains/product/locales/en/.agents/skills/user-flow/SKILL.md +491 -476
- package/domains/product/locales/en/.agents/skills/user-interview-script/SKILL.md +314 -297
- package/domains/product/locales/en/.agents/skills/user-story/SKILL.md +401 -385
- package/domains/product/locales/en/.agents/skills/wsjf-scoring/SKILL.md +333 -315
- package/domains/product/locales/en/AGENTS.md +5 -0
- package/domains/product/locales/en/agents/auditor.md +76 -0
- package/domains/product/locales/en/agents/conductor.md +11 -0
- package/domains/product/locales/en/agents/data_analyst.md +11 -0
- package/domains/product/locales/en/agents/designer.md +11 -0
- package/domains/product/locales/en/agents/discovery.md +11 -0
- package/domains/product/locales/en/agents/layouter.md +11 -0
- package/domains/product/locales/en/agents/mediator.md +11 -0
- package/domains/product/locales/en/agents/pm.md +11 -0
- package/domains/product/locales/en/agents/product_strategist.md +11 -0
- package/domains/product/locales/en/agents/tech_lead.md +11 -0
- package/domains/product/locales/en/agents/ux_designer.md +11 -0
- package/domains/product/persona/persona-base.md +94 -0
- package/domains/product/pipeline.yaml +115 -0
- package/package.json +72 -70
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { loadCodeAiConfig } from "../config.js";
|
|
2
|
+
import { appendReviewEvent, readProposals } from "../proposal_store.js";
|
|
3
|
+
import { readDomainSkillMeta, findOverlaps } from "../proposal_dedup.js";
|
|
4
|
+
/**
|
|
5
|
+
* Authorize a proposal status transition, enforcing the autonomy matrix + toggle.
|
|
6
|
+
*
|
|
7
|
+
* 4b is the AUTHORIZATION seam, not the write seam (mirrors sign_off: it authorizes a gate
|
|
8
|
+
* without doing the gate's work). The actual byte write into the asset is a separate
|
|
9
|
+
* submit_artifact/edit step the caller performs after approval — see next_step.
|
|
10
|
+
*
|
|
11
|
+
* Transitions:
|
|
12
|
+
* approve pending → approved (matrix/toggle-gated when decided_by=auditor_auto)
|
|
13
|
+
* reject pending → rejected
|
|
14
|
+
* applied approved → applied (bookkeeping marker after the caller wrote the asset)
|
|
15
|
+
*
|
|
16
|
+
* Matrix (ADR-DEV-122): auditor_auto may approve only low/additive AND only when the approval
|
|
17
|
+
* gate is OFF; destructive (high) and gate-ON always require den. den may always act.
|
|
18
|
+
*/
|
|
19
|
+
export async function reviewProposal(input) {
|
|
20
|
+
const proposals = await readProposals();
|
|
21
|
+
const p = proposals.find((x) => x.id === input.id);
|
|
22
|
+
if (!p) {
|
|
23
|
+
throw new Error(`review_proposal: no proposal '${input.id}' in the store`);
|
|
24
|
+
}
|
|
25
|
+
// Transition validity.
|
|
26
|
+
if (input.decision === "approve" || input.decision === "reject") {
|
|
27
|
+
if (p.status !== "pending") {
|
|
28
|
+
throw new Error(`review_proposal: '${input.id}' is '${p.status}', not 'pending' — cannot ${input.decision}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
// "applied"
|
|
33
|
+
if (p.status !== "approved") {
|
|
34
|
+
throw new Error(`review_proposal: '${input.id}' is '${p.status}', not 'approved' — cannot mark applied`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// Matrix + toggle enforcement on the capability-granting direction (approve).
|
|
38
|
+
if (input.decision === "approve" && input.decided_by === "auditor_auto") {
|
|
39
|
+
const cfg = await loadCodeAiConfig();
|
|
40
|
+
if (cfg.auditor.approval_gate) {
|
|
41
|
+
throw new Error(`review_proposal: approval gate is ON — '${input.id}' requires den approval, not auditor_auto`);
|
|
42
|
+
}
|
|
43
|
+
if (p.risk === "high") {
|
|
44
|
+
throw new Error(`review_proposal: '${input.id}' is high-risk (destructive) — always requires den, even in autonomy`);
|
|
45
|
+
}
|
|
46
|
+
// Additive-dedup guard (ADR-DEV-125): before auto-adding a NEW skill, block silent
|
|
47
|
+
// library bloat — if it overlaps an existing skill, route to den instead of auto-adding.
|
|
48
|
+
if (p.change_kind === "add_asset" && p.target.asset === "skill") {
|
|
49
|
+
const skills = await readDomainSkillMeta(p.target.domain);
|
|
50
|
+
const overlaps = findOverlaps({
|
|
51
|
+
proposalName: p.target.name,
|
|
52
|
+
text: `${p.rationale}\n${p.draft}`,
|
|
53
|
+
skills,
|
|
54
|
+
});
|
|
55
|
+
if (overlaps.length > 0) {
|
|
56
|
+
const summary = overlaps
|
|
57
|
+
.map((o) => `${o.skill} (${o.reasons.join("; ")})`)
|
|
58
|
+
.join("; ");
|
|
59
|
+
throw new Error(`review_proposal: '${input.id}' may duplicate existing skill(s) [${summary}] — additive-dedup guard routes it to den, not auto-add`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const status = input.decision === "approve"
|
|
64
|
+
? "approved"
|
|
65
|
+
: input.decision === "reject"
|
|
66
|
+
? "rejected"
|
|
67
|
+
: "applied";
|
|
68
|
+
await appendReviewEvent({
|
|
69
|
+
kind: "review",
|
|
70
|
+
id: input.id,
|
|
71
|
+
status,
|
|
72
|
+
decided_by: input.decided_by,
|
|
73
|
+
...(input.note !== undefined ? { note: input.note } : {}),
|
|
74
|
+
reviewed_at: new Date().toISOString(),
|
|
75
|
+
});
|
|
76
|
+
return {
|
|
77
|
+
id: input.id,
|
|
78
|
+
status,
|
|
79
|
+
risk: p.risk,
|
|
80
|
+
decided_by: input.decided_by,
|
|
81
|
+
target: p.target,
|
|
82
|
+
next_step: buildNextStep(status, p.target, p.draft, input.decided_by, p.change_kind),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** Mandatory report — every decision (especially autonomous) returns a plain-language next step. */
|
|
86
|
+
function buildNextStep(status, target, draft, decided_by, change_kind) {
|
|
87
|
+
const who = decided_by === "auditor_auto" ? "Auditor (autonomous)" : "den";
|
|
88
|
+
const asset = `${target.asset} '${target.name}' in domain '${target.domain}'`;
|
|
89
|
+
if (status === "approved") {
|
|
90
|
+
const bloatNote = decided_by === "auditor_auto" && change_kind === "add_asset"
|
|
91
|
+
? " NEW ADDITION (autonomous) — passed the dedup guard; tracked for later pruning review."
|
|
92
|
+
: "";
|
|
93
|
+
return `Approved by ${who}. Apply the draft to ${asset} via submit_artifact (class=${target.asset === "agent" ? "role" : "skill"}) or a targeted edit, then call review_proposal decision='applied'.${bloatNote} Draft:\n${draft}`;
|
|
94
|
+
}
|
|
95
|
+
if (status === "rejected") {
|
|
96
|
+
return `Rejected by ${who}. No change applied; the proposal stays on record.`;
|
|
97
|
+
}
|
|
98
|
+
return `Marked applied by ${who}. The change is now written to ${asset}; the proposal lifecycle is closed.`;
|
|
99
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type RunDriftAuditInput, type RunDriftAuditOutput } from "../../shared/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Drift audit uses a PERMISSIVE YAML parser — strict SkillFrontmatter
|
|
4
|
+
* validation (e.g. `owners: z.array(AgentName).min(1)`) would silently skip
|
|
5
|
+
* the very skills the audit needs to surface. We only require:
|
|
6
|
+
* - frontmatter block exists
|
|
7
|
+
* - `name` field is a string matching the folder name
|
|
8
|
+
* Everything else (type, domain, owners empty/missing) is reported, not
|
|
9
|
+
* rejected.
|
|
10
|
+
*/
|
|
11
|
+
export declare function runDriftAudit(input: RunDriftAuditInput): Promise<RunDriftAuditOutput>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { parse as parseYaml } from "yaml";
|
|
4
|
+
import { resolveDomainRoot, resolveSkillsRoot } from "../paths.js";
|
|
5
|
+
/**
|
|
6
|
+
* Drift audit uses a PERMISSIVE YAML parser — strict SkillFrontmatter
|
|
7
|
+
* validation (e.g. `owners: z.array(AgentName).min(1)`) would silently skip
|
|
8
|
+
* the very skills the audit needs to surface. We only require:
|
|
9
|
+
* - frontmatter block exists
|
|
10
|
+
* - `name` field is a string matching the folder name
|
|
11
|
+
* Everything else (type, domain, owners empty/missing) is reported, not
|
|
12
|
+
* rejected.
|
|
13
|
+
*/
|
|
14
|
+
export async function runDriftAudit(input) {
|
|
15
|
+
const domainRoot = resolveDomainRoot(input.domain);
|
|
16
|
+
const agentsYamlPath = join(domainRoot, "AGENTS.yaml");
|
|
17
|
+
const yamlList = await readSkillsFromAgentsYaml(agentsYamlPath);
|
|
18
|
+
const { onDisk, unowned } = await scanSkillsFromDisk(input.domain);
|
|
19
|
+
const yamlSet = new Set(yamlList);
|
|
20
|
+
const diskSet = new Set(onDisk);
|
|
21
|
+
const orphan_skills = yamlList.filter((s) => !diskSet.has(s)).sort();
|
|
22
|
+
const phantom_skills = onDisk.filter((s) => !yamlSet.has(s)).sort();
|
|
23
|
+
return {
|
|
24
|
+
orphan_skills,
|
|
25
|
+
phantom_skills,
|
|
26
|
+
yaml_skew: [],
|
|
27
|
+
unowned: unowned.sort(),
|
|
28
|
+
missing_backlinks: [],
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async function readSkillsFromAgentsYaml(file) {
|
|
32
|
+
const raw = await readFile(file, "utf8").catch(() => "");
|
|
33
|
+
if (!raw)
|
|
34
|
+
return [];
|
|
35
|
+
let parsed;
|
|
36
|
+
try {
|
|
37
|
+
parsed = parseYaml(raw);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
const skills = parsed?.skills;
|
|
43
|
+
return Array.isArray(skills) ? [...skills] : [];
|
|
44
|
+
}
|
|
45
|
+
async function scanSkillsFromDisk(domain) {
|
|
46
|
+
const root = resolveSkillsRoot(domain);
|
|
47
|
+
const entries = await readdir(root, { withFileTypes: true }).catch(() => []);
|
|
48
|
+
const onDisk = [];
|
|
49
|
+
const unowned = [];
|
|
50
|
+
for (const entry of entries) {
|
|
51
|
+
if (!entry.isDirectory())
|
|
52
|
+
continue;
|
|
53
|
+
const file = join(root, entry.name, "SKILL.md");
|
|
54
|
+
const raw = await readFile(file, "utf8").catch(() => null);
|
|
55
|
+
if (!raw)
|
|
56
|
+
continue;
|
|
57
|
+
const stripped = raw.startsWith("") ? raw.slice(1) : raw;
|
|
58
|
+
const m = stripped.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
59
|
+
if (!m)
|
|
60
|
+
continue;
|
|
61
|
+
let parsed;
|
|
62
|
+
try {
|
|
63
|
+
parsed = parseYaml(m[1]);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const obj = parsed;
|
|
69
|
+
const name = obj?.name;
|
|
70
|
+
if (typeof name !== "string" || name !== entry.name)
|
|
71
|
+
continue;
|
|
72
|
+
onDisk.push(name);
|
|
73
|
+
const owners = obj?.owners;
|
|
74
|
+
if (!Array.isArray(owners) || owners.length === 0) {
|
|
75
|
+
unowned.push(name);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return { onDisk, unowned };
|
|
79
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { readFile, unlink } from "node:fs/promises";
|
|
5
|
+
import { npmCommand, spawnWithOutput, tail } from "./_subprocess.js";
|
|
6
|
+
export async function runTests(input) {
|
|
7
|
+
const cwd = input.cwd ?? process.cwd();
|
|
8
|
+
const outFile = join(tmpdir(), `code-ai-vitest-${randomUUID()}.json`);
|
|
9
|
+
const args = ["test", "--", "--reporter=json", `--outputFile=${outFile}`];
|
|
10
|
+
if (input.filter)
|
|
11
|
+
args.push(input.filter);
|
|
12
|
+
const result = await spawnWithOutput(npmCommand(), args, { cwd });
|
|
13
|
+
let raw = null;
|
|
14
|
+
try {
|
|
15
|
+
raw = await readFile(outFile, "utf8");
|
|
16
|
+
await unlink(outFile).catch(() => undefined);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
// no JSON file — subprocess crashed before writing
|
|
20
|
+
}
|
|
21
|
+
if (raw === null) {
|
|
22
|
+
return {
|
|
23
|
+
passed: 0,
|
|
24
|
+
failed: 0,
|
|
25
|
+
duration_ms: result.durationMs,
|
|
26
|
+
failures: [
|
|
27
|
+
{
|
|
28
|
+
code: "subprocess-error",
|
|
29
|
+
message: `npm test did not produce a vitest JSON report (exit=${result.exitCode})`,
|
|
30
|
+
evidence: {
|
|
31
|
+
stderr: tail(result.stderr, 2000),
|
|
32
|
+
stdout: tail(result.stdout, 2000),
|
|
33
|
+
spawnError: result.spawnError?.message,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
let report;
|
|
40
|
+
try {
|
|
41
|
+
report = JSON.parse(raw);
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
return {
|
|
45
|
+
passed: 0,
|
|
46
|
+
failed: 0,
|
|
47
|
+
duration_ms: result.durationMs,
|
|
48
|
+
failures: [
|
|
49
|
+
{
|
|
50
|
+
code: "json-parse-error",
|
|
51
|
+
message: `Failed to parse vitest JSON report: ${err.message}`,
|
|
52
|
+
evidence: { raw: raw.slice(0, 500) },
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return mapReport(report, result.durationMs);
|
|
58
|
+
}
|
|
59
|
+
function mapReport(report, durationMs) {
|
|
60
|
+
const failures = [];
|
|
61
|
+
const totalTests = report.numTotalTests ?? 0;
|
|
62
|
+
if (totalTests === 0 && report.success === false) {
|
|
63
|
+
failures.push({
|
|
64
|
+
code: "no-tests-found",
|
|
65
|
+
message: "vitest ran but found no test files in this project",
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
for (const file of report.testResults ?? []) {
|
|
69
|
+
for (const assertion of file.assertionResults ?? []) {
|
|
70
|
+
if (assertion.status === "failed") {
|
|
71
|
+
const title = assertion.fullName ??
|
|
72
|
+
[...(assertion.ancestorTitles ?? []), assertion.title ?? ""].filter(Boolean).join(" > ");
|
|
73
|
+
const message = (assertion.failureMessages?.[0] ?? "(no failure message)").split("\n")[0] ?? "";
|
|
74
|
+
failures.push({
|
|
75
|
+
code: "test-failed",
|
|
76
|
+
message: `${file.name ?? "<unknown>"} > ${title}: ${message}`,
|
|
77
|
+
evidence: {
|
|
78
|
+
file: file.name,
|
|
79
|
+
title,
|
|
80
|
+
failureMessages: assertion.failureMessages,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
passed: report.numPassedTests ?? 0,
|
|
88
|
+
failed: report.numFailedTests ?? 0,
|
|
89
|
+
duration_ms: durationMs,
|
|
90
|
+
failures,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getGateConfig, loadPipeline } from "../pipeline.js";
|
|
2
2
|
import { readTaskState, writeTaskState } from "../task_state.js";
|
|
3
|
-
|
|
3
|
+
import { recordRunScorecard } from "../audit_ledger.js";
|
|
4
|
+
import { resolveActiveDomain } from "../config.js";
|
|
4
5
|
/**
|
|
5
6
|
* Records a sign-off event for the task's current gate. Validates that:
|
|
6
7
|
* 1. Task exists and is at the named gate.
|
|
@@ -14,7 +15,7 @@ const DEFAULT_DOMAIN = "development";
|
|
|
14
15
|
* records evidence; advance_gate gates on it.
|
|
15
16
|
*/
|
|
16
17
|
export async function signOff(input) {
|
|
17
|
-
const pipeline = await loadPipeline(
|
|
18
|
+
const pipeline = await loadPipeline(await resolveActiveDomain());
|
|
18
19
|
const state = await readTaskState(input.task_id);
|
|
19
20
|
if (!state) {
|
|
20
21
|
throw new Error(`sign_off: no task state for ${input.task_id} (call current_gate or classify_gate first)`);
|
|
@@ -54,5 +55,16 @@ export async function signOff(input) {
|
|
|
54
55
|
evidence: input.evidence,
|
|
55
56
|
});
|
|
56
57
|
await writeTaskState(state);
|
|
58
|
+
// Auditor telemetry: when the terminal gate is signed, the run is complete —
|
|
59
|
+
// append a scorecard to the local ledger. Best-effort: a ledger failure must
|
|
60
|
+
// NEVER break a sign-off (telemetry is not load-bearing for the gate).
|
|
61
|
+
if (input.gate === "RG") {
|
|
62
|
+
try {
|
|
63
|
+
await recordRunScorecard(state);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
/* swallow — see contract in audit_ledger.recordRunScorecard */
|
|
67
|
+
}
|
|
68
|
+
}
|
|
57
69
|
return { signed: true, signer: input.signer, timestamp };
|
|
58
70
|
}
|
package/dist/mcp/tools/stubs.js
CHANGED
|
@@ -16,6 +16,21 @@ import { auditTrail } from "./audit_trail.js";
|
|
|
16
16
|
import { listArtifacts } from "./list_artifacts.js";
|
|
17
17
|
import { getArtifact } from "./get_artifact.js";
|
|
18
18
|
import { verifyClaim } from "./verify_claim.js";
|
|
19
|
+
import { runTests } from "./run_tests.js";
|
|
20
|
+
import { checkLint } from "./check_lint.js";
|
|
21
|
+
import { build } from "./build.js";
|
|
22
|
+
import { applyDiff } from "./apply_diff.js";
|
|
23
|
+
import { gitCommit } from "./git_commit.js";
|
|
24
|
+
import { runDriftAudit } from "./run_drift_audit.js";
|
|
25
|
+
import { auditBudgetCompliance } from "./audit_budget_compliance.js";
|
|
26
|
+
import { auditBilocaleParity } from "./audit_bilocale_parity.js";
|
|
27
|
+
import { aggregateRunMetrics } from "./aggregate_run_metrics.js";
|
|
28
|
+
import { proposeChange } from "./propose_change.js";
|
|
29
|
+
import { listProposals } from "./list_proposals.js";
|
|
30
|
+
import { reviewProposal } from "./review_proposal.js";
|
|
31
|
+
import { e2ePlaywright } from "./e2e_playwright.js";
|
|
32
|
+
import { dockerCompose } from "./docker_compose.js";
|
|
33
|
+
import { dependencySupplyChain } from "./dependency_supply_chain.js";
|
|
19
34
|
/** Thrown by every stub until the real implementation lands. */
|
|
20
35
|
export class NotImplementedError extends Error {
|
|
21
36
|
constructor(tool) {
|
|
@@ -53,13 +68,19 @@ export const DEFAULT_HANDLERS = {
|
|
|
53
68
|
audit_trail: auditTrail,
|
|
54
69
|
recent_decisions: recentDecisions,
|
|
55
70
|
regenerate_manifest: regenerateManifest,
|
|
56
|
-
run_drift_audit:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
71
|
+
run_drift_audit: runDriftAudit,
|
|
72
|
+
audit_budget_compliance: auditBudgetCompliance,
|
|
73
|
+
audit_bilocale_parity: auditBilocaleParity,
|
|
74
|
+
aggregate_run_metrics: aggregateRunMetrics,
|
|
75
|
+
propose_change: proposeChange,
|
|
76
|
+
list_proposals: listProposals,
|
|
77
|
+
review_proposal: reviewProposal,
|
|
78
|
+
run_tests: runTests,
|
|
79
|
+
apply_diff: applyDiff,
|
|
80
|
+
git_commit: gitCommit,
|
|
81
|
+
check_lint: checkLint,
|
|
82
|
+
build,
|
|
83
|
+
dependency_supply_chain: dependencySupplyChain,
|
|
84
|
+
docker_compose: dockerCompose,
|
|
85
|
+
e2e_playwright: e2ePlaywright,
|
|
65
86
|
};
|
|
@@ -3,6 +3,9 @@ import { join } from "node:path";
|
|
|
3
3
|
import { parse as parseYaml } from "yaml";
|
|
4
4
|
import { SkillFrontmatter, TechSeed, TopicSeed, } from "../../shared/index.js";
|
|
5
5
|
import { resolveSkillsRoot } from "../paths.js";
|
|
6
|
+
import { runTests } from "./run_tests.js";
|
|
7
|
+
import { checkLint } from "./check_lint.js";
|
|
8
|
+
import { build } from "./build.js";
|
|
6
9
|
/**
|
|
7
10
|
* Code-verifiable claims. Per the silent-by-default contract, every claim a
|
|
8
11
|
* gate makes ("tests pass", "no orphan skills", "vocab clean") should be
|
|
@@ -31,17 +34,41 @@ export async function verifyClaim(input) {
|
|
|
31
34
|
const result = await checkVocab(domain);
|
|
32
35
|
return result;
|
|
33
36
|
}
|
|
34
|
-
case "tests_pass":
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
case "tests_pass": {
|
|
38
|
+
const cwd = input.args.cwd ?? undefined;
|
|
39
|
+
const r = await runTests({ task_id: input.task_id, cwd });
|
|
40
|
+
return {
|
|
41
|
+
verified: r.failed === 0 && r.failures.length === 0,
|
|
42
|
+
evidence: { passed: r.passed, failed: r.failed, duration_ms: r.duration_ms },
|
|
43
|
+
failures: r.failures,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
case "lint_clean": {
|
|
47
|
+
const cwd = input.args.cwd ?? undefined;
|
|
48
|
+
const r = await checkLint({ task_id: input.task_id, cwd });
|
|
49
|
+
return {
|
|
50
|
+
verified: r.clean,
|
|
51
|
+
evidence: { clean: r.clean },
|
|
52
|
+
failures: r.issues,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
case "build_succeeds": {
|
|
56
|
+
const cwd = input.args.cwd ?? undefined;
|
|
57
|
+
const r = await build({ task_id: input.task_id, cwd });
|
|
58
|
+
return {
|
|
59
|
+
verified: r.succeeded,
|
|
60
|
+
evidence: { succeeded: r.succeeded },
|
|
61
|
+
failures: r.errors,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
37
64
|
case "custom": {
|
|
38
65
|
return {
|
|
39
66
|
verified: false,
|
|
40
|
-
evidence: { reason: `claim_type='
|
|
67
|
+
evidence: { reason: `claim_type='custom' not wired (project-specific dispatcher needed)` },
|
|
41
68
|
failures: [
|
|
42
69
|
{
|
|
43
|
-
code:
|
|
44
|
-
message: `verify_claim: claim_type='
|
|
70
|
+
code: `custom-unwired`,
|
|
71
|
+
message: `verify_claim: claim_type='custom' requires a project-specific dispatcher (not part of DEV-101).`,
|
|
45
72
|
},
|
|
46
73
|
],
|
|
47
74
|
};
|
package/dist/mcp_setup.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DomainId } from "./shared/index.js";
|
|
1
2
|
/**
|
|
2
3
|
* MCP auto-setup for `--target=claude` installs.
|
|
3
4
|
*
|
|
@@ -34,6 +35,12 @@ export interface McpSetupOptions {
|
|
|
34
35
|
wantMempalace: boolean;
|
|
35
36
|
/** When true, no files are written; the report still reflects planned actions. */
|
|
36
37
|
dryRun: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The selected domain, written into `.code-ai/config.json` so the gate tools
|
|
40
|
+
* read this project's pipeline. Undefined for the legacy flat layout (no
|
|
41
|
+
* domains) — then the config omits it and the runtime defaults to development.
|
|
42
|
+
*/
|
|
43
|
+
domain?: DomainId;
|
|
37
44
|
}
|
|
38
45
|
export interface McpSetupReport {
|
|
39
46
|
mempalaceUsed: boolean;
|
|
@@ -83,6 +90,7 @@ export declare function mergeMcpJson(destinationDir: string, servers: Record<str
|
|
|
83
90
|
*/
|
|
84
91
|
export declare function writeCodeAiConfig(destinationDir: string, config: {
|
|
85
92
|
decision_store: "jsonl" | "mempalace";
|
|
93
|
+
domain?: DomainId;
|
|
86
94
|
}, dryRun?: boolean): Promise<{
|
|
87
95
|
path: string;
|
|
88
96
|
}>;
|
package/dist/mcp_setup.js
CHANGED
|
@@ -158,7 +158,10 @@ export async function setupMcp(opts) {
|
|
|
158
158
|
}
|
|
159
159
|
const mcp = await mergeMcpJson(opts.destinationDir, servers, opts.dryRun);
|
|
160
160
|
notices.push(...mcp.notices);
|
|
161
|
-
const cfg = await writeCodeAiConfig(opts.destinationDir, {
|
|
161
|
+
const cfg = await writeCodeAiConfig(opts.destinationDir, {
|
|
162
|
+
decision_store: mempalaceUsed ? "mempalace" : "jsonl",
|
|
163
|
+
...(opts.domain ? { domain: opts.domain } : {}),
|
|
164
|
+
}, opts.dryRun);
|
|
162
165
|
return {
|
|
163
166
|
mempalaceUsed,
|
|
164
167
|
mempalaceInstallAttempted,
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Single source of truth for the `budget_lines` schema caps. Used by the zod
|
|
4
|
+
* schemas below AND imported by audit_budget_compliance (which previously
|
|
5
|
+
* hardcoded duplicate copies — ADR-DEV-108 R1). Change here, not in two places.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SKILL_BUDGET_LINES_MAX = 800;
|
|
8
|
+
export declare const ROLE_BUDGET_LINES_MAX = 650;
|
|
2
9
|
/**
|
|
3
10
|
* Skill frontmatter — the structural anti-drift contract.
|
|
4
11
|
*
|
|
@@ -49,8 +56,24 @@ export declare const SkillFrontmatter: z.ZodObject<{
|
|
|
49
56
|
OPS: "OPS";
|
|
50
57
|
TEST: "TEST";
|
|
51
58
|
RG: "RG";
|
|
59
|
+
STRATEGIST: "STRATEGIST";
|
|
60
|
+
RESEARCHER: "RESEARCHER";
|
|
61
|
+
COPYWRITER: "COPYWRITER";
|
|
62
|
+
VISUAL_CONCEPT: "VISUAL_CONCEPT";
|
|
63
|
+
REVIEWER: "REVIEWER";
|
|
64
|
+
RELEASE_GATE: "RELEASE_GATE";
|
|
65
|
+
INTERVIEWER: "INTERVIEWER";
|
|
66
|
+
DATA_ANALYST: "DATA_ANALYST";
|
|
67
|
+
MEDIATOR: "MEDIATOR";
|
|
68
|
+
DESIGNER: "DESIGNER";
|
|
69
|
+
LAYOUTER: "LAYOUTER";
|
|
70
|
+
DISCOVERY: "DISCOVERY";
|
|
71
|
+
PRODUCT_STRATEGIST: "PRODUCT_STRATEGIST";
|
|
72
|
+
UX_DESIGNER: "UX_DESIGNER";
|
|
73
|
+
TECH_LEAD: "TECH_LEAD";
|
|
52
74
|
}>>>;
|
|
53
75
|
tech: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
76
|
+
mcp: "mcp";
|
|
54
77
|
typescript: "typescript";
|
|
55
78
|
node: "node";
|
|
56
79
|
react: "react";
|
|
@@ -133,7 +156,11 @@ export declare const RoleFrontmatter: z.ZodObject<{
|
|
|
133
156
|
analytics: "analytics";
|
|
134
157
|
product: "product";
|
|
135
158
|
}>;
|
|
136
|
-
|
|
159
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
160
|
+
gate: "gate";
|
|
161
|
+
meta: "meta";
|
|
162
|
+
}>>;
|
|
163
|
+
signs_off_at: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
137
164
|
PM: "PM";
|
|
138
165
|
UX: "UX";
|
|
139
166
|
ARCH: "ARCH";
|
|
@@ -142,7 +169,22 @@ export declare const RoleFrontmatter: z.ZodObject<{
|
|
|
142
169
|
OPS: "OPS";
|
|
143
170
|
TEST: "TEST";
|
|
144
171
|
RG: "RG";
|
|
145
|
-
|
|
172
|
+
STRATEGIST: "STRATEGIST";
|
|
173
|
+
RESEARCHER: "RESEARCHER";
|
|
174
|
+
COPYWRITER: "COPYWRITER";
|
|
175
|
+
VISUAL_CONCEPT: "VISUAL_CONCEPT";
|
|
176
|
+
REVIEWER: "REVIEWER";
|
|
177
|
+
RELEASE_GATE: "RELEASE_GATE";
|
|
178
|
+
INTERVIEWER: "INTERVIEWER";
|
|
179
|
+
DATA_ANALYST: "DATA_ANALYST";
|
|
180
|
+
MEDIATOR: "MEDIATOR";
|
|
181
|
+
DESIGNER: "DESIGNER";
|
|
182
|
+
LAYOUTER: "LAYOUTER";
|
|
183
|
+
DISCOVERY: "DISCOVERY";
|
|
184
|
+
PRODUCT_STRATEGIST: "PRODUCT_STRATEGIST";
|
|
185
|
+
UX_DESIGNER: "UX_DESIGNER";
|
|
186
|
+
TECH_LEAD: "TECH_LEAD";
|
|
187
|
+
}>>>;
|
|
146
188
|
tool_allowlist: z.ZodString;
|
|
147
189
|
budget_lines: z.ZodDefault<z.ZodNumber>;
|
|
148
190
|
schema_version: z.ZodDefault<z.ZodLiteral<1>>;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { DomainId, GateName, SkillType, TechSeed, TopicSeed, } from "./vocabulary.js";
|
|
2
|
+
import { DomainId, GateName, SkillType, TechSeed, TopicSeed, gateBelongsToDomain, } from "./vocabulary.js";
|
|
3
|
+
/**
|
|
4
|
+
* Single source of truth for the `budget_lines` schema caps. Used by the zod
|
|
5
|
+
* schemas below AND imported by audit_budget_compliance (which previously
|
|
6
|
+
* hardcoded duplicate copies — ADR-DEV-108 R1). Change here, not in two places.
|
|
7
|
+
*/
|
|
8
|
+
export const SKILL_BUDGET_LINES_MAX = 800; // ADR-DEV-034 (state-zustand-beast-practices-reference at 750)
|
|
9
|
+
export const ROLE_BUDGET_LINES_MAX = 650; // ADR-DEV-107 (raised 250→500); 500→550 for content agents; 550→650 for product agents (layouter 614, data_analyst 558 + frontmatter, Phase 3)
|
|
3
10
|
/**
|
|
4
11
|
* Skill frontmatter — the structural anti-drift contract.
|
|
5
12
|
*
|
|
@@ -55,25 +62,66 @@ export const SkillFrontmatter = z.object({
|
|
|
55
62
|
* up to 400 (precedent ADR-DEV-021 raised k8s-manifests-conventions workflow to 350).
|
|
56
63
|
* Raised to 800 in ADR-DEV-034 for state-zustand-beast-practices-reference (750)
|
|
57
64
|
* — densest examples skill in codebase, DEN-locked rule prevents trim. */
|
|
58
|
-
budget_lines: z.number().int().positive().max(
|
|
65
|
+
budget_lines: z.number().int().positive().max(SKILL_BUDGET_LINES_MAX).default(300),
|
|
59
66
|
/** Frontmatter version. Bumped when SkillFrontmatter shape changes. */
|
|
60
67
|
schema_version: z.literal(1).default(1),
|
|
61
68
|
/** Optional provenance preserved from pre-migration frontmatter (license/source). */
|
|
62
69
|
license: z.string().optional(),
|
|
63
70
|
source: z.string().url().or(z.string().min(1)).optional(),
|
|
71
|
+
}).superRefine((val, ctx) => {
|
|
72
|
+
// Domain isolation: every gate a skill applies at must belong to the skill's
|
|
73
|
+
// own domain. GateName is the cross-domain union, so without this clause a
|
|
74
|
+
// skill could silently declare a foreign-domain gate. Mirrors the identical
|
|
75
|
+
// RoleFrontmatter clause for agents (signs_off_at).
|
|
76
|
+
for (const gate of val.gates) {
|
|
77
|
+
if (!gateBelongsToDomain(gate, val.domain)) {
|
|
78
|
+
ctx.addIssue({
|
|
79
|
+
code: z.ZodIssueCode.custom,
|
|
80
|
+
path: ["gates"],
|
|
81
|
+
message: `gate '${gate}' does not belong to domain '${val.domain}'`,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
64
85
|
});
|
|
65
86
|
/**
|
|
66
87
|
* Role frontmatter — agent.md header. Defines the role's tool allowlist (referenced by name;
|
|
67
88
|
* MCP resolves to concrete tool set) and which gates the role can sign off on.
|
|
68
89
|
*/
|
|
69
|
-
export const RoleFrontmatter = z
|
|
90
|
+
export const RoleFrontmatter = z
|
|
91
|
+
.object({
|
|
70
92
|
name: AgentName,
|
|
71
93
|
description: z.string().min(1).max(1000),
|
|
72
94
|
domain: DomainId,
|
|
73
|
-
/**
|
|
74
|
-
|
|
95
|
+
/**
|
|
96
|
+
* "gate" — orchestra role that signs delivery gates (the 8 dev agents).
|
|
97
|
+
* "meta" — maintenance agent beside the pipeline that signs NO gates
|
|
98
|
+
* (the Auditor, ADR-DEV-122). Default keeps every existing
|
|
99
|
+
* agent.md (which omits the field) a gate role.
|
|
100
|
+
*/
|
|
101
|
+
kind: z.enum(["gate", "meta"]).default("gate"),
|
|
102
|
+
/** Gates where this role signs off. Required for gate roles; empty for meta. */
|
|
103
|
+
signs_off_at: z.array(GateName).default([]),
|
|
75
104
|
/** Named tool-allowlist policy. MCP looks up the concrete tool list by name. */
|
|
76
105
|
tool_allowlist: z.string().min(1),
|
|
77
|
-
budget_lines: z.number().int().positive().max(
|
|
106
|
+
budget_lines: z.number().int().positive().max(ROLE_BUDGET_LINES_MAX).default(250),
|
|
78
107
|
schema_version: z.literal(1).default(1),
|
|
108
|
+
})
|
|
109
|
+
.superRefine((val, ctx) => {
|
|
110
|
+
if (val.kind === "gate" && val.signs_off_at.length === 0) {
|
|
111
|
+
ctx.addIssue({
|
|
112
|
+
code: z.ZodIssueCode.custom,
|
|
113
|
+
path: ["signs_off_at"],
|
|
114
|
+
message: "gate-kind role must sign off on at least one gate",
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
// Domain isolation: every signed gate must belong to the role's own domain.
|
|
118
|
+
for (const gate of val.signs_off_at) {
|
|
119
|
+
if (!gateBelongsToDomain(gate, val.domain)) {
|
|
120
|
+
ctx.addIssue({
|
|
121
|
+
code: z.ZodIssueCode.custom,
|
|
122
|
+
path: ["signs_off_at"],
|
|
123
|
+
message: `gate '${gate}' does not belong to domain '${val.domain}'`,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
79
127
|
});
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -8,11 +8,6 @@
|
|
|
8
8
|
* Pre-DEV-100 this lived as a separate `@denish1209/types` npm package;
|
|
9
9
|
* DEV-100 consolidated it into `code-ai-installer/src/shared/`. The legacy
|
|
10
10
|
* `@denish1209/types@0.1.0` is deprecated on npm.
|
|
11
|
-
*
|
|
12
|
-
* See ../../../docs/architecture-redesign/ for the source-of-truth specs:
|
|
13
|
-
* - persona-base.md / persona-architecture.md
|
|
14
|
-
* - 2026-05-23-context.md (paradigm shift, principles, artifact caps)
|
|
15
|
-
* - dev-domain-planning-kickoff.md (pipeline.yaml scope)
|
|
16
11
|
*/
|
|
17
12
|
export declare const VERSION = "0.0.0";
|
|
18
13
|
export * from "./vocabulary.js";
|
package/dist/shared/index.js
CHANGED
|
@@ -8,11 +8,6 @@
|
|
|
8
8
|
* Pre-DEV-100 this lived as a separate `@denish1209/types` npm package;
|
|
9
9
|
* DEV-100 consolidated it into `code-ai-installer/src/shared/`. The legacy
|
|
10
10
|
* `@denish1209/types@0.1.0` is deprecated on npm.
|
|
11
|
-
*
|
|
12
|
-
* See ../../../docs/architecture-redesign/ for the source-of-truth specs:
|
|
13
|
-
* - persona-base.md / persona-architecture.md
|
|
14
|
-
* - 2026-05-23-context.md (paradigm shift, principles, artifact caps)
|
|
15
|
-
* - dev-domain-planning-kickoff.md (pipeline.yaml scope)
|
|
16
11
|
*/
|
|
17
12
|
export const VERSION = "0.0.0";
|
|
18
13
|
export * from "./vocabulary.js";
|