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
|
@@ -1,115 +1,122 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## 1
|
|
6
|
-
|
|
7
|
-
- **READY_FOR_PROPOSE**:
|
|
8
|
-
- **READY_FOR_APPLY**:
|
|
9
|
-
- **READY_FOR_VERIFY**:
|
|
10
|
-
- **READY_FOR_REVIEW**:
|
|
11
|
-
- **READY_FOR_ARCHIVE**: review
|
|
12
|
-
- **READY_FOR_MERGE**: review
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
## 2
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
## 3
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
1.
|
|
26
|
-
2.
|
|
27
|
-
3.
|
|
28
|
-
4.
|
|
29
|
-
5.
|
|
30
|
-
6.
|
|
31
|
-
7.
|
|
32
|
-
|
|
33
|
-
Coverage (
|
|
34
|
-
|
|
35
|
-
## 4
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- **
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
###
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
- **
|
|
49
|
-
|
|
50
|
-
###
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
- No
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
###
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
1.
|
|
61
|
-
2.
|
|
62
|
-
3.
|
|
63
|
-
4.
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
5.
|
|
68
|
-
- Feature: `feature/<ID>`
|
|
69
|
-
- Bugfix: `fix/<ID>`
|
|
70
|
-
-
|
|
71
|
-
6.
|
|
72
|
-
7.
|
|
73
|
-
|
|
74
|
-
## 5
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- **
|
|
79
|
-
- **
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
###
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
- *"
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
**
|
|
92
|
-
|
|
93
|
-
## 6
|
|
94
|
-
|
|
95
|
-
- `up-code`
|
|
96
|
-
-
|
|
97
|
-
- `review`
|
|
98
|
-
|
|
99
|
-
## 7
|
|
100
|
-
|
|
101
|
-
- `archive`
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
## 8
|
|
107
|
-
|
|
108
|
-
- **`.review-passed`**
|
|
109
|
-
- **
|
|
110
|
-
-
|
|
111
|
-
|
|
112
|
-
## 9
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
- **
|
|
1
|
+
# SDD-AI Methodology Contract
|
|
2
|
+
|
|
3
|
+
This file centralizes cross-cutting rules to avoid duplication and inconsistencies between skills.
|
|
4
|
+
|
|
5
|
+
## §1 — Flow states (Definition of Ready / Done)
|
|
6
|
+
|
|
7
|
+
- **READY_FOR_PROPOSE**: problem understood (objective, scope, constraints) and minimum repo context.
|
|
8
|
+
- **READY_FOR_APPLY**: complete SDD artifacts (`proposal.md`, `design.md`, `tasks.md`, specification in `specs.md` and/or `specs/**/*.md`) and explicit user approval.
|
|
9
|
+
- **READY_FOR_VERIFY**: implementation finished, no changes outside scope.
|
|
10
|
+
- **READY_FOR_REVIEW**: for regular changes (propose), verify executed and critical issues resolved or accepted by the user. For bug fixes, the implementation and regression tests are complete (bugs do not go through verify).
|
|
11
|
+
- **READY_FOR_ARCHIVE**: review approved (`.review-passed` exists), tasks complete or exceptions approved, change functionally closed.
|
|
12
|
+
- **READY_FOR_MERGE**: review approved (`.review-passed` exists) and integration ready: PR created for the target branch. `/refacil:up-code` automatically verifies the review before push — if missing, it runs it.
|
|
13
|
+
- If multiple active changes exist without review, the target change must be explicitly selected before running review/push.
|
|
14
|
+
|
|
15
|
+
## §2 — AGENTS.md policy
|
|
16
|
+
|
|
17
|
+
- If a skill requires the `sdd` profile: `AGENTS.md` is mandatory (if missing, stop and redirect to `/refacil:setup`).
|
|
18
|
+
- If a skill requires the `agents` profile: if `AGENTS.md` is missing, continue with a generic baseline and report the limitation to the user.
|
|
19
|
+
|
|
20
|
+
## §3 — Test command resolution (multi-stack)
|
|
21
|
+
|
|
22
|
+
Do not hardcode `npm test` unless it is genuinely the project's command.
|
|
23
|
+
|
|
24
|
+
Detection order:
|
|
25
|
+
1. If `AGENTS.md` defines the official test command, use that.
|
|
26
|
+
2. If a package manager script exists (e.g. `npm test`, `pnpm test`, `yarn test`, `bun test`), use the corresponding one.
|
|
27
|
+
3. If Python: `pytest`.
|
|
28
|
+
4. If Go: `go test ./...`.
|
|
29
|
+
5. If Rust: `cargo test`.
|
|
30
|
+
6. If Java/Gradle: `./gradlew test` or `gradle test`.
|
|
31
|
+
7. If Java/Maven: `mvn test`.
|
|
32
|
+
|
|
33
|
+
Coverage (if applicable): detect the project command (`test:cov`, `coverage`, `pytest --cov`, etc.). If it does not exist, report N/A with justification.
|
|
34
|
+
|
|
35
|
+
## §4 — Protected branch policy and branch creation
|
|
36
|
+
|
|
37
|
+
Protected branches (never develop directly on them): `master`, `main`, `develop`, `dev`, `testing`, `qa`.
|
|
38
|
+
|
|
39
|
+
Critical rule:
|
|
40
|
+
- **NEVER** make direct changes on protected branches.
|
|
41
|
+
- All integration to protected branches is done via PR, without exceptions (including `testing`).
|
|
42
|
+
|
|
43
|
+
### Working branch creation
|
|
44
|
+
|
|
45
|
+
- General rule: every new working branch (`feature/*`, `fix/*`, `hotfix/*`, `refactor/*`, etc.) must be created from an updated `develop` or `dev`.
|
|
46
|
+
- Exception for new repos: if neither `develop` nor `dev` exists yet, creating temporarily from `main` or `master` is allowed.
|
|
47
|
+
- If the exception is used, recommend creating `develop`/`dev` and adopting that flow as the repo standard.
|
|
48
|
+
- **NEVER** create working branches from `testing`, `qa`, or from other feature/bug branches.
|
|
49
|
+
|
|
50
|
+
### Integration
|
|
51
|
+
|
|
52
|
+
- All integration to any protected branch requires a **PR**.
|
|
53
|
+
- No exceptions: `testing`, `develop`, `main`, `master`, `qa`, `release/*` — all require PR.
|
|
54
|
+
- Recommend the user create a PR to `testing` so the changes are available in the test environment.
|
|
55
|
+
|
|
56
|
+
### Protocol when the current branch is protected
|
|
57
|
+
|
|
58
|
+
If the current branch is protected and code needs to be written:
|
|
59
|
+
|
|
60
|
+
1. Inform and ask for a task identifier (Jira or other).
|
|
61
|
+
2. Verify clean working directory (`git status --porcelain`).
|
|
62
|
+
3. If there are uncommitted changes, ask for approval to `git stash push -m "auto-stash-refacil"`.
|
|
63
|
+
4. Detect the base branch to create a working branch from:
|
|
64
|
+
- Prefer `develop`, then `dev`.
|
|
65
|
+
- Only if neither exists (new repo), use `main` or `master` as a temporary exception.
|
|
66
|
+
- Switch and update (`git pull origin <base>`). If none exist, stop.
|
|
67
|
+
5. Create the working branch:
|
|
68
|
+
- Feature: `feature/<ID>`
|
|
69
|
+
- Bugfix: `fix/<ID>`
|
|
70
|
+
- Without ID: short descriptive name and recommend creating a ticket.
|
|
71
|
+
6. Restore `stash` if used.
|
|
72
|
+
7. If the user does not approve the process, stop.
|
|
73
|
+
|
|
74
|
+
## §5 — Output policy (UX)
|
|
75
|
+
|
|
76
|
+
Default mode: **concise**.
|
|
77
|
+
|
|
78
|
+
- **Concise**: verdict + blockers + maximum 5 prioritized findings + next step.
|
|
79
|
+
- **Detailed**: full section-by-section report.
|
|
80
|
+
|
|
81
|
+
If the user does not request detail, use concise mode.
|
|
82
|
+
|
|
83
|
+
### Natural flow continuity (confirmation)
|
|
84
|
+
|
|
85
|
+
- When there is **one single possible next step** within the flow, do not limit yourself to "run `/refacil:...`".
|
|
86
|
+
- In that case, close with a continuity question in natural language using the **single formula**:
|
|
87
|
+
- *"The next step is [brief description]. Do you want me to continue with `/refacil:<skill>`?"*
|
|
88
|
+
- When there are **multiple valid next steps** (real branching), list numbered options and ask for explicit selection.
|
|
89
|
+
- If the current step is **terminal** (end of flow, e.g. PR created), close without asking for the next skill.
|
|
90
|
+
|
|
91
|
+
**Operative rule (mandatory)**: if the user confirms affirmatively ("yes", "ok", "go", "continue", "sure", etc.) to the continuity question, **directly invoke the next skill via the Skill tool** in the same turn. Do not ask the user to type `/refacil:X` or repeat the context — the session must continue without friction.
|
|
92
|
+
|
|
93
|
+
## §6 — Review and push scope
|
|
94
|
+
|
|
95
|
+
- `up-code` and `check-review` should only auto-run review when there is a single pending change.
|
|
96
|
+
- If there are multiple changes pending review, block and ask for explicit selection of `change-name`.
|
|
97
|
+
- `review` must not run in bulk mode by default when there are multiple active changes without explicit scope.
|
|
98
|
+
|
|
99
|
+
## §7 — Review evidence persistence
|
|
100
|
+
|
|
101
|
+
- `archive` requires `.review-passed` as a blocking precondition (verify existence according to **§8**).
|
|
102
|
+
- When archiving regular changes (proposal-driven flow), the `.review-passed` metadata must be persisted in `refacil-sdd/specs/`.
|
|
103
|
+
- The recommended format is `review.yaml` inside each affected spec folder.
|
|
104
|
+
- If it cannot be reliably mapped to specific specs, record the evidence in `refacil-sdd/specs/review-metadata.yaml`.
|
|
105
|
+
|
|
106
|
+
## §8 — Hidden files under `refacil-sdd/changes/<change>/`
|
|
107
|
+
|
|
108
|
+
- **`.review-passed`** and any file whose name starts with **`.`** are **hidden** in many environments: in shell, **`ls` without `-a` / `-la` does not list them** — do not conclude they do not exist because of this (avoid false negatives in prereqs, review, verify, `up-code`, and archive).
|
|
109
|
+
- **Preferred**: **`Glob`** tool (pattern under `refacil-sdd/changes/<name>/`), **`Read`** on the exact path `refacil-sdd/changes/<name>/.review-passed`, or Bash **`test -f`** / **`[ -f ... ]`** on that path.
|
|
110
|
+
- If the user says the file exists and your check denied it, **re-verify** with one of the above methods before insisting.
|
|
111
|
+
|
|
112
|
+
## §9 — Folder identifier under `refacil-sdd/changes/<change>/`
|
|
113
|
+
|
|
114
|
+
- The **folder name** of the active change is the identifier used by the refacil-sdd CLI (`refacil-sdd status --change`, archive flows, etc.).
|
|
115
|
+
- **Must start with an ASCII letter** `[a-zA-Z]`. If the first character is a digit or other symbol, the CLI rejects the name (e.g. `Invalid change name: Change name must start with a letter`).
|
|
116
|
+
|
|
117
|
+
## §10 — Language policy
|
|
118
|
+
|
|
119
|
+
- **Agent and skill internal instructions**: always in **English** (reduces token cost, improves LLM performance).
|
|
120
|
+
- **Responses to the user**: in the **user's language**. If the user writes in Spanish, respond in Spanish. If in English, respond in English. Default: Spanish.
|
|
121
|
+
- **SDD artifacts** (proposal.md, specs, design.md, tasks.md): in the **user's language** (or the language the team agreed on for the project).
|
|
122
|
+
- Technical terms, code identifiers, and proper nouns stay in their canonical language regardless.
|
package/skills/prereqs/SKILL.md
CHANGED
|
@@ -1,37 +1,30 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: refacil:prereqs
|
|
3
|
-
description:
|
|
4
|
-
user-invocable: false
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
1.
|
|
18
|
-
2.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Convenciones Refacil al delegar a skills `openspec-*`: ver `OPENSPEC-DELTAS.md` (misma carpeta), leer junto a la skill OpenSpec que se invoque.
|
|
32
|
-
|
|
33
|
-
## BUS-CROSS-REPO.md
|
|
34
|
-
|
|
35
|
-
Protocolo compartido para consultar a otros repositorios via `refacil-bus` y para **acuerdos en sala** (propose + cierre al solicitante). Aplica en `explore`, `propose`, `verify` y `bug` cuando la skill detecta dependencia cross-repo o coordinacion multi-repo. Ver `BUS-CROSS-REPO.md` (misma carpeta).
|
|
36
|
-
|
|
37
|
-
Si faltan estos archivos, ejecuta `refacil-sdd-ai update` (o `init`).
|
|
1
|
+
---
|
|
2
|
+
name: refacil:prereqs
|
|
3
|
+
description: Internal reference — SDD-AI prerequisites shared by all other refacil skills (do not invoke manually)
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# SDD-AI Prerequisites
|
|
8
|
+
|
|
9
|
+
Identical methodology in Claude Code (`.claude/skills/refacil-*`) and Cursor (`.cursor/skills/refacil-*`). Use the path of the open IDE.
|
|
10
|
+
|
|
11
|
+
Cross-cutting rules (states, branches, tests, output): `METHODOLOGY-CONTRACT.md` in this same folder.
|
|
12
|
+
|
|
13
|
+
## `sdd` profile
|
|
14
|
+
|
|
15
|
+
A skill requests this profile when it needs `AGENTS.md` to operate with the SDD-AI flow. These validations are mandatory on each execution of a skill that declares this profile.
|
|
16
|
+
|
|
17
|
+
1. Read `AGENTS.md` from the root. If missing: *"AGENTS.md not found. Run `/refacil:setup`"* and **stop**.
|
|
18
|
+
2. If `AGENTS.md` includes a `compact-guidance` block, apply those token efficiency rules throughout the execution.
|
|
19
|
+
|
|
20
|
+
Special case: in `refacil:explore`, `AGENTS.md` is active context throughout the entire exploration.
|
|
21
|
+
|
|
22
|
+
## `agents` profile
|
|
23
|
+
|
|
24
|
+
Only requires `AGENTS.md`. If it exists, read it and apply `compact-guidance` if present. If missing: continue with generic baseline and inform the user: *"AGENTS.md not found; run `/refacil:setup` for project rules."*
|
|
25
|
+
|
|
26
|
+
## BUS-CROSS-REPO.md
|
|
27
|
+
|
|
28
|
+
Shared protocol for consulting other repositories via `refacil-bus` and for **room agreements** (propose + notification to the requester). Applies in `explore`, `propose`, `verify`, and `bug` when the skill detects a cross-repo dependency or multi-repo coordination. See `BUS-CROSS-REPO.md` (same folder).
|
|
29
|
+
|
|
30
|
+
If these files are missing, run `refacil-sdd-ai init` to reinstall skills and prereqs.
|
package/skills/propose/SKILL.md
CHANGED
|
@@ -1,102 +1,103 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: refacil:propose
|
|
3
|
-
description:
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# refacil:propose —
|
|
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
|
-
|
|
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
|
-
-
|
|
1
|
+
---
|
|
2
|
+
name: refacil:propose
|
|
3
|
+
description: Create a complete change proposal — delegates codebase exploration and artifact generation to the refacil-proposer sub-agent, and handles mandatory human review of the artifacts
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# refacil:propose — Change Proposal Entrypoint
|
|
8
|
+
|
|
9
|
+
This skill is a **wrapper** that prepares the scope, delegates SDD artifact generation to the `refacil-proposer` sub-agent, and handles the mandatory human review (Human-in-the-Loop). The sub-agent runs in an isolated context exploring the codebase and generating the artifacts; this wrapper presents them to the user for approval.
|
|
10
|
+
|
|
11
|
+
**Prerequisites**: `sdd` profile from `refacil-prereqs/SKILL.md` + rules from `METHODOLOGY-CONTRACT.md`.
|
|
12
|
+
|
|
13
|
+
## Flow
|
|
14
|
+
|
|
15
|
+
### Step 0.5: Duplicate exploration guard (CA-11)
|
|
16
|
+
|
|
17
|
+
Before gathering context or delegating, check the current session conversation for a prior complete exploration report with overlapping scope (same modules, files, or described topic):
|
|
18
|
+
|
|
19
|
+
- **If a prior complete exploration exists for the same or highly overlapping topic**: summarize the already-known context in 2-3 sentences and ask:
|
|
20
|
+
```
|
|
21
|
+
I already explored [topic] earlier in this session. The key findings were: [summary].
|
|
22
|
+
Do you want me to run a targeted follow-up, or proceed with the full exploration for this proposal?
|
|
23
|
+
```
|
|
24
|
+
Wait for the user's answer. If they confirm "proceed", continue to Step 1 — do not re-invoke a full exploration automatically.
|
|
25
|
+
- **If there is no prior exploration** for this topic: continue to Step 1 without interruption.
|
|
26
|
+
|
|
27
|
+
### Step 1: Understand the change
|
|
28
|
+
|
|
29
|
+
If the user did NOT provide sufficient context in `$ARGUMENTS`, ask:
|
|
30
|
+
- **What type of change is it?** (new feature, improvement, refactor)
|
|
31
|
+
- **What is the problem or need?** (business context)
|
|
32
|
+
- **What is the objective?** (what it must achieve in one sentence)
|
|
33
|
+
|
|
34
|
+
If `$ARGUMENTS` is already clear, do not ask again.
|
|
35
|
+
|
|
36
|
+
### Step 1.5: Change folder identifier (blocking)
|
|
37
|
+
|
|
38
|
+
The `refacil-sdd/changes/<name>/` directory **cannot** use a `<name>` whose **first character is not an ASCII letter** `[a-zA-Z]` — see **`refacil-prereqs/METHODOLOGY-CONTRACT.md` §9**. Names like `2026-04-17-expose-something` cause `refacil-sdd-ai sdd status <name>` and other SDD commands to fail.
|
|
39
|
+
|
|
40
|
+
**Before delegating to the sub-agent:**
|
|
41
|
+
|
|
42
|
+
1. Agree on or derive the **final slug** of the change (kebab-case: `feat-...`, `expose-...`, `imp-...`, etc.). Dates or tickets do not go at the **start** of the name.
|
|
43
|
+
2. If the user proposes an invalid name, **correct it** (e.g. `feat-` or `change-` prefix) or ask for the correct slug; **do not** delegate until you have a valid name.
|
|
44
|
+
3. Communicate the final agreed slug to the user before generating.
|
|
45
|
+
|
|
46
|
+
### Step 2: Delegate to the refacil-proposer sub-agent
|
|
47
|
+
|
|
48
|
+
Invoke the `refacil-proposer` sub-agent passing it:
|
|
49
|
+
- `changeName`: the valid slug agreed in Step 1.5.
|
|
50
|
+
- `description`: complete description of the change (from Step 1 or from `$ARGUMENTS`).
|
|
51
|
+
|
|
52
|
+
The sub-agent:
|
|
53
|
+
- Explores the codebase (reads `AGENTS.md`, detects relevant files and conventions) before generating.
|
|
54
|
+
- Generates the artifacts under `refacil-sdd/changes/<changeName>/`: `proposal.md`, specification (`specs.md` and/or `specs/**/*.md`), `design.md`, `tasks.md`.
|
|
55
|
+
- If the change involves cross-repo contracts, notes it in `design.md`.
|
|
56
|
+
- Returns ONE single message with the summary + JSON block fenced as ` ```refacil-propose-result `.
|
|
57
|
+
|
|
58
|
+
If the change arises from a **bus room agreement** (`refacil-bus`), indicate it to the sub-agent in the description so it takes it into account when generating the artifacts. Do not shorten the methodology flow. See `refacil-prereqs/BUS-CROSS-REPO.md` (room agreements section).
|
|
59
|
+
|
|
60
|
+
### Step 3: Developer review (Human-in-the-Loop — MANDATORY)
|
|
61
|
+
|
|
62
|
+
Parse the `refacil-propose-result` block from the sub-agent to get the real artifact paths. Present a clear summary to the user for their review:
|
|
63
|
+
|
|
64
|
+
1. **Proposal**: objective, scope, and justification of the change.
|
|
65
|
+
2. **Specs**: acceptance and rejection criteria — list **real paths** received in the JSON block.
|
|
66
|
+
3. **Design**: files to create/modify and patterns to use.
|
|
67
|
+
4. **Tasks**: task list — verify the breakdown is correct and complete.
|
|
68
|
+
|
|
69
|
+
Ask explicitly:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
=== Review required ===
|
|
73
|
+
The artifacts are ready for your review:
|
|
74
|
+
- refacil-sdd/changes/[name]/proposal.md
|
|
75
|
+
- [real spec paths]
|
|
76
|
+
- refacil-sdd/changes/[name]/design.md
|
|
77
|
+
- refacil-sdd/changes/[name]/tasks.md
|
|
78
|
+
|
|
79
|
+
Please review the artifacts and confirm:
|
|
80
|
+
1. Are the acceptance criteria correct?
|
|
81
|
+
2. Does the design align with the project architecture?
|
|
82
|
+
3. Do the tasks cover the full scope?
|
|
83
|
+
|
|
84
|
+
Reply "OK" to continue, or indicate what adjustments you need.
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**DO NOT continue to Step 4 until the user explicitly approves.**
|
|
88
|
+
|
|
89
|
+
If the user requests limited adjustments (change a criterion, fix a path, adjust a task), apply them directly to the corresponding files and present the summary again. If the adjustments are broad (changing the objective or the full scope), re-invoke the sub-agent with the updated description.
|
|
90
|
+
|
|
91
|
+
### Step 4: Next step
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
Proposal approved at: refacil-sdd/changes/[name]/
|
|
95
|
+
The next step is to implement the tasks.
|
|
96
|
+
Do you want me to continue with /refacil:apply?
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Rules
|
|
100
|
+
|
|
101
|
+
- **Change folder name**: always comply with **§9** of the methodology contract (first character ASCII letter; never start with a digit). Validate BEFORE delegating.
|
|
102
|
+
- **Always delegate generation to the sub-agent**. Do not replicate the codebase exploration or artifact generation logic here.
|
|
103
|
+
- **Flow continuity**: if the user confirms affirmatively ("yes", "ok", "go", "continue", etc.) the continuity question in Step 4, immediately invoke the **Skill tool** with `skill: "refacil:apply"`. Do not describe it in text or wait for the user to type `/refacil:apply`. (See `METHODOLOGY-CONTRACT.md §5`.)
|