Implement draftwise tech [<feature>]#7
Merged
Merged
Conversation
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
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.
3 tasks
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.