Add draftwise scaffold for greenfield file scaffolding#14
Merged
Conversation
PR2 of the greenfield expansion — turns the chosen stack's plan
into actual files on disk, optionally.
init (greenfield + api mode) now also writes
.draftwise/scaffold.json with the structured stack data:
{
"stack": "Next.js + Postgres + Prisma",
"summary": "...",
"directory_structure": "<markdown tree>",
"initial_files": [{ path, purpose }, ...],
"setup_commands": [...]
}
The greenfield agent-mode instruction picks up the same file —
the host coding agent is now told to save scaffold.json alongside
overview.md so `draftwise scaffold` works in both modes.
draftwise scaffold:
- Reads .draftwise/scaffold.json. Errors with a helpful message
if missing or malformed.
- Lists the planned files with purposes, then asks the user to
confirm before writing. The confirm prompt warns that
scaffolders like create-next-app should run first, since
pre-creating files can interfere with a fresh scaffolder run.
- Default-NO on the confirm to avoid surprises.
- Creates each file with placeholder content tailored by
extension (// TODO for JS/TS, # TODO for Python, # heading
for markdown, etc.). Recursively creates parent dirs.
- Skips files that already exist (no overwrite).
- Prints setup_commands as a reminder; does NOT execute them.
7 new scaffold tests + 1 init test verifying scaffold.json is
written. 102 tests total, all passing.
Per docs-sync: README + CLAUDE.md updated to add scaffold to the
command list, mention scaffold.json in the .draftwise/ tree
diagram, and check off the "optional file scaffolding" roadmap
item.
4nkur
added a commit
that referenced
this pull request
Apr 25, 2026
Per the user's request — every change to the project gets recorded here by tag ID, date, and author. Format follows Keep a Changelog (keepachangelog.com) with semver versioning. Retroactively populated: - [0.0.1] — 2026-04-25 — Ankur — the first npm release, with every command in the v1 build order (init, scan, explain, new, tech, tasks, list, show) and the AI plumbing for Claude. - [Unreleased] — everything merged to main since 0.0.1 but not yet published: greenfield init routing (#12), greenfield-aware new/tech/tasks (#13), scaffold (#14), scanner robustness (#15), Python support (#16), scan cache + flow filter (#17), pruning resolved questions out of CLAUDE.md (#18), and this changelog. Going forward (saved as a feedback memory): - Every functional PR adds an entry under [Unreleased] in the same PR — bundled with the change, not as a follow-up. - On version tag, [Unreleased] entries move into a versioned section header `## [X.Y.Z] — YYYY-MM-DD — author` and a fresh empty [Unreleased] block is added at the top. - Pure-internal noise (test-only refactors, lockfile bumps, settings.local.json) is skipped.
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.
PR2 of the greenfield expansion — turns the chosen stack's plan into actual files on disk, optionally.
init (greenfield + api mode) now also writes
.draftwise/scaffold.json with the structured stack data:
The greenfield agent-mode instruction picks up the same file — the host coding agent is now told to save scaffold.json alongside overview.md so
draftwise scaffoldworks in both modes.draftwise scaffold:
7 new scaffold tests + 1 init test verifying scaffold.json is written. 102 tests total, all passing.
Per docs-sync: README + CLAUDE.md updated to add scaffold to the command list, mention scaffold.json in the .draftwise/ tree diagram, and check off the "optional file scaffolding" roadmap item.