@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,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `agent-config ui:render <path|url>` — headless capture, then exit.
|
|
3
|
+
*
|
|
4
|
+
* Step E3.1 of `road-to-frontend-power`. Captures DOM, computed styles and a
|
|
5
|
+
* screenshot at three viewports — desktop, 375 px and 320 px — into
|
|
6
|
+
* `agents/runtime/state/render/<slug>/`, then terminates.
|
|
7
|
+
*
|
|
8
|
+
* CLASS A, and the boundary is the whole design constraint. `docs/contracts/
|
|
9
|
+
* no-runtime-boundary.md` plus ADR-124 put a *resident* browser, a dev-server
|
|
10
|
+
* bridge and a watcher in Class B, which is prohibited in core. A headless
|
|
11
|
+
* render per command is Class A because it terminates and its state is a
|
|
12
|
+
* rebuildable directory. So:
|
|
13
|
+
*
|
|
14
|
+
* - the browser is closed in a `finally`, on every path including a throw;
|
|
15
|
+
* - nothing is cached between invocations;
|
|
16
|
+
* - no listener, no watch mode, no `--serve` flag exists to add one.
|
|
17
|
+
*
|
|
18
|
+
* Live-browser iteration stays out of scope (recorded as a null in R3.1). The
|
|
19
|
+
* in-scope substitute is a turn-scoped variant capture built on this command.
|
|
20
|
+
*
|
|
21
|
+
* WHY 320 px is captured: the fidelity roadmap's AC-6 asserts a 320 px floor
|
|
22
|
+
* and had no primitive to measure it with, which is why its
|
|
23
|
+
* `b-page-capture-primitive` closed as a recorded null. This supplies the
|
|
24
|
+
* primitive, so that null's own reopening condition fires.
|
|
25
|
+
*
|
|
26
|
+
* Playwright is a devDependency (`package.json:97`) and is therefore NOT
|
|
27
|
+
* guaranteed present in a consumer install. The import is dynamic and the
|
|
28
|
+
* absence path is a clean, explained exit rather than a stack trace — and it
|
|
29
|
+
* reports `verification: unverified` instead of writing an empty manifest that
|
|
30
|
+
* would read as a successful capture of nothing.
|
|
31
|
+
*/
|
|
32
|
+
import * as fs from 'node:fs';
|
|
33
|
+
import * as path from 'node:path';
|
|
34
|
+
/** The three viewports E3.1 names. Widths are the contract, not a preference. */
|
|
35
|
+
export const VIEWPORTS = [
|
|
36
|
+
{ name: 'desktop', width: 1440, height: 900 },
|
|
37
|
+
{ name: 'mobile-375', width: 375, height: 812 },
|
|
38
|
+
{ name: 'mobile-320', width: 320, height: 640 },
|
|
39
|
+
];
|
|
40
|
+
/** Computed properties captured per element — the A1.5 delta inputs, plus the overflow signals. */
|
|
41
|
+
export const CAPTURED_PROPERTIES = [
|
|
42
|
+
'color',
|
|
43
|
+
'background-color',
|
|
44
|
+
'border-color',
|
|
45
|
+
'font-family',
|
|
46
|
+
'font-size',
|
|
47
|
+
'line-height',
|
|
48
|
+
'overflow-x',
|
|
49
|
+
'overflow-y',
|
|
50
|
+
];
|
|
51
|
+
export const RENDER_REL = path.join('agents', 'runtime', 'state', 'render');
|
|
52
|
+
export function slugify(target) {
|
|
53
|
+
return (target
|
|
54
|
+
.replace(/^https?:\/\//, '')
|
|
55
|
+
.replace(/[^a-z0-9]+/gi, '-')
|
|
56
|
+
.replace(/^-+|-+$/g, '')
|
|
57
|
+
.toLowerCase()
|
|
58
|
+
.slice(0, 60) || 'render');
|
|
59
|
+
}
|
|
60
|
+
/** Colour-ish computed values, normalised. Used to build the palette snapshot. */
|
|
61
|
+
export function collectPalette(styleRecords) {
|
|
62
|
+
const out = new Set();
|
|
63
|
+
for (const rec of styleRecords) {
|
|
64
|
+
for (const key of ['color', 'background-color', 'border-color']) {
|
|
65
|
+
const v = (rec[key] ?? '').trim().toLowerCase();
|
|
66
|
+
if (!v || v === 'rgba(0, 0, 0, 0)' || v === 'transparent')
|
|
67
|
+
continue;
|
|
68
|
+
out.add(v);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return [...out].sort();
|
|
72
|
+
}
|
|
73
|
+
/** First-choice families only — the A1.5 threshold is about the family that wins. */
|
|
74
|
+
export function collectTypeFamilies(styleRecords) {
|
|
75
|
+
const out = new Set();
|
|
76
|
+
for (const rec of styleRecords) {
|
|
77
|
+
const fam = (rec['font-family'] ?? '').split(',')[0]?.trim().replace(/^["']|["']$/g, '').toLowerCase();
|
|
78
|
+
if (fam)
|
|
79
|
+
out.add(fam);
|
|
80
|
+
}
|
|
81
|
+
return [...out].sort();
|
|
82
|
+
}
|
|
83
|
+
export async function runUiRender(opts) {
|
|
84
|
+
const projectRoot = path.resolve(opts.projectRoot ?? process.cwd());
|
|
85
|
+
const isUrl = /^https?:\/\//i.test(opts.target);
|
|
86
|
+
const abs = isUrl ? opts.target : path.resolve(projectRoot, opts.target);
|
|
87
|
+
if (!isUrl && !fs.existsSync(abs)) {
|
|
88
|
+
process.stderr.write(`[ui:render] path not found: ${abs}\n`);
|
|
89
|
+
return 1;
|
|
90
|
+
}
|
|
91
|
+
const slug = opts.slug ?? slugify(opts.target);
|
|
92
|
+
const outDir = path.join(projectRoot, RENDER_REL, slug);
|
|
93
|
+
let chromium;
|
|
94
|
+
try {
|
|
95
|
+
({ chromium } = await import('@playwright/test'));
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
const manifest = {
|
|
99
|
+
schema: 1,
|
|
100
|
+
generated_at: new Date().toISOString(),
|
|
101
|
+
target: opts.target,
|
|
102
|
+
slug,
|
|
103
|
+
captures: [],
|
|
104
|
+
palette: [],
|
|
105
|
+
type_families: [],
|
|
106
|
+
verification: 'unverified',
|
|
107
|
+
degradation_reason: '@playwright/test is not installed — it is a devDependency, so a consumer install has no browser. ' +
|
|
108
|
+
'Install it, or scope any verdict to the static checks that actually ran.',
|
|
109
|
+
};
|
|
110
|
+
writeManifest(outDir, manifest);
|
|
111
|
+
process.stderr.write(`[ui:render] ${manifest.degradation_reason}\n`);
|
|
112
|
+
if (opts.json)
|
|
113
|
+
process.stdout.write(`${JSON.stringify(manifest, null, 2)}\n`);
|
|
114
|
+
// Exit 0, deliberately: an absent devDependency is a capability fact,
|
|
115
|
+
// not a failure of this command. The manifest carries the honest state.
|
|
116
|
+
return 0;
|
|
117
|
+
}
|
|
118
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
119
|
+
const captures = [];
|
|
120
|
+
const allStyles = [];
|
|
121
|
+
let browser = null;
|
|
122
|
+
try {
|
|
123
|
+
browser = await chromium.launch({ headless: true });
|
|
124
|
+
for (const vp of VIEWPORTS) {
|
|
125
|
+
const page = await browser.newPage({ viewport: { width: vp.width, height: vp.height } });
|
|
126
|
+
await page.goto(isUrl ? abs : `file://${abs}`, { waitUntil: 'load', timeout: 30_000 });
|
|
127
|
+
const shot = path.join(outDir, `${vp.name}.png`);
|
|
128
|
+
await page.screenshot({ path: shot, fullPage: true });
|
|
129
|
+
const dom = await page.content();
|
|
130
|
+
const domPath = path.join(outDir, `${vp.name}.dom.html`);
|
|
131
|
+
fs.writeFileSync(domPath, dom);
|
|
132
|
+
const styles = await page.evaluate((props) => {
|
|
133
|
+
const rows = [];
|
|
134
|
+
for (const el of Array.from(document.querySelectorAll('*')).slice(0, 1500)) {
|
|
135
|
+
const cs = window.getComputedStyle(el);
|
|
136
|
+
const rec = { selector: el.tagName.toLowerCase() };
|
|
137
|
+
for (const p of props)
|
|
138
|
+
rec[p] = cs.getPropertyValue(p);
|
|
139
|
+
rows.push(rec);
|
|
140
|
+
}
|
|
141
|
+
return rows;
|
|
142
|
+
}, CAPTURED_PROPERTIES);
|
|
143
|
+
allStyles.push(...styles);
|
|
144
|
+
const stylePath = path.join(outDir, `${vp.name}.styles.json`);
|
|
145
|
+
fs.writeFileSync(stylePath, `${JSON.stringify(styles, null, 2)}\n`);
|
|
146
|
+
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
|
|
147
|
+
await page.close();
|
|
148
|
+
captures.push({
|
|
149
|
+
viewport: vp.name,
|
|
150
|
+
width: vp.width,
|
|
151
|
+
height: vp.height,
|
|
152
|
+
screenshot: path.relative(projectRoot, shot).split(path.sep).join('/'),
|
|
153
|
+
dom: path.relative(projectRoot, domPath).split(path.sep).join('/'),
|
|
154
|
+
styles: path.relative(projectRoot, stylePath).split(path.sep).join('/'),
|
|
155
|
+
document_scroll_width: scrollWidth,
|
|
156
|
+
horizontal_overflow: scrollWidth > vp.width + 1,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
catch (err) {
|
|
161
|
+
const manifest = {
|
|
162
|
+
schema: 1,
|
|
163
|
+
generated_at: new Date().toISOString(),
|
|
164
|
+
target: opts.target,
|
|
165
|
+
slug,
|
|
166
|
+
captures,
|
|
167
|
+
palette: collectPalette(allStyles),
|
|
168
|
+
type_families: collectTypeFamilies(allStyles),
|
|
169
|
+
verification: 'degraded',
|
|
170
|
+
degradation_reason: `capture failed after ${captures.length} viewport(s): ${String(err)}`,
|
|
171
|
+
};
|
|
172
|
+
writeManifest(outDir, manifest);
|
|
173
|
+
process.stderr.write(`[ui:render] ${manifest.degradation_reason}\n`);
|
|
174
|
+
return 1;
|
|
175
|
+
}
|
|
176
|
+
finally {
|
|
177
|
+
// The Class-A boundary. Closed on every path, throw included — this is
|
|
178
|
+
// what keeps a resident browser from becoming an accident.
|
|
179
|
+
await browser?.close();
|
|
180
|
+
}
|
|
181
|
+
const manifest = {
|
|
182
|
+
schema: 1,
|
|
183
|
+
generated_at: new Date().toISOString(),
|
|
184
|
+
target: opts.target,
|
|
185
|
+
slug,
|
|
186
|
+
captures,
|
|
187
|
+
palette: collectPalette(allStyles),
|
|
188
|
+
type_families: collectTypeFamilies(allStyles),
|
|
189
|
+
verification: 'verified',
|
|
190
|
+
};
|
|
191
|
+
writeManifest(outDir, manifest);
|
|
192
|
+
if (opts.json)
|
|
193
|
+
process.stdout.write(`${JSON.stringify(manifest, null, 2)}\n`);
|
|
194
|
+
else {
|
|
195
|
+
const overflow = manifest.captures.filter((c) => c.horizontal_overflow).map((c) => c.viewport);
|
|
196
|
+
process.stdout.write(`✅ ui:render — ${manifest.captures.length} viewport(s), ${manifest.palette.length} colour(s), ` +
|
|
197
|
+
`${manifest.type_families.length} family(ies)\n ${path.relative(projectRoot, outDir)}\n` +
|
|
198
|
+
(overflow.length ? ` ⚠️ horizontal overflow at: ${overflow.join(', ')}\n` : ''));
|
|
199
|
+
}
|
|
200
|
+
return 0;
|
|
201
|
+
}
|
|
202
|
+
function writeManifest(outDir, manifest) {
|
|
203
|
+
fs.mkdirSync(outDir, { recursive: true });
|
|
204
|
+
fs.writeFileSync(path.join(outDir, 'manifest.json'), `${JSON.stringify(manifest, null, 2)}\n`);
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=uiRender.js.map
|
package/dist/cli/main.js
CHANGED
|
@@ -21,6 +21,8 @@ import { runVersions } from './commands/versions.js';
|
|
|
21
21
|
import { runRecordTriggerEval } from './commands/recordTriggerEval.js';
|
|
22
22
|
import { runDoctorShell } from './commands/doctorShell.js';
|
|
23
23
|
import { runRtkDetect } from './commands/rtkDetect.js';
|
|
24
|
+
import { runUiAudit } from './commands/uiAudit.js';
|
|
25
|
+
import { runUiRender } from './commands/uiRender.js';
|
|
24
26
|
import { runUiServe } from './commands/uiServe.js';
|
|
25
27
|
import { shouldInitLaunchGui, buildInitGuiOptions, buildProjectInitDelegation, findInitGuiConflict, withoutGuiFlag } from './initRouting.js';
|
|
26
28
|
import { maybePrintFirstRunNotice } from './firstRunNotice.js';
|
|
@@ -107,6 +109,25 @@ async function main(rawArgv) {
|
|
|
107
109
|
// process exit naturally once stdin is at EOF and stdout drained.
|
|
108
110
|
process.exitCode = await runMcpServer();
|
|
109
111
|
});
|
|
112
|
+
program
|
|
113
|
+
.command('ui:audit')
|
|
114
|
+
.argument('[path]', 'UI tree or file to inventory (default: cwd)')
|
|
115
|
+
.description('Inventory a UI tree into agents/runtime/state/ui-audit.json (Class A)')
|
|
116
|
+
.option('--json', 'Print the artefact on stdout as well as writing it')
|
|
117
|
+
.option('--project-root <path>', 'Override the project root')
|
|
118
|
+
.action((target, opts) => {
|
|
119
|
+
process.exitCode = runUiAudit({ target, ...opts });
|
|
120
|
+
});
|
|
121
|
+
program
|
|
122
|
+
.command('ui:render')
|
|
123
|
+
.argument('<target>', 'HTML file or http(s) URL to capture')
|
|
124
|
+
.description('Headless capture at desktop / 375px / 320px into agents/runtime/state/render/ (Class A)')
|
|
125
|
+
.option('--json', 'Print the manifest on stdout as well as writing it')
|
|
126
|
+
.option('--project-root <path>', 'Override the project root')
|
|
127
|
+
.option('--slug <name>', 'Override the output directory name')
|
|
128
|
+
.action(async (target, opts) => {
|
|
129
|
+
process.exitCode = await runUiRender({ target, ...opts });
|
|
130
|
+
});
|
|
110
131
|
program
|
|
111
132
|
.command('ui:serve')
|
|
112
133
|
.description('Start the local UI server (127.0.0.1, auto-picked port)')
|
|
@@ -338,7 +359,7 @@ async function main(rawArgv) {
|
|
|
338
359
|
return 0;
|
|
339
360
|
}
|
|
340
361
|
// Native subcommand → commander handles it (exits inside action).
|
|
341
|
-
const native = ['versions', 'doctor-shell', 'rtk:detect', 'mcp-server', 'ui:serve', 'settings', 'config', 'install', 'setup', 'workspaces', 'packs', 'commands', 'help', 'eval:record'];
|
|
362
|
+
const native = ['versions', 'doctor-shell', 'rtk:detect', 'mcp-server', 'ui:serve', 'ui:audit', 'ui:render', 'settings', 'config', 'install', 'setup', 'workspaces', 'packs', 'commands', 'help', 'eval:record'];
|
|
342
363
|
if (head !== undefined && native.includes(head)) {
|
|
343
364
|
await program.parseAsync(['node', 'agent-config', ...argv]);
|
|
344
365
|
// Actions that don't hard-exit signal failure via process.exitCode.
|
package/dist/cli/mcp/content.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* downstream (dispatch) is a pure function of the returned tree.
|
|
13
13
|
*/
|
|
14
14
|
import { readFileSync, readdirSync, existsSync, statSync } from 'node:fs';
|
|
15
|
+
import { INDEXED_TRIGGER_KEYS } from '../../shared/skillRanking.js';
|
|
15
16
|
import { join, resolve, basename, relative, sep } from 'node:path';
|
|
16
17
|
import * as yaml from 'js-yaml';
|
|
17
18
|
const MIME_MARKDOWN = 'text/markdown';
|
|
@@ -36,6 +37,36 @@ function parseFrontmatter(raw) {
|
|
|
36
37
|
function str(v, fallback = '') {
|
|
37
38
|
return typeof v === 'string' ? v : fallback;
|
|
38
39
|
}
|
|
40
|
+
/** Frontmatter `personas:` — a bare string counts as a one-element list. */
|
|
41
|
+
function personaList(v) {
|
|
42
|
+
if (typeof v === 'string')
|
|
43
|
+
return v ? [v] : [];
|
|
44
|
+
if (!Array.isArray(v))
|
|
45
|
+
return [];
|
|
46
|
+
return v.filter((x) => typeof x === 'string');
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* `triggers[].keyword` + `triggers[].phrase` as plain text.
|
|
50
|
+
*
|
|
51
|
+
* Which keys count is `INDEXED_TRIGGER_KEYS`, shared with the disk-side reader
|
|
52
|
+
* so the two cannot disagree about what a trigger contributes.
|
|
53
|
+
*/
|
|
54
|
+
function triggerText(v) {
|
|
55
|
+
if (!Array.isArray(v))
|
|
56
|
+
return [];
|
|
57
|
+
const out = [];
|
|
58
|
+
for (const item of v) {
|
|
59
|
+
if (!item || typeof item !== 'object')
|
|
60
|
+
continue;
|
|
61
|
+
const rec = item;
|
|
62
|
+
for (const key of INDEXED_TRIGGER_KEYS) {
|
|
63
|
+
const val = rec[key];
|
|
64
|
+
if (typeof val === 'string' && val)
|
|
65
|
+
out.push(val);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
39
70
|
/** Recursively collect `*.md` files under `dir` (empty if `dir` is absent). */
|
|
40
71
|
function walkMd(dir) {
|
|
41
72
|
if (!existsSync(dir))
|
|
@@ -68,6 +99,15 @@ function makeEntry(file, kind, scheme, fallbackName) {
|
|
|
68
99
|
};
|
|
69
100
|
if (kind === 'rule' || kind === 'guideline')
|
|
70
101
|
entry.mime_type = MIME_MARKDOWN;
|
|
102
|
+
// Ranking inputs — only skills are ranked, so only skills carry them.
|
|
103
|
+
if (kind === 'skill') {
|
|
104
|
+
const personas = personaList(fm.personas);
|
|
105
|
+
if (personas.length > 0)
|
|
106
|
+
entry.personas = personas;
|
|
107
|
+
const triggers = triggerText(fm.triggers);
|
|
108
|
+
if (triggers.length > 0)
|
|
109
|
+
entry.trigger_text = triggers;
|
|
110
|
+
}
|
|
71
111
|
return entry;
|
|
72
112
|
}
|
|
73
113
|
/**
|
|
@@ -76,6 +116,28 @@ function makeEntry(file, kind, scheme, fallbackName) {
|
|
|
76
116
|
* (a partial install still serves what is present). Never throws on a single
|
|
77
117
|
* malformed file — that file is skipped with a stderr note.
|
|
78
118
|
*/
|
|
119
|
+
/**
|
|
120
|
+
* Tier A names, or `undefined` when no split has been computed here.
|
|
121
|
+
*
|
|
122
|
+
* The file is gitignored and per-machine (`compute_skill_tiers` writes it), so
|
|
123
|
+
* absent is the common case and must stay distinguishable from empty. A
|
|
124
|
+
* malformed or unreadable file is also `undefined`: a half-read split would
|
|
125
|
+
* filter the wrong skills out of the one tool that exists to find them.
|
|
126
|
+
*/
|
|
127
|
+
export function loadTierA(packageRoot) {
|
|
128
|
+
const file = resolve(packageRoot, 'agents', 'runtime', 'state', 'skill-tiers.json');
|
|
129
|
+
if (!existsSync(file))
|
|
130
|
+
return undefined;
|
|
131
|
+
try {
|
|
132
|
+
const parsed = JSON.parse(readFileSync(file, 'utf8'));
|
|
133
|
+
if (!Array.isArray(parsed.tier_a))
|
|
134
|
+
return undefined;
|
|
135
|
+
return new Set(parsed.tier_a.filter((n) => typeof n === 'string'));
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
79
141
|
export function loadContentTree(packageRoot) {
|
|
80
142
|
const uris = {};
|
|
81
143
|
const add = (e) => {
|
|
@@ -117,7 +179,8 @@ export function loadContentTree(packageRoot) {
|
|
|
117
179
|
const fallback = relative(guidelinesRoot, f).replace(/\.md$/, '').split(sep).join('/');
|
|
118
180
|
safe(() => add(makeEntry(f, 'guideline', 'guideline', fallback)), f);
|
|
119
181
|
}
|
|
120
|
-
|
|
182
|
+
const tierA = loadTierA(packageRoot);
|
|
183
|
+
return tierA ? { uris, tier_a: tierA } : { uris };
|
|
121
184
|
}
|
|
122
185
|
/** All entries of the given kinds (insertion order). */
|
|
123
186
|
export function entriesOfKind(tree, kinds) {
|
package/dist/cli/mcp/dispatch.js
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pure JSON-RPC dispatch for the local stdio-lite MCP server (ADR-
|
|
2
|
+
* Pure JSON-RPC dispatch for the local stdio-lite MCP server (ADR-207).
|
|
3
3
|
*
|
|
4
4
|
* Wire shapes are mirrored VERBATIM from the hosted Worker
|
|
5
5
|
* (`internal/workers/mcp/src/{handlers,prompts,resources}.ts`) so the local
|
|
6
6
|
* stdio surface and the hosted HTTP surface return identical envelopes —
|
|
7
|
-
* the multi-channel-consistency guarantee
|
|
8
|
-
*
|
|
7
|
+
* the multi-channel-consistency guarantee. If you change a shape here, change
|
|
8
|
+
* it there too (and the kernel `src/scripts/mcp_server/`).
|
|
9
9
|
*
|
|
10
|
-
* Read-only
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
10
|
+
* Read-only, and still read-only after Phase 1.1 of
|
|
11
|
+
* `road-to-skill-delivery-over-mcp`: `tools/list` now returns exactly TWO
|
|
12
|
+
* discovery tools — `suggest_skill_for_task` and `read_skill` — both of which
|
|
13
|
+
* only read the in-memory content tree. Execution (the `full` kernel) remains
|
|
14
|
+
* deferred per ADR-085 § Phase-2 trigger, and every other tool name still gets
|
|
15
|
+
* the `not_implemented` envelope. Pure — no I/O, no clock, no stdout.
|
|
16
|
+
*
|
|
17
|
+
* WHY THESE TWO AND NOT MORE. The turnkey server is small enough to load
|
|
18
|
+
* upfront (Claude Code defers MCP tool definitions only above ~10% of context),
|
|
19
|
+
* so every tool here is standing cost in every session. `LITE_TOOLS_TOKEN_CAP`
|
|
20
|
+
* below is that budget, asserted in `tests/scripts/mcp_lite_tools.test.ts`.
|
|
21
|
+
* `list_skills` is deliberately absent: the host already lists the names, and a
|
|
22
|
+
* 290-name tool result is the context cost this whole surface exists to avoid.
|
|
23
|
+
*
|
|
24
|
+
* The read-only boundary itself is accepted policy, owned with its revisit
|
|
25
|
+
* trigger by ADR-112 and restated as the distribution shape by ADR-207 on
|
|
26
|
+
* Node-only grounds; Phase 1.1 widens what is READ, never what is executed.
|
|
13
27
|
*/
|
|
28
|
+
import { rankSkills } from '../../shared/skillRanking.js';
|
|
14
29
|
import { entriesOfKind } from './content.js';
|
|
15
30
|
export const RPC_PARSE_ERROR = -32700;
|
|
16
31
|
export const RPC_INVALID_REQUEST = -32600;
|
|
@@ -97,13 +112,155 @@ function readResource(tree, uri) {
|
|
|
97
112
|
_meta: { source: e.source, kind: e.kind },
|
|
98
113
|
};
|
|
99
114
|
}
|
|
100
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* Server `instructions` (Phase 1.2).
|
|
117
|
+
*
|
|
118
|
+
* The AAIF Skills-over-MCP working group's June-2026 experiments found models
|
|
119
|
+
* routinely ignoring skills served over MCP and reaching for tools instead, and
|
|
120
|
+
* found that a server-side instruction nudge helped. This is that nudge, and it
|
|
121
|
+
* is the ONE positive finding from that work applied here — its decay with
|
|
122
|
+
* context length is a measurement (Phase 4.3), not something this paragraph
|
|
123
|
+
* fixes. Derived from the Iron Law of `rules/missing-skill-recovery.md`.
|
|
124
|
+
*/
|
|
125
|
+
export const INSTRUCTIONS = 'This server indexes the full skill catalogue, including skills the host ' +
|
|
126
|
+
'listed without a description or did not list at all. A skill missing from ' +
|
|
127
|
+
'the catalogue still exists: ask by task with suggest_skill_for_task, then ' +
|
|
128
|
+
'read the winner with read_skill. Never conclude that no skill covers a ' +
|
|
129
|
+
'task from the list you were shown.';
|
|
130
|
+
/** Standing-context budget for the two tool definitions, in tokens (chars/4). */
|
|
131
|
+
export const LITE_TOOLS_TOKEN_CAP = 600;
|
|
132
|
+
/** Byte cap on `INSTRUCTIONS`, so the nudge cannot grow into a preamble. */
|
|
133
|
+
export const INSTRUCTIONS_BYTE_CAP = 400;
|
|
134
|
+
/**
|
|
135
|
+
* The two discovery tools. Read-only, shell-free, and pure over the content
|
|
136
|
+
* tree — `read_skill` resolves a NAME through the tree's uri map and never
|
|
137
|
+
* joins a path, so directory traversal is not merely rejected but unexpressible.
|
|
138
|
+
*/
|
|
139
|
+
export const LITE_TOOLS = [
|
|
140
|
+
{
|
|
141
|
+
name: 'suggest_skill_for_task',
|
|
142
|
+
description: 'Rank skills against a free-form task description. Use when the ' +
|
|
143
|
+
'skill you need is not in the catalogue the host delivered, so ' +
|
|
144
|
+
'asking by name is impossible and asking by task is not. Returns ' +
|
|
145
|
+
'names, scores and personas only — never bodies.',
|
|
146
|
+
inputSchema: {
|
|
147
|
+
type: 'object',
|
|
148
|
+
required: ['task'],
|
|
149
|
+
properties: {
|
|
150
|
+
task: { type: 'string', description: 'The task to match skills against.' },
|
|
151
|
+
limit: { type: 'integer', minimum: 1, default: 5, description: 'Max results. Default 5.' },
|
|
152
|
+
},
|
|
153
|
+
additionalProperties: false,
|
|
154
|
+
},
|
|
155
|
+
annotations: { readOnlyHint: true },
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'read_skill',
|
|
159
|
+
description: 'Return one skill body by name, as listed by suggest_skill_for_task.',
|
|
160
|
+
inputSchema: {
|
|
161
|
+
type: 'object',
|
|
162
|
+
required: ['name'],
|
|
163
|
+
properties: { name: { type: 'string', description: 'Skill name.' } },
|
|
164
|
+
additionalProperties: false,
|
|
165
|
+
},
|
|
166
|
+
annotations: { readOnlyHint: true },
|
|
167
|
+
},
|
|
168
|
+
];
|
|
169
|
+
const LITE_TOOL_NAMES = new Set(LITE_TOOLS.map((t) => t.name));
|
|
170
|
+
/** Chars/4 over the served `tools/list` payload — the figure the cap is on. */
|
|
171
|
+
export function liteToolsTokenCost() {
|
|
172
|
+
return Math.round(JSON.stringify({ tools: LITE_TOOLS }).length / 4);
|
|
173
|
+
}
|
|
174
|
+
/** MCP `tools/call` success shape: text content plus the structured result. */
|
|
175
|
+
function toolTextResult(payload) {
|
|
176
|
+
return {
|
|
177
|
+
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
|
178
|
+
structuredContent: payload,
|
|
179
|
+
isError: false,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function rankableSkills(tree) {
|
|
183
|
+
return entriesOfKind(tree, ['skill']).map((e) => ({
|
|
184
|
+
name: e.name,
|
|
185
|
+
description: e.description,
|
|
186
|
+
personas: e.personas ?? [],
|
|
187
|
+
triggerText: e.trigger_text ?? [],
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Phase 3.3 — when the host already lists a skill WITH its description,
|
|
192
|
+
* returning it from the recovery tool is noise. Filter Tier A out if a split
|
|
193
|
+
* exists on this machine; return everything and say `tiers: unknown` if not.
|
|
194
|
+
*
|
|
195
|
+
* The filter deliberately does NOT apply when it would empty the result. A
|
|
196
|
+
* ranked list that went empty only because every match was Tier A is
|
|
197
|
+
* indistinguishable, to the caller, from "no skill covers this" — which is the
|
|
198
|
+
* exact wrong conclusion `missing-skill-recovery.md` exists to prevent.
|
|
199
|
+
*/
|
|
200
|
+
function tierState(tree) {
|
|
201
|
+
return tree.tier_a ? 'tier-b-only' : 'unknown';
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* `suggest_skill_for_task`. Mirrors the kernel handler's envelope — `status`,
|
|
205
|
+
* `suggestions[]` of `{skill, score, personas}` — so a consumer that learned the
|
|
206
|
+
* shape on one server does not have to relearn it on the other. `tiers` is
|
|
207
|
+
* Phase 3.3's field and reports `unknown` until a tier file is wired in.
|
|
208
|
+
*/
|
|
209
|
+
function suggestSkillForTask(tree, params) {
|
|
210
|
+
const task = typeof params.task === 'string' ? params.task.trim() : '';
|
|
211
|
+
if (!task)
|
|
212
|
+
return { status: 'error', error: 'params.task is required', suggestions: [] };
|
|
213
|
+
const rawLimit = typeof params.limit === 'number' ? Math.floor(params.limit) : 5;
|
|
214
|
+
const limit = Math.max(1, rawLimit);
|
|
215
|
+
const skills = rankableSkills(tree);
|
|
216
|
+
if (skills.length === 0) {
|
|
217
|
+
return { status: 'no_catalogue', suggestions: [], tiers: 'unknown' };
|
|
218
|
+
}
|
|
219
|
+
const all = rankSkills(task, skills);
|
|
220
|
+
const tiers = tierState(tree);
|
|
221
|
+
const tierA = tree.tier_a;
|
|
222
|
+
const filtered = tierA ? all.filter((r) => !tierA.has(r.name)) : all;
|
|
223
|
+
// Never let the tier filter turn a real match into an empty answer.
|
|
224
|
+
const kept = filtered.length > 0 ? filtered : all;
|
|
225
|
+
return {
|
|
226
|
+
status: 'ok',
|
|
227
|
+
skills_indexed: skills.length,
|
|
228
|
+
tiers,
|
|
229
|
+
...(tierA && filtered.length === 0 && all.length > 0 ? { tier_filter: 'bypassed-to-avoid-empty' } : {}),
|
|
230
|
+
suggestions: kept.slice(0, limit).map((r) => ({ skill: r.name, score: r.score, personas: r.personas })),
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
/** `read_skill`. Name lookup through the uri map; no path is ever constructed. */
|
|
234
|
+
function readSkill(tree, params) {
|
|
235
|
+
const name = typeof params.name === 'string' ? params.name.trim() : '';
|
|
236
|
+
if (!name)
|
|
237
|
+
return { status: 'error', error: 'params.name is required' };
|
|
238
|
+
// Structurally unnecessary — the lookup is a map hit on `skill://<name>` and
|
|
239
|
+
// cannot escape anywhere — but rejected explicitly so a reader does not have
|
|
240
|
+
// to reconstruct that argument, and so a future path-based backend inherits
|
|
241
|
+
// the guard rather than the hole.
|
|
242
|
+
if (name.includes('/') || name.includes('\\') || name.includes('..')) {
|
|
243
|
+
return { status: 'error', error: 'skill name must not contain a path separator' };
|
|
244
|
+
}
|
|
245
|
+
const entry = tree.uris[`skill://${name}`];
|
|
246
|
+
if (!entry || entry.kind !== 'skill') {
|
|
247
|
+
return { status: 'not_found', name };
|
|
248
|
+
}
|
|
249
|
+
return {
|
|
250
|
+
status: 'ok',
|
|
251
|
+
name: entry.name,
|
|
252
|
+
description: entry.description,
|
|
253
|
+
source: entry.source,
|
|
254
|
+
body: entry.body,
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
/** Read-only lite surface: only the two discovery tools. ADR-085 defers `full`. */
|
|
101
258
|
function notImplementedEnvelope(name) {
|
|
102
259
|
return {
|
|
103
260
|
code: 'not_implemented',
|
|
104
261
|
message: `Tool '${name}' is not available on the local stdio-lite surface ` +
|
|
105
|
-
`(read-only, ADR-
|
|
106
|
-
`
|
|
262
|
+
`(read-only, ADR-112). Execution is deferred; self-host the kernel ` +
|
|
263
|
+
`(src/scripts/mcp_server/) for tool execution.`,
|
|
107
264
|
tool: name,
|
|
108
265
|
};
|
|
109
266
|
}
|
|
@@ -120,6 +277,7 @@ export function dispatch(tree, identity, req) {
|
|
|
120
277
|
tools: { listChanged: false },
|
|
121
278
|
},
|
|
122
279
|
serverInfo: { name: identity.name, version: identity.version },
|
|
280
|
+
instructions: INSTRUCTIONS,
|
|
123
281
|
});
|
|
124
282
|
case 'ping':
|
|
125
283
|
return rpcResult(id, {});
|
|
@@ -150,11 +308,18 @@ export function dispatch(tree, identity, req) {
|
|
|
150
308
|
return rpcResult(id, r);
|
|
151
309
|
}
|
|
152
310
|
case 'tools/list':
|
|
153
|
-
return rpcResult(id, { tools:
|
|
311
|
+
return rpcResult(id, { tools: LITE_TOOLS });
|
|
154
312
|
case 'tools/call': {
|
|
155
313
|
const name = typeof params.name === 'string' ? params.name : '';
|
|
156
314
|
if (!name)
|
|
157
315
|
return rpcError(id, RPC_INVALID_PARAMS, 'params.name is required');
|
|
316
|
+
if (LITE_TOOL_NAMES.has(name)) {
|
|
317
|
+
const args = (params.arguments ?? {});
|
|
318
|
+
const payload = name === 'suggest_skill_for_task'
|
|
319
|
+
? suggestSkillForTask(tree, args)
|
|
320
|
+
: readSkill(tree, args);
|
|
321
|
+
return rpcResult(id, toolTextResult(payload));
|
|
322
|
+
}
|
|
158
323
|
const env = notImplementedEnvelope(name);
|
|
159
324
|
// Mirror the Worker: -32601 with the envelope in `data`; consumers
|
|
160
325
|
// drive logic off `error.data.code`, never the wire message.
|
package/dist/cli/registry.js
CHANGED
|
@@ -35,6 +35,8 @@ export const REGISTRY = [
|
|
|
35
35
|
{ name: 'doctor-shell', disposition: 'native', synopsis: 'Native TS-shell environment probe.' },
|
|
36
36
|
{ name: 'rtk:detect', disposition: 'native', synopsis: 'rtk (Rust Token Killer) presence + identity readout — contract: docs/contracts/rtk-detection.md.' },
|
|
37
37
|
{ name: 'ui:serve', disposition: 'native', synopsis: 'Start the local UI server.' },
|
|
38
|
+
{ name: 'ui:audit', disposition: 'native', synopsis: 'Inventory a UI tree into agents/runtime/state/ui-audit.json (Class A; the artefact ui-audit-gate reads).' },
|
|
39
|
+
{ name: 'ui:render', disposition: 'native', synopsis: 'Headless capture at desktop / 375px / 320px into agents/runtime/state/render/ (Class A; no process survives).' },
|
|
38
40
|
{ name: 'config', disposition: 'native', synopsis: 'Open the configuration GUI (global by default; --project for the project surface).' },
|
|
39
41
|
{ name: 'settings', disposition: 'native', synopsis: 'Open the local Settings GUI (alias of config).' },
|
|
40
42
|
{ name: 'install', disposition: 'native', synopsis: 'Open the install wizard (UI server, lands on Step 1 / AI tools).' },
|
|
@@ -59,6 +61,7 @@ export const REGISTRY = [
|
|
|
59
61
|
{ name: 'sessions:list', disposition: 'delegate', synopsis: 'List live agent sessions plus unmerged branches held by other worktrees; --json, --branches.' },
|
|
60
62
|
{ name: 'sessions:claim', disposition: 'delegate', synopsis: 'Claim a roadmap for this session so other sessions skip it; --release clears it.' },
|
|
61
63
|
{ name: 'session:recycle', disposition: 'delegate', synopsis: 'Validate + write the main-session recycle envelope (--verify validates only, --project names the repo); the successor resumes from it after /clear.' },
|
|
64
|
+
{ name: 'roadmap:context', disposition: 'delegate', synopsis: 'One live situational-awareness probe: open PRs + their file sets, roadmap-tail branches, live sessions, inbox note names, sibling-roadmap keyword hits; --roadmap <slug>, --json.' },
|
|
62
65
|
{ name: 'roadmap:progress', disposition: 'delegate', synopsis: 'Regenerate agents/roadmaps-progress.md from open roadmaps; archives completed ones (--no-archive to skip).' },
|
|
63
66
|
{ name: 'roadmap:progress-check', disposition: 'delegate', synopsis: 'Fail if agents/roadmaps-progress.md is stale (for CI).' },
|
|
64
67
|
{ name: 'roadmap:archive', disposition: 'delegate', synopsis: 'Archive completed roadmaps (PR-gate sweep).' },
|
|
@@ -201,6 +201,61 @@ function resolve_rule_pack_scope(raw, package_root, runtime_active_packs = []) {
|
|
|
201
201
|
}
|
|
202
202
|
return null;
|
|
203
203
|
}
|
|
204
|
+
function prune_modules_by(deploy_results, is_pruned) {
|
|
205
|
+
let pruned = 0;
|
|
206
|
+
const adjusted = {};
|
|
207
|
+
for (const tool_id of Object.keys(deploy_results)) {
|
|
208
|
+
const [written, skipped, status, paths] = deploy_results[tool_id];
|
|
209
|
+
const pruned_skill_dirs = /* @__PURE__ */ new Set();
|
|
210
|
+
for (const p of paths) {
|
|
211
|
+
const parts = p.split(path2.sep);
|
|
212
|
+
if (parts.includes("skills")) {
|
|
213
|
+
const i = parts.indexOf("skills");
|
|
214
|
+
if (i + 1 < parts.length) {
|
|
215
|
+
const skill_root = parts.slice(0, i + 2).join(path2.sep);
|
|
216
|
+
if (!pruned_skill_dirs.has(skill_root)) {
|
|
217
|
+
const skillmd = path2.join(skill_root, "SKILL.md");
|
|
218
|
+
if (fs2.existsSync(skillmd) && is_pruned(skillmd)) {
|
|
219
|
+
pruned_skill_dirs.add(skill_root);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const keep = [];
|
|
226
|
+
const delete_files = [];
|
|
227
|
+
for (const p of paths) {
|
|
228
|
+
const parts = p.split(path2.sep);
|
|
229
|
+
let is_target = false;
|
|
230
|
+
if (parts.includes("skills")) {
|
|
231
|
+
const i = parts.indexOf("skills");
|
|
232
|
+
if (i + 1 < parts.length && pruned_skill_dirs.has(parts.slice(0, i + 2).join(path2.sep))) {
|
|
233
|
+
is_target = true;
|
|
234
|
+
}
|
|
235
|
+
} else if (parts.includes("commands") && path2.extname(p) === ".md" && is_pruned(p)) {
|
|
236
|
+
is_target = true;
|
|
237
|
+
}
|
|
238
|
+
(is_target ? delete_files : keep).push(p);
|
|
239
|
+
}
|
|
240
|
+
for (const d of pruned_skill_dirs) {
|
|
241
|
+
fs2.rmSync(d, { recursive: true, force: true });
|
|
242
|
+
}
|
|
243
|
+
for (const p of delete_files) {
|
|
244
|
+
if (p.split(path2.sep).includes("commands") && fs2.existsSync(p)) {
|
|
245
|
+
try {
|
|
246
|
+
fs2.unlinkSync(p);
|
|
247
|
+
} catch {
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
pruned += delete_files.length;
|
|
252
|
+
adjusted[tool_id] = [Math.max(0, written - delete_files.length), skipped, status, keep];
|
|
253
|
+
}
|
|
254
|
+
return [pruned, adjusted];
|
|
255
|
+
}
|
|
256
|
+
function prune_lab_modules(deploy_results, lab_ids) {
|
|
257
|
+
return prune_modules_by(deploy_results, (p) => is_lab_artefact(p, lab_ids));
|
|
258
|
+
}
|
|
204
259
|
|
|
205
260
|
// src/install/ruleInScope.ts
|
|
206
261
|
var YAML = __toESM(require_dist(), 1);
|
|
@@ -328,10 +383,11 @@ function excludedRuleBasenames(rulesDir, scope) {
|
|
|
328
383
|
|
|
329
384
|
export {
|
|
330
385
|
load_lab_pack_ids,
|
|
331
|
-
is_lab_artefact,
|
|
332
386
|
load_packs_registry,
|
|
333
387
|
compute_active_pack_ids,
|
|
334
388
|
is_pruned_under_scoped,
|
|
389
|
+
prune_modules_by,
|
|
390
|
+
prune_lab_modules,
|
|
335
391
|
parseFrontmatter,
|
|
336
392
|
LEGACY_ALL,
|
|
337
393
|
ruleScopeFromSettings,
|