Plan Target for create-refrakt
Add a planning-only scaffold option to create-refrakt so users who want to adopt refrakt primarily as a plan management tool have a one-command entry point, matching the experience for sites and themes.
Add a planning-only scaffold option to create-refrakt so users who want to adopt refrakt primarily as a plan management tool have a one-command entry point, matching the experience for sites and themes.
f2b3512create-refrakt is the advertised entry point to the refrakt ecosystem, but it only knows how to scaffold full sites (SvelteKit, Astro, Nuxt, Next, Eleventy, static HTML) and theme packages. Users who want refrakt solely for its planning features (@refrakt-md/plan — specs, work items, bugs, decisions, milestones) currently have to discover and execute a multi-step manual sequence:
npm init -y in a new directorynpm install --save-dev @refrakt-md/cli @refrakt-md/plannpx refrakt plan init plan.claude/settings.json hooks, wrapper scripts, and AI tool instruction filesEach of those steps is documented in isolation (root CLAUDE.md, refrakt plan init --help, plan package README), but there is no consolidated "here's how to start a planning-only project" path. Users arriving at npx create-refrakt see framework options and theme scaffolding — planning isn't represented at all.
This matters for three reasons:
--target options, themes have --type theme. Planning-only usage deserves the same first-class surface.plan init target directory, optional flags). A single command collapses that to one tool call.Planning-only is a distinct project type, not a site variant. A planning project has no framework, no theme, no rendering pipeline — just a plan/ directory and CLI commands that read/write it. This is a different kind of thing from a site, so it belongs under --type, not --target.
Delegate to refrakt plan init, don't duplicate it. The plan package already owns scaffolding logic (directory structure, example items, instruction files, optional Claude Code hook, optional wrapper script). create-refrakt should not reimplement any of that — it should produce a minimal package.json, install the CLI and plan package, and invoke the existing init command.
Minimal dependencies. A planning-only project should install @refrakt-md/cli and @refrakt-md/plan and nothing else. No @refrakt-md/runes, @refrakt-md/transform, @refrakt-md/lumina, or any framework adapter. The resulting node_modules should be as small as the ecosystem allows.
Interactive prompt parity. The existing interactive mode asks for project name and framework. When --type plan is selected (or offered as a choice), the framework prompt is skipped — there is no framework to choose.
Add plan as a third value for --type in create-refrakt:
# Non-interactive npx create-refrakt my-plan --type plan # Interactive — "Planning only" appears as a choice alongside "Site" and "Theme" npx create-refrakt my-plan
Usage output becomes:
Usage: create-refrakt [name] [options] Options: --type <site|theme|plan> What to create (default: site) --target <target> Adapter target (sites only, default: sveltekit) --theme, -t <package> Theme package (sites only, default: @refrakt-md/lumina) --scope, -s <scope> npm scope (themes only) --help, -h Show this help message Examples: npx create-refrakt my-plan --type plan npx create-refrakt my-site --target astro npx create-refrakt my-theme --type theme
When --type plan is set, --target, --theme, and --scope are rejected with a clear error message.
When no --type is supplied and stdout is a TTY, the first prompt becomes:
? What do you want to create? › Site — full refrakt.md site with a framework adapter Theme — a publishable theme package Planning only — specs, work items, decisions, milestones
If the user chooses "Planning only", the framework prompt is skipped.
Running npx create-refrakt my-plan --type plan in an empty working directory should produce the following:
my-plan/ package.json .gitignore plan/ INSTRUCTIONS.md AGENTS.md specs/ SPEC-001-example.md work/ WORK-001-example.md decisions/ ADR-001-example.md milestones/ v0.1.0.md index.md
{ "name": "my-plan", "version": "0.0.0", "private": true, "scripts": { "plan": "refrakt plan", "plan:next": "refrakt plan next", "plan:status": "refrakt plan status", "plan:validate": "refrakt plan validate" }, "devDependencies": { "@refrakt-md/cli": "<current>", "@refrakt-md/plan": "<current>" } }
Dependency versions are derived from create-refrakt's own package.json at runtime (same pattern used for site scaffolds today — see packages/create-refrakt/src/scaffold.ts).
The scaffold does not create a README.md at the project root. refrakt plan init already writes plan/INSTRUCTIONS.md (human-facing workflow guide) and plan/AGENTS.md (agent-facing instructions) inside the plan directory that owns all the real content. A second doc file at the repo root would duplicate that and read awkwardly next to a plan/ folder that isn't the repo itself. Users who want a root README can add one manually — the scaffold shouldn't impose one.
The npm run plan* aliases give users a discoverable verb surface without requiring them to remember npx refrakt plan .... Agents invoking the CLI directly can still use npx refrakt plan ....
refrakt plan initAfter writing package.json and .gitignore, the scaffold runs refrakt plan init plan in the new project directory. This produces the plan/ tree, INSTRUCTIONS.md, AGENTS.md, and example content.
Two implementation options:
package.json, runs npm install, then invokes npx refrakt plan init plan. Simple but slow (two npm install roundtrips if the user re-runs init).@refrakt-md/plan as a dependency of create-refrakt and call the init function programmatically. Faster and more coherent, but couples create-refrakt's release cadence to the plan package.Option 2 is preferred because create-refrakt's existing site scaffold already depends on @refrakt-md/runes and @refrakt-md/transform for config generation — adding @refrakt-md/plan is consistent with that pattern, and the packages are released together via fixed-mode Changesets anyway.
refrakt plan init already handles writing AGENTS.md and appending to per-tool instruction files. create-refrakt --type plan should not duplicate this logic — it should pass through any relevant flags to the init step.
Forward these flags to refrakt plan init if supplied:
--agent <tool> — which AI tool instruction file to append to (claude, cursor, copilot, etc.)--no-claude-hook — skip .claude/settings.json SessionStart hook--no-wrapper — skip plan.sh wrapper scriptThese are not required for v1 — the defaults from plan init are sensible.
After scaffolding, print:
Done! Your refrakt.md planning project is ready. Next steps: cd my-plan npm install npx refrakt plan next Useful commands: npm run plan:status See an overview of all plan items npm run plan:next Find the next ready work item npx refrakt plan create work --title "..." npx refrakt plan update <id> --status in-progress Documentation: https://refrakt.md/docs/plan
plan/ directory — create-refrakt always operates on an empty or new directory. Users with pre-existing plan content should run refrakt plan init manually (or use the deferred refrakt plan import proposed in SPEC-039).create-refrakt my-site, they can add planning by running npm install --save-dev @refrakt-md/plan && npx refrakt plan init plan. Supporting "augment existing project" via create-refrakt itself is not in scope.create-refrakt-plan binary — adding a separate bin entry adds packaging and discovery overhead without clear benefit. --type plan on the existing bin is sufficient.create-refrakt --type plan install @refrakt-md/plan as a devDependency or a regular dependency? The CLI package is always a devDependency; plan is similar in that it's only used at author time. Leaning devDependency for consistency.create-refrakt entry point delegating to that init. The two are complementary: improvements to plan init flow through automatically to create-refrakt --type plan.npx create-refrakt my-plan --type plan scaffolds a new directory containing a minimal package.json, .gitignore, and the full plan/ tree produced by refrakt plan init.package.json lists only @refrakt-md/cli and @refrakt-md/plan under devDependencies — no site-related packages.npm install and npx refrakt plan next in the scaffolded project succeeds and prints the example work item.npx create-refrakt interactive mode offers "Planning only" as a third choice alongside "Site" and "Theme", and skips the framework prompt when chosen.--type plan combined with --target, --theme, or --scope produces a clear error and exits non-zero.create-refrakt --help documents the plan value for --type with an example.plan next, plan status, and a link to plan docs.package.json shape.