@event4u/agent-config 9.6.0 → 9.8.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 (204) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +207 -942
  3. package/README.md +21 -21
  4. package/dist/agent-src/README.md +2 -2
  5. package/dist/agent-src/commands/commit/in-chunks.md +8 -0
  6. package/dist/agent-src/commands/commit.md +17 -0
  7. package/dist/agent-src/commands/pr/create.md +4 -0
  8. package/dist/agent-src/contexts/override-system.md +75 -5
  9. package/dist/agent-src/rules/context-hygiene.md +2 -0
  10. package/dist/agent-src/rules/doc-screenshot-hygiene.md +97 -0
  11. package/dist/agent-src/rules/domain-safety-pii.md +1 -0
  12. package/dist/agent-src/rules/downstream-changes.md +31 -1
  13. package/dist/agent-src/rules/external-code-graph-interop.md +13 -3
  14. package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +2 -0
  15. package/dist/agent-src/rules/git-history-discipline.md +2 -0
  16. package/dist/agent-src/rules/language-and-tone.md +2 -0
  17. package/dist/agent-src/rules/lethal-trifecta-guard.md +3 -0
  18. package/dist/agent-src/rules/media-governance-routing.md +2 -0
  19. package/dist/agent-src/rules/minimal-safe-diff.md +2 -0
  20. package/dist/agent-src/rules/no-roadmap-references.md +3 -0
  21. package/dist/agent-src/rules/non-destructive-by-default.md +20 -0
  22. package/dist/agent-src/rules/onboarding-gate.md +2 -0
  23. package/dist/agent-src/rules/output-discipline.md +2 -0
  24. package/dist/agent-src/rules/persona-governance.md +2 -0
  25. package/dist/agent-src/rules/preservation-guard.md +3 -0
  26. package/dist/agent-src/rules/roadmap-progress-sync.md +2 -0
  27. package/dist/agent-src/rules/secret-vcs-guard.md +106 -0
  28. package/dist/agent-src/rules/security-sensitive-stop.md +1 -1
  29. package/dist/agent-src/rules/skill-quality.md +2 -0
  30. package/dist/agent-src/rules/source-confidentiality.md +2 -0
  31. package/dist/agent-src/rules/source-of-truth.md +2 -0
  32. package/dist/agent-src/rules/telegraph-speak.md +2 -0
  33. package/dist/agent-src/rules/token-optimizer-maintenance.md +2 -0
  34. package/dist/agent-src/rules/tool-safety.md +1 -0
  35. package/dist/agent-src/rules/verify-before-complete.md +2 -0
  36. package/dist/agent-src/skills/adr-create/SKILL.md +17 -1
  37. package/dist/agent-src/skills/agent-docs-writing/SKILL.md +34 -16
  38. package/dist/agent-src/skills/agents-md-thin-root/SKILL.md +9 -9
  39. package/dist/agent-src/skills/code-intelligence/SKILL.md +94 -0
  40. package/dist/agent-src/skills/gated-reach/SKILL.md +185 -0
  41. package/dist/agent-src/skills/gated-reach/evals/triggers.json +72 -0
  42. package/dist/agent-src/skills/image-analyser/SKILL.md +14 -12
  43. package/dist/agent-src/skills/image-editing/SKILL.md +1 -0
  44. package/dist/agent-src/skills/readme-writing/SKILL.md +6 -1
  45. package/dist/agent-src/skills/screenshot-hygiene/SKILL.md +171 -0
  46. package/dist/agent-src/skills/secrets-management/SKILL.md +44 -1
  47. package/dist/agent-src/skills/subagent-orchestration/prompts/adversarial-verification-council.md +29 -0
  48. package/dist/agent-src/skills/subagent-orchestration/prompts/do-and-judge-two-stage.md +29 -0
  49. package/dist/agent-src/skills/subagent-orchestration/prompts/do-and-judge.md +29 -0
  50. package/dist/agent-src/skills/subagent-orchestration/prompts/do-competitively.md +29 -0
  51. package/dist/agent-src/skills/subagent-orchestration/prompts/do-in-parallel.md +29 -0
  52. package/dist/agent-src/skills/subagent-orchestration/prompts/do-in-steps.md +29 -0
  53. package/dist/agent-src/skills/subagent-orchestration/prompts/do-in-worktrees.md +29 -0
  54. package/dist/agent-src/skills/subagent-orchestration/prompts/judge-with-debate.md +29 -0
  55. package/dist/agent-src/skills/verify-repair-loop/SKILL.md +4 -0
  56. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  57. package/dist/agent-src/templates/github-workflows/doc-impact.yml +101 -0
  58. package/dist/agent-src/templates/github-workflows/secret-scan.yml +65 -0
  59. package/dist/cli/configRoot.js +112 -0
  60. package/dist/cli/configRoot.js.map +1 -0
  61. package/dist/cli/configRoot.test.js +97 -0
  62. package/dist/cli/configRoot.test.js.map +1 -0
  63. package/dist/cli/help.js +4 -1
  64. package/dist/cli/help.js.map +1 -1
  65. package/dist/cli/main.js +19 -2
  66. package/dist/cli/main.js.map +1 -1
  67. package/dist/cli/registry.js +1 -0
  68. package/dist/cli/registry.js.map +1 -1
  69. package/dist/discovery/deprecation-report.md +1 -1
  70. package/dist/discovery/discovery-manifest.json +164 -47
  71. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  72. package/dist/discovery/discovery-manifest.summary.md +4 -4
  73. package/dist/discovery/orphan-report.md +1 -1
  74. package/dist/discovery/packs.json +13 -8
  75. package/dist/discovery/trust-report.md +11 -11
  76. package/dist/discovery/workspaces.json +11 -6
  77. package/dist/install/install.mjs +16 -0
  78. package/dist/mcp/awesome-mcp-servers.row.md +1 -1
  79. package/dist/mcp/mcp-cloudflare-catalogue.json +1 -1
  80. package/dist/mcp/registry-manifest.json +4 -4
  81. package/dist/router.json +1 -1
  82. package/dist/server/app.js +10 -0
  83. package/dist/server/app.js.map +1 -1
  84. package/dist/server/routes/ping.js +18 -0
  85. package/dist/server/routes/ping.js.map +1 -1
  86. package/dist/server/schemas/settings.js +8 -0
  87. package/dist/server/schemas/settings.js.map +1 -1
  88. package/dist/server/serverInfo.js +6 -2
  89. package/dist/server/serverInfo.js.map +1 -1
  90. package/dist/server/token.js +11 -4
  91. package/dist/server/token.js.map +1 -1
  92. package/dist/server/writeRoot.js +15 -1
  93. package/dist/server/writeRoot.js.map +1 -1
  94. package/dist/shared/capabilities.js +33 -0
  95. package/dist/shared/capabilities.js.map +1 -0
  96. package/dist/shared/capabilities.test.js +39 -0
  97. package/dist/shared/capabilities.test.js.map +1 -0
  98. package/dist/ui/assets/{index-BiEZiZ31.js → index-CrmZ34Rg.js} +16 -16
  99. package/dist/ui/assets/index-CrmZ34Rg.js.map +1 -0
  100. package/dist/ui/index.html +14 -5
  101. package/docs/CLAIMS.md +64 -38
  102. package/docs/architecture.md +2 -2
  103. package/docs/archive/CHANGELOG-6.0.0-overview.md +953 -0
  104. package/docs/benchmark.md +170 -9
  105. package/docs/catalog.md +8 -3
  106. package/docs/comparison.yaml +44 -2
  107. package/docs/contracts/local-server-ports.md +53 -0
  108. package/docs/contracts/no-runtime-boundary.md +1 -1
  109. package/docs/contracts/subagent-boundary.md +15 -0
  110. package/docs/customization.md +14 -3
  111. package/docs/decisions/ADR-016-installer-architecture.md +2 -0
  112. package/docs/decisions/ADR-088-no-external-runtime-federation.md +1 -1
  113. package/docs/decisions/ADR-094-agent-memory-layer-removal.md +1 -1
  114. package/docs/decisions/ADR-109-subagent-v1-contract.md +2 -0
  115. package/docs/decisions/ADR-110-discipline-profile-resolution-locus.md +2 -0
  116. package/docs/decisions/ADR-113-ci-native-release-label-trigger.md +11 -3
  117. package/docs/decisions/ADR-122-adversarial-verification-council.md +30 -0
  118. package/docs/decisions/ADR-123-runtime-security-scope-and-spawn-hardening.md +31 -0
  119. package/docs/decisions/ADR-124-embedded-engine-doctrine.md +255 -0
  120. package/docs/decisions/ADR-125-doc-screenshot-anonymization.md +131 -0
  121. package/docs/decisions/ADR-126-internet-reach-operator-tooling.md +254 -0
  122. package/docs/decisions/ADR-127-enforcement-claims-must-resolve.md +150 -0
  123. package/docs/decisions/ADR-128-executable-evidence-and-measured-escalation.md +201 -0
  124. package/docs/decisions/INDEX.md +21 -0
  125. package/docs/decisions/engine-reclassification-2026-07.md +104 -0
  126. package/docs/distribution/awesome-list-submission.md +1 -1
  127. package/docs/distribution/registries.md +36 -27
  128. package/docs/enforcement-by-host.md +7 -0
  129. package/docs/featured-skills.md +2 -2
  130. package/docs/getting-started-by-role.md +1 -1
  131. package/docs/getting-started.md +1 -1
  132. package/docs/governance-advantage.md +1 -1
  133. package/docs/guides/gated-platform-reads.md +221 -0
  134. package/docs/positioning-evidence.md +1 -1
  135. package/docs/proof.md +92 -16
  136. package/docs/spawn-site-policy.md +72 -0
  137. package/docs/threat-model.md +2 -1
  138. package/package.json +6 -3
  139. package/src/agent-src/README.md +2 -2
  140. package/src/config/agent-settings.template.yml +43 -0
  141. package/src/config/reach-channels.yml +217 -0
  142. package/src/config/reach-prescriptions-intake.yml +200 -0
  143. package/src/scripts/_dispatch.bash +15 -0
  144. package/src/scripts/_lib/adversarial_bench_score.ts +106 -0
  145. package/src/scripts/_lib/exec_evidence.ts +251 -0
  146. package/src/scripts/_lib/fixtures/secret-detector/negatives.txt +10 -0
  147. package/src/scripts/_lib/fixtures/secret-detector/positives.txt +11 -0
  148. package/src/scripts/_lib/kernel_rules.ts +46 -0
  149. package/src/scripts/_lib/reddit_thread_parse.ts +598 -0
  150. package/src/scripts/_lib/risk_paths.ts +160 -0
  151. package/src/scripts/_lib/secret_detector.test.ts +103 -0
  152. package/src/scripts/_lib/secret_detector.ts +319 -0
  153. package/src/scripts/_lib/spawn_env.ts +24 -4
  154. package/src/scripts/_lib/tool_probe.ts +359 -0
  155. package/src/scripts/adr/regenerate_index.ts +81 -6
  156. package/src/scripts/audit_adr_coverage.ts +33 -0
  157. package/src/scripts/bench_adversarial_council.ts +292 -0
  158. package/src/scripts/build_proof.ts +162 -0
  159. package/src/scripts/check_adr_frontmatter.ts +195 -0
  160. package/src/scripts/check_artefact_count_messaging.ts +4 -0
  161. package/src/scripts/check_backstop_debt.ts +200 -0
  162. package/src/scripts/check_claims.ts +188 -8
  163. package/src/scripts/check_comparison.ts +12 -0
  164. package/src/scripts/check_enforcement_coverage.ts +592 -0
  165. package/src/scripts/check_kernel_rule_bundle.ts +16 -12
  166. package/src/scripts/check_no_new_legacy_path.ts +2 -0
  167. package/src/scripts/check_reach_channels.ts +407 -0
  168. package/src/scripts/check_reach_staleness.ts +364 -0
  169. package/src/scripts/check_secret_leak.test.ts +47 -0
  170. package/src/scripts/check_secret_leak.ts +290 -0
  171. package/src/scripts/check_source_pointer_freshness.ts +165 -0
  172. package/src/scripts/code_graph/build.ts +0 -0
  173. package/src/scripts/code_graph/cli.ts +207 -0
  174. package/src/scripts/code_graph/detect.ts +134 -0
  175. package/src/scripts/code_graph/extract.ts +386 -0
  176. package/src/scripts/code_graph/loader.ts +123 -0
  177. package/src/scripts/code_graph/query.ts +176 -0
  178. package/src/scripts/code_graph/sanitize.ts +30 -0
  179. package/src/scripts/code_graph/types.ts +83 -0
  180. package/src/scripts/code_graph/validate.ts +63 -0
  181. package/src/scripts/external_sources_denylist.json +3 -1
  182. package/src/scripts/generate_subagent_floor.ts +194 -0
  183. package/src/scripts/hook_manifest.yaml +13 -3
  184. package/src/scripts/hooks/code_graph_nudge_hook.ts +184 -0
  185. package/src/scripts/hooks/dispatch_hook.ts +5 -1
  186. package/src/scripts/iron_law_sha.ts +3 -12
  187. package/src/scripts/lint_override_kernel_guard.ts +219 -0
  188. package/src/scripts/lint_readme_serial_comma.ts +169 -0
  189. package/src/scripts/measure_rule_budget.ts +3 -12
  190. package/src/scripts/postinstall_gui.ts +129 -0
  191. package/src/scripts/reach_doctor.ts +1651 -0
  192. package/src/scripts/release.ts +24 -3
  193. package/src/scripts/risk_escalation_shadow.ts +160 -0
  194. package/src/scripts/schemas/agent-settings.schema.json +23 -0
  195. package/src/scripts/schemas/reach-channels.schema.json +134 -0
  196. package/src/scripts/schemas/reach-doctor-payload.schema.json +220 -0
  197. package/src/scripts/schemas/rule.schema.json +10 -0
  198. package/src/scripts/skill_linter.ts +55 -0
  199. package/src/scripts/validate_reach_prescriptions.ts +751 -0
  200. package/src/server/schemas/settings.ts +16 -0
  201. package/src/shared/capabilities.test.ts +43 -0
  202. package/src/shared/capabilities.ts +75 -0
  203. package/src/templates/minimal/agents-overrides-readme.md +20 -0
  204. package/dist/ui/assets/index-BiEZiZ31.js.map +0 -1
