@event4u/agent-config 9.10.0 → 9.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.
Files changed (142) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +111 -0
  3. package/README.md +20 -16
  4. package/agents/templates/.ai-council.yml.example +481 -0
  5. package/agents/templates/.ai-video.xml.example +247 -0
  6. package/dist/agent-src/commands/fix/ci.md +29 -0
  7. package/dist/agent-src/commands/pr/create.md +60 -0
  8. package/dist/agent-src/contexts/authority/kernel-rule-edits.md +18 -2
  9. package/dist/agent-src/rules/design-fidelity.md +2 -2
  10. package/dist/agent-src/skills/ai-code-blindspots/SKILL.md +1 -0
  11. package/dist/agent-src/skills/design-intelligence/SKILL.md +27 -1
  12. package/dist/agent-src/skills/design-intelligence/data/font-pairings-reference.csv +74 -74
  13. package/dist/agent-src/skills/design-intelligence/data/manifest.json +2 -0
  14. package/dist/agent-src/skills/design-tokens/scripts/tokens.ts +0 -7
  15. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +15 -2
  16. package/dist/agent-src/skills/fe-design/SKILL.md +10 -0
  17. package/dist/agent-src/skills/typography-system/SKILL.md +55 -11
  18. package/dist/agent-src/skills/ui-apply-generic/SKILL.md +180 -0
  19. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  20. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +34 -30
  21. package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
  22. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +23 -0
  23. package/dist/agent-src/templates/scripts/work_engine/directives/ui/review.ts +24 -1
  24. package/dist/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +332 -0
  25. package/dist/agent-src/templates/scripts/work_engine/stack/detect.ts +449 -11
  26. package/dist/agent-src/templates/scripts/work_engine/state.ts +21 -4
  27. package/dist/cli/initRouting.js +74 -11
  28. package/dist/cli/initRouting.js.map +1 -1
  29. package/dist/cli/main.js +14 -3
  30. package/dist/cli/main.js.map +1 -1
  31. package/dist/cli-delegate/chunk-523HCFYO.js +90 -0
  32. package/dist/cli-delegate/chunk-736JCWLM.js +1104 -0
  33. package/dist/cli-delegate/chunk-7HQ52DHU.js +74 -0
  34. package/dist/cli-delegate/chunk-A3HJ6NTI.js +1084 -0
  35. package/dist/cli-delegate/chunk-EJYIGZ3T.js +125 -0
  36. package/dist/cli-delegate/chunk-FTAISGDQ.js +117 -0
  37. package/dist/cli-delegate/chunk-GME3Q44L.js +82 -0
  38. package/dist/cli-delegate/chunk-GRRPEPRN.js +336 -0
  39. package/dist/cli-delegate/chunk-HJ6DAJHR.js +502 -0
  40. package/dist/cli-delegate/chunk-HYWSRNUX.js +179 -0
  41. package/dist/cli-delegate/chunk-J55WI3RR.js +47 -0
  42. package/dist/cli-delegate/chunk-MCJYCQPF.js +35 -0
  43. package/dist/cli-delegate/chunk-NDJLNC6Q.js +169 -0
  44. package/dist/cli-delegate/chunk-OMIVVCG2.js +26 -0
  45. package/dist/cli-delegate/chunk-OY53J6II.js +7336 -0
  46. package/dist/cli-delegate/chunk-QFKQLQ7X.js +10835 -0
  47. package/dist/cli-delegate/chunk-TEGJU2JX.js +6908 -0
  48. package/dist/cli-delegate/chunk-TJIAM5FW.js +133 -0
  49. package/dist/cli-delegate/chunk-XX6TOPD7.js +715 -0
  50. package/dist/cli-delegate/cmd_analyze_session.js +294 -0
  51. package/dist/cli-delegate/cmd_conformance.js +643 -0
  52. package/dist/cli-delegate/cmd_converge.js +326 -0
  53. package/dist/cli-delegate/cmd_doctor.js +142 -0
  54. package/dist/cli-delegate/cmd_explain.js +2576 -0
  55. package/dist/cli-delegate/cmd_export.js +298 -0
  56. package/dist/cli-delegate/cmd_fleet.js +333 -0
  57. package/dist/cli-delegate/cmd_memory_get.js +3878 -0
  58. package/dist/cli-delegate/cmd_migrate.js +11 -0
  59. package/dist/cli-delegate/cmd_preflight.js +153 -0
  60. package/dist/cli-delegate/cmd_prune.js +446 -0
  61. package/dist/cli-delegate/cmd_refresh.js +28 -0
  62. package/dist/cli-delegate/cmd_settings_check.js +574 -0
  63. package/dist/cli-delegate/cmd_settings_migrate.js +225 -0
  64. package/dist/cli-delegate/cmd_sync.js +266 -0
  65. package/dist/cli-delegate/cmd_uninstall.js +657 -0
  66. package/dist/cli-delegate/cmd_update.js +425 -0
  67. package/dist/cli-delegate/cmd_upgrade.js +444 -0
  68. package/dist/cli-delegate/cmd_validate.js +307 -0
  69. package/dist/cli-delegate/cmd_versions.js +370 -0
  70. package/dist/discovery/deprecation-report.md +1 -1
  71. package/dist/discovery/discovery-manifest.json +45 -16
  72. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  73. package/dist/discovery/discovery-manifest.summary.md +3 -3
  74. package/dist/discovery/orphan-report.md +1 -1
  75. package/dist/discovery/packs.json +13 -7
  76. package/dist/discovery/trust-report.md +2 -2
  77. package/dist/discovery/workspaces.json +6 -4
  78. package/dist/install/emit_host_rules_cli.js +2 -1
  79. package/dist/install/emit_host_rules_cli.js.map +1 -1
  80. package/dist/install/install.mjs +634 -409
  81. package/dist/install/ruleInScope.js +123 -0
  82. package/dist/install/ruleInScope.js.map +1 -0
  83. package/dist/install/rule_scope.js +7 -3
  84. package/dist/install/rule_scope.js.map +1 -1
  85. package/dist/install/toolDetection.js +40 -12
  86. package/dist/install/toolDetection.js.map +1 -1
  87. package/dist/install/wizard-plan.js +12 -3
  88. package/dist/install/wizard-plan.js.map +1 -1
  89. package/dist/mcp/registry-manifest.json +3 -3
  90. package/dist/mcp/server.json +2 -2
  91. package/dist/mcp/server.mjs +1553 -2728
  92. package/dist/router.json +1 -1
  93. package/dist/scripts/condense.js +6 -22
  94. package/dist/scripts/condense.js.map +1 -1
  95. package/docs/guidelines/design-fidelity-mechanics.md +14 -0
  96. package/package.json +4 -2
  97. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +34 -30
  98. package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +88 -33
  99. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +23 -0
  100. package/src/agent-src/templates/scripts/work_engine/directives/ui/review.ts +24 -1
  101. package/src/agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.ts +332 -0
  102. package/src/agent-src/templates/scripts/work_engine/stack/detect.ts +449 -11
  103. package/src/agent-src/templates/scripts/work_engine/state.ts +21 -4
  104. package/src/config/discovery/packs.yml +7 -0
  105. package/src/config/evaluator-budgets.json +1 -1
  106. package/src/config/pack-size-budget.json +27 -0
  107. package/src/install/emit_host_rules_cli.ts +2 -1
  108. package/src/install/ruleInScope.ts +133 -0
  109. package/src/install/rule_scope.ts +7 -3
  110. package/src/install/toolDetection.ts +39 -8
  111. package/src/install/wizard-plan.ts +13 -3
  112. package/src/scripts/_cli/cmd_conformance.ts +2 -1
  113. package/src/scripts/_cli/cmd_converge.ts +2 -1
  114. package/src/scripts/_cli/cmd_doctor.ts +214 -13
  115. package/src/scripts/_cli/cmd_export.ts +2 -1
  116. package/src/scripts/_cli/cmd_fleet.ts +2 -1
  117. package/src/scripts/_cli/cmd_migrate.ts +2 -1
  118. package/src/scripts/_cli/cmd_preflight.ts +2 -1
  119. package/src/scripts/_cli/cmd_refresh.ts +2 -1
  120. package/src/scripts/_cli/cmd_update.ts +2 -1
  121. package/src/scripts/_cli/cmd_upgrade.ts +2 -1
  122. package/src/scripts/_cli/cmd_versions.ts +2 -1
  123. package/src/scripts/_cli/detection_report.ts +480 -0
  124. package/src/scripts/_dispatch.bash +52 -14
  125. package/src/scripts/_lib/changelog_eras.ts +103 -9
  126. package/src/scripts/_lib/environment_detector.ts +441 -0
  127. package/src/scripts/_lib/global_deploy_inventory.ts +38 -2
  128. package/src/scripts/_lib/package_root.ts +72 -0
  129. package/src/scripts/ai_council/config.ts +15 -7
  130. package/src/scripts/ai_council/modes.ts +68 -2
  131. package/src/scripts/ai_council/transport_resolver.ts +331 -0
  132. package/src/scripts/check_bundle_path_leakage.ts +10 -4
  133. package/src/scripts/check_dependency_floors.ts +153 -0
  134. package/src/scripts/check_installer_import_purity.ts +295 -0
  135. package/src/scripts/check_pack_size.ts +188 -0
  136. package/src/scripts/condense.ts +7 -28
  137. package/src/scripts/council_cli.ts +6 -2
  138. package/src/scripts/evaluator_umbrella.sh +34 -1
  139. package/src/scripts/install-hooks.sh +36 -4
  140. package/src/scripts/install.ts +210 -5
  141. package/src/scripts/lint_eval_fixture_citations.ts +113 -0
  142. package/src/scripts/lint_ui_stack_bundles.ts +201 -0
