@bitmagic/cli 0.1.15 → 0.1.17

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 (36) hide show
  1. package/README.md +50 -16
  2. package/dist/cli.d.ts +26 -0
  3. package/dist/cli.js +3 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/cover.d.ts +100 -0
  6. package/dist/commands/cover.js +321 -0
  7. package/dist/commands/cover.js.map +1 -0
  8. package/dist/commands/generate.d.ts +13 -3
  9. package/dist/commands/generate.js +12 -2
  10. package/dist/commands/generate.js.map +1 -1
  11. package/dist/commands/init.d.ts +4 -0
  12. package/dist/commands/init.js +21 -7
  13. package/dist/commands/init.js.map +1 -1
  14. package/dist/commands/publish.d.ts +23 -0
  15. package/dist/commands/publish.js +72 -23
  16. package/dist/commands/publish.js.map +1 -1
  17. package/dist/commands/upgrade.d.ts +18 -0
  18. package/dist/commands/upgrade.js +33 -0
  19. package/dist/commands/upgrade.js.map +1 -1
  20. package/dist/commands/verify.js +2 -3
  21. package/dist/commands/verify.js.map +1 -1
  22. package/dist/publish/fingerprint.js +13 -5
  23. package/dist/publish/fingerprint.js.map +1 -1
  24. package/dist/render/inline-image.d.ts +45 -0
  25. package/dist/render/inline-image.js +70 -0
  26. package/dist/render/inline-image.js.map +1 -0
  27. package/dist/scaffold/project-files.d.ts +15 -0
  28. package/dist/scaffold/project-files.js +94 -6
  29. package/dist/scaffold/project-files.js.map +1 -1
  30. package/dist/scaffold/project.d.ts +17 -3
  31. package/dist/scaffold/project.js +22 -7
  32. package/dist/scaffold/project.js.map +1 -1
  33. package/dist/scaffold/upgrade-project.d.ts +12 -4
  34. package/dist/scaffold/upgrade-project.js +19 -5
  35. package/dist/scaffold/upgrade-project.js.map +1 -1
  36. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/commands/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA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,QAAQ;gBACjC,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW;gBACvC,WAAW;gBACX,WAAW;gBACX,cAAc;aACf,CAAC,CAAC;QACL,CAAC;gBAAS,CAAC;YACT,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -19,13 +19,21 @@ import * as path from 'path';
19
19
  *
20
20
  * `.DS_Store` is excluded for the same reason at file granularity: on macOS, Finder writes it
21
21
  * merely for opening the project folder, and no build tool ever reads it — so it is another way
22
- * to flip the fingerprint without editing anything. It is the only excluded FILE; the list is
23
- * deliberately not a general ignore mechanism, because a false "fresh" ships an unverified
24
- * bundle while a false "stale" only costs one `bitmagic verify`.
22
+ * to flip the fingerprint without editing anything. The list is deliberately not a general ignore
23
+ * mechanism, because a false "fresh" ships an unverified bundle while a false "stale" only costs
24
+ * one `bitmagic verify`.
25
+ *
26
+ * `GAME-DESIGN.md` earns its place on the same "no build tool reads it" test: nothing imports it,
27
+ * `vite.publish.config.js` cannot put prose in the bundle, and it exists to be REWRITTEN as the
28
+ * game evolves — it is the input `bitmagic cover` reads. Left in, the ordinary
29
+ * `bitmagic verify` → refine the design doc → `bitmagic publish` sequence exits 3 over a paragraph
30
+ * of prose, which teaches agents to reach for `--force` (the one flag that also waves through a
31
+ * genuinely stale verify). Excluded at basename granularity like `.DS_Store`, so a design doc kept
32
+ * in a subdirectory counts the same way.
25
33
  */
26
34
  const EXCLUDED_DIRS = new Set(['.bitmagic', 'node_modules', 'dist', '.vite-cache', '.git']);
