@antoneeo/agentic-sdlc-skill 1.35.0 → 1.37.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.
@@ -1,71 +1,118 @@
1
1
  # Systematic Debugging
2
2
 
3
- Applies to bugs classified L2 or L3. Entered either from phase 4
4
- (Development and Testing) when a defect surfaces during implementation, or
5
- from the circuit breaker in `SKILL.md` §4 after repeated no-progress runs.
3
+ Applies to bugs classified L2 or L3, from the start of their analysis, including
4
+ defects discovered during implementation. Investigate the observed failure before
5
+ proposing a definitive fix. A suspicious source-code pattern is a hypothesis, not
6
+ proof that it caused this incident.
6
7
 
7
8
  ## Method
8
9
 
9
- Work the steps in order; do not skip ahead to a fix before step 3 names the
10
- mechanism.
11
-
12
- 1. **Reproduce deterministically.** Find the smallest input or scenario that
13
- triggers the bug every time. A bug you cannot reliably reproduce cannot be
14
- verified as fixed.
15
- 2. **Isolate.** Narrow the failing case to its minimal form — strip
16
- unrelated setup, unrelated data, unrelated code paths. Bisect (recent
17
- commits, code paths, input ranges) when the boundary is unclear.
18
- 3. **Root cause — name the mechanism.** State in one sentence why the
19
- observed behavior happens, tracing the actual execution path. Trace it by
20
- enumerating the real callers/consumers of each suspect symbol with the best
21
- symbol-graph tool your toolchain offers — an IDE/LSP call hierarchy or a
22
- find-usages / call-graph capability — not text search; `grep`
23
- under-enumerates and hides the very consumer that breaks. **MUST NOT
24
- patch a symptom without naming the mechanism; why: symptom patches recur
25
- and stack** — the same underlying defect resurfaces elsewhere, and each
26
- unexplained patch makes the next investigation harder, not easier.
27
- 4. **Fix at the cause**, not at the symptom identified in step 1.
28
- 5. **Write a regression test that FAILS on the old code** (verify this
29
- before applying the fix, or by temporarily reverting it) and passes after.
30
- A regression test that was never confirmed to fail proves nothing.
31
- 6. **Run the relevant suite for collateral.** A root-cause fix can change
32
- behavior other callers depend on; enumerate those callers with the
33
- symbol-graph (step 3), not from memory, and check them before closing.
34
-
35
- **Capture the model you had to rebuild.** If naming the mechanism (step 3) forced
36
- you to reconstruct the mental model of a complex component that no guide documents —
37
- tracing it across files because it was written down nowhere — that is the
38
- comprehension trigger (`guides.md` §1): it is your duty to write the `source_kind:
39
- code` guide, so the next debugger starts with the map you just paid to build.
40
-
41
- **Chronic fragility is a signal, not a task to grind.** If a component breaks
42
- *repeatedly across sessions* and its complexity is no longer under control, stop
43
- treating each break as an isolated bug — that pattern has two duties, not one:
44
- 1. **Understand** — write the `source_kind: code` comprehension guide (above) so the
45
- understanding stops evaporating between sessions.
46
- 2. **Escalate the complexity itself** — STOP stacking patches on a component nobody
47
- fully understands. Flag the fragility as tech debt and propose a dedicated
48
- **refactor as its own L3** (Vision-gated), instead of a fourth fix. Continuing to
49
- patch a component you keep breaking is the anti-pattern, not the fix.
10
+ 1. **Establish the facts.** State expected versus observed behavior, affected
11
+ environment, timing and last known working state. Read available local incident
12
+ evidence first: relevant logs, stack traces, request/response, effective
13
+ configuration and service state. Preserve evidence before restarts or changes
14
+ erase it; urgent containment may come first, but label it temporary and record
15
+ what evidence could not be preserved. Logs may be partial or misleading: check
16
+ their scope and time window. Do not exhaust every log or wait for nonexistent
17
+ logs when a direct observation is available. Read only what is needed, redact
18
+ secrets/personal data in reports, and keep sensitive raw logs out of project docs.
50
19
 
