refacil-sdd-ai 5.0.4 → 5.0.5
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.
- package/README.md +2 -0
- package/agents/debugger.md +12 -3
- package/package.json +1 -1
- package/skills/bug/SKILL.md +7 -0
package/README.md
CHANGED
|
@@ -443,6 +443,8 @@ Local bus (WebSocket over `127.0.0.1`) so agents across different repos can comm
|
|
|
443
443
|
|
|
444
444
|
**SDD-AI conventions in the bus**: anyone in the room joined with `/refacil:join` (methodology already active in the repo). **Change requests** to another session go with **clear scope** in the `ask` (no pasting the guide in every message); the destination repo channels with **`/refacil:propose`** and whoever implements **closes via bus** to who requested the work. Details and edge cases: `refacil-prereqs/BUS-CROSS-REPO.md` in the installed skills.
|
|
445
445
|
|
|
446
|
+
**Contract-first questions (recommended)**: for cross-repo integration clarifications, format `ask/reply` around contract fields (integration point, input contract, output contract, compatibility, source of truth). If the first response is partial, send a focused retry `ask` only for unresolved points. This keeps bus conversations actionable for integration work instead of generic chat.
|
|
447
|
+
|
|
446
448
|
**Pure observer** (0 tokens): `refacil-sdd-ai bus watch <session>` or `refacil-sdd-ai bus view` for the web UI.
|
|
447
449
|
|
|
448
450
|
> **Diagrams, scenarios and pitch**: see `refacil-bus-diagrams.md` (included in the package) — includes architecture, flow with attend, flow without attend, comparative impact table, and visual decision guide (Mermaid).
|
package/agents/debugger.md
CHANGED
|
@@ -56,20 +56,26 @@ If you prefer to continue here, provide:
|
|
|
56
56
|
|
|
57
57
|
The main agent passes you: `mode: investigation` + bug `description`.
|
|
58
58
|
|
|
59
|
-
### Step 1:
|
|
59
|
+
### Step 1: Reproduce and minimize first
|
|
60
|
+
|
|
61
|
+
- Define the minimal reproducible scenario from the description (inputs, trigger, observed failure).
|
|
62
|
+
- Narrow scope to the smallest code path that can still explain the failure.
|
|
63
|
+
|
|
64
|
+
### Step 2: Investigate root cause
|
|
60
65
|
|
|
61
66
|
- Search the codebase for symbols/files mentioned in logs or stack traces from the description.
|
|
62
67
|
- Trace the flow from entry (controller/endpoint) to the failure point.
|
|
63
68
|
- Review recent commits if the bug is new: `git log --oneline -20`.
|
|
64
69
|
- If the cause seems to be in an interaction with another repo (unexpected API response, event with a different format, broken contract on the producer/consumer side), indicate it in `hypotheses` with `crossRepo: true` and the protocol from `refacil-prereqs/BUS-CROSS-REPO.md` so the wrapper resolves it.
|
|
65
70
|
|
|
66
|
-
### Step
|
|
71
|
+
### Step 3: Formulate hypotheses with evidence
|
|
67
72
|
|
|
68
73
|
Prepare 1-3 hypotheses ordered by confidence (`high`/`medium`/`low`), each with:
|
|
69
74
|
- Suspicious file and line.
|
|
70
75
|
- Description of the unhandled condition.
|
|
76
|
+
- Evidence that supports the hypothesis (repro observation, log, code path check).
|
|
71
77
|
|
|
72
|
-
### Step
|
|
78
|
+
### Step 4: Propose fix for hypothesis #1
|
|
73
79
|
|
|
74
80
|
Describe:
|
|
75
81
|
- Minimum necessary change.
|
|
@@ -84,6 +90,7 @@ Describe:
|
|
|
84
90
|
|
|
85
91
|
Hypotheses (ordered by confidence):
|
|
86
92
|
1. [high|medium|low] file:line — [description]
|
|
93
|
+
Evidence: [what validates this hypothesis]
|
|
87
94
|
2. ...
|
|
88
95
|
|
|
89
96
|
Proposed fix for hypothesis #1:
|
|
@@ -101,6 +108,7 @@ Proposed fix for hypothesis #1:
|
|
|
101
108
|
"file": "<path/file>",
|
|
102
109
|
"line": <int or null>,
|
|
103
110
|
"description": "<description of the cause>",
|
|
111
|
+
"evidence": "<brief evidence backing this hypothesis>",
|
|
104
112
|
"crossRepo": <bool>
|
|
105
113
|
}
|
|
106
114
|
],
|
|
@@ -197,6 +205,7 @@ Resolve and run the test command according to `METHODOLOGY-CONTRACT.md §3`. All
|
|
|
197
205
|
## Rules
|
|
198
206
|
|
|
199
207
|
- In mode=investigation: **NEVER modify files**. Only report hypotheses and proposed fix.
|
|
208
|
+
- In mode=investigation: follow diagnose loop discipline (reproduce, minimize, hypothesize, validate evidence) before proposing a fix.
|
|
200
209
|
- In mode=fix: the fix must be MINIMAL. Never over-refactor.
|
|
201
210
|
- Regression tests are MANDATORY in mode=fix.
|
|
202
211
|
- Use **concise** output mode by default.
|
package/package.json
CHANGED
package/skills/bug/SKILL.md
CHANGED
|
@@ -8,6 +8,9 @@ user-invocable: true
|
|
|
8
8
|
|
|
9
9
|
This skill is a **wrapper** that guides the user through the bug fix flow and delegates the heavy work to the `refacil-debugger` sub-agent. The sub-agent operates in two modes: `investigation` (analyzes and proposes hypotheses without modifying anything) and `fix` (implements the approved correction, generates tests, and creates traceability). Hypothesis confirmation and branch validation occur in this wrapper, between the two invocations.
|
|
10
10
|
|
|
11
|
+
The investigation stage follows a **diagnose loop** to reduce weak fixes:
|
|
12
|
+
1) reproduce, 2) minimize scope, 3) form evidence-backed hypotheses, 4) validate evidence, 5) propose minimal correction.
|
|
13
|
+
|
|
11
14
|
**Prerequisites**: `agents` profile from `refacil-prereqs/SKILL.md` + rules from `METHODOLOGY-CONTRACT.md`.
|
|
12
15
|
|
|
13
16
|
## Flow
|
|
@@ -40,8 +43,10 @@ Invoke the `refacil-debugger` sub-agent passing it:
|
|
|
40
43
|
- `description`: complete bug description (collected in Step 1 or from `$ARGUMENTS`).
|
|
41
44
|
|
|
42
45
|
The sub-agent:
|
|
46
|
+
- Reproduces and minimizes the failure scope first.
|
|
43
47
|
- Searches the codebase for symbols/files from logs or stack traces.
|
|
44
48
|
- Traces the flow from entry to the failure point.
|
|
49
|
+
- Validates hypotheses with explicit evidence.
|
|
45
50
|
- Reviews recent commits if the bug is new.
|
|
46
51
|
- Returns hypotheses ordered by confidence + proposed correction, fenced as ` ```refacil-debug-investigation `.
|
|
47
52
|
|
|
@@ -51,6 +56,7 @@ Show the user the hypotheses and the proposed correction. Ask explicitly:
|
|
|
51
56
|
|
|
52
57
|
```
|
|
53
58
|
Most confident hypothesis: [description — file:line]
|
|
59
|
+
Evidence used: [repro step / observed condition / validation result]
|
|
54
60
|
Proposed fix: [minimal description]
|
|
55
61
|
Files to modify: [list]
|
|
56
62
|
|
|
@@ -162,6 +168,7 @@ If the sub-agent returned `result: "FAILED"` (tests not passing), present the fa
|
|
|
162
168
|
## Rules
|
|
163
169
|
|
|
164
170
|
- **Always investigate before proposing** — do not delegate the fix without a confirmed hypothesis.
|
|
171
|
+
- In investigation, prefer the diagnose loop order: reproduce → minimize → hypothesize → validate evidence → propose fix.
|
|
165
172
|
- **NEVER implement without explicit user approval** (Step 3).
|
|
166
173
|
- **Always validate the branch** (Step 4) before delegating the fix.
|
|
167
174
|
- **Do not replicate investigation or implementation logic here** — that lives in `refacil-debugger`.
|