27
- /** See EXCLUDED_DIRS: tool-written files that can never change what the bundle contains. */
28
- const EXCLUDED_FILES = new Set(['.DS_Store']);
35
+ /** See EXCLUDED_DIRS: files that can never change what the bundle contains. */
36
+ const EXCLUDED_FILES = new Set(['.DS_Store', 'GAME-DESIGN.md']);
29
37
  /**
30
38
  * A relative path as the fingerprint hashes it: always forward-slashed.
31
39
  *
@@ -1 +1 @@
1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C,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACxB,KAAK,CAAC,IAAI,EAAE,CAAC;IAEb,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAChF,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Drawing an image into the terminal, for the one thing in this CLI that produces something worth
3
+ * looking at: the generated cover art.
4
+ *
5
+ * This is the only place in the package that writes escape sequences. Every other command prints
6
+ * plain lines on purpose, because an agent tool is usually what reads them — so the rule here is
7
+ * that the image is strictly ADDITIONAL. The caller prints the path and URL first, unconditionally;
8
+ * this function either draws on top of that or does nothing at all. It never replaces a line, and
9
+ * it never reports failure as an error.
10
+ *
11
+ * Only the iTerm2 inline-image protocol is implemented. It takes the image bytes in whatever format
12
+ * the terminal can decode, which is what makes the Forger's webp usable without transcoding. kitty
13
+ * and Ghostty speak a different protocol whose only portable transmission format is PNG (`f=100`),
14
+ * and decoding webp to PNG would mean adding an image codec to a package that deliberately depends
15
+ * on almost nothing — so those terminals fall through to the plain lines like any other.
16
+ */
17
+ import { Buffer } from 'buffer';
18
+ export interface InlineImageEnv {
19
+ TERM_PROGRAM?: string | undefined;
20
+ LC_TERMINAL?: string | undefined;
21
+ KONSOLE_VERSION?: string | undefined;
22
+ TMUX?: string | undefined;
23
+ BITMAGIC_NO_INLINE_IMAGE?: string | undefined;
24
+ }
25
+ /**
26
+ * Whether this terminal is known to implement the iTerm2 inline-image protocol.
27
+ *
28
+ * An allowlist, never a guess: a terminal that does not understand the sequence prints its raw
29
+ * bytes, and a screenful of base64 in the middle of a command's output is far worse than no image.
30
+ * `TMUX` disqualifies everything — tmux swallows the sequence unless it is wrapped in its own
31
+ * passthrough, and a wrapped sequence that reaches a pane the user cannot see helps nobody.
32
+ */
33
+ export declare function supportsInlineImage(env: InlineImageEnv, isTTY: boolean): boolean;
34
+ /** The raw iTerm2 sequence for `bytes`, exported so a test can assert its shape without a TTY. */
35
+ export declare function inlineImageSequence(bytes: Buffer): string;
36
+ export interface RenderInlineImageOptions {
37
+ env?: InlineImageEnv;
38
+ isTTY?: boolean;
39
+ write?: (chunk: string) => void;
40
+ }
41
+ /**
42
+ * Draw `bytes` into the terminal if it can display them. Returns whether anything was drawn, so a
43
+ * caller can decide what else to say — never throws, and never writes when unsupported.
44
+ */
45
+ export declare function renderInlineImage(bytes: Buffer, options?: RenderInlineImageOptions): boolean;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Drawing an image into the terminal, for the one thing in this CLI that produces something worth
3
+ * looking at: the generated cover art.
4
+ *
5
+ * This is the only place in the package that writes escape sequences. Every other command prints
6
+ * plain lines on purpose, because an agent tool is usually what reads them — so the rule here is
7
+ * that the image is strictly ADDITIONAL. The caller prints the path and URL first, unconditionally;
8
+ * this function either draws on top of that or does nothing at all. It never replaces a line, and
9
+ * it never reports failure as an error.
10
+ *
11
+ * Only the iTerm2 inline-image protocol is implemented. It takes the image bytes in whatever format
12
+ * the terminal can decode, which is what makes the Forger's webp usable without transcoding. kitty
13
+ * and Ghostty speak a different protocol whose only portable transmission format is PNG (`f=100`),
14
+ * and decoding webp to PNG would mean adding an image codec to a package that deliberately depends
15
+ * on almost nothing — so those terminals fall through to the plain lines like any other.
16
+ */
17
+ /** Written as escapes rather than literal control bytes, so the source stays greppable. */
18
+ const ESC = '\u001b';
19
+ const BEL = '\u0007';
20
+ /** Width in terminal cells. Large enough to read as a picture, small enough not to fill a screen. */
21
+ const IMAGE_CELL_WIDTH = 40;
22
+ /**
23
+ * Whether this terminal is known to implement the iTerm2 inline-image protocol.
24
+ *
25
+ * An allowlist, never a guess: a terminal that does not understand the sequence prints its raw
26
+ * bytes, and a screenful of base64 in the middle of a command's output is far worse than no image.
27
+ * `TMUX` disqualifies everything — tmux swallows the sequence unless it is wrapped in its own
28
+ * passthrough, and a wrapped sequence that reaches a pane the user cannot see helps nobody.
29
+ */
30
+ export function supportsInlineImage(env, isTTY) {
31
+ if (!isTTY)
32
+ return false;
33
+ if (env.BITMAGIC_NO_INLINE_IMAGE)
34
+ return false;
35
+ if (env.TMUX)
36
+ return false;
37
+ if (env.TERM_PROGRAM === 'iTerm.app' || env.TERM_PROGRAM === 'WezTerm')
38
+ return true;
39
+ if (env.LC_TERMINAL === 'iTerm2')
40
+ return true;
41
+ return env.KONSOLE_VERSION !== undefined && env.KONSOLE_VERSION !== '';
42
+ }
43
+ /** The raw iTerm2 sequence for `bytes`, exported so a test can assert its shape without a TTY. */
44
+ export function inlineImageSequence(bytes) {
45
+ const payload = bytes.toString('base64');
46
+ // `size` is the DECODED byte count, which is what iTerm2 uses to know the transfer is complete.
47
+ // preserveAspectRatio keeps the 1:1 cover square rather than stretching it to the cell box.
48
+ return (`${ESC}]1337;File=inline=1;size=${bytes.length};width=${IMAGE_CELL_WIDTH};` +
49
+ `preserveAspectRatio=1:${payload}${BEL}\n`);
50
+ }
51
+ /**
52
+ * Draw `bytes` into the terminal if it can display them. Returns whether anything was drawn, so a
53
+ * caller can decide what else to say — never throws, and never writes when unsupported.
54
+ */
55
+ export function renderInlineImage(bytes, options = {}) {
56
+ const env = options.env ?? process.env;
57
+ const isTTY = options.isTTY ?? process.stdout.isTTY === true;
58
+ if (!supportsInlineImage(env, isTTY))
59
+ return false;
60
+ const write = options.write ?? ((chunk) => process.stdout.write(chunk));
61
+ try {
62
+ write(inlineImageSequence(bytes));
63
+ return true;
64
+ }
65
+ catch {
66
+ // A closed or non-writable stdout is not worth failing a successful generation over.
67
+ return false;
68
+ }
69
+ }
70
+ //# sourceMappingURL=inline-image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-image.js","sourceRoot":"","sources":["../../src/render/inline-image.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,2FAA2F;AAC3F,MAAM,GAAG,GAAG,QAAQ,CAAC;AACrB,MAAM,GAAG,GAAG,QAAQ,CAAC;AAErB,qGAAqG;AACrG,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAU5B;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,GAAmB,EACnB,KAAc;IAEd,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,IAAI,GAAG,CAAC,wBAAwB;QAAE,OAAO,KAAK,CAAC;IAC/C,IAAI,GAAG,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IAC3B,IAAI,GAAG,CAAC,YAAY,KAAK,WAAW,IAAI,GAAG,CAAC,YAAY,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACpF,IAAI,GAAG,CAAC,WAAW,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC9C,OAAO,GAAG,CAAC,eAAe,KAAK,SAAS,IAAI,GAAG,CAAC,eAAe,KAAK,EAAE,CAAC;AACzE,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzC,gGAAgG;IAChG,4FAA4F;IAC5F,OAAO,CACL,GAAG,GAAG,4BAA4B,KAAK,CAAC,MAAM,UAAU,gBAAgB,GAAG;QAC3E,yBAAyB,OAAO,GAAG,GAAG,IAAI,CAC3C,CAAC;AACJ,CAAC;AAQD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa,EAAE,UAAoC,EAAE;IACrF,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACvC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC;IAC7D,IAAI,CAAC,mBAAmB,CAAC,GAAG,EAAE,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEnD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAChF,IAAI,CAAC;QACH,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,qFAAqF;QACrF,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -34,5 +34,20 @@ export interface ProjectMetadata {
34
34
  export declare function renderBitmagicJson(metadata: ProjectMetadata): string;