@@ -8,6 +8,8 @@ triggers:
8
8
  - path_prefix: ".agent-settings.yml"
9
9
  workspaces: [agent-config-maintainer, construction, engineering, finance, founder, gtm, legal-review-prep, ops, product, small-business]
10
10
  packs: [meta]
11
+ enforced_by:
12
+ - "hook:onboarding-gate"
11
13
  ---
12
14
 
13
15
  # Onboarding Gate
@@ -10,6 +10,8 @@ triggers:
10
10
  - phrase: "similar pattern"
11
11
  workspaces: [engineering]
12
12
  packs: [engineering-base]
13
+ enforced_by:
14
+ - "validator:src/scripts/lint_output_slop.ts"
13
15
  ---
14
16
 
15
17
  # Output Discipline
@@ -25,6 +25,8 @@ validator_ignore:
25
25
  reason: "Rule documents the persona authoring tree (.agent-src.uncondensed/personas/) as the deprecation-path operand."
26
26
  workspaces: [agent-config-maintainer]
27
27
  packs: [meta]
28
+ enforced_by:
29
+ - "validator:src/scripts/lint_persona_governance.ts"
28
30
  ---
29
31
 
30
32
  # Persona Governance
@@ -14,6 +14,9 @@ validator_ignore:
14
14
  reason: "Rule references the authoring tree as the operand of condensation/preservation."
