@homericintelligence/athena-opencode 0.4.4 → 0.5.1

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 (136) hide show
  1. package/README.md +30 -17
  2. package/package.json +2 -2
  3. package/plugin.js +20 -5
  4. package/skills/TECHNICAL_ENGLISH.md +78 -0
  5. package/skills/_cli.py +26 -18
  6. package/skills/_support/docs/dependency-resolution.md +192 -0
  7. package/skills/_support/docs/policies/development.md +117 -0
  8. package/skills/_support/docs/policies/evidence-integrity.md +40 -0
  9. package/skills/_support/docs/principles/README.md +542 -0
  10. package/skills/_support/docs/principles/details/p001-kiss.md +114 -0
  11. package/skills/_support/docs/principles/details/p002-yagni.md +109 -0
  12. package/skills/_support/docs/principles/details/p003-dry.md +126 -0
  13. package/skills/_support/docs/principles/details/p004-solid.md +165 -0
  14. package/skills/_support/docs/principles/details/p005-modularity.md +123 -0
  15. package/skills/_support/docs/principles/details/p006-principle-of-least-astonishment.md +115 -0
  16. package/skills/_support/docs/principles/details/p007-subtraction-over-addition.md +113 -0
  17. package/skills/_support/docs/principles/details/p008-understand-before-subtracting.md +115 -0
  18. package/skills/_support/docs/principles/details/p009-general-mechanisms-over-special-cases.md +108 -0
  19. package/skills/_support/docs/principles/details/p010-scope-fidelity.md +117 -0
  20. package/skills/_support/docs/principles/details/p011-minimal-coherent-change.md +128 -0
  21. package/skills/_support/docs/principles/details/p012-evidence-before-modification.md +115 -0
  22. package/skills/_support/docs/principles/details/p013-avoid-hasty-abstractions.md +112 -0
  23. package/skills/_support/docs/principles/details/p014-preserve-unrequested-behavior.md +110 -0
  24. package/skills/_support/docs/principles/details/p015-architecture-conformance.md +124 -0
  25. package/skills/_support/docs/principles/details/p016-separation-of-concerns.md +125 -0
  26. package/skills/_support/docs/principles/details/p017-high-cohesion-low-coupling.md +130 -0
  27. package/skills/_support/docs/principles/details/p018-information-hiding.md +128 -0
  28. package/skills/_support/docs/principles/details/p019-explicit-contracts.md +134 -0
  29. package/skills/_support/docs/principles/details/p020-executable-architecture.md +130 -0
  30. package/skills/_support/docs/principles/details/p021-evolutionary-and-reversible-design.md +126 -0
  31. package/skills/_support/docs/principles/details/p022-test-behavior-not-implementation.md +129 -0
  32. package/skills/_support/docs/principles/details/p023-parameterized-table-driven-testing.md +129 -0
  33. package/skills/_support/docs/principles/details/p024-boundary-value-testing.md +128 -0
  34. package/skills/_support/docs/principles/details/p025-property-based-testing-for-invariants.md +133 -0
  35. package/skills/_support/docs/principles/details/p026-regression-before-repair.md +134 -0
  36. package/skills/_support/docs/principles/details/p027-deterministic-and-hermetic-tests.md +128 -0
  37. package/skills/_support/docs/principles/details/p028-test-failure-paths.md +133 -0
  38. package/skills/_support/docs/principles/details/p029-generalize-error-policy-preserve-specific-cause.md +131 -0
  39. package/skills/_support/docs/principles/details/p030-nearest-responsible-error-boundary.md +133 -0
  40. package/skills/_support/docs/principles/details/p031-propagate-rather-than-swallow.md +131 -0
  41. package/skills/_support/docs/principles/details/p032-handle-once-preserve-causality.md +137 -0
  42. package/skills/_support/docs/principles/details/p033-state-safe-failure-semantics.md +140 -0
  43. package/skills/_support/docs/principles/details/p034-fail-fast.md +132 -0
  44. package/skills/_support/docs/principles/details/p035-fail-secure-fail-closed.md +137 -0
  45. package/skills/_support/docs/principles/details/p036-graceful-degradation.md +137 -0
  46. package/skills/_support/docs/principles/details/p037-idempotency-before-retry.md +139 -0
  47. package/skills/_support/docs/principles/details/p038-bounded-retry.md +145 -0
  48. package/skills/_support/docs/principles/details/p039-bounded-waiting.md +151 -0
  49. package/skills/_support/docs/principles/details/p040-bounded-resources.md +138 -0
  50. package/skills/_support/docs/principles/details/p041-backpressure-and-load-shedding.md +141 -0
  51. package/skills/_support/docs/principles/details/p042-fault-isolation-bulkheads.md +140 -0
  52. package/skills/_support/docs/principles/details/p043-circuit-breakers.md +148 -0
  53. package/skills/_support/docs/principles/details/p044-atomicity-where-possible.md +141 -0
  54. package/skills/_support/docs/principles/details/p045-compensation-where-atomicity-is-impossible.md +163 -0
  55. package/skills/_support/docs/principles/details/p046-resumability.md +138 -0
  56. package/skills/_support/docs/principles/details/p047-observability-is-part-of-correctness.md +134 -0
  57. package/skills/_support/docs/principles/details/p048-secure-by-design.md +132 -0
  58. package/skills/_support/docs/principles/details/p049-secure-by-default.md +126 -0
  59. package/skills/_support/docs/principles/details/p050-least-privilege.md +123 -0
  60. package/skills/_support/docs/principles/details/p051-complete-mediation.md +124 -0
  61. package/skills/_support/docs/principles/details/p052-separation-of-duties.md +129 -0
  62. package/skills/_support/docs/principles/details/p053-validate-at-trust-boundaries.md +126 -0
  63. package/skills/_support/docs/principles/details/p054-defense-in-depth.md +135 -0
  64. package/skills/_support/docs/principles/details/p055-minimize-attack-surface.md +133 -0
  65. package/skills/_support/docs/principles/details/p056-secrets-stay-out-of-code-and-context.md +137 -0
  66. package/skills/_support/docs/principles/details/p057-supply-chain-integrity.md +135 -0
  67. package/skills/_support/docs/principles/details/p058-bounded-agent-authority.md +137 -0
  68. package/skills/_support/docs/principles/details/p059-data-is-not-instruction.md +130 -0
  69. package/skills/_support/docs/principles/details/p060-constrain-sub-agents.md +136 -0
  70. package/skills/_support/docs/principles/details/p061-separate-decision-from-high-impact-execution.md +131 -0
  71. package/skills/_support/docs/principles/details/p062-human-approval-for-irreversible-or-high-risk-actions.md +129 -0
  72. package/skills/_support/docs/principles/details/p063-requirement-to-code-traceability.md +116 -0
  73. package/skills/_support/docs/principles/details/p064-requirement-to-test-traceability.md +116 -0
  74. package/skills/_support/docs/principles/details/p065-verify-before-claiming-completion.md +129 -0
  75. package/skills/_support/docs/principles/details/p066-preserve-existing-work.md +114 -0
  76. package/skills/_support/docs/principles/details/p067-no-test-cheating.md +126 -0
  77. package/skills/_support/docs/principles/details/p068-no-validation-bypass.md +119 -0
  78. package/skills/_support/docs/principles/details/p069-independent-review-for-high-risk-changes.md +129 -0
  79. package/skills/_support/docs/principles/details/p070-code-health-must-not-regress.md +116 -0
  80. package/skills/_support/docs/principles/details/p071-consistency-over-personal-preference.md +117 -0
  81. package/skills/_support/docs/principles/details/p072-technical-evidence-over-preference.md +122 -0
  82. package/skills/_support/docs/principles/details/p073-optimize-only-with-evidence.md +123 -0
  83. package/skills/_support/docs/principles/details/p074-prefer-existing-mechanisms.md +121 -0
  84. package/skills/_support/docs/principles/details/p075-make-invalid-states-hard-to-represent.md +128 -0
  85. package/skills/_support/docs/principles/details/p076-parse-then-validate-then-operate.md +133 -0
  86. package/skills/_support/docs/principles/details/p077-separate-policy-from-mechanism.md +112 -0
  87. package/skills/_support/docs/principles/details/p078-single-source-of-truth.md +131 -0
  88. package/skills/_support/docs/principles/details/p079-explicit-ownership-and-lifetimes.md +124 -0
  89. package/skills/_support/docs/principles/details/p080-make-concurrency-deliberate.md +122 -0
  90. package/skills/_support/docs/principles/details/p081-forward-progress-with-safety.md +125 -0
  91. package/skills/_support/docs/principles/details/p082-design-for-cancellation.md +133 -0
  92. package/skills/_support/docs/principles/details/p083-irreversible-actions-last.md +124 -0
  93. package/skills/_support/docs/principles/details/p084-prefer-local-reasoning.md +131 -0
  94. package/skills/_support/docs/principles/details/p085-explicit-is-better-than-implicit.md +123 -0
  95. package/skills/_support/docs/principles/details/p086-readability-counts.md +113 -0
  96. package/skills/_support/docs/principles/details/p087-comments-explain-why-code-explains-what.md +120 -0
  97. package/skills/_support/docs/principles/details/p088-delete-dead-code.md +125 -0
  98. package/skills/_support/docs/principles/details/p089-delete-obsolete-configuration-and-dependencies.md +125 -0
  99. package/skills/_support/docs/principles/details/p090-prefer-negative-code.md +134 -0
  100. package/skills/_support/docs/principles/details/p091-test-driven-development.md +149 -0
  101. package/skills/_support/docs/review/README.md +59 -0
  102. package/skills/_support/docs/review/behavior-first-testing.md +73 -0
  103. package/skills/_support/docs/review/common.md +365 -0
  104. package/skills/_support/docs/review/design-docs.md +74 -0
  105. package/skills/_support/docs/review/issue-planning.md +220 -0
  106. package/skills/_support/docs/review/language-routing.md +141 -0
  107. package/skills/_support/docs/review/repository-scorecard.md +170 -0
  108. package/skills/advise/SKILL.md +102 -40
  109. package/skills/advise/scripts/list_retrievable_skills.py +3 -3
  110. package/skills/brainstorm/SKILL.md +167 -76
  111. package/skills/change-review/SKILL.md +99 -43
  112. package/skills/change-review/references/scope-resolution.md +70 -41
  113. package/skills/change-review/scripts/resolve_scope.py +119 -73
  114. package/skills/finalize-plan/SKILL.md +208 -100
  115. package/skills/git-worktrees/SKILL.md +108 -59
  116. package/skills/git-worktrees/scripts/prepare_worktree.py +16 -10
  117. package/skills/issue-review/SKILL.md +143 -47
  118. package/skills/learn/SKILL.md +284 -162
  119. package/skills/myrmidon-swarm/SKILL.md +136 -61
  120. package/skills/plan-issue/SKILL.md +129 -47
  121. package/skills/pr-review/SKILL.md +170 -71
  122. package/skills/pr-review/references/criteria.md +61 -14
  123. package/skills/pr-review/references/delivery.md +159 -80
  124. package/skills/pr-review/references/evidence.md +268 -139
  125. package/skills/pr-review/references/prevalidated.md +91 -48
  126. package/skills/pr-review/scripts/collect_evidence.py +211 -140
  127. package/skills/pr-review/scripts/diff_context.py +6 -4
  128. package/skills/pr-review/scripts/materialize_snapshot.py +112 -120
  129. package/skills/pr-review/scripts/pr_identity.py +27 -15
  130. package/skills/pr-review/scripts/resolve_pr.py +53 -31
  131. package/skills/repo-review/SKILL.md +209 -87
  132. package/skills/systematic-debugging/SKILL.md +195 -131
  133. package/skills/systematic-debugging/scripts/repository_evidence.py +9 -4
  134. package/skills/test-driven-development/SKILL.md +134 -53
  135. package/skills/tidy/SKILL.md +97 -33
  136. package/skills/tidy/scripts/run_tidy.py +3 -3
