@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
@@ -0,0 +1,65 @@
1
+ # Prompt — do-competitively
2
+
3
+ Mode reference: [`../SKILL.md`](../SKILL.md) § *4. do-competitively*.
4
+
5
+ ## Implementer prompt (per candidate)
6
+
7
+ ```
8
+ You are CANDIDATE {{candidate_id}} of {{n_candidates}} competing on the
9
+ SAME slice. Other implementers are solving the identical problem in
10
+ parallel; the judge will pick exactly one winner.
11
+
12
+ TASK: {{task_description}}
13
+ CONTEXT FILES: {{file_paths}}
14
+
15
+ CONSTRAINTS:
16
+ - Do NOT optimize for "what the judge wants to see" — solve the task.
17
+ - Do NOT copy from other candidates; you do not have access to them.
18
+ - Make a real choice: name the algorithm, the API shape, the trade-off.
19
+ Generic safe answers lose to specific decisive ones.
20
+
21
+ ON COMPLETION, return ONE envelope per schemas/subagent-status.json:
22
+ - DONE — your candidate is complete and tests pass;
23
+ evidence[] cites the test output.
24
+ - DONE_WITH_CONCERNS — complete but flag the trade-off you made so
25
+ the judge can score it.
26
+ - NEEDS_CONTEXT — task ambiguity blocks all candidates; if so,
27
+ all candidates should converge on the same
28
+ blocking_question.
29
+ - BLOCKED — task is malformed; explain in blocking_reason.
30
+ ```
31
+
32
+ ## Judge prompt (winner selection)
33
+
34
+ ```
35
+ You are the judge picking ONE winner from {{n_candidates}} competing
36
+ diffs for the SAME slice. Losers are rejected, not merged.
37
+
38
+ CANDIDATE ENVELOPES: {{envelopes_array}}
39
+ CANDIDATE DIFFS: {{diffs_array}}
40
+ TASK: {{task_description}}
41
+
42
+ SCORING DIMENSIONS (cite each in evidence[]):
43
+ 1. Correctness — does it pass tests AND solve the task?
44
+ 2. Trade-off clarity — is the choice named and defended?
45
+ 3. Maintenance cost — what does the codebase look like in 6 months?
46
+ 4. Diff size — smaller wins ties.
47
+
48
+ VERDICT (one envelope, schemas/subagent-status.json):
49
+ - DONE — winner picked; evidence[] cites the four
50
+ scoring dimensions and names the winner.
51
+ - DONE_WITH_CONCERNS — winner picked but the chosen trade-off has
52
+ carry-over costs (concerns[]).
53
+ - NEEDS_CONTEXT — all candidates need the same clarification.
54
+ - BLOCKED — no candidate is acceptable; rerun with new
55
+ implementers or change the task.
56
+
57
+ NEVER pick a winner because it was the cheapest model. NEVER merge
58
+ two candidates — that is do-in-parallel, not do-competitively.
59
+ ```
60
+
61
+ ## Cost-discipline rule
62
+
63
+ `do-competitively` is N+1 subagent calls per slice. The orchestrator
64
+ confirms budget with the user before dispatch. The losing diffs are
65
+ discarded — that cost is the price of the trade-off survey.
@@ -0,0 +1,62 @@
1
+ # Prompt — do-in-parallel
2
+
3
+ Mode reference: [`../SKILL.md`](../SKILL.md) § *3. do-in-parallel*.
4
+
5
+ ## Implementer prompt (per slice)
6
+
7
+ ```
8
+ You are the implementer for SLICE {{slice_id}} in a parallel-dispatch
9
+ run. {{n_slices}} slices run concurrently. Slices are guaranteed
10
+ independent — different files, no shared state.
11
+
12
+ SLICE: {{slice_description}}
13
+ CONTEXT FILES (this slice only): {{file_paths}}
14
+ SHARED-STATE BAN: {{shared_paths_to_avoid}}
15
+
16
+ CONSTRAINTS:
17
+ - Do NOT touch any file outside the cited paths. The orchestrator
18
+ verified independence — violating it causes a merge race.
19
+ - Do NOT communicate with other slices. They are doing their own work.
20
+ - Write tests scoped to your slice; do not assert on slice-cross
21
+ behavior.
22
+
23
+ ON COMPLETION, return ONE envelope per schemas/subagent-status.json:
24
+ - DONE — slice shipped clean; evidence[] required.
25
+ - DONE_WITH_CONCERNS — shipped but mark concerns[] for the
26
+ aggregating judge to surface.
27
+ - NEEDS_CONTEXT — paused; orchestrator must answer
28
+ blocking_question. Other slices keep running.
29
+ - BLOCKED — slice cannot complete in isolation; explain
30
+ in blocking_reason. Other slices keep running;
31
+ aggregating judge handles partial outcome.
32
+ ```
33
+
34
+ ## Judge prompt (run once on aggregate)
35
+
36
+ ```
37
+ You are the judge running ONCE over the merged output of N parallel
38
+ slices. Per-slice judges were skipped to keep cost linear.
39
+
40
+ SLICE ENVELOPES: {{envelopes_array}}
41
+ AGGREGATED DIFF: {{merged_diff}}
42
+ TEST OUTPUT (full suite): {{test_output}}
43
+
44
+ VERDICT (one envelope, schemas/subagent-status.json):
45
+ - DONE — every slice DONE or DONE_WITH_CONCERNS that
46
+ you accept; evidence[] cites the merge being
47
+ test-green.
48
+ - DONE_WITH_CONCERNS — accept the aggregate, but consolidated
49
+ concerns[] from all slices need caller action.
50
+ - NEEDS_CONTEXT — one or more slices need clarification before
51
+ the aggregate can land; cite which.
52
+ - BLOCKED — aggregate is broken; cite the slice(s) that
53
+ must be re-run.
54
+
55
+ INDEPENDENCE-VIOLATION CHECK: scan for files touched by more than one
56
+ slice. If found, return BLOCKED — the dispatch was unsafe.
57
+ ```
58
+
59
+ ## Failure-isolation rule
60
+
61
+ A slice returning BLOCKED does not abort the other slices. The
62
+ aggregating judge decides whether the partial result lands.
@@ -0,0 +1,62 @@
1
+ # Prompt — do-in-steps
2
+
3
+ Mode reference: [`../SKILL.md`](../SKILL.md) § *2. do-in-steps*.
4
+
5
+ ## Implementer prompt (per step)
6
+
7
+ ```
8
+ You are the implementer for STEP {{step_number}} of {{total_steps}} in a
9
+ sequential plan. Earlier steps that PASSED judgment are committed; their
10
+ diffs are read-only context.
11
+
12
+ PLAN: {{plan_summary}}
13
+ THIS STEP: {{step_description}}
14
+ PRIOR STEP DIFFS (read-only): {{prior_diffs}}
15
+ CONTEXT FILES: {{file_paths}}
16
+
17
+ CONSTRAINTS:
18
+ - Do NOT modify code from prior steps; their tests must still pass.
19
+ - Do NOT preempt later steps; one step at a time.
20
+ - Write the test for THIS step before the production code.
21
+
22
+ ON COMPLETION, return ONE envelope per schemas/subagent-status.json:
23
+ - DONE — step complete, gate green; cite evidence[].
24
+ - DONE_WITH_CONCERNS — step complete but flag carry-over concerns
25
+ for later steps.
26
+ - NEEDS_CONTEXT — paused; blocking_question must be answered
27
+ before this step can complete.
28
+ - BLOCKED — step cannot complete on the current plan;
29
+ blocking_reason explains why. The orchestrator
30
+ may revise the plan and re-dispatch.
31
+ ```
32
+
33
+ ## Judge prompt (between steps)
34
+
35
+ ```
36
+ You are the judge reviewing STEP {{step_number}} before STEP
37
+ {{step_number_plus_one}} starts. A failing step here cascades into the
38
+ next, so verdicts are stricter than a one-shot do-and-judge.
39
+
40
+ STEP DIFF: {{diff}}
41
+ STEP TESTS: {{test_output}}
42
+ PRIOR STEPS: {{prior_step_summaries}}
43
+ NEXT STEP DESCRIPTION: {{next_step_description}}
44
+
45
+ VERDICT — return ONE envelope per schemas/subagent-status.json:
46
+ - DONE — proceed to next step; evidence[] required.
47
+ - DONE_WITH_CONCERNS — proceed, but next step's prompt MUST surface
48
+ the concerns[] so the implementer compensates.
49
+ - NEEDS_CONTEXT — pause; orchestrator answers blocking_question
50
+ before next step.
51
+ - BLOCKED — do not start next step; this step is wrong.
52
+
53
+ DOWNSTREAM IMPACT CHECK: name one way this diff could break the next
54
+ step. If you cannot, return DONE. If you can but the implementer
55
+ already mitigated, DONE. Otherwise DONE_WITH_CONCERNS.
56
+ ```
57
+
58
+ ## Cascade rule
59
+
60
+ A step that returns BLOCKED stops the chain. The orchestrator does not
61
+ "jump ahead" or re-order — it surfaces the BLOCKED envelope to the user
62
+ and waits.
@@ -0,0 +1,70 @@
1
+ # Prompt — do-in-worktrees
2
+
3
+ Mode reference: [`../SKILL.md`](../SKILL.md) § *6. do-in-worktrees*.
4
+ Worktree creation/destruction lives in [`../../using-git-worktrees/SKILL.md`](../../using-git-worktrees/SKILL.md).
5
+
6
+ ## Implementer prompt (per worktree step)
7
+
8
+ ```
9
+ You are the implementer for STEP {{step_id}} in a cross-wing chain.
10
+ You are running INSIDE a fresh git worktree at {{worktree_path}} on
11
+ branch {{branch_name}}. Prior step's open files / branch state cannot
12
+ leak into this worktree — that is the whole point.
13
+
14
+ STEP TYPED INPUT (from prior step's ## Output): {{typed_input}}
15
+ STEP DESCRIPTION: {{step_description}}
16
+ EXPECTED ## Output (next step's ## Input): {{expected_output_shape}}
17
+
18
+ CONSTRAINTS:
19
+ - Stay inside the worktree path. Do NOT cd to the parent repo.
20
+ - Do NOT touch branches other than {{branch_name}}.
21
+ - Produce the expected ## Output shape literally — the next worktree's
22
+ implementer consumes it as ## Input.
23
+ - Run the chain-end test for THIS step before signaling completion.
24
+
25
+ ON COMPLETION, return ONE envelope per schemas/subagent-status.json:
26
+ - DONE — step output produced and validated; evidence[]
27
+ cites the typed-output file path.
28
+ - DONE_WITH_CONCERNS — output produced but flag carry-over for next
29
+ worktree; concerns[] surfaces in next step's
30
+ dispatch.
31
+ - NEEDS_CONTEXT — paused; chain pauses until orchestrator
32
+ answers blocking_question. Other worktrees
33
+ are NOT running concurrently in this mode.
34
+ - BLOCKED — step cannot complete; chain halts. The
35
+ orchestrator decides whether to drop the
36
+ worktree or rescope.
37
+ ```
38
+
39
+ ## Chain-end judge prompt (run once after final worktree)
40
+
41
+ ```
42
+ You are the chain-end judge. The chain produced N typed outputs, one
43
+ per worktree. Validate the final integration PR against the chain's
44
+ goal.
45
+
46
+ CHAIN STEPS: {{step_summaries_array}}
47
+ TYPED OUTPUTS: {{outputs_array}}
48
+ INTEGRATION PR DIFF: {{integration_diff}}
49
+
50
+ VERDICT (one envelope, schemas/subagent-status.json):
51
+ - DONE — chain landed cleanly; evidence[] cites each
52
+ step's typed output and the integration test
53
+ run.
54
+ - DONE_WITH_CONCERNS — chain landed but consolidated concerns[]
55
+ across steps need follow-up.
56
+ - NEEDS_CONTEXT — integration is unclear; cite which step(s)
57
+ need clarification.
58
+ - BLOCKED — integration is broken; cite the worktree(s)
59
+ that must be redone. Do NOT silently rewrite.
60
+
61
+ WORKTREE-LEAK CHECK: scan the integration diff for branch names or
62
+ files belonging to a different worktree's step. If found, BLOCKED —
63
+ isolation was violated.
64
+ ```
65
+
66
+ ## Sequential-not-parallel rule
67
+
68
+ `do-in-worktrees` runs steps sequentially across isolated worktrees.
69
+ Parallel concurrent worktrees are `do-in-parallel` with explicit
70
+ isolation, not this mode.
@@ -0,0 +1,63 @@
1
+ # Prompt — judge-with-debate
2
+
3
+ Mode reference: [`../SKILL.md`](../SKILL.md) § *5. judge-with-debate*.
4
+
5
+ ## Judge-A / Judge-B prompt (run twice in parallel)
6
+
7
+ ```
8
+ You are JUDGE {{judge_letter}} reviewing a high-stakes diff (security,
9
+ data integrity, public API). Another judge is independently reviewing
10
+ the same diff. A meta-judge will reconcile your verdicts.
11
+
12
+ DO NOT reach for the safe answer. Disagreement IS the value.
13
+
14
+ TASK: {{task_description}}
15
+ DIFF: {{diff}}
16
+ TEST OUTPUT: {{test_output}}
17
+ SENSITIVITY: {{security_or_data_or_api}}
18
+
19
+ VERDICT (one envelope, schemas/subagent-status.json):
20
+ - DONE — diff is correct and safe; evidence[] cites
21
+ the specific defenses you verified.
22
+ - DONE_WITH_CONCERNS — correct but the failure modes you can name
23
+ go in concerns[].
24
+ - NEEDS_CONTEXT — paused; meta-judge will adjudicate after
25
+ orchestrator answers blocking_question.
26
+ - BLOCKED — diff is wrong; explain in blocking_reason.
27
+
28
+ NAME ONE FAILURE MODE you actively looked for, even if you did not
29
+ find it. "I looked for X, did not find it" is stronger evidence than
30
+ "this looks fine".
31
+ ```
32
+
33
+ ## Meta-judge prompt (run once after Judge-A and Judge-B return)
34
+
35
+ ```
36
+ You are the META-JUDGE reconciling two independent verdicts. Both
37
+ judges saw the same diff; their envelopes are below.
38
+
39
+ JUDGE-A ENVELOPE: {{envelope_a}}
40
+ JUDGE-B ENVELOPE: {{envelope_b}}
41
+ DIFF: {{diff}}
42
+
43
+ RECONCILIATION RULES:
44
+ 1. Both DONE → your verdict is DONE.
45
+ 2. Either BLOCKED → your verdict is BLOCKED. No tiebreaker.
46
+ 3. One DONE, one DONE_WITH_CONCERNS → DONE_WITH_CONCERNS (carry the
47
+ concerns).
48
+ 4. One NEEDS_CONTEXT → consolidate blocking_question(s); your status
49
+ is NEEDS_CONTEXT.
50
+ 5. Mixed otherwise → DONE_WITH_CONCERNS, listing every concern from
51
+ both judges.
52
+
53
+ DISAGREEMENT IS THE VALUE: do NOT average. The strict-er verdict wins.
54
+
55
+ VERDICT (one envelope, schemas/subagent-status.json) using the rules
56
+ above. Cite both judges' evidence[] in your evidence[].
57
+ ```
58
+
59
+ ## High-stakes-only rule
60
+
61
+ `judge-with-debate` is two-judges-plus-meta = three subagent calls per
62
+ review. Reserve for security, data migration, public API, or
63
+ cross-tenant boundaries. Routine refactors use plain `do-and-judge`.
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft-07/schema#",
3
+ "$id": "https://event4u.dev/agent-config/schemas/subagent-status.json",
4
+ "title": "Subagent Status Envelope",
5
+ "description": "Required wire format for every implementer or judge subagent return. Loaded by /do-and-judge, /do-in-steps, and the subagent-orchestration skill. Hand-validated by tests/test_subagent_status_schema.py (no jsonschema runtime dep).",
6
+ "type": "object",
7
+ "required": ["status", "summary"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "status": {
11
+ "type": "string",
12
+ "enum": ["DONE", "DONE_WITH_CONCERNS", "NEEDS_CONTEXT", "BLOCKED"],
13
+ "description": "DONE = work shipped, gate green. DONE_WITH_CONCERNS = work shipped but caller must read concerns[]. NEEDS_CONTEXT = paused, blocking_question[] must be answered. BLOCKED = halted, blocking_reason describes why no path forward."
14
+ },
15
+ "summary": {
16
+ "type": "string",
17
+ "minLength": 1,
18
+ "description": "One- or two-sentence outcome. Required for every status."
19
+ },
20
+ "evidence": {
21
+ "type": "array",
22
+ "items": {"type": "string", "minLength": 1},
23
+ "description": "Citations: file:line, command output, test name, contract section. Required for DONE / DONE_WITH_CONCERNS."
24
+ },
25
+ "concerns": {
26
+ "type": "array",
27
+ "items": {"type": "string", "minLength": 1},
28
+ "description": "Caller-actionable concerns. Required when status = DONE_WITH_CONCERNS, must be empty otherwise."
29
+ },
30
+ "blocking_question": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "description": "Single specific question whose answer would unblock. Required when status = NEEDS_CONTEXT."
34
+ },
35
+ "blocking_reason": {
36
+ "type": "string",
37
+ "minLength": 1,
38
+ "description": "Why no path forward exists. Required when status = BLOCKED. Distinguish from NEEDS_CONTEXT (where caller can supply context)."
39
+ },
40
+ "next_action": {
41
+ "type": "string",
42
+ "description": "What the caller does now. Optional; orchestrator infers from status when omitted."
43
+ }
44
+ },
45
+ "allOf": [
46
+ {
47
+ "if": {"properties": {"status": {"const": "DONE"}}, "required": ["status"]},
48
+ "then": {"required": ["evidence"], "not": {"required": ["concerns"]}}
49
+ },
50
+ {
51
+ "if": {"properties": {"status": {"const": "DONE_WITH_CONCERNS"}}, "required": ["status"]},
52
+ "then": {"required": ["evidence", "concerns"]}
53
+ },
54
+ {
55
+ "if": {"properties": {"status": {"const": "NEEDS_CONTEXT"}}, "required": ["status"]},
56
+ "then": {"required": ["blocking_question"]}
57
+ },
58
+ {
59
+ "if": {"properties": {"status": {"const": "BLOCKED"}}, "required": ["status"]},
60
+ "then": {"required": ["blocking_reason"]}
61
+ }
62
+ ]
63
+ }
@@ -64,6 +64,20 @@ stay on plain TDD — the section above.
64
64
  If step 2 is skipped, the test is not trusted — a test that has never