15
15
  workspaces: [agent-config-maintainer]
16
16
  packs: [meta]
17
+ enforced_by:
18
+ - "validator:src/scripts/check_condensation.ts"
19
+ - "validator:src/scripts/skill_linter.ts"
17
20
  ---
18
21
 
19
22
  # Preservation Guard
@@ -11,6 +11,8 @@ routes_to:
11
11
  - "guideline:agent-infra/roadmap-progress-mechanics"
12
12
  workspaces: [agent-config-maintainer, engineering]
13
13
  packs: [meta]
14
+ enforced_by:
15
+ - "hook:roadmap-progress"
14
16
  ---
15
17
 
16
18
  # Roadmap Progress Sync
@@ -0,0 +1,106 @@
1
+ ---
2
+ type: "auto"
3
+ tier: "2a"
4
+ alwaysApply: false
5
+ description: "About to write a credential into a tracked file or stage/commit one in any VCS (git/svn/hg) — STOP, show the match, ask, offer alternatives; never silently commit, never silently strip"
6
+ triggers:
7
+ - intent: "writing a credential or API key into a file"
8
+ - intent: "committing or staging changes that may contain a secret"
9
+ - keyword: "secret"
10
+ - keyword: "password"
11
+ - keyword: "credential"
12
+ - keyword: "api key"
13
+ - keyword: "token"
14
+ - keyword: ".env"
15
+ - keyword: "commit"
16
+ - keyword: "git add"
17
+ - keyword: "svn commit"
18
+ - keyword: "hg commit"
19
+ - keyword: "push"
20
+ routes_to:
21
+ - "skill:secrets-management"
22
+ validator_ignore:
23
+ - type: "substring"
24
+ pattern: "../../docs/"
25
+ reason: "See-also routes to docs/threat-model.md — the canonical attack-surface doc lives there by design."
26
+ workspaces: [engineering]
27
+ packs: [engineering-base]
28
+ enforced_by:
29
+ - "validator:src/scripts/check_secret_leak.ts"
30
+ ---
31
+
32
+ # Secret-in-VCS Guard
33
+
34
+ A committed secret is a leaked secret. Once it reaches version control it is in
35
+ the history, in every clone and fork, and — on a public remote — scraped by bots
36
+ within minutes. `git rm` does not un-leak it; only rotation does. The cheapest
37
+ moment to stop it is **before** the write. The agent is upstream of the commit,
38
+ so the agent is the earliest gate.
39
+
40
+ ## The Iron Law
41
+
42
+ ```
43
+ NEVER WRITE A CREDENTIAL INTO A TRACKED (OR TO-BE-TRACKED) FILE, AND NEVER
44
+ STAGE / COMMIT CONTENT CONTAINING ONE — IN ANY VCS (git · svn · hg) —
45
+ WITHOUT STOPPING FIRST.
46
+ DETECT → SHOW THE MATCH (file:line · kind · why risky) → ASK → OFFER ALTERNATIVES.
47
+ NEVER SILENTLY COMMIT A SECRET. NEVER SILENTLY STRIP ONE.
48
+ ALREADY IN HISTORY → ROTATE FIRST. git rm DOES NOT UN-LEAK.
49
+ ```
50
+
51
+ ## When it fires
52
+
53
+ The agent is about to (a) write/edit a value that looks like a live credential
54
+ into a tracked or soon-to-be-tracked file, or (b) `git add` / `git commit` /
55
+ `svn commit` / `hg commit` / push content containing one. Detection uses the
56
+ `secret_detector` library (regex rule pack + Shannon entropy + keyword context):
57
+ AWS/GitHub/Stripe/Google/Slack keys, PEM private keys, JWTs, DB connection URLs
58
+ with embedded credentials, and `password=` / `api_key=` style assignments.
59
+
60
+ ## What to do on a `high`-confidence hit
61
+
62
+ 1. **STOP** — do not write, stage, or commit.
63
+ 2. **Show** the match: `file:line`, the kind, a masked preview, and why it is
64
+ risky. Never echo the full secret back.
65
+ 3. **Ask** via numbered options (per [`non-destructive-by-default`](non-destructive-by-default.md) +
66
+ [`user-interaction`](user-interaction.md)) — e.g. *move it to a secret store
67
+ (recommended)* / *this is a false positive, add a narrow allow-marker* /
68
+ *commit anyway (I understand the risk)*. Never decide for the user; never
69
+ auto-strip.
70
+ 4. **Offer the alternative**, tiered to context (full table in
71
+ [`secrets-management`](../skills/secrets-management/SKILL.md)): solo/local →
72
+ gitignored `.env` + committed `.env.example`; team/prod → cloud secret manager
73
+ or Vault/Doppler; k8s/GitOps → SOPS / Sealed Secrets; CI → OIDC over stored
74
+ creds.
75
+
76
+ ## Already committed / pushed → rotate first
77
+
78
+ If the secret is already in history, lead with **rotate/revoke the credential
79
+ now** — that is the only action that actually stops the damage. State plainly
80
+ that `git rm` and even a history rewrite do **not** un-leak an already-pushed
81
+ secret; then, if the user wants, point to history purge (`git filter-repo` / BFG)
82
+ plus force-push and collaborator re-clone. See
83
+ [`secrets-management`](../skills/secrets-management/SKILL.md).
84
+
85
+ ## Honesty — one layer, not the whole defense
86
+
87
+ The agent-side gate is one layer and only covers what the agent writes. Recommend
88
+ the user also enable the non-bypassable nets: the repo's CI secret-scan
89
+ (`check_secret_leak`) and, where available, the host's push-protection.
90
+
91
+ ## When NOT to fire
92
+
93
+ - `.env.example` / `*.sample` / `*.example` files with placeholder values.
94
+ - A line carrying an audited allow-marker (`# secret-allow` / `// secret-allow` /
95
+ `<!-- secret-allow -->`) or listed in the repo `.secret-allow` file.
96
+ - Obvious placeholders (`xxxx`, `changeme`, `your-key-here`, `<...>`), test
97
+ fixtures explicitly marked as such, and non-credential high-entropy strings
98
+ (hashes, UUIDs, lockfile digests) with no credential keyword nearby.
99
+
100
+ ## See also
101
+
102
+ - [`secrets-management`](../skills/secrets-management/SKILL.md) — store selection, tiered alternatives, rotation contract, remediation ordering.
103
+ - [`security-sensitive-stop`](security-sensitive-stop.md) — threat-model before editing a secrets surface (fires first, broader).
104
+ - [`tool-safety`](tool-safety.md) — "no hidden credentials" in shipped files.
105
+ - [`non-destructive-by-default`](non-destructive-by-default.md) — the commit/push confirmation floor this builds on.
106
+ - [`lethal-trifecta-guard`](lethal-trifecta-guard.md) — secrets are the private-data leg of the trifecta.
@@ -100,4 +100,4 @@ Authorization and tenancy bugs are often invisible in logs and fire silently
100
100
  until an auditor or attacker finds them. The cheapest moment to catch them
