@event4u/agent-config 1.23.0 → 1.25.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.
- package/.agent-src/commands/analyze-reference-repo.md +3 -0
- package/.agent-src/commands/review-routing.md +7 -10
- package/.agent-src/commands/roadmap/process-full.md +41 -1
- package/.agent-src/contexts/authority/kernel-rule-edits.md +48 -0
- package/.agent-src/contexts/authority/scope-mechanics.md +15 -0
- package/.agent-src/contexts/contracts/consumer-agents-md-guide.md +127 -0
- package/.agent-src/contexts/contracts/emergency-triage-block.md +53 -0
- package/.agent-src/contexts/execution/roadmap-process-loop.md +29 -6
- package/.agent-src/rules/analysis-skill-routing.md +1 -1
- package/.agent-src/rules/artifact-drafting-protocol.md +1 -1
- package/.agent-src/rules/artifact-engagement-recording.md +1 -1
- package/.agent-src/rules/augment-source-of-truth.md +1 -1
- package/.agent-src/rules/autonomous-execution.md +1 -1
- package/.agent-src/rules/caveman-speak.md +1 -1
- package/.agent-src/rules/cli-output-handling.md +1 -1
- package/.agent-src/rules/command-suggestion-policy.md +1 -1
- package/.agent-src/rules/docs-sync.md +1 -1
- package/.agent-src/rules/guidelines.md +1 -1
- package/.agent-src/rules/improve-before-implement.md +1 -1
- package/.agent-src/rules/invite-challenge.md +1 -1
- package/.agent-src/rules/minimal-safe-diff.md +1 -1
- package/.agent-src/rules/model-recommendation.md +1 -1
- package/.agent-src/rules/no-attribution-footers.md +1 -1
- package/.agent-src/rules/no-roadmap-references.md +56 -20
- package/.agent-src/rules/onboarding-gate.md +1 -1
- package/.agent-src/rules/package-ci-checks.md +1 -1
- package/.agent-src/rules/reviewer-awareness.md +9 -2
- package/.agent-src/rules/roadmap-progress-sync.md +37 -3
- package/.agent-src/rules/scope-control.md +6 -0
- package/.agent-src/rules/security-sensitive-stop.md +1 -1
- package/.agent-src/rules/size-enforcement.md +1 -1
- package/.agent-src/rules/token-optimizer-maintenance.md +1 -1
- package/.agent-src/rules/ui-audit-gate.md +1 -1
- package/.agent-src/skills/adr-create/SKILL.md +2 -1
- package/.agent-src/skills/agents-md-thin-root/SKILL.md +125 -0
- package/.agent-src/skills/ai-council/SKILL.md +9 -7
- package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +9 -0
- package/.agent-src/skills/markitdown/SKILL.md +239 -0
- package/.agent-src/skills/review-routing/SKILL.md +3 -4
- package/.agent-src/skills/universal-project-analysis/SKILL.md +8 -0
- package/.agent-src/templates/AGENTS.md +18 -148
- package/.agent-src/templates/copilot-instructions.md +41 -17
- package/.agent-src/templates/github-workflows/pr-risk-review.yml +1 -1
- package/.agent-src/templates/scripts/pr_review_routing.py +1 -1
- package/.claude-plugin/marketplace.json +7 -5
- package/AGENTS.md +18 -205
- package/CHANGELOG.md +70 -0
- package/README.md +2 -2
- package/docs/architecture.md +13 -7
- package/docs/catalog.md +45 -29
- package/docs/contracts/agents-md-tech-stack.md +74 -0
- package/docs/contracts/linear-ai-rules-inclusion.md +1 -1
- package/docs/contracts/package-self-orientation.md +135 -0
- package/docs/contracts/rule-classification.md +4 -4
- package/docs/decisions/ADR-004-rule-governance-pruning.md +240 -0
- package/docs/getting-started.md +1 -1
- package/docs/guidelines/agent-infra/review-routing-data-format.md +1 -2
- package/package.json +1 -1
- package/scripts/_p4_migrate.py +5 -5
- package/scripts/audit_auto_rules.py +159 -0
- package/scripts/audit_likelihood.py +148 -0
- package/scripts/audit_overlap.py +145 -0
- package/scripts/build_rule_trigger_matrix.py +3 -5
- package/scripts/check_augment_description_cap.py +79 -0
- package/scripts/check_council_references.py +3 -3
- package/scripts/check_kernel_rule_bundle.py +151 -0
- package/scripts/check_references.py +21 -1
- package/scripts/compile_router.py +3 -0
- package/scripts/install.sh +0 -1
- package/scripts/lint_agents_md.py +168 -0
- package/scripts/measure_augment_budget.py +208 -0
- package/scripts/measure_markitdown_lift.py +127 -0
- package/scripts/schemas/rule.schema.json +2 -1
- package/scripts/skill_linter.py +10 -4
- package/scripts/spotcheck_thin_root.py +134 -0
- package/scripts/update_counts.py +6 -10
- package/.agent-src/rules/no-council-references.md +0 -76
- package/.agent-src/rules/review-routing-awareness.md +0 -19
- package/.agent-src/templates/copilot-review-instructions.md +0 -76
|
@@ -1,31 +1,49 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "mechanical-already"
|
|
4
|
-
description: "
|
|
4
|
+
description: "Linking transient files (agents/roadmaps/, agents/council-{questions,responses,sessions}/) from a stable artifact — both layers expire; promote findings"
|
|
5
5
|
alwaysApply: false
|
|
6
6
|
source: package
|
|
7
7
|
triggers:
|
|
8
8
|
- path_prefix: "agents/roadmaps/"
|
|
9
|
+
- path_prefix: "agents/council-questions/"
|
|
10
|
+
- path_prefix: "agents/council-responses/"
|
|
11
|
+
- path_prefix: "agents/council-sessions/"
|
|
9
12
|
- intent: "link from stable artifact"
|
|
13
|
+
- intent: "link to council artefact"
|
|
14
|
+
routes_to:
|
|
15
|
+
- "skill:ai-council"
|
|
10
16
|
validator_ignore:
|
|
11
17
|
- type: "substring"
|
|
12
18
|
pattern: ".agent-src.uncompressed/"
|
|
13
|
-
reason: "Rule contrasts the authoring tree with transient
|
|
19
|
+
reason: "Rule contrasts the authoring tree with transient layers."
|
|
14
20
|
---
|
|
15
21
|
|
|
16
|
-
# No
|
|
22
|
+
# No Transient References from Stable Artifacts
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
or deleted as work
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
Two transient layers under `agents/` outlive nothing: roadmaps in
|
|
25
|
+
`agents/roadmaps/` are archived, skipped, or deleted as work
|
|
26
|
+
completes; council artefacts in `agents/council-{questions,responses,
|
|
27
|
+
sessions}/` are **gitignored, local-only, and auto-pruned** after
|
|
28
|
+
`ai_council.session_retention_days` (default 7). Stable artifacts
|
|
29
|
+
(rules, skills, commands, contexts, guidelines, AGENTS.md, README,
|
|
30
|
+
copilot-instructions) outlive both. A stable artifact citing a
|
|
31
|
+
specific transient file becomes a broken reference the moment that
|
|
32
|
+
file is deleted or pruned.
|
|
33
|
+
|
|
34
|
+
Council links rot three ways: gitignored (not in cloned repo),
|
|
35
|
+
pruned after retention window (gone even locally), and the installed
|
|
36
|
+
`.augment/` projection cannot follow a path that does not exist in
|
|
37
|
+
the consumer.
|
|
23
38
|
|
|
24
39
|
## The Iron Law
|
|
25
40
|
|
|
26
41
|
```
|
|
27
|
-
NEVER LINK TO A SPECIFIC FILE IN agents/roadmaps/
|
|
42
|
+
NEVER LINK TO A SPECIFIC FILE IN agents/roadmaps/
|
|
43
|
+
OR IN agents/council-{questions,responses,sessions}/
|
|
44
|
+
FROM A STABLE ARTIFACT.
|
|
28
45
|
PROMOTE DURABLE CONCLUSIONS TO agents/contexts/ AND CITE THAT INSTEAD.
|
|
46
|
+
INLINE COUNCIL CONVERGENCE WITH DATE + MEMBERS, NEVER THE PATH.
|
|
29
47
|
```
|
|
30
48
|
|
|
31
49
|
Stable artifact = anything that is **not** a roadmap, council
|
|
@@ -37,6 +55,9 @@ These paths must not appear inside a stable artifact:
|
|
|
37
55
|
|
|
38
56
|
- `agents/roadmaps/<file>.md`, `agents/roadmaps/archive/<file>.md`,
|
|
39
57
|
`agents/roadmaps/skipped/<file>.md`
|
|
58
|
+
- `agents/council-questions/<file>.md`,
|
|
59
|
+
`agents/council-responses/<file>.json`,
|
|
60
|
+
`agents/council-sessions/<file>.json` or `<timestamp>/...`
|
|
40
61
|
|
|
41
62
|
Stable artifact = any file under `.agent-src.uncompressed/{rules,
|
|
42
63
|
skills,commands,contexts,templates,personas}/`, `agents/contexts/`,
|
|
@@ -44,38 +65,53 @@ skills,commands,contexts,templates,personas}/`, `agents/contexts/`,
|
|
|
44
65
|
`docs/customization.md`, `docs/getting-started.md`, `docs/catalog.md`,
|
|
45
66
|
`AGENTS.md`, `README.md`, `copilot-instructions.md`.
|
|
46
67
|
|
|
47
|
-
CI enforcement: `scripts/check_no_roadmap_refs.py` (
|
|
48
|
-
|
|
68
|
+
CI enforcement: `scripts/check_no_roadmap_refs.py` (roadmap layer)
|
|
69
|
+
and `scripts/check_council_references.py` (council layer) — both
|
|
70
|
+
fail the build on any new violation.
|
|
49
71
|
|
|
50
72
|
## Allowed patterns
|
|
51
73
|
|
|
52
|
-
- `agents/roadmaps/` and
|
|
74
|
+
- `agents/roadmaps/` and `agents/council-*/` as **directory** mentions
|
|
53
75
|
(talking about the layer, not a specific file)
|
|
54
76
|
- Roadmap → roadmap references (siblings within the transient layer)
|
|
77
|
+
- The `ai-council` skill and `/council:*` commands documenting the
|
|
78
|
+
output path schema
|
|
79
|
+
- Inline council convergence summary — e.g. *"Council
|
|
80
|
+
(claude-sonnet-4-5 + gpt-4o, 2026-05-06) converged on …"* with
|
|
81
|
+
date + members, no filepath
|
|
55
82
|
- Council sessions, `agents/.agent-chat-history`, commit messages, PR
|
|
56
83
|
descriptions — transient by construction, not part of the package
|
|
57
84
|
surface
|
|
58
85
|
|
|
59
86
|
## What to do instead
|
|
60
87
|
|
|
61
|
-
When a stable artifact needs to cite a
|
|
88
|
+
When a stable artifact needs to cite a transient finding:
|
|
62
89
|
|
|
63
90
|
1. Identify the durable conclusion — decision, contract, lesson,
|
|
64
91
|
mechanic.
|
|
65
92
|
2. Promote it to a context file under `agents/contexts/` (ADR,
|
|
66
|
-
mechanics doc, locked decision). The roadmap
|
|
67
|
-
the context, not the other way around.
|
|
93
|
+
mechanics doc, locked decision). The roadmap or council session
|
|
94
|
+
can then point at the context, not the other way around.
|
|
68
95
|
3. Reference the context from the stable artifact.
|
|
96
|
+
4. For council convergences specifically: inline a convergence-summary
|
|
97
|
+
block (members, date, cost if relevant — see `ai-council`
|
|
98
|
+
§ Output format) instead of linking the session JSON.
|
|
99
|
+
|
|
100
|
+
Failure modes:
|
|
69
101
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
102
|
+
- *"I'll just link to the roadmap, it's evidence."* The roadmap
|
|
103
|
+
gets archived, then deleted, then the link rots. **Promote first,
|
|
104
|
+
link second.**
|
|
105
|
+
- *"I'll just link to the session JSON, it's evidence."* The session
|
|
106
|
+
is gone in 7 days. **Inline first, link never.**
|
|
73
107
|
|
|
74
108
|
## See also
|
|
75
109
|
|
|
76
110
|
- [`docs-sync`](docs-sync.md) — cross-reference sync after rename / delete
|
|
77
111
|
- [`agent-docs`](agent-docs.md) — roadmap layer conventions
|
|
78
|
-
- [`roadmap-progress-sync`](roadmap-progress-sync.md) — sync dashboard
|
|
79
|
-
roadmap touch
|
|
112
|
+
- [`roadmap-progress-sync`](roadmap-progress-sync.md) — sync dashboard
|
|
113
|
+
on roadmap touch
|
|
80
114
|
- [`augment-source-of-truth`](augment-source-of-truth.md) — edit
|
|
81
115
|
`.agent-src.uncompressed/`
|
|
116
|
+
- [`ai-council`](../skills/ai-council/SKILL.md) — output path
|
|
117
|
+
convention and convergence-summary format
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "1"
|
|
4
|
-
description: "First turn of a conversation on a project — check onboarding.onboarded in .agent-settings.yml; when false, prompt
|
|
4
|
+
description: "First turn of a conversation on a project — check onboarding.onboarded in .agent-settings.yml; when false, prompt to run /onboard before any request"
|
|
5
5
|
source: package
|
|
6
6
|
triggers:
|
|
7
7
|
- phrase: "first turn"
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "2a"
|
|
4
|
-
description: "When suggesting reviewers
|
|
4
|
+
description: "When suggesting reviewers or flagging risk hotspots — anchor in paths/risk + ownership-map + bug-patterns; medium/high needs primary + secondary"
|
|
5
5
|
source: package
|
|
6
6
|
triggers:
|
|
7
7
|
- keyword: "reviewer"
|
|
8
8
|
- phrase: "suggest reviewers"
|
|
9
|
+
- phrase: "risk hotspot"
|
|
10
|
+
- phrase: "ownership map"
|
|
9
11
|
routes_to:
|
|
10
12
|
- "skill:review-routing"
|
|
11
13
|
---
|
|
12
14
|
|
|
13
15
|
# Reviewer Awareness
|
|
14
16
|
|
|
15
|
-
**Iron Law.** Anchor reviewer choice in paths and risk, never seniority; medium / high risk requires primary + secondary role.
|
|
17
|
+
**Iron Law (reviewer choice).** Anchor reviewer choice in paths and risk, never seniority; medium / high risk requires primary + secondary role.
|
|
18
|
+
|
|
19
|
+
**Iron Law (routing / risk).** Consult ownership-map and historical-bug-patterns before suggesting reviewers or claiming a change is safe.
|
|
16
20
|
|
|
17
21
|
Body migrated to `skill:review-routing` (per P4 of `road-to-kernel-and-router.md`).
|
|
18
22
|
Trigger-set above activates this routing under the `balanced` and `full` profiles.
|
|
23
|
+
|
|
24
|
+
Consolidates the former review-routing-awareness rule per the
|
|
25
|
+
package's adr-auto-rule-consolidation decision.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "1"
|
|
4
|
-
description: "Any touch
|
|
4
|
+
description: "Any roadmap touch (file move, checkbox flip, phase change) regens dashboard same response; archive at 0 open. Autonomous runs flip checkboxes inline"
|
|
5
5
|
source: package
|
|
6
6
|
triggers:
|
|
7
7
|
- path_prefix: "agents/roadmaps/"
|
|
@@ -11,7 +11,41 @@ routes_to:
|
|
|
11
11
|
|
|
12
12
|
# Roadmap Progress Sync
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
## Iron Law 1 — dashboard sync, same response
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
```
|
|
17
|
+
ANY ROADMAP TOUCH → REGENERATE THE DASHBOARD, SAME RESPONSE.
|
|
18
|
+
NO EXCEPTIONS. NO "I'LL DO IT AT THE END". NO BATCHING ACROSS TURNS.
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Roadmap touch = create / rename / delete / move file, add/rename/remove a phase, OR flip any checkbox (`[ ]` ↔ `[x]` ↔ `[~]` ↔ `[-]`). Regen command: `./agent-config roadmap:progress`. Archive (`git mv` → `archive/`) the moment `count_open == 0` — same response.
|
|
22
|
+
|
|
23
|
+
## Iron Law 2 — real-time checkbox cadence (autonomous execution)
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
EVERY DONE STEP FLIPS [ ] → [x] IN THE SAME REPLY THAT LANDS THE WORK.
|
|
27
|
+
NO "I UPDATE THE ROADMAP AT THE END OF THE PHASE."
|
|
28
|
+
NO "FOUR STEPS DONE, ONE COMMIT, ONE REGEN."
|
|
29
|
+
A REPLY THAT LANDS A VERIFIED STEP WITHOUT FLIPPING ITS CHECKBOX
|
|
30
|
+
IS A RULE VIOLATION, NOT AN OVERSIGHT.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`/roadmap:process-step`, `/roadmap:process-phase`, `/roadmap:process-full`, and any other multi-step autonomous run flip the box for step N **before** moving on to step N+1. The dashboard is a real-time monitor, not a post-hoc summary. Batched flips at the archive commit defeat the dashboard's purpose.
|
|
34
|
+
|
|
35
|
+
**Step counts as done** when its code/doc change is written and saved AND the verification cited in the step has passed (fresh output in this reply or an earlier one).
|
|
36
|
+
|
|
37
|
+
**In-progress marker.** When a step takes more than one reply, mark it `[~]` the moment work starts and regen — the user sees one row move `[ ] → [~] → [x]` instead of silent rows. `[~]` stays open for `count_open` but advances the phase percentage.
|
|
38
|
+
|
|
39
|
+
## Pre-send self-check — MANDATORY
|
|
40
|
+
|
|
41
|
+
Before sending any reply that landed roadmap work:
|
|
42
|
+
|
|
43
|
+
1. Did this reply land a step (code/doc saved + verification passed)?
|
|
44
|
+
2. Is its checkbox flipped to `[x]` / `[~]` / `[-]` in `agents/roadmaps/<file>.md`? If no → flip, then continue.
|
|
45
|
+
3. Did `./agent-config roadmap:progress` run after the flip? If no → run, then continue.
|
|
46
|
+
4. Did `count_open` reach 0? If yes → `git mv` to `archive/` and regen again — same reply.
|
|
47
|
+
|
|
48
|
+
Any "no" at step 2 or 3 → reply is incomplete. Do not send.
|
|
49
|
+
|
|
50
|
+
Long-form mechanics (failure-mode catalog, Copilot fallback, `[~]` vs `[ ]` semantics, hook + CI defence-in-depth) live in `guideline:agent-infra/roadmap-progress-mechanics`.
|
|
17
51
|
Trigger-set above activates this routing under the `balanced` and `full` profiles.
|
|
@@ -6,6 +6,7 @@ alwaysApply: true
|
|
|
6
6
|
source: package
|
|
7
7
|
load_context:
|
|
8
8
|
- ../contexts/authority/scope-mechanics.md
|
|
9
|
+
- ../contexts/authority/kernel-rule-edits.md
|
|
9
10
|
---
|
|
10
11
|
|
|
11
12
|
# Scope Control
|
|
@@ -29,6 +30,7 @@ The user decides the git shape. Never improvise. Commit specifics: canonical [`c
|
|
|
29
30
|
- NEVER push a tag or create a release without permission.
|
|
30
31
|
- NEVER include version numbers, target releases, deprecation dates, release-tied milestones, or git tags in roadmaps, plans, tickets, or any planning artifact. Roadmaps plan **work**; releases / tags are a separate decision outside the roadmap. Never surface "which release should this ship in?" as a numbered choice. User pins by saying so explicitly.
|
|
31
32
|
- Task seems to need a separate branch / PR → STOP and **brief before asking** ([`scope-mechanics § Brief-before-asking`](../contexts/authority/scope-mechanics.md)).
|
|
33
|
+
- BEFORE the first commit on related work, **inventory** existing branches and open PRs (`git branch --show-current`, `gh pr list --state open`). If a plausible base beyond the current branch exists, STOP and ask with numbered options — never improvise the base. Inventory + 4-option template + diverging-stack failure mode: [`scope-mechanics § Branch-base inventory`](../contexts/authority/scope-mechanics.md).
|
|
32
34
|
|
|
33
35
|
"Explicit permission" = user said so **this turn or in a standing instruction not yet revoked**. Earlier permission for a different operation does not carry over.
|
|
34
36
|
|
|
@@ -36,6 +38,10 @@ The user decides the git shape. Never improvise. Commit specifics: canonical [`c
|
|
|
36
38
|
|
|
37
39
|
A subset is **never** autonomous and never auto-permitted by a standing autonomy directive. Canonical: [`non-destructive-by-default`](non-destructive-by-default.md). Trigger list (prod-branch merges, deploys / releases, prod data / infra, bulk-destructive ops) and the "authorization is this turn, not earlier" clarification: [`scope-mechanics § Production, infrastructure, bulk-destructive`](../contexts/authority/scope-mechanics.md).
|
|
38
40
|
|
|
41
|
+
## Kernel-rule edits — slow-rollout guarantee
|
|
42
|
+
|
|
43
|
+
Each kernel-rule edit ships in **its own PR**, ≥ 24 h between merges. Autonomous mandate does NOT lift this — soak guarantee, not preference. CI fails > 1 kernel rule per PR unless labeled `bundled-always-rules-acknowledged`. Trigger / scope: [`kernel-rule-edits`](../contexts/authority/kernel-rule-edits.md).
|
|
44
|
+
|
|
39
45
|
## Decline = silence — no re-asking on the same task
|
|
40
46
|
|
|
41
47
|
After the user **declines** a proposal (branch switch, PR creation, tag/release entry, separate worktree, version pinning), do **not** raise it again on the same task. Decline stands until the user reopens the topic. Timing / "is this worth asking?": [`scope-mechanics § Decline = silence`](../contexts/authority/scope-mechanics.md).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "2a"
|
|
4
4
|
alwaysApply: false
|
|
5
|
-
description: "Security-sensitive paths — auth, billing, tenant boundaries, secrets,
|
|
5
|
+
description: "Security-sensitive paths — auth, billing, tenant boundaries, secrets, uploads, integrations, webhooks, public endpoints — threat-model BEFORE editing"
|
|
6
6
|
source: package
|
|
7
7
|
triggers:
|
|
8
8
|
- keyword: "auth"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "2a"
|
|
4
|
-
description: "Editing a token-optimizer-cited asset (cli-output-handling, rtk-output-filtering, token-efficiency,
|
|
4
|
+
description: "Editing a token-optimizer-cited asset (cli-output-handling, rtk-output-filtering, token-efficiency, markitdown) — sync catalog same commit"
|
|
5
5
|
source: package
|
|
6
6
|
triggers:
|
|
7
7
|
- keyword: "cli-output-handling"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "2b"
|
|
4
4
|
alwaysApply: false
|
|
5
|
-
description: "Writing or editing UI — components, screens, partials, layouts, design tokens — require existing-ui-audit findings
|
|
5
|
+
description: "Writing or editing UI — components, screens, partials, layouts, design tokens — require existing-ui-audit findings before non-trivial UI change"
|
|
6
6
|
source: package
|
|
7
7
|
triggers:
|
|
8
8
|
- path_prefix: "resources/views/"
|
|
@@ -194,4 +194,5 @@ to every ADR you author.
|
|
|
194
194
|
- Reuse an existing ADR number — the index regenerator hard-fails.
|
|
195
195
|
- Author ADRs for reversible refactors or minor cleanups.
|
|
196
196
|
- Cite a council session id without ensuring the file is committed
|
|
197
|
-
or otherwise reachable from the repo (per `no-
|
|
197
|
+
or otherwise reachable from the repo (per `no-roadmap-references`,
|
|
198
|
+
council clause).
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agents-md-thin-root
|
|
3
|
+
description: "Use when editing AGENTS.md (package root) or templates/AGENTS.md (consumer) — enforces Thin-Root contract: hard char ceilings, ≥40% pointer ratio, mandatory emergency-triage block."
|
|
4
|
+
source: package
|
|
5
|
+
execution:
|
|
6
|
+
type: assisted
|
|
7
|
+
handler: internal
|
|
8
|
+
allowed_tools: []
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# agents-md-thin-root
|
|
12
|
+
|
|
13
|
+
## When to use
|
|
14
|
+
|
|
15
|
+
Use when:
|
|
16
|
+
- Editing `AGENTS.md` at the package root.
|
|
17
|
+
- Editing `.agent-src.uncompressed/templates/AGENTS.md` (consumer-shipped template).
|
|
18
|
+
- Reviewing a PR that changes either file.
|
|
19
|
+
- Running `/optimize/agents`.
|
|
20
|
+
- A budget meter (`scripts/measure_augment_budget.py`) flags the package-root AGENTS.md as the dominant cost.
|
|
21
|
+
|
|
22
|
+
## Do NOT
|
|
23
|
+
|
|
24
|
+
- Edit `.github/copilot-instructions.md` with this skill (use `copilot-agents-optimization` instead).
|
|
25
|
+
- Edit other `.md` files under `.augment/`, `.agent-src.uncompressed/`, or `agents/` with this skill.
|
|
26
|
+
- Add a section to AGENTS.md without first checking whether an outboard target already exists in `agents/contexts/` or `docs/contracts/`.
|
|
27
|
+
- 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.
|
|
28
|
+
- Reuse the package-root anatomy in the consumer template — caps and target paths differ.
|
|
29
|
+
|
|
30
|
+
## Why Thin-Root
|
|
31
|
+
|
|
32
|
+
Augment Code injects `AGENTS.md` verbatim into every workspace prompt. Each kilobyte spent here permanently consumes the 49,512-char workspace-guidelines budget shared with always-rules and auto-rule registry stubs. The Thin-Root pattern keeps the entry point a navigation surface (pointers + intent) and pushes deep detail into files Augment loads on demand via `load_context` or that other tools fetch only when their search retrieves them. Strategic council R2 (2026-05-08, Sonnet 4.5 / Opus 4.1 / gpt-4o / o1) converged on the contract codified below as the minimum guard against AGENTS.md re-bloat.
|
|
33
|
+
|
|
34
|
+
## The contract — hard caps
|
|
35
|
+
|
|
36
|
+
| File | FAIL above | WARN above | Target |
|
|
37
|
+
|---|---|---|---|
|
|
38
|
+
| `AGENTS.md` (package root) | 3,000 chars | 2,800 chars | ≤ 2,800 |
|
|
39
|
+
| `.agent-src.uncompressed/templates/AGENTS.md` (consumer) | 2,500 chars | 2,300 chars | ≤ 2,300 |
|
|
40
|
+
|
|
41
|
+
Char-count is raw file size (`wc -c`), frontmatter included. Enforcement: `scripts/lint_agents_md.py` (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.
|
|
42
|
+
|
|
43
|
+
The R2 council originally proposed 2,500 / 2,000 caps. Phase 6.4 empirical refactor demonstrated that the mandatory emergency-triage block (≈ 700 chars) plus operational must-haves (source-of-truth disclaimer, `task` quickstart, six substantive pointers) raise the achievable floor by ≈ 500 chars. The caps above are the post-refactor baseline; the previous numbers stayed unattainable without dropping mandatory content.
|
|
44
|
+
|
|
45
|
+
## The contract — pointer ratio
|
|
46
|
+
|
|
47
|
+
≥ 40 % of non-blank lines must be **substantive pointers**. A substantive pointer is a Markdown link `[label](path[#anchor])` whose surrounding sentence carries a *why* clause ≥ 60 chars explaining what the reader will learn there. Decorative links (table-of-contents, badges, repeated cross-refs) do not count. Lint formula:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
pointer_ratio = (substantive_pointer_lines / non_blank_lines) >= 0.40
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## The contract — pointer anatomy
|
|
54
|
+
|
|
55
|
+
Every substantive pointer specifies, on the same line or the immediately following line:
|
|
56
|
+
|
|
57
|
+
1. **Target file path** — repo-relative, no leading `./`.
|
|
58
|
+
2. **Optional anchor** — `#section-slug` when the linked file's content is large enough that landing in the middle saves the reader. Skip only when the linked file is itself short.
|
|
59
|
+
3. ***Why* clause** — ≥ 60 chars, present-tense, names the concrete decision the pointer unblocks. Not "see also", not "more info", not the file's title repeated.
|
|
60
|
+
|
|
61
|
+
### Wrong vs. right
|
|
62
|
+
|
|
63
|
+
❌ **Wrong** — bare link, no *why*, no anchor:
|
|
64
|
+
> See [`commit-policy`](.agent-src/rules/commit-policy.md).
|
|
65
|
+
|
|
66
|
+
❌ **Wrong** — *why* present but < 60 chars:
|
|
67
|
+
> Commit rules: [`commit-policy`](.agent-src/rules/commit-policy.md).
|
|
68
|
+
|
|
69
|
+
✅ **Right** — full anatomy, anchor, *why* ≥ 60 chars:
|
|
70
|
+
> Commit policy — never auto-commit, four named exceptions, Hard Floor list of bulk-deletion / infra triggers: [`commit-policy § Iron Law`](.agent-src/rules/commit-policy.md#the-iron-law).
|
|
71
|
+
|
|
72
|
+
✅ **Right** — anchor optional when target is short:
|
|
73
|
+
> Mirror the user's language every reply, single Iron Law that overrides any momentum: [`language-and-tone`](.agent-src/rules/language-and-tone.md).
|
|
74
|
+
|
|
75
|
+
## The contract — emergency-triage block
|
|
76
|
+
|
|
77
|
+
Every Thin-Root AGENTS.md MUST contain an **Emergency Triage** section verbatim from `.agent-src.uncompressed/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:
|
|
78
|
+
|
|
79
|
+
1. What is this repository?
|
|
80
|
+
2. What language(s) does this repository accept?
|
|
81
|
+
3. Where do I edit (source-of-truth path)?
|
|
82
|
+
4. What is the lint / test / sync entry point?
|
|
83
|
+
5. Where do the always-active behavior rules live?
|
|
84
|
+
|
|
85
|
+
Each answer must fit on one line. The block exists so the root never silently degrades to "useful only when every linked file is reachable".
|
|
86
|
+
|
|
87
|
+
## Procedure — apply Thin-Root to AGENTS.md
|
|
88
|
+
|
|
89
|
+
1. **Measure baseline.** `wc -c AGENTS.md` and `python3 scripts/measure_augment_budget.py`. Record current char-count and the gap to 2,200 / 2,500.
|
|
90
|
+
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).
|
|
91
|
+
3. **Identify outboard targets.** For each `outboard-candidate`, name the destination — `.agent-src.uncompressed/contexts/`, `docs/contracts/`, an existing rule body, an existing skill body. Never invent a new top-level directory.
|
|
92
|
+
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.
|
|
93
|
+
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.
|
|
94
|
+
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.
|
|
95
|
+
7. **Verify emergency-triage block.** Diff the in-file block against `.agent-src.uncompressed/contexts/contracts/emergency-triage-block.md`. Drift = revert to canonical.
|
|
96
|
+
8. **Run lints.** `task lint-agents-md && task check-refs && task lint-skills`. All green before commit.
|
|
97
|
+
|
|
98
|
+
## Procedure — apply Thin-Root to consumer template
|
|
99
|
+
|
|
100
|
+
Same procedure, applied to `.agent-src.uncompressed/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/contexts/`, ...), not this package's authoring tree.
|
|
101
|
+
|
|
102
|
+
## Gotchas
|
|
103
|
+
|
|
104
|
+
- **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 `.agent-src.uncompressed/contexts/`, `docs/contracts/`, an existing rule body, or an existing skill body.
|
|
105
|
+
- **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.
|
|
106
|
+
- **Emergency-triage drift.** Editing the in-file emergency-triage block instead of the canonical `.agent-src.uncompressed/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.
|
|
107
|
+
- **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.
|
|
108
|
+
- **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.
|
|
109
|
+
|
|
110
|
+
## Output format
|
|
111
|
+
|
|
112
|
+
When invoked as a planning step, produce:
|
|
113
|
+
|
|
114
|
+
1. Current size + gap to target (one line per file).
|
|
115
|
+
2. Inventory table (section, chars, keep-inline / outboard-candidate, target).
|
|
116
|
+
3. Pointer ratio before / after (predicted).
|
|
117
|
+
4. Specific outboarding edits as a numbered diff plan.
|
|
118
|
+
5. The four lint commands the agent must run before claiming completion.
|
|
119
|
+
|
|
120
|
+
## See also
|
|
121
|
+
|
|
122
|
+
- [`copilot-agents-optimization`](../copilot-agents-optimization/SKILL.md) — sibling skill for `.github/copilot-instructions.md`; runs alongside Thin-Root in `/optimize/agents`.
|
|
123
|
+
- [`agent-docs-writing`](../agent-docs-writing/SKILL.md) — broader documentation-structure context for navigating outboard targets.
|
|
124
|
+
- [`size-enforcement`](../../rules/size-enforcement.md) — covers per-skill / per-rule / per-command size budgets; AGENTS.md caps live in this skill instead.
|
|
125
|
+
- [`ADR-004-rule-governance-pruning`](../../../docs/decisions/ADR-004-rule-governance-pruning.md) — captures the rule-governance pruning that freed the workspace-guidelines budget; the Thin-Root caps build on that headroom.
|
|
@@ -235,9 +235,10 @@ durable contract lives in the roadmap / ADR / skill body that cites
|
|
|
235
235
|
the council's convergence inline.
|
|
236
236
|
|
|
237
237
|
**Linking to a specific council file is forbidden by
|
|
238
|
-
[`no-
|
|
239
|
-
gitignored, not in the cloned repo, gone after
|
|
240
|
-
Inline the convergence with date + members
|
|
238
|
+
[`no-roadmap-references`](../../rules/no-roadmap-references.md)
|
|
239
|
+
(council clause)** — gitignored, not in the cloned repo, gone after
|
|
240
|
+
the retention window. Inline the convergence with date + members
|
|
241
|
+
instead.
|
|
241
242
|
|
|
242
243
|
Three directories, three modes:
|
|
243
244
|
|
|
@@ -258,10 +259,11 @@ matching `road-to-<topic-slug>` roadmap under `agents/roadmaps/`).
|
|
|
258
259
|
- Any other directory below `agents/` (e.g. `agents/scratch/`,
|
|
259
260
|
`agents/tmp/`).
|
|
260
261
|
- Cross-references from any artefact to specific council files —
|
|
261
|
-
see [`no-
|
|
262
|
-
Inline the convergence summary instead, with
|
|
263
|
-
for traceability (`Council (claude-sonnet-4-5
|
|
264
|
-
reviewed N candidate strategies; converged
|
|
262
|
+
see [`no-roadmap-references`](../../rules/no-roadmap-references.md)
|
|
263
|
+
(council clause). Inline the convergence summary instead, with
|
|
264
|
+
date and member list for traceability (`Council (claude-sonnet-4-5
|
|
265
|
+
+ gpt-4o, YYYY-MM-DD) reviewed N candidate strategies; converged
|
|
266
|
+
on …`).
|
|
265
267
|
|
|
266
268
|
`scripts/check_council_layout.py` is the mechanical check for the
|
|
267
269
|
output path convention — wire it into the package's CI pipeline so
|
|
@@ -285,6 +285,15 @@ Decision: Create focused skill for Laravel route inspection via JSON and jq.
|
|
|
285
285
|
Learning: "I forgot to run PHPStan once."
|
|
286
286
|
Decision: No action — one-off, already covered by verify-before-complete rule.
|
|
287
287
|
|
|
288
|
+
Learning: "We re-invented a per-format PDF extractor in three different
|
|
289
|
+
analysis skills."
|
|
290
|
+
Decision: Update the affected skills to dispatch to
|
|
291
|
+
[`markitdown`](../markitdown/SKILL.md) instead of writing new
|
|
292
|
+
extractors. Non-text ingestion (PDF / DOCX / XLSX / PPTX / image /
|
|
293
|
+
audio) goes through the upstream `markitdown-mcp` server first; only
|
|
294
|
+
write a custom extractor if `markitdown` cannot handle the format and
|
|
295
|
+
the gap is documented in its skill body.
|
|
296
|
+
|
|
288
297
|
## Environment notes
|
|
289
298
|
|
|
290
299
|
Prefer updating existing rule/skill when possible.
|