@event4u/agent-config 1.29.0 → 1.32.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/agents/audit.md +101 -197
- package/.agent-src/commands/{copilot-agents → agents}/init.md +18 -10
- package/.agent-src/commands/agents/optimize.md +181 -0
- package/.agent-src/commands/agents.md +19 -12
- package/.agent-src/commands/optimize/agents-dir.md +111 -0
- package/.agent-src/commands/optimize.md +10 -8
- package/.agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +6 -0
- package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +2 -3
- package/.agent-src/contexts/contracts/agents-md-anatomy.md +132 -0
- package/.agent-src/skills/agents-md-thin-root/SKILL.md +8 -1
- package/.agent-src/skills/command-writing/SKILL.md +49 -0
- package/.agent-src/skills/copilot-agents-optimization/SKILL.md +3 -3
- package/.agent-src/skills/error-handling-patterns/SKILL.md +2 -2
- package/.agent-src/skills/feature-planning/SKILL.md +43 -7
- package/.agent-src/skills/judge-test-coverage/SKILL.md +4 -0
- package/.agent-src/skills/pest-testing/SKILL.md +13 -6
- package/.agent-src/skills/quality-tools/SKILL.md +4 -0
- package/.agent-src/skills/refine-prompt/SKILL.md +10 -0
- package/.agent-src/skills/refine-ticket/SKILL.md +12 -0
- package/.agent-src/skills/{repomix → repomix-packer}/SKILL.md +8 -8
- package/.agent-src/skills/roadmap-writing/SKILL.md +9 -0
- package/.agent-src/skills/rule-writing/SKILL.md +21 -0
- package/.agent-src/skills/skill-writing/SKILL.md +19 -0
- package/.agent-src/skills/subagent-orchestration/SKILL.md +77 -12
- package/.agent-src/skills/subagent-orchestration/prompts/README.md +29 -0
- package/.agent-src/skills/subagent-orchestration/prompts/do-and-judge-two-stage.md +121 -0
- package/.agent-src/skills/subagent-orchestration/prompts/do-and-judge.md +60 -0
- package/.agent-src/skills/subagent-orchestration/prompts/do-competitively.md +65 -0
- package/.agent-src/skills/subagent-orchestration/prompts/do-in-parallel.md +62 -0
- package/.agent-src/skills/subagent-orchestration/prompts/do-in-steps.md +62 -0
- package/.agent-src/skills/subagent-orchestration/prompts/do-in-worktrees.md +70 -0
- package/.agent-src/skills/subagent-orchestration/prompts/judge-with-debate.md +63 -0
- package/.agent-src/skills/subagent-orchestration/schemas/subagent-status.json +63 -0
- package/.agent-src/skills/test-driven-development/SKILL.md +25 -13
- package/.agent-src/skills/testing-anti-patterns/SKILL.md +14 -0
- package/.agent-src/skills/testing-anti-patterns/process-anti-patterns.md +67 -0
- package/.agent-src/templates/AGENTS.md +9 -10
- package/.claude-plugin/marketplace.json +5 -8
- package/AGENTS.md +1 -2
- package/CHANGELOG.md +110 -0
- package/CONTRIBUTING.md +90 -0
- package/README.md +3 -3
- package/docs/architecture.md +2 -2
- package/docs/catalog.md +12 -14
- package/docs/contracts/command-clusters.md +20 -3
- package/docs/contracts/file-ownership-matrix.json +546 -56
- package/docs/getting-started.md +1 -1
- package/docs/guidelines/code-clarity.md +95 -0
- package/docs/guidelines/php/general.md +8 -0
- package/docs/guidelines/php/php-coding-patterns.md +1 -0
- package/docs/skills-catalog.md +27 -3
- package/llms.txt +26 -2
- package/package.json +1 -1
- package/scripts/chat_history.py +166 -36
- package/scripts/check_bite_sized_granularity.py +99 -0
- package/scripts/check_command_count_messaging.py +12 -3
- package/scripts/check_portability.py +1 -0
- package/scripts/lint_agents_md.py +33 -0
- package/scripts/release.py +77 -2
- package/scripts/skill_linter.py +10 -3
- package/.agent-src/commands/agents/cleanup.md +0 -194
- package/.agent-src/commands/agents/prepare.md +0 -141
- package/.agent-src/commands/copilot-agents/optimize.md +0 -255
- package/.agent-src/commands/copilot-agents.md +0 -44
- package/.agent-src/commands/optimize/agents.md +0 -144
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: copilot-agents:optimize
|
|
3
|
-
cluster: copilot-agents
|
|
4
|
-
sub: optimize
|
|
5
|
-
description: Analyzes and refactors AGENTS.md and copilot-instructions.md — removes duplications, enforces line budgets, and ensures both files are optimized for their audience.
|
|
6
|
-
skills: [copilot-agents-optimization, copilot-config, agent-docs-writing]
|
|
7
|
-
disable-model-invocation: true
|
|
8
|
-
suggestion:
|
|
9
|
-
eligible: false
|
|
10
|
-
rationale: "Maintenance refactor; only when the maintainer chooses to run it."
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# /copilot-agents optimize
|
|
14
|
-
Analyzes and refactors `AGENTS.md` and `.github/copilot-instructions.md` against the `.augment/` ecosystem.
|
|
15
|
-
|
|
16
|
-
## Steps
|
|
17
|
-
|
|
18
|
-
### 1. Measure current state
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
wc -l AGENTS.md .github/copilot-instructions.md
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Report line counts with budget status:
|
|
25
|
-
|
|
26
|
-
| File | Lines | Budget | Status |
|
|
27
|
-
|---|---|---|---|
|
|
28
|
-
| `AGENTS.md` | {n} | ≤ 500 ideal, max 1000 | 🟢/🟡/🔴 |
|
|
29
|
-
| `copilot-instructions.md` | {n} | ≤ 500 ideal, max 1000 | 🟢/🟡/🔴 |
|
|
30
|
-
|
|
31
|
-
### 2. Scan for duplications
|
|
32
|
-
|
|
33
|
-
Read both files and compare against `.augment/` content:
|
|
34
|
-
|
|
35
|
-
**Check against rules:**
|
|
36
|
-
```bash
|
|
37
|
-
ls .augment/rules/*.md
|
|
38
|
-
```
|
|
39
|
-
For each rule, check if AGENTS.md or copilot-instructions.md duplicates its content.
|
|
40
|
-
|
|
41
|
-
**Check against guidelines:**
|
|
42
|
-
```bash
|
|
43
|
-
find .augment/guidelines/ -name '*.md'
|
|
44
|
-
```
|
|
45
|
-
For each guideline, check if either file repeats the same conventions.
|
|
46
|
-
|
|
47
|
-
**Check against skills:**
|
|
48
|
-
```bash
|
|
49
|
-
ls .augment/skills/*/SKILL.md
|
|
50
|
-
```
|
|
51
|
-
For each skill, check if either file contains domain knowledge that belongs in the skill.
|
|
52
|
-
|
|
53
|
-
**Check between the two files:**
|
|
54
|
-
Compare sections — anything duplicated between AGENTS.md and copilot-instructions.md
|
|
55
|
-
that isn't required for Copilot's self-containment.
|
|
56
|
-
|
|
57
|
-
### 2.5. Scan for legacy identifiers and stack mismatches
|
|
58
|
-
|
|
59
|
-
Before deduplicating, verify the content still **applies to the current
|
|
60
|
-
project**. Files drift in three ways:
|
|
61
|
-
|
|
62
|
-
- **Legacy leakage** — identifiers from a former, forked, or adjacent
|
|
63
|
-
project (renamed repo, split monorepo, content copied from a sibling).
|
|
64
|
-
- **Stack mismatch** — the file claims tech the project no longer uses
|
|
65
|
-
(e.g. "Laravel 11 + MariaDB" in a repo that is now a pure Python
|
|
66
|
-
library).
|
|
67
|
-
- **Dead commands** — Make targets, Artisan commands, docker services
|
|
68
|
-
that no longer exist.
|
|
69
|
-
|
|
70
|
-
**A. Legacy-identifier scan**
|
|
71
|
-
|
|
72
|
-
Use the package's portability blocklist as the baseline:
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
python3 -c "import sys; sys.path.insert(0, 'scripts'); \
|
|
76
|
-
from check_portability import FORBIDDEN_IDENTIFIERS; \
|
|
77
|
-
[print(i) for i in FORBIDDEN_IDENTIFIERS]" 2>/dev/null
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
Plus any identifier from `agents/` module docs that does NOT match the
|
|
81
|
-
current project name (see step 2.5.B to determine the current project).
|
|
82
|
-
|
|
83
|
-
For each identifier, grep both files and report **every** hit:
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
for ident in "${forbidden_identifiers[@]}"; do
|
|
87
|
-
grep -n -iE "\b${ident}\b" AGENTS.md .github/copilot-instructions.md
|
|
88
|
-
done
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Every hit is a 🔴 **blocker** — these must be fixed or removed before any
|
|
92
|
-
other optimization. Leaking another project's name into the consumer's
|
|
93
|
-
own docs is the failure mode that made this step exist.
|
|
94
|
-
|
|
95
|
-
**B. Stack-coherence scan**
|
|
96
|
-
|
|
97
|
-
Auto-detect the real stack (same logic as `/copilot-agents-init` step 2):
|
|
98
|
-
|
|
99
|
-
| Source file | Signal |
|
|
100
|
-
|---|---|
|
|
101
|
-
| `composer.json` | PHP, Laravel/Symfony, package name, PHP version |
|
|
102
|
-
| `package.json` | Node, Next.js/React/Vue, engines |
|
|
103
|
-
| `pyproject.toml` / `requirements.txt` | Python + framework |
|
|
104
|
-
| `Gemfile` | Ruby on Rails |
|
|
105
|
-
| `go.mod`, `Cargo.toml`, `pom.xml`, `build.gradle` | Language |
|
|
106
|
-
| `docker-compose.yml` | Service names actually used |
|
|
107
|
-
| `Makefile` / `Taskfile.yml` / `package.json` scripts | Dev commands |
|
|
108
|
-
|
|
109
|
-
Compare each claim in AGENTS.md / copilot-instructions.md against the
|
|
110
|
-
detected stack. Flag mismatches:
|
|
111
|
-
|
|
112
|
-
| Claim in doc | Reality | Severity |
|
|
113
|
-
|---|---|---|
|
|
114
|
-
| "Laravel 11" | no `laravel/framework` in composer.json | 🔴 |
|
|
115
|
-
| "MariaDB" | no DB driver or docker service | 🟡 |
|
|
116
|
-
| service name `db` | `docker-compose.yml` has `mariadb` only | 🟡 |
|
|
117
|
-
| `make start` | `Makefile` absent OR target missing | 🔴 |
|
|
118
|
-
| "PHP 8.2" | `composer.json` requires `^8.1` | 🟡 |
|
|
119
|
-
|
|
120
|
-
**C. Dead-command scan**
|
|
121
|
-
|
|
122
|
-
Extract every invoked command from both files:
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
grep -oE '(make|task|composer|npm|pnpm|yarn|php artisan|python|./)[a-zA-Z0-9 _:./-]+' \
|
|
126
|
-
AGENTS.md .github/copilot-instructions.md | sort -u
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
For each hit, verify it exists:
|
|
130
|
-
|
|
131
|
-
- `make X` → `grep -q "^${X}:" Makefile`
|
|
132
|
-
- `task X` → `task --list-all` contains X
|
|
133
|
-
- `composer X` → `composer.json` `scripts` contains X
|
|
134
|
-
- `php artisan X` → `php artisan list --no-ansi` contains X (skip if no
|
|
135
|
-
container — just note "unverified")
|
|
136
|
-
- `npm/pnpm/yarn X` → `package.json` `scripts` contains X
|
|
137
|
-
|
|
138
|
-
Commands that no longer resolve are 🟡 stale — propose a replacement or
|
|
139
|
-
removal.
|
|
140
|
-
|
|
141
|
-
### 3. Present findings
|
|
142
|
-
|
|
143
|
-
Show a table of issues found, **grouped by severity**. Blockers from
|
|
144
|
-
step 2.5 come first:
|
|
145
|
-
|
|
146
|
-
| # | File | Section | Issue | Severity | Action |
|
|
147
|
-
|---|---|---|---|---|---|
|
|
148
|
-
| 1 | AGENTS.md | "Quick Setup" | Mentions a forbidden identifier from the blocklist | 🔴 | Replace or remove |
|
|
149
|
-
| 2 | copilot | "Tech stack" | Claims Laravel 11, project is Python | 🔴 | Full rewrite |
|
|
150
|
-
| 3 | AGENTS.md | "Commands" | `make start` target not in Makefile | 🟡 | Update or remove |
|
|
151
|
-
| 4 | AGENTS.md | "Coding Standards" | Duplicates `.augment/rules/php-coding.md` | 🟢 | Remove, add reference |
|
|
152
|
-
| 5 | copilot | "SOLID Principles" | Duplicates `.augment/rules/architecture.md` | 🟢 | Keep (Copilot needs it) |
|
|
153
|
-
| 6 | copilot | "Trailing commas" | Auto-enforced by ECS | 🟢 | Remove |
|
|
154
|
-
|
|
155
|
-
Classify each issue:
|
|
156
|
-
|
|
157
|
-
| Action | Meaning |
|
|
158
|
-
|---|---|
|
|
159
|
-
| **Replace** | Legacy identifier → swap for the correct current name |
|
|
160
|
-
| **Rewrite** | Entire section no longer matches reality — rewrite from stack detection |
|
|
161
|
-
| **Remove** | Content exists in `.augment/` and the file can reference it, or command is dead |
|
|
162
|
-
| **Keep** | Content is needed self-contained (copilot-instructions.md) |
|
|
163
|
-
| **Compress** | Content is valid but too verbose — shorten |
|
|
164
|
-
| **Extract** | Move to a dedicated file in `agents/` and link |
|
|
165
|
-
| **Update** | Content is outdated or references have changed |
|
|
166
|
-
|
|
167
|
-
If the 🔴 blockers exceed a reasonable rewrite effort (e.g. the entire
|
|
168
|
-
"Tech stack" and "Commands" sections are wrong), offer
|
|
169
|
-
`/copilot-agents-init` as an alternative instead of patching in place:
|
|
170
|
-
|
|
171
|
-
> ⚠️ Detected severe drift: {N} blockers, including a completely wrong
|
|
172
|
-
> tech stack.
|
|
173
|
-
>
|
|
174
|
-
> 1. Continue optimizing (patch in place — may require large rewrites)
|
|
175
|
-
> 2. Back up current files and run `/copilot-agents-init` for a clean scaffold
|
|
176
|
-
> 3. Abort
|
|
177
|
-
|
|
178
|
-
### 4. Ask for confirmation
|
|
179
|
-
|
|
180
|
-
> Found {n} optimizations:
|
|
181
|
-
> - {x} duplicates to remove (AGENTS.md)
|
|
182
|
-
> - {y} sections to compress
|
|
183
|
-
> - {z} sections to extract to `agents/`
|
|
184
|
-
>
|
|
185
|
-
> 1. Apply all changes
|
|
186
|
-
> 2. Confirm each change individually
|
|
187
|
-
> 3. Only optimize AGENTS.md
|
|
188
|
-
> 4. Only optimize copilot-instructions.md
|
|
189
|
-
|
|
190
|
-
### 5. Apply changes
|
|
191
|
-
|
|
192
|
-
For each approved change:
|
|
193
|
-
|
|
194
|
-
1. **Remove duplicates** — Delete the section, add a reference line if needed
|
|
195
|
-
2. **Compress** — Rewrite verbose sections as concise tables/bullets
|
|
196
|
-
3. **Extract** — Create file in `agents/`, move content, add link in original
|
|
197
|
-
4. **Update** — Fix outdated references, paths, or descriptions
|
|
198
|
-
|
|
199
|
-
After each file is modified, verify:
|
|
200
|
-
- Line count is within budget
|
|
201
|
-
- No broken references
|
|
202
|
-
- Self-containment preserved for copilot-instructions.md
|
|
203
|
-
|
|
204
|
-
### 6. Verify cross-references
|
|
205
|
-
|
|
206
|
-
Check that all references in both files are valid:
|
|
207
|
-
|
|
208
|
-
```bash
|
|
209
|
-
# Find all markdown links in both files
|
|
210
|
-
grep -oE '\[.*\]\(.*\)' AGENTS.md .github/copilot-instructions.md
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
For each link, verify the target file exists.
|
|
214
|
-
|
|
215
|
-
### 7. Report results
|
|
216
|
-
|
|
217
|
-
> ✅ Optimization complete:
|
|
218
|
-
>
|
|
219
|
-
> | File | Before | After | Δ |
|
|
220
|
-
> |---|---|---|---|
|
|
221
|
-
> | `AGENTS.md` | {old} lines | {new} lines | -{diff} |
|
|
222
|
-
> | `copilot-instructions.md` | {old} lines | {new} lines | -{diff} |
|
|
223
|
-
>
|
|
224
|
-
> **Removed duplicates:** {n}
|
|
225
|
-
> **Compressed sections:** {n}
|
|
226
|
-
> **Extracted content:** {n} (to `agents/`)
|
|
227
|
-
|
|
228
|
-
### 8. Suggest follow-ups
|
|
229
|
-
|
|
230
|
-
If issues were found that need manual attention:
|
|
231
|
-
|
|
232
|
-
> ⚠️ Manual review recommended:
|
|
233
|
-
> - {issue description}
|
|
234
|
-
|
|
235
|
-
If `.augment/` content is missing that both files reference:
|
|
236
|
-
|
|
237
|
-
> 💡 Missing `.augment/` content:
|
|
238
|
-
> - {missing skill/rule/guideline}
|
|
239
|
-
|
|
240
|
-
## Rules
|
|
241
|
-
|
|
242
|
-
- **Step 2.5 is mandatory.** Never skip the portability + stack scan —
|
|
243
|
-
that is the step that catches the "legacy identifier from another
|
|
244
|
-
project" failure mode. Duplication cleanup without this scan means the
|
|
245
|
-
command approves stale, wrong content.
|
|
246
|
-
- **🔴 blockers are fixed first.** Don't deduplicate a section that is
|
|
247
|
-
about to be rewritten anyway.
|
|
248
|
-
- **NEVER strip strong language** — "Do NOT", "NEVER", "MUST" are load-bearing words.
|
|
249
|
-
See the Iron Laws in `/optimize-agents` — they apply here too.
|
|
250
|
-
- **NEVER remove examples** from `copilot-instructions.md` — Copilot Code Review cannot
|
|
251
|
-
read other files, so examples must be self-contained.
|
|
252
|
-
- **`copilot-instructions.md` MUST remain self-contained** — it cannot reference `.augment/`
|
|
253
|
-
files because Copilot Code Review has no access to them. Only Copilot Chat can read other files.
|
|
254
|
-
- **`AGENTS.md` MAY reference `.augment/`** — it is read by tools that can follow links.
|
|
255
|
-
- **Ask before removing** — present findings first, apply after approval.
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: copilot-agents
|
|
3
|
-
description: Copilot agents-doc orchestrator — routes to init, optimize
|
|
4
|
-
cluster: copilot-agents
|
|
5
|
-
disable-model-invocation: true
|
|
6
|
-
suggestion:
|
|
7
|
-
eligible: true
|
|
8
|
-
trigger_description: "create AGENTS.md, optimize copilot-instructions.md, scaffold copilot agent docs"
|
|
9
|
-
trigger_context: "user wants to author or tune AGENTS.md / copilot-instructions.md"
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# /copilot-agents
|
|
13
|
-
|
|
14
|
-
Top-level orchestrator for the `/copilot-agents` family. Replaces 2
|
|
15
|
-
standalone commands with a single entry point + sub-command dispatch.
|
|
16
|
-
|
|
17
|
-
## Sub-commands
|
|
18
|
-
|
|
19
|
-
| Sub-command | Routes to | Purpose |
|
|
20
|
-
|---|---|---|
|
|
21
|
-
| `/copilot-agents init` | `commands/copilot-agents/init.md` | Create AGENTS.md and `.github/copilot-instructions.md` from scratch |
|
|
22
|
-
| `/copilot-agents optimize` | `commands/copilot-agents/optimize.md` | Refactor existing AGENTS.md and copilot-instructions.md for line budgets |
|
|
23
|
-
|
|
24
|
-
Sub-command names match the locked contract in
|
|
25
|
-
[`docs/contracts/command-clusters.md`](../docs/contracts/command-clusters.md).
|
|
26
|
-
|
|
27
|
-
## Dispatch
|
|
28
|
-
|
|
29
|
-
1. Parse the user's argument: `/copilot-agents <sub-command> [args]`.
|
|
30
|
-
2. Look up the sub-command in the table above.
|
|
31
|
-
3. Load the body of the routed file and follow its `## Instructions` section
|
|
32
|
-
verbatim with the remaining args.
|
|
33
|
-
4. If the sub-command is unknown or missing, print the table above and ask:
|
|
34
|
-
|
|
35
|
-
> 1. init — scaffold AGENTS.md + copilot-instructions.md from scratch
|
|
36
|
-
> 2. optimize — refactor existing files for budget and audience
|
|
37
|
-
|
|
38
|
-
## Rules
|
|
39
|
-
|
|
40
|
-
- **Do NOT commit, push, or open a PR** unless the sub-command explicitly
|
|
41
|
-
authorizes it.
|
|
42
|
-
- **Do NOT chain sub-commands.** One `/copilot-agents <sub>` per turn.
|
|
43
|
-
- If the user invokes `/copilot-agents` with no argument, **show the
|
|
44
|
-
menu** — do not guess which sub-command they meant.
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: optimize:agents
|
|
3
|
-
cluster: optimize
|
|
4
|
-
sub: agents
|
|
5
|
-
description: Audits agent infrastructure — measures token overhead, checks rule triggers, verifies AGENTS.md. Suggest only, never auto-apply.
|
|
6
|
-
skills: [copilot-agents-optimization, agents-audit, agent-docs-writing, quality-tools]
|
|
7
|
-
disable-model-invocation: true
|
|
8
|
-
suggestion:
|
|
9
|
-
eligible: true
|
|
10
|
-
trigger_description: "audit agent infrastructure, tune the agent setup"
|
|
11
|
-
trigger_context: "maintainer working on .augment/ files"
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
# /optimize agents
|
|
15
|
-
Agent infrastructure audit: measure token overhead, check rule triggers, verify AGENTS.md, find stale references. **Suggest only — never auto-apply.**
|
|
16
|
-
|
|
17
|
-
**Source of truth:** `.agent-src.uncompressed/` — never read or edit `.agent-src/` or `.augment/` directly.
|
|
18
|
-
|
|
19
|
-
## Steps
|
|
20
|
-
|
|
21
|
-
### 1. Measure baseline
|
|
22
|
-
|
|
23
|
-
Count lines affecting token consumption:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
# Always-loaded (per chat)
|
|
27
|
-
for f in .agent-src.uncompressed/rules/*.md; do
|
|
28
|
-
type=$(head -5 "$f" | grep 'type:' | sed 's/.*"\(.*\)"/\1/')
|
|
29
|
-
[ "$type" = "auto" ] && continue
|
|
30
|
-
lines=$(wc -l < "$f"); echo "always | $lines | $(basename "$f")"
|
|
31
|
-
done | sort -t'|' -k2 -rn
|
|
32
|
-
agents=$(wc -l < AGENTS.md); echo "always | $agents | AGENTS.md"
|
|
33
|
-
|
|
34
|
-
# Auto-loaded rules
|
|
35
|
-
for f in .agent-src.uncompressed/rules/*.md; do
|
|
36
|
-
type=$(head -5 "$f" | grep 'type:' | sed 's/.*"\(.*\)"/\1/')
|
|
37
|
-
[ "$type" != "auto" ] && continue
|
|
38
|
-
lines=$(wc -l < "$f"); echo "auto | $lines | $(basename "$f")"
|
|
39
|
-
done | sort -t'|' -k2 -rn
|
|
40
|
-
|
|
41
|
-
# Skills (top 20 by size)
|
|
42
|
-
for f in .agent-src.uncompressed/skills/*/SKILL.md; do
|
|
43
|
-
name=$(echo "$f" | sed 's|.agent-src.uncompressed/skills/||;s|/SKILL.md||')
|
|
44
|
-
lines=$(wc -l < "$f"); echo "$lines | $name"
|
|
45
|
-
done | sort -rn | head -20
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Report totals:
|
|
49
|
-
|
|
50
|
-
| Category | Files | Lines |
|
|
51
|
-
|---|---|---|
|
|
52
|
-
| Always-loaded rules + AGENTS.md | {n} | {n} |
|
|
53
|
-
| Auto-loaded rules | {n} | {n} |
|
|
54
|
-
| Skills (total) | {n} | {n} |
|
|
55
|
-
| **TOTAL** | {n} | {n} |
|
|
56
|
-
|
|
57
|
-
### 2. Check rules
|
|
58
|
-
|
|
59
|
-
- **Frontmatter**: `type: "always"` or `type: "auto"` with `description`?
|
|
60
|
-
- **Duplicate triggers**: Same `description` → both load simultaneously
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
for f in .agent-src.uncompressed/rules/*.md; do
|
|
64
|
-
desc=$(head -5 "$f" | grep 'description:' | sed 's/.*"\(.*\)"/\1/')
|
|
65
|
-
[ -n "$desc" ] && echo "$desc | $(basename "$f")"
|
|
66
|
-
done | sort | awk -F' \\| ' '{descs[$1]=descs[$1] " " $2} END {for (d in descs) {n=split(descs[d], a, " "); if (n>1) print "⚠️ " d " →" descs[d]}}'
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
- **Redundancy**: Duplicates between rules, AGENTS.md, skills?
|
|
70
|
-
- **Merge candidates**: Small rules (< 15 lines) that belong elsewhere?
|
|
71
|
-
|
|
72
|
-
### 3. Check always → auto candidates
|
|
73
|
-
|
|
74
|
-
Apply the `rule-type-governance` rule criteria:
|
|
75
|
-
|
|
76
|
-
1. Does it apply to EVERY conversation? → keep `always`
|
|
77
|
-
2. Can it be triggered by a specific topic? → candidate for `auto`
|
|
78
|
-
3. Is it a core behavior constraint (scope-control, verify-before-complete, token-efficiency)? → **NEVER change to auto**
|
|
79
|
-
|
|
80
|
-
**Decision test:** "Does this rule need to be active when the user asks a simple question, reviews a PR, or discusses architecture?" No → `auto`.
|
|
81
|
-
|
|
82
|
-
**Safety gate for always → auto:**
|
|
83
|
-
|
|
84
|
-
- [ ] Rule is NOT a core behavior constraint
|
|
85
|
-
- [ ] A clear, specific trigger description exists
|
|
86
|
-
- [ ] The trigger won't miss conversations where the rule matters
|
|
87
|
-
|
|
88
|
-
Present candidates with explicit justification. **Never auto-apply.**
|
|
89
|
-
|
|
90
|
-
### 4. Check AGENTS.md + copilot-instructions.md
|
|
91
|
-
|
|
92
|
-
- **Budget**: AGENTS.md target ≤800 words (max ~1200). copilot-instructions.md < 60 lines (max ~150).
|
|
93
|
-
See `docs/guidelines/agent-infra/size-and-scope.md` for all limits.
|
|
94
|
-
- **Quality**: Dev Setup, Testing, Quality Tools need full detail — don't compress to one-liners
|
|
95
|
-
- **Duplication**: only word-for-word identical. Summary + detail = layered context, NOT duplication
|
|
96
|
-
- **Freshness**: paths, commands, references match reality?
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
lines=$(wc -l < AGENTS.md); bytes=$(wc -c < AGENTS.md)
|
|
100
|
-
echo "AGENTS.md: $lines lines, $bytes bytes (~$((bytes / 4)) tokens)"
|
|
101
|
-
[ "$lines" -gt 300 ] && echo "⚠️ Over 300-line target (review size-and-scope guideline)"
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### 5. Check docs sync
|
|
105
|
-
|
|
106
|
-
Counts and lists in `contexts/augment-infrastructure.md` correct?
|
|
107
|
-
|
|
108
|
-
### 6. Run linters
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
python3 scripts/skill_linter.py --all --pairs --duplicates 2>&1 | grep "Summary:"
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Report FAIL/WARN counts. Do NOT fix here — delegate to linter/skill-reviewer.
|
|
115
|
-
|
|
116
|
-
### 7. Present findings
|
|
117
|
-
|
|
118
|
-
| # | Category | Finding | Impact | Suggestion |
|
|
119
|
-
|---|---|---|---|---|
|
|
120
|
-
| 1 | Rule | `{name}` duplicate trigger | Both load simultaneously | Fix trigger description |
|
|
121
|
-
| 2 | Rule | `{name}` could be `auto` | ~{n} lines saved/chat | Switch (with safety gate) |
|
|
122
|
-
| ... | | | | |
|
|
123
|
-
|
|
124
|
-
Ask the user:
|
|
125
|
-
|
|
126
|
-
```
|
|
127
|
-
> 1. Go through suggestions one by one
|
|
128
|
-
> 2. Apply only high-impact changes (saves > 50 lines)
|
|
129
|
-
> 3. Skip — report only
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
## Preservation gate — MANDATORY before any change
|
|
133
|
-
|
|
134
|
-
- [ ] Does a rule lose strong enforcement language? → **REJECT**
|
|
135
|
-
- [ ] Does a rule lose a concrete example? → **REJECT**
|
|
136
|
-
- [ ] Does an always → auto switch risk missing relevant conversations? → **REJECT**
|
|
137
|
-
- [ ] Does the linter still pass after the change? → **REJECT if FAIL**
|
|
138
|
-
|
|
139
|
-
## What this command does NOT do
|
|
140
|
-
|
|
141
|
-
- **No quality judgments on skills** — use `/optimize-skills` or `skill-reviewer`
|
|
142
|
-
- **No auto-fixes** — all changes require explicit user approval
|
|
143
|
-
- **No "make it shorter"** — compression is done by Caveman Compression
|
|
144
|
-
- **No edits to `.agent-src/` or `.augment/`** — always edit `.agent-src.uncompressed/`, then sync
|