@event4u/agent-config 8.10.0 → 8.11.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 (192) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +148 -0
  3. package/README.md +5 -5
  4. package/dist/agent-src/commands/challenge-me/vision.md +121 -32
  5. package/dist/agent-src/commands/challenge-me/with-docs.md +21 -8
  6. package/dist/agent-src/commands/commit/in-chunks.md +1 -1
  7. package/dist/agent-src/commands/commit.md +2 -1
  8. package/dist/agent-src/commands/cost/report.md +2 -1
  9. package/dist/agent-src/commands/feature/dev.md +4 -4
  10. package/dist/agent-src/commands/humanize.md +101 -0
  11. package/dist/agent-src/commands/jira-ticket.md +2 -2
  12. package/dist/agent-src/commands/memory/load.md +15 -0
  13. package/dist/agent-src/commands/optimize/project.md +12 -0
  14. package/dist/agent-src/commands/roadmap/create.md +12 -11
  15. package/dist/agent-src/commands/tests/create.md +1 -1
  16. package/dist/agent-src/commands/worktree/cleanup.md +22 -17
  17. package/dist/agent-src/commands/worktree/create.md +3 -1
  18. package/dist/agent-src/commands/worktree/status.md +12 -0
  19. package/dist/agent-src/contexts/execution/autonomy-mechanics.md +66 -0
  20. package/dist/agent-src/contexts/execution/orchestration-benchmark-gate.md +1 -0
  21. package/dist/agent-src/contexts/execution/orchestration-telemetry.md +47 -3
  22. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +14 -0
  23. package/dist/agent-src/contexts/execution/roadmap-writing-source-derived.md +65 -0
  24. package/dist/agent-src/contexts/execution/subagent-modes-detail.md +84 -0
  25. package/dist/agent-src/rules/autonomous-execution.md +7 -37
  26. package/dist/agent-src/rules/broken-access-control.md +7 -45
  27. package/dist/agent-src/rules/code-comment-discipline.md +148 -0
  28. package/dist/agent-src/rules/context-hygiene.md +14 -0
  29. package/dist/agent-src/rules/delegation-policy.md +10 -8
  30. package/dist/agent-src/rules/design-fidelity.md +4 -0
  31. package/dist/agent-src/rules/git-history-discipline.md +4 -79
  32. package/dist/agent-src/rules/legal-safety-floor.md +11 -55
  33. package/dist/agent-src/rules/roadmap-progress-sync.md +5 -56
  34. package/dist/agent-src/rules/think-before-action.md +10 -0
  35. package/dist/agent-src/rules/verify-before-complete.md +12 -0
  36. package/dist/agent-src/skills/agent-docs-writing/SKILL.md +13 -12
  37. package/dist/agent-src/skills/ai-council/SKILL.md +19 -9
  38. package/dist/agent-src/skills/api-design/SKILL.md +7 -5
  39. package/dist/agent-src/skills/api-testing/SKILL.md +1 -1
  40. package/dist/agent-src/skills/authz-review/SKILL.md +59 -2
  41. package/dist/agent-src/skills/blast-radius-analyzer/SKILL.md +1 -1
  42. package/dist/agent-src/skills/bug-analyzer/SKILL.md +19 -16
  43. package/dist/agent-src/skills/code-refactoring/SKILL.md +9 -9
  44. package/dist/agent-src/skills/content-funnel-design/SKILL.md +2 -0
  45. package/dist/agent-src/skills/data-flow-mapper/SKILL.md +1 -1
  46. package/dist/agent-src/skills/defense-in-depth/SKILL.md +2 -2
  47. package/dist/agent-src/skills/dependency-upgrade/SKILL.md +7 -7
  48. package/dist/agent-src/skills/design-intelligence/SKILL.md +8 -8
  49. package/dist/agent-src/skills/design-review/SKILL.md +23 -2
  50. package/dist/agent-src/skills/doc-coauthoring/SKILL.md +2 -0
  51. package/dist/agent-src/skills/editorial-calendar/SKILL.md +2 -0
  52. package/dist/agent-src/skills/fe-design/SKILL.md +7 -9
  53. package/dist/agent-src/skills/git-workflow/SKILL.md +86 -0
  54. package/dist/agent-src/skills/humanizer/SKILL.md +147 -0
  55. package/dist/agent-src/skills/humanizer/data/patterns.md +190 -0
  56. package/dist/agent-src/skills/humanizer/evals/triggers.json +17 -0
  57. package/dist/agent-src/skills/laravel/SKILL.md +14 -1
  58. package/dist/agent-src/skills/launch-readiness/SKILL.md +20 -19
  59. package/dist/agent-src/skills/legal-practice-profile/SKILL.md +126 -0
  60. package/dist/agent-src/skills/logging-monitoring/SKILL.md +1 -1
  61. package/dist/agent-src/skills/mcp/SKILL.md +1 -1
  62. package/dist/agent-src/skills/memory-consolidation/SKILL.md +14 -1
  63. package/dist/agent-src/skills/migration-architect/SKILL.md +2 -1
  64. package/dist/agent-src/skills/performance/SKILL.md +1 -1
  65. package/dist/agent-src/skills/php-debugging/SKILL.md +17 -0
  66. package/dist/agent-src/skills/readme-writing/SKILL.md +2 -0
  67. package/dist/agent-src/skills/readme-writing-package/SKILL.md +2 -0
  68. package/dist/agent-src/skills/release-comms/SKILL.md +2 -0
  69. package/dist/agent-src/skills/roadmap-writing/SKILL.md +22 -51
  70. package/dist/agent-src/skills/security-audit/SKILL.md +6 -9
  71. package/dist/agent-src/skills/sentry-integration/SKILL.md +2 -2
  72. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +8 -0
  73. package/dist/agent-src/skills/source-discovery/SKILL.md +26 -24
  74. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +55 -46
  75. package/dist/agent-src/skills/subagent-orchestration/evals/evals.json +42 -0
  76. package/dist/agent-src/skills/systematic-debugging/SKILL.md +10 -0
  77. package/dist/agent-src/skills/using-git-worktrees/SKILL.md +10 -0
  78. package/dist/agent-src/skills/worktree-lifecycle/SKILL.md +27 -20
  79. package/dist/agent-src/skills/worktree-lifecycle/evals/evals.json +38 -0
  80. package/dist/agent-src/templates/agent-settings.md +3 -2
  81. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +15 -1
  82. package/dist/agent-src/templates/roadmaps.md +14 -0
  83. package/dist/cli/commands/recordTriggerEval.js +4 -14
  84. package/dist/cli/commands/recordTriggerEval.js.map +1 -1
  85. package/dist/discovery/deprecation-report.md +1 -1
  86. package/dist/discovery/discovery-manifest.json +147 -78
  87. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  88. package/dist/discovery/discovery-manifest.summary.md +6 -6
  89. package/dist/discovery/orphan-report.md +1 -1
  90. package/dist/discovery/packs.json +13 -10
  91. package/dist/discovery/trust-report.md +3 -3
  92. package/dist/discovery/workspaces.json +14 -9
  93. package/dist/install/install.mjs +12 -7
  94. package/dist/mcp/registry-manifest.json +4 -4
  95. package/dist/router.json +1 -1
  96. package/dist/scripts/_lib/claude_settings_hooks.js +8 -0
  97. package/dist/scripts/_lib/claude_settings_hooks.js.map +1 -1
  98. package/dist/scripts/_lib/trigger_eval_floors.js +24 -0
  99. package/dist/scripts/_lib/trigger_eval_floors.js.map +1 -0
  100. package/dist/scripts/condense.js +12 -2
  101. package/dist/scripts/condense.js.map +1 -1
  102. package/dist/server/schemas/settings.js +5 -2
  103. package/dist/server/schemas/settings.js.map +1 -1
  104. package/docs/CLAIMS.md +24 -3
  105. package/docs/architecture.md +3 -3
  106. package/docs/benchmark.md +51 -0
  107. package/docs/catalog.md +8 -5
  108. package/docs/command-flows.md +2 -1
  109. package/docs/contracts/ai-council-config.md +92 -0
  110. package/docs/contracts/command-clusters.md +1 -0
  111. package/docs/contracts/evidence-based-pruning.md +1 -0
  112. package/docs/contracts/hook-architecture-v1.md +25 -0
  113. package/docs/contracts/kernel-membership.md +35 -0
  114. package/docs/contracts/measurement-baseline.md +1 -0
  115. package/docs/contracts/release-sizing.md +22 -0
  116. package/docs/contracts/write-engine.md +38 -1
  117. package/docs/customization.md +12 -0
  118. package/docs/decisions/ADR-002-kernel-bucket-overrides.md +11 -0
  119. package/docs/decisions/ADR-003-flat-cluster-subs-and-colon-syntax.md +11 -0
  120. package/docs/decisions/ADR-006-skill-tools-python-pilot.md +1 -1
  121. package/docs/decisions/ADR-028-root-layout.md +1 -1
  122. package/docs/decisions/ADR-038-canonical-settings-path.md +10 -0
  123. package/docs/decisions/ADR-092-defer-command-tier-alias-removal.md +29 -5
  124. package/docs/decisions/ADR-093-ai-council-config-user-global.md +1 -1
  125. package/docs/decisions/ADR-100-global-knowledge-card-sharing.md +7 -0
  126. package/docs/decisions/ADR-103-global-knowledge-default-off-until-measured.md +2 -2
  127. package/docs/decisions/ADR-105-automatic-subagent-orchestration.md +1 -1
  128. package/docs/decisions/ADR-114-commit-policy-iron-law-override.md +11 -0
  129. package/docs/decisions/ADR-116-memory-tripwire-activation-path.md +11 -1
  130. package/docs/decisions/ADR-117-subagents-auto-default-on.md +2 -1
  131. package/docs/decisions/ADR-118-loop-engineering-boundaries.md +162 -0
  132. package/docs/decisions/ADR-119-global-knowledge-default-on.md +104 -0
  133. package/docs/decisions/ADR-200-python-to-typescript-migration.md +11 -1
  134. package/docs/decisions/ADR-rule-kernel-and-router.md +11 -0
  135. package/docs/decisions/INDEX.md +11 -9
  136. package/docs/design/cross-model-parity-eval.md +82 -0
  137. package/docs/design/length-neutral-judge-rerun.md +92 -0
  138. package/docs/featured-skills.md +2 -2
  139. package/docs/getting-started-by-role.md +1 -1
  140. package/docs/getting-started.md +2 -2
  141. package/docs/governance-advantage.md +1 -1
  142. package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +80 -5
  143. package/docs/guidelines/code-clarity.md +106 -1
  144. package/docs/guidelines/design-antipatterns.md +20 -0
  145. package/docs/guidelines/php/php-coding-patterns.md +12 -2
  146. package/docs/proof.md +20 -14
  147. package/docs/wedge/production-validator/production-validator.md +27 -0
  148. package/package.json +1 -1
  149. package/src/config/agent-settings.template.yml +29 -9
  150. package/src/scripts/_cli/cmd_doctor.ts +34 -1
  151. package/src/scripts/_lib/auto_dispatch.corpus.test.ts +87 -0
  152. package/src/scripts/_lib/claude_settings_hooks.ts +8 -0
  153. package/src/scripts/_lib/knowledge_global.ts +6 -2
  154. package/src/scripts/_lib/knowledge_global_redaction.ts +42 -4
  155. package/src/scripts/_lib/lexical_index.ts +15 -2
  156. package/src/scripts/_lib/orchestration_record.ts +14 -0
  157. package/src/scripts/_lib/trigger_eval_floors.ts +31 -0
  158. package/src/scripts/ai_council/chairman.ts +90 -0
  159. package/src/scripts/ai_council/clients.ts +18 -3
  160. package/src/scripts/ai_council/config.ts +157 -0
  161. package/src/scripts/ai_council/debate_gates.ts +89 -0
  162. package/src/scripts/ai_council/orchestrator.ts +65 -2
  163. package/src/scripts/ai_council/prompts.ts +121 -11
  164. package/src/scripts/ai_council/replay.ts +17 -0
  165. package/src/scripts/ai_council/stance_tally.ts +184 -0
  166. package/src/scripts/ai_tells_rules.ts +433 -0
  167. package/src/scripts/bench_humanizer_eval.ts +240 -0
  168. package/src/scripts/build_discovery_manifest.ts +6 -0
  169. package/src/scripts/build_proof.ts +21 -9
  170. package/src/scripts/check_claims.ts +40 -0
  171. package/src/scripts/check_rule_invariants.ts +10 -3
  172. package/src/scripts/condense.ts +16 -2
  173. package/src/scripts/consumer_matrix.ts +41 -2
  174. package/src/scripts/council_cli.ts +147 -0
  175. package/src/scripts/detect_ai_tells.ts +312 -0
  176. package/src/scripts/install.ts +12 -0
  177. package/src/scripts/knowledge_global_cli.ts +1 -1
  178. package/src/scripts/lint_framework_leakage.ts +88 -7
  179. package/src/scripts/lint_framework_leakage_allowlist.json +59 -572
  180. package/src/scripts/lint_knowledge_scale.ts +30 -0
  181. package/src/scripts/lint_originality_shingles.ts +210 -0
  182. package/src/scripts/orchestration_record.ts +1 -0
  183. package/src/scripts/schemas/agent-settings.schema.json +11 -0
  184. package/src/scripts/self_review_gate.ts +41 -15
  185. package/src/scripts/skill_eval_coverage.ts +71 -3
  186. package/src/scripts/skill_linter.ts +1 -0
  187. package/src/scripts/trigger_eval_rotation.ts +344 -0
  188. package/src/scripts/update_counts.ts +5 -17
  189. package/src/scripts/worktree_cleanup_check.ts +263 -0
  190. package/src/server/schemas/settings.ts +8 -3
  191. package/src/scripts/analysis_freshness.ts +0 -362
  192. package/src/scripts/export_replay_corpus.ts +0 -208
