@event4u/agent-config 9.12.0 → 9.14.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 (146) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +110 -238
  3. package/README.md +1 -1
  4. package/dist/agent-src/commands/optimize/deep.md +147 -0
  5. package/dist/agent-src/commands/optimize.md +12 -6
  6. package/dist/agent-src/rules/active-remediation.md +0 -2
  7. package/dist/agent-src/rules/architecture.md +0 -1
  8. package/dist/agent-src/rules/artifact-drafting-protocol.md +0 -4
  9. package/dist/agent-src/rules/autonomous-execution.md +1 -2
  10. package/dist/agent-src/rules/broken-access-control.md +0 -2
  11. package/dist/agent-src/rules/code-comment-discipline.md +0 -3
  12. package/dist/agent-src/rules/code-provenance.md +0 -3
  13. package/dist/agent-src/rules/communication-through-line.md +2 -3
  14. package/dist/agent-src/rules/content-quoting-floor.md +0 -2
  15. package/dist/agent-src/rules/context-hygiene.md +1 -3
  16. package/dist/agent-src/rules/decision-revisit-gate.md +0 -2
  17. package/dist/agent-src/rules/design-fidelity.md +29 -0
  18. package/dist/agent-src/rules/domain-adoption-policy.md +0 -3
  19. package/dist/agent-src/rules/downstream-changes.md +10 -1
  20. package/dist/agent-src/rules/external-reference-deep-dive.md +0 -7
  21. package/dist/agent-src/rules/fast-path-marker-visibility.md +0 -1
  22. package/dist/agent-src/rules/git-history-discipline.md +0 -7
  23. package/dist/agent-src/rules/guidelines.md +0 -2
  24. package/dist/agent-src/rules/improve-before-implement.md +4 -2
  25. package/dist/agent-src/rules/invite-challenge.md +0 -4
  26. package/dist/agent-src/rules/linked-projects-onboarding-gate.md +0 -2
  27. package/dist/agent-src/rules/markdown-safe-codeblocks.md +0 -1
  28. package/dist/agent-src/rules/minimal-safe-diff.md +2 -2
  29. package/dist/agent-src/rules/missing-tool-handling.md +0 -1
  30. package/dist/agent-src/rules/no-attribution-footers.md +0 -3
  31. package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +8 -5
  32. package/dist/agent-src/rules/no-pr-progress-comments.md +1 -3
  33. package/dist/agent-src/rules/no-roadmap-references.md +0 -2
  34. package/dist/agent-src/rules/output-discipline.md +0 -1
  35. package/dist/agent-src/rules/prefer-enums-over-literals.md +0 -2
  36. package/dist/agent-src/rules/preservation-guard.md +0 -3
  37. package/dist/agent-src/rules/role-mode-adherence.md +0 -1
  38. package/dist/agent-src/rules/secret-vcs-guard.md +0 -2
  39. package/dist/agent-src/rules/senior-engineering-discipline.md +0 -2
  40. package/dist/agent-src/rules/session-canary.md +0 -2
  41. package/dist/agent-src/rules/size-enforcement.md +0 -5
  42. package/dist/agent-src/rules/source-confidentiality.md +0 -3
  43. package/dist/agent-src/rules/source-discovery-gate.md +0 -2
  44. package/dist/agent-src/rules/think-before-action.md +3 -3
  45. package/dist/agent-src/rules/token-budget-discipline.md +0 -1
  46. package/dist/agent-src/rules/token-efficiency.md +1 -2
  47. package/dist/agent-src/rules/tool-safety.md +0 -1
  48. package/dist/agent-src/rules/user-interaction.md +0 -3
  49. package/dist/agent-src/rules/user-interrupt-priority.md +0 -1
  50. package/dist/agent-src/skills/agent-docs-writing/SKILL.md +8 -0
  51. package/dist/agent-src/skills/analysis-skill-router/SKILL.md +55 -86
  52. package/dist/agent-src/skills/character-consistency/SKILL.md +7 -4
  53. package/dist/agent-src/skills/decision-record/SKILL.md +8 -0
  54. package/dist/agent-src/skills/design-review/SKILL.md +11 -0
  55. package/dist/agent-src/skills/design-system-capture/reference/design-system-json.md +8 -0
  56. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +34 -3
  57. package/dist/agent-src/skills/fe-design/SKILL.md +10 -0
  58. package/dist/agent-src/skills/motion-choreographer/SKILL.md +7 -4
  59. package/dist/agent-src/skills/overbuild-review-lens/SKILL.md +201 -0
  60. package/dist/agent-src/skills/performance/SKILL.md +14 -0
  61. package/dist/agent-src/skills/pixar-storyteller/SKILL.md +8 -5
  62. package/dist/agent-src/skills/scene-expander/SKILL.md +9 -6
  63. package/dist/agent-src/skills/supply-chain-intake/SKILL.md +10 -0
  64. package/dist/agent-src/skills/universal-project-analysis/SKILL.md +14 -37
  65. package/dist/agent-src/skills/video-director/SKILL.md +9 -6
  66. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  67. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +154 -13
  68. package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +118 -0
  69. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +40 -0
  70. package/dist/agent-src/templates/scripts/work_engine/state.ts +55 -0
  71. package/dist/cli-delegate/{chunk-QFKQLQ7X.js → chunk-GCVFLBP2.js} +399 -365
  72. package/dist/cli-delegate/cmd_export.js +1 -1
  73. package/dist/cli-delegate/cmd_prune.js +1 -1
  74. package/dist/cli-delegate/cmd_settings_migrate.js +1 -1
  75. package/dist/cli-delegate/cmd_sync.js +1 -1
  76. package/dist/cli-delegate/cmd_uninstall.js +1 -1
  77. package/dist/cli-delegate/cmd_validate.js +1 -1
  78. package/dist/discovery/deprecation-report.md +1 -1
  79. package/dist/discovery/discovery-manifest.json +123 -73
  80. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  81. package/dist/discovery/discovery-manifest.summary.md +4 -4
  82. package/dist/discovery/orphan-report.md +1 -1
  83. package/dist/discovery/packs.json +10 -8
  84. package/dist/discovery/trust-report.md +3 -3
  85. package/dist/discovery/workspaces.json +8 -6
  86. package/dist/hooks/dispatch.js +174 -13
  87. package/dist/install/install.mjs +648 -614
  88. package/dist/mcp/registry-manifest.json +3 -3
  89. package/dist/mcp/server.json +2 -2
  90. package/dist/mcp/server.mjs +783 -507
  91. package/dist/router.json +1 -1
  92. package/dist/scripts/condense.js +2 -2
  93. package/docs/MIGRATION.md +1 -1
  94. package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +71 -0
  95. package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +24 -1
  96. package/docs/guidelines/code-clarity.md +9 -2
  97. package/docs/guidelines/design-fidelity-mechanics.md +44 -0
  98. package/llms.txt +63 -27
  99. package/package.json +4 -4
  100. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +154 -13
  101. package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +118 -0
  102. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +40 -0
  103. package/src/agent-src/templates/scripts/work_engine/state.ts +55 -0
  104. package/src/config/agent-settings.template.yml +8 -0
  105. package/src/scripts/_lib/counted_probe.ts +142 -0
  106. package/src/scripts/_lib/exec_evidence.ts +5 -0
  107. package/src/scripts/_lib/overbuild_lens_contract.ts +196 -0
  108. package/src/scripts/_lib/release_scope.ts +207 -0
  109. package/src/scripts/_lib/scoped_projection.ts +212 -0
  110. package/src/scripts/ai_council/stance_tally.ts +37 -2
  111. package/src/scripts/audit_auto_rules.ts +9 -9
  112. package/src/scripts/audit_likelihood.ts +3 -3
  113. package/src/scripts/audit_overlap.ts +2 -2
  114. package/src/scripts/audit_skill_overlap.ts +233 -95
  115. package/src/scripts/audit_skill_overlap_allowlist.json +4 -0
  116. package/src/scripts/build_proof.ts +15 -1
  117. package/src/scripts/check_artefact_count_messaging.ts +128 -15
  118. package/src/scripts/check_dependency_floors.ts +16 -6
  119. package/src/scripts/check_gate_coverage.ts +6 -6
  120. package/src/scripts/check_kernel_rule_bundle.ts +5 -4
  121. package/src/scripts/check_token_quality_golden.ts +0 -18
  122. package/src/scripts/code_graph/loader.ts +35 -6
  123. package/src/scripts/compile_router.ts +3 -8
  124. package/src/scripts/condense.ts +2 -2
  125. package/src/scripts/count_scoped_projection.ts +104 -0
  126. package/src/scripts/explain_run.ts +0 -1
  127. package/src/scripts/generate_pack_manifests.ts +3 -20
  128. package/src/scripts/hooks/block_kernel_rule_writes.ts +145 -10
  129. package/src/scripts/hooks/block_no_verify.ts +101 -0
  130. package/src/scripts/install.ts +13 -90
  131. package/src/scripts/lint_agent_security.ts +5 -4
  132. package/src/scripts/lint_framework_leakage_allowlist.json +2 -2
  133. package/src/scripts/lint_regression.ts +92 -1
  134. package/src/scripts/lint_skill_descriptions.ts +93 -5
  135. package/src/scripts/project_thin_rules.ts +2 -2
  136. package/src/scripts/release.ts +107 -3
  137. package/src/scripts/resolve_lint_scope.ts +53 -0
  138. package/src/scripts/router_telemetry.ts +0 -5
  139. package/src/scripts/runtime_dispatcher.ts +40 -0
  140. package/src/scripts/schemas/pack.schema.json +1 -5
  141. package/src/scripts/schemas/rule.schema.json +1 -2
  142. package/src/scripts/self_review_gate.ts +15 -73
  143. package/src/scripts/skill_linter.ts +160 -11
  144. package/src/scripts/sweep_dead_scan_roots.ts +550 -0
  145. package/src/scripts/trigger_coverage.ts +11 -37
  146. package/src/scripts/update_counts.ts +90 -11