51
- ## Circuit breaker integration
20
+ 2. **Maintain the hypotheses.** Keep a small register in the existing L2
21
+ mini-analysis or L3 ANALYSIS/Action Plan, not a new mandatory document:
22
+
23
+ | Cause hypothesis | Evidence for/against | Likelihood and basis | Verification cost | Check and result | Current hypothesis status |
24
+ |---|---|---|---|---|---|
25
+
26
+ Use high/medium/low or unknown likelihood and rough costs, with reasons; do not
27
+ invent numerical probabilities. Prefer hypotheses that are both more likely
28
+ and cheaper to verify. When those criteria conflict, choose a check with useful
29
+ discrimination between the remaining explanations and justify that choice.
30
+ State what observation would support or invalidate the hypothesis before the
31
+ check. Record each result, update evidence/status and reorder after every check.
32
+ An inconclusive check leaves the hypothesis open; distinguish a check's outcome
33
+ from the hypothesis's accumulated status (open, confirmed, invalidated).
34
+ Do not repeat an invalidated hypothesis unless new evidence reopens it.
35
+
36
+ 3. **Test and trace the mechanism.** Reproduce and isolate the smallest faithful
37
+ failing case when feasible; bisect inputs, paths or changes when informative.
38
+ Skip a reproduction already known to omit the incident's causal conditions;
39
+ choose a faithful alternative or disclose the gap. Stop diagnostic checks when
40
+ further results cannot change the causal or fix decision; this does not replace
41
+ the regression and recovery verification in step 5.
42
+ If the incident is intermittent or inaccessible, use captured traces and
43
+ targeted diagnostic observations instead of declaring investigation impossible.
44
+ Add minimal instrumentation when evidence is insufficient. Prefer read-only
45
+ checks; run state-changing experiments in a controlled environment under the
46
+ existing authorization boundaries. Read source to answer a concrete question
47
+ arising from evidence, then check its predictions against actual execution.
48
+ A static call graph identifies possible consumers, not the executed path.
49
+
50
+ Use the **five whys** to deepen supported causal links, not to force five
51
+ answers or a single linear cause. Each unsupported answer becomes a hypothesis
52
+ in the register. Allow interacting causes; distinguish why the failure happened
53
+ from why prevention or detection missed it. Stop when the actionable causal
54
+ mechanism is supported, or state the evidence gap instead of inventing a cause.
55
+ Before a definitive fix, name the mechanism and evidence connecting it to this
56
+ failure; explain which alternatives were invalidated and which remain open.
57
+ Missing logs or a passing unrelated test do not invalidate a hypothesis.
58
+
59
+ 4. **Correct the design with Poka-Yoke.** Fix the responsible code, configuration
60
+ or infrastructure; do not force a code edit for an environmental cause.
61
+ Enforce the invariant where the responsibility belongs: prevent the invalid
62
+ condition, or detect and reject it immediately with an explicit outcome when
63
+ prevention is infeasible. Preserve legitimate behavior; a blanket rejection or
64
+ crash is not universally appropriate. Prefer the smallest coherent correction
65
+ over a case-specific exception, duplicated guard, silent fallback or speculative
66
+ broad refactor. Temporary containment is not a definitive fix.
67
+
68
+ Before editing, enumerate affected consumers using the available symbol graph
69
+ and a text coverage probe; reconcile differences and state coverage limits.
70
+ With no graph available, use text/targeted reads and disclose incomplete coverage
71
+ rather than guessing completeness. Apply existing triage/design gates if scope
72
+ expands. Mandatory design verification, preserving this wording verbatim:
52
73
 
