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
@@ -0,0 +1,8 @@
1
+ ; Exact versions in package.json, no ^ or ~.
2
+ save-exact=true
3
+ ; Refuse a package published in the last 2 days: a hijacked release is usually pulled by then.
4
+ ; npm ci installs from the lockfile and is never held back.
5
+ min-release-age=2
6
+ ; Dependencies come from the registry only, never a git repo or a URL.
7
+ allow-git=none
8
+ allow-remote=none
@@ -0,0 +1,8 @@
1
+ {
2
+ "setup": ["npm install"],
3
+ "run": [
4
+ { "name": "dev", "commands": ["npm run dev"], "default": true },
5
+ { "name": "build", "commands": ["npm run build"] },
6
+ { "name": "preview", "commands": ["npm run build && npm run preview"] }
7
+ ]
8
+ }
@@ -0,0 +1,5 @@
1
+ [
2
+ { "label": "dev", "command": "npm run dev", "use_new_terminal": true },
3
+ { "label": "build", "command": "npm run build" },
4
+ { "label": "preview", "command": "npm run build && npm run preview", "use_new_terminal": true }
5
+ ]
@@ -0,0 +1,111 @@
1
+ // @ts-check
2
+ import { existsSync, readFileSync, readdirSync } from 'node:fs';
3
+ import { rename, rmdir } from 'node:fs/promises';
4
+ import { join } from 'node:path';
5
+ import { defineConfig } from 'astro/config';
6
+ import react from '@astrojs/react';
7
+ import sitemap from '@astrojs/sitemap';
8
+ import tailwindcss from '@tailwindcss/vite';
9
+ import { catalog, dist, isNoindex } from './scripts/shared.mjs';
10
+ import { defaultLocale, devPort, locales, siteUrl } from './site.config.mjs';
11
+
12
+ /** The sitemap lists a page only if its built HTML is indexable. */
13
+ const indexable = (/** @type {string} */ page) => {
14
+ const file = join(dist, decodeURI(new URL(page).pathname), 'index.html');
15
+ return existsSync(file) && !isNoindex(readFileSync(file, 'utf8'));
16
+ };
17
+
18
+ /**
19
+ * Cloudflare Pages serves the nearest 404.html up the tree. src/pages/404.astro already builds
20
+ * /404.html; move each other locale's /<code>/404/index.html to /<code>/404.html.
21
+ */
22
+ /** @type {import('astro').AstroIntegration} */
23
+ const notFoundPages = {
24
+ name: 'not-found-pages',
25
+ hooks: {
26
+ 'astro:build:done': async ({ dir }) => {
27
+ for (const code of locales.filter((locale) => locale !== defaultLocale)) {
28
+ const folder = new URL(`${code}/404/`, dir);
29
+ await rename(new URL('index.html', folder), new URL('../404.html', folder));
30
+ await rmdir(folder);
31
+ }
32
+ },
33
+ },
34
+ };
35
+
36
+ const hreflangs = Object.fromEntries(locales.map((code) => [code, catalog(code).meta.hreflang]));
37
+
38
+ const port = Number(process.env.PORT) || devPort;
39
+
40
+ /** strictPort stops dev on a busy port. Say how to run it on another one. */
41
+ /** @type {import('astro').AstroIntegration} */
42
+ const busyPort = {
43
+ name: 'busy-port',
44
+ hooks: {
45
+ 'astro:server:setup': ({ server, logger }) => {
46
+ const hint = (/** @type {NodeJS.ErrnoException} */ error) => {
47
+ if (error.code !== 'EADDRINUSE') return;
48
+ // The port dev tried, --port included (.claude/launch.json passes one).
49
+ const taken = server.config.server.port;
50
+ logger.error(`Port ${taken} is taken. Run: PORT=${taken + 1} npm run dev`);
51
+ };
52
+ server.httpServer?.once('error', hint).once('listening', () => server.httpServer?.off('error', hint));
53
+ },
54
+ },
55
+ };
56
+
57
+ /** Pages in src/dev/ exist under `npm run dev` only, at /dev/<name>/. A build never ships them. */
58
+ /** @type {import('astro').AstroIntegration} */
59
+ const devPages = {
60
+ name: 'dev-pages',
61
+ hooks: {
62
+ 'astro:config:setup': ({ command, injectRoute }) => {
63
+ const folder = new URL('src/dev/', import.meta.url);
64
+ if (command !== 'dev' || !existsSync(folder)) return;
65
+ for (const file of readdirSync(folder).filter((name) => name.endsWith('.astro'))) {
66
+ injectRoute({
67
+ pattern: `/dev/${file.slice(0, -'.astro'.length)}`,
68
+ entrypoint: new URL(file, folder),
69
+ });
70
+ }
71
+ },
72
+ },
73
+ };
74
+
75
+ export default defineConfig({
76
+ site: siteUrl,
77
+ output: 'static',
78
+ trailingSlash: 'always',
79
+ server: { port },
80
+ i18n: { locales, defaultLocale, routing: { prefixDefaultLocale: false } },
81
+ integrations: [
82
+ react(),
83
+ notFoundPages,
84
+ busyPort,
85
+ devPages,
86
+ sitemap({
87
+ filter: indexable,
88
+ // With more than one locale, each URL lists the same alternates as its HTML head, x-default included.
89
+ i18n: { defaultLocale, locales: hreflangs },
90
+ serialize: (item) => {
91
+ const fallback = item.links?.find((link) => link.lang === hreflangs[defaultLocale]);
92
+ return fallback
93
+ ? { ...item, links: [...(item.links ?? []), { url: fallback.url, lang: 'x-default' }] }
94
+ : item;
95
+ },
96
+ }),
97
+ ],
98
+ vite: {
99
+ plugins: [tailwindcss()],
100
+ // Never inline fonts into the render-blocking CSS; unicode-range then skips unused subsets.
101
+ build: { assetsInlineLimit: 0 },
102
+ // A busy port is an error, never a silent move: the local URL points at this one.
103
+ server: { strictPort: true },
104
+ // Builds get their own dependency cache so a production build never overwrites
105
+ // the dev server's pre-bundled React ("_jsxDEV is not a function").
106
+ cacheDir: process.argv.includes('dev') ? 'node_modules/.vite' : 'node_modules/.vite-build',
107
+ optimizeDeps: {
108
+ include: ['react', 'react-dom', 'react-dom/client', 'react/jsx-runtime', 'react/jsx-dev-runtime'],
109
+ },
110
+ },
111
+ });
@@ -0,0 +1,7 @@
1
+ # docs/
2
+
3
+ Briefs, specs, handoffs, formulas, sources and reference prototypes for this site. Drop them here and ask an agent to port them: scope into `intent.md`, brand into `design.md` and `src/styles/global.css`, numbers into `src/data/`, words into `src/i18n/`.
4
+
5
+ `decisions.md` is the running log every agent reads. Add one dated line per decision worth keeping. `inbox.md` lists what waits on the human and what was delivered.
6
+
7
+ `kit/` explains the parts the claudecraft kit built; `AGENTS.md` → Kit reference says when to read each file.
@@ -0,0 +1,3 @@
1
+ # Decisions
2
+
3
+ - {{PUBLISHED}}: Scaffolded with create-claudecraft (astro). Languages: {{LOCALES}} (default {{DEFAULT_LOCALE}}). Accent: {{ACCENT_NAME}} ({{ACCENT}}). Canonical URL: {{SITE_URL}}.
@@ -0,0 +1,7 @@
1
+ # Inbox
2
+
3
+ What waits on the human, newest first, then what was delivered. Agents keep it current (`AGENTS.md` → How you must work, 9).
4
+
5
+ ## Waiting on you
6
+
7
+ ## Delivered
@@ -0,0 +1,15 @@
1
+ # Agent apps
2
+
3
+ `.claude/settings.json` is in every site. Claude Code runs `npm run *` without asking, asks before `npm run deploy` and `npx wrangler *`, and is blocked from reading `.env` and `.dev.vars`. It applies once the folder is trusted in Claude Code.
4
+
5
+ The scaffold wrote these only for the apps picked at creation:
6
+
7
+ | File | App | For |
8
+ |---|---|---|
9
+ | `.claude/launch.json` | Claude desktop | Starts `npm run dev` for its preview pane |
10
+ | `.codex/environments/environment.toml` | Codex app | Setup (`npm install`) and Dev, Build, Preview actions |
11
+ | `.super.engineering/config.json` | super.engineering | Setup and the dev, build, preview run scripts |
12
+ | `t3.json` | T3 Code | Install, Dev (opens the preview), Build, Preview actions; import them once in the app |
13
+ | `.zed/tasks.json` | Zed | dev, build, preview tasks |
14
+
15
+ Cursor needs no file. Every app reads this file (`CLAUDE.md` imports it), so all agent instructions live here.
@@ -0,0 +1,13 @@
1
+ # Analytics and the cookie question
2
+
3
+ `analytics` in `site.config.mjs` holds two IDs, both empty: `googleAnalytics` (the `G-…` measurement ID) and `clarity` (the Microsoft Clarity project ID). An empty ID loads nothing. Cloudflare Web Analytics sets no cookies and needs no code: the human switches it on for the Pages project in the Cloudflare dashboard.
4
+
5
+ With an ID set:
6
+
7
+ - `src/components/Analytics.astro` loads the tools in `<head>`. Both run without cookies until the visitor allows them: Google's consent mode starts at denied, and Clarity is told the same. Advertising storage stays denied.
8
+ - `src/components/Consent.astro` asks once per browser, with two equal buttons, and `src/lib/consent.ts` keeps the answer in `localStorage`. The footer's `consentOpen` button asks again.
9
+ - `/privacy/` is built in every language (`src/pages/[...locale]/privacy.astro`), and the question links to it. Its text, `privacyBody`, starts as a placeholder: write it with the human in every `src/i18n/<code>.json` (who runs the site, each tool, what each records, how to reach them). `npm run deploy` refuses while the placeholder is in the build.
10
+ - The four `consent*` strings are in every `src/i18n/<code>.json`. Rewrite them in the site's voice.
11
+ - A new tool goes in all three files: its ID in `analytics`, its loader in `Analytics.astro`, its consent call in `decide()`.
12
+
13
+ `verify-build` fails when a page loads a tool without the question, or loads one whose ID is empty.
@@ -0,0 +1,9 @@
1
+ # Deploy to Cloudflare Pages
2
+
3
+ ```sh
4
+ npm run deploy -- https://your-domain # production branch main
5
+ npm run deploy -- https://your-domain preview # any other branch is a preview
6
+ ```
7
+
8
+ The header of `scripts/deploy.sh` lists what it refuses, how to log in, and how pages.dev hosts are noindexed.
9
+ **A push to `main` deploys.** `.github/workflows/deploy.yml` runs the same script once the GitHub repository has the secrets `CLOUDFLARE_API_TOKEN` (Pages: Edit) and `CLOUDFLARE_ACCOUNT_ID` and the variable `SITE_URL`; until then the run passes and says it skipped. Treat a push to `main` as a deploy: ask the human first. To deploy by hand only, delete the workflow.
@@ -0,0 +1,10 @@
1
+ # Share card and icons
2
+
3
+ | Asset | How |
4
+ |---|---|
5
+ | Share card 1200×630 | `ogImage` on `BaseLayout` takes a PNG or JPEG under `public/`; `verify-build` fails when a page's file is missing. `npm run generate:og` renders `scripts/og-template.html` with the site name, the default language's `description` and the paper/ink/accent tokens. Needs Chrome or Chromium. Refuses while the description is the placeholder. |
6
+ | Icons | `npm run generate:icons` renders `public/favicon.svg` on `--color-paper` at each size, and writes `favicon.ico`. Needs Chrome or Chromium. |
7
+ | More pictures | `scripts/chrome.mjs` drives one headless Chrome with no dependency: use it for a share card per page or any other rendered image |
8
+ | Layout | Absolute `og:image` / Twitter image via `Astro.site`, never relative |
9
+
10
+ The committed `og-image.png` and PNG icons are neutral ink on paper; `favicon.svg` already uses the accent. Run both generators once the brand is set.
@@ -0,0 +1,8 @@
1
+ # Languages
2
+
3
+ - **URLs:** the default language is unprefixed (`/`, `/about/`); the others live under `/<code>/` (`/de/`, `/de/about/`).
4
+ - **Strings:** `src/i18n/<code>.json` holds `meta` (native name, hreflang, ogLocale, dir, font), `description` (the site's one sentence in that language) and `ui` (page strings; `{site}` becomes the site name). Every file keeps the same `ui` keys or the build fails.
5
+ - **Add a language:** copy a file in `src/i18n/` to `<code>.json`, fill its `meta` (`"font": "system"` for scripts the site's font lacks, such as Arabic, Hebrew, Devanagari or CJK), translate `description` and `ui`, then add the code to `locales` in `site.config.mjs` (default first).
6
+ - **Add a page:** put it in `src/pages/[...locale]/` with `getStaticPaths = localeStaticPaths`, pass `locale` to `BaseLayout`, add its strings to `ui` in every catalog, and link with `localePath(locale, '/path/')`. Every page exists in every language.
7
+ - **Translate:** `npm run build` warns (lint-copy) on each string still identical to the default language's.
8
+ - **Automatic, enforced by verify-build:** `<html lang dir>`, hreflang for every language plus `x-default` (reciprocal), matching sitemap alternates, `og:locale` + alternates, JSON-LD `inLanguage` and translation links, a noindex 404 per language (`/404.html`, `/<code>/404.html`), one `llms.txt` section per language, markdown twins with `lang`.
@@ -0,0 +1,16 @@
1
+ # Local URL and dev server
2
+
3
+ ## Local URL
4
+
5
+ `README.md` → Run covers `npm run domain`, `--remove` and what to do when the port is taken.
6
+
7
+ - Start the dev server through `npm run dev` only. The script clears `CLAUDECODE`, `AGENT` and `AI_AGENT`. Astro may still run dev in the background under Codex, Cursor or Zed.
8
+ - The port is `devPort` in `site.config.mjs`. `.claude/launch.json`, `t3.json` and the Caddy file repeat it. Change it only with the human: edit those two files too, then run `npm run domain` again.
9
+
10
+ ## Vite cacheDir pitfall
11
+
12
+ Split `cacheDir` in `astro.config.mjs`. If islands die with `_jsxDEV is not a function`:
13
+
14
+ ```sh
15
+ rm -rf node_modules/.vite node_modules/.vite-build && npm run dev
16
+ ```
@@ -0,0 +1,15 @@
1
+ # SEO and AEO
2
+
3
+ | Piece | Where |
4
+ |---|---|
5
+ | Head + one JSON-LD `@graph` | `BaseLayout.astro`, `lib/seo.ts` |
6
+ | Publisher | `publisher` in `site.config.mjs`: the JSON-LD Organization. Empty means the site itself; set a name, URL and `sameAs` profiles when a studio or company runs it |
7
+ | Per-page extras | `BaseLayout` props: `graph` (extra JSON-LD nodes, same `@graph`), `noindex`, `ogImage`, `pageType`, `locale` |
8
+ | `llms.txt` · `llms-full.txt` · `index.md` twins | `scripts/markdown-pages.mjs`, generated after the build from the pages actually built. `data-md`, `data-md-label` and `data-md-text` on an element shape its markdown (the script's header) |
9
+ | Sitemap (indexable pages only) · robots (one `*` group) | `astro.config.mjs`, `pages/robots.txt.ts` |
10
+ | Headers (one `/*`) | `public/_headers` |
11
+ | Manifest · theme-color · viewport-fit | `BaseLayout` + `pages/site.webmanifest.ts`; both read their colors from `src/styles/global.css` (`src/lib/theme.ts`) |
12
+ | `dateModified` | The last commit's date (`modified` in `site.config.mjs`); a page passes its own to `BaseLayout` |
13
+ | Contract | `scripts/verify-build.mjs`: also one title and description per page in a language, and every internal link lands on a built page |
14
+
15
+ `noindex` is the one switch: a noindex page drops out of the sitemap, `llms.txt` and the markdown twins. If you add `/tools/*`: pass `noindex` (noindex + out of sitemap).
@@ -0,0 +1,40 @@
1
+ # Project structure
2
+
3
+ ```
4
+ .
5
+ ├── AGENTS.md · CLAUDE.md · design.md · intent.md · README.md
6
+ ├── claudecraft.json ← the kit version, template and answers this site came from (`upgrade.md`)
7
+ ├── docs/ ← specs, handoffs, formulas, sources, decisions.md (read after intent.md), inbox.md (what waits on the human)
8
+ ├── docs/kit/ ← how the kit's parts work (`AGENTS.md` → Kit reference)
9
+ ├── astro.config.mjs ← static · trailingSlash · i18n routing · sitemap filter · 404s · Vite cacheDir split
10
+ ├── site.config.mjs ← SITE_URL, SITE_NAME, devPort, locales, analytics IDs, publisher, Content-Signal (.env overrides URL and name)
11
+ ├── wrangler.toml ← Cloudflare Pages (name={{PROJECT_NAME}}, dist/)
12
+ ├── functions/_middleware.js ← markdown for agents that ask for it (deployed with dist/)
13
+ ├── .npmrc ← exact versions, registry only, nothing newer than 2 days
14
+ ├── public/
15
+ │ ├── _headers ← exactly ONE /* block (deploy appends the pages.dev noindex)
16
+ │ ├── _routes.json ← pages run through functions/_middleware.js; assets and .md files skip it
17
+ │ ├── favicon.svg · favicon-16/32.png · favicon.ico · apple-touch-icon.png
18
+ │ ├── icon-192.png · icon-512.png
19
+ │ └── og-image.png ← 1200×630 share card (absolute URL in layout)
20
+ ├── scripts/
21
+ │ ├── verify.mjs ← npm run verify, the gate
22
+ │ ├── markdown-pages.mjs · lint-copy.mjs · verify-build.mjs
23
+ │ ├── generate-og.mjs · og-template.html · generate-icons.mjs
24
+ │ ├── chrome.mjs ← one headless Chrome for both generators, no dependency
25
+ │ ├── local-domain.mjs ← npm run domain (README.md → Run)
26
+ │ └── deploy.sh
27
+ ├── .claude/settings.json ← Claude Code permissions + design-lint hook (`agent-apps.md`)
28
+ ├── .claude/hooks/design-lint.mjs ← PostToolUse nudge against raw colors/hex and h-screen
29
+ ├── .claude/skills/design-quality/ ← art-direction planning + pixel-grounded G1–G20 review
30
+ ├── agent-app files ← only for the apps picked at creation (`agent-apps.md`)
31
+ ├── .github/workflows/ci.yml · deploy.yml ← verify and a secret scan, and the deploy on every push to main
32
+ ├── .vscode/ · .editorconfig · .nvmrc
33
+ └── src/
34
+ ├── i18n/ ← <code>.json strings per language · index.ts helpers
35
+ ├── pages/[...locale]/ ← every page, built once per language (privacy.astro only with an analytics ID)
36
+ ├── pages/404.astro ← the default locale's 404 (renders [...locale]/404.astro)
37
+ ├── pages/robots.txt.ts · pages/site.webmanifest.ts
38
+ ├── dev/ ← pages served under npm run dev only (`upgrade.md` → Dev pages)
39
+ └── layouts · components · lib · data · styles
40
+ ```
@@ -0,0 +1,19 @@
1
+ # Kit upgrades and dev pages
2
+
3
+ ## create-claudecraft upgrade
4
+
5
+ `claudecraft.json` records the kit version, template, commit this site came from, and the answers that shaped it. Leave it as the kit wrote it. Every page carries the version in `<meta name="claudecraft">`.
6
+
7
+ `npx create-claudecraft upgrade`, run here on a clean git tree, brings in what the kit changed since. `npx create-claudecraft upgrade --dry-run` lists it without writing.
8
+
9
+ - A file this site never changed takes the kit's version.
10
+ - A file both changed is merged line by line. Lines both changed keep both versions between `<<<<<<<` markers: resolve each one, keeping the site's intent and the kit's fix.
11
+ - A file the site deleted, an image both changed and `package-lock.json` stay as they are, and are listed.
12
+
13
+ Afterwards: resolve the markers, `npm install` when `package.json` changed, `npm run verify`, then show the human `git diff` before committing. `git checkout . && git clean -fd` undoes the whole upgrade.
14
+
15
+ Upgrades merge cleanly when site work stays out of kit files. Put new behaviour in new files (a component, a page, a script) and keep edits to `scripts/`, `functions/`, `astro.config.mjs` and `BaseLayout.astro` small.
16
+
17
+ ## Dev pages
18
+
19
+ A page in `src/dev/` is served at `/dev/<name>/` under `npm run dev` only; a build never ships it. `src/dev/styleguide.astro` shows the tokens and type. Add each shared component to it as it appears, and check it there after changing one.
@@ -0,0 +1,25 @@
1
+ // Serves a page's markdown twin when the request prefers text/markdown over text/html.
2
+ // Everything else passes straight through to the static files. Browsers never ask for
3
+ // markdown, so visitors always get HTML. public/_routes.json keeps assets off this function.
4
+
5
+ const quality = (accept, type) => {
6
+ for (const part of accept.split(',')) {
7
+ const [name, ...params] = part.trim().toLowerCase().split(';');
8
+ if (name.trim() !== type) continue;
9
+ const q = params.map((p) => p.trim()).find((p) => p.startsWith('q='));
10
+ return q ? Number(q.slice(2)) || 0 : 1;
11
+ }
12
+ return 0;
13
+ };
14
+
15
+ export async function onRequest({ request, next, env }) {
16
+ const url = new URL(request.url);
17
+ if (!['GET', 'HEAD'].includes(request.method) || !url.pathname.endsWith('/')) return next();
18
+
19
+ const accept = request.headers.get('accept') || '';
20
+ const markdown = quality(accept, 'text/markdown');
21
+ if (!markdown || markdown < quality(accept, 'text/html')) return next();
22
+
23
+ const twin = await env.ASSETS.fetch(new Request(new URL(`${url.pathname}index.md`, url), request));
24
+ return twin.ok ? twin : next();
25
+ }
@@ -0,0 +1,40 @@
1
+ # intent.md — {{SITE_NAME}}
2
+
3
+ Product scope. Port it from the brief in `docs/` (or fill it with the human) and update it when scope changes. Agents: do not invent product scope beyond this file.
4
+
5
+ ## One sentence
6
+
7
+ > {{ONE_SENTENCE}}
8
+
9
+ ## Audience
10
+
11
+ - Primary:
12
+ - Secondary (optional):
13
+
14
+ ## One job
15
+
16
+ The homepage exists to make visitors do **one** thing:
17
+
18
+ -
19
+
20
+ ## Success looks like
21
+
22
+ -
23
+ -
24
+ -
25
+
26
+ ## Out of scope
27
+
28
+ -
29
+
30
+ ## Languages
31
+
32
+ {{LOCALES}} (the first is the default, served at `/`). Source of truth: `locales` in `site.config.mjs`.
33
+
34
+ ## Voice (optional)
35
+
36
+ Tone in three words:
37
+
38
+ -
39
+
40
+ Words we never use: add them to `RULES` in `scripts/lint-copy.mjs` so the build enforces them.
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "{{PROJECT_NAME}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "version": "0.1.0",
6
+ "engines": {
7
+ "node": ">=22.12.0"
8
+ },
9
+ "scripts": {
10
+ "dev": "env -u CLAUDECODE -u AGENT -u AI_AGENT astro dev",
11
+ "domain": "node scripts/local-domain.mjs",
12
+ "build": "astro check && astro build && node scripts/markdown-pages.mjs && node scripts/lint-copy.mjs && node scripts/verify-build.mjs",
13
+ "verify": "node scripts/verify.mjs",
14
+ "preview": "astro preview",
15
+ "check": "astro check",
16
+ "format": "prettier --write .",
17
+ "format:check": "prettier --check .",
18
+ "lint:copy": "node scripts/lint-copy.mjs",
19
+ "verify:build": "node scripts/verify-build.mjs",
20
+ "generate:og": "node scripts/generate-og.mjs",
21
+ "generate:icons": "node scripts/generate-icons.mjs",
22
+ "deploy": "bash scripts/deploy.sh",
23
+ "astro": "astro"
24
+ },
25
+ "dependencies": {
26
+ "@astrojs/react": "7.1.4",
27
+ "@astrojs/sitemap": "3.7.4",
28
+ "@fontsource/jetbrains-mono": "5.3.0",
29
+ "@tailwindcss/vite": "4.3.4",
30
+ "astro": "7.4.7",
31
+ "clsx": "2.1.1",
32
+ "react": "19.3.1",
33
+ "react-dom": "19.3.1",
34
+ "tailwind-merge": "3.7.0",
35
+ "tailwindcss": "4.3.4"
36
+ },
37
+ "devDependencies": {
38
+ "@astrojs/check": "0.9.12",
39
+ "@types/react": "19.3.0",
40
+ "@types/react-dom": "19.3.0",
41
+ "node-html-markdown": "2.0.0",
42
+ "prettier": "3.9.10",
43
+ "prettier-plugin-astro": "1.1.2",
44
+ "typescript": "5.9.3"
45
+ }
46
+ }
@@ -0,0 +1,17 @@
1
+ # ONE /* block only: a second /* block silently drops the first.
2
+ /*
3
+ X-Content-Type-Options: nosniff
4
+ Referrer-Policy: strict-origin-when-cross-origin
5
+ X-Frame-Options: DENY
6
+ Permissions-Policy: camera=(), microphone=(), geolocation=(), payment=(), usb=(), browsing-topics=()
7
+ Vary: Accept
8
+
9
+ /
10
+ Link: </llms.txt>; rel="describedby"; type="text/plain", </sitemap-index.xml>; rel="sitemap"; type="application/xml", </index.md>; rel="alternate"; type="text/markdown"
11
+
12
+ /*.md
13
+ Content-Type: text/markdown; charset=utf-8
14
+ /index.md
15
+ Link: </>; rel="canonical"
16
+ /*/index.md
17
+ Link: </:splat/>; rel="canonical"
@@ -0,0 +1,5 @@
1
+ {
2
+ "version": 1,
3
+ "include": ["/*"],
4
+ "exclude": ["/_astro/*", "/*.png", "/*.ico", "/*.svg", "/*.txt", "/*.xml", "/*.md", "/*.webmanifest", "/*/*.md"]
5
+ }
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
2
+ <rect width="32" height="32" rx="7" fill="#f4f1ea" />
3
+ <circle cx="16" cy="16" r="8" fill="{{ACCENT}}" />
4
+ </svg>
@@ -0,0 +1,138 @@
1
+ // One headless Chrome or Chromium, driven over the DevTools protocol with Node's own WebSocket
2
+ // (Node 22+), so rendering many pages needs no dependency and no browser start per page.
3
+ //
4
+ // const chrome = await launchChrome(); // null when no browser is installed
5
+ // const tab = await chrome.tab(1200, 630);
6
+ // await tab.goto(pathToFileURL('scripts/og-template.html').href);
7
+ // await tab.evaluate('document.fonts.ready.then(() => true)'); // awaits a returned promise
8
+ // writeFileSync('card.png', await tab.screenshot({ format: 'png' }));
9
+ // await chrome.close();
10
+ import { spawn, spawnSync } from 'node:child_process';
11
+ import { mkdtempSync, rmSync } from 'node:fs';
12
+ import { tmpdir } from 'node:os';
13
+ import path from 'node:path';
14
+
15
+ const BROWSERS = [
16
+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
17
+ '/Applications/Chromium.app/Contents/MacOS/Chromium',
18
+ 'google-chrome',
19
+ 'chromium',
20
+ ];
21
+
22
+ export async function launchChrome() {
23
+ const binary = BROWSERS.find((candidate) => spawnSync(candidate, ['--version']).status === 0);
24
+ if (!binary) return null;
25
+ const profile = mkdtempSync(path.join(tmpdir(), 'chrome-'));
26
+ const browser = spawn(
27
+ binary,
28
+ [
29
+ '--headless=new',
30
+ '--remote-debugging-port=0',
31
+ `--user-data-dir=${profile}`,
32
+ '--no-first-run',
33
+ '--no-default-browser-check',
34
+ '--disable-gpu',
35
+ '--hide-scrollbars',
36
+ 'about:blank',
37
+ ],
38
+ { stdio: ['ignore', 'ignore', 'pipe'] },
39
+ );
40
+ const stop = () => {
41
+ browser.kill();
42
+ rmSync(profile, { recursive: true, force: true, maxRetries: 5 });
43
+ };
44
+
45
+ // Chrome prints the address of its DevTools socket on stderr once it is up.
46
+ const address = await new Promise((resolve, reject) => {
47
+ let printed = '';
48
+ browser.stderr.on('data', (chunk) => {
49
+ printed += chunk;
50
+ const found = printed.match(/DevTools listening on (ws:\/\/\S+)/);
51
+ if (found) resolve(found[1]);
52
+ });
53
+ browser.once('exit', () => reject(new Error('Chrome closed before it was ready.')));
54
+ setTimeout(() => reject(new Error('Chrome did not start in 20 s.')), 20_000);
55
+ }).catch((error) => {
56
+ stop();
57
+ throw error;
58
+ });
59
+
60
+ const socket = new WebSocket(address);
61
+ await new Promise((resolve, reject) => {
62
+ socket.addEventListener('open', resolve, { once: true });
63
+ socket.addEventListener('error', reject, { once: true });
64
+ });
65
+ let last = 0;
66
+ const waiting = new Map(); // call id → { resolve, reject }
67
+ const listeners = new Set(); // (event) => void
68
+ socket.addEventListener('message', ({ data }) => {
69
+ const message = JSON.parse(data);
70
+ const call = waiting.get(message.id);
71
+ if (!call) return listeners.forEach((listener) => listener(message));
72
+ waiting.delete(message.id);
73
+ if (message.error) call.reject(new Error(message.error.message));
74
+ else call.resolve(message.result);
75
+ });
76
+ const send = (method, params = {}, sessionId) =>
77
+ new Promise((resolve, reject) => {
78
+ const id = ++last;
79
+ waiting.set(id, { resolve, reject });
80
+ socket.send(JSON.stringify({ id, method, params, sessionId }));
81
+ });
82
+ const next = (method, sessionId) =>
83
+ new Promise((resolve) => {
84
+ const listener = (event) => {
85
+ if (event.method !== method || event.sessionId !== sessionId) return;
86
+ listeners.delete(listener);
87
+ resolve(event.params);
88
+ };
89
+ listeners.add(listener);
90
+ });
91
+
92
+ return {
93
+ /** A tab `width` × `height` CSS pixels; `mobile` emulates a touch phone at `scale`× density. */
94
+ async tab(width, height, { mobile = false, scale = 1 } = {}) {
95
+ const { targetId } = await send('Target.createTarget', { url: 'about:blank' });
96
+ const { sessionId } = await send('Target.attachToTarget', { targetId, flatten: true });
97
+ const call = (method, params) => send(method, params, sessionId);
98
+ await call('Page.enable');
99
+ await call('Emulation.setDeviceMetricsOverride', { width, height, deviceScaleFactor: scale, mobile });
100
+ if (mobile) await call('Emulation.setTouchEmulationEnabled', { enabled: true });
101
+ return {
102
+ call,
103
+ async goto(url) {
104
+ const loaded = next('Page.loadEventFired', sessionId);
105
+ await call('Page.navigate', { url });
106
+ await loaded;
107
+ },
108
+ /** Runs an expression in the page and returns its value; a promise is awaited. */
109
+ async evaluate(expression) {
110
+ const { result, exceptionDetails } = await call('Runtime.evaluate', {
111
+ expression,
112
+ awaitPromise: true,
113
+ returnByValue: true,
114
+ userGesture: true,
115
+ });
116
+ if (exceptionDetails)
117
+ throw new Error(exceptionDetails.exception?.description ?? exceptionDetails.text);
118
+ return result.value;
119
+ },
120
+ /** The viewport as a JPEG (or `format: 'png'`); `full` takes the whole page. */
121
+ async screenshot({ format = 'jpeg', quality = 82, full = false } = {}) {
122
+ const { data } = await call('Page.captureScreenshot', {
123
+ format,
124
+ ...(format === 'jpeg' && { quality }),
125
+ captureBeyondViewport: full,
126
+ ...(full && { clip: { ...(await call('Page.getLayoutMetrics')).cssContentSize, scale: 1 } }),
127
+ });
128
+ return Buffer.from(data, 'base64');
129
+ },
130
+ close: () => send('Target.closeTarget', { targetId }),
131
+ };
132
+ },
133
+ async close() {
134
+ socket.close();
135
+ stop();
136
+ },
137
+ };
138
+ }