65
65
  failed proves nothing about the code under test.
66
66
 
67
+ ### Iron Law — delete-and-restart over keep-as-reference
68
+
69
+ ```
70
+ WHEN UNTESTED CODE EXISTS AND A TEST IS NEEDED — DELETE THE CODE,
71
+ WRITE THE TEST, REIMPLEMENT. NEVER KEEP IT "AS REFERENCE".
72
+ ```
73
+
74
+ Reading the existing implementation while writing its test is
75
+ test-after-the-fact with extra steps. The 12-row anti-rationalization
76
+ table that follows expands the most common ways this Iron Law gets
77
+ talked-around. Externalized to
78
+ [`testing-anti-patterns/process-anti-patterns.md`](../testing-anti-patterns/process-anti-patterns.md)
79
+ to keep this skill under the 400-line sunset trigger.
80
+
67
81
  ## Procedure
68
82
 
69
83
  ### 1. Identify the behavior to test
@@ -140,22 +154,20 @@ Back to step 1 with the next single-sentence behavior.
140
154
  3. Captured green-run output
141
155
  4. Any refactor diff (optional)
142
156
 
143
- ## Anti-rationalizations table
157
+ ## Anti-rationalizations
144
158
 
145
- The urge to skip TDD is strongest on tasks where TDD matters most. Name
146
- the rationalization and reject it:
159
+ Twelve common rationalizations that fire *before* the test is written
160
+ plus the delete-and-restart Iron Law — live in
161
+ [`testing-anti-patterns/process-anti-patterns.md`](../testing-anti-patterns/process-anti-patterns.md).
162
+ Read the table when:
147
163
 