@@ -0,0 +1,201 @@
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * Lint the UI-track verb → skill-bundle map.
4
+ *
5
+ * The stack-dispatched UI steps halt with a directive verb
6
+ * (`ui-apply-<stack>` and friends). Those verbs are agent-interpreted, not
7
+ * skill paths — only 2 of the engine's 11 literal verbs name a real skill — so
8
+ * the mapping from verb to the skills that implement it is a separate fact.
9
+ * It used to live only in a prose table in `docs/contracts/ui-track-flow.md`,
10
+ * unverified, and two of its four rows were wrong: `vue` named the verb itself
11
+ * (no skill at all) and `plain` — the fallback for every unrecognised project —
12
+ * named `blade-ui`, a `packs: [laravel]` skill that a non-Laravel consumer does
13
+ * not have installed.
14
+ *
15
+ * Two assertions, both decidable in this repo:
16
+ *
17
+ * 1. RESOLUTION — every bundle member is a real skill (`src/skills/<n>/SKILL.md`).
18
+ * 2. PACK REACH — a lane declared `pack_agnostic` names only skills that ship
19
+ * in a stack-neutral pack. This is the assertion that actually matters: CI
20
+ * here cannot see a consumer's installed pack combination, so "the skill
21
+ * exists in our tree" would have passed the `plain → blade-ui` defect
22
+ * unchanged.
23
+ *
24
+ * Exit codes: 0 clean, 1 one or more findings.
25
+ */
26
+
27
+ import * as fs from 'node:fs';
28
+ import * as path from 'node:path';
29
+ import { fileURLToPath } from 'node:url';
30
+
31
+ import {
32
+ STACK_BUNDLES,
33
+ type StackBundle,
34
+ compose_bundle,
35
+ } from '../agent-src/templates/scripts/work_engine/directives/ui/stack_bundles.js';
36
+
37
+ const QUIET = process.argv.includes('--quiet');
38
+
39
+ const _HERE = fileURLToPath(import.meta.url);
40
+ const REPO = path.resolve(path.dirname(_HERE), '..', '..');
41
+ const SKILLS_DIR = path.join(REPO, 'src', 'skills');
42
+
43
+ /**
44
+ * Packs that ship regardless of the project's framework. A `pack_agnostic`
45
+ * lane may only draw on these — anything else is unavailable to some consumer.
46
+ */
47
+ const STACK_NEUTRAL_PACKS: ReadonlySet<string> = new Set(['engineering-base', 'core', 'meta']);
48
+
49
+ const findings: string[] = [];
50
+
51
+ /**
52
+ * Axis combinations the composition must satisfy.
53
+ *
54
+ * Not exhaustive over the cross-product — that would be thousands of
55
+ * meaningless tuples. These are the shapes a real project produces, including
56
+ * the ones no hand-written lane ever covered (Nuxt over Vue, Astro, Angular,
57
+ * Livewire without Flux).
58
+ */
59
+ const _AXIS_COMBOS: ReadonlyArray<Record<string, string>> = [
60
+ { view: 'blade', reactivity: 'livewire', component_lib: 'flux', css: 'tailwind', meta: 'none' },
61
+ { view: 'blade', reactivity: 'livewire', component_lib: 'none', css: 'tailwind', meta: 'none' },
62
+ { view: 'blade', reactivity: 'alpine', component_lib: 'none', css: 'tailwind', meta: 'none' },
63
+ { view: 'blade', reactivity: 'unknown', component_lib: 'none', css: 'none', meta: 'filament' },
64
+ { view: 'jsx', reactivity: 'react', component_lib: 'radix', css: 'tailwind', meta: 'none' },
65
+ { view: 'jsx', reactivity: 'react', component_lib: 'none', css: 'tailwind', meta: 'nextjs' },
66
+ { view: 'vue-sfc', reactivity: 'vue', component_lib: 'none', css: 'none', meta: 'nuxt' },
67
+ { view: 'svelte-sfc', reactivity: 'svelte', component_lib: 'none', css: 'none', meta: 'none' },
68
+ { view: 'astro', reactivity: 'unknown', component_lib: 'none', css: 'none', meta: 'astro' },
69
+ { view: 'angular-html', reactivity: 'angular', component_lib: 'none', css: 'none', meta: 'none' },
70
+ { view: 'unknown', reactivity: 'htmx', component_lib: 'none', css: 'none', meta: 'none' },
71
+ { view: 'none', reactivity: 'none', component_lib: 'none', css: 'tailwind', meta: 'none' },
72
+ ];
73
+
74
+ function skill_path(name: string): string {
75
+ return path.join(SKILLS_DIR, name, 'SKILL.md');
76
+ }
77
+
78
+ /** Return the `packs:` list from a skill's frontmatter, or `null` if absent. */
79
+ function packs_of(name: string): string[] | null {
80
+ let text: string;
81
+ try {
82
+ text = fs.readFileSync(skill_path(name), { encoding: 'utf-8' });
83
+ } catch {
84
+ return null;
85
+ }
86
+ // Frontmatter only — a `packs:` mention in the body is not a declaration.
87
+ const end = text.indexOf('\n---', 4);
88
+ const front = end === -1 ? text : text.slice(0, end);
89
+ // `[ \t]*`, not `\s*`: `\s` matches a newline, so the greedy form swallowed
90
+ // the line break and captured the first block-list item as if it were an
91
+ // inline value — which made every block-list skill parse as "no packs".
92
+ const match = /^packs:[ \t]*(.*)$/m.exec(front);
93
+ if (match === null) return null;
94
+ const inline = (match[1] ?? '').trim();
95
+ if (inline.startsWith('[')) {
96
+ return inline
97
+ .replace(/^\[|\]$/g, '')
98
+ .split(',')
99
+ .map((s) => s.trim().replace(/^['"]|['"]$/g, ''))
100
+ .filter((s) => s !== '');
101
+ }
102
+ // Block list: consume the ` - name` lines that follow. `match[0]` stops
103
+ // before the newline, so the first split element is the empty tail of the
104
+ // matched line itself — dropping it is required, not cosmetic: treating it
105
+ // as a non-item ended the loop immediately and made every block-list skill
106
+ // parse as "no packs", which is how this linter first shipped green against
107
+ // the very defect it exists to catch.
108
+ const rest = front.slice(match.index + match[0].length).split('\n').slice(1);
109
+ const out: string[] = [];
110
+ for (const line of rest) {
111
+ const item = /^\s*-\s*(.+?)\s*$/.exec(line);
112
+ if (item === null) break;
113
+ out.push((item[1] ?? '').replace(/^['"]|['"]$/g, ''));
114
+ }
115
+ return out;
116
+ }
117
+
118
+ function check_lane(lane: string, bundle: StackBundle): void {
119
+ const members = [...bundle.build, ...bundle.review];
120
+ if (members.length === 0) {
121
+ findings.push(`${lane}: bundle is empty — a lane must name at least one skill.`);
122
+ return;
123
+ }
124
+ for (const name of new Set(members)) {
125
+ // 1. RESOLUTION
126
+ if (!fs.existsSync(skill_path(name))) {
127
+ findings.push(
128
+ `${lane}: bundle member \`${name}\` has no ` +
129
+ `\`src/skills/${name}/SKILL.md\` — the verb would resolve to nothing.`,
130
+ );
131
+ continue;
132
+ }
133
+ // 2. PACK REACH
134
+ if (!bundle.pack_agnostic) continue;
135
+ const packs = packs_of(name);
136
+ if (packs === null) {
137
+ findings.push(
138
+ `${lane}: bundle member \`${name}\` declares no \`packs:\` — ` +
139
+ 'a pack-agnostic lane cannot verify it ships everywhere.',
140
+ );
141
+ continue;
142
+ }
143
+ const offenders = packs.filter((p) => !STACK_NEUTRAL_PACKS.has(p));
144
+ if (offenders.length > 0) {
145
+ findings.push(
146
+ `${lane}: lane is \`pack_agnostic\` but member \`${name}\` ships only in ` +
147
+ `[${offenders.join(', ')}] — a consumer without that pack gets nothing. ` +
148
+ 'This is the `plain → blade-ui` defect class.',
149
+ );
150
+ }
151
+ }
152
+ }
153
+
154
+ function main(): number {
155
+ const lanes = Object.keys(STACK_BUNDLES).sort();
156
+ if (lanes.length === 0) {
157
+ process.stderr.write('lint-ui-stack-bundles: STACK_BUNDLES is empty — nothing to check.\n');
158
+ return 1;
159
+ }
160
+ for (const lane of lanes) {
161
+ check_lane(lane, STACK_BUNDLES[lane] as StackBundle);
162
+ }
163
+
164
+ // The composed shape, not just the hand-written lanes. Dispatch derives a
165
+ // bundle from axes now, so a combination nobody wrote down by hand can
166
+ // still be produced — and it has to satisfy the same two properties.
167
+ for (const combo of _AXIS_COMBOS) {
168
+ check_lane(`composed(${JSON.stringify(combo)})`, compose_bundle(combo));
169
+ }
170
+
171
+ // A lane usable as a fallback must be pack-agnostic, else the fallback
172
+ // itself is the thing that fails for an unpredictable consumer.
173
+ const plain = STACK_BUNDLES['plain'];
174
+ if (plain === undefined) {
175
+ findings.push('plain: missing — it is the documented DEFAULT_DIRECTIVE lane.');
176
+ } else if (!plain.pack_agnostic) {
177
+ findings.push(
178
+ 'plain: the fallback lane must be `pack_agnostic` — every unrecognised ' +
179
+ 'project lands here and its packs are unknown.',
180
+ );
181
+ }
182
+
183
+ if (findings.length > 0) {
184
+ for (const f of findings) {
185
+ process.stdout.write(`lint-ui-stack-bundles: ${f}\n`);
186
+ }
187
+ process.stderr.write(
188
+ `lint-ui-stack-bundles: ${findings.length} finding(s) across ${lanes.length} lane(s).\n`,
189
+ );
190
+ return 1;
191
+ }
192
+ if (!QUIET) {
193
+ process.stdout.write(
194
+ `lint-ui-stack-bundles: ${lanes.length} lane(s) clean — every bundle member ` +
195
+ 'resolves, and every pack-agnostic lane stays stack-neutral.\n',
196
+ );
197
+ }
198
+ return 0;
199
+ }
200
+
201
+ process.exit(main());