Skip to content

Implement draftwise new <idea> with conversational drafting#6

Merged
4nkur merged 1 commit into
mainfrom
new-command
Apr 25, 2026
Merged

Implement draftwise new <idea> with conversational drafting#6
4nkur merged 1 commit into
mainfrom
new-command

Conversation

@4nkur
Copy link
Copy Markdown
Owner

@4nkur 4nkur commented Apr 25, 2026

Three-phase command, per CLAUDE.md's "conversation > form-filling" principle:

Phase 1 — plan call. The model returns a JSON plan with affected flows (grounded in real scanner files), 4-8 clarifying questions each tied to a specific gap in the codebase, and 2-5 adjacent opportunities pointing at existing flows that should change alongside the feature so edge cases surface during drafting, not in code review.

Phase 2 — interactive loop. Inquirer walks the PM through each question (free-text answers, "I don't know" allowed) and each opportunity (accept / decline / defer).

Phase 3 — synthesis call. Idea + scanner + answers + decisions → product-spec.md following the template (problem, users, stories, acceptance criteria, affected flows, adjacent changes, edge cases, test cases, scope, metrics, counter-metrics). Saves to .draftwise/specs//product-spec.md.

Agent mode bundles all three phases into one instruction for the host coding agent. Hard rule shared across both modes: ASK, don't assume — every gap becomes a question, never an invention.

10 new tests covering parser robustness (fenced/raw/missing fields) and command flow (both modes, no-opportunities edge case, missing inputs).

Three-phase command, per CLAUDE.md's "conversation > form-filling"
principle:

Phase 1 — plan call. The model returns a JSON plan with affected
flows (grounded in real scanner files), 4-8 clarifying questions
each tied to a specific gap in the codebase, and 2-5 adjacent
opportunities pointing at existing flows that should change
alongside the feature so edge cases surface during drafting, not
in code review.

Phase 2 — interactive loop. Inquirer walks the PM through each
question (free-text answers, "I don't know" allowed) and each
opportunity (accept / decline / defer).

Phase 3 — synthesis call. Idea + scanner + answers + decisions →
product-spec.md following the template (problem, users, stories,
acceptance criteria, affected flows, adjacent changes, edge cases,
test cases, scope, metrics, counter-metrics). Saves to
.draftwise/specs/<feature-slug>/product-spec.md.

Agent mode bundles all three phases into one instruction for the
host coding agent. Hard rule shared across both modes: ASK, don't
assume — every gap becomes a question, never an invention.

10 new tests covering parser robustness (fenced/raw/missing fields)
and command flow (both modes, no-opportunities edge case, missing
inputs).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@4nkur 4nkur merged commit 8196aed into main Apr 25, 2026
@4nkur 4nkur deleted the new-command branch April 25, 2026 08:03
4nkur added a commit that referenced this pull request Apr 26, 2026
CI workflow at .github/workflows/ci.yml — install + lint + test
on Node 20 and 22, on every PR and push to main. Manual checks
before merge stop being the only line of defense.

Anthropic SDK maxRetries goes from its default 2 to 4. The SDK
already handles 429 / 5xx / network retries internally; the audit
suggested wrapping our own retry but that's redundant with
existing SDK behavior. Bumping the SDK's own knob covers more
transient blips with less code.

scan-cache.json gains a cacheVersion field. When we change scan
output shape later (new field, renamed key), bumping
CACHE_VERSION in src/utils/scan-cache.js makes old caches
miss instead of poisoning downstream commands with stale shapes.

Closes audit P2 #4, #6, #7. All seven P2s now closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant