@event4u/agent-config 9.12.0 → 9.13.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 (130) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +80 -256
  3. package/README.md +1 -1
  4. package/dist/agent-src/rules/active-remediation.md +0 -2
  5. package/dist/agent-src/rules/architecture.md +0 -1
  6. package/dist/agent-src/rules/artifact-drafting-protocol.md +0 -4
  7. package/dist/agent-src/rules/autonomous-execution.md +1 -2
  8. package/dist/agent-src/rules/broken-access-control.md +0 -2
  9. package/dist/agent-src/rules/code-comment-discipline.md +0 -3
  10. package/dist/agent-src/rules/code-provenance.md +0 -3
  11. package/dist/agent-src/rules/communication-through-line.md +2 -3
  12. package/dist/agent-src/rules/content-quoting-floor.md +0 -2
  13. package/dist/agent-src/rules/context-hygiene.md +1 -3
  14. package/dist/agent-src/rules/decision-revisit-gate.md +0 -2
  15. package/dist/agent-src/rules/design-fidelity.md +29 -0
  16. package/dist/agent-src/rules/domain-adoption-policy.md +0 -3
  17. package/dist/agent-src/rules/downstream-changes.md +10 -1
  18. package/dist/agent-src/rules/external-reference-deep-dive.md +0 -7
  19. package/dist/agent-src/rules/fast-path-marker-visibility.md +0 -1
  20. package/dist/agent-src/rules/git-history-discipline.md +0 -7
  21. package/dist/agent-src/rules/guidelines.md +0 -2
  22. package/dist/agent-src/rules/improve-before-implement.md +4 -2
  23. package/dist/agent-src/rules/invite-challenge.md +0 -4
  24. package/dist/agent-src/rules/linked-projects-onboarding-gate.md +0 -2
  25. package/dist/agent-src/rules/markdown-safe-codeblocks.md +0 -1
  26. package/dist/agent-src/rules/minimal-safe-diff.md +2 -2
  27. package/dist/agent-src/rules/missing-tool-handling.md +0 -1
  28. package/dist/agent-src/rules/no-attribution-footers.md +0 -3
  29. package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +8 -5
  30. package/dist/agent-src/rules/no-pr-progress-comments.md +1 -3
  31. package/dist/agent-src/rules/no-roadmap-references.md +0 -2
  32. package/dist/agent-src/rules/output-discipline.md +0 -1
  33. package/dist/agent-src/rules/prefer-enums-over-literals.md +0 -2
  34. package/dist/agent-src/rules/preservation-guard.md +0 -3
  35. package/dist/agent-src/rules/role-mode-adherence.md +0 -1
  36. package/dist/agent-src/rules/secret-vcs-guard.md +0 -2
  37. package/dist/agent-src/rules/senior-engineering-discipline.md +0 -2
  38. package/dist/agent-src/rules/session-canary.md +0 -2
  39. package/dist/agent-src/rules/size-enforcement.md +0 -5
  40. package/dist/agent-src/rules/source-confidentiality.md +0 -3
  41. package/dist/agent-src/rules/source-discovery-gate.md +0 -2
  42. package/dist/agent-src/rules/think-before-action.md +3 -3
  43. package/dist/agent-src/rules/token-budget-discipline.md +0 -1
  44. package/dist/agent-src/rules/token-efficiency.md +1 -2
  45. package/dist/agent-src/rules/tool-safety.md +0 -1
  46. package/dist/agent-src/rules/user-interaction.md +0 -3
  47. package/dist/agent-src/rules/user-interrupt-priority.md +0 -1
  48. package/dist/agent-src/skills/agent-docs-writing/SKILL.md +8 -0
  49. package/dist/agent-src/skills/analysis-skill-router/SKILL.md +55 -86
  50. package/dist/agent-src/skills/character-consistency/SKILL.md +7 -4
  51. package/dist/agent-src/skills/decision-record/SKILL.md +8 -0
  52. package/dist/agent-src/skills/design-review/SKILL.md +11 -0
  53. package/dist/agent-src/skills/design-system-capture/reference/design-system-json.md +8 -0
  54. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +34 -3
  55. package/dist/agent-src/skills/fe-design/SKILL.md +10 -0
  56. package/dist/agent-src/skills/motion-choreographer/SKILL.md +7 -4
  57. package/dist/agent-src/skills/overbuild-review-lens/SKILL.md +201 -0
  58. package/dist/agent-src/skills/performance/SKILL.md +14 -0
  59. package/dist/agent-src/skills/pixar-storyteller/SKILL.md +8 -5
  60. package/dist/agent-src/skills/scene-expander/SKILL.md +9 -6
  61. package/dist/agent-src/skills/supply-chain-intake/SKILL.md +10 -0
  62. package/dist/agent-src/skills/universal-project-analysis/SKILL.md +14 -37
  63. package/dist/agent-src/skills/video-director/SKILL.md +9 -6
  64. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  65. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +154 -13
  66. package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +118 -0
  67. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +40 -0
  68. package/dist/agent-src/templates/scripts/work_engine/state.ts +55 -0
  69. package/dist/discovery/deprecation-report.md +1 -1
  70. package/dist/discovery/discovery-manifest.json +89 -67
  71. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  72. package/dist/discovery/discovery-manifest.summary.md +3 -3
  73. package/dist/discovery/orphan-report.md +1 -1
  74. package/dist/discovery/packs.json +6 -5
  75. package/dist/discovery/trust-report.md +2 -2
  76. package/dist/discovery/workspaces.json +5 -4
  77. package/dist/hooks/dispatch.js +174 -13
  78. package/dist/mcp/registry-manifest.json +3 -3
  79. package/dist/mcp/server.json +2 -2
  80. package/dist/mcp/server.mjs +750 -507
  81. package/dist/router.json +1 -1
  82. package/dist/scripts/condense.js +2 -2
  83. package/docs/MIGRATION.md +1 -1
  84. package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +71 -0
  85. package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +24 -1
  86. package/docs/guidelines/code-clarity.md +9 -2
  87. package/docs/guidelines/design-fidelity-mechanics.md +44 -0
  88. package/llms.txt +63 -27
  89. package/package.json +4 -4
  90. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +154 -13
  91. package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +118 -0
  92. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +40 -0
  93. package/src/agent-src/templates/scripts/work_engine/state.ts +55 -0
  94. package/src/config/agent-settings.template.yml +8 -0
  95. package/src/scripts/_lib/counted_probe.ts +142 -0
  96. package/src/scripts/_lib/overbuild_lens_contract.ts +196 -0
  97. package/src/scripts/_lib/release_scope.ts +207 -0
  98. package/src/scripts/ai_council/stance_tally.ts +37 -2
  99. package/src/scripts/audit_auto_rules.ts +9 -9
  100. package/src/scripts/audit_likelihood.ts +3 -3
  101. package/src/scripts/audit_overlap.ts +2 -2
  102. package/src/scripts/audit_skill_overlap.ts +233 -95
  103. package/src/scripts/audit_skill_overlap_allowlist.json +4 -0
  104. package/src/scripts/build_proof.ts +15 -1
  105. package/src/scripts/check_dependency_floors.ts +16 -6
  106. package/src/scripts/check_gate_coverage.ts +6 -6
  107. package/src/scripts/check_kernel_rule_bundle.ts +5 -4
  108. package/src/scripts/check_token_quality_golden.ts +0 -18
  109. package/src/scripts/code_graph/loader.ts +35 -6
  110. package/src/scripts/compile_router.ts +3 -8
  111. package/src/scripts/condense.ts +2 -2
  112. package/src/scripts/explain_run.ts +0 -1
  113. package/src/scripts/generate_pack_manifests.ts +3 -20
  114. package/src/scripts/hooks/block_kernel_rule_writes.ts +145 -10
  115. package/src/scripts/hooks/block_no_verify.ts +101 -0
  116. package/src/scripts/lint_agent_security.ts +5 -4
  117. package/src/scripts/lint_framework_leakage_allowlist.json +2 -2
  118. package/src/scripts/lint_regression.ts +92 -1
  119. package/src/scripts/lint_skill_descriptions.ts +93 -5
  120. package/src/scripts/project_thin_rules.ts +2 -2
  121. package/src/scripts/release.ts +107 -3
  122. package/src/scripts/resolve_lint_scope.ts +53 -0
  123. package/src/scripts/router_telemetry.ts +0 -5
  124. package/src/scripts/runtime_dispatcher.ts +40 -0
  125. package/src/scripts/schemas/pack.schema.json +1 -5
  126. package/src/scripts/schemas/rule.schema.json +1 -2
  127. package/src/scripts/self_review_gate.ts +15 -73
  128. package/src/scripts/skill_linter.ts +93 -11
  129. package/src/scripts/sweep_dead_scan_roots.ts +550 -0
  130. package/src/scripts/trigger_coverage.ts +11 -37