@@ -128,7 +128,7 @@ const LEAKAGE: Record<string, string[]> = {
128
128
  ],
129
129
  'JS-specific': [
130
130
  '\\bpackage\\.json\\b',
131
- '\\bnpm (install|run|test|ci)\\b',
131
+ '\\bnpm (install|run|test|ci|update|audit|exec)\\b',
132
132
  '\\byarn (install|add|test)\\b',
133
133
  '\\bpnpm (install|add|run|test)\\b',
134
134
  '\\bnode_modules\\b',
@@ -147,20 +147,69 @@ const FAMILY: Record<string, string> = {
147
147
  const CROSS_STACK_HINTS: Record<string, string[]> = {
148
148
  ruby: ['\\bRails\\b', '\\bbin/rails\\b', '\\bGemfile\\b', '\\bbundle exec\\b'],
149
149
  python: ['\\bDjango\\b', '\\bFastAPI\\b', '\\bFlask\\b', '\\bpoetry\\b',
150
- '\\buv (add|sync|run|pip)\\b', '\\bvenv\\b'],
150
+ '\\buv (add|sync|run|pip)\\b', '\\bvenv\\b', '\\bPydantic\\b', '\\bJinja\\b',
151
+ 'docs\\.python\\.org'],
151
152
  node: ['\\bExpress\\b', '\\bNext\\.?js\\b', '\\bNode\\.?js\\b', '\\bnpx\\b',
152
- '\\bvitest\\b', '\\bjest\\b', '\\beslint\\b', '\\bprettier\\b'],
153
- go: ['\\bgo (test|build|run|mod)\\b', '\\bgolangci-lint\\b', '\\bGoLand\\b'],
153
+ '\\bvitest\\b', '\\bjest\\b', '\\beslint\\b', '\\bprettier\\b',
154
+ '\\bReact\\b', '\\bVue\\b', '\\bNestJS\\b', '\\bTypeScript\\b',
155
+ '\\btsc\\b', '\\bzod\\b', '\\bPrisma\\b', '\\bTailwind\\b',
156
+ '\\bTurborepo\\b', '\\bclass-validator\\b', '\\bInertia\\b',
157
+ '\\bJSX\\b', '\\bNx\\b',
158
+ '\\.tsx?\\b', 'typescriptlang\\.org'],
159
+ go: ['\\bgo (test|build|run|mod)\\b', '\\bgolangci-lint\\b', '\\bGoLand\\b',
160
+ '\\bGolang\\b', '\\bgo\\.dev\\b'],
154
161
  rust: ['\\bcargo (test|build|run|check|fmt|clippy|add|update)\\b',
155
- '\\bClippy\\b', '\\brustfmt\\b', '\\bCargo\\.toml\\b'],
162
+ '\\bClippy\\b', '\\brustfmt\\b', '\\bCargo\\.toml\\b',
163
+ 'rust-lang\\.org'],
156
164
  dotnet: ['\\bdotnet (test|build|run|add|restore)\\b', '\\b\\.NET\\b'],
