pagepublishedmdai-assisted

Boilerplate Setup Wizard: Design Doc

Architecture and UX plan for a standalone CLI tool that scaffolds new projects from the boilerplate via a web UI wizard.

Path
/notes/boilerplate-setup-wizard
Published
May 7, 2026
Revised
—
Project
jaygriff-v3
Tags

On this page

Stored toc, derived from the body's headings on save. The body below isn't rendered yet, so these show the anchor ids rather than linking to them.

  • The Idea #the-idea
  • Architecture #architecture
  • Template Composition (not removal) #template-composition-not-removal
  • Wizard Steps #wizard-steps
  • Step 1: Project Identity #step-1-project-identity
  • Step 2: Branding #step-2-branding
  • Step 3: Optional Templates #step-3-optional-templates
  • Step 4: AI Assistant Setup #step-4-ai-assistant-setup
  • Step 5: Review + Confirm #step-5-review-confirm
  • Server Script: What It Does #server-script-what-it-does
  • Repo Structure #repo-structure
  • UX Notes #ux-notes
  • MVP Scope #mvp-scope
  • Open Questions #open-questions

Body

markdownbody.md
## The Idea

Every time you clone the boilerplate, you spend the first 20 minutes doing the same manual stuff: rename the project, swap the favicon, delete the example pages you don't need, set up your agent rules file, maybe add prettier, maybe not. It's not hard but it's friction, and friction compounds.

The fix: a standalone CLI tool — basically your own `create-next-app`. Run one command, a web UI wizard opens, you make your choices, and a fully configured project is generated in a new directory. No cloning, no manual cleanup, no fighting dependencies.

---

## Architecture

This is a **separate repo/package** from the boilerplate itself. Three pieces:

**1. `cli.js` — the entry point**

You run `npx create-jay-app my-project`. The CLI:

- Clones the boilerplate into `./my-project`
- Starts a local Vite dev server + Express/Hono server
- Opens the browser to the wizard UI
- Waits for the wizard to complete
- Shuts everything down

**2. `ui/` — Vite + React SPA**

The wizard UI. Full web app — color pickers, file uploads, drag-and-drop, live previews. Not a CLI prompt. Runs on `localhost:4321` (or similar) and only exists for the duration of setup.

**3. `server.js` — local Express/Hono server**

Runs alongside Vite. The SPA calls it to apply config to the cloned project directory. Handles all filesystem operations: writing files, merging `package.json`, running `npm install`.

**Why not Next.js for the UI?** Vite starts in ~300ms. Next takes 2-3 seconds. For a local dev tool, that matters. No server components needed — it's just a React app talking to a local server.

---

## Template Composition (not removal)

This is how `create-react-app`, `create-t3-app`, and every other serious scaffolding tool works. Instead of one big boilerplate you strip down, you have a collection of partial template directories that get merged together.

```
templates/
  core/                # always included: Next.js, Tailwind, shadcn, typography system
  with-examples/       # the example pages
  with-prettier/       # .prettierrc + prettier dep
  with-cline/          # .clinerules template
  with-cursor/         # .cursorrules template
  with-eslint-strict/  # stricter ESLint config
```

Based on wizard choices, the server script:

1. Copies `core/` into the new project directory
2. Copies each selected template on top (merging directories)
3. Deep-merges all `package.json` files into one
4. Runs `npm install` once at the end

**Why this beats removal:**

- No dependency graph problems — you never have to know what imports what
- No uninstalling — just don't include what you don't want
- Predictable — you know exactly what's in each template
- Maintainable — update a template once, all future projects get it
- Battle-tested — it's the pattern every major scaffolding tool uses

---

## Wizard Steps

### Step 1: Project Identity

- App name (writes to `config.ts`, `layout.tsx` title)
- Description (writes to `config.ts`, `layout.tsx` description)
- Author name (writes to `config.ts`, used in generated files)

### Step 2: Branding

- Favicon: emoji picker or upload a file (saves to `public/favicon.ico`, updates `layout.tsx`)
- Logo: optional file upload (saves to `public/logo.*`)
- Primary color: color picker (writes oklch value to `globals.css` `:root`)

