create-claudecraft 1.0.0 → 2.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 (258) hide show
  1. package/README.md +43 -178
  2. package/bin/cli.js +186 -1
  3. package/dist/answers.d.ts +269 -0
  4. package/dist/answers.js +215 -0
  5. package/dist/ink-prompts.d.ts +90 -12
  6. package/dist/ink-prompts.js +371 -330
  7. package/dist/lettering.d.ts +2 -0
  8. package/dist/lettering.js +28 -0
  9. package/lib/apps.mjs +141 -0
  10. package/lib/github.mjs +24 -0
  11. package/lib/init.mjs +153 -0
  12. package/lib/ports.mjs +56 -0
  13. package/lib/scaffold.mjs +218 -0
  14. package/lib/upgrade.mjs +164 -0
  15. package/package.json +39 -33
  16. package/templates/astro/.editorconfig +15 -0
  17. package/templates/astro/.env.example +2 -0
  18. package/templates/astro/.github/workflows/ci.yml +37 -0
  19. package/templates/astro/.github/workflows/deploy.yml +46 -0
  20. package/templates/astro/.nvmrc +1 -0
  21. package/templates/astro/.prettierignore +10 -0
  22. package/templates/astro/.prettierrc.json +7 -0
  23. package/templates/astro/.vscode/extensions.json +3 -0
  24. package/templates/astro/.vscode/settings.json +12 -0
  25. package/templates/astro/AGENTS.md +100 -0
  26. package/templates/astro/README.md +42 -0
  27. package/templates/astro/_CLAUDE.md +1 -0
  28. package/templates/astro/_claude/launch.json +13 -0
  29. package/templates/astro/_claude/settings.json +22 -0
  30. package/templates/astro/_codex/environments/environment.toml +20 -0
  31. package/templates/astro/_gitignore +31 -0
  32. package/templates/astro/_npmrc +8 -0
  33. package/templates/astro/_super.engineering/config.json +8 -0
  34. package/templates/astro/_zed/tasks.json +5 -0
  35. package/templates/astro/astro.config.mjs +111 -0
  36. package/templates/astro/docs/README.md +7 -0
  37. package/templates/astro/docs/decisions.md +3 -0
  38. package/templates/astro/docs/inbox.md +7 -0
  39. package/templates/astro/docs/kit/agent-apps.md +15 -0
  40. package/templates/astro/docs/kit/analytics.md +13 -0
  41. package/templates/astro/docs/kit/deploy.md +9 -0
  42. package/templates/astro/docs/kit/images.md +10 -0
  43. package/templates/astro/docs/kit/languages.md +8 -0
  44. package/templates/astro/docs/kit/local.md +16 -0
  45. package/templates/astro/docs/kit/seo.md +15 -0
  46. package/templates/astro/docs/kit/structure.md +40 -0
  47. package/templates/astro/docs/kit/upgrade.md +19 -0
  48. package/templates/astro/functions/_middleware.js +25 -0
  49. package/templates/astro/intent.md +40 -0
  50. package/templates/astro/package.json +46 -0
  51. package/templates/astro/public/_headers +17 -0
  52. package/templates/astro/public/_routes.json +5 -0
  53. package/templates/astro/public/apple-touch-icon.png +0 -0
  54. package/templates/astro/public/favicon-16.png +0 -0
  55. package/templates/astro/public/favicon-32.png +0 -0
  56. package/templates/astro/public/favicon.ico +0 -0
  57. package/templates/astro/public/favicon.svg +4 -0
  58. package/templates/astro/public/icon-192.png +0 -0
  59. package/templates/astro/public/icon-512.png +0 -0
  60. package/templates/astro/public/og-image.png +0 -0
  61. package/templates/astro/scripts/chrome.mjs +138 -0
  62. package/templates/astro/scripts/deploy.sh +69 -0
  63. package/templates/astro/scripts/generate-icons.mjs +73 -0
  64. package/templates/astro/scripts/generate-og.mjs +66 -0
  65. package/templates/astro/scripts/lint-copy.mjs +67 -0
  66. package/templates/astro/scripts/local-domain.mjs +115 -0
  67. package/templates/astro/scripts/markdown-pages.mjs +142 -0
  68. package/templates/astro/scripts/og-template.html +73 -0
  69. package/templates/astro/scripts/shared.mjs +33 -0
  70. package/templates/astro/scripts/verify-build.mjs +283 -0
  71. package/templates/astro/scripts/verify.mjs +19 -0
  72. package/templates/astro/site.config.mjs +85 -0
  73. package/templates/astro/src/components/Analytics.astro +49 -0
  74. package/templates/astro/src/components/Consent.astro +52 -0
  75. package/templates/astro/src/components/Counter.tsx +20 -0
  76. package/templates/astro/src/data/README.md +18 -0
  77. package/templates/astro/src/dev/styleguide.astro +43 -0
  78. package/templates/astro/src/env.d.ts +1 -0
  79. package/templates/astro/src/i18n/ar.json +29 -0
  80. package/templates/astro/src/i18n/de.json +29 -0
  81. package/templates/astro/src/i18n/en.json +29 -0
  82. package/templates/astro/src/i18n/es.json +29 -0
  83. package/templates/astro/src/i18n/fr.json +29 -0
  84. package/templates/astro/src/i18n/he.json +29 -0
  85. package/templates/astro/src/i18n/hi.json +29 -0
  86. package/templates/astro/src/i18n/index.ts +80 -0
  87. package/templates/astro/src/i18n/it.json +29 -0
  88. package/templates/astro/src/i18n/ja.json +29 -0
  89. package/templates/astro/src/i18n/ko.json +29 -0
  90. package/templates/astro/src/i18n/nl.json +29 -0
  91. package/templates/astro/src/i18n/pl.json +29 -0
  92. package/templates/astro/src/i18n/pt-br.json +29 -0
  93. package/templates/astro/src/i18n/ro.json +29 -0
  94. package/templates/astro/src/i18n/ru.json +29 -0
  95. package/templates/astro/src/i18n/sv.json +29 -0
  96. package/templates/astro/src/i18n/tr.json +29 -0
  97. package/templates/astro/src/i18n/uk.json +29 -0
  98. package/templates/astro/src/i18n/zh-cn.json +29 -0
  99. package/templates/astro/src/layouts/BaseLayout.astro +205 -0
  100. package/templates/astro/src/lib/cn.ts +7 -0
  101. package/templates/astro/src/lib/consent.ts +32 -0
  102. package/templates/astro/src/lib/seo.ts +18 -0
  103. package/templates/astro/src/lib/theme.ts +5 -0
  104. package/templates/astro/src/pages/404.astro +7 -0
  105. package/templates/astro/src/pages/[...locale]/404.astro +25 -0
  106. package/templates/astro/src/pages/[...locale]/about.astro +25 -0
  107. package/templates/astro/src/pages/[...locale]/index.astro +30 -0
  108. package/templates/astro/src/pages/[...locale]/privacy.astro +28 -0
  109. package/templates/astro/src/pages/robots.txt.ts +16 -0
  110. package/templates/astro/src/pages/site.webmanifest.ts +26 -0
  111. package/templates/astro/src/styles/global.css +163 -0
  112. package/templates/astro/t3.json +22 -0
  113. package/templates/astro/tsconfig.json +13 -0
  114. package/templates/astro/wrangler.toml +8 -0
  115. package/templates/react/.editorconfig +15 -0
  116. package/templates/react/.env.example +2 -0
  117. package/templates/react/.nvmrc +1 -0
  118. package/templates/react/.prettierignore +11 -0
  119. package/templates/react/.prettierrc.json +5 -0
  120. package/templates/react/.vscode/extensions.json +3 -0
  121. package/templates/react/.vscode/settings.json +4 -0
  122. package/templates/react/AGENTS.md +64 -0
  123. package/templates/react/README.md +31 -0
  124. package/templates/react/_CLAUDE.md +1 -0
  125. package/templates/react/_claude/launch.json +13 -0
  126. package/templates/react/_claude/settings.json +21 -0
  127. package/templates/react/_codex/environments/environment.toml +20 -0
  128. package/templates/react/_gitignore +17 -0
  129. package/templates/react/_npmrc +8 -0
  130. package/templates/react/_super.engineering/config.json +8 -0
  131. package/templates/react/_zed/tasks.json +5 -0
  132. package/templates/react/docs/decisions.md +3 -0
  133. package/templates/react/docs/inbox.md +7 -0
  134. package/templates/react/index.html +14 -0
  135. package/templates/react/package.json +47 -0
  136. package/templates/react/public/favicon.svg +5 -0
  137. package/templates/react/scripts/lint-copy.mjs +46 -0
  138. package/templates/react/scripts/lint-tokens.mjs +44 -0
  139. package/templates/react/scripts/local-domain.mjs +115 -0
  140. package/templates/react/scripts/verify.mjs +20 -0
  141. package/templates/react/site.config.mjs +23 -0
  142. package/templates/react/src/App.test.tsx +15 -0
  143. package/templates/react/src/App.tsx +21 -0
  144. package/templates/react/src/components/ErrorBoundary.tsx +42 -0
  145. package/templates/react/src/components/SkipLink.tsx +10 -0
  146. package/templates/react/src/config/site.ts +5 -0
  147. package/templates/react/src/lib/cn.ts +7 -0
  148. package/templates/react/src/main.tsx +13 -0
  149. package/templates/react/src/pages/HomePage.tsx +71 -0
  150. package/templates/react/src/pages/NotFoundPage.tsx +21 -0
  151. package/templates/react/src/styles/global.css +96 -0
  152. package/templates/react/src/test-setup.ts +1 -0
  153. package/templates/react/t3.json +22 -0
  154. package/templates/{base → react}/tsconfig.json +3 -3
  155. package/templates/react/vite.config.ts +26 -0
  156. package/templates/shared/_claude/hooks/design-lint.mjs +67 -0
  157. package/templates/shared/_claude/skills/design-quality/SKILL.md +113 -0
  158. package/templates/shared/_claude/skills/design-quality/references/composition-palette.md +87 -0
  159. package/templates/shared/_claude/skills/design-quality/references/copy-tells.md +49 -0
  160. package/templates/shared/_claude/skills/design-quality/references/visual-critic.md +75 -0
  161. package/templates/shared/design.md +148 -0
  162. package/templates/shared/intent.md +28 -0
  163. package/dist/constants.d.ts +0 -71
  164. package/dist/constants.js +0 -128
  165. package/dist/index.d.ts +0 -1
  166. package/dist/index.js +0 -229
  167. package/dist/prompts.d.ts +0 -16
  168. package/dist/prompts.js +0 -434
  169. package/dist/scaffold.d.ts +0 -19
  170. package/dist/scaffold.js +0 -303
  171. package/dist/ui.d.ts +0 -27
  172. package/dist/ui.js +0 -254
  173. package/templates/app/App.tsx +0 -21
  174. package/templates/base/CLAUDE.md +0 -332
  175. package/templates/base/eslint.config.js +0 -28
  176. package/templates/base/index.html +0 -17
  177. package/templates/base/package.json +0 -43
  178. package/templates/base/postcss.config.js +0 -6
  179. package/templates/base/tailwind.config.js +0 -81
  180. package/templates/base/vite.config.ts +0 -16
  181. package/templates/commands/brainstorm.md +0 -6
  182. package/templates/commands/build.md +0 -41
  183. package/templates/commands/execute-plan.md +0 -6
  184. package/templates/commands/lint.md +0 -41
  185. package/templates/commands/ralph.md +0 -113
  186. package/templates/commands/typecheck.md +0 -44
  187. package/templates/commands/write-plan.md +0 -6
  188. package/templates/components/ErrorBoundary.tsx +0 -49
  189. package/templates/components/ui/Button.tsx +0 -60
  190. package/templates/components/ui/CodeBlock.tsx +0 -46
  191. package/templates/components/ui/CopyCommand.tsx +0 -38
  192. package/templates/components/ui/FilePreview.tsx +0 -46
  193. package/templates/components/ui/SkipLink.tsx +0 -7
  194. package/templates/components/ui/ThemeSelector.tsx +0 -41
  195. package/templates/components/ui/UICarousel.tsx +0 -309
  196. package/templates/context/ThemeContext.tsx +0 -61
  197. package/templates/homepage/HomePage.tsx +0 -534
  198. package/templates/homepage/NotFoundPage.tsx +0 -17
  199. package/templates/hooks/README.md +0 -82
  200. package/templates/hooks/check-branch.js +0 -27
  201. package/templates/hooks/typecheck-after-edit.js +0 -51
  202. package/templates/index.css +0 -67
  203. package/templates/lib/utils.ts +0 -9
  204. package/templates/main.tsx +0 -16
  205. package/templates/settings/MCP_SETUP.md +0 -76
  206. package/templates/settings/settings.json +0 -16
  207. package/templates/settings/settings.local.json +0 -37
  208. package/templates/skills/design/a11y-audit/SKILL.md +0 -173
  209. package/templates/skills/design/design-polish/SKILL.md +0 -75
  210. package/templates/skills/design/figma-to-code/SKILL.md +0 -157
  211. package/templates/skills/design/json-ld/SKILL.md +0 -125
  212. package/templates/skills/design/microcopy/SKILL.md +0 -197
  213. package/templates/skills/design/og-image/SKILL.md +0 -157
  214. package/templates/skills/design/ralph-wiggum-loops/SKILL.md +0 -299
  215. package/templates/skills/design/react-best-practices/SKILL.md +0 -106
  216. package/templates/skills/design/react-best-practices/references/react-performance-guidelines.md +0 -143
  217. package/templates/skills/design/seo-review/SKILL.md +0 -96
  218. package/templates/skills/design/sitemap-generator/SKILL.md +0 -66
  219. package/templates/skills/design/testing-patterns/SKILL.md +0 -276
  220. package/templates/skills/design/ui-skills/SKILL.md +0 -85
  221. package/templates/skills/design/visual-iteration/SKILL.md +0 -88
  222. package/templates/skills/workflow/brainstorming/SKILL.md +0 -54
  223. package/templates/skills/workflow/dispatching-parallel-agents/SKILL.md +0 -180
  224. package/templates/skills/workflow/executing-plans/SKILL.md +0 -76
  225. package/templates/skills/workflow/finishing-a-development-branch/SKILL.md +0 -200
  226. package/templates/skills/workflow/receiving-code-review/SKILL.md +0 -213
  227. package/templates/skills/workflow/requesting-code-review/SKILL.md +0 -105
  228. package/templates/skills/workflow/requesting-code-review/code-reviewer.md +0 -146
  229. package/templates/skills/workflow/subagent-driven-development/SKILL.md +0 -240
  230. package/templates/skills/workflow/subagent-driven-development/code-quality-reviewer-prompt.md +0 -20
  231. package/templates/skills/workflow/subagent-driven-development/implementer-prompt.md +0 -78
  232. package/templates/skills/workflow/subagent-driven-development/spec-reviewer-prompt.md +0 -61
  233. package/templates/skills/workflow/systematic-debugging/CREATION-LOG.md +0 -119
  234. package/templates/skills/workflow/systematic-debugging/SKILL.md +0 -296
  235. package/templates/skills/workflow/systematic-debugging/condition-based-waiting-example.ts +0 -158
  236. package/templates/skills/workflow/systematic-debugging/condition-based-waiting.md +0 -115
  237. package/templates/skills/workflow/systematic-debugging/defense-in-depth.md +0 -122
  238. package/templates/skills/workflow/systematic-debugging/find-polluter.sh +0 -63
  239. package/templates/skills/workflow/systematic-debugging/root-cause-tracing.md +0 -169
  240. package/templates/skills/workflow/systematic-debugging/test-academic.md +0 -14
  241. package/templates/skills/workflow/systematic-debugging/test-pressure-1.md +0 -58
  242. package/templates/skills/workflow/systematic-debugging/test-pressure-2.md +0 -68
  243. package/templates/skills/workflow/systematic-debugging/test-pressure-3.md +0 -69
  244. package/templates/skills/workflow/test-driven-development/SKILL.md +0 -371
  245. package/templates/skills/workflow/test-driven-development/testing-anti-patterns.md +0 -299
  246. package/templates/skills/workflow/using-git-worktrees/SKILL.md +0 -217
  247. package/templates/skills/workflow/using-superpowers/SKILL.md +0 -87
  248. package/templates/skills/workflow/verification-before-completion/SKILL.md +0 -139
  249. package/templates/skills/workflow/writing-plans/SKILL.md +0 -116
  250. package/templates/skills/workflow/writing-skills/SKILL.md +0 -655
  251. package/templates/skills/workflow/writing-skills/anthropic-best-practices.md +0 -1150
  252. package/templates/skills/workflow/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -189
  253. package/templates/skills/workflow/writing-skills/graphviz-conventions.dot +0 -172
  254. package/templates/skills/workflow/writing-skills/persuasion-principles.md +0 -187
  255. package/templates/skills/workflow/writing-skills/render-graphs.js +0 -168
  256. package/templates/skills/workflow/writing-skills/testing-skills-with-subagents.md +0 -384
  257. package/templates/types/index.ts +0 -17
  258. /package/templates/{vite-env.d.ts → react/src/vite-env.d.ts} +0 -0