35
35
  export declare function renderAgentsMd(): string;
36
36
  export declare function renderGenerateSkill(): string;
37
+ /**
38
+ * `GAME-DESIGN.md` — the project's design document, and the input `bitmagic cover` builds its
39
+ * image prompt from. The web lane's Planning Mode writes a file of the same name for the same
40
+ * purpose, so a creator moving between lanes finds the same thing where they expect it.
41
+ *
42
+ * Written once by `scaffoldProject` and creator-owned from then on: it is deliberately NOT in
43
+ * PLATFORM_GENERATED_FILES, so `bitmagic upgrade` never overwrites the creator's design with this
44
+ * skeleton. `bitmagic init --idea` seeds the Pitch; without it the headings stand empty and the
45
+ * line under the title says who fills them in.
46
+ *
47
+ * The headings are the ones a cover prompt can actually use — what the world looks like matters
48
+ * more to an image model than how the input mapping works — but nothing enforces them: the whole
49
+ * file is read as prose.
50
+ */
51
+ export declare function renderGameDesignMd(idea?: string): string;
37
52
  export declare function renderClaudeMd(): string;
38
53
  export declare function renderSkillsReadme(): string;
@@ -302,6 +302,12 @@ export function renderAgentsMd() {
302
302
  - \`engine/\` — **the Bitmagic engine, read-only.** It is vendored by the CLI and replaced
303
303
  wholesale by \`bitmagic upgrade\`. Edits here are lost on upgrade and ignored on publish.
304
304
  - \`engine/docs/\` — the engine's deep-dive documentation. Read it before guessing.
305
+ - \`GAME-DESIGN.md\` — **what this game is.** Yours to write and keep current. Nothing compiles it,
306
+ but \`bitmagic cover\` generates the cover art from it, so it is not decoration.
307
+ - \`.claude/skills/generating-assets/\` — **shipped by the CLI, re-rendered by \`bitmagic upgrade\`.**
308
+ It documents the CLI's own commands, so it stays current with them; edits to it are lost. Skills
309
+ you add yourself are never touched. This file (\`AGENTS.md\`) is yours too — \`upgrade\` does not
310
+ open it, which also means it will not learn about new CLI commands on its own.
305
311
 
306
312
  \`engine/types/work-game.d.ts\` declares \`module 'work/Game.js'\`, which is how the engine
307
313
  imports your game. Renaming or removing the \`VoxelGame\` export from \`src/work/Game.ts\` still
@@ -319,6 +325,25 @@ import type { GameData } from 'types/game.js';
319
325
 
320
326
  Always include the \`.js\` extension, even in TypeScript.
321
327
 
328
+ ## Cover art — do this early
329
+
330
+ \`\`\`
331
+ bitmagic cover # generate the cover from GAME-DESIGN.md and set it as the start screen
332
+ \`\`\`
333
+
334
+ Run it **as soon as \`GAME-DESIGN.md\` says what the game is, before you start implementing it.**
335
+ Building the first version takes a while, and the cover is the only thing the person waiting has to
336
+ look at while you work. Generated afterwards it is the same picture, just no longer useful for that.
337
+
338
+ It writes \`.bitmagic/cover.webp\` (read that file if you want to show them the art), sets
339
+ \`hud.startScreen.imageUrl\` in \`world.json\`, and becomes the thumbnail \`bitmagic publish\`
340
+ uploads. Because it touches \`world.json\`, it invalidates a passing verify — so run it BEFORE
341
+ \`bitmagic verify\`, not between verifying and publishing.
342
+
343
+ Re-running it on an unchanged \`GAME-DESIGN.md\` costs nothing and generates nothing; it just
344
+ reports the cover you already have. Rewrite the design and run it again — or pass \`--force\` — when
345
+ the game has moved on from its artwork. It costs the creator real money each time it does generate.
346
+
322
347
  ## Before you change movement, cameras or rotation
323
348
 
324
349
  Read \`engine/docs/coordinate-system.md\`. Gameplay faces **+Z** while cameras face **−Z**, and
@@ -349,15 +374,18 @@ bitmagic publish # verify-gate, build if needed, and ship to bitmagic.ai
349
374
  Follow this order; \`publish\` enforces it and refuses otherwise:
350
375
 
351
376
  1. Run \`bitmagic verify\` and get it passing. It writes \`.bitmagic/verify/result.json\`,
352
- \`.bitmagic/verify/screenshot.png\` (becomes the publish thumbnail) and
353
- \`.bitmagic/verify/console.log\`.
377
+ \`.bitmagic/verify/screenshot.png\` and \`.bitmagic/verify/console.log\`.
378
+
379
+ The publish thumbnail is \`.bitmagic/cover.webp\` when \`bitmagic cover\` has produced one, and
380
+ that screenshot otherwise. The output names which one it used.
354
381
  2. Do not edit any tracked file between verifying and publishing. Staleness is decided by a
355
382
  content fingerprint of every tracked file, not a clock — one edit after verifying invalidates
356
383
  it immediately, and an untouched project stays fresh no matter how long it has been. There is
357
384
  no way to check freshness except running \`bitmagic verify\` again. Git operations are safe:
358
385
  \`.git/\` is excluded from the fingerprint, so committing (or branching, or stashing) between
359
386
  verifying and publishing changes nothing. So are \`node_modules/\`, \`dist/\`, \`.bitmagic/\`
360
- and \`.vite-cache/\`.
387
+ and \`.vite-cache/\` — and \`GAME-DESIGN.md\`, which no build step reads, so refining the design
388
+ doc never invalidates a verify. \`bitmagic cover\` DOES, because it writes \`world.json\`.
361
389
  3. Run \`bitmagic publish\`. It rebuilds automatically if the project changed since the last
362
390
  build, so a manual \`bitmagic build\` first is optional.
363
391
 
@@ -368,9 +396,9 @@ publish and the game goes back to private — its \`/play/\` page stops serving
368
396
  game you re-publish bare disappears from bitmagic.ai entirely until the next
369
397
  \`--visibility public\`.
370
398
 
371
- \`--force\` overrides a **stale or failed** verify verdict, never a **missing** one — the
372
- thumbnail comes from the verify screenshot, so \`bitmagic verify\` must have produced one at least
373
- once before \`--force\` has anything to publish from.
399
+ \`--force\` overrides a **stale or failed** verify verdict, never a **missing** one — a project with
400
+ no cover art has only the verify screenshot to publish a thumbnail from, so \`bitmagic verify\` must
401
+ have produced one at least once before \`--force\` has anything to work with.
374
402
 
375
403
  \`--name\`/\`--description\` apply to that one publish call only; they are never written back to
376
404
  \`src/work/game.json\` (doing so by hand would change the fingerprint and invalidate the verify
@@ -485,6 +513,16 @@ The \`bitmagic\` CLI generates content directly into this project. Five types wo
485
513
 
486
514
  \`--help\` on any subcommand lists its full flags.
487
515
 
516
+ Cover art is the one generation that is **not** a \`generate\` subcommand:
517
+
518
+ | Command | Makes | Lands in |
519
+ |---|---|---|
520
+ | \`bitmagic cover\` | the game's cover art | \`hud.startScreen.imageUrl\`, \`.bitmagic/cover.webp\`, the publish thumbnail |
521
+
522
+ It writes its own prompt from \`GAME-DESIGN.md\` rather than taking one, and it skips generating
523
+ entirely when the design has not changed since the last cover. See AGENTS.md for why it is worth
524
+ running before you start implementing rather than after.
525
+
488
526
  ## Before generating
489
527
 
490
528
  - Confirm the change actually needs new content. Reusing an asset already in \`world.json\` costs
@@ -516,6 +554,46 @@ toolchain does not run yet. Do not hand-edit \`world.json\` to reference a model
516
554
  generate — the game will fail to load it.
517
555
  `;
518
556
  }