@@ -26,6 +26,8 @@ import process from 'node:process';
26
26
  import { fileURLToPath, pathToFileURL } from 'node:url';
27
27
 
28
28
  import { artefact_roots, iter_commands } from './_lib/agent_src.js';
29
+ import { scoped_projection_stats } from './_lib/scoped_projection.js';
30
+ import { canonical_counts } from './check_command_count_messaging.js';
29
31
 
30
32
  const _HERE = fileURLToPath(import.meta.url);
31
33
  // _HERE === <repo>/src/scripts/update_counts.ts ; the retired Python implementation derives
@@ -77,7 +79,48 @@ function _exists(p: string): boolean {
77
79
  }
78
80
  }
79
81
 
82
+ /**
83
+ * Every `SKILL.md` the canonical `count('skills')` counts, as absolute paths.
84
+ *
85
+ * Exported so `count_scoped_projection.ts` partitions the SAME file set the
86
+ * ledger's total is derived from. That is what makes the published pair
87
+ * ("N of M skills") coherent by construction: `projected + pruned === M`
88
+ * cannot drift, because there is one walk, not two.
89
+ */
90
+ export function* iter_skills(): Generator<string> {
91
+ const seen = new Set<string>();
92
+ for (const root of artefact_roots()) {
93
+ const subdir = path.join(root, 'skills');
94
+ if (!_exists(subdir)) {
95
+ continue;
96
+ }
97
+ for (const f of _rglob(subdir, (n) => n === 'SKILL.md')) {
98
+ const rel = path.relative(root, f).split(path.sep).join('/');
99
+ if (seen.has(rel)) continue;
100
+ seen.add(rel);
101
+ yield f;
102
+ }
103
+ }
104
+ }
105
+
80
106
  export function count(kind: string): number {
107
+ if (kind === 'commands_active') {
108
+ // Commands MINUS deprecation shims — the number the hero badge and the
109
+ // "Browse all N active commands" line carry, and the one prose
110
+ // mentions resolve to. Distinct from `commands` (raw file count):
111
+ // they are equal only while the shim set is empty, so anchoring an
112
+ // active-count position to `commands` would rewrite it to the wrong
113
+ // number the moment a command is superseded.
114
+ const [, , active] = canonical_counts();
115
+ return active;
116
+ }
117
+ if (kind === 'skills_scoped') {
118
+ // Skills a DEFAULT `projection.mode: scoped` install deploys. Derived
119
+ // by the installer's own prune predicate over the same walk the
120
+ // canonical `skills` total uses, so the published pair
121
+ // ("N of M skills") cannot drift apart. See count_scoped_projection.ts.
122
+ return scoped_projection_stats(REPO_ROOT, iter_skills()).projected;
123
+ }
81
124
  if (kind === 'router_rules') {
82
125
  // Routed rule entries in the compiled router (kernel + tier_1 +
83
126
  // tier_2). Read from dist/router.json — the artifact hosts consume —
@@ -119,19 +162,19 @@ export function count(kind: string): number {
119
162
  }
120
163
  return total;
121
164
  }
165
+ if (kind === 'skills') {
166
+ // Single walk, shared with count_scoped_projection.ts — see iter_skills.
167
+ for (const _ of iter_skills()) {
168
+ total += 1;
169
+ }
170
+ return total;
171
+ }
122
172
  for (const root of artefact_roots()) {
123
173
  const subdir = path.join(root, kind);
124
174
  if (!_exists(subdir)) {
125
175
  continue;
126
176
  }
127
- if (kind === 'skills') {
128
- for (const f of _rglob(subdir, (n) => n === 'SKILL.md')) {
129
- const rel = path.relative(root, f).split(path.sep).join('/');
130
- if (seen.has(rel)) continue;
131
- seen.add(rel);
132
- total += 1;
133
- }
134
- } else if (kind === 'personas') {
177
+ if (kind === 'personas') {
135
178
  // personas live as flat .md files, README excluded
136
179
  for (const f of _glob(subdir, (n) => n.endsWith('.md'))) {
137
180
  if (path.basename(f) === 'README.md') continue;
@@ -164,6 +207,12 @@ export const TARGETS: ReadonlyArray<[string, ReadonlyArray<[string, string]>]> =
164
207
  // badge is owned by check_command_count_messaging.
165
208
  ['(/badge/Skills-)(\\d+)(-)', 'skills'],
166
209
  ['(/badge/Rules-)(\\d+)(-)', 'rules'],
210
+ // The Commands badge WAS left to check_command_count_messaging
211
+ // alone ("avoids double-ownership"). Nothing generated it, so it
212
+ // drifted to 191 against a canonical 192 and only the checker
213
+ // noticed — the exact gap this roadmap closes. Generator writes,
214
+ // checker verifies: that IS the ownership split, not a conflict.
215
+ ['(/badge/Commands-)(\\d+)(-)', 'commands_active'],
167
216
  ['(/badge/Guidelines-)(\\d+)(-)', 'guidelines'],
168
217
  ['(/badge/Personas-)(\\d+)(-)', 'personas'],
169
218
  ],
@@ -177,8 +226,22 @@ export const TARGETS: ReadonlyArray<[string, ReadonlyArray<[string, string]>]> =
177
226
  ['(- claim: )(\\d+)( skills\\.)', 'skills'],
178
227
  ['(- claim: )(\\d+)( commands\\.)', 'commands'],
179
228
  ['(- claim: )(\\d+)( governed rules\\.)', 'rules'],
229
+ // The scoped-projection claim: BOTH halves of "N of M skills".
230
+ // `M` was scanner-checked but generator-blind (a maintainer
231
+ // hand-edited it on every skill addition); `N` was guarded by
232
+ // nothing at all and had drifted 2 from the benchmark doc the
233
+ // claim names as its own method.
234
+ ['(installs ships )(\\d+)( of )', 'skills_scoped'],
235
+ ['( of )(\\d+)( skills \\(untagged core)', 'skills'],
236
+ // "14 of 111 governed rules" — the total was scanner-checked and
237
+ // generator-blind for the same reason.
238
+ ['( of )(\\d+)( governed rules \\()', 'rules'],
180
239
  ],
181
240
  ],
241
+ [
242
+ 'docs/command-flows.md',
243
+ [['(\\*\\*)(\\d+)( commands\\*\\*)', 'commands_active']],
244
+ ],
182
245
  [
183
246
  'docs/getting-started-by-role.md',
184
247
  [
@@ -206,6 +269,11 @@ export const TARGETS: ReadonlyArray<[string, ReadonlyArray<[string, string]>]> =
206
269
  'docs/getting-started.md',
207
270
  [
208
271
  ['(automatically by )(\\d+)( rules)', 'rules'],
272
+ // Was deliberately unsynced to avoid double-ownership with
273
+ // check_command_count_messaging; it drifted to 191 as a result.
274
+ // Now generated from `commands_active` — the SAME canonical the
275
+ // checker compares against, so the two cannot disagree.
276
+ ['(Browse all )(\\d+)( active commands)', 'commands_active'],
209
277
  // NOTE: the "Browse all N active commands" line here carries the
210
278
  // *active* command count and is owned by
211
279
  // check_command_count_messaging.py — intentionally not synced
@@ -254,7 +322,16 @@ export function apply_to_text(
254
322
  return [new_text, drifts];
255
323
  }
256
324
 
257
- const KINDS = ['skills', 'rules', 'commands', 'guidelines', 'personas', 'router_rules'] as const;
325
+ const KINDS = [
326
+ 'skills',
327
+ 'skills_scoped',
328
+ 'rules',
329
+ 'commands',
330
+ 'commands_active',
331
+ 'guidelines',
332
+ 'personas',
333
+ 'router_rules',
334
+ ] as const;
258
335
 
259
336
  function parse_args(argv: readonly string[]): { check: boolean } {
260
337
  const args = { check: false };
@@ -282,8 +359,10 @@ export function main(argv: readonly string[] = process.argv.slice(2)): number {
282
359
  counts[k] = count(k);
283
360
  }
284
361
  process.stdout.write(
285
- `📊 Truth: skills=${counts['skills']} rules=${counts['rules']} ` +
286
- `commands=${counts['commands']} guidelines=${counts['guidelines']} ` +
362
+ `📊 Truth: skills=${counts['skills']} skills_scoped=${counts['skills_scoped']} ` +
363
+ `rules=${counts['rules']} commands=${counts['commands']} ` +
364
+ `commands_active=${counts['commands_active']} ` +
365
+ `guidelines=${counts['guidelines']} ` +
287
366
  `personas=${counts['personas']} router_rules=${counts['router_rules']}\n`,
288
367
  );
289
368