package/README.md CHANGED
@@ -1,194 +1,59 @@
1
1
  # create-claudecraft
2
2
 
3
- Your taste. Their labor. Finally.
3
+ Design-first starter & G1–G20 design-quality guardrails for coding agents (Claude Code, Codex, Cursor, Zed, T3 Code).
4
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
5
+ Needs Node 22.12 or newer.
110
6
 
111
- | Hook | What it does |
112
- |------|--------------|
113
- | `typecheck-after-edit` | TypeScript check after saves |
114
- | `check-branch` | Warns before you commit to main |
7
+ ## Usage
115
8
 
116
- ---
9
+ ```sh
10
+ # Interactive Ink wizard (template picker, Tailwind 4 accent swatches, dark mode, agent apps, GitHub repo)
11
+ npx create-claudecraft
117
12
 
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
13
+ # Non-interactive
14
+ npx create-claudecraft my-site --yes --template astro
15
+ npx create-claudecraft my-app --yes --template react
143
16
 
144
- src/
145
- ├── components/ui/ # Button, ThemeSelector, CodeBlock
146
- ├── context/ # ThemeContext
147
- ├── pages/ # HomePage
148
- └── lib/ # utils
17
+ # Add the design-quality kit to an existing project (no scaffold)
18
+ npx create-claudecraft --init
149
19
 
150
- CLAUDE.md # project brain dump
20
+ # Merge newer kit changes into a scaffolded project (3-way git merge)
21
+ npx create-claudecraft upgrade --dry-run
22
+ npx create-claudecraft upgrade
151
23
  ```