@@ -30,7 +30,6 @@
30
30
  * 2 = errors
31
31
  * 3 = internal error / structural malice
32
32
  */
33
- import { spawnSync } from 'node:child_process';
34
33
  import * as fs from 'node:fs';
35
34
  import * as path from 'node:path';
36
35
  import process from 'node:process';
@@ -44,6 +43,9 @@ import {
44
43
  type YamlValue,
45
44
  } from './validate_frontmatter.js';
46
45
  import { artefact_roots, resolve_logical } from './_lib/agent_src.js';
46
+ import { ProbeOverflowError, runCountedProbe } from './_lib/counted_probe.js';
47
+ import { resolveContentLintScope } from './_lib/release_scope.js';
48
+ import { DeadScopeError, assertScanned } from './_lib/scan_scope.js';
47
49
 
48
50
  // __file__ equivalent for repo-root derivation (mirrors Python
49
51
  // `Path(__file__).resolve().parent.parent.parent` = <repo>/src/scripts → repo).
@@ -166,10 +168,10 @@ const DOUBLE_BLANK_PATTERN = /\n{3,}/;
166
168
  const VALID_RULE_TYPES = new Set(['always', 'auto', 'manual']);
167
169
  const VALID_RULE_SOURCES = new Set(['package', 'project']);