101
101
  is before the first edit — this rule makes that the default path.
102
102
 
103
- See also: `threat-modeling` · `authz-review` · `data-flow-mapper` · `minimal-safe-diff` · `think-before-action` · [`untrusted-input-defense`](untrusted-input-defense.md) · [`lethal-trifecta-guard`](lethal-trifecta-guard.md) · [`docs/threat-model.md`](../../docs/threat-model.md).
103
+ See also: `threat-modeling` · `authz-review` · `data-flow-mapper` · `minimal-safe-diff` · `think-before-action` · [`untrusted-input-defense`](untrusted-input-defense.md) · [`lethal-trifecta-guard`](lethal-trifecta-guard.md) · [`secret-vcs-guard`](secret-vcs-guard.md) · [`docs/threat-model.md`](../../docs/threat-model.md).
@@ -8,6 +8,8 @@ routes_to:
8
8
  - "guideline:agent-infra/skill-quality-checklist"
9
9
  workspaces: [agent-config-maintainer]
10
10
  packs: [meta]
11
+ enforced_by:
12
+ - "validator:src/scripts/skill_linter.ts"
11
13
  ---
12
14
 
13
15
  # Skill Quality
@@ -19,6 +19,8 @@ validator_ignore:
19
19
  reason: "Rule names the linter/denylist asset that necessarily holds the tokens."