### Step 3: Optional Templates

Checkboxes — each maps to a template directory:

- Example pages (`with-examples`)
- Prettier (`with-prettier`)
- Strict ESLint (`with-eslint-strict`)

### Step 4: AI Assistant Setup

- Which agent? (Cline, Cursor, Copilot, none)
- Generate a rules file from template? Or skip?
- If generating: fills in project name, stack, conventions from Step 1

### Step 5: Review + Confirm

- Summary of all choices
- List of templates being merged
- Files that will be created/modified
- "Generate Project" button
- Progress indicator while it runs
- Opens VS Code when done

---

## Server Script: What It Does

```js
applyConfig(projectDir, config) {
  // 1. Copy selected templates into projectDir (merge directories)
  // 2. Deep-merge all package.json files
  // 3. Write config.ts with project identity values
  // 4. Update layout.tsx metadata (title, description, favicon)
  // 5. Write primary color to globals.css :root
  // 6. Write agent rules file if requested
  // 7. Run npm install once
  // 8. Signal wizard UI that setup is complete
}
```

All file writes use Node.js `fs`. Idempotent where possible — check before writing.

---

## Repo Structure

```
create-jay-app/
  cli.js              # entry point, clones boilerplate, starts servers
  server.js           # local Express/Hono, handles fs operations
  ui/                 # Vite + React wizard SPA
    src/
      App.tsx
      steps/
        Identity.tsx
        Branding.tsx
        Templates.tsx
        Agent.tsx
        Review.tsx
  templates/
    core/
    with-examples/
    with-prettier/
    with-cline/
    with-cursor/
    with-eslint-strict/
  scripts/
    apply-config.js   # the actual file writer
    merge-package.js  # deep-merges package.json files
```

---

## UX Notes

- Wizard should feel polished. Think macOS setup assistant, not a dev tool.
- Each step is a full-screen card with a progress indicator at the top.
- All choices have sensible defaults — you can hit Next through everything.
- The review step shows exactly what will be generated.
- After confirm, show a loading state with what's happening ("Merging templates...", "Installing dependencies...").
- On completion, open the project in VS Code automatically.

---

## MVP Scope

1. Identity (name, description, author)
2. Branding (favicon emoji, primary color)
3. Templates (examples yes/no, prettier yes/no)
4. Agent rules (Cline or skip)
5. Review + confirm

That's enough to make every new project feel immediately personalized and cuts the most repetitive manual steps.

---

## Open Questions

- Should the wizard support logo upload in MVP, or defer?
- How does the CLI handle the case where `my-project` directory already exists?
- Should `create-jay-app` be published to npm or just run locally via `node cli.js`?
- Should the generated `.clinerules` be opinionated (based on this stack) or generic?
- Does the boilerplate repo need to change at all, or does it stay as-is and serve as the `core/` template source?

Raw row