148
- | Thought | Reality |
149
- |---|---|
150
- | "This is too simple to need a test" | Simple code still breaks. A test takes less time than one debug cycle. |
151
- | "I'll add the test after the code works" | A test written after code passes on the first run it has never failed. It does not prove the code is correct. |
152
- | "I already ran it manually" | Manual runs are not repeatable. The next edit breaks it silently. |
153
- | "Deleting this code I just wrote is wasteful" | Sunk cost. The cheap path is: delete, write the test, reimplement minimally. |
154
- | "I'll keep the code as reference while I write the test" | You will read it and adapt it. That is test-after-the-fact with extra steps. Delete it. |
155
- | "I just need to explore the API first" | Spike it on a throwaway branch. Then delete it and restart with TDD. |
156
- | "The test is too hard to write" | That signals a design problem in the code, not in the test. Listen to it. |
157
- | "This bug is urgent, no time for a test" | The test **is** the fastest path to a verified fix. Guessing takes longer. |
164
+ - You catch yourself thinking "I'll add the test after" — row 2.
165
+ - You want to keep the code "as reference" while writing the test — row 5.
166
+ - "CI is red, patch first, test later" row 9.
167
+ - "Follow-up PR will add the test" — row 12.
158
168
 
169
+ For mock-isolation failure modes (separate concern), see
170
+ [`testing-anti-patterns`](../testing-anti-patterns/SKILL.md).
159
171
 