557
+ /**
558
+ * `GAME-DESIGN.md` — the project's design document, and the input `bitmagic cover` builds its
559
+ * image prompt from. The web lane's Planning Mode writes a file of the same name for the same
560
+ * purpose, so a creator moving between lanes finds the same thing where they expect it.
561
+ *
562
+ * Written once by `scaffoldProject` and creator-owned from then on: it is deliberately NOT in
563
+ * PLATFORM_GENERATED_FILES, so `bitmagic upgrade` never overwrites the creator's design with this
564
+ * skeleton. `bitmagic init --idea` seeds the Pitch; without it the headings stand empty and the
565
+ * line under the title says who fills them in.
566
+ *
567
+ * The headings are the ones a cover prompt can actually use — what the world looks like matters
568
+ * more to an image model than how the input mapping works — but nothing enforces them: the whole
569
+ * file is read as prose.
570
+ */
571
+ export function renderGameDesignMd(idea) {
572
+ const pitch = idea?.trim();
573
+ return `# Game design
574
+
575
+ ${pitch
576
+ ? 'Written from `bitmagic init --idea`. Keep it current as the game changes — `bitmagic cover` reads this file.'
577
+ : 'Fill this in before you start building. `bitmagic cover` reads this file to generate the cover art, so the World & look section in particular is worth writing properly.'}
578
+
579
+ ## Pitch
580
+
581
+ ${pitch ?? 'One or two sentences: what is this game, and who is the player?'}
582
+
583
+ ## Core loop
584
+
585
+ What the player does over and over, and why it stays interesting.
586
+
587
+ ## World & look
588
+
589
+ Setting, mood, palette, time of day, the landmarks a player would remember. This is the section
590
+ the cover art is drawn from.
591
+
592
+ ## Win / lose
593
+
594
+ How a run ends, in both directions.
595
+ `;
596
+ }
519
597
  export function renderClaudeMd() {
520
598
  return '@AGENTS.md\n';
521
599
  }
