refacil-sdd-ai 4.2.4 → 4.4.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.
- package/README.md +239 -214
- package/agents/auditor.md +189 -184
- package/agents/debugger.md +201 -204
- package/agents/implementer.md +150 -149
- package/agents/investigator.md +80 -89
- package/agents/proposer.md +219 -124
- package/agents/tester.md +140 -144
- package/agents/validator.md +153 -145
- package/bin/cli.js +158 -116
- package/lib/bus/askFulfillment.js +17 -17
- package/lib/bus/broker.js +599 -599
- package/lib/bus/ui/app.js +318 -318
- package/lib/commands/sdd.js +447 -0
- package/lib/hooks.js +236 -236
- package/lib/installer.js +58 -2
- package/lib/methodology-migration-pending.js +101 -136
- package/package.json +4 -6
- package/skills/apply/SKILL.md +139 -120
- package/skills/archive/SKILL.md +105 -107
- package/skills/ask/SKILL.md +78 -78
- package/skills/attend/SKILL.md +70 -70
- package/skills/bug/SKILL.md +121 -128
- package/skills/explore/SKILL.md +73 -63
- package/skills/guide/SKILL.md +79 -79
- package/skills/inbox/SKILL.md +43 -43
- package/skills/join/SKILL.md +82 -82
- package/skills/prereqs/BUS-CROSS-REPO.md +55 -55
- package/skills/prereqs/METHODOLOGY-CONTRACT.md +122 -115
- package/skills/prereqs/SKILL.md +30 -37
- package/skills/propose/SKILL.md +103 -102
- package/skills/reply/SKILL.md +44 -44
- package/skills/review/SKILL.md +163 -126
- package/skills/review/checklist-back.md +92 -92
- package/skills/review/checklist-front.md +72 -72
- package/skills/review/checklist.md +114 -114
- package/skills/say/SKILL.md +38 -38
- package/skills/setup/SKILL.md +85 -141
- package/skills/setup/troubleshooting.md +38 -35
- package/skills/test/SKILL.md +104 -94
- package/skills/test/testing-patterns.md +63 -63
- package/skills/up-code/SKILL.md +108 -108
- package/skills/update/SKILL.md +109 -132
- package/skills/verify/SKILL.md +159 -132
- package/templates/compact-guidance.md +45 -45
- package/templates/methodology-guide.md +46 -42
- package/config/openspec-config.yaml +0 -8
- package/skills/prereqs/OPENSPEC-DELTAS.md +0 -51
package/skills/attend/SKILL.md
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: refacil:attend
|
|
3
|
-
description:
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# refacil:attend —
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
###
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
refacil-sdd-ai bus attend
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
###
|
|
29
|
-
|
|
30
|
-
**
|
|
31
|
-
1.
|
|
32
|
-
2.
|
|
33
|
-
3.
|
|
34
|
-
4.
|
|
35
|
-
```bash
|
|
36
|
-
refacil-sdd-ai bus reply --text "<
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
5.
|
|
40
|
-
```bash
|
|
41
|
-
refacil-sdd-ai bus reply --text "
|
|
42
|
-
```
|
|
43
|
-
6. **
|
|
44
|
-
|
|
45
|
-
**
|
|
46
|
-
-
|
|
47
|
-
- **
|
|
48
|
-
|
|
49
|
-
###
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
##
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
##
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
##
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
- **
|
|
67
|
-
- **
|
|
68
|
-
- **
|
|
69
|
-
- **
|
|
70
|
-
-
|
|
1
|
+
---
|
|
2
|
+
name: refacil:attend
|
|
3
|
+
description: Active bus listening mode. Waits for questions directed to this session, processes them and responds; then continues listening. Enables automatic LLM-to-LLM conversation between repos.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# refacil:attend — Listen and respond to bus questions
|
|
8
|
+
|
|
9
|
+
Puts this session in listening mode. When a directed question arrives, you respond using your knowledge of the repo and go back to listening. This way other agents can ask you things and receive an automatic response while you are in this mode.
|
|
10
|
+
|
|
11
|
+
## Instructions
|
|
12
|
+
|
|
13
|
+
### Step 1: Execute attend
|
|
14
|
+
|
|
15
|
+
Run via `Bash` with a high timeout (10 minutes / 600000 ms):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
refacil-sdd-ai bus attend
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**IMPORTANT**: when invoking the `Bash` tool, pass `timeout: 600000` (10 min) to take advantage of the maximum.
|
|
22
|
+
|
|
23
|
+
The command:
|
|
24
|
+
- First checks if there are pending questions directed to this session in the recent history
|
|
25
|
+
- If not, waits live for up to 9 minutes for a new directed question
|
|
26
|
+
- Returns as soon as one arrives, or with a "no questions" message if the time passes
|
|
27
|
+
|
|
28
|
+
### Step 2: Process the result
|
|
29
|
+
|
|
30
|
+
**If the output contains "Question received from bus"**:
|
|
31
|
+
1. Read `from:`, `correlationId:`, and `text:` from the output.
|
|
32
|
+
2. If the `text` is a **change request** in **this** repo (not just an informational question), channel it with **`/refacil:propose`** and the SDD-AI flow; in the `reply` summarize status or next step without re-explaining the methodology (whoever asks is already in the room via `join`). See `refacil-prereqs/BUS-CROSS-REPO.md` and `/refacil:ask` Step 1.5.
|
|
33
|
+
3. Investigate the repo to find the answer. Use `Read`, `Grep`, `Glob` as needed.
|
|
34
|
+
4. Respond to the bus with:
|
|
35
|
+
```bash
|
|
36
|
+
refacil-sdd-ai bus reply --text "<your response>"
|
|
37
|
+
```
|
|
38
|
+
The broker autocompletes the `correlationId` with the last question directed to you (the one you just processed).
|
|
39
|
+
5. If the question is outside your scope, still respond:
|
|
40
|
+
```bash
|
|
41
|
+
refacil-sdd-ai bus reply --text "out of my scope, consult repo X"
|
|
42
|
+
```
|
|
43
|
+
6. **Run `refacil-sdd-ai bus attend` again** (step 1) to continue listening.
|
|
44
|
+
|
|
45
|
+
**If the output contains "No questions in"**:
|
|
46
|
+
- There were no questions in the interval.
|
|
47
|
+
- **Run `refacil-sdd-ai bus attend` again** (step 1) to continue listening.
|
|
48
|
+
|
|
49
|
+
### Step 3: Exit the mode
|
|
50
|
+
|
|
51
|
+
The loop continues while the user (dev) does not give you another instruction or aborts with ESC. If the user gives you a new task in the middle of the loop, leave attend and attend to the new task.
|
|
52
|
+
|
|
53
|
+
## When to use attend
|
|
54
|
+
|
|
55
|
+
- When the dev says *"attend the bus for a while"* or *"stay listening to the bus while I do something else"*.
|
|
56
|
+
- When you know another agent will consult you and you want to respond automatically.
|
|
57
|
+
|
|
58
|
+
## When NOT to use attend
|
|
59
|
+
|
|
60
|
+
- If you have an active task the user asked for — finish it first.
|
|
61
|
+
- If the dev needs to use this session for something immediate — attend blocks the session.
|
|
62
|
+
|
|
63
|
+
## Rules
|
|
64
|
+
|
|
65
|
+
- If the `ask` implies **implementing a change in this repo** agreed by the room, after executing it use **`/refacil:propose`** (and the SDD-AI flow) and **close to the requester** via bus (`reply` or other channel according to `refacil-prereqs/BUS-CROSS-REPO.md`); do not close silently.
|
|
66
|
+
- **Always re-invoke attend after responding** — a single `attend` handles a single question; you maintain the loop yourself.
|
|
67
|
+
- **Do not respond from general knowledge**: use repo files as the source. If you do not know, say so.
|
|
68
|
+
- **Do not send secrets or tokens** in responses — messages stay 7 days on local disk.
|
|
69
|
+
- **Busy session**: while attend runs, the dev cannot use this session without aborting. If the dev interrupts you, leave attend and attend to the dev.
|
|
70
|
+
- The internal timeout (9 min) is to stay within the Bash tool limit; it is not a total listening cap. By re-invoking, the loop is effectively infinite.
|
package/skills/bug/SKILL.md
CHANGED
|
@@ -1,128 +1,121 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: refacil:bug
|
|
3
|
-
description:
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# refacil:bug —
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
**
|
|
12
|
-
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
###
|
|
16
|
-
|
|
17
|
-
1.
|
|
18
|
-
2.
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
3.
|
|
24
|
-
|
|
25
|
-
###
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
###
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- `mode: investigation`
|
|
40
|
-
- `description`:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
###
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
- **"
|
|
66
|
-
- **"
|
|
67
|
-
- **"no" /
|
|
68
|
-
1. **
|
|
69
|
-
2. **
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
###
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
###
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- `mode: fix`
|
|
88
|
-
- `description`:
|
|
89
|
-
- `hypothesis`:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
###
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
(
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
1. **
|
|
112
|
-
2. **
|
|
113
|
-
|
|
114
|
-
##
|
|
115
|
-
|
|
116
|
-
- **
|
|
117
|
-
- **
|
|
118
|
-
- **
|
|
119
|
-
- **
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
- Responder en espanol con terminos tecnicos en ingles.
|
|
123
|
-
- **Continuidad del flujo**: si el usuario confirma afirmativamente ("si", "ok", "dale", "continua", etc.) la pregunta de continuidad del Paso 6, invocar inmediatamente el **Skill tool** con `skill: "refacil:review"`. No describirlo en texto ni esperar que el usuario escriba `/refacil:review`. (Ver `METHODOLOGY-CONTRACT.md §5`.)
|
|
124
|
-
|
|
125
|
-
## Ver tambien
|
|
126
|
-
|
|
127
|
-
- Sub-agente: `.claude/agents/refacil-debugger.md` (fuente: `refacil-sdd-ai/agents/debugger.md`)
|
|
128
|
-
- Bus cross-repo: `refacil-prereqs/BUS-CROSS-REPO.md`
|
|
1
|
+
---
|
|
2
|
+
name: refacil:bug
|
|
3
|
+
description: Guided complete flow to investigate and fix bugs — delegates investigation and fix to the refacil-debugger sub-agent in two passes separated by user confirmation
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# refacil:bug — Bug Fix Entrypoint
|
|
8
|
+
|
|
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
|
+
|
|
11
|
+
**Prerequisites**: `agents` profile from `refacil-prereqs/SKILL.md` + rules from `METHODOLOGY-CONTRACT.md`.
|
|
12
|
+
|
|
13
|
+
## Flow
|
|
14
|
+
|
|
15
|
+
### Step 0: Verify traceability prerequisite
|
|
16
|
+
|
|
17
|
+
1. Verify that the `refacil-sdd/` folder exists in the repo root.
|
|
18
|
+
2. If it does NOT exist, stop the flow and show:
|
|
19
|
+
```
|
|
20
|
+
This bugfix flow requires the SDD-AI methodology initialized to save traceability.
|
|
21
|
+
Run /refacil:setup and re-run /refacil:bug.
|
|
22
|
+
```
|
|
23
|
+
3. If it exists, continue to Step 1.
|
|
24
|
+
|
|
25
|
+
### Step 1: Describe the bug
|
|
26
|
+
|
|
27
|
+
If `$ARGUMENTS` does not bring enough information, ask the user:
|
|
28
|
+
- Current vs. expected behavior.
|
|
29
|
+
- Reproduction steps.
|
|
30
|
+
- Available evidence (logs, stack traces).
|
|
31
|
+
- When it started occurring.
|
|
32
|
+
- Severity (Critical/High/Medium/Low).
|
|
33
|
+
|
|
34
|
+
If `$ARGUMENTS` is already clear, do not ask again.
|
|
35
|
+
|
|
36
|
+
### Step 2: Delegate investigation to the refacil-debugger sub-agent (mode: investigation)
|
|
37
|
+
|
|
38
|
+
Invoke the `refacil-debugger` sub-agent passing it:
|
|
39
|
+
- `mode: investigation`
|
|
40
|
+
- `description`: complete bug description (collected in Step 1 or from `$ARGUMENTS`).
|
|
41
|
+
|
|
42
|
+
The sub-agent:
|
|
43
|
+
- Searches the codebase for symbols/files from logs or stack traces.
|
|
44
|
+
- Traces the flow from entry to the failure point.
|
|
45
|
+
- Reviews recent commits if the bug is new.
|
|
46
|
+
- Returns hypotheses ordered by confidence + proposed correction, fenced as ` ```refacil-debug-investigation `.
|
|
47
|
+
|
|
48
|
+
### Step 3: Confirm hypothesis with the user
|
|
49
|
+
|
|
50
|
+
Show the user the hypotheses and the proposed correction. Ask explicitly:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
Most confident hypothesis: [description — file:line]
|
|
54
|
+
Proposed fix: [minimal description]
|
|
55
|
+
Files to modify: [list]
|
|
56
|
+
|
|
57
|
+
Do you confirm this hypothesis? (yes/no/other hypothesis N)
|
|
58
|
+
Do you approve applying the fix? (yes/no)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Do NOT implement anything until you have explicit user approval.**
|
|
62
|
+
|
|
63
|
+
According to the user's response:
|
|
64
|
+
|
|
65
|
+
- **"yes" / approval**: proceed to Step 4 with hypothesis #1 as the confirmed `hypothesis`.
|
|
66
|
+
- **"other hypothesis N"** (e.g. "hypothesis 2"): use that hypothesis as the confirmed `hypothesis` for Step 5. The proposed correction may differ — summarize the fix for that alternative hypothesis to the user and ask for confirmation that they approve applying it before continuing.
|
|
67
|
+
- **"no" / rejection without alternative**: offer the user two options:
|
|
68
|
+
1. **Re-investigate** — return to Step 2 with an enriched description (ask the user to provide more context: additional logs, reproduction steps, when it started). The `refacil-debugger` sub-agent is invoked again in `mode: investigation` with the updated description.
|
|
69
|
+
2. **Cancel** — close the flow without modifying anything.
|
|
70
|
+
Do not continue until the user chooses an option.
|
|
71
|
+
|
|
72
|
+
If the sub-agent reported `crossRepo: true` in any hypothesis: before implementing, apply the protocol from `refacil-prereqs/BUS-CROSS-REPO.md` to verify with the other repo's agent via the bus. Use the response to confirm whether the fix goes in this repo, the other, or both.
|
|
73
|
+
|
|
74
|
+
### Step 4: Validate working branch (before implementing)
|
|
75
|
+
|
|
76
|
+
Run `git branch --show-current` to get the current branch.
|
|
77
|
+
|
|
78
|
+
Apply the **Protected branch policy and branch creation** defined in `refacil-prereqs/METHODOLOGY-CONTRACT.md`.
|
|
79
|
+
|
|
80
|
+
- If the current branch is protected, execute the full protocol before continuing.
|
|
81
|
+
- For `refacil:bug`, the suggested branch prefix is `fix/`.
|
|
82
|
+
- If the current branch is already a working branch (`feature/*`, `fix/*`, `hotfix/*`, `refactor/*`, etc.), continue without interruption.
|
|
83
|
+
|
|
84
|
+
### Step 5: Delegate implementation to the refacil-debugger sub-agent (mode: fix)
|
|
85
|
+
|
|
86
|
+
Invoke the `refacil-debugger` sub-agent passing it:
|
|
87
|
+
- `mode: fix`
|
|
88
|
+
- `description`: complete bug description.
|
|
89
|
+
- `hypothesis`: root cause confirmed by the user in Step 3.
|
|
90
|
+
|
|
91
|
+
The sub-agent:
|
|
92
|
+
- Implements the minimal and focused fix.
|
|
93
|
+
- Generates regression tests (reproduces the bug + verifies the fix + no regression).
|
|
94
|
+
- Creates `refacil-sdd/changes/fix-<name>/summary.md` with traceability.
|
|
95
|
+
- Runs all project tests.
|
|
96
|
+
- Returns the report fenced as ` ```refacil-debug-fix `.
|
|
97
|
+
|
|
98
|
+
### Step 6: Present result and next step
|
|
99
|
+
|
|
100
|
+
Show the user the **report** (everything before the `refacil-debug-fix` block). Do not show the JSON block — it is internal metadata.
|
|
101
|
+
|
|
102
|
+
Add at the end:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
The next step is the fix review (mandatory before archiving).
|
|
106
|
+
Do you want me to continue with /refacil:review?
|
|
107
|
+
(The flow then continues with /refacil:archive and /refacil:up-code)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
If the sub-agent returned `result: "FAILED"` (tests not passing), present the failing test details and offer the user:
|
|
111
|
+
1. **Retry** — the `refacil-debugger` sub-agent is invoked again in `mode: fix` with the same hypothesis plus the test failure context.
|
|
112
|
+
2. **Cancel** — close the flow without archiving. The modified files remain in the branch for manual review.
|
|
113
|
+
|
|
114
|
+
## Rules
|
|
115
|
+
|
|
116
|
+
- **Always investigate before proposing** — do not delegate the fix without a confirmed hypothesis.
|
|
117
|
+
- **NEVER implement without explicit user approval** (Step 3).
|
|
118
|
+
- **Always validate the branch** (Step 4) before delegating the fix.
|
|
119
|
+
- **Do not replicate investigation or implementation logic here** — that lives in `refacil-debugger`.
|
|
120
|
+
- Step 3 (bus cross-repo) is **optional** — only applies if the sub-agent reported `crossRepo: true`.
|
|
121
|
+
- **Flow continuity**: if the user confirms affirmatively ("yes", "ok", "go", "continue", etc.) the continuity question in Step 6, immediately invoke the **Skill tool** with `skill: "refacil:review"`. Do not describe it in text or wait for the user to type `/refacil:review`. (See `METHODOLOGY-CONTRACT.md §5`.)
|
package/skills/explore/SKILL.md
CHANGED
|
@@ -1,63 +1,73 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: refacil:explore
|
|
3
|
-
description:
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# refacil:explore — Entrypoint
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
**
|
|
12
|
-
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
###
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
###
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
###
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
1
|
+
---
|
|
2
|
+
name: refacil:explore
|
|
3
|
+
description: Explore and investigate the codebase before making changes — delegates to the refacil-investigator sub-agent to analyze architecture, flows, and dependencies without modifying anything
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# refacil:explore — Exploration Entrypoint
|
|
8
|
+
|
|
9
|
+
This skill is a **thin wrapper** that delegates the investigation to the `refacil-investigator` sub-agent. The sub-agent runs in an isolated context (does not saturate your main session with massive file reads) and returns a concise report with architecture, flows, and recommendations.
|
|
10
|
+
|
|
11
|
+
**Prerequisites**: `sdd` profile from `refacil-prereqs/SKILL.md` — use `AGENTS.md` as active context throughout the entire exploration.
|
|
12
|
+
|
|
13
|
+
## Flow
|
|
14
|
+
|
|
15
|
+
### Step 0: Validate question
|
|
16
|
+
|
|
17
|
+
- If `$ARGUMENTS` is empty, ask the user for the question or topic to explore BEFORE invoking the sub-agent.
|
|
18
|
+
- If there is a question, continue.
|
|
19
|
+
|
|
20
|
+
### Step 0.1: Duplicate exploration guard (CA-11)
|
|
21
|
+
|
|
22
|
+
Before delegating, check the current session conversation context for a prior complete exploration report with overlapping scope (same modules, files, or question topic):
|
|
23
|
+
|
|
24
|
+
- **If a prior complete exploration exists for the same or highly overlapping topic**: summarize the already-known context in 2-3 sentences and ask:
|
|
25
|
+
```
|
|
26
|
+
I already explored [topic] earlier in this session. The key findings were: [summary].
|
|
27
|
+
Do you want me to run a targeted follow-up on a specific aspect, or proceed with a new full exploration?
|
|
28
|
+
```
|
|
29
|
+
Wait for the user's answer before proceeding.
|
|
30
|
+
- **If there is no prior exploration** (or it is on a clearly different topic): continue to Step 1 without interruption.
|
|
31
|
+
|
|
32
|
+
### Step 1: Delegate to the refacil-investigator sub-agent
|
|
33
|
+
|
|
34
|
+
Invoke the `refacil-investigator` sub-agent passing it:
|
|
35
|
+
- The user's question (`$ARGUMENTS`).
|
|
36
|
+
- If the user explicitly requested detailed mode, indicate it (`mode: detailed`). Default: concise.
|
|
37
|
+
|
|
38
|
+
The sub-agent:
|
|
39
|
+
- Explores the codebase natively (Read/Grep with discipline — see sub-agent rules).
|
|
40
|
+
- Enriches with patterns and conventions from `AGENTS.md`.
|
|
41
|
+
- Detects cross-repo dependencies and, if appropriate, consults the bus according to `refacil-prereqs/BUS-CROSS-REPO.md`.
|
|
42
|
+
- Returns a report with architecture, flows, dependencies, and next-step recommendations.
|
|
43
|
+
|
|
44
|
+
### Step 2: Present the report
|
|
45
|
+
|
|
46
|
+
Show the user the full report returned by the sub-agent. There are no artifacts to write — exploration is purely analytical.
|
|
47
|
+
|
|
48
|
+
If the sub-agent asked for clarification (because the prompt did not carry an explicit question), propagate the question to the user.
|
|
49
|
+
|
|
50
|
+
### Step 3: Next step
|
|
51
|
+
|
|
52
|
+
The sub-agent already includes recommendations at the end of its report. Apply the natural continuity rule from `METHODOLOGY-CONTRACT.md §5`:
|
|
53
|
+
|
|
54
|
+
- If the report converges on **one single** next step (e.g. the finding clearly indicates a new feature or a bug), close with the single formula:
|
|
55
|
+
- *"The next step is [description]. Do you want me to continue with `/refacil:propose`?"* (or `/refacil:bug`, as appropriate).
|
|
56
|
+
- If there are **multiple valid paths**, list them numbered and ask the user to select.
|
|
57
|
+
|
|
58
|
+
## Rules
|
|
59
|
+
|
|
60
|
+
- **Always delegate to the sub-agent**. Do not replicate the exploration logic here.
|
|
61
|
+
- **Do not invoke without a question**. If `$ARGUMENTS` is empty, ask for the question first.
|
|
62
|
+
- **Do not write files**. Exploration is read-only end-to-end.
|
|
63
|
+
- **Flow continuity**: if the user confirms affirmatively ("yes", "ok", "go", "continue", etc.) the continuity question in Step 3, immediately invoke the **Skill tool** with the exact name resolved from the sub-agent's finding. Deterministic resolution:
|
|
64
|
+
|
|
65
|
+
| Finding | Skill |
|
|
66
|
+
|---------|-------|
|
|
67
|
+
| New feature or improvement | `refacil:propose` |
|
|
68
|
+
| Functional bug or production error | `refacil:bug` |
|
|
69
|
+
| Missing initial repo configuration | `refacil:setup` |
|
|
70
|
+
| Flow doubt or next command unclear | `refacil:guide` |
|
|
71
|
+
| No clear match | Do NOT invoke — list numbered options and ask for explicit selection |
|
|
72
|
+
|
|
73
|
+
Do not describe it in text or wait for the user to type the command. (See `METHODOLOGY-CONTRACT.md §5`.)
|