160
172
  ## Examples
161
173
 
@@ -8,6 +8,13 @@ source: package
8
8
 
9
9
  Tests must verify real behavior, not mock behavior. Mocks isolate; they are not the thing under test. This skill is the **prevention** layer; [`judge-test-coverage`](../judge-test-coverage/SKILL.md) catches what slips through afterwards.
10
10
 
11
+ For the **process / rationalization** failure modes that fire *before* a
12
+ test is written (the urges to skip TDD, keep code "as reference", patch
13
+ without a regression test), see the sibling reference table in
14
+ [`process-anti-patterns.md`](process-anti-patterns.md). Both layers are
15
+ required — a correctly-mocked test that was written *after* the code is
16
+ still test-after-the-fact.
17
+
11
18
  ## When to use
12
19
 
13
20
  - About to write a new test that mocks a collaborator.
@@ -34,6 +41,10 @@ Do NOT use when:
34
41
 
35
42
  ## Procedure: Run the gate before each anti-pattern
36
43
 
44
+ ### 1. Inspect the diff before any new mock
45
+
46
+ Before writing or extending a test, **inspect** the code under test and identify which collaborators are real, which are mocked, and which produce side effects the assertion depends on. Open the file, read the dependency chain, and write the chain down. Do not start mocking until the chain is on paper.
47
+
37
48
  ### Anti-Pattern 1 — Asserting on mock elements