@@ -524,6 +602,16 @@ export function renderSkillsReadme() {
524
602
 
525
603
  Claude Code skills placed in this directory apply to this project. See \`AGENTS.md\` at the
526
604
  project root for the guidance an agent should read before editing this game.
605
+
606
+ ## Which of these are yours
607
+
608
+ \`generating-assets/\` — and this README — are shipped by the Bitmagic CLI and **re-rendered by
609
+ \`bitmagic upgrade\`**. They describe what the CLI can do, so they have to stay current with it;
610
+ edits to them are lost on the next upgrade.
611
+
612
+ Every other directory here is yours. \`upgrade\` never opens a skill it does not ship, and never
613
+ deletes anything under \`.claude/\`. Put project-specific guidance in a skill of your own, or in
614
+ \`AGENTS.md\` — both are left alone.
527
615
  `;
528
616
  }
529
617
  //# sourceMappingURL=project-files.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/scaffold/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEjF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,2BAA2B,EAAE,SAAS;IACtC,2BAA2B,EAAE,SAAS;IACtC,kBAAkB,EAAE,QAAQ;IAC5B,MAAM,EAAE,QAAQ;IAChB,OAAO,EAA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B,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO;;;;;;;;;;;;;;CAcR,CAAC;AACF,CAAC"}
