Skip to content

Commit 9ca0316

Browse files
alexeyvclaude
andauthored
refactor(quick-dev): eliminate spec-wip.md singleton (#2214)
* refactor(quick-dev): eliminate spec-wip.md singleton Write directly to spec-{slug}.md with status: draft instead of using a shared spec-wip.md file. Use draft status for resume detection in step-01. Removes wipFile variable from all step frontmatter and workflow initialization. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(quick-dev): address PR review findings - step-02: preserve Intent block on draft resume instead of regenerating from template (F1) - step-01: resume existing draft on slug collision rather than creating -2 duplicate (F3) - step-01: recognize `done` status and ingest as context instead of silently re-implementing (F4) - step-oneshot: remove unused spec_file frontmatter declaration (F6) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6cecab2 commit 9ca0316

4 files changed

Lines changed: 12 additions & 18 deletions

File tree

src/bmm-skills/4-implementation/bmad-quick-dev/step-01-clarify-and-route.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
wipFile: '{implementation_artifacts}/spec-wip.md'
32
deferred_work_file: '{implementation_artifacts}/deferred-work.md'
43
spec_file: '' # set at runtime for both routes before leaving this step
54
---
@@ -21,16 +20,16 @@ Before listing artifacts or prompting the user, check whether you already know t
2120

2221
1. Explicit argument
2322
Did the user pass a specific file path, spec name, or clear instruction this message?
24-
- If it points to a file that matches the spec template (has `status` frontmatter with a recognized value: ready-for-dev, in-progress, or in-review) → set `spec_file` and **EARLY EXIT** to the appropriate step (step-03 for ready/in-progress, step-04 for review).
23+
- If it points to a file that matches the spec template (has `status` frontmatter with a recognized value: draft, ready-for-dev, in-progress, in-review, or done) → set `spec_file` and **EARLY EXIT** to the appropriate step (step-02 for draft, step-03 for ready/in-progress, step-04 for review). For `done`, ingest as context and proceed to INSTRUCTIONS — do not resume.
2524
- Anything else (intent files, external docs, plans, descriptions) → ingest it as starting intent and proceed to INSTRUCTIONS. Do not attempt to infer a workflow state from it.
2625

2726
2. Recent conversation
2827
Do the last few human messages clearly show what the user intends to work on?
2928
Use the same routing as above.
3029

3130
3. Otherwise — scan artifacts and ask
32-
- `{wipFile}` exists? → Offer resume or archive.
33-
- Active specs (`ready-for-dev`, `in-progress`, `in-review`) in `{implementation_artifacts}`? → List them and HALT. Ask user which to resume (or `[N]` for new).
31+
- Active specs (`draft`, `ready-for-dev`, `in-progress`, `in-review`) in `{implementation_artifacts}`? → List them and HALT. Ask user which to resume (or `[N]` for new).
32+
- If `draft` selected: Set `spec_file`. **EARLY EXIT**`./step-02-plan.md` (resume planning from the draft)
3433
- If `ready-for-dev` or `in-progress` selected: Set `spec_file`. **EARLY EXIT**`./step-03-implement.md`
3534
- If `in-review` selected: Set `spec_file`. **EARLY EXIT**`./step-04-review.md`
3635
- Unformatted spec or intent file lacking `status` frontmatter? → Suggest treating its contents as the starting intent. Do NOT attempt to infer a state and resume it.
@@ -65,7 +64,7 @@ Never ask extra questions if you already understand what the user intends.
6564
- On **K**: Proceed as-is.
6665
5. Route — choose exactly one:
6766

68-
Derive a valid kebab-case slug from the clarified intent. If the intent references a tracking identifier (story number, issue number, ticket ID), lead the slug with it (e.g. `3-2-digest-delivery`, `gh-47-fix-auth`). If `{implementation_artifacts}/spec-{slug}.md` already exists, append `-2`, `-3`, etc. Set `spec_file` = `{implementation_artifacts}/spec-{slug}.md`.
67+
Derive a valid kebab-case slug from the clarified intent. If the intent references a tracking identifier (story number, issue number, ticket ID), lead the slug with it (e.g. `3-2-digest-delivery`, `gh-47-fix-auth`). If `{implementation_artifacts}/spec-{slug}.md` already exists: if its status is `draft`, treat it as the same work and resume it (set `spec_file` to that path, **EARLY EXIT**`./step-02-plan.md`); otherwise append `-2`, `-3`, etc. Set `spec_file` = `{implementation_artifacts}/spec-{slug}.md`.
6968

7069
**a) One-shot** — zero blast radius: no plausible path by which this change causes unintended consequences elsewhere. Clear intent, no architectural decisions.
7170

src/bmm-skills/4-implementation/bmad-quick-dev/step-02-plan.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
wipFile: '{implementation_artifacts}/spec-wip.md'
32
deferred_work_file: '{implementation_artifacts}/deferred-work.md'
43
---
54

@@ -12,11 +11,12 @@ deferred_work_file: '{implementation_artifacts}/deferred-work.md'
1211

1312
## INSTRUCTIONS
1413

15-
1. Investigate codebase. _Isolate deep exploration in sub-agents/tasks where available. To prevent context snowballing, instruct subagents to give you distilled summaries only._
16-
2. Read `./spec-template.md` fully. Fill it out based on the intent and investigation, and write the result to `{wipFile}`.
17-
3. Self-review against READY FOR DEVELOPMENT standard.
18-
4. If intent gaps exist, do not fantasize, do not leave open questions, HALT and ask the human.
19-
5. Token count check (see SCOPE STANDARD). If spec exceeds 1600 tokens:
14+
1. Draft resume check. If `{spec_file}` exists with `status: draft`, read it and capture the verbatim `<frozen-after-approval>...</frozen-after-approval>` block as `preserved_intent`. Otherwise `preserved_intent` is empty.
15+
2. Investigate codebase. _Isolate deep exploration in sub-agents/tasks where available. To prevent context snowballing, instruct subagents to give you distilled summaries only._
16+
3. Read `./spec-template.md` fully. Fill it out based on the intent and investigation. If `{preserved_intent}` is non-empty, substitute it for the `<frozen-after-approval>` block in your filled spec before writing. Write the result to `{spec_file}`.
17+
4. Self-review against READY FOR DEVELOPMENT standard.
18+
5. If intent gaps exist, do not fantasize, do not leave open questions, HALT and ask the human.
19+
6. Token count check (see SCOPE STANDARD). If spec exceeds 1600 tokens:
2020
- Show user the token count.
2121
- HALT and ask human: `[S] Split — carve off secondary goals` | `[K] Keep full spec — accept the risks`
2222
- On **S**: Propose the split — name each secondary goal. Append deferred goals to `{deferred_work_file}`. Rewrite the current spec to cover only the main goal — do not surgically carve sections out; regenerate the spec for the narrowed scope. Continue to checkpoint.
@@ -26,7 +26,7 @@ deferred_work_file: '{implementation_artifacts}/deferred-work.md'
2626

2727
Present summary. If token count exceeded 1600 and user chose [K], include the token count and explain why it may be a problem. HALT and ask human: `[A] Approve` | `[E] Edit`
2828

29-
- **A**: Rename `{wipFile}` to `{spec_file}`, set status `ready-for-dev`. Everything inside `<frozen-after-approval>` is now locked — only the human can change it. Display the finalized spec path to the user as a CWD-relative path (no leading `/`) so it is clickable in the terminal. → Step 3.
29+
- **A**: Set status `ready-for-dev` in `{spec_file}`. Everything inside `<frozen-after-approval>` is now locked — only the human can change it. Display the finalized spec path to the user as a CWD-relative path (no leading `/`) so it is clickable in the terminal. → Step 3.
3030
- **E**: Apply changes, then return to CHECKPOINT 1.
3131

3232

src/bmm-skills/4-implementation/bmad-quick-dev/step-oneshot.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
deferred_work_file: '{implementation_artifacts}/deferred-work.md'
3-
spec_file: '' # set by step-01 before entering this step
43
---
54

65
# Step One-Shot: Implement, Review, Present

src/bmm-skills/4-implementation/bmad-quick-dev/workflow.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ Load and read full config from `{main_config}` and resolve:
7070

7171
YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}`.
7272

73-
### 2. Paths
74-
75-
- `wipFile` = `{implementation_artifacts}/spec-wip.md`
76-
77-
### 3. First Step Execution
73+
### 2. First Step Execution
7874

7975
Read fully and follow: `./step-01-clarify-and-route.md` to begin the workflow.

0 commit comments

Comments
 (0)