create-claudecraft 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +194 -0
  3. package/bin/cli.js +2 -0
  4. package/dist/constants.d.ts +71 -0
  5. package/dist/constants.js +128 -0
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.js +229 -0
  8. package/dist/ink-prompts.d.ts +12 -0
  9. package/dist/ink-prompts.js +363 -0
  10. package/dist/prompts.d.ts +16 -0
  11. package/dist/prompts.js +434 -0
  12. package/dist/scaffold.d.ts +19 -0
  13. package/dist/scaffold.js +303 -0
  14. package/dist/ui.d.ts +27 -0
  15. package/dist/ui.js +254 -0
  16. package/package.json +74 -0
  17. package/templates/app/App.tsx +21 -0
  18. package/templates/base/CLAUDE.md +332 -0
  19. package/templates/base/eslint.config.js +28 -0
  20. package/templates/base/index.html +17 -0
  21. package/templates/base/package.json +43 -0
  22. package/templates/base/postcss.config.js +6 -0
  23. package/templates/base/tailwind.config.js +81 -0
  24. package/templates/base/tsconfig.json +25 -0
  25. package/templates/base/vite.config.ts +16 -0
  26. package/templates/commands/brainstorm.md +6 -0
  27. package/templates/commands/build.md +41 -0
  28. package/templates/commands/execute-plan.md +6 -0
  29. package/templates/commands/lint.md +41 -0
  30. package/templates/commands/ralph.md +113 -0
  31. package/templates/commands/typecheck.md +44 -0
  32. package/templates/commands/write-plan.md +6 -0
  33. package/templates/components/ErrorBoundary.tsx +49 -0
  34. package/templates/components/ui/Button.tsx +60 -0
  35. package/templates/components/ui/CodeBlock.tsx +46 -0
  36. package/templates/components/ui/CopyCommand.tsx +38 -0
  37. package/templates/components/ui/FilePreview.tsx +46 -0
  38. package/templates/components/ui/SkipLink.tsx +7 -0
  39. package/templates/components/ui/ThemeSelector.tsx +41 -0
  40. package/templates/components/ui/UICarousel.tsx +309 -0
  41. package/templates/context/ThemeContext.tsx +61 -0
  42. package/templates/homepage/HomePage.tsx +534 -0
  43. package/templates/homepage/NotFoundPage.tsx +17 -0
  44. package/templates/hooks/README.md +82 -0
  45. package/templates/hooks/check-branch.js +27 -0
  46. package/templates/hooks/typecheck-after-edit.js +51 -0
  47. package/templates/index.css +67 -0
  48. package/templates/lib/utils.ts +9 -0
  49. package/templates/main.tsx +16 -0
  50. package/templates/settings/MCP_SETUP.md +76 -0
  51. package/templates/settings/settings.json +16 -0
  52. package/templates/settings/settings.local.json +37 -0
  53. package/templates/skills/design/a11y-audit/SKILL.md +173 -0
  54. package/templates/skills/design/design-polish/SKILL.md +75 -0
  55. package/templates/skills/design/figma-to-code/SKILL.md +157 -0
  56. package/templates/skills/design/json-ld/SKILL.md +125 -0
  57. package/templates/skills/design/microcopy/SKILL.md +197 -0
  58. package/templates/skills/design/og-image/SKILL.md +157 -0
  59. package/templates/skills/design/ralph-wiggum-loops/SKILL.md +299 -0
  60. package/templates/skills/design/react-best-practices/SKILL.md +106 -0
  61. package/templates/skills/design/react-best-practices/references/react-performance-guidelines.md +143 -0
  62. package/templates/skills/design/seo-review/SKILL.md +96 -0
  63. package/templates/skills/design/sitemap-generator/SKILL.md +66 -0
  64. package/templates/skills/design/testing-patterns/SKILL.md +276 -0
  65. package/templates/skills/design/ui-skills/SKILL.md +85 -0
  66. package/templates/skills/design/visual-iteration/SKILL.md +88 -0
  67. package/templates/skills/workflow/brainstorming/SKILL.md +54 -0
  68. package/templates/skills/workflow/dispatching-parallel-agents/SKILL.md +180 -0
  69. package/templates/skills/workflow/executing-plans/SKILL.md +76 -0
  70. package/templates/skills/workflow/finishing-a-development-branch/SKILL.md +200 -0
  71. package/templates/skills/workflow/receiving-code-review/SKILL.md +213 -0
  72. package/templates/skills/workflow/requesting-code-review/SKILL.md +105 -0
  73. package/templates/skills/workflow/requesting-code-review/code-reviewer.md +146 -0
  74. package/templates/skills/workflow/subagent-driven-development/SKILL.md +240 -0
  75. package/templates/skills/workflow/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
  76. package/templates/skills/workflow/subagent-driven-development/implementer-prompt.md +78 -0
  77. package/templates/skills/workflow/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  78. package/templates/skills/workflow/systematic-debugging/CREATION-LOG.md +119 -0
  79. package/templates/skills/workflow/systematic-debugging/SKILL.md +296 -0
  80. package/templates/skills/workflow/systematic-debugging/condition-based-waiting-example.ts +158 -0
  81. package/templates/skills/workflow/systematic-debugging/condition-based-waiting.md +115 -0
  82. package/templates/skills/workflow/systematic-debugging/defense-in-depth.md +122 -0
  83. package/templates/skills/workflow/systematic-debugging/find-polluter.sh +63 -0
  84. package/templates/skills/workflow/systematic-debugging/root-cause-tracing.md +169 -0
  85. package/templates/skills/workflow/systematic-debugging/test-academic.md +14 -0
  86. package/templates/skills/workflow/systematic-debugging/test-pressure-1.md +58 -0
  87. package/templates/skills/workflow/systematic-debugging/test-pressure-2.md +68 -0
  88. package/templates/skills/workflow/systematic-debugging/test-pressure-3.md +69 -0
  89. package/templates/skills/workflow/test-driven-development/SKILL.md +371 -0
  90. package/templates/skills/workflow/test-driven-development/testing-anti-patterns.md +299 -0
  91. package/templates/skills/workflow/using-git-worktrees/SKILL.md +217 -0
  92. package/templates/skills/workflow/using-superpowers/SKILL.md +87 -0
  93. package/templates/skills/workflow/verification-before-completion/SKILL.md +139 -0
  94. package/templates/skills/workflow/writing-plans/SKILL.md +116 -0
  95. package/templates/skills/workflow/writing-skills/SKILL.md +655 -0
  96. package/templates/skills/workflow/writing-skills/anthropic-best-practices.md +1150 -0
  97. package/templates/skills/workflow/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  98. package/templates/skills/workflow/writing-skills/graphviz-conventions.dot +172 -0
  99. package/templates/skills/workflow/writing-skills/persuasion-principles.md +187 -0
  100. package/templates/skills/workflow/writing-skills/render-graphs.js +168 -0
  101. package/templates/skills/workflow/writing-skills/testing-skills-with-subagents.md +384 -0
  102. package/templates/types/index.ts +17 -0
  103. package/templates/vite-env.d.ts +1 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Radu Ceuca
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,194 @@
1
+ # create-claudecraft
2
+
3
+ Your taste. Their labor. Finally.
4
+
5
+ ```bash
6
+ bun create claudecraft my-app
7
+ ```
8
+
9
+ ---
10
+
11
+ ## What
12
+
13
+ Hey, designer. Your job isn't going anywhere—but it is getting weirder. The robots are here, and they have opinions about border-radius.
14
+
15
+ This is a boilerplate for people who'd rather shape the slop than become it. Pre-configured with design constraints, accessibility guilt trips, and 32 themes so you can procrastinate on the hard decisions.
16
+
17
+ ---
18
+
19
+ ## Install
20
+
21
+ ```bash
22
+ bun create claudecraft my-app
23
+ cd my-app
24
+ bun dev
25
+ ```
26
+
27
+ Open `localhost:6969`. Nice.
28
+
29
+ **Also works with:**
30
+ ```bash
31
+ npx create-claudecraft my-app
32
+ pnpm create claudecraft my-app
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Stack
38
+
39
+ | Tool | Why |
40
+ |------|-----|
41
+ | React 18 | You know why |
42
+ | TypeScript 5 | Lies surfaced early |
43
+ | Vite 5 | Fast enough to feel productive |
44
+ | Tailwind 3 | Utility cope |
45
+ | DaisyUI 4 | 32 themes, 0 decisions |
46
+ | Vitest | Tests that might catch bugs |
47
+ | Bun | Speed you'll briefly appreciate |
48
+
49
+ ---
50
+
51
+ ## What's Inside
52
+
53
+ ### 27 Skills
54
+
55
+ Guardrails. Claude wants to help. These make sure it helps *correctly*.
56
+
57
+ **Process** (via [obra/superpowers](https://github.com/obra/superpowers))
58
+
59
+ | Skill | What it does |
60
+ |-------|--------------|
61
+ | `brainstorming` | Poke holes before you build |
62
+ | `writing-plans` | Scope creep prevention |
63
+ | `executing-plans` | Checkpoints for the anxious |
64
+ | `test-driven-development` | Write the test first, cry later |
65
+ | `systematic-debugging` | Denial → anger → acceptance → fix |
66
+ | `verification-before-completion` | Did you actually check? |
67
+ | `requesting-code-review` | Brace for feedback |
68
+ | `receiving-code-review` | They meant well |
69
+ | `using-git-worktrees` | Branch isolation therapy |
70
+ | `finishing-a-development-branch` | Merge it or delete it |
71
+ | `subagent-driven-development` | Outsource to yourself |
72
+ | `dispatching-parallel-agents` | Fake productivity, real results |
73
+ | `writing-skills` | Teach Claude your ways |
74
+
75
+ **Design**
76
+
77
+ | Skill | What it does |
78
+ |-------|--------------|
79
+ | `react-best-practices` | Fewer re-renders, more peace |
80
+ | `testing-patterns` | Tests that find bugs, not LOC |
81
+ | `ui-skills` | CSS that cooperates |
82
+ | `a11y-audit` | WCAG compliance therapy |
83
+ | `seo-review` | Feed the algorithm |
84
+ | `og-image` | Social cards worth clicking |
85
+ | `microcopy` | Words that don't annoy users |
86
+ | `sitemap-generator` | Crawler food |
87
+ | `json-ld` | Structured data for bots |
88
+ | `figma-to-code` | Pixel-perfect from Figma |
89
+ | `design-polish` | Systematic polish passes |
90
+ | `visual-iteration` | Mockup to code loop |
91
+ | `ralph-wiggum-loops` | Sleep while Claude ships |
92
+
93
+ ### 7 Commands
94
+
95
+ ```
96
+ /build Compile and hope
97
+ /typecheck Surface the lies in your types
98
+ /lint Formatting tribunal
99
+ /brainstorm Interrogate your assumptions
100
+ /write-plan Think before you ship
101
+ /execute-plan Stop planning, start building
102
+ /ralph Autonomous loop templates
103
+ ```
104
+
105
+ ### 32 Themes
106
+
107
+ DaisyUI ships 32 themes. Pick one. Everything updates. Decision deferred successfully.
108
+
109
+ ### 2 Hooks
110
+
111
+ | Hook | What it does |
112
+ |------|--------------|
113
+ | `typecheck-after-edit` | TypeScript check after saves |
114
+ | `check-branch` | Warns before you commit to main |
115
+
116
+ ---
117
+
118
+ ## The Superpower
119
+
120
+ **Ralph Wiggum loops.** Claude works autonomously—building, checking, fixing—until done. Walk away. Come back to finished work.
121
+
122
+ ```bash
123
+ /ralph-loop "Build a card component with hover states" \
124
+ --completion-promise "COMPLETE" \
125
+ --max-iterations 15
126
+ ```
127
+
128
+ YC teams shipped 6 repos overnight. $50k contracts completed for $297 in API costs.
129
+
130
+ Named after the Simpsons character. Keeps going despite everything.
131
+
132
+ ---
133
+
134
+ ## Structure
135
+
136
+ ```
137
+ .claude/
138
+ ├── commands/ # /build, /lint, /ralph
139
+ ├── hooks/ # typecheck, branch warnings
140
+ ├── skills/ # 27 behavioral guardrails
141
+ ├── settings.json # hook config
142
+ └── settings.local.json # pre-approved chaos
143
+
144
+ src/
145
+ ├── components/ui/ # Button, ThemeSelector, CodeBlock
146
+ ├── context/ # ThemeContext
147
+ ├── pages/ # HomePage
148
+ └── lib/ # utils
149
+
150
+ CLAUDE.md # project brain dump
151
+ ```
152
+
153
+ ---
154
+
155
+ ## Options
156
+
157
+ ```bash
158
+ bun create claudecraft [name] [flags]
159
+
160
+ Flags:
161
+ -y, --yes Skip prompts. Use defaults.
162
+ --no-git Skip git init
163
+ --no-install Skip bun install
164
+ --init Add skills to existing project
165
+ -h, --help This
166
+ -v, --version Version number
167
+ ```
168
+
169
+ ---
170
+
171
+ ## Requirements
172
+
173
+ **Bun** — The fast one.
174
+ ```bash
175
+ curl -fsSL https://bun.sh/install | bash
176
+ ```
177
+
178
+ **Claude Code** — The AI that reads your CLAUDE.md and (mostly) follows it.
179
+
180
+ ---
181
+
182
+ ## Links
183
+
184
+ [Website](https://claudecraft.dev) · [GitHub](https://github.com/raduceuca/claudecraft) · [Issues](https://github.com/raduceuca/claudecraft/issues)
185
+
186
+ ---
187
+
188
+ ## License
189
+
190
+ MIT. Do whatever. Credit appreciated, not required.
191
+
192
+ ---
193
+
194
+ Made by a designer who got tired of the slop. [@raduceuca](https://x.com/raduceuca)
package/bin/cli.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../dist/index.js';
@@ -0,0 +1,71 @@
1
+ export declare const PACKAGE_NAME = "create-claudecraft";
2
+ export declare const VERSION = "1.0.0";
3
+ export declare const DEFAULT_PORT = 6969;
4
+ export declare const DEFAULT_THEME = "halloween";
5
+ export declare const TAGLINE = "Your taste. Their labor. Finally.";
6
+ export declare const STACK: {
7
+ readonly react: "18.x";
8
+ readonly typescript: "5.x";
9
+ readonly vite: "5.x";
10
+ readonly tailwind: "3.x";
11
+ readonly daisyui: "4.x";
12
+ };
13
+ export declare const ASSETS: {
14
+ readonly skills: 27;
15
+ readonly commands: 7;
16
+ readonly themes: 32;
17
+ readonly hooks: 2;
18
+ readonly components: 6;
19
+ };
20
+ export interface Skill {
21
+ name: string;
22
+ description: string;
23
+ group: 'workflow' | 'design';
24
+ bytes: number;
25
+ }
26
+ export declare const SKILLS: Skill[];
27
+ export declare const BUNDLES: {
28
+ readonly everything: {
29
+ readonly name: "Everything";
30
+ readonly description: "All of it. No restraint.";
31
+ readonly skills: string[];
32
+ readonly commands: 6;
33
+ readonly files: 48;
34
+ };
35
+ readonly designer: {
36
+ readonly name: "Designer Essentials";
37
+ readonly description: "UI, a11y, Figma, and enough process to stay sane.";
38
+ readonly skills: readonly ["react-best-practices", "ui-skills", "a11y-audit", "testing-patterns", "seo-review", "systematic-debugging", "brainstorming", "writing-plans", "verification-before-completion", "design-polish", "visual-iteration", "ralph-wiggum-loops", "figma-to-code"];
39
+ readonly commands: 4;
40
+ readonly files: 35;
41
+ };
42
+ readonly workflow: {
43
+ readonly name: "Workflow Only";
44
+ readonly description: "Process without opinions.";
45
+ readonly skills: string[];
46
+ readonly commands: 3;
47
+ readonly files: 28;
48
+ };
49
+ };
50
+ export declare const COMMANDS: {
51
+ name: string;
52
+ description: string;
53
+ }[];
54
+ export declare const ERRORS: {
55
+ dirExists: (name: string) => {
56
+ title: string;
57
+ body: string;
58
+ };
59
+ noBun: () => {
60
+ title: string;
61
+ body: string;
62
+ };
63
+ network: () => {
64
+ title: string;
65
+ body: string;
66
+ };
67
+ noProject: () => {
68
+ title: string;
69
+ body: string;
70
+ };
71
+ };
@@ -0,0 +1,128 @@
1
+ export const PACKAGE_NAME = 'create-claudecraft';
2
+ export const VERSION = '1.0.0';
3
+ export const DEFAULT_PORT = 6969;
4
+ export const DEFAULT_THEME = 'halloween';
5
+ export const TAGLINE = 'Your taste. Their labor. Finally.';
6
+ export const STACK = {
7
+ react: '18.x',
8
+ typescript: '5.x',
9
+ vite: '5.x',
10
+ tailwind: '3.x',
11
+ daisyui: '4.x',
12
+ };
13
+ export const ASSETS = {
14
+ skills: 27,
15
+ commands: 7,
16
+ themes: 32,
17
+ hooks: 2,
18
+ components: 6,
19
+ };
20
+ export const SKILLS = [
21
+ // Workflow (via obra/superpowers)
22
+ { name: 'brainstorming', description: 'poke holes before you build', group: 'workflow', bytes: 2800 },
23
+ { name: 'writing-plans', description: 'scope creep prevention', group: 'workflow', bytes: 3200 },
24
+ { name: 'executing-plans', description: 'checkpoints for the anxious', group: 'workflow', bytes: 2400 },
25
+ { name: 'systematic-debugging', description: 'denial → anger → acceptance → fix', group: 'workflow', bytes: 8500 },
26
+ { name: 'test-driven-development', description: 'write the test first, cry later', group: 'workflow', bytes: 3100 },
27
+ { name: 'verification-before-completion', description: 'did you actually check?', group: 'workflow', bytes: 1800 },
28
+ { name: 'requesting-code-review', description: 'brace for feedback', group: 'workflow', bytes: 2200 },
29
+ { name: 'receiving-code-review', description: 'they meant well', group: 'workflow', bytes: 1900 },
30
+ { name: 'using-git-worktrees', description: 'branch isolation therapy', group: 'workflow', bytes: 2100 },
31
+ { name: 'finishing-a-development-branch', description: 'merge it or delete it', group: 'workflow', bytes: 1700 },
32
+ { name: 'subagent-driven-development', description: 'outsource to yourself', group: 'workflow', bytes: 4200 },
33
+ { name: 'dispatching-parallel-agents', description: 'fake productivity, real results', group: 'workflow', bytes: 1600 },
34
+ { name: 'writing-skills', description: 'teach Claude your ways', group: 'workflow', bytes: 5800 },
35
+ { name: 'using-superpowers', description: 'RTFM energy', group: 'workflow', bytes: 1200 },
36
+ // Design
37
+ { name: 'react-best-practices', description: 'fewer re-renders, more peace', group: 'design', bytes: 4200 },
38
+ { name: 'testing-patterns', description: 'tests that catch bugs', group: 'design', bytes: 3800 },
39
+ { name: 'ui-skills', description: "CSS that cooperates", group: 'design', bytes: 2900 },
40
+ { name: 'a11y-audit', description: 'WCAG compliance therapy', group: 'design', bytes: 3400 },
41
+ { name: 'seo-review', description: 'feed the algorithm', group: 'design', bytes: 2100 },
42
+ { name: 'og-image', description: 'cards worth clicking', group: 'design', bytes: 1800 },
43
+ { name: 'microcopy', description: 'interface text that helps', group: 'design', bytes: 2200 },
44
+ { name: 'sitemap-generator', description: 'crawler food', group: 'design', bytes: 1400 },
45
+ { name: 'json-ld', description: 'structured data for bots', group: 'design', bytes: 1600 },
46
+ { name: 'figma-to-code', description: 'pixel-perfect from Figma', group: 'design', bytes: 3200 },
47
+ { name: 'design-polish', description: 'systematic polish passes', group: 'design', bytes: 2400 },
48
+ { name: 'visual-iteration', description: 'mockup to code loop', group: 'design', bytes: 2100 },
49
+ { name: 'ralph-wiggum-loops', description: 'sleep while Claude ships', group: 'design', bytes: 6800 },
50
+ ];
51
+ export const BUNDLES = {
52
+ everything: {
53
+ name: 'Everything',
54
+ description: 'All of it. No restraint.',
55
+ skills: SKILLS.map((s) => s.name),
56
+ commands: 6,
57
+ files: 48,
58
+ },
59
+ designer: {
60
+ name: 'Designer Essentials',
61
+ description: 'UI, a11y, Figma, and enough process to stay sane.',
62
+ skills: [
63
+ 'react-best-practices',
64
+ 'ui-skills',
65
+ 'a11y-audit',
66
+ 'testing-patterns',
67
+ 'seo-review',
68
+ 'systematic-debugging',
69
+ 'brainstorming',
70
+ 'writing-plans',
71
+ 'verification-before-completion',
72
+ 'design-polish',
73
+ 'visual-iteration',
74
+ 'ralph-wiggum-loops',
75
+ 'figma-to-code',
76
+ ],
77
+ commands: 4,
78
+ files: 35,
79
+ },
80
+ workflow: {
81
+ name: 'Workflow Only',
82
+ description: 'Process without opinions.',
83
+ skills: SKILLS.filter((s) => s.group === 'workflow').map((s) => s.name),
84
+ commands: 3,
85
+ files: 28,
86
+ },
87
+ };
88
+ export const COMMANDS = [
89
+ { name: '/build', description: 'compile and hope' },
90
+ { name: '/typecheck', description: 'surface the lies' },
91
+ { name: '/lint', description: 'formatting tribunal' },
92
+ { name: '/brainstorm', description: 'interrogate your assumptions' },
93
+ { name: '/write-plan', description: 'think before you ship' },
94
+ { name: '/execute-plan', description: 'stop planning, start building' },
95
+ { name: '/ralph', description: 'autonomous loop templates' },
96
+ ];
97
+ export const ERRORS = {
98
+ dirExists: (name) => ({
99
+ title: `"${name}" already exists`,
100
+ body: `Your options:
101
+ 1. Pick a different name (creativity exercise)
102
+ 2. Delete the old one (commitment issues)
103
+ 3. Use --init to add skills to it (pragmatism)`,
104
+ }),
105
+ noBun: () => ({
106
+ title: 'Bun not found',
107
+ body: `The fast runtime. You need it.
108
+
109
+ curl -fsSL https://bun.sh/install | bash
110
+
111
+ Then try again. We'll wait.`,
112
+ }),
113
+ network: () => ({
114
+ title: 'Network gave up',
115
+ body: `Either your wifi or npm. Probably npm.
116
+
117
+ Check your connection and retry. If npm is down,
118
+ join the mass hallucination at status.npmjs.org.`,
119
+ }),
120
+ noProject: () => ({
121
+ title: 'Nothing here',
122
+ body: `--init needs an existing project. This directory is empty.
123
+ No package.json. No hope.
124
+
125
+ Create something first:
126
+ bun create claudecraft my-app`,
127
+ }),
128
+ };
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,229 @@
1
+ import pc from 'picocolors';
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+ import { renderHeader, renderManifest, renderMiniHeader, renderProgress, renderProgressFooter, renderComplete, renderError, renderInitComplete, } from './ui.js';
5
+ import { runInkPrompts, runInkInitPrompts } from './ink-prompts.js';
6
+ import { scaffold, initExisting } from './scaffold.js';
7
+ import { ERRORS, DEFAULT_THEME, DEFAULT_PORT, ASSETS, SKILLS, VERSION } from './constants.js';
8
+ async function main() {
9
+ // Parse args
10
+ const args = process.argv.slice(2);
11
+ const projectName = args.find((a) => !a.startsWith('-'));
12
+ const skipPrompts = args.includes('--yes') || args.includes('-y');
13
+ const noGit = args.includes('--no-git');
14
+ const noInstall = args.includes('--no-install');
15
+ const showHelp = args.includes('--help') || args.includes('-h') || args.includes('/help');
16
+ const showVersion = args.includes('--version') || args.includes('-v') || args.includes('/version');
17
+ const initMode = args.includes('--init') || args.includes('-i') || args.includes('/init');
18
+ if (showVersion) {
19
+ console.log(VERSION);
20
+ process.exit(0);
21
+ }
22
+ if (showHelp) {
23
+ console.log(`
24
+ ${pc.bold('create-claudecraft')} - Designer-first boilerplate for Claude Code
25
+
26
+ ${pc.bold('Usage:')}
27
+ bun create claudecraft [project-name] [options]
28
+
29
+ ${pc.bold('Options:')}
30
+ --yes, -y Skip prompts, use defaults
31
+ --init, -i Add skills to existing project (no scaffold)
32
+ --no-git Skip git initialization
33
+ --no-install Skip dependency installation
34
+ --help, -h Show this help
35
+ --version, -v Show version
36
+
37
+ ${pc.bold('Slash Commands:')}
38
+ /help Same as --help
39
+ /init Same as --init
40
+ /version Same as --version
41
+
42
+ ${pc.bold('Examples:')}
43
+ ${pc.dim('# New project')}
44
+ bun create claudecraft my-app
45
+ bun create claudecraft my-app --yes
46
+
47
+ ${pc.dim('# Existing project (run from project root)')}
48
+ bunx create-claudecraft --init
49
+ bunx create-claudecraft --init --yes
50
+
51
+ ${pc.bold('Figma Integration:')}
52
+ After setup, connect Figma MCP:
53
+ claude mcp add --transport http figma https://mcp.figma.com/mcp
54
+ `);
55
+ process.exit(0);
56
+ }
57
+ // Init mode: add to existing project
58
+ if (initMode) {
59
+ await runInitMode(skipPrompts);
60
+ return;
61
+ }
62
+ // Get user choices
63
+ let choices;
64
+ if (skipPrompts) {
65
+ // Show header only for non-interactive mode
66
+ console.clear();
67
+ console.log(renderHeader());
68
+ console.log(renderManifest());
69
+ choices = {
70
+ projectName: projectName || 'claudecraft-app',
71
+ bundle: 'everything',
72
+ selectedSkills: SKILLS.map((s) => s.name),
73
+ includeHomepage: true,
74
+ initGit: !noGit,
75
+ };
76
+ console.log(pc.dim(` Using defaults: ${choices.projectName}, all skills, homepage, git init`));
77
+ console.log('');
78
+ }
79
+ else {
80
+ const result = await runInkPrompts(projectName);
81
+ if (!result)
82
+ process.exit(0);
83
+ choices = result;
84
+ }
85
+ // Override git if --no-git flag
86
+ if (noGit)
87
+ choices.initGit = false;
88
+ // Progress state
89
+ const progressState = {
90
+ scaffolding: { name: 'scaffolding', progress: 0, status: 'queued', detail: '' },
91
+ dependencies: { name: 'dependencies', progress: 0, status: 'queued', detail: '' },
92
+ 'git init': { name: 'git init', progress: 0, status: 'queued', detail: '' },
93
+ };
94
+ let startTime = Date.now();
95
+ const updateProgress = (task, progress, detail) => {
96
+ progressState[task] = {
97
+ name: task,
98
+ progress,
99
+ status: progress >= 100 ? 'done' : 'active',
100
+ time: progress >= 100 ? `${((Date.now() - startTime) / 1000).toFixed(1)}s` : undefined,
101
+ detail: detail || '',
102
+ };
103
+ // Mark previous tasks as done
104
+ const tasks = Object.keys(progressState);
105
+ const currentIndex = tasks.indexOf(task);
106
+ for (let i = 0; i < currentIndex; i++) {
107
+ if (progressState[tasks[i]].status !== 'done') {
108
+ progressState[tasks[i]].status = 'done';
109
+ progressState[tasks[i]].progress = 100;
110
+ }
111
+ }
112
+ // Re-render progress
113
+ console.clear();
114
+ console.log(renderMiniHeader());
115
+ console.log('');
116
+ console.log(renderProgress([
117
+ progressState['scaffolding'],
118
+ progressState['dependencies'],
119
+ progressState['git init'],
120
+ ]));
121
+ const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
122
+ console.log(renderProgressFooter(`${elapsed}s`, ''));
123
+ };
124
+ try {
125
+ startTime = Date.now();
126
+ const result = await scaffold(choices, updateProgress);
127
+ // Final output
128
+ console.clear();
129
+ console.log(renderMiniHeader());
130
+ console.log(renderComplete(choices.projectName, {
131
+ files: result.files,
132
+ skills: result.skills,
133
+ commands: result.commands,
134
+ themes: ASSETS.themes,
135
+ time: result.time,
136
+ deps: result.deps,
137
+ disk: result.disk,
138
+ theme: DEFAULT_THEME,
139
+ port: DEFAULT_PORT,
140
+ }));
141
+ }
142
+ catch (err) {
143
+ const error = err;
144
+ if (error.message.startsWith('DIR_EXISTS:')) {
145
+ const name = error.message.split(':')[1];
146
+ const { title, body } = ERRORS.dirExists(name);
147
+ console.log(renderError(title, body));
148
+ }
149
+ else if (error.message === 'INSTALL_FAILED') {
150
+ const { title, body } = ERRORS.network();
151
+ console.log(renderError(title, body));
152
+ }
153
+ else {
154
+ console.log(renderError('Unexpected error', error.message));
155
+ }
156
+ process.exit(1);
157
+ }
158
+ }
159
+ async function runInitMode(skipPrompts) {
160
+ // Check if we're in a project directory
161
+ const cwd = process.cwd();
162
+ const pkgPath = path.join(cwd, 'package.json');
163
+ if (!fs.existsSync(pkgPath)) {
164
+ const { title, body } = ERRORS.noProject();
165
+ console.log(renderError(title, body));
166
+ process.exit(1);
167
+ }
168
+ // Check if .claude already exists
169
+ const claudeDir = path.join(cwd, '.claude');
170
+ const alreadyInit = fs.existsSync(claudeDir);
171
+ // Show warning if .claude already exists (for --yes mode)
172
+ if (alreadyInit && skipPrompts) {
173
+ console.log(pc.yellow(' ⚠ .claude/ exists - will merge, not overwrite'));
174
+ }
175
+ // Get choices
176
+ let choices;
177
+ if (skipPrompts) {
178
+ choices = {
179
+ selectedSkills: SKILLS.map((s) => s.name),
180
+ };
181
+ console.log(pc.dim(` Using defaults: all ${SKILLS.length} skills`));
182
+ console.log('');
183
+ }
184
+ else {
185
+ const result = await runInkInitPrompts();
186
+ if (!result)
187
+ process.exit(0);
188
+ choices = result;
189
+ }
190
+ // Progress state (simpler for init)
191
+ const progressState = {
192
+ scaffolding: { name: 'scaffolding', progress: 0, status: 'queued', detail: '' },
193
+ };
194
+ let startTime = Date.now();
195
+ const updateProgress = (task, progress, detail) => {
196
+ progressState[task] = {
197
+ name: task,
198
+ progress,
199
+ status: progress >= 100 ? 'done' : 'active',
200
+ time: progress >= 100 ? `${((Date.now() - startTime) / 1000).toFixed(1)}s` : undefined,
201
+ detail: detail || '',
202
+ };
203
+ console.clear();
204
+ console.log(renderMiniHeader());
205
+ console.log('');
206
+ console.log(renderProgress([progressState['scaffolding']]));
207
+ const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
208
+ console.log(renderProgressFooter(`${elapsed}s`, ''));
209
+ };
210
+ try {
211
+ startTime = Date.now();
212
+ const result = await initExisting(choices, updateProgress);
213
+ // Final output
214
+ console.clear();
215
+ console.log(renderMiniHeader());
216
+ console.log(renderInitComplete({
217
+ files: result.files,
218
+ skills: result.skills,
219
+ commands: result.commands,
220
+ time: result.time,
221
+ }));
222
+ }
223
+ catch (err) {
224
+ const error = err;
225
+ console.log(renderError('Init failed', error.message));
226
+ process.exit(1);
227
+ }
228
+ }
229
+ main().catch(console.error);
@@ -0,0 +1,12 @@
1
+ export interface UserChoices {
2
+ projectName: string;
3
+ bundle: 'everything' | 'designer' | 'workflow' | 'custom';
4
+ selectedSkills: string[];
5
+ includeHomepage: boolean;
6
+ initGit: boolean;
7
+ }
8
+ export interface InitChoices {
9
+ selectedSkills: string[];
10
+ }
11
+ export declare function runInkPrompts(defaultName?: string): Promise<UserChoices | null>;
12
+ export declare function runInkInitPrompts(): Promise<InitChoices | null>;