@@ -1,198 +1,262 @@
1
1
  ---
2
2
  name: systematic-debugging
3
3
  license: BSD-3-Clause
4
- description: Investigate root cause before fixing bugs or unexpected behavior. Requires the Mnemosyne knowledge backend through advise and fails closed when it cannot be prepared.
4
+ description: Investigate root cause before you repair a bug or unexpected behavior. This skill requires the Mnemosyne knowledge backend through advise. Stop if the backend cannot be prepared.
5
5
  argument-hint: <description of the bug or failure>
6
6
  allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent]
7
7
  ---
8
8
 
9
- # Systematic Debugging
9
+ # Systematic debugging
10
10
 
11
11
  ## Overview
12
12
 
13
- Random fixes waste time and create new bugs. Quick patches mask underlying issues.
13
+ A repair without evidence wastes time and can create a new bug. A repair of only the symptom can
14
+ hide the root cause.
14
15
 
15
- **Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
16
+ Apply the [ASD-STE100 technical-English policy](../TECHNICAL_ENGLISH.md) to this skill and to
17
+ all prose that it produces.
16
18
 
17
- **Violating the letter of this process is violating the spirit of debugging.**
19
+ ## Working rules
18
20
 
19
- ## Before Starting
21
+ Find the root cause before you attempt a repair. Do not repair only the symptom. Follow each
22
+ required step in this process.
23
+
24
+ ## Engineering principles
20
25
 
