Skip to content

Implement draftwise tech [<feature>]#7

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

Implement draftwise tech [<feature>]#7
4nkur merged 1 commit into
mainfrom
tech-command

Conversation

@4nkur
Copy link
Copy Markdown
Owner

@4nkur 4nkur commented Apr 25, 2026

Reads an approved product-spec.md and drafts technical-spec.md grounded in the scanner output. Sections: summary, data model changes, API changes, component changes, migration notes, test plan, open technical questions. Hard rule shared with new and explain: every cited file path must come from the scanner — if a product-spec implication isn't visible in the codebase, it surfaces as an open question rather than a fabricated path.

Spec selection mirrors common CLI ergonomics: pass a slug (draftwise tech collab-albums) to target one directly, auto-pick when there's exactly one product spec, or fall back to an inquirer select when multiple specs coexist. Existing technical-spec.md is overwritten — flagged in the picker so the user knows.

Adds src/utils/specs.js (listSpecs) which tasks/list/show will reuse. 11 new tests cover the helper, command flow in both modes, and the four selection paths (auto / arg / unknown-arg / multi-spec prompt) plus the empty-product-spec error.

Reads an approved product-spec.md and drafts technical-spec.md
grounded in the scanner output. Sections: summary, data model
changes, API changes, component changes, migration notes, test
plan, open technical questions. Hard rule shared with new and
explain: every cited file path must come from the scanner — if a
product-spec implication isn't visible in the codebase, it surfaces
as an open question rather than a fabricated path.

Spec selection mirrors common CLI ergonomics: pass a slug
(`draftwise tech collab-albums`) to target one directly, auto-pick
when there's exactly one product spec, or fall back to an inquirer
select when multiple specs coexist. Existing technical-spec.md is
overwritten — flagged in the picker so the user knows.

Adds src/utils/specs.js (listSpecs) which tasks/list/show will
reuse. 11 new tests cover the helper, command flow in both modes,
and the four selection paths (auto / arg / unknown-arg / multi-spec
prompt) plus the empty-product-spec error.
@4nkur 4nkur merged commit b1a0580 into main Apr 25, 2026
@4nkur 4nkur deleted the tech-command branch April 25, 2026 08:11
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.
4nkur added a commit that referenced this pull request Apr 30, 2026
…round a spec while preserving PM hand-edits

Resolves the long-standing "AI-assisted spec merge mode" open question. Re-running `new` / `tech` / `tasks` would clobber PM edits — `refine` is the alternative. Reads the chosen file, treats it as ground truth for what the PM wants, prints it plus its source-of-truth (scanner / overview, plus the upstream spec for tech/tasks), then prints a three-phase agent instruction: audit each section as strong/weak, re-ground only the weak ones, write the file back preserving strong sections character-for-character and any YAML frontmatter at the top of `product-spec.md`. Different shape from `clarify`: clarify finds gaps and walks the PM through them; refine takes the existing spec as ground truth and re-grounds the parts that need it.

Hard rules in the prompt: no fabricated code references (mark `(unverified)` or remove if the source-of-truth doesn't surface it), no scope creep (refine ≠ add new features / edge cases — gaps go under Open questions), and don't touch sections that are already strong. Bar for "weak" is "actively misleads or under-specifies," not "could be tighter," so the agent doesn't churn good prose.

Same auto-pick / multi-spec / unknown-slug ergonomics as `tech`. Filters specs by which file the requested type requires; `tech`/`tasks` additionally validate that the upstream spec exists. Per-type metadata table (file name, source-of-truth label, section-preservation rule) lives at the top of `src/ai/prompts/refine.js`.

Adds 16 tests in `test/commands/refine.test.js`. Updates CHANGELOG `[Unreleased] ### Added`, CLAUDE.md (commands list, v1 status #7, new "Refine, don't clobber" design principle), README commands table.
4nkur added a commit that referenced this pull request Apr 30, 2026
…round a spec while preserving PM hand-edits (#66)

Resolves the long-standing "AI-assisted spec merge mode" open question. Re-running `new` / `tech` / `tasks` would clobber PM edits — `refine` is the alternative. Reads the chosen file, treats it as ground truth for what the PM wants, prints it plus its source-of-truth (scanner / overview, plus the upstream spec for tech/tasks), then prints a three-phase agent instruction: audit each section as strong/weak, re-ground only the weak ones, write the file back preserving strong sections character-for-character and any YAML frontmatter at the top of `product-spec.md`. Different shape from `clarify`: clarify finds gaps and walks the PM through them; refine takes the existing spec as ground truth and re-grounds the parts that need it.

Hard rules in the prompt: no fabricated code references (mark `(unverified)` or remove if the source-of-truth doesn't surface it), no scope creep (refine ≠ add new features / edge cases — gaps go under Open questions), and don't touch sections that are already strong. Bar for "weak" is "actively misleads or under-specifies," not "could be tighter," so the agent doesn't churn good prose.

Same auto-pick / multi-spec / unknown-slug ergonomics as `tech`. Filters specs by which file the requested type requires; `tech`/`tasks` additionally validate that the upstream spec exists. Per-type metadata table (file name, source-of-truth label, section-preservation rule) lives at the top of `src/ai/prompts/refine.js`.

Adds 16 tests in `test/commands/refine.test.js`. Updates CHANGELOG `[Unreleased] ### Added`, CLAUDE.md (commands list, v1 status #7, new "Refine, don't clobber" design principle), README commands table.
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