20
20
  workspaces: [agent-config-maintainer]
21
21
  packs: [meta]
22
+ enforced_by:
23
+ - "validator:src/scripts/check_no_external_sources.ts"
22
24
  ---
23
25
 
24
26
  # Source Confidentiality
@@ -11,6 +11,8 @@ triggers:
11
11
  - path_prefix: ".cursor/"
12
12
  workspaces: [agent-config-maintainer]
13
13
  packs: [meta]
14
+ enforced_by:
15
+ - "validator:src/scripts/check_condensation.ts"
14
16
  ---
15
17
 
16
18
  # Source of Truth
@@ -6,6 +6,8 @@ triggers:
6
6
  - intent: "any reply"
7
7
  workspaces: [agent-config-maintainer]
8
8
  packs: [meta]
9
+ enforced_by:
10
+ - "observer:maintainer-review"
9
11
  ---
10
12
 
11
13
  # Telegraph Speak
@@ -17,6 +17,8 @@ validator_ignore:
17
17
  reason: "Rule lists the authoring-tree paths that must stay in sync with the catalog."
18
18
  workspaces: [agent-config-maintainer]
19
19
  packs: [meta]
20
+ enforced_by:
21
+ - "validator:src/scripts/check_token_optimizer_freshness.ts"
20
22
  ---
21
23
 
22
24
  # Token Optimizer Maintenance
@@ -65,3 +65,4 @@ If a skill needs a tool that is not in the registry:
65
65
  - [`lethal-trifecta-guard`](lethal-trifecta-guard.md) — an over-broad tool grant is the standing egress leg of the lethal trifecta (OWASP ASI). Least Agency here breaks that leg by construction.
66
66
  - [`supply-chain-intake`](../skills/supply-chain-intake/SKILL.md) — the MCP-server intake gate applies this rule's Least-Agency tool-grant review before a new server is connected.
67
67
  - [`untrusted-input-defense`](untrusted-input-defense.md) — the least-agency + human-approval controls (OWASP LLM06 / ASI excessive-agency) that bound an untrusted-content path.
68
+ - [`secret-vcs-guard`](secret-vcs-guard.md) — a raw credential in a shipped file is the "no hidden credentials" violation this rule names; that rule blocks it at write/commit time.
@@ -7,6 +7,8 @@ load_context:
7
7
  - ../contexts/execution/verification-mechanics.md
8
8
  workspaces: [engineering]
9
9
  packs: [engineering-base]
10
+ enforced_by:
11
+ - "hook:verify-before-complete"
10
12
  ---
11
13
 
12
14
  # Verify Before Completion
@@ -104,6 +104,21 @@ Use the surface-specific template. All sections are required; "—"
104
104
  is acceptable for genuinely empty Alternatives or References blocks
105
105
  but never for Status, Context, Decision, or Consequences.
106
106
 
107
+ **`review_trigger` is required and it names a CONDITION, not a date.** A
108
+ decision is a call made under conditions that held at the time; the trigger
109
+ records which change would make it worth re-deciding. "Review annually" is
110
+ ignored by everyone and rots into ceremony —
111
+ `check_adr_frontmatter.ts` rejects bare cadences for exactly that reason. Write
112
+ the event: *"when a second consumer reports the same preservation surprise"*,
113
+ *"when a host ships a native primitive for this"*, *"if the measured lift drops
114
+ below the pre-registered threshold"*. Enforced from 2026-07-25 forward; earlier
115
+ ADRs are grandfathered by date.
116
+
117
+ When you later reopen one, say which **premise moved** and what evidences the
118
+ move — not "we were wrong". If the original was right under its own conditions,
119
+ record that too. A premise that turns out false while the decision stays correct
120
+ gets a logged correction block, never a silent edit.
121
+
107
122
  **Flat-surface template** (`docs/decisions/ADR-NNN-<slug>.md`):
108
123
 
109
124
  ```markdown
@@ -115,6 +130,7 @@ decision: <slug>
115
130
  supersedes: — | ADR-MMM
116
131
  superseded_by: — | ADR-MMM
117
132
  phase: <roadmap> · <phase-id>
133
+ review_trigger: <the CONDITION that would reopen this decision>
118
134
  ---
119
135
 
120
136
  # ADR-NNN — <Decision Title>
@@ -158,7 +174,7 @@ the area's contract from the README in
158
174
  - Per-area: `./scripts-run src/scripts/audit_adr_coverage --check` exits 0.
159
175
  - The project's CI / quality pipeline passes — locally only when
160
176
  `quality.local_auto_run: true`; under the default (`false` / missing)
161
- remote CI is the gate, no local pipeline run.
177
+ remote CI is the gate and no local pipeline run happens.
162
178
 
163
179
  ## Rubric pass (optional, surfacing-only)
164
180
 
@@ -189,29 +189,47 @@ After making changes, check if docs need updating:
189
189
  - **Structural changes** → update affected docs in `./agents/`
190
190
  - **New patterns** → update or create guideline docs
191
191
 
192
- ## Doc sync check (after code changes)
192
+ ## Doc-Impact — the mandatory check after every code change
193
193
 
194
- After completing a significant code change, run this mental checklist:
194
+ This is the detection procedure the [`downstream-changes`](../../rules/downstream-changes.md)
195
+ § Doc-Impact obligation points at. **Run it after every code change** — the
196
+ *detection* is non-optional; the human still confirms the actual edit.
195
197
 
196
- | What changed | Doc to check |
198
+ **Step 1 — did a public surface change?** Framework-agnostic surface list:
199
+
200
+ | Public surface changed | Doc that describes it — update in the same change |
197
201
  |---|---|
198
- | Database schema (migration) | `agents/reference/docs/database-setup.md` |
199
- | New API endpoint | OpenAPI annotations, `AGENTS.md` API section |
200
- | New module created | Create `{module_root}/{Module}/{agent_folder}/` (resolve via `modules.root_paths` + `modules.agent_folder`) |
201
- | Service/repository signature changed | Check if referenced in `agents/reference/docs/services-and-repos.md` |
202
- | New environment variable | `.env.example`, `AGENTS.md` environment section |
203
- | Docker/compose change | `agents/reference/docs/docker.md`, `Makefile` documentation |
204
- | New Artisan command | `AGENTS.md` commands section |
205
- | New pattern/convention introduced | Relevant guideline in `.augment/guidelines/` |
206
-
207
- **When unsure** — ask with numbered options:
202
+ | HTTP route / endpoint (Laravel `routes/`, Next.js `app/api`, FastAPI/Express handlers, Go mux) | OpenAPI / API reference, `README` usage, `AGENTS.md` API section |
203
+ | Exported function / class / method signature | The doc/example that calls it; `agents/reference/docs/services-and-repos.md` if referenced |
204
+ | CLI command or flag | `README` usage, `AGENTS.md` commands section, `--help` text |
205
+ | Config / settings key | Settings doc, `README` config section, schema/example file |
206
+ | Environment variable | `.env.example`, `AGENTS.md` environment section |
207
+ | DB schema / migration | `agents/reference/docs/database-setup.md` |
208
+ | Event payload / job constructor | The listener/consumer doc that documents the contract |
209
+ | New module | `{module_root}/{Module}/{agent_folder}/` (resolve via `modules.root_paths` + `modules.agent_folder`) |
210
+ | New pattern / convention | Relevant guideline in `.augment/guidelines/` |
211
+ | Architectural decision | [`adr-create`](../adr-create/SKILL.md) — numbered ADR + index regen |
212
+
213
+ **Step 2 — apply the fire/no-fire test.** Drift is a **falsifiable-claim
214
+ contradiction**, not incompleteness:
215
+
216
+ - **FIRE** (doc is now wrong — a reader would be misled): endpoint no longer
217
+ exists, wrong return type, renamed key, removed flag, broken code example.
218
+ - **DO NOT FIRE** (completeness / quality only): the doc is high-level and
219
+ omits a new internal detail it never claimed to list; "could be clearer".
220
+
221
+ **Step 3 — escape hatch.** Refactor-only / no public-surface change → no doc
222
+ obligation. Surface changed but genuinely needs no doc edit → state the
223
+ one-line reason; never edit a doc just to satisfy the rule (false-positive
224
+ fatigue is worse than a missed nit).
225
+
226
+ **When a doc edit IS needed but you are unsure of the wording** — flag it with
227
+ numbered options; do NOT auto-rewrite prose without the user's knowledge:
208
228
  ```
209
229
  > 1. Yes — update the docs
