Skip to content

Add draftwise scaffold for greenfield file scaffolding#14

Merged
4nkur merged 1 commit intomainfrom
greenfield-scaffolding
Apr 25, 2026
Merged

Add draftwise scaffold for greenfield file scaffolding#14
4nkur merged 1 commit intomainfrom
greenfield-scaffolding

Conversation

@4nkur
Copy link
Copy Markdown
Owner

@4nkur 4nkur commented Apr 25, 2026

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.

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 4nkur merged commit 3904818 into main Apr 25, 2026
@4nkur 4nkur deleted the greenfield-scaffolding branch April 25, 2026 11:11
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.
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