157
165
  java: ['\\bSpring\\b', '\\bmvn (test|clean|install|package)\\b',
158
166
  '\\bgradle\\b', '\\bMaven\\b'],
167
+ // Additional hint vocabulary for the PHP family — the LEAKAGE patterns
168
+ // are hit patterns; these are window-only hints so a JS/Python hit next
169
+ // to plain-language PHP mentions self-suppresses as cross-stack docs.
170
+ php: ['\\bvendor/', '\\bPHP\\b'],
171
+ // Polyglot-runner pseudo-family: a Taskfile/Makefile mention marks the
172
+ // window as multi-stack tooling documentation (runner files are
173
+ // ecosystem-neutral by definition).
174
+ 'polyglot-runner': ['\\bTaskfile(\\.ya?ml)?\\b', '\\bMakefile\\b'],
159
175
  };
176
+ // Case-insensitive on purpose (fix G2): "Prettier" / "ESLint" in prose are
177
+ // the same hint as their lowercase binary names.
160
178
  const CROSS_STACK_RE: Record<string, RegExp> = Object.fromEntries(
161
- Object.entries(CROSS_STACK_HINTS).map(([fam, pats]) => [fam, new RegExp(pats.join('|'))]),
179
+ Object.entries(CROSS_STACK_HINTS).map(([fam, pats]) => [fam, new RegExp(pats.join('|'), 'i')]),
162
180
  );