53
- After 3 consecutive runs without progress: STOP. Do not attempt a 4th
54
- variation of the same guess. Audit your assumptions from step 1 — is the
55
- reproduction actually deterministic, is the isolated case actually minimal,
56
- is the "root cause" from step 3 actually confirmed or just plausible? Then
57
- restart from step 1 with the corrected assumption.
74
+ > Dopo la correzione il software deve essere fatto come se fosse stato progettato senza quel difetto
75
+
76
+ Explain how the fix satisfies it: the correct owner enforces the invariant,
77
+ the same failure is prevented or detected at origin, no ad hoc exception is
78
+ needed, and valid consumer behavior is preserved. Disclose residual compromises;
79
+ the sentence does not authorize redesign beyond the confirmed defect's scope.
80
+
81
+ 5. **Verify the correction and collateral.** Follow `tdd.md` for implementation:
82
+ confirm a regression test fails for this mechanism on the old implementation
83
+ and passes after the fix. Verify the Poka-Yoke against invalid and valid cases,
84
+ relevant neighboring cases, and concurrency/retry/order where the mechanism
85
+ involves them. Run the relevant consumer suite after the final change.
86
+ If the original incident cannot be replayed, distinguish controlled mechanism
87
+ tests from incident recovery evidence and report remaining uncertainty; do not
88
+ waive available regression tests or claim an unperformed verification.
89
+
90
+ **Capture the model you had to rebuild.** If tracing the cause reconstructed a
91
+ complex component with no CURRENT comprehension guide, write its `source_kind:
92
+ code` guide under `guides.md` §1. Keep evidence and invariants, not sensitive logs.
93
+
94
+ **Chronic fragility is a signal, not a task to grind.** If the component repeatedly
95
+ breaks across sessions and complexity is no longer controlled, preserve its model
96
+ in that guide and surface the debt. Propose a dedicated Vision-gated L3 refactor
97
+ instead of stacking patches; do not silently expand the current fix into it.
98
+
99
+ ## Circuit breaker integration
58
100
 
59
- If still stuck after the restart, ask the user for instructions, and hand
60
- over the evidence gathered so far: the minimal reproduction, what was ruled
61
- out, and the current best hypothesis.
101
+ After three consecutive attempts without new diagnostic information or progress,
102
+ STOP varying the same guess. Audit the evidence, register and checks: did a result
103
+ actually invalidate the hypothesis, did the test reproduce the relevant conditions,
104
+ and was the mechanism confirmed rather than merely plausible? Restart from the
105
+ earliest unsupported step. If still stuck after that restart, ask the user for
106
+ instructions with observed facts, checks/results, invalidated and open hypotheses,
107
+ the evidence gap and any temporary containment. More guesses are not progress.
62
108
 
63
109
  ## Anti-patterns
64
110
 
65
- - **Shotgun debugging**: changing several things at once hoping one fixes it
66
- — when it "works," you do not know which change mattered or why.
67
- - **Stacking speculative fixes**: adding a second guess on top of an
68
- unverified first one instead of confirming or discarding it first.
69
- - **"Fixed but can't say why"**: closing the bug without a step-3 mechanism
70
- statement. If you cannot name the mechanism, the fix is not confirmed —
71
- it may just be masking the trigger.
111
+ - Source-first speculation: patching a plausible defect without tying it to the incident.
112
+ - Shotgun debugging: changing several things at once without a discriminating check.
113
+ - Guess stacking: retaining an unverified fix while adding another.
114
+ - Register theater: invented likelihoods, repeated cheap but uninformative checks,
115
+ or check failure presented as hypothesis falsification without adequate coverage.
116
+ - Five invented whys: unsupported causal links, or forcing one root on interacting causes.
117
+ - Symptom exceptions: suppressing one event or input instead of correcting its invariant.
118
+ - "Fixed but can't say why": closure without causal evidence and the mandatory design check.
@@ -26,7 +26,11 @@ without an E-ISP.
26
26
  - `sdlc_check.py plan brief PLAN_[feature].md --task <id>` — prints the
27
27
  task block, the `produces` of prior-order tasks (interfaces), and
28
28
  `guides` pointers (paths, never pasted content) to stdout.
29
- - Spawn the subagent with that brief as its entire context window.
29
+ - Spawn the subagent with that brief plus the return-doubts line as its
30
+ entire context window. The line: "An open point whose answer changes the
31
+ work is not yours to decide: return it in your final output with what you
32
+ searched." The orchestrator treats them as its own candidate doubts
33
+ (`elicitation.md` §When a doubt emerges).
30
34
  - Run `task.verify` out of band (the orchestrator executes it — the
31
35
  validator only ever prints it, never runs it) plus the one-shot review
32
36
  below.
@@ -1,30 +1,91 @@
1
1
  # Spec Elicitation
2
2
 