38
49
 
39
50
  Symptom: `expect(screen.getByTestId('sidebar-mock')).toBeInTheDocument()` or `$this->assertSee('mock-sidebar')`. Test passes when the mock is present, fails when it is not — proves nothing about the component.
@@ -102,6 +113,8 @@ BEFORE creating a mock response object:
102
113
  3. If the shape is unknown, capture a real response into `tests/fixtures/` instead of inventing one.
103
114
  ```
104
115
 
116
+ **Concrete capture tools** for recording the real shape: `curl -s <url> | jq '.'` against a staging endpoint, Postman's "Save Response", Laravel's `Http::fake()` in record mode, or a Playwright network-trace export. Filter the captured payload with `jq` / `grep` to keep only the fields your fixture documents — **do not** dump unredacted secrets into `tests/fixtures/`.
117
+
105
118
  ### Anti-Pattern 5 — Tests as an afterthought
106
119
 
107
120
  Symptom: "Implementation complete, ready for testing." Implementation went in without tests. TDD was skipped, anti-patterns 1–4 are now likely.
@@ -120,6 +133,7 @@ Gate: a feature is not complete until a failing-then-passing test cycle ran for
120
133
  - A "complete" mock that mirrors a v1 API silently rots when v2 ships — link mock fixtures to a real recorded response and re-record on schema changes.
121
134
  - Layer 3 environment guards from [`defense-in-depth`](../defense-in-depth/SKILL.md) often expose anti-pattern 2: if a production guard fires only in tests, the test setup is wrong, not the guard.
122
135
  - Long mock setups (> 50% of the test) are a signal that integration tests would be simpler — consider it before piling on more mocks.
136
+ - **Diagnose, do not brute-force.** If a test fails after a mock change, **never guess** at another mock tweak — drop a debugger / Xdebug breakpoint at the seam, observe the real call shape, then mock minimally. Two retries without a root-cause hypothesis = STOP and rethink.
123
137
 
124
138
  ## Do NOT
125
139
 
@@ -0,0 +1,67 @@
1
+ # Testing process anti-patterns — reference table
2
+
3
+ Sibling reference for [`testing-anti-patterns`](SKILL.md) and
4
+ [`test-driven-development`](../test-driven-development/SKILL.md).
5
+
6
+ `testing-anti-patterns/SKILL.md` covers **mock-isolation** failure modes
7
+ (mocking-the-mock, production pollution, partial mocks). This doc covers
8
+ the **process / rationalization** failure modes — the urges that fire
9
+ *before* the test is written and convince you to skip TDD entirely.
10
+
11
+ Both layers are required. A correctly-mocked test that was written *after*
12
+ the code is still test-after-the-fact. A TDD-first test that mocks itself
13
+ is still mocking the mock.
14
+
15
+ ## The Iron Law (delete-and-restart)
16
+
17
+ ```
18
+ WHEN YOU FIND YOURSELF KEEPING UNTESTED CODE "AS REFERENCE" WHILE WRITING
19
+ A TEST FOR IT — DELETE THE CODE. WRITE THE TEST. THEN REIMPLEMENT.
20
+ ```
21
+
22
+ The cheap path is one extra round-trip. The expensive path is a test that
23
+ silently encodes the bug it was supposed to catch.
24
+
25
+ ## 12-row anti-rationalization table
26
+
27
+ The urge to skip TDD is strongest on tasks where TDD matters most. Name
28
+ the rationalization, then reject it:
29
+
30
+ | # | Thought | Reality |
31
+ |---|---|---|
32
+ | 1 | "This is too simple to need a test" | Simple code still breaks. A test takes less time than one debug cycle. |
33
+ | 2 | "I'll add the test after the code works" | A test written after code that passed first try has never failed. It does not prove the code is correct. |
34
+ | 3 | "I already ran it manually" | Manual runs are not repeatable. The next edit breaks it silently. |
35
+ | 4 | "Deleting code I just wrote is wasteful" | Sunk cost. The cheap path: delete, write the test, reimplement minimally. |
36
+ | 5 | "I'll keep the code as reference while I write the test" | You will read it and adapt to it. That is test-after-the-fact with extra steps. Delete it. |
37
+ | 6 | "I just need to explore the API first" | Spike on a throwaway branch. Then delete the spike and restart with TDD. |
38
+ | 7 | "The test is too hard to write" | That signals a design problem in the code, not the test. Listen to it — refactor the seam, then test. |
39
+ | 8 | "This bug is urgent, no time for a test" | The test **is** the fastest path to a verified fix. Guessing takes longer and re-occurs. |
40
+ | 9 | "CI is red — patch first, test later" | A red CI is the cheapest moment to write the regression test. The patch without the test invites the same bug back. |
41
+ | 10 | "The test is just proof-of-work for the PR review" | A test that exists to placate review is not a test — it is theater. Either it asserts behavior or delete it. |
42
+ | 11 | "The dependency is too awkward to seam" | The seam discomfort *is* the design feedback. A constructor-injection refactor pays for itself the second time you change the dependency. |
43
+ | 12 | "We'll add the test in a follow-up PR" | Follow-up PRs that add tests to merged code arrive 0% of the time. The test ships with the change or never. |
44
+
45
+ ## When to use this doc
46
+
47
+ - Reviewing your own draft before writing a test — read the table, check
48
+ none of the 12 are firing in your head.
49
+ - Reviewing a teammate's PR — if the PR description matches one of the 12
50
+ patterns, surface the row number in the review.
51
+ - Onboarding — pair with [`test-driven-development`](../test-driven-development/SKILL.md)
52
+ to give new devs the *why* behind the discipline.
53
+
54
+ ## Cross-references
55
+
56
+ - Mock-specific anti-patterns: [`testing-anti-patterns`](SKILL.md)
57
+ - TDD discipline: [`test-driven-development`](../test-driven-development/SKILL.md)
58
+ - Coverage hygiene on a finished diff: [`judge-test-coverage`](../judge-test-coverage/SKILL.md)
59
+ - Pest conventions: [`pest-testing`](../pest-testing/SKILL.md)
60
+ - Quality tooling: [`quality-tools`](../quality-tools/SKILL.md)
61
+
62
+ ## Provenance
63
+
64
+ - Adapted from `obra/superpowers@v5.1.0` `testing/anti-patterns.md`.
65
+ - Council convergence (anthropic/claude-sonnet-4-5 + openai/gpt-4o,
66
+ 2026-05-07): both members ADOPT — the catalogue surfaces specific
67
+ rationalization patterns that would otherwise leak past code review.
@@ -1,25 +1,24 @@
1
1
  # {{project_name}}
2
2
 
3
3
  <!--
4
- AGENTS.md entry point for AI coding agents. Installed by
5
- `event4u/agent-config`. Fill placeholders (or run `/copilot-agents-init`)
6
- and delete this comment. Keep thin; bulk prose belongs in the linked guide.
4
+ Fill placeholders or run `/agents init`, then delete this
5
+ comment. Iron Law capability bullets, not path lists; paths rot.
6
+ Tool stubs (`CLAUDE.md`, `GEMINI.md`, `.cursorrules`) link here.
7
+ Anatomy + recipes: `.augment/contexts/contracts/agents-md-anatomy.md`.
7
8
  -->
8
9
 
9
- {{project_description}}
10
+ > {{project_description}}
10
11
 
11
12
  ## Layers
12
13
 
13
- | Layer | Location | Purpose |
14
+ | Layer | Location | Edits |
14
15
  |---|---|---|
15
- | **Shared package** | `.augment/`, `.agent-src/` | Installed skills / rules / commands — do not hand-edit |
16
- | **Project overrides** | `agents/overrides/` | Customizations of shared resources |
17
- | **Project docs** | `agents/` | Architecture, features, roadmaps, sessions, contexts |
18
- | **Agent settings** | `.agent-settings.yml` | Project-specific config consumed by skills |
16
+ | Installed package | `.augment/`, `.agent-src/` | hands-off managed by `event4u/agent-config` |
17
+ | Project layer | `agents/`, `agents/overrides/`, `.agent-settings.yml` | your customizations and config |
19
18
 
20
19
  ## Pointers
21
20
 
22
- - **Filling out this AGENTS.md** — tech-stack / dev-setup / testing / quality / project-structure templates plus `/work` + `/implement-ticket` entry flow and multi-agent matrix: [`.augment/contexts/contracts/consumer-agents-md-guide.md`](.augment/contexts/contracts/consumer-agents-md-guide.md).
21
+ - **Filling out this AGENTS.md** — section templates, capability bullets, multi-agent entry flow, monorepo per-package layout: [`.augment/contexts/contracts/consumer-agents-md-guide.md`](.augment/contexts/contracts/consumer-agents-md-guide.md).
23
22
  - **Behavior rules (always active)** — Iron Laws and routed rules that fire automatically while you work in this project: [`.augment/rules/`](.augment/rules/).
24
23
  - **Skills (on-demand expertise)** — domain skills surfaced by description; invoked when their trigger fires: [`.augment/skills/`](.augment/skills/).
25
24
  - **Commands (workflows)** — slash-commands the agent runs end-to-end (`/work`, `/implement-ticket`, `/commit`, `/create-pr`, …): [`.augment/commands/`](.augment/commands/).
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Shared agent configuration \u2014 skills for AI coding tools (Claude Code, Augment, Cursor, Cline, Windsurf, Gemini CLI).",
9
- "version": "1.29.0"
9
+ "version": "1.32.0"
10
10
  },
11
11
  "plugins": [
12
12
  {
@@ -22,9 +22,9 @@
22
22
  "./.claude/skills/agent-status",
23
23
  "./.claude/skills/agents",
24
24
  "./.claude/skills/agents-audit",
25
- "./.claude/skills/agents-cleanup",
25
+ "./.claude/skills/agents-init",
26
26
  "./.claude/skills/agents-md-thin-root",
27
- "./.claude/skills/agents-prepare",
27
+ "./.claude/skills/agents-optimize",
28
28
  "./.claude/skills/ai-council",
29
29
  "./.claude/skills/analysis-autonomous-mode",
30
30
  "./.claude/skills/analysis-skill-router",
@@ -64,10 +64,7 @@
64
64
  "./.claude/skills/context-document",
65
65
  "./.claude/skills/context-refactor",
66
66
  "./.claude/skills/conventional-commits-writing",
67
- "./.claude/skills/copilot-agents",
68
- "./.claude/skills/copilot-agents-init",
69
67
  "./.claude/skills/copilot-agents-optimization",
70
- "./.claude/skills/copilot-agents-optimize",
71
68
  "./.claude/skills/copilot-config",
72
69
  "./.claude/skills/cost-report",
73
70
  "./.claude/skills/council",
@@ -169,7 +166,7 @@
169
166
  "./.claude/skills/onboard",
170
167
  "./.claude/skills/openapi",
171
168
  "./.claude/skills/optimize",
172
- "./.claude/skills/optimize-agents",
169
+ "./.claude/skills/optimize-agents-dir",
173
170
  "./.claude/skills/optimize-augmentignore",
174
171
  "./.claude/skills/optimize-prompt",
175
172
  "./.claude/skills/optimize-rtk",
@@ -213,7 +210,7 @@
213
210
  "./.claude/skills/receiving-code-review",
214
211
  "./.claude/skills/refine-prompt",
215
212
  "./.claude/skills/refine-ticket",
216
- "./.claude/skills/repomix",
213
+ "./.claude/skills/repomix-packer",
217
214
  "./.claude/skills/requesting-code-review",
218
215
  "./.claude/skills/research",
219
216
  "./.claude/skills/review-changes",
package/AGENTS.md CHANGED
@@ -19,8 +19,7 @@ task ci # full pipeline — green before PR
19
19
  - **Package self-orientation** — identity, four-wing cognition map, repo layout, tech stack, key-rules table, telemetry, command-suggester: [`docs/contracts/package-self-orientation.md`](docs/contracts/package-self-orientation.md).
20
20
  - **Kernel + Router** — 9 always-loaded Iron-Law rules, tier-1 / tier-2 routing, cost profiles, per-rule char caps enforced by `task lint-rule-budget`: [`kernel-membership`](docs/contracts/kernel-membership.md) + [`rule-router`](docs/contracts/rule-router.md).
21
21
  - **Multi-tool projection** — Augment, Claude Code, Cursor, Cline, Windsurf, Gemini CLI, Claude.ai bundle pipeline that ships from `.agent-src/` to consumer surfaces: [`docs/architecture.md`](docs/architecture.md#cloud-bundle-pipeline).
22
- - **Iron-Law rules when editing this repo** — portability, source-of-truth, skill-quality: [`augment-portability`](.agent-src/rules/augment-portability.md), [`augment-source-of-truth`](.agent-src/rules/augment-source-of-truth.md), [`skill-quality`](.agent-src/rules/skill-quality.md).
23
- - **Thin-Root contract** governing **this** file (cap, pointer ratio, emergency-triage block) — read before editing AGENTS.md: [`agents-md-thin-root`](.agent-src/skills/agents-md-thin-root/SKILL.md).
22
+ - **Editing this repo** — Iron-Law rules (portability, source-of-truth, skill-quality) and the Thin-Root contract (caps · pointer-ratio · triage block) governing AGENTS.md: [`augment-portability`](.agent-src/rules/augment-portability.md), [`augment-source-of-truth`](.agent-src/rules/augment-source-of-truth.md), [`skill-quality`](.agent-src/rules/skill-quality.md), [`agents-md-thin-root`](.agent-src/skills/agents-md-thin-root/SKILL.md).
24
23
  - **Consumer story + architecture deep-dive** — what the package does for installers and how it ships: [`README.md`](README.md), [`docs/architecture.md`](docs/architecture.md).
25
24
 
26
25
  ## Emergency triage — read this when nothing else is reachable