@@ -22,9 +22,21 @@ export declare const VENDORED_DIRS: string[];
22
22
  * platform-owned, and engine/ + sw-cache-buster.js, handled separately since they are copied, not
23
23
  * rendered).
24
24
  *
25
- * Deliberately excludes package.json (creators add dependencies to it), AGENTS.md/CLAUDE.md (the
26
- * creator's own agent reads and may edit them), and .gitignore (same reasoning) those are
27
- * generated once by `scaffoldProject` but are creator-owned from that point on.
25
+ * **Every skill this CLI deploys belongs here.** A skill documents what the CLI can do — not the
26
+ * creator's game so a project stuck on the version that shipped with its scaffold is a project
27
+ * whose agent cannot discover anything added since. That is not hypothetical: `bitmagic cover`
28
+ * shipped and was invisible in every existing project, because the skill listing the generate
29
+ * commands was written once at init and never revisited. Whatever we add next would repeat it.
30
+ * Add a new skill to this list and existing projects receive it on their next `bitmagic upgrade`.
31
+ *
32
+ * Only the paths named here are rewritten; anything else under `.claude/` — a skill the creator
33
+ * wrote themselves — is never opened. The trade is deliberate and one-directional: an edit to one
34
+ * of OUR skill files is lost on upgrade, which is the price of those files staying current.
35
+ *
36
+ * Deliberately excludes package.json (creators add dependencies to it), AGENTS.md/CLAUDE.md and
37
+ * GAME-DESIGN.md (the creator's own guidance and design — ours to seed once, theirs to own), and
38
+ * .gitignore (same reasoning) — those are generated once by `scaffoldProject` but are creator-owned
39
+ * from that point on.
28
40
  *
29
41
  * Exported so `scaffoldProject` and `upgradeProject` share one definition instead of two lists
30
42
  * that can drift — the exact failure that motivated this: `vite.publish.config.js` was added
@@ -41,5 +53,7 @@ export interface ScaffoldOptions {
41
53
  template: TemplateEntry;
42
54
  metadata: ProjectMetadata;
43
55
  projectName: string;
56
+ /** `bitmagic init --idea`, seeding GAME-DESIGN.md's Pitch. Absent leaves the skeleton empty. */
57
+ idea?: string;
44
58
  }
45
59
  export declare function scaffoldProject(options: ScaffoldOptions): void;
@@ -2,7 +2,7 @@ import * as fs from 'fs';
2
2
  import * as path from 'path';
3
3
  import { CliError } from '../errors.js';
4
4
  import { aliasSourceDir } from './aliases.js';
5
- import { renderPackageJson, renderTsconfig, renderIndexHtml, renderViteConfig, renderVitePublishConfig, renderGitignore, renderBitmagicJson, renderAgentsMd, renderClaudeMd, renderSkillsReadme, renderGenerateSkill, } from './project-files.js';
5
+ import { renderPackageJson, renderTsconfig, renderIndexHtml, renderViteConfig, renderVitePublishConfig, renderGitignore, renderBitmagicJson, renderAgentsMd, renderGameDesignMd, renderClaudeMd, renderSkillsReadme, renderGenerateSkill, } from './project-files.js';
6
6
  /**
7
7
  * Directories moved out of the extracted tree into the project's vendored engine/.
8
8
  *
@@ -31,9 +31,21 @@ export const VENDORED_DIRS = [
31
31
  * platform-owned, and engine/ + sw-cache-buster.js, handled separately since they are copied, not
32
32
  * rendered).
33
33
  *
34
- * Deliberately excludes package.json (creators add dependencies to it), AGENTS.md/CLAUDE.md (the
35
- * creator's own agent reads and may edit them), and .gitignore (same reasoning) those are
36
- * generated once by `scaffoldProject` but are creator-owned from that point on.
34
+ * **Every skill this CLI deploys belongs here.** A skill documents what the CLI can do — not the
35
+ * creator's game so a project stuck on the version that shipped with its scaffold is a project
36
+ * whose agent cannot discover anything added since. That is not hypothetical: `bitmagic cover`
37
+ * shipped and was invisible in every existing project, because the skill listing the generate
38
+ * commands was written once at init and never revisited. Whatever we add next would repeat it.
39
+ * Add a new skill to this list and existing projects receive it on their next `bitmagic upgrade`.
40
+ *
41
+ * Only the paths named here are rewritten; anything else under `.claude/` — a skill the creator
42
+ * wrote themselves — is never opened. The trade is deliberate and one-directional: an edit to one
43
+ * of OUR skill files is lost on upgrade, which is the price of those files staying current.
44
+ *
45
+ * Deliberately excludes package.json (creators add dependencies to it), AGENTS.md/CLAUDE.md and
46
+ * GAME-DESIGN.md (the creator's own guidance and design — ours to seed once, theirs to own), and
47
+ * .gitignore (same reasoning) — those are generated once by `scaffoldProject` but are creator-owned
48
+ * from that point on.
37
49
  *
38
50
  * Exported so `scaffoldProject` and `upgradeProject` share one definition instead of two lists
39
51
  * that can drift — the exact failure that motivated this: `vite.publish.config.js` was added
@@ -45,6 +57,8 @@ export const PLATFORM_GENERATED_FILES = [
45
57
  ['vite.config.js', renderViteConfig],
46
58
  ['vite.publish.config.js', renderVitePublishConfig],
47
59
  ['index.html', renderIndexHtml],
60
+ ['.claude/skills/README.md', renderSkillsReadme],
61
+ ['.claude/skills/generating-assets/SKILL.md', renderGenerateSkill],
48
62
  ];
49
63
  export function resolveTemplate(templatesDir, requestedId) {
50
64
  const indexPath = path.join(templatesDir, 'index.json');
@@ -80,7 +94,7 @@ function copyContents(source, dest) {
80
94
  }
81
95
  }
82
96
  export function scaffoldProject(options) {
83
- const { targetDir, extractedEngineDir, templatesDir, template, metadata, projectName } = options;
97
+ const { targetDir, extractedEngineDir, templatesDir, template, metadata, projectName, idea } = options;
84
98
  const engineDir = path.join(targetDir, 'engine');
85
99
  fs.mkdirSync(engineDir, { recursive: true });
86
100
  for (const dir of VENDORED_DIRS) {
@@ -123,10 +137,11 @@ export function scaffoldProject(options) {
123
137
  ...PLATFORM_GENERATED_FILES.map((entry) => [entry[0], entry[1]()]),
124
138
  ['bitmagic.json', renderBitmagicJson(metadata)],
125
139
  ['AGENTS.md', renderAgentsMd()],
140
+ // Creator-owned from here on (see PLATFORM_GENERATED_FILES): the agent rewrites it as the
141
+ // game takes shape, and `bitmagic cover` reads whatever it says at the time.
142
+ ['GAME-DESIGN.md', renderGameDesignMd(idea)],
126
143
  ['CLAUDE.md', renderClaudeMd()],
127
144
  ['.gitignore', renderGitignore()],
128
- ['.claude/skills/README.md', renderSkillsReadme()],
129
- ['.claude/skills/generating-assets/SKILL.md', renderGenerateSkill()],
130
145
  ];
131
146
  for (const [name, contents] of files) {
132
147
  const filePath = path.join(targetDir, name);
@@ -1 +1 @@
1
- {"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/scaffold/project.ts"],"names":[],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AE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAC/C,CAAC,WAAW,EAAE,cAAc,EAAE,CAAC;QAC/B,0FAA0F;QAC1F,6EAA6E;QAC7E,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC,WAAW,EAAE,cAAc,EAAE,CAAC;QAC/B,CAAC,YAAY,EAAE,eAAe,EAAE,CAAC;KAClC,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,KAAK,EAAE,CAAC;QACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC5C,wFAAwF;QACxF,+EAA+E;QAC/E,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;AACH,CAAC"}
@@ -14,10 +14,18 @@ export interface UpgradeResult {
14
14
  /**
15
15
  * Refreshes the platform-owned parts of a scaffolded project in place, and nothing else. This is
16
16
  * the file-boundary described in the task brief: `engine/` (every VENDORED_DIRS entry) and
17
- * sw-cache-buster.js are wholesale-replaced, the config files in PLATFORM_GENERATED_FILES are
18
- * re-rendered, and bitmagic.json is read-modified-written so only its engineVersion field
19
- * changes. Everything else on disk — src/, world.json, game.json, package.json, AGENTS.md,
20
- * CLAUDE.md, .claude/, .gitignore is never opened.
17
+ * sw-cache-buster.js are wholesale-replaced, the config files AND SHIPPED SKILLS in
18
+ * PLATFORM_GENERATED_FILES are re-rendered, and bitmagic.json is read-modified-written so only its
19
+ * engineVersion field changes. Everything else on disk — src/, world.json, game.json,
20
+ * package.json, AGENTS.md, GAME-DESIGN.md, CLAUDE.md, .gitignore, and any skill the creator wrote
21
+ * themselves — is never opened.
22
+ *
23
+ * The skills are in that list on purpose (see PLATFORM_GENERATED_FILES): they describe the CLI, so
24
+ * a project that never receives an updated one has an agent that cannot discover anything the CLI
25
+ * learned since the project was scaffolded. Note the asymmetry with the rest of `.claude/`: paths
26
+ * we render are overwritten, paths we do not are left entirely alone. Nothing under `.claude/` is
27
+ * ever deleted, so a skill we stop shipping stays behind rather than being cleaned up — a stale
28
+ * file being much cheaper than deleting one a creator wrote.
21
29
  *
22
30
  * Mirrors scaffoldProject's copy behaviour (same VENDORED_DIRS loop, same corrupt-tarball error
23
31
  * when a directory is missing from the extracted tree), except it clears engine/ first: unlike a
@@ -5,10 +5,18 @@ import { VENDORED_DIRS, PLATFORM_GENERATED_FILES } from './project.js';
5
5
  /**
6
6
  * Refreshes the platform-owned parts of a scaffolded project in place, and nothing else. This is
7
7
  * the file-boundary described in the task brief: `engine/` (every VENDORED_DIRS entry) and
8
- * sw-cache-buster.js are wholesale-replaced, the config files in PLATFORM_GENERATED_FILES are
9
- * re-rendered, and bitmagic.json is read-modified-written so only its engineVersion field
10
- * changes. Everything else on disk — src/, world.json, game.json, package.json, AGENTS.md,
11
- * CLAUDE.md, .claude/, .gitignore is never opened.
8
+ * sw-cache-buster.js are wholesale-replaced, the config files AND SHIPPED SKILLS in
9
+ * PLATFORM_GENERATED_FILES are re-rendered, and bitmagic.json is read-modified-written so only its
10
+ * engineVersion field changes. Everything else on disk — src/, world.json, game.json,
11
+ * package.json, AGENTS.md, GAME-DESIGN.md, CLAUDE.md, .gitignore, and any skill the creator wrote
12
+ * themselves — is never opened.
13
+ *
14
+ * The skills are in that list on purpose (see PLATFORM_GENERATED_FILES): they describe the CLI, so
15
+ * a project that never receives an updated one has an agent that cannot discover anything the CLI
16
+ * learned since the project was scaffolded. Note the asymmetry with the rest of `.claude/`: paths
17
+ * we render are overwritten, paths we do not are left entirely alone. Nothing under `.claude/` is
18
+ * ever deleted, so a skill we stop shipping stays behind rather than being cleaned up — a stale
19
+ * file being much cheaper than deleting one a creator wrote.
12
20
  *
13
21
  * Mirrors scaffoldProject's copy behaviour (same VENDORED_DIRS loop, same corrupt-tarball error
14
22
  * when a directory is missing from the extracted tree), except it clears engine/ first: unlike a
@@ -47,7 +55,13 @@ export function upgradeProject(options) {
47
55
  replaced.push('sw-cache-buster.js');
48
56
  }
49
57
  for (const [name, render] of PLATFORM_GENERATED_FILES) {
50
- fs.writeFileSync(path.join(root, name), render());
58
+ const filePath = path.join(root, name);
59
+ // The skills nest two directories deep, and a project scaffolded before they existed — or
60
+ // before a newly added one existed — has no such directory. Without this, writeFileSync ENOENTs
61
+ // and the upgrade dies AFTER engine/ has already been replaced. mkdir on an existing directory
62
+ // is a no-op, so the flat entries pay nothing for it.
63
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
64
+ fs.writeFileSync(filePath, render());
51
65
  replaced.push(name);
52
66
  }
53
67
  // Read-modify-write, not re-rendered from renderBitmagicJson: re-rendering would discard any
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-project.js","sourceRoot":"","sources":["../../src/scaffold/upgrade-project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAiBvE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,cAAc,CAAC,OAAuB;IACpD,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAC5D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;QAClD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC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AG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvC,0FAA0F;QAC1F,gGAAgG;QAChG,+FAA+F;QAC/F,sDAAsD;QACtD,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACrC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAED,6FAA6F;IAC7F,8FAA8F;IAC9F,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAC1D,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAA4B,CAAC;IAC/F,MAAM,qBAAqB,GAAG,OAAO,IAAI,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/F,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACnC,EAAE,CAAC,aAAa,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACzE,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAE/B,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CAAC;AAC5D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitmagic/cli",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "Build Bitmagic games from your own agent tool",
5
5
  "type": "module",
6
6
  "bin": {
@@ -19,7 +19,7 @@
19
19
  "citty": "^0.2.2",
20
20
  "playwright-core": "^1.59.1",
21
21
  "tar": "^7.4.3",
22
- "@bitmagic/asset-core": "0.1.0",
22
+ "@bitmagic/asset-core": "0.1.1",
23
23
  "@bitmagic/world-forger": "0.1.3"
24
24
  },
25
25
  "devDependencies": {