3
- `## The question discipline` below governs EVERY question to the user — any
4
- phase, any level, inside or outside the round. The rest of the file is the spec
5
- elicitation round: it applies when an L3 request enters phase 3 (Request
3
+ `## The question discipline` below governs EVERY doubt and EVERY question to the
4
+ user — any phase, any level, inside or outside the round. The rest of the file is
5
+ the spec elicitation round: it applies when an L3 request enters phase 3 (Request
6
6
  Analysis), BEFORE drafting the ANALYSIS document (Standalone) or the D-UC/E-ISP
7
7
  (Hybrid).
8
8
 
9
- Skip path: if the spec is already complete — an approved Vision or explicit user
10
- requirements already answer goal, scope, and constraints, or the remainder is
11
- derivable from the repo, `ai_docs/` and the conversation — skip the round and add
9
+ Skip path: if the spec is already complete — an approved Vision, explicit user
10
+ requirements or an earlier reply already answer goal, scope, and constraints, and
11
+ any remainder is settled as §When a doubt emerges allows — skip the round and add
12
12
  a one-line note in the analysis stating why it was skipped and naming the
13
13
  sources. Do not run the round as a formality when the answers are already on
14
14
  record.
15
15
 
16
16
  Unattended path: when the user is not reachable (a scheduled or autonomous run)
17
- and the skip path does not answer all six, do not stall and do not invent
18
- consensus. Write the missing answers as **declared assumptions** in
19
- `## Objective`, mark the ANALYSIS `BLOCKED on the user`, and stop before
20
- implementation. An assumption on the record is reviewable; a guess folded
21
- silently into a design is not.
17
+ and a real doubt remains, do not stall and do not invent consensus. Write it as a
18
+ **declared assumption** (§Ask before the write) in the artifact it touches. At L3,
19
+ mark the ANALYSIS `BLOCKED on the user` and stop before implementation; below L3,
20
+ proceed and list the assumption in the reply. An assumption on the record is
21
+ reviewable; a guess folded silently into a design is not.
22
22
 
23
23
  ## The question discipline
24
24
 
25
- A question to the user spends their attention and stalls the work; the round
26
- below is the only place the process *plans* that cost. Everywhere, a question is
27
- legal only when BOTH hold:
25
+ A doubt kept silent is decided by the agent alone and reaches the documents
26
+ looking settled; a useless question wastes the user's attention. This section
27
+ rules on both.
28
+
29
+ ### When a doubt emerges
30
+
31
+ A **candidate doubt** is an open point whose answer changes what you build or
32
+ write. The usual signals — they illustrate, they do not close the definition:
33
+
34
+ | Thought | What it means |
35
+ |---|---|
36
+ | "They probably mean…", "I'll assume…" | you are choosing between readings of the request |
37
+ | "The request doesn't say, so I'll fill it in" | a gap in scope, a non-goal, an acceptance criterion or a priority |
38
+ | "Either would work, I'll pick one" | equivalent in effect: yours, pick and do not ask; different in effect: weigh them below |
39
+ | "I'll note it as an assumption and move on" | with the user reachable, that note is where doubts go to be forgotten |
40
+ | "It's reversible, it can be fixed later" | later is after the documents built on it exist |
41
+
42
+ Settle it by kind:
43
+
44
+ - **A fact, or information only the user holds** (a deadline, a price, a
45
+ constraint): settled only by evidence, cited — never settled by a weighing. Left
46
+ open by the search and changing the work, it is a real doubt.
47
+ - **A choice** — a reading of intent, a design trade-off: cite the user's statement
48
+ that settles it (the request, an APPROVED Vision, an earlier reply); failing one,
49
+ weigh the pros and cons of each option, stating each rejected option
50
+ at its strongest — the need it serves best; a weighing won against a weak
51
+ version of the alternative is not a weighing. One clearly outweighs: take it and
52
+ write the weighing with the choice — "I take X over Z: pro …, contro …".
53
+ Balanced, or turning on a user priority not on record: a **real doubt** — and it
54
+ turns on one whenever the options serve different needs of the actor, each better
55
+ at one the actor would notice in using the result (reading in a spreadsheet
56
+ against processing by a program, a quick answer against a complete one) and
57
+ none good enough at both, and nothing the user wrote ranks those needs — however
58
+ clear your own ranking feels. "The more natural reading" with no pros and cons
59
+ written is not a weighing. Design is yours until it trades off something the
60
+ user owns. Reserved approvals never enter this test (§The form of a question).
61
+
62
+ ### Ask before the write
63
+
64
+ A real doubt that passes the legality test below is **owed**, not merely allowed:
65
+ the test separates a doubt from a search not yet run, it never licenses silence.
66
+ Ask it before the first write that would embed its answer — in an analysis, plan,
67
+ guide or code — grouped with every doubt open at that point, in one numbered set,
68
+ with the client's structured-question facility where it has one. Never defer a
69
+ doubt to the deliverable, where the user must find it inside the document; never
70
+ drip one question per turn. The round below is this rule's planned occasion. Fold
71
+ every answer into the artifact, citing the reply (§Reflect); an intent choice with
72
+ neither a source nor a weighing is a finding (`review.md` §Reviewing).
73
+
74
+ **Declared assumptions exist only where no question can be asked:**
75
+
76
+ - **Unattended** — the user is not reachable (the Unattended path above).
77
+ - **Delegated** — the user's own words handed you this choice ("your call"); quote
78
+ them. A general "go ahead" is not a delegation.
79
+
80
+ Each states **what it is taken from** and **the alternative it excludes**, and is
81
+ listed where the user will read it: an assumption recorded alone is a decision
82
+ wearing an assumption's clothes, and one nobody is shown is a silent decision. A
83
+ dispatched subagent returns its open points in its final output (`dispatch.md`);
84
+ the orchestrator treats them as its own candidate doubts (§When a doubt emerges).
85
+
86
+ ### The legality test
87
+
88
+ Everywhere, a question is legal only when BOTH hold:
28
89
 
29
90
  1. **Searched first, and the search is named — with its result.** The answer is
30
91
  not on record and not derivable from the repo, `ai_docs/`, the Vision or the
@@ -48,9 +109,7 @@ Never legal:
48
109
  fork — that is a blocking question and carries the form below.
49
110
  - **Preference-fishing** — asking the user to pick among options that are
50
111
  equivalent **in their effect on the benefit** and already decided by the
51
- project's conventions. Cheapness to undo is NOT the test: nearly everything is
52
- reversible under version control, and "it is reversible" as a licence to stop
53
- asking is the silence-side evasion this clause must not fund.
112
+ project's conventions. Cheapness to undo is NOT the test.
54
113
  - **Re-asking the record** — goal, scope or constraints that an APPROVED Vision,
55
114
  an earlier reply, or the request itself already states.
56
115
 
@@ -58,38 +117,20 @@ What questions are FOR — what the user uniquely owns: the benefit, priorities
58
117
  between conflicting goods, non-goals, acceptance, and the approvals doctrine
59
118
  reserves to them (Vision promotion and amendment, scope changes, proposal
60
119
  acceptance, merge decisions). Facts about intent come from the user; facts about
61
- the system come from search. (The marketing sibling states the same rule as "ask
62
- only what the user uniquely owns"; this is its code-domain form.)
120
+ the system come from search.
63
121
 
64
122
  **Precedence, because both halves can fire at once:** this paragraph wins over
65
123
  the "never legal" list above it. A choice the user uniquely owns is never
66
124
  preference-fishing, however cheap it is to undo; the list reaches choices that
67
125
  are *not* theirs.
68
126
 
69
- **Default non-blocking.** An unknown on which no fork of the work depends: write
70
- it as a **declared assumption** in the artifact it touches — the same mechanism
71
- the unattended path uses — proceed, and present the open points **batched**, with
72
- the round for spec questions or with the deliverable otherwise, answered by
73
- exception.
74
-
75
- This is the path most work takes, so it carries the SAME evidence duty as a
76
- question, not a lighter one — otherwise "assume it" becomes the way to skip the
77
- standard. Each declared assumption states **what it is taken from** ("I take X
78
- from Y" — the same shape the round uses) and **the alternative it excludes**, and
79
- **every declared assumption reaches the batch**: an assumption nobody is shown is
80
- not an open point, it is a silent decision. That pairing is what the kb family's
81
- escalation rule actually does — keep BOTH sides with their sources and surface
82
- them, never silently pick one — and this branch, not the blocking one, is where
83
- it structurally belongs. An assumption recorded with its source and its rejected
84
- alternative is reviewable; one recorded alone is a decision wearing an
85
- assumption's clothes, and a session stalled on a question that could have been
86
- an assumption is the waste this section exists to prevent.
87
-
88
- **Blocking is reserved** for three cases: proceeding under ANY assumption would
89
- waste the work (the forks diverge at once, and the wrong branch is rework of the
90
- whole unit); the doctrine reserves the decision to the user (the approvals
91
- above); or the doctrine itself mandates the stop — and a mandated stop is legal
92
- by mandate, never re-argued here.
127
+ ### The form of a question
128
+
129
+ The approvals reserved above and every stop the doctrine mandates are asked
130
+ whatever you expect the answer: **legal by mandate**, never weighed, never
131
+ re-argued here. Unattended, they are never assumed: the work holds, unless the
132
+ mandating rule prescribes its own unattended handling (`review.md`'s gated rung
133
+ does).
93
134
 
94
135
  **Exactly two mandating files prescribe their own hand-over, and there the form
95
136
  below does not apply** (two forms over one moment is the duplicate `review.md`
@@ -103,16 +144,15 @@ one that prescribes nothing (`guides.md`'s guide proposal and its ingestion
103
144
  bound). "The file mentions the moment" is not a prescription; only a stated
104
145
  hand-over is.
105
146
 
106
- A blocking question carries a mandatory form — surface both sides with their
107
- evidence, never silently pick one:
147
+ A question outside the planned occasions carries the **blocking form**, one line
148
+ per element — surface both sides with their evidence, never silently pick one:
108
149
 
109
- - the fork: the concrete options and what each implies for the work;
150
+ - the fork: the options, each with its pros and cons, and what each implies for
151
+ the work;
110
152
  - the evidence: what you searched, read or tried, and what it leaves undecided;
111
- - why no assumption survives — what work is discarded if you assume and are
112
- wrong. This is what makes case (a) falsifiable: without it, "this is a fork"
113
- is an agent's assertion about its own convenience, and case (a) becomes the
114
- licence for exactly the question this section forbids. Cases (b) and (c) answer
115
- it by citing the approval or the mandate instead;
153
+ - why no assumption survives — why the weighing does not settle it, and what a
154
+ wrong pick costs; a reserved approval or a mandated stop cites the approval or
155
+ the mandate instead;
116
156
  - why it is the user's call — what makes the remainder intent, priority or
117
157
  approval rather than a derivable fact;
118
158
  - what stays blocked until answered.
@@ -120,14 +160,15 @@ evidence, never silently pick one:
120
160
  ## The round
121
161
 
122
162
  **Derive before asking.** Answer each of the six from the record first — the
123
- Vision, `ai_docs/`, the conversation, the code. Ask only the residue, and carry
124
- the derived answers into the round as declared assumptions corrected by
125
- exception ("I take X from Y; the questions below are what no source answers"),
126
- not re-confirmed one by one.
163
+ Vision, `ai_docs/`, the conversation; the code answers facts and constraints,
164
+ never the goal, scope or acceptance. Ask only the real doubts, and carry the
165
+ derived answers into the round with their source or weighing ("I take X from Y;
166
+ the questions below are what no source settles"), not re-confirmed one by one.
127
167
 
128
168
  Ask ONE structured set of questions, not a drip of follow-ups. Keep each
129
169
  question short and numbered; offer concrete options where a real choice
130
- exists (this narrows the reply and speeds up the round). Cover:
170
+ exists, each with its pros and cons (this narrows the reply and speeds up the
171
+ round). Cover:
131
172
 
132
173
  1. **Goal / benefit** — what problem this closes and why now. The answer must
133
174
  name what the actor *obtains*, not a mechanism: "a dashboard" is not an
@@ -165,6 +206,8 @@ run a second round to double-check answers that were already clear.
165
206
 
166
207
  - **Interrogation**: an endless list of questions, or drip-feeding one
167
208
  question at a time across many turns instead of one structured round.
209
+ - **Deferring a doubt into the document**: writing a guess into the artifact
210
+ and leaving the user to find it there.
168
211
  - **Collecting answers without folding them in**: getting replies in chat
169
212
  and proceeding to design without writing them into the analysis document —
170
213
  the next reader has no record of why the scope is what it is.