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/reply/SKILL.md
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: refacil:reply
|
|
3
|
-
description:
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# refacil:reply —
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
###
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
refacil-sdd-ai bus reply --text "<
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
###
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
- **`reply`**:
|
|
33
|
-
- **`say`**:
|
|
34
|
-
|
|
35
|
-
##
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
```bash
|
|
43
|
-
refacil-sdd-ai bus reply --text "..." --correlation <id>
|
|
44
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: refacil:reply
|
|
3
|
+
description: Reply to the last question directed to this session on the bus. The broker autocompletes the correlationId.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# refacil:reply — Reply to a bus question
|
|
8
|
+
|
|
9
|
+
Sends a response to the last question directed to this session. **$ARGUMENTS** = response text.
|
|
10
|
+
|
|
11
|
+
## Instructions
|
|
12
|
+
|
|
13
|
+
### Step 1: Execute reply
|
|
14
|
+
|
|
15
|
+
Run via `Bash`:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
refacil-sdd-ai bus reply --text "<response>"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The broker:
|
|
22
|
+
- Automatically finds the last `ask` directed to this session in the room
|
|
23
|
+
- Uses its `correlationId` so the asker (if in `ask --wait`) receives the response directly
|
|
24
|
+
- Broadcasts to the entire room as a `kind=reply` message
|
|
25
|
+
|
|
26
|
+
### Step 2: Confirm
|
|
27
|
+
|
|
28
|
+
Report to the user that the response was sent.
|
|
29
|
+
|
|
30
|
+
## When to use `reply` vs `say`
|
|
31
|
+
|
|
32
|
+
- **`reply`**: always when you are responding to something you were asked. This allows the other side in `ask --wait` to unblock automatically.
|
|
33
|
+
- **`say`**: general announcement unrelated to a previous question.
|
|
34
|
+
|
|
35
|
+
## Rules
|
|
36
|
+
|
|
37
|
+
- If you just **implemented** a change requested by another agent and this `reply` is the **close** (done / PR / blocked), include that summary in the text; it is the default channel to respond to whoever made the original `ask` (same thread).
|
|
38
|
+
- Correctly quote the text.
|
|
39
|
+
- Respond only from your knowledge of THIS repo. If the question falls outside your scope, say it explicitly: `"out of my scope, repo X knows about this"`.
|
|
40
|
+
- If there is no pending question directed to you and you do not want to link it, use `/refacil:say` instead.
|
|
41
|
+
- If you were asked multiple questions and want to respond to a specific older one, pass `--correlation <id>` explicitly:
|
|
42
|
+
```bash
|
|
43
|
+
refacil-sdd-ai bus reply --text "..." --correlation <id>
|
|
44
|
+
```
|
package/skills/review/SKILL.md
CHANGED
|
@@ -1,126 +1,163 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: refacil:review
|
|
3
|
-
description:
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# refacil:review — Entrypoint
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
**
|
|
12
|
-
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
###
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
1)
|
|
19
|
-
2)
|
|
20
|
-
3)
|
|
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
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
###
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
- **
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
-
|
|
1
|
+
---
|
|
2
|
+
name: refacil:review
|
|
3
|
+
description: Code review with the team quality checklist — builds a briefing with changed files and project type, delegates to the refacil-auditor sub-agent, and processes the verdict
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# refacil:review — Review Entrypoint
|
|
8
|
+
|
|
9
|
+
This skill is a **thin wrapper** that delegates the heavy review to the `refacil-auditor` sub-agent. Before delegating, it builds a **structured briefing** with the changed files and detected project type — the sub-agent starts evaluating, not discovering.
|
|
10
|
+
|
|
11
|
+
**Prerequisites**: `agents` profile from `refacil-prereqs/SKILL.md` + output mode from `METHODOLOGY-CONTRACT.md`.
|
|
12
|
+
|
|
13
|
+
## Flow
|
|
14
|
+
|
|
15
|
+
### Step 0: Resolve scope
|
|
16
|
+
|
|
17
|
+
- Determine the review scope BEFORE invoking the sub-agent. Prioritize in this order:
|
|
18
|
+
1) User argument (`$ARGUMENTS`)
|
|
19
|
+
2) Active change in `refacil-sdd/changes/`
|
|
20
|
+
3) Uncommitted changes (`git diff`)
|
|
21
|
+
- If there are multiple active changes in `refacil-sdd/changes/` and no `$ARGUMENTS`, **stop** and ask the user to explicitly select which change to review. **Do not invoke the sub-agent with ambiguous scope.**
|
|
22
|
+
|
|
23
|
+
### Step 0.3: Git working tree snapshot (run once)
|
|
24
|
+
|
|
25
|
+
After scope is unambiguous (you are **not** stopping for multiple active changes), collect git state **exactly once** for this skill invocation:
|
|
26
|
+
|
|
27
|
+
1. Run `git diff --name-only HEAD` → set `pathsFromDiff`.
|
|
28
|
+
2. Run `git status --porcelain` → parse each line (strip the first two status columns) → set `pathsFromStatus`.
|
|
29
|
+
3. **`changedFilesUnion`** = sorted unique union of `pathsFromDiff` and `pathsFromStatus` (drop empty entries).
|
|
30
|
+
|
|
31
|
+
**Rules:**
|
|
32
|
+
- Reuse **`changedFilesUnion`** and the **same** `git status --porcelain` interpretation everywhere below — **do not** run `git diff --name-only` or `git status --porcelain` again in this skill.
|
|
33
|
+
- If a later step needs “is the working tree non-empty?”, derive it from the snapshot (e.g. non-empty `changedFilesUnion` or any porcelain line) instead of re-running `git status`.
|
|
34
|
+
|
|
35
|
+
If you already have a `changeName`, run `refacil-sdd-ai sdd status <changeName> --json` to get the change status (artifacts, tasks, reviewPassed).
|
|
36
|
+
|
|
37
|
+
**Review already approved**: If `reviewPassed` is `true` in the status JSON (or if the target change already has `.review-passed`), verify if there are changes after the review (marker existence: **`METHODOLOGY-CONTRACT.md` §8**):
|
|
38
|
+
1. Read the `date` from `.review-passed`.
|
|
39
|
+
2. Compare with `git log --since="[date]" --oneline` and **reuse the Step 0.3 snapshot** for working-tree activity (do not run `git status` again).
|
|
40
|
+
3. **If there are new changes** (commits since marker date and/or paths in `changedFilesUnion`): delete the previous `.review-passed` and continue (build briefing and invoke the sub-agent).
|
|
41
|
+
4. **If there are NO new changes**: inform the user and finish without invoking the sub-agent:
|
|
42
|
+
```
|
|
43
|
+
The change [name] already has an approved review ([verdict] — [date]) and there are no subsequent changes.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Step 0.4: Incremental scope (CA-07 — only if re-running after REQUIERE CORRECCIONES)
|
|
47
|
+
|
|
48
|
+
If `changeName` is not null, check whether `refacil-sdd/changes/<changeName>/.review-last-fails.json` exists (read by explicit path — it is NOT a dotfile but may be hidden in listings):
|
|
49
|
+
|
|
50
|
+
- **If the file EXISTS**: read `failedFiles` from it. Compute:
|
|
51
|
+
`incrementalScope = failedFiles ∪ changedFilesUnion`
|
|
52
|
+
- If `incrementalScope` is empty (CR-02): fall back to `changedFilesUnion` and add a comment in the briefing: `"# warning: incremental scope was empty — using full changedFilesUnion"`.
|
|
53
|
+
- Use `incrementalScope` as `changedFiles` in the briefing (Step 0.5), instead of the full `changedFilesUnion`.
|
|
54
|
+
- **If the file does NOT exist**: use `changedFilesUnion` as `changedFiles` normally.
|
|
55
|
+
|
|
56
|
+
### Step 0.5: Build briefing for the sub-agent (reduces auditor tool calls)
|
|
57
|
+
|
|
58
|
+
Before invoking the sub-agent, extract the context that the auditor would otherwise calculate on its own:
|
|
59
|
+
|
|
60
|
+
1. **Changed files** — use the scope resolved in Step 0.4 (`incrementalScope` if available, otherwise `changedFilesUnion`). Do not run `git diff` or `git status` again.
|
|
61
|
+
|
|
62
|
+
2. **Project type** — read `package.json` (if it exists) and inspect the dependencies:
|
|
63
|
+
- Backend indicators: `@nestjs/*`, `express`, `fastify`, `koa`, `typeorm`, `prisma`, `pg`, `mongoose`, `bullmq`, `amqplib`
|
|
64
|
+
- Frontend indicators: `react`, `vue`, `angular`, `next`, `nuxt`, `svelte`, `vite`, `@tanstack/*`
|
|
65
|
+
- If both → `fullstack`; if only backend → `backend`; if only frontend → `frontend`; if no `package.json` or none applies → read the first 20 lines of `AGENTS.md` to infer.
|
|
66
|
+
|
|
67
|
+
3. **Change objective** (only if there is an active change in `refacil-sdd/changes/`) — read the first section of `proposal.md`. Extract the objective in 1-2 sentences. If the scope is `git-diff` without an active change → `null`.
|
|
68
|
+
|
|
69
|
+
4. **Cross-skill memory** — if `changeName` is not null and `refacil-sdd/changes/<changeName>/memory.yaml` exists, read it and extract `stackDetected`, `touchedFiles`. Include them in the briefing so the auditor skips re-discovery. If the file does not exist, omit — do not block (CR-04).
|
|
70
|
+
|
|
71
|
+
5. **Mode** — default `concise`. If re-running after a prior `REQUIERE CORRECCIONES` (i.e., `.review-last-fails.json` was found with non-empty `failedFiles` in Step 0.4): set `mode: focused` — the auditor re-evaluates only the failing checklist items on the `failedFiles` (CR-05: focused mode still reads those files). Otherwise keep `concise`.
|
|
72
|
+
|
|
73
|
+
Build the BRIEFING block:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
BRIEFING:
|
|
77
|
+
scope: <changeName | "git-diff">
|
|
78
|
+
changedFiles: [path/file-1.ts, path/file-2.ts, ...]
|
|
79
|
+
projectType: backend | frontend | fullstack | library
|
|
80
|
+
changeObjective: <objective in 1-2 sentences, or null>
|
|
81
|
+
mode: concise | detailed | focused
|
|
82
|
+
stackDetected: <from memory.yaml, or omit>
|
|
83
|
+
touchedFiles: [...] # from memory.yaml — omit if not present
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Step 1: Delegate to the refacil-auditor sub-agent
|
|
87
|
+
|
|
88
|
+
Invoke the `refacil-auditor` sub-agent passing it the BRIEFING from the previous step.
|
|
89
|
+
|
|
90
|
+
The sub-agent:
|
|
91
|
+
- Uses `changedFiles` from the briefing as the blocking scope (without re-running git diff).
|
|
92
|
+
- Uses `projectType` to directly load the correct checklists (without a detection phase).
|
|
93
|
+
- Uses `changeObjective` as intent context (without re-reading proposal.md).
|
|
94
|
+
- Reads the checklists and the blocking scope files.
|
|
95
|
+
- Evaluates each item with PASS/FAIL/N/A + severity for each FAIL.
|
|
96
|
+
- Returns ONE single message with the report + JSON block fenced as ` ```refacil-review-result `.
|
|
97
|
+
|
|
98
|
+
### Step 2: Process the sub-agent report
|
|
99
|
+
|
|
100
|
+
Show the user the **concise report** (everything before the `refacil-review-result` block). Do not show the JSON block — it is internal metadata.
|
|
101
|
+
|
|
102
|
+
**If the sub-agent returned `SCOPE_ERROR: <reason>`**: propagate the error to the user and ask for clarification. Do not write a marker.
|
|
103
|
+
|
|
104
|
+
### Step 2.5: Persist or clean incremental-scope state (CA-06/CA-08/CA-09/CR-01)
|
|
105
|
+
|
|
106
|
+
Parse the `refacil-review-result` block from the sub-agent.
|
|
107
|
+
|
|
108
|
+
**If `verdict` is `REQUIERE CORRECCIONES`**:
|
|
109
|
+
- Only if `changeName` is not null (CR-01) AND the block includes a `failedFiles` field (CA-09 backward compat):
|
|
110
|
+
- Write `refacil-sdd/changes/<changeName>/.review-last-fails.json` with content: `{ "failedFiles": [...] }` using the `failedFiles` array from the JSON block.
|
|
111
|
+
- If `changeName` is null or `failedFiles` is absent: skip silently — existing behavior unchanged.
|
|
112
|
+
|
|
113
|
+
**If `verdict` is `APROBADO` or `APROBADO CON OBSERVACIONES`**:
|
|
114
|
+
- If `refacil-sdd/changes/<changeName>/.review-last-fails.json` exists: delete it (CA-08) — run `rm -f "refacil-sdd/changes/<changeName>/.review-last-fails.json"`.
|
|
115
|
+
|
|
116
|
+
### Step 3: Create `.review-passed` marker (if applicable)
|
|
117
|
+
|
|
118
|
+
Parse the ` ```refacil-review-result ` block from the sub-agent. If `verdict` is **APROBADO** or **APROBADO CON OBSERVACIONES** and `changeName` is not null:
|
|
119
|
+
|
|
120
|
+
Run the following command to write the marker:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
refacil-sdd-ai sdd mark-reviewed <changeName> \
|
|
124
|
+
--verdict "<verdict>" \
|
|
125
|
+
--summary "<1-line summary>" \
|
|
126
|
+
--fail-count <failCount> \
|
|
127
|
+
--preexisting-count <preexistingCount>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Where the values are extracted from the sub-agent's `refacil-review-result` block:
|
|
131
|
+
- `<verdict>`: the value of `verdict` (APROBADO, APROBADO CON OBSERVACIONES, etc.)
|
|
132
|
+
- `<summary>`: the value of `summary`
|
|
133
|
+
- `<failCount>`: FAILs in new code (default 0)
|
|
134
|
+
- `<preexistingCount>`: pre-existing non-blocking FAILs (default 0)
|
|
135
|
+
|
|
136
|
+
**Do NOT run the command if:**
|
|
137
|
+
- `verdict` is `REQUIERE CORRECCIONES`.
|
|
138
|
+
- `changeName` is null.
|
|
139
|
+
- The sub-agent returned `SCOPE_ERROR`.
|
|
140
|
+
|
|
141
|
+
### Step 4: Recommend next step
|
|
142
|
+
|
|
143
|
+
According to the parsed `verdict`, add at the end of your response:
|
|
144
|
+
|
|
145
|
+
**If APROBADO or APROBADO CON OBSERVACIONES:**
|
|
146
|
+
```
|
|
147
|
+
The next step is to archive the change.
|
|
148
|
+
Do you want me to continue with /refacil:archive?
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**If REQUIERE CORRECCIONES:**
|
|
152
|
+
```
|
|
153
|
+
Once the corrections are applied, the next step is to re-verify the implementation.
|
|
154
|
+
Do you want me to continue with /refacil:verify?
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Rules
|
|
158
|
+
|
|
159
|
+
- **Always build the briefing (Step 0.5) before delegating** — it is the key piece that reduces the sub-agent cost.
|
|
160
|
+
- **Always delegate to the sub-agent**. Do not replicate checklist or evaluation logic here.
|
|
161
|
+
- **The marker is created by this skill, not the sub-agent**.
|
|
162
|
+
- If the sub-agent returned something out of format (no parseable JSON block and not `SCOPE_ERROR`), inform the user: "The reviewer returned an unstructured report — no marker was created. Review the report manually."
|
|
163
|
+
- **Flow continuity**: if the user confirms affirmatively ("yes", "ok", "go", "continue", etc.) the continuity question, immediately invoke the corresponding **Skill tool**: `skill: "refacil:archive"` if the verdict is APROBADO/APROBADO CON OBSERVACIONES, or `skill: "refacil:verify"` if REQUIERE CORRECCIONES. (See `METHODOLOGY-CONTRACT.md §5`.)
|