@event4u/agent-config 14.10.0 → 14.12.0
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/.augment-plugin/marketplace.json +3 -3
- package/.augment-plugin/plugin.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +161 -208
- package/README.md +1 -1
- package/dist/agent-src/commands/design.md +88 -0
- package/dist/agent-src/commands/project/analyze.md +47 -0
- package/dist/agent-src/commands/review/changes.md +67 -6
- package/dist/agent-src/commands/roadmap/create.md +49 -0
- package/dist/agent-src/commands/roadmap/next.md +27 -11
- package/dist/agent-src/commands/roadmap/process-full.md +14 -0
- package/dist/agent-src/commands/video/from-script.md +60 -3
- package/dist/agent-src/commands/video/stitch.md +14 -0
- package/dist/agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +1 -0
- package/dist/agent-src/contexts/execution/evidence-discipline.md +26 -0
- package/dist/agent-src/contexts/execution/roadmap-process-loop.md +154 -2
- package/dist/agent-src/rules/active-remediation.md +3 -3
- package/dist/agent-src/rules/code-provenance.md +2 -2
- package/dist/agent-src/rules/context-hygiene.md +13 -33
- package/dist/agent-src/rules/council-availability.md +2 -2
- package/dist/agent-src/rules/decision-revisit-gate.md +3 -1
- package/dist/agent-src/rules/design-fidelity.md +18 -0
- package/dist/agent-src/rules/design-review-after-ui-write.md +2 -2
- package/dist/agent-src/rules/evaluator-independence.md +56 -44
- package/dist/agent-src/rules/fix-what-you-see.md +9 -1
- package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +1 -1
- package/dist/agent-src/rules/minimal-safe-diff.md +14 -20
- package/dist/agent-src/rules/missing-skill-recovery.md +13 -1
- package/dist/agent-src/rules/playbook-precedence.md +105 -0
- package/dist/agent-src/rules/recurring-criticism.md +3 -1
- package/dist/agent-src/rules/roadmap-progress-sync.md +14 -13
- package/dist/agent-src/rules/scale-discipline.md +24 -0
- package/dist/agent-src/rules/security-sensitive-stop.md +2 -2
- package/dist/agent-src/rules/settings-ask-protocol.md +2 -2
- package/dist/agent-src/rules/ui-audit-gate.md +27 -15
- package/dist/agent-src/rules/untrusted-input-defense.md +2 -2
- package/dist/agent-src/skills/accessibility-auditor/SKILL.md +19 -0
- package/dist/agent-src/skills/adr-create/SKILL.md +7 -0
- package/dist/agent-src/skills/agents-md-thin-root/SKILL.md +33 -0
- package/dist/agent-src/skills/ai-council/references/advanced-modes.md +17 -3
- package/dist/agent-src/skills/ai-council/references/output-and-synthesis.md +31 -0
- package/dist/agent-src/skills/ai-council/references/procedure.md +19 -0
- package/dist/agent-src/skills/alerting-doctrine/SKILL.md +225 -0
- package/dist/agent-src/skills/authz-review/SKILL.md +0 -1
- package/dist/agent-src/skills/blast-radius-analyzer/SKILL.md +32 -0
- package/dist/agent-src/skills/brand/SKILL.md +3 -0
- package/dist/agent-src/skills/brand-asset-generation/SKILL.md +3 -0
- package/dist/agent-src/skills/brand-audit/SKILL.md +3 -0
- package/dist/agent-src/skills/brand-identity/SKILL.md +3 -0
- package/dist/agent-src/skills/brand-strategy/SKILL.md +3 -0
- package/dist/agent-src/skills/brand-to-tokens/SKILL.md +3 -0
- package/dist/agent-src/skills/check-refs/SKILL.md +3 -0
- package/dist/agent-src/skills/code-refactoring/SKILL.md +45 -1
- package/dist/agent-src/skills/code-review/SKILL.md +75 -5
- package/dist/agent-src/skills/command-routing/SKILL.md +6 -0
- package/dist/agent-src/skills/command-writing/SKILL.md +35 -0
- package/dist/agent-src/skills/condense-memory/SKILL.md +3 -0
- package/dist/agent-src/skills/context-authoring/SKILL.md +1 -1
- package/dist/agent-src/skills/conventional-commits-writing/SKILL.md +3 -0
- package/dist/agent-src/skills/copilot-agents-optimization/SKILL.md +10 -0
- package/dist/agent-src/skills/corpus-grounding/SKILL.md +3 -0
- package/dist/agent-src/skills/design-intelligence/SKILL.md +3 -0
- package/dist/agent-src/skills/design-intelligence/data/landing.csv +36 -35
- package/dist/agent-src/skills/design-intelligence/data/stacks/threejs.csv +1 -0
- package/dist/agent-src/skills/design-review/SKILL.md +79 -1
- package/dist/agent-src/skills/design-review/references/verification-automation.md +41 -0
- package/dist/agent-src/skills/design-system-capture/SKILL.md +35 -40
- package/dist/agent-src/skills/design-system-capture/references/import-procedure.md +50 -0
- package/dist/agent-src/skills/design-tokens/SKILL.md +3 -0
- package/dist/agent-src/skills/design-variations/SKILL.md +3 -0
- package/dist/agent-src/skills/developer-like-execution/SKILL.md +3 -0
- package/dist/agent-src/skills/estimate-ticket/SKILL.md +3 -0
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +28 -4
- package/dist/agent-src/skills/fe-design/SKILL.md +74 -41
- package/dist/agent-src/skills/fe-design/references/craft-floor.md +52 -0
- package/dist/agent-src/skills/fe-design/references/source-led-port.md +36 -0
- package/dist/agent-src/skills/file-editor/SKILL.md +5 -0
- package/dist/agent-src/skills/finishing-a-development-branch/SKILL.md +2 -2
- package/dist/agent-src/skills/git-workflow/SKILL.md +3 -0
- package/dist/agent-src/skills/html-deck/SKILL.md +3 -0
- package/dist/agent-src/skills/iconography/SKILL.md +3 -0
- package/dist/agent-src/skills/image-editing/SKILL.md +3 -0
- package/dist/agent-src/skills/image-generation/SKILL.md +3 -0
- package/dist/agent-src/skills/image-provider-routing/SKILL.md +3 -0
- package/dist/agent-src/skills/incident-commander/SKILL.md +10 -0
- package/dist/agent-src/skills/js-library-packaging/SKILL.md +173 -0
- package/dist/agent-src/skills/js-library-packaging/scripts/check_package_surface.ts +270 -0
- package/dist/agent-src/skills/laravel-migration/SKILL.md +3 -0
- package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +3 -0
- package/dist/agent-src/skills/lint-skills/SKILL.md +3 -0
- package/dist/agent-src/skills/llm-provider-knowledge/SKILL.md +3 -0
- package/dist/agent-src/skills/logging-monitoring/SKILL.md +234 -51
- package/dist/agent-src/skills/logo-generation/SKILL.md +3 -0
- package/dist/agent-src/skills/md-language-check/SKILL.md +3 -0
- package/dist/agent-src/skills/monorepo-workspace/SKILL.md +149 -0
- package/dist/agent-src/skills/motion-choreographer/SKILL.md +6 -0
- package/dist/agent-src/skills/multi-tenancy/SKILL.md +4 -0
- package/dist/agent-src/skills/operational-readiness/SKILL.md +184 -0
- package/dist/agent-src/skills/override-management/SKILL.md +3 -0
- package/dist/agent-src/skills/persona-improvement/SKILL.md +3 -0
- package/dist/agent-src/skills/pest-testing/SKILL.md +3 -0
- package/dist/agent-src/skills/playbook-authoring/SKILL.md +162 -0
- package/dist/agent-src/skills/playwright-testing/SKILL.md +3 -0
- package/dist/agent-src/skills/privacy-review/SKILL.md +3 -0
- package/dist/agent-src/skills/project-analysis-core/SKILL.md +23 -0
- package/dist/agent-src/skills/prompt-engineering-image/SKILL.md +3 -0
- package/dist/agent-src/skills/quality-tools/SKILL.md +5 -0
- package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +81 -33
- package/dist/agent-src/skills/readme-reviewer/SKILL.md +3 -0
- package/dist/agent-src/skills/readme-writing/SKILL.md +3 -0
- package/dist/agent-src/skills/readme-writing-package/SKILL.md +3 -0
- package/dist/agent-src/skills/receiving-code-review/SKILL.md +2 -2
- package/dist/agent-src/skills/refine-prompt/SKILL.md +3 -0
- package/dist/agent-src/skills/refine-ticket/SKILL.md +3 -0
- package/dist/agent-src/skills/requesting-code-review/SKILL.md +2 -2
- package/dist/agent-src/skills/review-routing/SKILL.md +2 -2
- package/dist/agent-src/skills/roadmap-writing/SKILL.md +23 -41
- package/dist/agent-src/skills/roadmap-writing/references/follow-up-roadmap-shape.md +47 -0
- package/dist/agent-src/skills/rtk-output-filtering/SKILL.md +22 -6
- package/dist/agent-src/skills/runway-cognition/SKILL.md +3 -0
- package/dist/agent-src/skills/scene-expander/scene-blueprint.schema.yaml +26 -0
- package/dist/agent-src/skills/secrets-management/SKILL.md +4 -0
- package/dist/agent-src/skills/server-hardening/SKILL.md +159 -0
- package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +3 -0
- package/dist/agent-src/skills/skill-management/SKILL.md +3 -0
- package/dist/agent-src/skills/skill-reviewer/SKILL.md +3 -0
- package/dist/agent-src/skills/skill-writing/SKILL.md +6 -0
- package/dist/agent-src/skills/skill-writing/references/procedure.md +24 -2
- package/dist/agent-src/skills/spreadsheet-authoring/SKILL.md +3 -0
- package/dist/agent-src/skills/storybook-workshop/SKILL.md +203 -0
- package/dist/agent-src/skills/storybook-workshop/scripts/story_contrast_floor.ts +134 -0
- package/dist/agent-src/skills/subagent-orchestration/SKILL.md +1 -1
- package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +25 -0
- package/dist/agent-src/skills/supply-chain-intake/SKILL.md +12 -0
- package/dist/agent-src/skills/systematic-debugging/SKILL.md +1 -1
- package/dist/agent-src/skills/terraform/SKILL.md +3 -0
- package/dist/agent-src/skills/test-driven-development/SKILL.md +1 -1
- package/dist/agent-src/skills/threat-modeling/SKILL.md +0 -3
- package/dist/agent-src/skills/token-optimizer/SKILL.md +3 -0
- package/dist/agent-src/skills/typography-system/SKILL.md +3 -0
- package/dist/agent-src/skills/ui-component-architect/SKILL.md +17 -1
- package/dist/agent-src/skills/upstream-contribute/SKILL.md +3 -0
- package/dist/agent-src/skills/validate-feature-fit/SKILL.md +3 -0
- package/dist/agent-src/skills/verify-completion-evidence/SKILL.md +2 -2
- package/dist/agent-src/skills/wireframe/SKILL.md +3 -0
- package/dist/agent-src/skills/wireframe/references/story-beat-ledger.schema.json +115 -0
- package/dist/agent-src/skills/workspace-link/SKILL.md +131 -0
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/playbook.md +75 -0
- package/dist/agent-src/templates/roadmaps.md +37 -0
- package/dist/agent-src/templates/scripts/check_playbook_invokes.ts +231 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +24 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +216 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +159 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +73 -4
- package/dist/agent-src/templates/scripts/work_engine/stack/detect.ts +325 -40
- package/dist/cli/commands/uiAudit.js +221 -0
- package/dist/cli/commands/uiRender.js +206 -0
- package/dist/cli/main.js +22 -1
- package/dist/cli/mcp/content.js +64 -1
- package/dist/cli/mcp/dispatch.js +175 -10
- package/dist/cli/registry.js +3 -0
- package/dist/cli-delegate/{chunk-G23AT6GD.js → chunk-DMSZHXZS.js} +57 -1
- package/dist/cli-delegate/{chunk-77GR3VD4.js → chunk-FF7WAFMR.js} +58 -3
- package/dist/cli-delegate/{chunk-YM4GZDJG.js → chunk-JCW7ZLHK.js} +10 -0
- package/dist/cli-delegate/{chunk-H4VIVD4C.js → chunk-JJA2QEWA.js} +413 -391
- package/dist/cli-delegate/{chunk-PLSG6UL5.js → chunk-K4FFODTS.js} +341 -204
- package/dist/cli-delegate/{chunk-B2ERU2VA.js → chunk-WOKWX5PL.js} +1 -1
- package/dist/cli-delegate/cmd_brand_status.js +8 -6
- package/dist/cli-delegate/cmd_conformance.js +3 -3
- package/dist/cli-delegate/cmd_doctor.js +3 -3
- package/dist/cli-delegate/cmd_export.js +4 -4
- package/dist/cli-delegate/cmd_handoff.js +1 -1
- package/dist/cli-delegate/cmd_preflight.js +2 -2
- package/dist/cli-delegate/cmd_prune.js +4 -4
- package/dist/cli-delegate/cmd_session_recycle.js +70 -9
- package/dist/cli-delegate/cmd_settings_migrate.js +4 -4
- package/dist/cli-delegate/cmd_settings_set.js +1 -1
- package/dist/cli-delegate/cmd_sync.js +4 -4
- package/dist/cli-delegate/cmd_uninstall.js +4 -4
- package/dist/cli-delegate/cmd_validate.js +4 -4
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +362 -127
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +4 -4
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +18 -8
- package/dist/discovery/trust-report.md +3 -3
- package/dist/discovery/workspaces.json +16 -6
- package/dist/hooks/dispatch.js +2575 -1472
- package/dist/install/install.mjs +800 -708
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +1685 -1250
- package/dist/router.json +1 -1
- package/dist/scripts/_lib/lean_projection_mode.js +40 -0
- package/dist/scripts/_lib/scoped_projection.js +84 -0
- package/dist/scripts/_lib/ui_surface.js +89 -0
- package/dist/scripts/condense.js +6 -10
- package/dist/scripts/project_thin_rules.js +40 -2
- package/dist/server/schemas/settings.js +6 -0
- package/dist/shared/skillRanking.js +159 -0
- package/docs/contracts/provider-lifecycle.md +47 -18
- package/docs/contracts/settings-classes.md +35 -5
- package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +49 -0
- package/docs/guidelines/agent-infra/downstream-changes-mechanics.md +91 -0
- package/docs/guidelines/agent-infra/evaluator-independence-mechanics.md +92 -0
- package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +45 -1
- package/docs/guidelines/agent-infra/roadmap-deferred-resolution-provenance.md +54 -0
- package/docs/guidelines/code-clarity.md +21 -0
- package/docs/guidelines/design-antipatterns.md +4 -2
- package/docs/guidelines/design-asset-discipline.md +38 -0
- package/docs/guidelines/design-fidelity-mechanics.md +45 -29
- package/docs/guidelines/design-handover-extraction.md +35 -5
- package/docs/guidelines/design-modes.md +41 -1
- package/docs/guidelines/monorepo-antipatterns.md +141 -0
- package/docs/guidelines/redundancy-taxonomy.md +180 -0
- package/llms.txt +50 -39
- package/package.json +6 -2
- package/src/agent-src/templates/scripts/check_playbook_invokes.ts +231 -0
- package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +24 -0
- package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +2 -0
- package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +216 -0
- package/src/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +159 -0
- package/src/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +73 -4
- package/src/agent-src/templates/scripts/work_engine/stack/detect.ts +325 -40
- package/src/config/agent-settings.template.yml +44 -0
- package/src/config/assurance-capability-registry.json +223 -0
- package/src/config/assurance-threshold-budget.json +65 -0
- package/src/config/budgets.yml +19 -0
- package/src/config/ci-local-parity.yml +29 -0
- package/src/config/discovery/prompt-patterns.yml +56 -0
- package/src/config/discovery/unassigned-artefacts.yml +2 -0
- package/src/config/dispatch-economy-metrics.json +4 -2
- package/src/config/estate-count-budget.json +8 -3
- package/src/config/evaluator-budgets.json +14 -14
- package/src/config/gate-coverage.yml +392 -8
- package/src/config/gate-violation-baselines.json +76 -72
- package/src/config/hook-latency-budget.json +1 -0
- package/src/config/hook-token-budget.json +137 -125
- package/src/config/pack-size-budget.json +39 -10
- package/src/config/preamble-payload-budget.json +97 -71
- package/src/config/quorum-attendance-budget.json +12 -4
- package/src/config/routing-coverage-seed.json +29 -0
- package/src/config/rule-activation-census.json +7 -3
- package/src/config/rule-enforcement-baseline.json +0 -1
- package/src/config/rule-stub-ceilings.json +112 -91
- package/src/config/suggestion-capture.json +28 -0
- package/src/config/surface-matrix.yml +21 -2
- package/src/config/web-launch-readiness.json +188 -0
- package/src/scripts/_cli/cmd_doctor.ts +15 -16
- package/src/scripts/_cli/doctor_install_mode.ts +49 -0
- package/src/scripts/_cli/doctor_overrides.ts +154 -0
- package/src/scripts/_dispatch.bash +17 -0
- package/src/scripts/_lib/as_of.ts +412 -0
- package/src/scripts/_lib/exec_evidence.ts +7 -0
- package/src/scripts/_lib/gate_baseline.ts +150 -1
- package/src/scripts/_lib/hook_settings.ts +33 -0
- package/src/scripts/_lib/host_listing_model.ts +192 -0
- package/src/scripts/_lib/lean_projection_mode.ts +44 -0
- package/src/scripts/_lib/mcp_bridge.ts +199 -0
- package/src/scripts/_lib/review_independence.ts +62 -10
- package/src/scripts/_lib/rule_injection.ts +239 -0
- package/src/scripts/_lib/run_checkpoint.ts +54 -1
- package/src/scripts/_lib/scoped_projection.ts +96 -0
- package/src/scripts/_lib/session_register.ts +44 -2
- package/src/scripts/_lib/skill_catalogue.ts +38 -2
- package/src/scripts/_lib/skill_estate.ts +115 -0
- package/src/scripts/_lib/transcript_reads.ts +207 -0
- package/src/scripts/_lib/ui_authority.ts +343 -0
- package/src/scripts/ai-video/adapters/fal.sh +8 -3
- package/src/scripts/ai-video/adapters/gemini-veo.sh +10 -0
- package/src/scripts/ai-video/adapters/higgsfield.sh +10 -2
- package/src/scripts/ai-video/adapters/kling.sh +10 -0
- package/src/scripts/ai-video/adapters/sora.sh +10 -0
- package/src/scripts/ai-video/lib/calibrate-cost.sh +145 -0
- package/src/scripts/ai-video/lib/model-capabilities/README.md +53 -7
- package/src/scripts/ai-video/lib/model-capabilities/comfyui.json +15 -3
- package/src/scripts/ai-video/lib/model-capabilities/fal.json +36 -6
- package/src/scripts/ai-video/lib/model-capabilities/gemini-veo.json +23 -0
- package/src/scripts/ai-video/lib/model-capabilities/higgsfield.json +23 -0
- package/src/scripts/ai-video/lib/model-capabilities/kling.json +23 -0
- package/src/scripts/ai-video/lib/model-capabilities/musetalk.json +8 -2
- package/src/scripts/ai-video/lib/model-capabilities/replicate.json +36 -6
- package/src/scripts/ai-video/lib/model-capabilities/sora.json +45 -0
- package/src/scripts/ai-video/lib/model-capabilities/syncso.json +8 -2
- package/src/scripts/ai-video/lib/parse-blueprint.sh +52 -5
- package/src/scripts/ai-video/lib/resume-scan.sh +92 -3
- package/src/scripts/ai-video/lib/seam-plan.sh +212 -0
- package/src/scripts/ai-video/smoke-trace.sh +450 -2
- package/src/scripts/ai-video/stitch.sh +191 -10
- package/src/scripts/ai-video/test-pipeline.sh +84 -6
- package/src/scripts/ai_council/argument_exhaustion.ts +130 -0
- package/src/scripts/ai_council/cli_agency_bounds.ts +139 -0
- package/src/scripts/ai_council/cli_least_agency_canary.ts +347 -0
- package/src/scripts/ai_council/clients.ts +3 -2
- package/src/scripts/ai_council/consensus.ts +63 -6
- package/src/scripts/ai_council/events_log.ts +46 -1
- package/src/scripts/ai_council/orchestrator.ts +103 -108
- package/src/scripts/ai_council/orchestrator_results.ts +166 -0
- package/src/scripts/ai_council/prompts.ts +12 -5
- package/src/scripts/ai_council/quorum.ts +82 -1
- package/src/scripts/ai_council/quorum_wiring.ts +82 -5
- package/src/scripts/ai_council/stance_tally.ts +22 -0
- package/src/scripts/bench_hook_latency.ts +62 -0
- package/src/scripts/build_proof.ts +12 -1
- package/src/scripts/capture_skill_catalogue.ts +21 -0
- package/src/scripts/check_always_budget.ts +2 -1
- package/src/scripts/check_augmentignore.ts +2 -1
- package/src/scripts/check_beta_review_markers.ts +2 -1
- package/src/scripts/check_bundle_path_leakage.ts +162 -7
- package/src/scripts/check_command_examples.ts +557 -0
- package/src/scripts/check_composite_arming.ts +364 -0
- package/src/scripts/check_corpus_staleness.ts +2 -1
- package/src/scripts/check_council_pin_staleness.ts +3 -1
- package/src/scripts/check_enforcement_coverage.ts +116 -3
- package/src/scripts/check_enforcement_denominator.ts +365 -0
- package/src/scripts/check_estate_count.ts +122 -3
- package/src/scripts/check_gate_coverage.ts +2 -1
- package/src/scripts/check_hook_bundle_freshness.ts +13 -1
- package/src/scripts/check_knowledge_cards.ts +2 -1
- package/src/scripts/check_knowledge_pages.ts +3 -2
- package/src/scripts/check_memory.ts +2 -1
- package/src/scripts/check_no_automerge_key.ts +287 -0
- package/src/scripts/check_pack_conformance_fixture.ts +565 -0
- package/src/scripts/check_preamble_payload_budget.ts +30 -3
- package/src/scripts/check_proposal.ts +2 -1
- package/src/scripts/check_reach_staleness.ts +2 -1
- package/src/scripts/check_release_adjacent_health.ts +2 -1
- package/src/scripts/check_release_pr_shape.ts +5 -0
- package/src/scripts/check_review_schema.ts +34 -1
- package/src/scripts/check_roadmap_trackable.ts +48 -3
- package/src/scripts/check_routing_coverage.ts +352 -0
- package/src/scripts/check_score_contract.ts +505 -0
- package/src/scripts/check_skill_admissions.ts +514 -0
- package/src/scripts/check_source_size_budget.ts +2 -1
- package/src/scripts/check_standing_payload_delta.ts +505 -0
- package/src/scripts/check_trigger_evals.ts +2 -1
- package/src/scripts/check_web_launch_readiness.ts +705 -0
- package/src/scripts/classify_change_risk.ts +281 -0
- package/src/scripts/compute_skill_tiers.ts +186 -0
- package/src/scripts/condense.ts +8 -13
- package/src/scripts/council_attendance_metrics.ts +183 -0
- package/src/scripts/council_cli.ts +10 -8
- package/src/scripts/council_parse_rate.ts +116 -0
- package/src/scripts/derive_playbooks.ts +406 -0
- package/src/scripts/description_route_check.ts +494 -0
- package/src/scripts/design_slop_rules.ts +56 -2
- package/src/scripts/dispatch_r2_reviewer.ts +16 -0
- package/src/scripts/frontend_corpus_hash.ts +116 -0
- package/src/scripts/grade_target_readiness.ts +478 -0
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +124 -16
- package/src/scripts/hooks/concern_registry.ts +6 -0
- package/src/scripts/hooks/design_pass_hook.ts +356 -0
- package/src/scripts/hooks/rtk_wrap_hook.ts +30 -7
- package/src/scripts/hooks/rule_inject_hook.ts +318 -0
- package/src/scripts/hooks/suggestion_capture_hook.ts +368 -0
- package/src/scripts/hot_context_hook.ts +74 -7
- package/src/scripts/install.ts +40 -89
- package/src/scripts/lint_adapter_tier.ts +663 -0
- package/src/scripts/lint_archived_skills.ts +93 -0
- package/src/scripts/lint_budget_ownership.ts +56 -5
- package/src/scripts/lint_deterministic_time.ts +470 -0
- package/src/scripts/lint_framework_leakage.ts +5 -0
- package/src/scripts/lint_handoffs.ts +525 -1
- package/src/scripts/lint_judge_prompt_expectation.ts +155 -0
- package/src/scripts/lint_marketplace.ts +88 -0
- package/src/scripts/lint_media_policy_linkage.ts +140 -1
- package/src/scripts/lint_one_off_age.ts +6 -1
- package/src/scripts/lint_override_kernel_guard.ts +87 -5
- package/src/scripts/lint_roadmap_complexity.ts +56 -0
- package/src/scripts/lint_rule_enforcement_declaration.ts +24 -7
- package/src/scripts/lint_rule_norm_pin.ts +321 -0
- package/src/scripts/lint_skill_trigger_corpus.ts +349 -0
- package/src/scripts/lint_spawn_payload.ts +42 -5
- package/src/scripts/lint_symptom_intake.ts +2 -1
- package/src/scripts/mcp_parity_smoke.ts +30 -4
- package/src/scripts/mcp_render.ts +66 -1
- package/src/scripts/mcp_tool_fingerprint.ts +241 -0
- package/src/scripts/measure_risk_class_drift.ts +140 -0
- package/src/scripts/measure_skill_ranker_baseline.ts +212 -0
- package/src/scripts/media/lib/adapter-common.sh +211 -1
- package/src/scripts/media/lib/adapter-contract.md +74 -6
- package/src/scripts/model_rule_injection.ts +907 -0
- package/src/scripts/pack_install_smoke.ts +363 -0
- package/src/scripts/pr_conflict_census.ts +187 -0
- package/src/scripts/project_thin_rules.ts +45 -2
- package/src/scripts/release.ts +66 -860
- package/src/scripts/release_drill.ts +59 -3
- package/src/scripts/release_env.ts +298 -0
- package/src/scripts/release_publication.ts +720 -0
- package/src/scripts/report_pack_delta.ts +204 -0
- package/src/scripts/roadmap_context.ts +778 -0
- package/src/scripts/schemas/fidelity-measurement-sheet.schema.json +169 -0
- package/src/scripts/schemas/rule.schema.json +24 -2
- package/src/scripts/schemas/skill.schema.json +39 -0
- package/src/scripts/schemas/ui-authority.schema.json +114 -0
- package/src/scripts/select_analysis_mode.ts +112 -0
- package/src/scripts/session_register_hook.ts +29 -3
- package/src/scripts/sessions_cli.ts +67 -3
- package/src/scripts/skill_tools/score_skill_relevance.ts +36 -53
- package/src/scripts/sync_pr_branch.ts +40 -1
- package/src/scripts/token_sink_report.ts +239 -0
- package/src/scripts/trigger_coverage.ts +122 -3
- package/src/scripts/update_counts.ts +7 -3
- package/src/scripts/validate_frontmatter.ts +66 -0
- package/src/server/schemas/settings.ts +10 -0
- package/src/shared/skillRanking.ts +183 -0
- package/dist/agent-src/skills/accessibility-auditor/evals/evals.json +0 -15
- package/dist/agent-src/skills/agent-security-review/evals/triggers.json +0 -52
- package/dist/agent-src/skills/ai-code-blindspots/evals/triggers.json +0 -52
- package/dist/agent-src/skills/analysis-skill-router/evals/evals.json +0 -13
- package/dist/agent-src/skills/brand/evals/triggers.json +0 -17
- package/dist/agent-src/skills/brand-asset-generation/evals/triggers.json +0 -17
- package/dist/agent-src/skills/brand-audit/evals/triggers.json +0 -17
- package/dist/agent-src/skills/brand-identity/evals/triggers.json +0 -17
- package/dist/agent-src/skills/brand-strategy/evals/triggers.json +0 -17
- package/dist/agent-src/skills/brand-to-tokens/evals/triggers.json +0 -17
- package/dist/agent-src/skills/bug-analyzer/evals/evals.json +0 -13
- package/dist/agent-src/skills/canvas-design/evals/triggers.json +0 -17
- package/dist/agent-src/skills/character-consistency/evals/evals.json +0 -16
- package/dist/agent-src/skills/code-intelligence/evals/triggers.json +0 -52
- package/dist/agent-src/skills/code-review/evals/evals.json +0 -100
- package/dist/agent-src/skills/command-routing/evals/evals.json +0 -14
- package/dist/agent-src/skills/complexity-first-planning/evals/triggers.json +0 -17
- package/dist/agent-src/skills/contract-review/evals/triggers.json +0 -17
- package/dist/agent-src/skills/conventional-commits-writing/evals/evals.json +0 -15
- package/dist/agent-src/skills/corpus-grounding/evals/triggers.json +0 -17
- package/dist/agent-src/skills/dashboard-design/evals/evals.json +0 -16
- package/dist/agent-src/skills/dcf-modeling/evals/domain-truth.json +0 -29
- package/dist/agent-src/skills/dcf-modeling/evals/evals.json +0 -20
- package/dist/agent-src/skills/decision-record/evals/evals.json +0 -20
- package/dist/agent-src/skills/decision-record/evals/triggers.json +0 -87
- package/dist/agent-src/skills/design-intelligence/evals/evals.json +0 -14
- package/dist/agent-src/skills/design-intelligence/evals/triggers.json +0 -17
- package/dist/agent-src/skills/design-system-capture/evals/evals.json +0 -15
- package/dist/agent-src/skills/design-tokens/evals/triggers.json +0 -17
- package/dist/agent-src/skills/design-variations/evals/triggers.json +0 -17
- package/dist/agent-src/skills/developer-like-execution/evals/evals.json +0 -16
- package/dist/agent-src/skills/doc-coauthoring/evals/evals.json +0 -16
- package/dist/agent-src/skills/doc-coauthoring/evals/triggers.json +0 -17
- package/dist/agent-src/skills/docx-authoring/evals/triggers.json +0 -52
- package/dist/agent-src/skills/dpa-review/evals/triggers.json +0 -17
- package/dist/agent-src/skills/editorial-calendar/evals/domain-truth.json +0 -16
- package/dist/agent-src/skills/editorial-calendar/evals/evals.json +0 -16
- package/dist/agent-src/skills/eloquent/evals/triggers.json +0 -17
- package/dist/agent-src/skills/estimate-ticket/evals/evals.json +0 -16
- package/dist/agent-src/skills/estimate-ticket/evals/output-schema.yml +0 -20
- package/dist/agent-src/skills/estimate-ticket/evals/triggers.json +0 -19
- package/dist/agent-src/skills/evaluate-llm-feature/evals/triggers.json +0 -52
- package/dist/agent-src/skills/existing-ui-audit/evals/triggers.json +0 -47
- package/dist/agent-src/skills/experiment-loop/evals/output-schema.yml +0 -27
- package/dist/agent-src/skills/experiment-loop/evals/triggers.json +0 -17
- package/dist/agent-src/skills/fe-design/evals/triggers.json +0 -55
- package/dist/agent-src/skills/forecasting/evals/domain-truth.json +0 -29
- package/dist/agent-src/skills/forecasting/evals/evals.json +0 -20
- package/dist/agent-src/skills/forensics-report/evals/triggers.json +0 -17
- package/dist/agent-src/skills/frontend-render-security/evals/triggers.json +0 -52
- package/dist/agent-src/skills/fundraising-narrative/evals/domain-truth.json +0 -16
- package/dist/agent-src/skills/fundraising-narrative/evals/evals.json +0 -16
- package/dist/agent-src/skills/gated-reach/evals/triggers.json +0 -72
- package/dist/agent-src/skills/github-ci/evals/evals.json +0 -25
- package/dist/agent-src/skills/history-design/evals/triggers.json +0 -17
- package/dist/agent-src/skills/html-deck/evals/triggers.json +0 -17
- package/dist/agent-src/skills/humanizer/evals/strip_fixtures.json +0 -57
- package/dist/agent-src/skills/humanizer/evals/triggers.json +0 -17
- package/dist/agent-src/skills/iconography/evals/triggers.json +0 -17
- package/dist/agent-src/skills/image-analyser/evals/triggers.json +0 -17
- package/dist/agent-src/skills/image-creator/evals/triggers.json +0 -17
- package/dist/agent-src/skills/image-editing/evals/triggers.json +0 -17
- package/dist/agent-src/skills/image-generation/evals/triggers.json +0 -17
- package/dist/agent-src/skills/image-provider-routing/evals/triggers.json +0 -17
- package/dist/agent-src/skills/incident-commander/evals/domain-truth.json +0 -16
- package/dist/agent-src/skills/incident-commander/evals/evals.json +0 -20
- package/dist/agent-src/skills/judge-artifact-completeness/evals/triggers.json +0 -17
- package/dist/agent-src/skills/judge-injection-defense/evals/triggers.json +0 -17
- package/dist/agent-src/skills/judge-synthesis/evals/triggers.json +0 -17
- package/dist/agent-src/skills/launch-readiness/evals/evals.json +0 -21
- package/dist/agent-src/skills/learning-tutor/evals/triggers.json +0 -52
- package/dist/agent-src/skills/legal-intake-triage/evals/triggers.json +0 -17
- package/dist/agent-src/skills/legal-practice-profile/evals/triggers.json +0 -17
- package/dist/agent-src/skills/license-compliance-audit/evals/triggers.json +0 -52
- package/dist/agent-src/skills/license-compliance-borrow-check/evals/triggers.json +0 -52
- package/dist/agent-src/skills/license-compliance-credits/evals/triggers.json +0 -52
- package/dist/agent-src/skills/llm-provider-knowledge/evals/triggers.json +0 -20
- package/dist/agent-src/skills/logging-monitoring/evals/evals.json +0 -16
- package/dist/agent-src/skills/logo-generation/evals/triggers.json +0 -17
- package/dist/agent-src/skills/messaging-architecture/evals/domain-truth.json +0 -16
- package/dist/agent-src/skills/messaging-architecture/evals/evals.json +0 -16
- package/dist/agent-src/skills/nda-triage/evals/triggers.json +0 -17
- package/dist/agent-src/skills/pdf-tools/evals/triggers.json +0 -52
- package/dist/agent-src/skills/perf-feedback-craft/evals/evals.json +0 -16
- package/dist/agent-src/skills/persona-improvement/evals/triggers.json +0 -52
- package/dist/agent-src/skills/php-coder/evals/triggers.json +0 -17
- package/dist/agent-src/skills/prediction-pool-optimizer/evals/triggers.json +0 -21
- package/dist/agent-src/skills/prompt-engineering-image/evals/triggers.json +0 -17
- package/dist/agent-src/skills/prompt-engineering-patterns/evals/evals.json +0 -16
- package/dist/agent-src/skills/prompt-validator/evals/triggers.json +0 -17
- package/dist/agent-src/skills/quality-tools/evals/evals.json +0 -15
- package/dist/agent-src/skills/reasoning-orchestrator/evals/triggers.json +0 -17
- package/dist/agent-src/skills/refine-prompt/evals/evals.json +0 -16
- package/dist/agent-src/skills/refine-ticket/evals/evals.json +0 -16
- package/dist/agent-src/skills/refine-ticket/evals/output-schema.yml +0 -16
- package/dist/agent-src/skills/refine-ticket/evals/triggers.json +0 -17
- package/dist/agent-src/skills/release-comms/evals/evals.json +0 -16
- package/dist/agent-src/skills/rice-prioritization/evals/evals.json +0 -20
- package/dist/agent-src/skills/runway-cognition/evals/domain-truth.json +0 -29
- package/dist/agent-src/skills/runway-cognition/evals/evals.json +0 -20
- package/dist/agent-src/skills/scenario-modeling/evals/domain-truth.json +0 -29
- package/dist/agent-src/skills/scenario-modeling/evals/evals.json +0 -20
- package/dist/agent-src/skills/schema-review/evals/triggers.json +0 -17
- package/dist/agent-src/skills/screenshot-hygiene/evals/triggers.json +0 -52
- package/dist/agent-src/skills/security-maturity-assessment/evals/triggers.json +0 -52
- package/dist/agent-src/skills/skill-writing/evals/triggers.json +0 -17
- package/dist/agent-src/skills/spreadsheet-authoring/evals/triggers.json +0 -47
- package/dist/agent-src/skills/subagent-orchestration/evals/evals.json +0 -60
- package/dist/agent-src/skills/supply-chain-intake/evals/triggers.json +0 -52
- package/dist/agent-src/skills/systematic-debugging/evals/evals.json +0 -20
- package/dist/agent-src/skills/test-case-discovery/evals/triggers.json +0 -52
- package/dist/agent-src/skills/test-driven-development/evals/evals.json +0 -16
- package/dist/agent-src/skills/threat-modeling/evals/evals.json +0 -21
- package/dist/agent-src/skills/typography-system/evals/evals.json +0 -14
- package/dist/agent-src/skills/typography-system/evals/triggers.json +0 -17
- package/dist/agent-src/skills/unit-economics-modeling/evals/domain-truth.json +0 -40
- package/dist/agent-src/skills/unit-economics-modeling/evals/evals.json +0 -24
- package/dist/agent-src/skills/verify-completion-evidence/evals/evals.json +0 -16
- package/dist/agent-src/skills/verify-repair-loop/evals/output-schema.yml +0 -20
- package/dist/agent-src/skills/verify-repair-loop/evals/triggers.json +0 -17
- package/dist/agent-src/skills/vision-articulation/evals/evals.json +0 -16
- package/dist/agent-src/skills/voice-and-tone-design/evals/evals.json +0 -16
- package/dist/agent-src/skills/wireframe/evals/triggers.json +0 -17
- package/dist/agent-src/skills/worktree-lifecycle/evals/evals.json +0 -38
- package/dist/agent-src/skills/worktree-lifecycle/evals/triggers.json +0 -52
- package/dist/cli/agent-config.js.map +0 -1
- package/dist/cli/bash/runBash.js.map +0 -1
- package/dist/cli/commands/commands.js.map +0 -1
- package/dist/cli/commands/config.js.map +0 -1
- package/dist/cli/commands/doctorShell.js.map +0 -1
- package/dist/cli/commands/mcpServer.js.map +0 -1
- package/dist/cli/commands/packs.js.map +0 -1
- package/dist/cli/commands/profiles.js.map +0 -1
- package/dist/cli/commands/recordTriggerEval.js.map +0 -1
- package/dist/cli/commands/rtkDetect.js.map +0 -1
- package/dist/cli/commands/settings.js.map +0 -1
- package/dist/cli/commands/uiServe.js.map +0 -1
- package/dist/cli/commands/versions.js.map +0 -1
- package/dist/cli/commands/workspaces.js.map +0 -1
- package/dist/cli/configRoot.js.map +0 -1
- package/dist/cli/discovery/loadManifest.js.map +0 -1
- package/dist/cli/firstRunNotice.js.map +0 -1
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/initRouting.js.map +0 -1
- package/dist/cli/log/logger.js.map +0 -1
- package/dist/cli/main.js.map +0 -1
- package/dist/cli/mcp/content.js.map +0 -1
- package/dist/cli/mcp/dispatch.js.map +0 -1
- package/dist/cli/mcp/stdio.js.map +0 -1
- package/dist/cli/paths.js.map +0 -1
- package/dist/cli/python/knowledge_ingest.js.map +0 -1
- package/dist/cli/python/workspace_analytics.js.map +0 -1
- package/dist/cli/python/workspace_crypto.js.map +0 -1
- package/dist/cli/python/workspace_documents.js.map +0 -1
- package/dist/cli/python/workspace_drive.js.map +0 -1
- package/dist/cli/python/workspace_drive_health.js.map +0 -1
- package/dist/cli/python/workspace_explain.js.map +0 -1
- package/dist/cli/python/workspace_hosts.js.map +0 -1
- package/dist/cli/python/workspace_inbox.js.map +0 -1
- package/dist/cli/python/workspace_render.js.map +0 -1
- package/dist/cli/python/workspace_roles.js.map +0 -1
- package/dist/cli/python/workspace_secrets.js.map +0 -1
- package/dist/cli/python/workspace_sessions.js.map +0 -1
- package/dist/cli/python/workspace_skills.js.map +0 -1
- package/dist/cli/registry.js.map +0 -1
- package/dist/install/agentSwitchDetection.js.map +0 -1
- package/dist/install/agentSwitchProfile.js.map +0 -1
- package/dist/install/atomic.js.map +0 -1
- package/dist/install/claudePathsPlan.js.map +0 -1
- package/dist/install/conflict.js.map +0 -1
- package/dist/install/detect.js.map +0 -1
- package/dist/install/emit_host_rules_cli.js.map +0 -1
- package/dist/install/globalRuleLayers.js.map +0 -1
- package/dist/install/hostLayerFingerprint.js.map +0 -1
- package/dist/install/partitionEligibility.js.map +0 -1
- package/dist/install/paths.js.map +0 -1
- package/dist/install/plan.js.map +0 -1
- package/dist/install/preflight.js.map +0 -1
- package/dist/install/rtkDetection.js.map +0 -1
- package/dist/install/ruleInScope.js.map +0 -1
- package/dist/install/ruleLayerPartition.js.map +0 -1
- package/dist/install/rule_scope.js.map +0 -1
- package/dist/install/rule_scope_cli.js.map +0 -1
- package/dist/install/selectedTools.js.map +0 -1
- package/dist/install/toolDetection.js.map +0 -1
- package/dist/install/txlog.js.map +0 -1
- package/dist/install/types.js.map +0 -1
- package/dist/install/wizard-plan.js.map +0 -1
- package/dist/install/wizardDismissals.js.map +0 -1
- package/dist/scripts/_lib/agent_settings.js.map +0 -1
- package/dist/scripts/_lib/agent_src.js.map +0 -1
- package/dist/scripts/_lib/claude_builtin_names.js.map +0 -1
- package/dist/scripts/_lib/claude_plugin.js.map +0 -1
- package/dist/scripts/_lib/claude_settings_hooks.js.map +0 -1
- package/dist/scripts/_lib/compile_time_toggles.js.map +0 -1
- package/dist/scripts/_lib/environment_detector.js.map +0 -1
- package/dist/scripts/_lib/host_launch.js.map +0 -1
- package/dist/scripts/_lib/install_layout.js.map +0 -1
- package/dist/scripts/_lib/installed_lock.js.map +0 -1
- package/dist/scripts/_lib/model_tier.js.map +0 -1
- package/dist/scripts/_lib/prune_empty_dirs.js.map +0 -1
- package/dist/scripts/_lib/scoped_projection.js.map +0 -1
- package/dist/scripts/_lib/script_output.js.map +0 -1
- package/dist/scripts/_lib/spawn_env.js.map +0 -1
- package/dist/scripts/_lib/surface_tiers.js.map +0 -1
- package/dist/scripts/_lib/token_count.js.map +0 -1
- package/dist/scripts/_lib/trigger_eval_floors.js.map +0 -1
- package/dist/scripts/_lib/user_global_paths.js.map +0 -1
- package/dist/scripts/ai_council/modes.js.map +0 -1
- package/dist/scripts/ai_council/transport_resolver.js.map +0 -1
- package/dist/scripts/condense.js.map +0 -1
- package/dist/scripts/project_thin_rules.js.map +0 -1
- package/dist/server/app.js.map +0 -1
- package/dist/server/io/atomicMultiWrite.js.map +0 -1
- package/dist/server/io/atomicWrite.js.map +0 -1
- package/dist/server/io/sharedWriteCheck.js.map +0 -1
- package/dist/server/io/substituteTemplate.js.map +0 -1
- package/dist/server/io/yamlIO.js.map +0 -1
- package/dist/server/nicknameResolver.js.map +0 -1
- package/dist/server/port.js.map +0 -1
- package/dist/server/routes/discovery.js.map +0 -1
- package/dist/server/routes/install.js.map +0 -1
- package/dist/server/routes/ping.js.map +0 -1
- package/dist/server/routes/schema.js.map +0 -1
- package/dist/server/routes/settings.js.map +0 -1
- package/dist/server/routes/settingsChanges.js.map +0 -1
- package/dist/server/routes/userMd.js.map +0 -1
- package/dist/server/routes/wizard.js.map +0 -1
- package/dist/server/routes/workspace.js.map +0 -1
- package/dist/server/schemas/settings.js.map +0 -1
- package/dist/server/serverInfo.js.map +0 -1
- package/dist/server/token.js.map +0 -1
- package/dist/server/writeRoot.js.map +0 -1
- package/dist/shared/capabilities.js.map +0 -1
- package/dist/shared/interactiveContext.js.map +0 -1
- package/dist/shared/nicknamePrefill.js.map +0 -1
- package/dist/shared/settingsAsks.js.map +0 -1
- package/dist/shared/settingsCarveOut.js.map +0 -1
- package/dist/shared/settingsClasses.js.map +0 -1
- package/dist/shared/settingsConsent.js.map +0 -1
- package/dist/shared/settingsSurface.js.map +0 -1
- package/dist/shared/userMd/formAdapter.js.map +0 -1
- package/dist/shared/userMd/schema.js.map +0 -1
- package/dist/shared/userMd/utils.js.map +0 -1
- package/dist/ui/assets/index-Cxgy63kz.js.map +0 -1
- package/src/scripts/_lib/adr_frontmatter.test.ts +0 -365
- package/src/scripts/_lib/adversarial_council_gate.test.ts +0 -112
- package/src/scripts/_lib/adversarial_reconcile.test.ts +0 -197
- package/src/scripts/_lib/auto_dispatch.corpus.test.ts +0 -150
- package/src/scripts/_lib/secret_detector.test.ts +0 -108
- package/src/scripts/_lib/secret_detector_adversarial.test.ts +0 -116
- package/src/scripts/_lib/untrusted_content.test.ts +0 -175
- package/src/scripts/check_secret_leak.test.ts +0 -90
- package/src/scripts/design_slop_rules.test.ts +0 -239
- package/src/scripts/self_review_gate.test.ts +0 -296
- package/src/shared/capabilities.test.ts +0 -43
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* derive_playbooks — propose Playbook contexts (ADR-244) from a repository's own
|
|
3
|
+
* configuration, and refuse to claim more than the tree shows.
|
|
4
|
+
*
|
|
5
|
+
* The `grade` field is the whole point. `configured` asserts that every step invokes
|
|
6
|
+
* something PRESENT IN THE TREE AND SEEN, so this script may only write it when it has
|
|
7
|
+
* actually resolved the invoked id to a file or a declared task. When it cannot, it
|
|
8
|
+
* writes `observed` and says which id went unresolved — never `configured` with a
|
|
9
|
+
* plausible-looking `invokes` list. That is the Class-A rule of `standards-from-config`
|
|
10
|
+
* applied to procedure: the config IS the standard, and an unresolvable id is not config.
|
|
11
|
+
*
|
|
12
|
+
* Scope of the first release, decided in ADR-244 § What a playbook is and not re-litigated
|
|
13
|
+
* here: THREE resolvable kinds — `package.json#scripts`, `turbo.json` tasks, and
|
|
14
|
+
* `turbo gen` templates under `turbo/generators/`. Nx generators and Plop are deliberately
|
|
15
|
+
* out: discovering them needs a consumer binary (`nx list`, `plop --help`), and the
|
|
16
|
+
* Phase-3 staleness check must run without one. A repo carrying them is reported, so the
|
|
17
|
+
* omission is visible to its maintainer rather than silent.
|
|
18
|
+
*
|
|
19
|
+
* Usage:
|
|
20
|
+
* derive_playbooks --root <repo> # propose, print, write nothing
|
|
21
|
+
* derive_playbooks --root <repo> --write # write into the playbook home
|
|
22
|
+
* derive_playbooks --root <repo> --home <d> # override the home
|
|
23
|
+
* derive_playbooks --self-test
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import * as fs from 'node:fs';
|
|
27
|
+
import * as path from 'node:path';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The playbook home. ADR-244 decided a playbook IS a context type, so this is the
|
|
31
|
+
* contexts home rather than a new directory — the path is not a fresh decision, and the
|
|
32
|
+
* `--home` flag exists because the ADR calls placement the part of the decision least
|
|
33
|
+
* likely to survive contact with a consumer.
|
|
34
|
+
*/
|
|
35
|
+
export const DEFAULT_HOME = path.join('agents', 'settings', 'contexts');
|
|
36
|
+
|
|
37
|
+
export type Grade = 'configured' | 'observed';
|
|
38
|
+
|
|
39
|
+
export interface PlaybookStep {
|
|
40
|
+
readonly title: string;
|
|
41
|
+
/** The id this step invokes — a script name, a turbo task, or `turbo gen <t>`. */
|
|
42
|
+
readonly invokes: string;
|
|
43
|
+
/** Where the id was RESOLVED, or null when it could not be. */
|
|
44
|
+
readonly source_of_truth: string | null;
|
|
45
|
+
readonly verify: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface Playbook {
|
|
49
|
+
readonly slug: string;
|
|
50
|
+
readonly task: string;
|
|
51
|
+
readonly scope: string;
|
|
52
|
+
readonly grade: Grade;
|
|
53
|
+
readonly steps: readonly PlaybookStep[];
|
|
54
|
+
/** Ids that could not be resolved. Non-empty forces `observed`. */
|
|
55
|
+
readonly unresolved: readonly string[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface DeriveReport {
|
|
59
|
+
readonly playbooks: readonly Playbook[];
|
|
60
|
+
/** Kinds seen in the tree that this release cannot resolve — reported, never guessed. */
|
|
61
|
+
readonly out_of_scope: readonly string[];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const readJson = (p: string): Record<string, unknown> | null => {
|
|
65
|
+
try {
|
|
66
|
+
return JSON.parse(fs.readFileSync(p, 'utf8')) as Record<string, unknown>;
|
|
67
|
+
} catch {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const asRecord = (v: unknown): Record<string, unknown> =>
|
|
73
|
+
v !== null && typeof v === 'object' && !Array.isArray(v) ? (v as Record<string, unknown>) : {};
|
|
74
|
+
|
|
75
|
+
/** Turbo generator templates present in the tree, as `turbo gen <name>` ids. */
|
|
76
|
+
export const discoverTurboGenerators = (root: string): Map<string, string> => {
|
|
77
|
+
const out = new Map<string, string>();
|
|
78
|
+
const dir = path.join(root, 'turbo', 'generators');
|
|
79
|
+
if (!fs.existsSync(dir)) return out;
|
|
80
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
81
|
+
const full = path.join(dir, entry.name);
|
|
82
|
+
if (entry.isDirectory()) {
|
|
83
|
+
out.set(`turbo gen ${entry.name}`, path.relative(root, full));
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
// A config file declares generators BY NAME, so read the names it registers
|
|
87
|
+
// rather than assuming the filename is the generator id. `@turbo/gen` wraps Plop
|
|
88
|
+
// and the registering call is `plop.setGenerator('component', …)`; `addGenerator`
|
|
89
|
+
// is accepted too because Plop's own API carries both spellings and a config
|
|
90
|
+
// written against either must resolve.
|
|
91
|
+
const text = fs.readFileSync(full, 'utf8');
|
|
92
|
+
for (const m of text.matchAll(/\.(?:set|add)Generator\(\s*['"]([A-Za-z0-9_-]+)['"]/g)) {
|
|
93
|
+
out.set(`turbo gen ${m[1]}`, `${path.relative(root, full)} (setGenerator)`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return out;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/** Every workspace directory that carries its own `package.json`. */
|
|
100
|
+
export const discoverWorkspaces = (root: string): string[] => {
|
|
101
|
+
const pkg = readJson(path.join(root, 'package.json'));
|
|
102
|
+
const globs = Array.isArray(pkg?.workspaces) ? (pkg.workspaces as string[]) : [];
|
|
103
|
+
const found: string[] = [];
|
|
104
|
+
for (const g of globs) {
|
|
105
|
+
if (!g.endsWith('/*')) continue;
|
|
106
|
+
const base = path.join(root, g.slice(0, -2));
|
|
107
|
+
if (!fs.existsSync(base)) continue;
|
|
108
|
+
for (const e of fs.readdirSync(base, { withFileTypes: true })) {
|
|
109
|
+
if (!e.isDirectory()) continue;
|
|
110
|
+
const rel = path.join(g.slice(0, -2), e.name);
|
|
111
|
+
if (fs.existsSync(path.join(root, rel, 'package.json'))) found.push(rel);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return found.sort();
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Resolve one invoked id against the tree. Returns the place it was SEEN, or null.
|
|
119
|
+
* Null is what forces `observed`, so this function is the honesty gate of the script.
|
|
120
|
+
*/
|
|
121
|
+
export const resolveInvoked = (
|
|
122
|
+
root: string,
|
|
123
|
+
id: string,
|
|
124
|
+
generators: Map<string, string>,
|
|
125
|
+
): string | null => {
|
|
126
|
+
if (generators.has(id)) return generators.get(id) ?? null;
|
|
127
|
+
|
|
128
|
+
const turbo = readJson(path.join(root, 'turbo.json'));
|
|
129
|
+
if (turbo && Object.prototype.hasOwnProperty.call(asRecord(turbo.tasks), id)) {
|
|
130
|
+
return 'turbo.json#tasks';
|
|
131
|
+
}
|
|
132
|
+
const pkg = readJson(path.join(root, 'package.json'));
|
|
133
|
+
if (pkg && Object.prototype.hasOwnProperty.call(asRecord(pkg.scripts), id)) {
|
|
134
|
+
return 'package.json#scripts';
|
|
135
|
+
}
|
|
136
|
+
return null;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/** Kinds this release does not resolve, reported so the gap is visible. */
|
|
140
|
+
export const detectOutOfScope = (root: string): string[] => {
|
|
141
|
+
const out: string[] = [];
|
|
142
|
+
if (fs.existsSync(path.join(root, 'nx.json'))) out.push('nx generators (needs `nx list`)');
|
|
143
|
+
for (const n of ['plopfile.js', 'plopfile.mjs', 'plopfile.ts', 'plopfile.cjs']) {
|
|
144
|
+
if (fs.existsSync(path.join(root, n))) {
|
|
145
|
+
out.push('plop generators (needs `plop --help`)');
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return out;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const scriptBody = (root: string, name: string): string =>
|
|
153
|
+
String(asRecord(readJson(path.join(root, 'package.json'))?.scripts)[name] ?? '');
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* A script whose body is a thin wrapper (`turbo gen component`) is a POINTER at the real
|
|
157
|
+
* procedure, so the playbook must invoke what it points at — otherwise a renamed
|
|
158
|
+
* generator leaves the playbook green while the procedure is broken, which is exactly the
|
|
159
|
+
* drift Phase 3 gates.
|
|
160
|
+
*/
|
|
161
|
+
export const unwrapScript = (body: string): string | null => {
|
|
162
|
+
const m = /^\s*turbo\s+gen\s+([A-Za-z0-9_-]+)/.exec(body);
|
|
163
|
+
return m ? `turbo gen ${m[1]}` : null;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export const derive = (root: string): DeriveReport => {
|
|
167
|
+
const generators = discoverTurboGenerators(root);
|
|
168
|
+
const workspaces = discoverWorkspaces(root);
|
|
169
|
+
const pkg = readJson(path.join(root, 'package.json'));
|
|
170
|
+
const scripts = asRecord(pkg?.scripts);
|
|
171
|
+
const playbooks: Playbook[] = [];
|
|
172
|
+
|
|
173
|
+
for (const name of Object.keys(scripts).sort()) {
|
|
174
|
+
// Only creation-shaped scripts become playbooks. `build` and `test` are one
|
|
175
|
+
// command each — a playbook for them would be a rename of the script, not a
|
|
176
|
+
// procedure, and the estate does not need one file per npm script.
|
|
177
|
+
const noun = /^(?:new|gen|generate|create|scaffold|add)[:-]?(.*)$/.exec(name);
|
|
178
|
+
if (!noun) continue;
|
|
179
|
+
|
|
180
|
+
const wrapped = unwrapScript(scriptBody(root, name));
|
|
181
|
+
const invoked = wrapped ?? name;
|
|
182
|
+
const where = resolveInvoked(root, invoked, generators);
|
|
183
|
+
const subject = (noun[1] || 'artefact').replace(/[^A-Za-z0-9]+/g, '-');
|
|
184
|
+
|
|
185
|
+
// `scope` prefers a real workspace whose name matches the subject, so a component
|
|
186
|
+
// playbook lands on packages/ui rather than claiming the whole repo.
|
|
187
|
+
const ws = workspaces.find((w) => path.basename(w) === subject) ?? null;
|
|
188
|
+
const scope =
|
|
189
|
+
ws ??
|
|
190
|
+
workspaces.find((w) => subject === 'component' && path.basename(w) === 'ui') ??
|
|
191
|
+
'repo';
|
|
192
|
+
|
|
193
|
+
const step: PlaybookStep = {
|
|
194
|
+
title: `Run the repository's own generator`,
|
|
195
|
+
invokes: invoked,
|
|
196
|
+
source_of_truth: where,
|
|
197
|
+
verify: where
|
|
198
|
+
? `the generator's output appears under \`${scope}\` and the package builds`
|
|
199
|
+
: `UNRESOLVED — confirm \`${invoked}\` exists before trusting this step`,
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// The slug carries the workspace when the playbook is workspace-scoped. Two
|
|
203
|
+
// workspaces may each own a `component` procedure with different conventions, and
|
|
204
|
+
// one file per subject would silently collapse them into whichever ran last.
|
|
205
|
+
const noun_slug = subject === 'artefact' ? name.replace(/[^a-z0-9]+/gi, '-') : subject;
|
|
206
|
+
const slug = scope === 'repo' ? `add-${noun_slug}` : `add-${path.basename(scope)}-${noun_slug}`;
|
|
207
|
+
|
|
208
|
+
playbooks.push({
|
|
209
|
+
slug,
|
|
210
|
+
task: `Add a new ${subject.replace(/-/g, ' ')} to this repository`,
|
|
211
|
+
scope,
|
|
212
|
+
grade: where ? 'configured' : 'observed',
|
|
213
|
+
steps: [step],
|
|
214
|
+
unresolved: where ? [] : [invoked],
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return { playbooks, out_of_scope: detectOutOfScope(root) };
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export const renderPlaybook = (p: Playbook): string => {
|
|
222
|
+
const lines: string[] = [
|
|
223
|
+
'---',
|
|
224
|
+
`task: "${p.task}"`,
|
|
225
|
+
`scope: "${p.scope}"`,
|
|
226
|
+
`grade: "${p.grade}"`,
|
|
227
|
+
'invokes:',
|
|
228
|
+
...p.steps.map((s) => ` - "${s.invokes}"`),
|
|
229
|
+
'---',
|
|
230
|
+
'',
|
|
231
|
+
`# Playbook: ${p.task}`,
|
|
232
|
+
'',
|
|
233
|
+
'> **This is THIS repository\'s answer, and it outranks a shipped skill.** A shipped',
|
|
234
|
+
'> skill is a generic answer to a generic question; this file encodes decisions this',
|
|
235
|
+
'> repository already made.',
|
|
236
|
+
'',
|
|
237
|
+
`Grade \`${p.grade}\` — ${
|
|
238
|
+
p.grade === 'configured'
|
|
239
|
+
? 'every step below invokes something seen in the tree, cited per step.'
|
|
240
|
+
: 'at least one invoked id could NOT be resolved in the tree, so the steps are a hypothesis to confirm, not a procedure to trust.'
|
|
241
|
+
}`,
|
|
242
|
+
'',
|
|
243
|
+
'## Steps',
|
|
244
|
+
'',
|
|
245
|
+
];
|
|
246
|
+
p.steps.forEach((s, i) => {
|
|
247
|
+
lines.push(
|
|
248
|
+
`${i + 1}. **${s.title}** — \`${s.invokes}\``,
|
|
249
|
+
` - **Source of truth:** ${s.source_of_truth ?? '**unresolved** — nothing in the tree declares this id'}`,
|
|
250
|
+
` - **Verify:** ${s.verify}`,
|
|
251
|
+
'',
|
|
252
|
+
);
|
|
253
|
+
});
|
|
254
|
+
if (p.unresolved.length > 0) {
|
|
255
|
+
lines.push(
|
|
256
|
+
'## Why this is not `configured`',
|
|
257
|
+
'',
|
|
258
|
+
`Unresolved: ${p.unresolved.map((u) => `\`${u}\``).join(', ')}. A \`configured\``,
|
|
259
|
+
'grade asserts every step was seen in the tree; this one was not, and downgrading is',
|
|
260
|
+
'the honest outcome rather than writing the stronger claim and hoping.',
|
|
261
|
+
'',
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
return lines.join('\n');
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
// ---------------------------------------------------------------------------
|
|
268
|
+
// Restatement detection — for the per-workspace AGENTS.md contract (1.3).
|
|
269
|
+
//
|
|
270
|
+
// A `packages/<n>/AGENTS.md` is allowed and its primary content is a POINTER LIST to the
|
|
271
|
+
// playbooks scoped to that workspace. The failure it must not become is a second copy of
|
|
272
|
+
// the steps: two files then disagree the first time one is edited, and a reader has no way
|
|
273
|
+
// to tell which one the repository actually follows. So the detector below looks for a
|
|
274
|
+
// playbook step's own text appearing verbatim in a workspace file, and deliberately does
|
|
275
|
+
// NOT flag a pointer AT the playbook — naming the file is the behaviour the contract wants.
|
|
276
|
+
// ---------------------------------------------------------------------------
|
|
277
|
+
|
|
278
|
+
export interface Restatement {
|
|
279
|
+
readonly file: string;
|
|
280
|
+
readonly playbook: string;
|
|
281
|
+
/** The step text found verbatim in `file`. */
|
|
282
|
+
readonly step: string;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/** Normalise for comparison: collapse whitespace, drop markdown emphasis and list markers. */
|
|
286
|
+
const normalise = (line: string): string =>
|
|
287
|
+
line
|
|
288
|
+
.replace(/^\s*(?:[-*+]|\d+\.)\s+/, '')
|
|
289
|
+
.replace(/[*_`>]/g, '')
|
|
290
|
+
.replace(/\s+/g, ' ')
|
|
291
|
+
.trim()
|
|
292
|
+
.toLowerCase();
|
|
293
|
+
|
|
294
|
+
/** A line that merely POINTS at a playbook — a link, or a path mention. Never a restatement. */
|
|
295
|
+
export const isPointerLine = (line: string): boolean =>
|
|
296
|
+
/\[[^\]]+\]\([^)]*\.md[^)]*\)/.test(line) || /`[^`]*\.md`/.test(line);
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Steps of a playbook that a workspace file restates verbatim.
|
|
300
|
+
*
|
|
301
|
+
* The needle is the step's **invoked id**, not its title. Titles are generic by
|
|
302
|
+
* construction — every generator step in this repository's own fixture is called "Run the
|
|
303
|
+
* repository's own generator" — so a title match reports the same prose line once per
|
|
304
|
+
* playbook and tells the reader nothing about WHICH procedure was duplicated. The id is
|
|
305
|
+
* what makes a line actionable, and duplicating the actionable half is the failure.
|
|
306
|
+
*
|
|
307
|
+
* Short lines are skipped: a three-word step and a three-word sentence collide by accident,
|
|
308
|
+
* and a detector that fires on coincidence teaches its readers to ignore it.
|
|
309
|
+
*/
|
|
310
|
+
export const findRestatedSteps = (
|
|
311
|
+
playbooks: readonly { readonly slug: string; readonly steps: readonly PlaybookStep[] }[],
|
|
312
|
+
file: string,
|
|
313
|
+
text: string,
|
|
314
|
+
minChars = 12,
|
|
315
|
+
): Restatement[] => {
|
|
316
|
+
const lines = text.split('\n');
|
|
317
|
+
const found: Restatement[] = [];
|
|
318
|
+
for (const p of playbooks) {
|
|
319
|
+
for (const st of p.steps) {
|
|
320
|
+
const needle = normalise(st.invokes);
|
|
321
|
+
if (needle.length < minChars) continue;
|
|
322
|
+
for (const line of lines) {
|
|
323
|
+
if (isPointerLine(line)) continue;
|
|
324
|
+
if (normalise(line).includes(needle)) {
|
|
325
|
+
found.push({ file, playbook: p.slug, step: st.title });
|
|
326
|
+
break;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return found;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
const selfTest = (): number => {
|
|
335
|
+
let failed = 0;
|
|
336
|
+
const check = (name: string, cond: boolean): void => {
|
|
337
|
+
if (!cond) {
|
|
338
|
+
console.error(`❌ ${name}`);
|
|
339
|
+
failed += 1;
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
check('a thin wrapper unwraps to the generator it points at', unwrapScript('turbo gen component') === 'turbo gen component');
|
|
344
|
+
check('an unrelated script body does not unwrap', unwrapScript('vite build') === null);
|
|
345
|
+
check('a wrapper with flags still unwraps', unwrapScript('turbo gen workspace --type package') === 'turbo gen workspace');
|
|
346
|
+
|
|
347
|
+
check(
|
|
348
|
+
'a pointer at a playbook is not a restatement',
|
|
349
|
+
isPointerLine('- See [add a component](../../agents/settings/contexts/add-ui-component.md)'),
|
|
350
|
+
);
|
|
351
|
+
check('a prose line is not a pointer', !isPointerLine('Run the repository own generator first'));
|
|
352
|
+
|
|
353
|
+
const fixture = path.join('tests', 'fixtures', 'playbooks', 'mono-with-generator');
|
|
354
|
+
if (fs.existsSync(fixture)) {
|
|
355
|
+
const r = derive(fixture);
|
|
356
|
+
const comp = r.playbooks.find((p) => p.slug === 'add-ui-component');
|
|
357
|
+
check('the fixture yields a component playbook', comp !== undefined);
|
|
358
|
+
check('it is graded configured', comp?.grade === 'configured');
|
|
359
|
+
check('it invokes the generator, not the wrapper script', comp?.steps[0]?.invokes === 'turbo gen component');
|
|
360
|
+
check('its scope is the workspace, not the repo', comp?.scope === path.join('packages', 'ui'));
|
|
361
|
+
check('build and test produced no playbook', !r.playbooks.some((p) => /build|test/.test(p.slug)));
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
process.stdout.write(
|
|
365
|
+
failed === 0
|
|
366
|
+
? '✅ derive_playbooks: self-test passed\n'
|
|
367
|
+
: `❌ derive_playbooks: ${failed} failure(s)\n`,
|
|
368
|
+
);
|
|
369
|
+
return failed === 0 ? 0 : 1;
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
const main = (): number => {
|
|
373
|
+
const argv = process.argv.slice(2);
|
|
374
|
+
if (argv.includes('--self-test')) return selfTest();
|
|
375
|
+
|
|
376
|
+
const arg = (flag: string): string | null => {
|
|
377
|
+
const i = argv.indexOf(flag);
|
|
378
|
+
return i >= 0 && i + 1 < argv.length ? String(argv[i + 1]) : null;
|
|
379
|
+
};
|
|
380
|
+
const root = arg('--root') ?? '.';
|
|
381
|
+
const home = arg('--home') ?? path.join(root, DEFAULT_HOME);
|
|
382
|
+
const write = argv.includes('--write');
|
|
383
|
+
|
|
384
|
+
const report = derive(root);
|
|
385
|
+
if (report.playbooks.length === 0) {
|
|
386
|
+
process.stdout.write('derive_playbooks: no creation-shaped procedure found — nothing proposed.\n');
|
|
387
|
+
}
|
|
388
|
+
for (const p of report.playbooks) {
|
|
389
|
+
const target = path.join(home, `${p.slug}.md`);
|
|
390
|
+
process.stdout.write(
|
|
391
|
+
`${p.grade === 'configured' ? '✅' : '⚠️ '} ${target} grade=${p.grade} invokes=[${p.steps.map((s) => s.invokes).join(', ')}]\n`,
|
|
392
|
+
);
|
|
393
|
+
if (!write) continue;
|
|
394
|
+
fs.mkdirSync(home, { recursive: true });
|
|
395
|
+
fs.writeFileSync(target, renderPlaybook(p), 'utf8');
|
|
396
|
+
}
|
|
397
|
+
for (const o of report.out_of_scope) {
|
|
398
|
+
process.stdout.write(`ℹ️ out of scope for this release: ${o} — reported, not guessed at (ADR-244)\n`);
|
|
399
|
+
}
|
|
400
|
+
process.stdout.write(`scanned: ${report.playbooks.length}\n`);
|
|
401
|
+
return 0;
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
if (process.argv[1] && /derive_playbooks/.test(process.argv[1])) {
|
|
405
|
+
process.exit(main());
|
|
406
|
+
}
|