jsonboilerplate-setup-wizard.json
{
  "id": "becea2f0-2eda-4136-8688-5900f4d8b26f",
  "parentId": "b455ec91-16d1-41f1-a222-a7097ea66c25",
  "slug": "boilerplate-setup-wizard",
  "path": "/notes/boilerplate-setup-wizard",
  "type": "page",
  "status": "published",
  "title": "Boilerplate Setup Wizard: Design Doc",
  "description": "Architecture and UX plan for a standalone CLI tool that scaffolds new projects from the boilerplate via a web UI wizard.",
  "intro": null,
  "body": "## The Idea\n\nEvery time you clone the boilerplate, you spend the first 20 minutes doing the same manual stuff: rename the project, swap the favicon, delete the example pages you don't need, set up your agent rules file, maybe add prettier, maybe not. It's not hard but it's friction, and friction compounds.\n\nThe fix: a standalone CLI tool — basically your own `create-next-app`. Run one command, a web UI wizard opens, you make your choices, and a fully configured project is generated in a new directory. No cloning, no manual cleanup, no fighting dependencies.\n\n---\n\n## Architecture\n\nThis is a **separate repo/package** from the boilerplate itself. Three pieces:\n\n**1. `cli.js` — the entry point**\n\nYou run `npx create-jay-app my-project`. The CLI:\n\n- Clones the boilerplate into `./my-project`\n- Starts a local Vite dev server + Express/Hono server\n- Opens the browser to the wizard UI\n- Waits for the wizard to complete\n- Shuts everything down\n\n**2. `ui/` — Vite + React SPA**\n\nThe wizard UI. Full web app — color pickers, file uploads, drag-and-drop, live previews. Not a CLI prompt. Runs on `localhost:4321` (or similar) and only exists for the duration of setup.\n\n**3. `server.js` — local Express/Hono server**\n\nRuns alongside Vite. The SPA calls it to apply config to the cloned project directory. Handles all filesystem operations: writing files, merging `package.json`, running `npm install`.\n\n**Why not Next.js for the UI?** Vite starts in ~300ms. Next takes 2-3 seconds. For a local dev tool, that matters. No server components needed — it's just a React app talking to a local server.\n\n---\n\n## Template Composition (not removal)\n\nThis is how `create-react-app`, `create-t3-app`, and every other serious scaffolding tool works. Instead of one big boilerplate you strip down, you have a collection of partial template directories that get merged together.\n\n```\ntemplates/\n  core/                # always included: Next.js, Tailwind, shadcn, typography system\n  with-examples/       # the example pages\n  with-prettier/       # .prettierrc + prettier dep\n  with-cline/          # .clinerules template\n  with-cursor/         # .cursorrules template\n  with-eslint-strict/  # stricter ESLint config\n```\n\nBased on wizard choices, the server script:\n\n1. Copies `core/` into the new project directory\n2. Copies each selected template on top (merging directories)\n3. Deep-merges all `package.json` files into one\n4. Runs `npm install` once at the end\n\n**Why this beats removal:**\n\n- No dependency graph problems — you never have to know what imports what\n- No uninstalling — just don't include what you don't want\n- Predictable — you know exactly what's in each template\n- Maintainable — update a template once, all future projects get it\n- Battle-tested — it's the pattern every major scaffolding tool uses\n\n---\n\n## Wizard Steps\n\n### Step 1: Project Identity\n\n- App name (writes to `config.ts`, `layout.tsx` title)\n- Description (writes to `config.ts`, `layout.tsx` description)\n- Author name (writes to `config.ts`, used in generated files)\n\n### Step 2: Branding\n\n- Favicon: emoji picker or upload a file (saves to `public/favicon.ico`, updates `layout.tsx`)\n- Logo: optional file upload (saves to `public/logo.*`)\n- Primary color: color picker (writes oklch value to `globals.css` `:root`)\n\n### Step 3: Optional Templates\n\nCheckboxes — each maps to a template directory:\n\n- Example pages (`with-examples`)\n- Prettier (`with-prettier`)\n- Strict ESLint (`with-eslint-strict`)\n\n### Step 4: AI Assistant Setup\n\n- Which agent? (Cline, Cursor, Copilot, none)\n- Generate a rules file from template? Or skip?\n- If generating: fills in project name, stack, conventions from Step 1\n\n### Step 5: Review + Confirm\n\n- Summary of all choices\n- List of templates being merged\n- Files that will be created/modified\n- \"Generate Project\" button\n- Progress indicator while it runs\n- Opens VS Code when done\n\n---\n\n## Server Script: What It Does\n\n```js\napplyConfig(projectDir, config) {\n  // 1. Copy selected templates into projectDir (merge directories)\n  // 2. Deep-merge all package.json files\n  // 3. Write config.ts with project identity values\n  // 4. Update layout.tsx metadata (title, description, favicon)\n  // 5. Write primary color to globals.css :root\n  // 6. Write agent rules file if requested\n  // 7. Run npm install once\n  // 8. Signal wizard UI that setup is complete\n}\n```\n\nAll file writes use Node.js `fs`. Idempotent where possible — check before writing.\n\n---\n\n## Repo Structure\n\n```\ncreate-jay-app/\n  cli.js              # entry point, clones boilerplate, starts servers\n  server.js           # local Express/Hono, handles fs operations\n  ui/                 # Vite + React wizard SPA\n    src/\n      App.tsx\n      steps/\n        Identity.tsx\n        Branding.tsx\n        Templates.tsx\n        Agent.tsx\n        Review.tsx\n  templates/\n    core/\n    with-examples/\n    with-prettier/\n    with-cline/\n    with-cursor/\n    with-eslint-strict/\n  scripts/\n    apply-config.js   # the actual file writer\n    merge-package.js  # deep-merges package.json files\n```\n\n---\n\n## UX Notes\n\n- Wizard should feel polished. Think macOS setup assistant, not a dev tool.\n- Each step is a full-screen card with a progress indicator at the top.\n- All choices have sensible defaults — you can hit Next through everything.\n- The review step shows exactly what will be generated.\n- After confirm, show a loading state with what's happening (\"Merging templates...\", \"Installing dependencies...\").\n- On completion, open the project in VS Code automatically.\n\n---\n\n## MVP Scope\n\n1. Identity (name, description, author)\n2. Branding (favicon emoji, primary color)\n3. Templates (examples yes/no, prettier yes/no)\n4. Agent rules (Cline or skip)\n5. Review + confirm\n\nThat's enough to make every new project feel immediately personalized and cuts the most repetitive manual steps.\n\n---\n\n## Open Questions\n\n- Should the wizard support logo upload in MVP, or defer?\n- How does the CLI handle the case where `my-project` directory already exists?\n- Should `create-jay-app` be published to npm or just run locally via `node cli.js`?\n- Should the generated `.clinerules` be opinionated (based on this stack) or generic?\n- Does the boilerplate repo need to change at all, or does it stay as-is and serve as the `core/` template source?\n",
  "toc": [
    {
      "depth": 2,
      "text": "The Idea",
      "id": "the-idea"
    },
    {
      "depth": 2,
      "text": "Architecture",
      "id": "architecture"
    },
    {
      "depth": 2,
      "text": "Template Composition (not removal)",
      "id": "template-composition-not-removal"
    },
    {
      "depth": 2,
      "text": "Wizard Steps",
      "id": "wizard-steps"
    },
    {
      "depth": 3,
      "text": "Step 1: Project Identity",
      "id": "step-1-project-identity"
    },
    {
      "depth": 3,
      "text": "Step 2: Branding",
      "id": "step-2-branding"
    },
    {
      "depth": 3,
      "text": "Step 3: Optional Templates",
      "id": "step-3-optional-templates"
    },
    {
      "depth": 3,
      "text": "Step 4: AI Assistant Setup",
      "id": "step-4-ai-assistant-setup"
    },
    {
      "depth": 3,
      "text": "Step 5: Review + Confirm",
      "id": "step-5-review-confirm"
    },
    {
      "depth": 2,
      "text": "Server Script: What It Does",
      "id": "server-script-what-it-does"
    },
    {
      "depth": 2,
      "text": "Repo Structure",
      "id": "repo-structure"
    },
    {
      "depth": 2,
      "text": "UX Notes",
      "id": "ux-notes"
    },
    {
      "depth": 2,
      "text": "MVP Scope",
      "id": "mvp-scope"
    },
    {
      "depth": 2,
      "text": "Open Questions",
      "id": "open-questions"
    }
  ],
  "format": "md",
  "componentKey": null,
  "contentHash": null,
  "authors": null,
  "authorship": "ai-assisted",
  "authorshipNote": null,
  "tags": [
    "boilerplate",
    "dx",
    "tooling",
    "next-js",
    "planning",
    "cli"
  ],
  "projectId": "b3d6e577-4481-4477-9b9f-cea025e63e92",
  "sectionId": "514c49bf-9956-4697-be0b-b64d6c0b90c7",
  "publishedAt": "2026-05-07T21:38:34.807Z",
  "revisedAt": null,
  "sortOrder": 0,
  "source": "db",
  "file": null,
  "missingSince": null,
  "createdAt": "2026-11-18T21:24:17.935Z",
  "updatedAt": "2026-12-01T03:56:13.822Z",
  "link": null,
  "project": {
    "slug": "jaygriff-v3",
    "title": "jaygriff-v3",
    "status": "published"
  },
  "section": {
    "slug": "ideas",
    "title": "Ideas"
  },
  "assets": []
}