152
24
 
153
- ---
154
-
155
25
  ## Options
156
26
 
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
27
  ```
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
- ---
28
+ --template <id> astro | react (default astro)
29
+ --yes, -y Skip interactive prompts
30
+ --init, -i Install design.md, intent.md, design-quality skill & design-lint hook in cwd
31
+ --force With --init, overwrite existing skill/design files
32
+ --site-name <str> Display name when <name> is a folder name
33
+ --sentence <str> Optional one-liner
34
+ --url <url> Canonical origin for Astro SEO stubs
35
+ --accent <id> Tailwind 4 accent: blue|indigo|violet|fuchsia|pink|rose|orange|emerald|teal|cyan|sky
36
+ --lang <codes> Astro locales, default first (e.g. en,de,ro)
37
+ --add <ids> Agent apps: super, t3, claude, codex, cursor, zed, all, or none
38
+ --no-dark Light appearance only (default: light + system dark mode)
39
+ --repo <vis> private or public: first commit + create GitHub repo via gh
40
+ --no-git Skip git init
41
+ --no-install Skip npm install
42
+ --dry-run With upgrade: list changes without writing
43
+ --version, -v Print version
44
+ --help, -h Show help
45
+ ```
46
+
47
+ ## What's Inside Every Project
48
+
49
+ - **`AGENTS.md` + `CLAUDE.md` (`@AGENTS.md`)** — short, strict agent contract.
50
+ - **`design.md` (G1–G20)** — Creative North Star + 20 non-negotiable gates.
51
+ - **`intent.md`** — scope law (audience, one job, out of scope).
52
+ - **`.claude/skills/design-quality/`** — `/design-quality plan` for pre-build art direction and `/design-quality` for pixel-grounded critique at 1440px + 390px (with bundled `composition-palette.md`, `visual-critic.md`, and `copy-tells.md`).
53
+ - **`.claude/hooks/design-lint.mjs`** — PostToolUse nudge against raw hex/palette classes and `h-screen`.
54
+ - **`npm run verify`** — silent mechanical gate (`format:check`, typecheck, token/copy lint, tests/build).
55
+ - **`claudecraft.json`** — version and answers stamp for 3-way `upgrade`.
187
56
 
