@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.
Files changed (65) 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/feature-planning/SKILL.md +43 -7
  15. package/.agent-src/skills/judge-test-coverage/SKILL.md +4 -0
  16. package/.agent-src/skills/pest-testing/SKILL.md +13 -6
  17. package/.agent-src/skills/quality-tools/SKILL.md +4 -0
  18. package/.agent-src/skills/refine-prompt/SKILL.md +10 -0
  19. package/.agent-src/skills/refine-ticket/SKILL.md +12 -0
  20. package/.agent-src/skills/{repomix → repomix-packer}/SKILL.md +8 -8
  21. package/.agent-src/skills/roadmap-writing/SKILL.md +9 -0
  22. package/.agent-src/skills/rule-writing/SKILL.md +21 -0
  23. package/.agent-src/skills/skill-writing/SKILL.md +19 -0
  24. package/.agent-src/skills/subagent-orchestration/SKILL.md +77 -12
  25. package/.agent-src/skills/subagent-orchestration/prompts/README.md +29 -0
  26. package/.agent-src/skills/subagent-orchestration/prompts/do-and-judge-two-stage.md +121 -0
  27. package/.agent-src/skills/subagent-orchestration/prompts/do-and-judge.md +60 -0
  28. package/.agent-src/skills/subagent-orchestration/prompts/do-competitively.md +65 -0
  29. package/.agent-src/skills/subagent-orchestration/prompts/do-in-parallel.md +62 -0
  30. package/.agent-src/skills/subagent-orchestration/prompts/do-in-steps.md +62 -0
  31. package/.agent-src/skills/subagent-orchestration/prompts/do-in-worktrees.md +70 -0
  32. package/.agent-src/skills/subagent-orchestration/prompts/judge-with-debate.md +63 -0
  33. package/.agent-src/skills/subagent-orchestration/schemas/subagent-status.json +63 -0
  34. package/.agent-src/skills/test-driven-development/SKILL.md +25 -13
  35. package/.agent-src/skills/testing-anti-patterns/SKILL.md +14 -0
  36. package/.agent-src/skills/testing-anti-patterns/process-anti-patterns.md +67 -0
  37. package/.agent-src/templates/AGENTS.md +9 -10
  38. package/.claude-plugin/marketplace.json +5 -8
  39. package/AGENTS.md +1 -2
  40. package/CHANGELOG.md +110 -0
  41. package/CONTRIBUTING.md +90 -0
  42. package/README.md +3 -3
  43. package/docs/architecture.md +2 -2
  44. package/docs/catalog.md +12 -14
  45. package/docs/contracts/command-clusters.md +20 -3
  46. package/docs/contracts/file-ownership-matrix.json +546 -56
  47. package/docs/getting-started.md +1 -1
  48. package/docs/guidelines/code-clarity.md +95 -0
  49. package/docs/guidelines/php/general.md +8 -0
  50. package/docs/guidelines/php/php-coding-patterns.md +1 -0
  51. package/docs/skills-catalog.md +27 -3
  52. package/llms.txt +26 -2
  53. package/package.json +1 -1
  54. package/scripts/chat_history.py +166 -36
  55. package/scripts/check_bite_sized_granularity.py +99 -0
  56. package/scripts/check_command_count_messaging.py +12 -3
  57. package/scripts/check_portability.py +1 -0
  58. package/scripts/lint_agents_md.py +33 -0
  59. package/scripts/release.py +77 -2
  60. package/scripts/skill_linter.py +10 -3
  61. package/.agent-src/commands/agents/cleanup.md +0 -194
  62. package/.agent-src/commands/agents/prepare.md +0 -141
  63. package/.agent-src/commands/copilot-agents/optimize.md +0 -255
  64. package/.agent-src/commands/copilot-agents.md +0 -44
  65. package/.agent-src/commands/optimize/agents.md +0 -144
@@ -319,8 +319,15 @@ def render_changelog_entry(
319
319
  prev: str | None,
320
320
  commits: list[Commit],
321
321
  today: str,
322
+ *,
323
+ test_trend_line: str | None = None,
322
324
  ) -> tuple[str, str]:
323
- """Return (heading-aware full entry, body-only for GitHub Release notes)."""
325
+ """Return (heading-aware full entry, body-only for GitHub Release notes).
326
+
327
+ ``test_trend_line`` — optional pre-computed ``Tests: N (+M …)`` footer
328
+ (road-to-feedback-followups P3.2). Computed by the caller so tests
329
+ don't trigger a recursive pytest collection.
330
+ """
324
331
  if prev:
325
332
  heading = (
326
333
  f"## [{version}](https://github.com/{REPO_SLUG}/compare/"
@@ -364,6 +371,12 @@ def render_changelog_entry(
364
371
  for c in other:
365
372
  body_lines.append(_changelog_line(c))
366
373
 
374
+ # Test-count trend footer (road-to-feedback-followups P3.2). Silent
375
+ # on errors — never a release blocker.
376
+ if test_trend_line:
377
+ body_lines.append("")
378
+ body_lines.append(test_trend_line)
379
+
367
380
  body = "\n".join(body_lines).lstrip("\n")
368
381
  full = heading + "\n\n" + body + "\n"
369
382
  return full, body
@@ -376,6 +389,65 @@ def _changelog_line(c: Commit) -> str:
376
389
  return f"* {scope}{c.subject} ([{short}]({link}))"
377
390
 
378
391
 
392
+ # ─── test-count trend (road-to-feedback-followups P3.2) ───────────────────────
393
+
394
+ _TEST_COUNT_LINE_RE = re.compile(r"^Tests:\s+(\d+)", re.MULTILINE)
395
+ _PYTEST_COLLECTED_RE = re.compile(r"^(\d+)\s+tests?\s+collected", re.MULTILINE)
396
+
397
+
398
+ def _count_tests_current() -> int | None:
399
+ """Return the count from `pytest --collect-only -q` on the current
400
+ tree. Returns None when pytest isn't available or collection fails —
401
+ the trend line is informational, never a release blocker.
402
+ """
403
+ try:
404
+ result = subprocess.run(
405
+ ["python3", "-m", "pytest", "--collect-only", "-q"],
406
+ cwd=str(REPO_ROOT),
407
+ capture_output=True,
408
+ text=True,
409
+ timeout=120,
410
+ )
411
+ except (FileNotFoundError, subprocess.TimeoutExpired):
412
+ return None
413
+ if result.returncode != 0:
414
+ return None
415
+ match = _PYTEST_COLLECTED_RE.search(result.stdout)
416
+ return int(match.group(1)) if match else None
417
+
418
+
419
+ def _previous_test_count_from_changelog(prev_tag: str | None) -> int | None:
420
+ """Read CHANGELOG.md and return the most recent ``Tests: N`` footer
421
+ under the ``prev_tag`` heading, or None when not found.
422
+ """
423
+ if not prev_tag or not CHANGELOG.exists():
424
+ return None
425
+ text = CHANGELOG.read_text(encoding="utf-8")
426
+ heading_re = re.compile(rf"^##\s+\[?{re.escape(prev_tag)}\b", re.MULTILINE)
427
+ m = heading_re.search(text)
428
+ if not m:
429
+ return None
430
+ next_heading = re.search(r"^##\s+\[?\d+\.\d+\.\d+", text[m.end():], re.MULTILINE)
431
+ section = text[m.end(): m.end() + (next_heading.start() if next_heading else len(text))]
432
+ count_match = _TEST_COUNT_LINE_RE.search(section)
433
+ return int(count_match.group(1)) if count_match else None
434
+
435
+
436
+ def _render_test_trend_line(prev_tag: str | None) -> str | None:
437
+ """Return the ``Tests: N (+M since X.Y.Z)`` footer line, or None when
438
+ the current count cannot be determined. Silent on collection errors.
439
+ """
440
+ current = _count_tests_current()
441
+ if current is None:
442
+ return None
443
+ previous = _previous_test_count_from_changelog(prev_tag)
444
+ if previous is None or not prev_tag:
445
+ return f"Tests: {current}"
446
+ delta = current - previous
447
+ sign = "+" if delta >= 0 else ""
448
+ return f"Tests: {current} ({sign}{delta} since {prev_tag})"
449
+
450
+
379
451
  def prepend_changelog(path: Path, entry: str) -> None:
380
452
  """Insert `entry` directly above the most recent `## [` heading."""
381
453
  text = path.read_text(encoding="utf-8")
@@ -787,7 +859,10 @@ def main(argv: list[str] | None = None) -> int:
787
859
  preflight(target, resume=args.resume)
788
860
 
789
861
  today = _date.today().isoformat()
790
- full, body = render_changelog_entry(target, prev, commits, today)
862
+ test_trend_line = _render_test_trend_line(prev)
863
+ full, body = render_changelog_entry(
864
+ target, prev, commits, today, test_trend_line=test_trend_line
865
+ )
791
866
  plan = Plan(
792
867
  current=current,
793
868
  target=target,
@@ -1291,12 +1291,19 @@ def lint_command(path: Path, text: str) -> LintResult:
1291
1291
  if not H1_PATTERN.search(text):
1292
1292
  issues.append(Issue("error", "missing_h1", "Command is missing an H1 heading (# Title)"))
1293
1293
 
1294
- # Must have at least one ## section with steps
1294
+ # Must have at least one ## section with steps. Cluster-head and
1295
+ # router-style commands (frontmatter cluster:/routes_to: or ≥ 3 .md
1296
+ # links) are exempt — they delegate procedure to sub-commands or
1297
+ # skills (road-to-feedback-followups P2.1).
1295
1298
  sections = extract_sections(text)
1296
1299
  has_steps = any(s.lower().startswith("step") for s in sections)
1297
- has_numbered = bool(re.search(r"^###?\s+\d+\.\s+", text, re.MULTILINE))
1300
+ # Accept both ``## 1.`` / ``### 1.`` numbered headings AND
1301
+ # ``### Step N`` / ``## Step N`` step-prefixed sub-headings.
1302
+ has_numbered = bool(re.search(r"^###?\s+(?:\d+\.|step\s+\d+)\s+", text, re.MULTILINE | re.IGNORECASE))
1298
1303
  if not has_steps and not has_numbered:
1299
- issues.append(Issue("warning", "no_steps", "Command has no Steps section or numbered sub-headings"))
1304
+ delegated = _command_delegation_signal(text, frontmatter)
1305
+ if not delegated:
1306
+ issues.append(Issue("warning", "no_steps", "Command has no Steps section or numbered sub-headings"))
1300
1307
 
1301
1308
  # --- Size check (docs/contracts/linter-structural-model.md) ---
1302
1309
  # Structural-density gate replaces sub-section + code-block heuristic
@@ -1,194 +0,0 @@
1
- ---
2
- name: agents:cleanup
3
- cluster: agents
4
- sub: cleanup
5
- skills: [agent-docs-writing]
6
- description: Execute cleanup actions from an agents-audit — move, merge, delete, and update agent docs
7
- disable-model-invocation: true
8
- suggestion:
9
- eligible: false
10
- rationale: "Consumes prior audit output; only meaningful right after /agents-audit."
11
- ---
12
-
13
- # /agents cleanup
14
- ## Instructions
15
-
16
- ### 1. Check for audit roadmap
17
-
18
- Check the audit-roadmap path created by `/agents audit`:
19
-
20
- ```
21
- agents/roadmaps/agents-cleanup.md
22
- ```
23
-
24
- - If it exists → load it and show the phases.
25
- - If not → ask:
26
-
27
- ```
28
- ⚠️ No audit roadmap found.
29
-
30
- 1. 🔍 Run /agents-audit first
31
- 2. 💬 I know what to do — start directly
32
- ```
33
-
34
- **Recommendation: 1 — Run /agents-audit first** — without an audit roadmap, the cleanup is shooting in the dark. Caveat: pick 2 only if you already know exactly which docs to touch.
35
-
36
- If option 2, ask what to clean up.
37
-
38
- ### 2. Show action plan
39
-
40
- If a roadmap exists, display the phases:
41
-
42
- ```
43
- ═══════════════════════════════════════════════
44
- 🧹 AGENTS CLEANUP
45
- ═══════════════════════════════════════════════
46
-
47
- Phase 1: Critical fixes ({count} actions)
48
- - [ ] {action}
49
- - [ ] {action}
50
-
51
- Phase 2: Structural cleanup ({count} actions)
52
- - [ ] {action}
53
- - [ ] {action}
54
-
55
- Phase 3: Fill gaps ({count} actions)
56
- - [ ] {action}
57
-
58
- Phase 4: Cleanup ({count} actions)
59
- - [ ] {action}
60
-
61
- ═══════════════════════════════════════════════
62
-
63
- Which phase to work on?
64
-
65
- 1. Start Phase 1 (recommended — top to bottom)
66
- 2. Choose a specific phase
67
- 3. Choose a specific action
68
- ```
69
-
70
- ### 3. Execute actions
71
-
72
- For each action, follow the appropriate workflow:
73
-
74
- **Move file:**
75
- ```
76
- 📁 Move: {source} → {target}
77
- Reason: {why}
78
-
79
- Confirm? (y/n)
80
- ```
81
- - Move the file.
82
- - Update all references in other docs that link to the old path.
83
- - Check `.augment/skills/` and `.augment/commands/` for references.
84
-
85
- **Merge files:**
86
- ```
87
- 🔗 Merge:
88
- {file1} + {file2} → {target}
89
- Reason: {why — what overlaps}
90
-
91
- Confirm? (y/n)
92
- ```
93
- - Read both files.
94
- - Show the proposed merged content.
95
- - Create the merged file, delete the originals.
96
- - Update references.
97
-
98
- **Delete file:**
99
- ```
100
- 🗑️ Delete: {file}
101
- Reason: {why — what's obsolete}
102
-
103
- Content (preview):
104
- {first 5 lines}
105
-
106
- Confirm? (y/n)
107
- ```
108
- - Delete the file.
109
- - Check for and remove references in other docs.
110
-
111
- **Update file:**
112
- ```
113
- ✏️ Update: {file}
114
- Reason: {what's outdated}
115
-
116
- Changes:
117
- - {reference to deleted class} → remove
118
- - {outdated section} → update
119
- - {missing info} → add
120
-
121
- Confirm? (y/n)
122
- ```
123
- - Read the file.
124
- - Make the changes.
125
- - Show a summary of what changed.
126
-
127
- **Create context:**
128
- ```
129
- 📄 Create context: {area}
130
- Reason: {why it's needed}
131
-
132
- > 1. Yes — start /context-create
133
- > 2. Skip
134
- ```
135
- - Transition to `/context-create` with the area pre-selected.
136
-
137
- ### 4. Update roadmap progress
138
-
139
- After each action:
140
- - Mark the step as `[x]` in the roadmap file.
141
- - Show progress:
142
-
143
- ```
144
- ✅ Action complete: {description}
145
-
146
- Progress Phase {n}: [{completed}/{total}]
147
- ██████████░░░░░░ 60%
148
- ```
149
-
150
- Per `verbosity.routine_confirmations` (default `false`):
151
-
152
- - `false` → continue to the next action silently. User can interrupt
153
- any time; "continue" is dominant once cleanup is in flight.
154
- - `true` → ask:
155
- ```
156
- > 1. Continue with next action
157
- > 2. Stop here
158
- ```
159
-
160
- ### 5. Summary (verbosity-gated)
161
-
162
- After completing a phase or all actions, read
163
- `verbosity.post_action_reports` from `.agent-settings.yml` (default
164
- `minimal`).
165
-
166
- - `off` → emit nothing on success; surface errors only.
167
- - `minimal` (default) → one line:
168
- `→ Cleanup: {moved} moved · {deleted} deleted · {updated} updated · {remaining} remaining`.
169
- - `full` → multi-line block:
170
-
171
- ```
172
- ═══════════════════════════════════════════════
173
- ✅ CLEANUP SUMMARY
174
- ═══════════════════════════════════════════════
175
-
176
- 📁 Moved: {count} files
177
- 🔗 Merged: {count} files
178
- 🗑️ Deleted: {count} files
179
- ✏️ Updated: {count} files
180
- 📄 Created: {count} contexts
181
-
182
- Remaining: {count} actions in {phases} phases
183
-
184
- ═══════════════════════════════════════════════
185
- ```
186
-
187
- ### Rules
188
-
189
- - **Do NOT commit or push.**
190
- - **Always confirm before each destructive action** (delete, merge, move).
191
- - **Always update references** when moving or renaming files.
192
- - **Update the roadmap** after each completed action.
193
- - **Show file content** before deleting — the user should see what's being removed.
194
- - **Check `.augment/` references too** — skills and commands may link to agents docs.
@@ -1,141 +0,0 @@
1
- ---
2
- name: agents:prepare
3
- cluster: agents
4
- sub: prepare
5
- skills: [agent-docs-writing]
6
- description: Scaffold the agents/ directory structure with all required subdirectories and .gitkeep files
7
- disable-model-invocation: true
8
- suggestion:
9
- eligible: false
10
- rationale: "One-shot project scaffolding; only run during initial setup."
11
- ---
12
-
13
- # /agents prepare
14
- ## Instructions
15
-
16
- ### 1. Check project root
17
-
18
- Verify you're in the project root (look for `composer.json`, `artisan`, or `package.json`).
19
-
20
- ### 2. Create directory structure
21
-
22
- Create the following directories if they don't exist, with a `.gitkeep` in each **empty** directory:
23
-
24
- ```
25
- agents/
26
- ├── roadmaps/
27
- │ └── .gitkeep
28
- ├── features/
29
- │ └── .gitkeep
30
- └── contexts/
31
- └── .gitkeep
32
- ```
33
-
34
- Also create the guidelines directory in `.augment/` if it doesn't exist:
35
-
36
- ```
37
- .augment/guidelines/
38
- └── php/
39
- └── .gitkeep
40
- ```
41
-
42
- **Rules:**
43
- - Only add `.gitkeep` to directories that have **no other files** in them.
44
- - Do NOT overwrite existing files.
45
- - Do NOT create directories that already exist with content.
46
-
47
- ### 3. Check for module support
48
-
49
- Check if the project has a module system (`app/Modules/` directory):
50
-
51
- - If `app/Modules/` exists → list all modules.
52
- - For each module, create the agent directories if they don't exist:
53
-
54
- ```
55
- app/Modules/{Module}/agents/
56
- ├── roadmaps/
57
- │ └── .gitkeep
58
- ├── features/
59
- │ └── .gitkeep
60
- ├── contexts/
61
- │ └── .gitkeep
62
- ```
63
-
64
- ### 4. Verify templates exist
65
-
66
- Check that `.augment/templates/` contains the required templates:
67
-
68
- ```
69
- .augment/templates/
70
- ├── features.md # Feature plan template
71
- ├── roadmaps.md # Roadmap template
72
- └── contexts.md # Context document template
73
- ```
74
-
75
- If any template is missing, warn:
76
-
77
- ```
78
- ⚠️ Missing templates in .augment/templates/:
79
- - {missing-file}
80
-
81
- These templates are required by the Feature/Roadmap commands.
82
- ```
83
-
84
- ### 5. Clean up old templates
85
-
86
- Check for **old template files** in the agents directories and offer to remove them:
87
-
88
- ```
89
- agents/features/template.md
90
- agents/roadmaps/template.md
91
- app/Modules/*/agents/roadmaps/template.md
92
- app/Modules/*/agents/features/template.md
93
- ```
94
-
95
- If any are found:
96
-
97
- ```
98
- ℹ️ Old template files found (now in .augment/templates/):
99
-
100
- - agents/features/template.md
101
- - agents/roadmaps/template.md
102
-
103
- Delete these? (y/n)
104
- ```
105
-
106
- If yes → delete them.
107
-
108
- ### 6. Show summary
109
-
110
- ```
111
- ═══════════════════════════════════════════════
112
- ✅ AGENTS-VERZEICHNIS VORBEREITET
113
- ═══════════════════════════════════════════════
114
-
115
- 📁 Projekt-Root:
116
- agents/roadmaps/ {✅ existiert | 🆕 erstellt}
117
- agents/features/ {✅ existiert | 🆕 erstellt}
118
- .augment/guidelines/ {✅ existiert | 🆕 erstellt}
119
-
120
- 📁 Templates:
121
- .augment/templates/features.md {✅ | ⚠️ fehlt}
122
- .augment/templates/roadmaps.md {✅ | ⚠️ fehlt}
123
-
124
- {If modules exist:}
125
- 📁 Module:
126
- {Module}/agents/roadmaps/ {✅ | 🆕}
127
- {Module}/agents/features/ {✅ | 🆕}
128
- ...
129
-
130
- {If old templates were cleaned up:}
131
- 🗑️ Old templates removed: {count}
132
-
133
- ═══════════════════════════════════════════════
134
- ```
135
-
136
- ### Rules
137
-
138
- - **Do NOT commit or push.**
139
- - **Do NOT overwrite existing files.**
140
- - **Do NOT create `.gitkeep` in directories that already have files.**
141
- - **Always ask before deleting** old template files.