163
181
 
182
+ // Framework-name pair rule (fix G3): Laravel and Symfony share the `php`
183
+ // family, so a genuine Laravel-vs-Symfony comparison never counted as
184
+ // cross-stack. Two DISTINCT framework names in the window are documentation
185
+ // of alternatives, not a mandate.
186
+ const FRAMEWORK_NAMES: readonly string[] = [
187
+ 'Laravel', 'Symfony', 'Django', 'Rails', 'NestJS', 'Next\\.js', 'Spring',
188
+ 'Flask', 'FastAPI',
189
+ ];
190
+ const FRAMEWORK_NAME_RES: readonly RegExp[] = FRAMEWORK_NAMES.map(
191
+ (n) => new RegExp(`\\b${n}\\b`),
192
+ );
193
+
194
+ // Carve-out-pointer suppression (fix G6): the neutrality rule's own
195
+ // "Allowed: carve-out pointers" shape — a handoff line linking to a
196
+ // framework-specific artifact, or the sanctioned `→ ` pointer prefix.
197
+ const POINTER_LINK_RE = /\]\((?:\.\.\/)+([a-z0-9-]+)\//;
198
+ function _is_carve_out_pointer_line(line: string): boolean {
199
+ const trimmed = line.trimStart();
200
+ if (trimmed.startsWith('→ ') || trimmed.startsWith('→')) {
201
+ return true;
202
+ }
203
+ const m = POINTER_LINK_RE.exec(line);
204
+ return m !== null && CARVE_OUT_RE.test(m[1] as string);
205
+ }
206
+
207
+ // Sanctioned single-stack annotation (fix G5): the corpus-wide
208
+ // "(Laravel shape: …)" / "Laravel example:" marker on a generic mechanism
209
+ // (road-to-configurable-modules Phase D decision).
210
+ const SHAPE_EXAMPLE_RE =
211
+ /\((?:Laravel|Symfony|Django|Rails|Next\.js)[^)]*\b(?:shape|example)\b|\b(?:Laravel|Symfony|Django|Rails) (?:shape|example):/i;
212
+
164
213
  const FRONTMATTER_FRAMEWORK_RE = /^---\s*\n([\s\S]*?)\n---/m;
165
214
  const FRAMEWORK_KEY_RE = /^(?:framework|\s+framework)\s*:\s*(\S+)/m;
166
215
 
@@ -287,6 +336,22 @@ function _families_in_window(lines: string[], idx: number, radius = 10): Set<str
287
336
  return families;
288
337
  }