210
- > 2. No — leave as-is
230
+ > 2. No — leave as-is (reason: …)
211
231
  ```
212
232
 
213
- Do NOT auto-update docs without the user's knowledge. Flag what needs updating and let the user decide.
214
-
215
233
  ## Rules
216
234
 
217
235
  - All `.md` files must be in **English**.
@@ -21,7 +21,7 @@ packs:
21
21
 
22
22
  Use when:
23
23
  - Editing `AGENTS.md` at the package root.
24
- - Editing `packages/core/.agent-src.uncondensed/templates/AGENTS.md` (consumer-shipped template).
24
+ - Editing `src/agent-src/templates/AGENTS.md` (consumer-shipped template).
25
25
  - Reviewing a PR that changes either file.
26
26
  - Running `/optimize/agents`.
27
27
  - A budget meter (`scripts/measure_augment_budget.ts`) flags the package-root AGENTS.md as the dominant cost.
@@ -29,7 +29,7 @@ Use when:
29
29
  ## Do NOT
30
30
 
31
31
  - Edit `.github/copilot-instructions.md` with this skill (use `copilot-agents-optimization` instead).
32
- - Edit other `.md` files under `.augment/`, `packages/*/.agent-src.uncondensed/`, or `agents/` with this skill.
32
+ - Edit other `.md` files under `.augment/`, `src/`, or `agents/` with this skill.
33
33
  - Add a section to AGENTS.md without first checking whether an outboard target already exists in `agents/settings/contexts/` or `docs/contracts/`.
34
34
  - Replace prose with a bare link `[label](path)` — every pointer needs a *why*-clause ≥ 60 chars or it does not count toward the 40 % ratio.
35
35
  - Reuse the package-root anatomy in the consumer template — caps and target paths differ.
@@ -47,7 +47,7 @@ Every entry describes **what** the project does or **where** to learn more — n
47
47
  | File | FAIL above | WARN above | Target |
48
48
  |---|---|---|---|
49
49
  | `AGENTS.md` (package root) | 3,000 chars | 2,800 chars | ≤ 2,800 |
50
- | `packages/core/.agent-src.uncondensed/templates/AGENTS.md` (consumer) | 2,500 chars | 2,300 chars | ≤ 2,300 |
50
+ | `src/agent-src/templates/AGENTS.md` (consumer) | 2,500 chars | 2,300 chars | ≤ 2,300 |
51
51
 
52
52
  Char-count is raw file size (`wc -c`), frontmatter included. Enforcement: `scripts/lint_agents_md.ts` (Phase 7), wired into the package's CI pipeline via the `lint-agents-md` task. WARN is a soft signal in CI; FAIL blocks merge.
53
53
 
@@ -85,7 +85,7 @@ Every substantive pointer specifies, on the same line or the immediately followi
85
85
 
86
86
  ## The contract — emergency-triage block
87
87
 
88
- Every Thin-Root AGENTS.md MUST contain an **Emergency Triage** section verbatim from `packages/core/.agent-src.uncondensed/contexts/contracts/emergency-triage-block.md` (Phase 6.4 will create that file as the canonical source). The block lists the five questions a host agent answers from the root file alone when network / tool access is degraded:
88
+ Every Thin-Root AGENTS.md MUST contain an **Emergency Triage** section verbatim from `src/agent-src/contexts/contracts/emergency-triage-block.md` (Phase 6.4 will create that file as the canonical source). The block lists the five questions a host agent answers from the root file alone when network / tool access is degraded:
89
89
 
90
90
  1. What is this repository?
91
91
  2. What language(s) does this repository accept?
@@ -99,22 +99,22 @@ Each answer must fit on one line. The block exists so the root never silently de
99
99
 
100
100
  1. **Measure baseline.** `wc -c AGENTS.md` and `./scripts-run src/scripts/measure_augment_budget`. Record current char-count and the gap to 2,200 / 2,500.
101
101
  2. **Inventory sections.** List every `## ` heading and its char-count. Mark each as `keep-inline` (Iron-Law-adjacent, ≤ 200 chars, no good outboard target) or `outboard-candidate` (longer-form prose, table-only sections, narrative).
102
- 3. **Identify outboard targets.** For each `outboard-candidate`, name the destination — `packages/core/.agent-src.uncondensed/contexts/`, `docs/contracts/`, an existing rule body, an existing skill body. Never invent a new top-level directory.
102
+ 3. **Identify outboard targets.** For each `outboard-candidate`, name the destination — `src/agent-src/contexts/`, `docs/contracts/`, an existing rule body, an existing skill body. Never invent a new top-level directory.
103
103
  4. **Move content; insert pointer.** Cut the section into the target file. Replace it in AGENTS.md with a single substantive pointer per anatomy above. Verify the *why*-clause length.
104
104
  5. **Re-measure.** `wc -c AGENTS.md` again. If above 2,200, repeat steps 2–4 on the next-largest section. Above 2,500 = must outboard further before commit.
105
105
  6. **Validate pointer ratio.** Count non-blank lines and substantive-pointer lines. Ratio < 0.40 = collapse decorative or boilerplate lines into a single pointer or remove.
106
- 7. **Verify emergency-triage block.** Diff the in-file block against `packages/core/.agent-src.uncondensed/contexts/contracts/emergency-triage-block.md`. Drift = revert to canonical.
106
+ 7. **Verify emergency-triage block.** Diff the in-file block against `src/agent-src/contexts/contracts/emergency-triage-block.md`. Drift = revert to canonical.
107
107
  8. **Run lints.** `task lint-agents-md && task check-refs && task lint-skills`. All green before commit.
108
108
 
109
109
  ## Procedure — apply Thin-Root to consumer template
110
110
 
111
- Same procedure, applied to `packages/core/.agent-src.uncondensed/templates/AGENTS.md`. Hard cap shifts to 2,000 / 1,700. The consumer template intentionally lacks the package-self-references — its pointers target files that exist in the **consumer's** repo (`.augment/skills/`, `agents/settings/contexts/`, ...), not this package's authoring tree.
111
+ Same procedure, applied to `src/agent-src/templates/AGENTS.md`. Hard cap shifts to 2,000 / 1,700. The consumer template intentionally lacks the package-self-references — its pointers target files that exist in the **consumer's** repo (`.augment/skills/`, `agents/settings/contexts/`, ...), not this package's authoring tree.
112
112
 
113
113
  ## Gotchas
114
114
 
115
- - **Outboarding to a new top-level dir.** Inventing `agents/explainers/` or `docs/notes/` for the moved content silently widens the contract surface. Outboard only into `packages/core/.agent-src.uncondensed/contexts/`, `docs/contracts/`, an existing rule body, or an existing skill body.
115
+ - **Outboarding to a new top-level dir.** Inventing `agents/explainers/` or `docs/notes/` for the moved content silently widens the contract surface. Outboard only into `src/agent-src/contexts/`, `docs/contracts/`, an existing rule body, or an existing skill body.
116
116
  - **Pointer-ratio inflation by decoration.** Adding boilerplate "Browse all skills" / "See also" links to lift the ratio above 40 % defeats the purpose. The lint counts only substantive pointers (with a *why*-clause ≥ 60 chars); decorative links get filtered out and the ratio drops back below threshold.
117
- - **Emergency-triage drift.** Editing the in-file emergency-triage block instead of the canonical `packages/core/.agent-src.uncondensed/contexts/contracts/emergency-triage-block.md` causes the package-root and consumer-template versions to diverge silently. Always edit the canonical file and let the lint diff pull both back in sync.
117
+ - **Emergency-triage drift.** Editing the in-file emergency-triage block instead of the canonical `src/agent-src/contexts/contracts/emergency-triage-block.md` causes the package-root and consumer-template versions to diverge silently. Always edit the canonical file and let the lint diff pull both back in sync.
118
118
  - **Cap inversion under WARN.** A 2,250-char AGENTS.md (above 2,200 WARN, below 2,500 FAIL) is a yellow signal not a green one — every additional sentence raises the probability of the next FAIL. Treat WARN as the spend boundary, not a buffer.
119
119
  - **Char-count includes frontmatter.** `wc -c` counts every byte including the YAML preamble, blank lines, and the trailing newline. Stripping a section to "look smaller" without re-running `wc -c` understates the true budget impact.
120
120
  - **Path enumeration.** A run of three or more bare `` `path/to/dir/` `` bullets without *why*-clauses is the classic re-bloat pattern. The lint emits a WARN at ≥ 3 such lines. Collapse them into one capability-style pointer — see the recipe in [`agents-md-anatomy § Iron Law`](../../contexts/contracts/agents-md-anatomy.md#iron-law--capabilities-over-structure).
@@ -0,0 +1,94 @@
1
+ ---
2
+ model_tier: inherit
3
+ name: code-intelligence
4
+ description: "Route codebase-structure questions (who calls X, where used, what imports, change-impact) to a code-graph first, grep fallback. Triggers 'who calls', 'where is this used', 'call graph'."
5
+ source: package
6
+ domain: engineering
7
+ workspaces:
8
+ - engineering
9
+ packs:
10
+ - meta
11
+ requires_skills:
12
+ - source-discovery
13
+ ---
14
+
15
+ # code-intelligence
16
+
17
+ > For a **structure** question — *who calls X*, *where is Y used*, *what
18
+ > imports Z*, *what breaks if I change this symbol* — a code-graph answers far
19
+ > more precisely than a blind `grep`, at a fraction of the tokens. This skill
20
+ > routes such questions to the native code-graph engine (ADR-124, Class A) or a
21
+ > consumer-shipped index first, and falls back to grep **with a stated reason**
22
+ > when the graph cannot answer. It is the executable side of
23
+ > [`external-code-graph-interop`](../../rules/external-code-graph-interop.md):
24
+ > *orchestrator first, owner where it wins*.
25
+
26
+ ## When to use
27
+
28
+ - The question is about **relationships between code symbols**, not content:
29
+ callers/callees, references, imports, inheritance, change-impact.
30
+ - You are about to `grep`/`Read` across many files to reconstruct a call or
31
+ import graph by hand.
32
+
33
+ **When NOT to use:** content/semantic questions ("what does this function
34
+ *mean*", "find the string 'password'"), single-file edits, or a repo with no
35
+ code-graph and no appetite to build one — plain `grep`/read is right there.
36
+
37
+ ## Procedure
38
+
39
+ 1. **Detect the source.** `code_graph detect` — is a fresh consumer `graph.json`
40
+ or native cache present? (A consumer-shipped fresh index wins; the native
41
+ engine covers stale-or-absent — ADR-124 § 2.)
42
+ 2. **Build if absent and worthwhile.** No graph + a repo in the launch set
43
+ (PHP / TS / JS)? `code_graph build` (deterministic, LLM-free, ~seconds).
44
+ Skip for a one-off question in an unsupported stack — grep instead.
45
+ 3. **Query.** Pick the verb:
46
+ - `code_graph query <symbol>` — direct relations of a symbol.
47
+ - `code_graph affected <symbol>` — reverse: who calls / references it (the
48
+ "impact of changing X" question). `--since <ref>` seeds from a git diff.
49
+ - `code_graph path <a> <b>` — how two symbols connect.
50
+ - `code_graph explain <symbol>` — 2-hop neighbourhood.
51
+ Pass `--budget <tokens>` to cap output.
52
+ 4. **Read the confidence.** `EXTRACTED` = syntactic fact; `INFERRED` =
53
+ hierarchy-resolved; `AMBIGUOUS` = dynamic dispatch / facade, carries
54
+ candidates — treat its target as *one of* the candidates, never as certain.
55
+ 5. **Fall back honestly.** If the graph has no entry for the symbol, grep — and
56
+ say so: *"the graph has no entry for X, so I grepped."*
57
+
58
+ ## Output
59
+
60
+ Every answer built with this skill MUST:
61
+
62
+ - **Name the source** that answered — `native`, `consumer`, or `grep-fallback`
63
+ — so the reader knows the provenance and freshness of the relationship claim.
64
+ - **Preserve the confidence class** for each relationship surfaced — never
65
+ present an `AMBIGUOUS` edge as a definite call; list its candidates or say
66
+ "ambiguous (dynamic dispatch)".
67
+
68
+ ## Gotcha
69
+
70
+ - **A stale graph lies confidently.** If `detect` reports the index is N commits
71
+ behind, rebuild (`code_graph build --update`) before trusting relationship
72
+ answers, or say the answer is from a stale index.
73
+ - **Dynamic dispatch is honestly ambiguous.** On a Laravel/JS codebase most
74
+ method-call edges are `AMBIGUOUS` (facades, injected services, `$obj->m()`).
75
+ That is the engine being honest, not broken — do not "resolve" them yourself
76
+ by guessing.
77
+
78
+ ## Do NOT
79
+
80
+ - Do NOT rebuild a **fresh** consumer-shipped index — query it (interop
81
+ courtesy).
82
+ - Do NOT block or defer a read waiting on the graph — it is an accelerator, not
83
+ a gate.
84
+ - Do NOT treat the cache as a source of truth for anything beyond the last
85
+ build; it is a rebuildable artifact.
86
+
87
+ ## See also
88
+
89
+ - [`external-code-graph-interop`](../../rules/external-code-graph-interop.md) —
90
+ the rule that routes structure questions here.
91
+ - [`source-discovery`](../source-discovery/SKILL.md) — evidence-before-structure
92
+ discipline; the graph is one evidence source, still confirmed against the real
93
+ code when load-bearing.
94
+ - `src/scripts/code_graph/` — the engine (build / query / detect / affected).