168
170
 
171
+ // `intent` was removed — see compile_router.ts's copy of this allowlist.
169
172
  const ROUTER_ALLOWED_TRIGGER_KEYS = new Set([
170
173
  'keyword',
171
174
  'phrase',
172
- 'intent',
173
175
  'file_pattern',
174
176
  'path_prefix',
175
177
  'command',
@@ -2428,20 +2430,42 @@ export function gather_candidate_files_under(srcRoot: string): string[] {
2428
2430
  return sortedUnique(out);
2429
2431
  }
2430
2432
 
2431
- export function gather_changed_candidate_files(root: string): string[] {
2433
+ /**
2434
+ * The scope `--changed` resolved, for the caller to report.
2435
+ *
2436
+ * Exported alongside the file list because a release PR silently widening its
2437
+ * own scope would be as opaque as the blindness it fixes — the caller prints
2438
+ * this line.
2439
+ */
2440
+ export let last_changed_scope_reason = '';
2441
+
2442
+ /**
2443
+ * Candidate files changed against the resolved base.
2444
+ *
2445
+ * The base is release-aware (`_lib/release_scope.ts`): on a release PR it
2446
+ * widens to `previous_release_tag...HEAD`, because a release PR's own diff is
2447
+ * the version bump and the changelog — everything substantive landed in the
2448
+ * commits before the cut. Scoped to the PR's own file list this returned
2449
+ * nothing on a 179-commit release, and the gate reported
2450
+ * "0 skills checked, INCONCLUSIVE" and passed.
2451
+ *
2452
+ * `since` pins the base explicitly and wins over detection.
2453
+ */
2454
+ export function gather_changed_candidate_files(root: string, since?: string | null): string[] {
2455
+ const scope = resolveContentLintScope({ cwd: root, since: since ?? null });
2456
+ last_changed_scope_reason = scope.reason;
2432
2457
  const diffCommands = [
2433
- ['git', 'diff', '--name-only', 'origin/main...HEAD'],
2458
+ ['git', 'diff', '--name-only', `${scope.base}...HEAD`],
2434
2459
  ['git', 'diff', '--name-only', '--cached', 'HEAD'],
2435
2460
  ['git', 'diff', '--name-only', 'HEAD'],
2436
2461
  ];
2437
2462
  try {
2438
2463
  let rawLines: string[] = [];
2439
2464
  for (const cmd of diffCommands) {
2440
- const result = spawnSync(cmd[0] as string, cmd.slice(1), {
2441
- cwd: root,
2442
- encoding: 'utf-8',
2443
- });
2444
- if (result.status === 0 && (result.stdout ?? '').trim()) {
2465
+ // A truncated diff would silently shrink the change set — the same
2466
+ // degrade-to-zero shape this roadmap closes elsewhere.
2467
+ const result = runCountedProbe(cmd[0] as string, cmd.slice(1), { cwd: root });
2468
+ if (result.ok && result.stdout.trim()) {
2445
2469
  rawLines = splitlines(result.stdout);
2446
2470
  break;
2447
2471
  }
@@ -2479,7 +2503,15 @@ export function gather_changed_candidate_files(root: string): string[] {
2479
2503
  }
2480
2504
  }
2481
2505
  return sortedUnique(files);
2482
- } catch {
2506
+ } catch (exc) {
2507
+ // An overflowed diff is not an empty diff. Everything else (a shallow
2508
+ // clone with no `origin/main`, a detached worktree) legitimately has no
2509
+ // resolvable change set and keeps the historical empty-list degrade.
2510
+ if (exc instanceof ProbeOverflowError) {
2511
+ throw exc;
2512
+ }
2513
+ last_changed_scope_reason =
2514
+ `change set unresolvable (${exc instanceof Error ? exc.message : String(exc)})`;
2483
2515
  return [];
2484
2516
  }
2485
2517
  }
@@ -4082,6 +4114,8 @@ interface Args {
4082
4114
  report: boolean;
4083
4115
  repoRoot: string;
4084
4116
  quiet: boolean;
4117
+ /** Explicit diff base for `--changed`; wins over release detection. */
4118
+ since: string | null;
4085
4119
  }
4086
4120
 
4087
4121
  export function parse_args(argv: string[]): Args {
@@ -4095,6 +4129,7 @@ export function parse_args(argv: string[]): Args {
4095
4129
  condensationQuality: false,
4096
4130
  strictWarnings: false,
4097
4131
  report: false,
4132
+ since: null,
4098
4133
  repoRoot: '.',
4099
4134
  quiet: false,
4100
4135
  };
@@ -4104,6 +4139,15 @@ export function parse_args(argv: string[]): Args {
4104
4139
  args.all = true;
4105
4140
  } else if (a === '--changed') {
4106
4141
  args.changed = true;
4142
+ } else if (a === '--since') {
4143
+ const v = argv[i + 1];
4144
+ i += 1;
4145
+ if (v === undefined || v.startsWith('--')) {
4146
+ throw new ArgError('argument --since: expected a git ref');
4147
+ }
4148
+ args.since = v;
4149
+ } else if (a.startsWith('--since=')) {
4150
+ args.since = a.slice('--since='.length);
4107
4151
  } else if (a === '--format') {
4108
4152
  const v = argv[i + 1];
4109
4153
  i += 1;
@@ -4143,6 +4187,21 @@ export function parse_args(argv: string[]): Args {
4143
4187
 
4144
4188
  class ArgError extends Error {}
4145
4189
 
4190
+ /**
4191
+ * True when an empty change set is a defect rather than a legitimate scope.
4192
+ *
4193
+ * Only on a release PR whose scope actually widened to a tag span: a release
4194
+ * that changed no skill and no rule is possible in principle, but a *resolved*
4195
+ * span that matched nothing is the "0 skills checked, INCONCLUSIVE" shape this
4196
+ * gate exists to stop. A release whose previous tag could not be resolved is
4197
+ * excluded — that scope never widened, so failing it would punish a shallow
4198
+ * clone for the wrong reason.
4199
+ */
4200
+ function _release_scope_requires_findings(root: string, since?: string | null): boolean {
4201
+ const scope = resolveContentLintScope({ cwd: root, since: since ?? null });
4202
+ return scope.isRelease && scope.previousTag !== null;
4203
+ }
4204
+
4146
4205
  export function main(argv: string[]): number {
4147
4206
  let args: Args;
4148
4207
  try {
@@ -4162,7 +4221,8 @@ export function main(argv: string[]): number {
4162
4221
  paths.push(...gather_all_candidate_files(root));
4163
4222
  }
4164
4223
  if (args.changed) {
4165
- paths.push(...gather_changed_candidate_files(root));
4224
+ paths.push(...gather_changed_candidate_files(root, args.since));
4225
+ process.stderr.write(`skill_linter --changed: ${last_changed_scope_reason}\n`);
4166
4226
  }
4167
4227
  for (const raw of args.paths) {
4168
4228
  const p = path.isAbsolute(raw) ? raw : path.resolve(root, raw);
@@ -4183,6 +4243,28 @@ export function main(argv: string[]): number {
4183
4243
  } else if (args.format === 'json') {
4184
4244
  process.stdout.write(`${format_json([])}\n`);
4185
4245
  }
4246
+ // A release PR that resolved a real tag span and still matched
4247
+ // nothing has not passed — it examined nothing. Mirrors the
4248
+ // scan-scope regime the other gates already adopted
4249
+ // (`_lib/scan_scope.ts`; exit 2, as `check_iron_law_prominence`).
4250
+ // Ordinary PRs keep the historical exit 0: a change set with no
4251
+ // skill or rule in it is a legitimate empty scope, not a dead one.
4252
+ if (args.changed && _release_scope_requires_findings(root, args.since)) {
4253
+ try {
4254
+ assertScanned({
4255
+ gate: 'skill_linter --changed (release PR)',
4256
+ scanned: 0,
4257
+ units: 'skill/rule files',
4258
+ roots: [last_changed_scope_reason],
4259
+ });
4260
+ } catch (exc) {
4261
+ if (exc instanceof DeadScopeError) {
4262
+ process.stderr.write(`❌ ${exc.message}\n`);
4263
+ return 2;
4264
+ }
4265
+ throw exc;
4266
+ }
4267
+ }
4186
4268
  process.stderr.write('No matching skill/rule files found.\n');
4187
4269
  return 0;
4188
4270
  }