289
338
 
339
+ /** Fix G3: count DISTINCT framework names in the window (pair rule). */
340
+ function _framework_names_in_window(lines: string[], idx: number, radius = 10): number {
341
+ const lo = Math.max(0, idx - radius);
342
+ const hi = Math.min(lines.length, idx + radius + 1);
343
+ const seen = new Set<number>();
344
+ for (let j = lo; j < hi; j++) {
345
+ const line = lines[j] as string;
346
+ for (let k = 0; k < FRAMEWORK_NAME_RES.length; k++) {
347
+ if (!seen.has(k) && (FRAMEWORK_NAME_RES[k] as RegExp).test(line)) {
348
+ seen.add(k);
349
+ }
350
+ }
351
+ }
352
+ return seen.size;
353
+ }
354
+
290
355
  export interface Hit {
291
356
  line: number;
292
357
  category: string;
@@ -310,13 +375,23 @@ export function scan_file(p: string): Hit[] {
310
375
  for (let i = 0; i < lines.length; i++) {
311
376
  const line = lines[i] as string;
312
377
  if (rx.test(line)) {
378
+ // Sanctioned shapes suppress the hit outright (fixes G5/G6):
379
+ // a carve-out pointer line or a "(Laravel shape/example)"
380
+ // annotation on a generic mechanism is the neutrality
381
+ // rule's OWN allowed form, not leakage.
382
+ if (_is_carve_out_pointer_line(line) || SHAPE_EXAMPLE_RE.test(line)) {
383
+ continue;
384
+ }
313
385
  const families = _families_in_window(lines, i);
386
+ const cross =
387
+ families.size >= 2 ||
388
+ _framework_names_in_window(lines, i) >= 2;
314
389
  hits.push({
315
390
  line: i + 1,
316
391
  category,
317
392
  pattern: pat,
318
393
  snippet: line.trim().slice(0, 160),
319
- cross_stack: families.size >= 2,
394
+ cross_stack: cross,
320
395
  });
321
396
  }
322
397
  }
@@ -426,6 +501,12 @@ export function main(argv?: readonly string[]): number {
426
501
  if (has_framework_frontmatter(f)) {
427
502
  continue;
428
503
  }
504
+ // Self-exemption: the neutrality rule itself enumerates the forbidden
505
+ // tokens (frontmatter triggers + fix table) — it can never be clean
506
+ // by construction.
507
+ if (f.endsWith(`${path.sep}framework-neutrality-in-generic-skills.md`)) {
508
+ continue;
509
+ }
429
510
  const rel = relToRepo(f);
430
511
  const raw_hits = scan_file(f);
431
512
  if (raw_hits.length === 0) {