188
57
  ## License
189
58
 
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)
59
+ MIT · [@raduceuca](https://x.com/raduceuca)
package/bin/cli.js CHANGED
@@ -1,2 +1,187 @@
1
1
  #!/usr/bin/env node
2
- import '../dist/index.js';
2
+ /**
3
+ * create-claudecraft — Design-first starter & guardrails for coding agents.
4
+ *
5
+ * npx create-claudecraft
6
+ * npx create-claudecraft my-app --yes --template react
7
+ * npx create-claudecraft my-site --yes --template astro
8
+ * npx create-claudecraft --init
9
+ * npx create-claudecraft upgrade
10
+ */
11
+
12
+ const [major, minor] = process.versions.node.split('.').map(Number);
13
+ if (major < 22 || (major === 22 && minor < 12)) {
14
+ console.error(
15
+ `create-claudecraft needs Node 22.12 or newer (found v${process.versions.node}).`,
16
+ );
17
+ process.exit(1);
18
+ }
19
+
20
+ const { parseArgs } = await import('node:util');
21
+ const {
22
+ ACCENT_PALETTE,
23
+ APP_IDS,
24
+ DEFAULT_SITE_URL,
25
+ LANGUAGES,
26
+ TEMPLATES,
27
+ VERSION,
28
+ defaultsFromFlags,
29
+ parseApps,
30
+ parseRepo,
31
+ parseTemplate,
32
+ } = await import('../dist/answers.js');
33
+ const { detectApps } = await import('../lib/apps.mjs');
34
+ const { githubReady } = await import('../lib/github.mjs');
35
+ const { refuseInsideGitRepo, scaffold } = await import('../lib/scaffold.mjs');
36
+
37
+ const HELP = `
38
+ create-claudecraft v${VERSION} — Design-first starter & guardrails for coding agents
39
+
40
+ Usage:
41
+ npx create-claudecraft Interactive wizard (Astro 7 or React 19)
42
+ npx create-claudecraft <name> --yes Non-interactive scaffold
43
+ npx create-claudecraft --init Add design-quality kit (G1-G20) to an existing repo
44
+ npx create-claudecraft upgrade [--dry-run] Merge newer kit updates into a scaffolded project
45
+
46
+ Options:
47
+ --template <id> Stack: ${TEMPLATES.map((t) => t.id).join(' | ')} (default astro)
48
+ --yes, -y Skip prompts
49
+ --init, -i Install design.md, intent.md, design-quality skill & design-lint hook here
50
+ --force With --init, overwrite existing skill/design files
51
+ --site-name <str> Display name when <name> is a folder name
52
+ --sentence <str> Optional one-liner
53
+ --url <url> Canonical URL for Astro SEO stubs (default ${DEFAULT_SITE_URL})
54
+ --accent <id> Dominant accent: ${ACCENT_PALETTE.map((a) => a.id).join('|')}
55
+ --lang <codes> Astro languages, default first (e.g. en,de)
56
+ ${LANGUAGES.map((l) => l.code).join(', ')}
57
+ --add <ids> Agent apps: ${APP_IDS.join(', ')}, all, or none (default none with --yes)
58
+ --no-dark Light appearance only (default: light + system dark mode)
59
+ --repo <vis> private or public: commit and create GitHub repo via gh
60
+ --no-git Skip git init
61
+ --no-install Skip npm install
62
+ --dry-run With upgrade: list changes without writing
63
+ --version, -v Print version
64
+ --help, -h Show this help
65
+ `;
66
+
67
+ try {
68
+ const { values: flags, positionals } = parseArgs({
69
+ allowPositionals: true,
70
+ allowNegative: true,
71
+ options: {
72
+ template: { type: 'string', short: 't' },
73
+ yes: { type: 'boolean', short: 'y' },
74
+ init: { type: 'boolean', short: 'i' },
75
+ force: { type: 'boolean' },
76
+ help: { type: 'boolean', short: 'h' },
77
+ version: { type: 'boolean', short: 'v' },
78
+ 'site-name': { type: 'string' },
79
+ sentence: { type: 'string' },
80
+ url: { type: 'string' },
81
+ accent: { type: 'string' },
82
+ lang: { type: 'string' },
83
+ add: { type: 'string' },
84
+ dark: { type: 'boolean', default: true },
85
+ repo: { type: 'string' },
86
+ git: { type: 'boolean', default: true },
87
+ install: { type: 'boolean', default: true },
88
+ 'dry-run': { type: 'boolean' },
89
+ },
90
+ });
91
+
92
+ if (flags.version) {
93
+ console.log(VERSION);
94
+ process.exit(0);
95
+ }
96
+ if (flags.help) {
97
+ console.log(HELP);
98
+ process.exit(0);
99
+ }
100
+
101
+ if (flags.init || (positionals[0] === 'init' && positionals.length === 1)) {
102
+ const { initExisting } = await import('../lib/init.mjs');
103
+ const res = await initExisting(process.cwd(), { force: Boolean(flags.force) });
104
+ console.log(`\n✓ Added claudecraft design-quality kit to ${res.dir}`);
105
+ if (res.added.length) console.log(` Added (${res.added.length}): ${res.added.join(', ')}`);
106
+ if (res.updated.length) console.log(` Updated (${res.updated.length}): ${res.updated.join(', ')}`);
107
+ if (res.skipped.length) console.log(` Kept existing (${res.skipped.length}): ${res.skipped.join(', ')}`);
108
+ console.log('\nNext:\n 1. Fill intent.md and rewrite the North Star in design.md');
109
+ console.log(' 2. Run /design-quality plan before laying out pages');
110
+ console.log(' 3. Run /design-quality before shipping UI changes\n');
111
+ process.exit(0);
112
+ }
113
+
114
+ if (positionals[0] === 'upgrade' && positionals.length === 1 && !flags.yes) {
115
+ const { summary, upgrade } = await import('../lib/upgrade.mjs');
116
+ const dryRun = Boolean(flags['dry-run']);
117
+ console.log(summary(await upgrade(process.cwd(), { dryRun }), { dryRun }));
118
+ process.exit(0);
119
+ }
120
+
121
+ if (positionals.length > 1) throw new Error(`Pass one project name, got: ${positionals.join(' ')}`);
122
+ const [name] = positionals;
123
+ const detected = detectApps();
124
+ const installed = detected.map((app) => app.id);
125
+
126
+ let answers;
127
+ if (flags.yes) {
128
+ if (!name) throw new Error('Pass a project name with --yes, e.g. npx create-claudecraft my-app --yes');
129
+ answers = defaultsFromFlags({
130
+ template: flags.template,
131
+ projectName: name,
132
+ siteName: flags['site-name'],
133
+ oneSentence: flags.sentence,
134
+ siteUrl: flags.url,
135
+ accent: flags.accent,
136
+ lang: flags.lang,
137
+ add: flags.add,
138
+ installed,
139
+ dark: flags.dark,
140
+ repo: flags.repo,
141
+ git: flags.git,
142
+ install: flags.install,
143
+ });
144
+ } else {
145
+ if (!process.stdin.isTTY) {
146
+ throw new Error('No interactive terminal. Re-run with --yes, e.g. npx create-claudecraft my-app --yes');
147
+ }
148
+ refuseInsideGitRepo();
149
+ const added = flags.add === undefined ? undefined : parseApps(flags.add, installed);
150
+ const chosenTemplate = flags.template ? parseTemplate(flags.template) : undefined;
151
+ const { runInkPrompts } = await import('../dist/ink-prompts.js');
152
+ answers = await runInkPrompts(name, chosenTemplate, added ? [] : detected, githubReady());
153
+ if (!answers) {
154
+ console.log('Cancelled.');
155
+ process.exit(0);
156
+ }
157
+ if (added) answers.apps = added;
158
+ answers.git &&= flags.git;
159
+ if (flags.repo !== undefined) answers.repo = parseRepo(flags.repo);
160
+ if (!answers.git) answers.repo = null;
161
+ answers.install &&= flags.install;
162
+ answers.darkMode &&= flags.dark;
163
+ }
164
+
165
+ console.log(`\nScaffolding ${answers.projectName} (${answers.template})…`);
166
+ const result = await scaffold(answers);
167
+
168
+ const next = [`cd ${answers.projectName}`, ...(answers.install ? [] : ['npm install']), 'npm run dev'];
169
+ console.log(
170
+ [
171
+ '',
172
+ `✓ Created ${result.targetDir}`,
173
+ ` Template: ${answers.template}`,
174
+ ` Local: ${result.localUrl}`,
175
+ ...(result.github ? [` ${result.github}`] : []),
176
+ ...result.apps.map((app) => ` ${app.line}`),
177
+ '',
178
+ ...next.map((step) => ` ${step}`),
179
+ '',
180
+ 'Read AGENTS.md → design.md → intent.md. Run /design-quality plan before laying out UI.',
181
+ '',
182
+ ].join('\n'),
183
+ );
184
+ } catch (err) {
185
+ console.error(err instanceof Error ? err.message : err);
186
+ process.exit(1);
187
+ }
@@ -0,0 +1,269 @@
1
+ export declare const VERSION = "2.0.0";
2
+ /** Placeholder canonical origin until a real domain exists. Astro's npm run deploy refuses it. */
3
+ export declare const DEFAULT_SITE_URL = "http://localhost:4321/";
4
+ export declare const TEMPLATES: readonly [{
5
+ readonly id: "astro";
6
+ readonly label: "Astro 7 site";
7
+ readonly detail: "Static marketing/content · Tailwind 4 · day-0 SEO/AEO · i18n · Cloudflare Pages";
8
+ }, {
9
+ readonly id: "react";
10
+ readonly label: "React 19 app";
11
+ readonly detail: "Vite + TypeScript 5.9 · Tailwind 4 · React Router 7 · Vitest";
12
+ }];
13
+ export type TemplateId = (typeof TEMPLATES)[number]['id'];
14
+ export declare const DEFAULT_TEMPLATE_ID: TemplateId;
15
+ export declare function parseTemplate(value?: string | null): TemplateId;
16
+ /**
17
+ * Dominant accent for a new project, from Tailwind 4: `hex` 600 (light accent), `soft` 100 (light
18
+ * selection), `on` 50 (text on the accent), `dark` 400 and `darkSoft` 950 (dark appearance).
19
+ */
20
+ export declare const ACCENT_PALETTE: readonly [{
21
+ readonly id: "blue";
22
+ readonly label: "Blue";
23
+ readonly hex: "#155dfc";
24
+ readonly soft: "#dbeafe";
25
+ readonly on: "#eff6ff";
26
+ readonly dark: "#51a2ff";
27
+ readonly darkSoft: "#162456";
28
+ }, {
29
+ readonly id: "indigo";
30
+ readonly label: "Indigo";
31
+ readonly hex: "#4f39f6";
32
+ readonly soft: "#e0e7ff";
33
+ readonly on: "#eef2ff";
34
+ readonly dark: "#7c86ff";
35
+ readonly darkSoft: "#1e1a4d";
36
+ }, {
37
+ readonly id: "violet";
38
+ readonly label: "Violet";
39
+ readonly hex: "#7f22fe";
40
+ readonly soft: "#ede9fe";
41
+ readonly on: "#f5f3ff";
42
+ readonly dark: "#a684ff";
43
+ readonly darkSoft: "#2f0d68";
44
+ }, {
45
+ readonly id: "fuchsia";
46
+ readonly label: "Fuchsia";
47
+ readonly hex: "#c800de";
48
+ readonly soft: "#fae8ff";
49
+ readonly on: "#fdf4ff";
50
+ readonly dark: "#ed6aff";
51
+ readonly darkSoft: "#4b004f";
52
+ }, {
53
+ readonly id: "pink";
54
+ readonly label: "Pink";
55
+ readonly hex: "#e60076";
56
+ readonly soft: "#fce7f3";
57
+ readonly on: "#fdf2f8";
58
+ readonly dark: "#fb64b6";
59
+ readonly darkSoft: "#510424";
60
+ }, {
61
+ readonly id: "rose";
62
+ readonly label: "Rose";
63
+ readonly hex: "#ec003f";
64
+ readonly soft: "#ffe4e6";
65
+ readonly on: "#fff1f2";
66
+ readonly dark: "#ff637e";
67
+ readonly darkSoft: "#4d0218";
68
+ }, {
69
+ readonly id: "orange";
70
+ readonly label: "Orange";
71
+ readonly hex: "#f54900";
72
+ readonly soft: "#ffedd4";
73
+ readonly on: "#fff7ed";
74
+ readonly dark: "#ff8904";
75
+ readonly darkSoft: "#441306";
76
+ }, {
77
+ readonly id: "emerald";
78
+ readonly label: "Emerald";
79
+ readonly hex: "#009966";
80
+ readonly soft: "#d0fae5";
81
+ readonly on: "#ecfdf5";
82
+ readonly dark: "#00d492";
83
+ readonly darkSoft: "#002c22";
84
+ }, {
85
+ readonly id: "teal";
86
+ readonly label: "Teal";
87
+ readonly hex: "#009689";
88
+ readonly soft: "#cbfbf1";
89
+ readonly on: "#f0fdfa";
90
+ readonly dark: "#00d5be";
91
+ readonly darkSoft: "#022f2e";
92
+ }, {
93
+ readonly id: "cyan";
94
+ readonly label: "Cyan";
95
+ readonly hex: "#0092b8";
96
+ readonly soft: "#cefafe";
97
+ readonly on: "#ecfeff";
98
+ readonly dark: "#00d3f2";
99
+ readonly darkSoft: "#053345";
100
+ }, {
101
+ readonly id: "sky";
102
+ readonly label: "Sky";
103
+ readonly hex: "#0084d1";
104
+ readonly soft: "#dff2fe";
105
+ readonly on: "#f0f9ff";
106
+ readonly dark: "#00bcff";
107
+ readonly darkSoft: "#052f4a";
108
+ }];
109
+ export type AccentId = (typeof ACCENT_PALETTE)[number]['id'];
110
+ export declare const DEFAULT_ACCENT_ID: AccentId;
111
+ export declare function accentById(id?: string | null): {
112
+ readonly id: "blue";
113
+ readonly label: "Blue";
114
+ readonly hex: "#155dfc";
115
+ readonly soft: "#dbeafe";
116
+ readonly on: "#eff6ff";
117
+ readonly dark: "#51a2ff";
118
+ readonly darkSoft: "#162456";
119
+ } | {
120
+ readonly id: "indigo";
121
+ readonly label: "Indigo";
122
+ readonly hex: "#4f39f6";
123
+ readonly soft: "#e0e7ff";
124
+ readonly on: "#eef2ff";
125
+ readonly dark: "#7c86ff";
126
+ readonly darkSoft: "#1e1a4d";
127
+ } | {
128
+ readonly id: "violet";
129
+ readonly label: "Violet";
130
+ readonly hex: "#7f22fe";
131
+ readonly soft: "#ede9fe";
132
+ readonly on: "#f5f3ff";
133
+ readonly dark: "#a684ff";
134
+ readonly darkSoft: "#2f0d68";
135
+ } | {
136
+ readonly id: "fuchsia";
137
+ readonly label: "Fuchsia";
138
+ readonly hex: "#c800de";
139
+ readonly soft: "#fae8ff";
140
+ readonly on: "#fdf4ff";
141
+ readonly dark: "#ed6aff";
142
+ readonly darkSoft: "#4b004f";
143
+ } | {
144
+ readonly id: "pink";
145
+ readonly label: "Pink";
146
+ readonly hex: "#e60076";
147
+ readonly soft: "#fce7f3";
148
+ readonly on: "#fdf2f8";
149
+ readonly dark: "#fb64b6";
150
+ readonly darkSoft: "#510424";
151
+ } | {
152
+ readonly id: "rose";
153
+ readonly label: "Rose";
154
+ readonly hex: "#ec003f";
155
+ readonly soft: "#ffe4e6";
156
+ readonly on: "#fff1f2";
157
+ readonly dark: "#ff637e";
158
+ readonly darkSoft: "#4d0218";
159
+ } | {
160
+ readonly id: "orange";
161
+ readonly label: "Orange";
162
+ readonly hex: "#f54900";
163
+ readonly soft: "#ffedd4";
164
+ readonly on: "#fff7ed";
165
+ readonly dark: "#ff8904";
166
+ readonly darkSoft: "#441306";
167
+ } | {
168
+ readonly id: "emerald";
169
+ readonly label: "Emerald";
170
+ readonly hex: "#009966";
171
+ readonly soft: "#d0fae5";
172
+ readonly on: "#ecfdf5";
173
+ readonly dark: "#00d492";
174
+ readonly darkSoft: "#002c22";
175
+ } | {
176
+ readonly id: "teal";
177
+ readonly label: "Teal";
178
+ readonly hex: "#009689";
179
+ readonly soft: "#cbfbf1";
180
+ readonly on: "#f0fdfa";
181
+ readonly dark: "#00d5be";
182
+ readonly darkSoft: "#022f2e";
183
+ } | {
184
+ readonly id: "cyan";
185
+ readonly label: "Cyan";
186
+ readonly hex: "#0092b8";
187
+ readonly soft: "#cefafe";
188
+ readonly on: "#ecfeff";
189
+ readonly dark: "#00d3f2";
190
+ readonly darkSoft: "#053345";
191
+ } | {
192
+ readonly id: "sky";
193
+ readonly label: "Sky";
194
+ readonly hex: "#0084d1";
195
+ readonly soft: "#dff2fe";
196
+ readonly on: "#f0f9ff";
197
+ readonly dark: "#00bcff";
198
+ readonly darkSoft: "#052f4a";
199
+ };
200
+ export declare const TEMPLATES_ROOT: string;
201
+ export declare const SHARED_TEMPLATE_DIR: string;
202
+ export declare const templateDirFor: (template: TemplateId) => string;
203
+ export type Language = {
204
+ code: string;
205
+ name: string;
206
+ english: string;
207
+ };
208
+ export declare const DEFAULT_LOCALE = "en";
209
+ /** Catalog languages: English first, then by English name. */
210
+ export declare const LANGUAGES: Language[];
211
+ /** "de,en,ar" → default de, then the rest in catalog order. Empty → English only. */
212
+ export declare function parseLocales(csv?: string | null): {
213
+ locales: string[];
214
+ defaultLocale: string;
215
+ };
216
+ /** Agent apps the scaffold can add a project to. lib/apps.mjs holds what each one does. */
217
+ export declare const APP_IDS: readonly ["super", "t3", "claude", "codex", "cursor", "zed"];
218
+ export type AppId = (typeof APP_IDS)[number];
219
+ /** --add value: "claude,cursor", "all" (the apps on this machine) or "none". Empty → none. */
220
+ export declare function parseApps(csv: string | undefined, installed: readonly AppId[]): AppId[];
221
+ export type Visibility = 'private' | 'public';
222
+ /** --repo value: private, public, or none (also when missing). */
223
+ export declare function parseRepo(value?: string | null): Visibility | null;
224
+ export type ProjectAnswers = {
225
+ template: TemplateId;
226
+ projectName: string;
227
+ siteName: string;
228
+ oneSentence: string;
229
+ siteUrl: string;
230
+ /** Dominant accent id from ACCENT_PALETTE. */
231
+ accentId: AccentId;
232
+ /** Locale codes, default first (Astro template). */
233
+ locales: string[];
234
+ defaultLocale: string;
235
+ /** Apps to write config for and open the project in. */
236
+ apps: AppId[];
237
+ /** Dark appearance that follows the visitor's system setting. */
238
+ darkMode: boolean;
239
+ git: boolean;
240
+ /** GitHub repo to create and push to after the first commit; null for none. Needs git. */
241
+ repo: Visibility | null;
242
+ install: boolean;
243
+ };
244
+ /** True for a name that can be the folder as is (my-app), false for a display name (Oak & Iron). */
245
+ export declare const isFolderName: (value: string) => boolean;
246
+ export declare function prettifyName(name: string): string;
247
+ export declare function folderName(name: string): string;
248
+ export declare function freeFolderName(name: string): string;
249
+ export declare function validateProjectName(value: string): string | undefined;
250
+ export declare function normalizeUrl(value?: string | null): string;
251
+ export declare function defaultsFromFlags(opts: {
252
+ template?: string;
253
+ projectName: string;
254
+ siteName?: string;
255
+ oneSentence?: string;
256
+ siteUrl?: string;
257
+ accent?: string;
258
+ lang?: string;
259
+ add?: string;
260
+ installed?: readonly AppId[];
261
+ dark?: boolean;
262
+ repo?: string;
263
+ git?: boolean;
264
+ install?: boolean;
265
+ }): ProjectAnswers;
266
+ /** Values written into template {{PLACEHOLDERS}}. scaffold sets devPort first. */
267
+ export declare function templateVars(answers: ProjectAnswers & {
268
+ devPort: number;
269
+ }, published: string): Record<string, string | string[]>;