21
- Run `advise` with the error description. Failure to prepare the required knowledge backend is a
22
- blocking error, not permission to skip prior-knowledge search.
26
+ Use Athena's [canonical engineering-principles catalog](../_support/docs/principles/README.md) for the
27
+ principle definitions. Use these principles in this workflow:
23
28
 
24
- ## The Iron Law
29
+ - [P012 Evidence Before Modification](../_support/docs/principles/README.md#p012): Before you select a
30
+ repair, examine symptoms, changes, contracts, and repository guidance.
31
+ - [P015 — Architecture Conformance](../_support/docs/principles/README.md#p015): Before you change the
32
+ architecture, compare the failure path with the repository boundaries.
33
+ - [P022 — Test Behavior, Not Implementation](../_support/docs/principles/README.md#p022): Reproduce the
34
+ observable contract. Add a test for this contract. Do not add a test for the private
35
+ implementation.
36
+ - [P029 — Generalize Error Policy; Preserve Specific Cause](../_support/docs/principles/README.md#p029):
37
+ Use a stable error policy at the boundary. Keep the initial cause.
38
+ - [P031 — Propagate Rather Than Swallow](../_support/docs/principles/README.md#p031): If this layer cannot
39
+ fully recover from the failure, propagate the failure.
40
+ - [P047 — Observability Is Part of Correctness](../_support/docs/principles/README.md#p047): Collect the
41
+ minimum evidence that is necessary to find the fault. Correlate the evidence. Use a structured
42
+ data format. Do not include sensitive data.
43
+ - [P065 — Verify Before Claiming Completion](../_support/docs/principles/README.md#p065): Before you tell the
44
+ user that you corrected the fault, do the initial reproduction again. Then, do the applicable
45
+ repository checks.
46
+ - [P072 — Technical Evidence Over Preference](../_support/docs/principles/README.md#p072): Use only collected
47
+ evidence to accept or reject a hypothesis.
25
48
 
26
- ```text
27
- NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
28
- ```
49
+ ## Before you start
29
50
 
30
- If you haven't completed Phase 1, you cannot propose fixes.
51
+ Run `advise` with the error description. If you cannot prepare the required knowledge backend,
52
+ stop. Do not skip the prior-knowledge search.
31
53
 
32
- ## When to Use
54
+ ## Required sequence
33
55
 
34
- Use for ANY technical issue:
56
+ Complete phase 1 before you propose a repair.
35
57
 
36
- - Test failures
37
- - Bugs in production
38
- - Unexpected behavior
39
- - Performance problems
40
- - Build failures
41
- - Integration issues
58
+ ## When to use
42
59
 
43
- **Use this ESPECIALLY when:**
60
+ Use this skill for all technical issues, including:
44
61
 
45
- - Under time pressure (emergencies make guessing tempting)
46
- - "Just one quick fix" seems obvious
47
- - You've already tried multiple fixes
48
- - Previous fix didn't work
49
- - You don't fully understand the issue
62
+ - A test fails.
63
+ - A bug occurs in production.
64
+ - The product has unexpected behavior.
65
+ - The product has a performance problem.
66
+ - A build fails.
67
+ - An integration fails.
50
68
 
51
- ## The Four Phases
69
+ Use this skill especially in these conditions:
52
70
 
53
- You MUST complete each phase before proceeding to the next.
71
+ - You are under time pressure.
72
+ - A repair appears obvious before an investigation.
73
+ - You already attempted multiple repairs.
74
+ - A previous repair did not work.
75
+ - You do not fully understand the issue.
54
76
 
55
- ### Phase 1: Root Cause Investigation
77
+ ## Workflow
56
78
 
57
- **BEFORE attempting ANY fix:**
79
+ Complete each phase before you continue to the next phase.
58
80
 
59
- 1. **Read Error Messages Carefully**
60
- - Don't skip past errors or warnings
61
- - They often contain the exact solution
62
- - Read stack traces completely
63
- - Note line numbers, file paths, error codes
81
+ ### Phase 1: Root cause investigation
64
82
 
65
- 2. **Reproduce Consistently**
66
- - Can you trigger it reliably?
67
- - What are the exact steps?
68
- - Does it happen every time?
69
- - If not reproducible → gather more data, don't guess
83
+ Before you attempt a repair, complete these steps:
70
84
 
71
- 3. **Check Recent Changes**
72
- - What changed that could cause this?
73
- - `git diff`, recent commits
74
- - New dependencies, config changes
75
- - Environmental differences
85
+ 1. Record these items from the complete failure output:
76
86
 
77
- 4. **Gather Evidence in Multi-Component Systems**
87
+ - each error and warning;
88
+ - the complete stack trace;
89
+ - line numbers;
90
+ - file paths;
91
+ - error codes.
78
92
 
79
- **WHEN system has multiple components:**
93
+ 2. Do not skip an error or warning. An error message can identify the cause.
94
+ 3. Reproduce the failure consistently.
95
+ 4. Record the exact conditions, steps, and frequency of the failure.
96
+ 5. If you cannot reproduce the failure, collect more data.
97
+ 6. Do not guess the cause.
98
+ 7. Compare the failed state with recent repository history.
99
+ 8. Inspect these possible sources of the failure:
80
100
 
81
- **BEFORE proposing fixes, add diagnostic instrumentation:**
101
+ - `git diff`;
102
+ - recent commits;
103
+ - new dependencies;
104
+ - configuration changes;
105
+ - environment differences.
82
106
 
83
- ```text
84
- For EACH component boundary:
85
- - Log what data enters component
86
- - Log what data exits component
87
- - Verify environment/config propagation
88
- - Check state at each layer
107
+ 9. If the system has multiple components, isolate the failed boundary.
108
+ 10. Before you propose a repair, add only the minimum non-sensitive diagnostic instrumentation that
109
+ [P047 Observability Is Part of Correctness](../_support/docs/principles/README.md#p047) requires.
110
+ 11. At each component boundary:
89
111
 
90
- Run once to gather evidence showing WHERE it breaks
91
- THEN analyze evidence to identify failing component
92
- THEN investigate that specific component
93
- ```
112
+ - log the input data;
113
+ - log the output data;
114
+ - verify the transfer of environment and configuration data;
115
+ - examine the state at each layer.
116
+
117
+ 12. Run the instrumented reproduction one time to collect evidence.
118
+ 13. Use the evidence to identify the failed component.
119
+ 14. Investigate that component.
120
+ 15. If an incorrect value is deep in the call stack, trace the value back to its source.
121
+ 16. Identify where the incorrect value starts and which caller supplied it.
122
+ 17. Continue the trace until you find the source.
123
+ 18. Identify the source as the repair location.
124
+ 19. Do not repair only the symptom.
125
+
126
+ ### Phase 2: Pattern analysis
127
+
128
+ Identify the pattern before you make a repair:
129
+
130
+ 1. Find correct examples of similar code in the same repository.
131
+ 2. Read each applicable reference implementation completely.
132
+ 3. Do not read only a sample.
133
+ 4. List each difference between the correct code and the code that fails.
134
+ 5. Identify all dependencies and all configuration and environment assumptions.
135
+
136
+ ### Phase 3: Hypothesis and test
94
137
 
95
- 5. **Trace Data Flow**
138
+ Use this method to test a hypothesis:
96
139
 
97
- When error is deep in call stack:
98
- - Where does the bad value originate?
99
- - What called this with the bad value?
100
- - Keep tracing up until you find the source
101
- - Fix at source, not at symptom
140
+ 1. State one hypothesis: `The root cause is X because Y.`
141
+ 2. Make the minimum possible change to test the hypothesis.
142
+ 3. Change only one variable in each test.
143
+ 4. If the result supports the hypothesis, continue to phase 4.
144
+ 5. If the result does not support the hypothesis, state a new hypothesis.
145
+ 6. If you do not understand X, state `I do not understand X.`
146
+ 7. Do not claim that you understand X.
102
147
 
103
- ### Phase 2: Pattern Analysis
148
+ ### Phase 4: Implementation
104
149
 
105
- **Find the pattern before fixing:**
150
+ Repair the root cause.
106
151
 
107
- 1. Find working examples of similar code in the same codebase
108
- 2. Read reference implementations completely — don't skim
109
- 3. List every difference between working and broken code
110
- 4. Identify all dependencies, config, environment assumptions
152
+ Do not repair only the symptom.
111
153
 
112
- ### Phase 3: Hypothesis and Testing
154
+ 1. Use the `test-driven-development` skill to create a regression test.
155
+ 2. Under [P026 — Regression Before Repair](../_support/docs/principles/README.md#p026), create the test
156
+ before the repair.
157
+ 3. Under [P022](../_support/docs/principles/README.md#p022), make the test assert observable behavior.
158
+ 4. Under [P028](../_support/docs/principles/README.md#p028), make the test cover the applicable failure
159
+ path.
160
+ 5. Implement one repair that corrects the root cause.
161
+ 6. Under [P065](../_support/docs/principles/README.md#p065), run this validation:
113
162
 
114
- **Scientific method:**
163
+ - Rerun the reproduction.
164
+ - Run the applicable test suite.
165
+ 7. Under [P027](../_support/docs/principles/README.md#p027), keep the test deterministic and isolated.
166
+ 8. Under [P067](../_support/docs/principles/README.md#p067), do not weaken tests.
167
+ 9. Under [P068](../_support/docs/principles/README.md#p068), do not bypass validation.
115
168
 
116
- 1. **Form single hypothesis**: "I think X is the root cause because Y"
117
- 2. **Test minimally**: Make the SMALLEST possible change to test the hypothesis
118
- 3. **One variable at a time**: Don't fix multiple things at once
119
- 4. **Verify before continuing**: If it worked → Phase 4. Didn't work → new hypothesis
120
- 5. **When stuck**: Say "I don't understand X" — don't pretend to know
169
+ If the repair changes failure behavior, complete these steps:
121
170
 
122
- ### Phase 4: Implementation
171
+ 1. Under [P029](../_support/docs/principles/README.md#p029), generalize the policy.
172
+ 2. Under [P029](../_support/docs/principles/README.md#p029), preserve the cause.
173
+ 3. Handle the failure at the
174
+ [nearest responsible boundary](../_support/docs/principles/README.md#p030).
175
+ 4. [Propagate unrecovered failures](../_support/docs/principles/README.md#p031).
176
+ 5. [Handle the failure once without losing causality](../_support/docs/principles/README.md#p032).
177
+ 6. Under [P033](../_support/docs/principles/README.md#p033), preserve valid state.
178
+ 7. Select [fail-fast](../_support/docs/principles/README.md#p034),
179
+ [fail-closed](../_support/docs/principles/README.md#p035), or
180
+ [graceful degradation](../_support/docs/principles/README.md#p036).
181
+ 8. Base this selection on the correctness and security importance of the failed capability.
182
+
183
+ If the repair does not correct the issue, complete these steps:
184
+
185
+ 1. Stop the current repair attempt.
186
+ 2. Count the failed repair attempts.
187
+ 3. If fewer than three repairs failed, return to phase 1 with the new information.
188
+ 4. After three failed repairs, start an architecture review.
123
189
 
124
- **Fix the root cause, not the symptom:**
190
+ ### After three failed repairs
125
191
 
126
- 1. **Create failing test case** using the `test-driven-development` skill it must exist before fixing
127
- 2. **Implement single fix** addressing the root cause
128
- 3. **Verify fix**: Test passes? No other tests broken? Issue actually resolved?
192
+ Repeated failed repairs can show an incorrect model, a missing dependency, or an architecture
193
+ problem. They require a new assessment. They do not prove that the architecture is incorrect.
129
194
 
130
- 4. **If fix doesn't work:**
131
- - STOP
132
- - Count: How many fixes have you tried?
133
- - If < 3: Return to Phase 1 with new information
134
- - **If ≥ 3: STOP and question the architecture**
195
+ Review the evidence for these conditions:
135
196
 
136
- 5. **If 3+ fixes failed Question Architecture:**
197
+ - Each repair reveals new shared state, coupling, or a problem in another component.
198
+ - A repair requires a large refactor.
199
+ - Each repair creates a new symptom in another component.
137
200
 
138
- Pattern indicating architectural problem:
139
- - Each fix reveals new shared state/coupling/problem elsewhere
140
- - Fixes require massive refactoring to implement
141
- - Each fix creates new symptoms elsewhere
201
+ Before another repair attempt, discuss the collected evidence with the user. If the evidence shows
202
+ an incorrect hypothesis, return to phase 1. Propose an architecture change only if the evidence
203
+ supports it.
142
204
 
143
- STOP and discuss with user before attempting more fixes.
144
- This is not a failed hypothesis — this is a wrong architecture.
205
+ ## Stop conditions
145
206
 
146
- ## Red Flags STOP and Follow Process
207
+ Stop if one of these conditions applies:
147
208
 
148
- - "Quick fix for now, investigate later"
149
- - "Just try changing X and see if it works"
150
- - "Add multiple changes, run tests"
151
- - "It's probably X, let me fix that"
152
- - "I don't fully understand but this might work"
153
- - "One more fix attempt" (when already tried 2+)
154
- - Each fix reveals a new problem in a different place
209
+ - You plan a temporary repair before an investigation.
210
+ - You plan to change X only to see the result.
211
+ - You plan to make multiple changes before a test.
212
+ - You select a probable cause without evidence.
213
+ - You do not understand the issue but plan a repair.
214
+ - You plan another repair after two failed repairs.
215
+ - Each repair reveals a new problem in a different component.
155
216
 
156
- **ALL of these mean: STOP. Return to Phase 1.**
217
+ After you stop, return to phase 1.
157
218
 
158
- ## Common Rationalizations
219
+ ## Failed approaches
159
220
 
160
- | Excuse | Reality |
161
- | -------- | --------- |
162
- | "Issue is simple, don't need process" | Simple issues have root causes too. |
163
- | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check. |
164
- | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
165
- | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
166
- | "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Don't fix again. |
221
+ - Do not omit this process for a simple issue. A simple issue also has a root cause.
222
+ - Do not omit this process during an emergency. Systematic debugging is faster than repairs without
223
+ evidence.
224
+ - Do not attempt a repair before the investigation. The first repair can affect the next evidence.
225
+ - Do not make multiple repairs at the same time. You cannot identify which repair changed the
226
+ result, and the repairs can cause new bugs.
227
+ - After three failed repairs, do not make another repair from a guess. Start an architecture review.
167
228
 
168
229
  ## Repository command discovery
169
230
 
170
- Before running a check, discover the target repository's commands from `AGENTS.md`, task runners,
171
- manifests, lockfiles, and CI. Prefer the command used by required CI. If sources conflict or no safe
172
- command is discoverable, ask the user rather than substituting Athena's own tooling.
231
+ Before you run a check, find the target repository commands. Inspect `AGENTS.md`, task runners,
232
+ manifests, lockfiles, and continuous integration (CI) configuration. Prefer the command that required
233
+ CI uses.
234
+ If the sources conflict or you cannot find a safe command, ask the user. Do not use Athena commands
235
+ as a substitute.
173
236
 
174
237
  Keep the target repository as the current working directory. Resolve
175
- `scripts/repository_evidence.py` against this installed skill directory and invoke that absolute
176
- helper path with `PATTERN --source-root SOURCE_ROOT` to collect the latest ten commits, a diff
177
- bounded to that revision window, and matching source locations as JSON. Run the
178
- discovered repository-focused test and type-check commands directly through the host execution
179
- tool, retaining their complete output as evidence.
238
+ `scripts/repository_evidence.py` against this installed skill directory. Invoke that absolute helper
239
+ path with `PATTERN --source-root SOURCE_ROOT`. The helper collects the latest ten commits, a diff
240
+ bounded to that revision window, and matching source locations as JSON. Run the discovered
241
+ repository-focused test and type-check commands through the host execution tool. Keep their complete
242
+ output as evidence.
180
243
 
181
- ## After Resolution
244
+ ## After resolution
182
245
 
183
- Verify with fresh runnable evidence per the evidence-integrity policy before claiming the bug is
184
- fixed; rerun the failing reproduction and the repository-defined checks.
246
+ Before you state that the bug is fixed, verify the result with fresh runnable evidence under the
247
+ [evidence-integrity policy](../_support/docs/policies/evidence-integrity.md). Rerun the original
248
+ reproduction. Run the repository-defined checks again.
185
249
 
186
- Offer to invoke `learn` when the session produced durable debugging knowledge. An indirect Learn
187
- invocation remains read-only and does not expand the requested scope; use Learn's delivery boundary
188
- when durable learning is requested. Useful lessons include:
250
+ If the session produces durable debugging knowledge, offer to invoke `learn`. An indirect `learn`
251
+ invocation is read-only and does not increase the requested scope. If the user requests durable
252
+ learning, use the delivery boundary of `learn`. Useful lessons include these items:
189
253
 
190
- - Root cause category and symptoms
191
- - What diagnostic steps revealed it
192
- - The fix pattern
193
- - Any architectural issues uncovered
254
+ - the root-cause category and symptoms;
255
+ - the diagnostic steps that revealed the cause;
256
+ - the repair pattern; and
257
+ - each architecture issue that the investigation found.
194
258
 
195
- This prevents the same debugging session from being repeated by another agent.
259
+ This record prevents another agent from repeating the same debugging session.
196
260
 
197
261
  ---
198
262
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env python3
2
- """Collect reproducible recent-change and source-pattern evidence."""
2
+ """Collect reproducible evidence about recent changes and source patterns."""
3
3
 
4
4
  from __future__ import annotations
5
5
 
@@ -18,7 +18,10 @@ EMPTY_TREE = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
18
18
  def run(*arguments: str, accepted_codes: tuple[int, ...] = (0,)) -> str:
19
19
  result = run_command(arguments, capture_output=True, text=True, check=False)
20
20
  if result.returncode not in accepted_codes:
21
- raise RuntimeError(result.stderr.strip() or f"{' '.join(arguments)} failed")
21
+ raise RuntimeError(
22
+ result.stderr.strip()
23
+ or f"The command failed. Command: {' '.join(arguments)}"
24
+ )
22
25
  return result.stdout
23
26
 
24
27
 
@@ -33,9 +36,11 @@ def main() -> int:
33
36
  "git", "rev-list", "--max-count=10", "HEAD"
34
37
  ).splitlines()
35
38
  except RuntimeError as error:
36
- raise RuntimeError(f"cannot resolve HEAD: {error}") from error
39
+ raise RuntimeError(f"The tool cannot resolve HEAD: {error}") from error
37
40
  if not recent_revisions:
38
- raise RuntimeError("cannot resolve HEAD: repository has no commits")
41
+ raise RuntimeError(
42
+ "The tool cannot resolve HEAD because the repository has no commits."
43
+ )
39
44
  recent_commits = run("git", "log", "--oneline", "-10")
40
45
  oldest_parent = run(
41
46
  "git",