@event4u/agent-config 1.29.0 → 1.31.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 (46) hide show
  1. package/.agent-src/commands/agents/audit.md +101 -197
  2. package/.agent-src/commands/{copilot-agents → agents}/init.md +18 -10
  3. package/.agent-src/commands/agents/optimize.md +181 -0
  4. package/.agent-src/commands/agents.md +19 -12
  5. package/.agent-src/commands/optimize/agents-dir.md +111 -0
  6. package/.agent-src/commands/optimize.md +10 -8
  7. package/.agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +6 -0
  8. package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +2 -3
  9. package/.agent-src/contexts/contracts/agents-md-anatomy.md +132 -0
  10. package/.agent-src/skills/agents-md-thin-root/SKILL.md +8 -1
  11. package/.agent-src/skills/command-writing/SKILL.md +49 -0
  12. package/.agent-src/skills/copilot-agents-optimization/SKILL.md +3 -3
  13. package/.agent-src/skills/error-handling-patterns/SKILL.md +2 -2
  14. package/.agent-src/skills/{repomix → repomix-packer}/SKILL.md +8 -8
  15. package/.agent-src/skills/roadmap-writing/SKILL.md +9 -0
  16. package/.agent-src/skills/rule-writing/SKILL.md +21 -0
  17. package/.agent-src/skills/skill-writing/SKILL.md +19 -0
  18. package/.agent-src/skills/testing-anti-patterns/SKILL.md +7 -0
  19. package/.agent-src/templates/AGENTS.md +9 -10
  20. package/.claude-plugin/marketplace.json +5 -8
  21. package/AGENTS.md +1 -2
  22. package/CHANGELOG.md +86 -0
  23. package/CONTRIBUTING.md +90 -0
  24. package/README.md +3 -3
  25. package/docs/architecture.md +2 -2
  26. package/docs/catalog.md +11 -13
  27. package/docs/contracts/command-clusters.md +20 -3
  28. package/docs/contracts/file-ownership-matrix.json +205 -56
  29. package/docs/getting-started.md +1 -1
  30. package/docs/guidelines/code-clarity.md +95 -0
  31. package/docs/guidelines/php/general.md +8 -0
  32. package/docs/guidelines/php/php-coding-patterns.md +1 -0
  33. package/docs/skills-catalog.md +27 -3
  34. package/llms.txt +26 -2
  35. package/package.json +1 -1
  36. package/scripts/chat_history.py +166 -36
  37. package/scripts/check_command_count_messaging.py +12 -3
  38. package/scripts/check_portability.py +1 -0
  39. package/scripts/lint_agents_md.py +33 -0
  40. package/scripts/release.py +77 -2
  41. package/scripts/skill_linter.py +10 -3
  42. package/.agent-src/commands/agents/cleanup.md +0 -194
  43. package/.agent-src/commands/agents/prepare.md +0 -141
  44. package/.agent-src/commands/copilot-agents/optimize.md +0 -255
  45. package/.agent-src/commands/copilot-agents.md +0 -44
  46. package/.agent-src/commands/optimize/agents.md +0 -144
@@ -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