@bitmagic/cli 0.1.61 → 0.1.62-dev.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.
- package/README.md +27 -3
- package/assets/unity-import/README.md +13 -0
- package/assets/unity-import/blender_build.py +462 -0
- package/assets/unity-import/build_parts.py +263 -0
- package/assets/unity-import/convert_assets.py +193 -0
- package/assets/unity-import/fbx_ascii.py +156 -0
- package/assets/unity-import/fbx_axis.py +174 -0
- package/assets/unity-import/fbx_bounds.py +202 -0
- package/assets/unity-import/import_config.py +86 -0
- package/assets/unity-import/level_patches.example.json +23 -0
- package/assets/unity-import/mesh_walls.py +78 -0
- package/assets/unity-import/render_topdown.py +33 -0
- package/assets/unity-import/unity-import.example.json +27 -0
- package/assets/unity-import/unity_assets.py +114 -0
- package/assets/unity-import/unity_colliders2d.py +127 -0
- package/assets/unity-import/unity_extract.py +774 -0
- package/assets/unity-import/unity_markers.py +249 -0
- package/assets/unity-import/unity_renderers.py +279 -0
- package/assets/unity-import/write_arena_data.py +198 -0
- package/dist/cli.d.ts +12 -0
- package/dist/commands/import.d.ts +4 -0
- package/dist/commands/import.js +5 -0
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.js +20 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/upgrade.d.ts +4 -0
- package/dist/commands/upgrade.js +31 -5
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/editor/server.js +3 -3
- package/dist/editor/shell-page.js +16 -1
- package/dist/editor/shell-page.js.map +1 -1
- package/dist/project/context.d.ts +9 -0
- package/dist/project/context.js +4 -1
- package/dist/project/context.js.map +1 -1
- package/dist/scaffold/agent-targets.d.ts +126 -0
- package/dist/scaffold/agent-targets.js +180 -0
- package/dist/scaffold/agent-targets.js.map +1 -0
- package/dist/scaffold/agents-md.d.ts +4 -1
- package/dist/scaffold/agents-md.js +6 -2
- package/dist/scaffold/agents-md.js.map +1 -1
- package/dist/scaffold/project-files.d.ts +40 -5
- package/dist/scaffold/project-files.js +67 -25
- package/dist/scaffold/project-files.js.map +1 -1
- package/dist/scaffold/project.d.ts +42 -15
- package/dist/scaffold/project.js +100 -38
- package/dist/scaffold/project.js.map +1 -1
- package/dist/scaffold/reference-guidance.d.ts +1 -1
- package/dist/scaffold/reference-guidance.js +2 -1
- package/dist/scaffold/reference-guidance.js.map +1 -1
- package/dist/scaffold/skill-files.d.ts +32 -9
- package/dist/scaffold/skill-files.js +71 -15
- package/dist/scaffold/skill-files.js.map +1 -1
- package/dist/scaffold/unity-skill-files.d.ts +30 -0
- package/dist/scaffold/unity-skill-files.js +474 -0
- package/dist/scaffold/unity-skill-files.js.map +1 -0
- package/dist/scaffold/upgrade-project.d.ts +31 -11
- package/dist/scaffold/upgrade-project.js +35 -23
- package/dist/scaffold/upgrade-project.js.map +1 -1
- package/package.json +4 -4
|
@@ -2,6 +2,7 @@ import { FAVICON_LINK_ID } from '@bitmagic/asset-core/favicon';
|
|
|
2
2
|
import { tsconfigPaths, importMapEntries, viteAliasEntries } from './aliases.js';
|
|
3
3
|
import { currentPortLane } from '../port-lane.js';
|
|
4
4
|
import { AGENTS_MD_REFERENCE_SECTION, GAME_DESIGN_REFERENCE_HINT, GENERATE_SKILL_REFERENCE_SECTION, PLANNING_SKILL_REFERENCE_STEP1, PLANNING_SKILL_REFERENCE_STEP4, } from './reference-guidance.js';
|
|
5
|
+
import { ALWAYS_AGENTS, PRIMARY_SKILLS_DIR, joinWithAnd, skillDirsFor, } from './agent-targets.js';
|
|
5
6
|
/**
|
|
6
7
|
* The legal notice stamped into every game this project publishes.
|
|
7
8
|
*
|
|
@@ -325,8 +326,28 @@ ${renderAliasEntries()}
|
|
|
325
326
|
}
|
|
326
327
|
},
|
|
327
328
|
server: {
|
|
328
|
-
port: 3001
|
|
329
|
-
|
|
329
|
+
port: 3001,
|
|
330
|
+
watch: {
|
|
331
|
+
// Vite leaves build.outDir out of its file watcher, but this project SERVES its outDir:
|
|
332
|
+
// every module the browser loads is a tsc emit under dist/. Unwatched, Vite's transform
|
|
333
|
+
// cache keeps serving the PREVIOUS emit after a rebuild until the dev server restarts —
|
|
334
|
+
// edits look like they did nothing. A negated pattern beats Vite's built-in ignore.
|
|
335
|
+
ignored: ['!**/dist/**']
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
plugins: [
|
|
339
|
+
{
|
|
340
|
+
// Watching dist/ makes each emit invalidate the stale transform (see server.watch above),
|
|
341
|
+
// but it would also have Vite full-reload the page on the FIRST emitted file of a compile
|
|
342
|
+
// — mid-emit, half the build still old. bitmagic dev reloads the browser itself once the
|
|
343
|
+
// compile lands clean, so Vite's own reaction is swallowed here. The invalidation is not:
|
|
344
|
+
// the module graph is told about the change before this hook runs.
|
|
345
|
+
name: 'bitmagic:defer-dist-reloads',
|
|
346
|
+
handleHotUpdate(context) {
|
|
347
|
+
if (context.file.includes('/dist/')) return [];
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
]
|
|
330
351
|
});
|
|
331
352
|
`;
|
|
332
353
|
}
|
|
@@ -652,10 +673,27 @@ rather than version warnings — so run \`self-update\` before debugging a comma
|
|
|
652
673
|
strangely. If \`bitmagic.json\` ever disagrees with this paragraph, the file is right. The engine is a
|
|
653
674
|
separate command: \`bitmagic upgrade\`.`;
|
|
654
675
|
}
|
|
655
|
-
|
|
676
|
+
/**
|
|
677
|
+
* `skillDirs` is every skills directory this project holds, in `skillDirsFor` order. It is a
|
|
678
|
+
* parameter for the same reason `environment` is (see `agents-md.ts`): this file has to describe
|
|
679
|
+
* the project it is written into, and a Kiro project holds a directory a default one does not.
|
|
680
|
+
*
|
|
681
|
+
* Cross-references name `PRIMARY_SKILLS_DIR` rather than the reader's own directory, because this
|
|
682
|
+
* is ONE file read by every agent in the project and it has to pick a path that exists in all of
|
|
683
|
+
* them. The Layout section names the rest, so a Claude Code reader still learns where its own
|
|
684
|
+
* loader looks.
|
|
685
|
+
*/
|
|
686
|
+
export function renderAgentsMd(environment, skillDirs = skillDirsFor(ALWAYS_AGENTS)) {
|
|
656
687
|
// The port this CLI would bind, so the doc it writes into the project matches the CLI that wrote
|
|
657
688
|
// it. A dev-line and a release-line install serve the shell on different numbers (port-lane.ts).
|
|
658
689
|
const editorPort = currentPortLane().editorPort;
|
|
690
|
+
// Built outside the literal: a nested template literal inside `${}` in a file that escapes every
|
|
691
|
+
// backtick is the one place that escaping reliably goes wrong.
|
|
692
|
+
const mirrors = skillDirs.filter((dir) => dir !== PRIMARY_SKILLS_DIR).map((dir) => '`' + dir + '/`');
|
|
693
|
+
const mirrorClause = mirrors.length === 0
|
|
694
|
+
? ''
|
|
695
|
+
: '\n Agents disagree on where project skills live, so the same files are also written to' +
|
|
696
|
+
`\n ${joinWithAnd(mirrors)}; cite the path above and every agent can open it.`;
|
|
659
697
|
return `# Working on this Bitmagic game
|
|
660
698
|
|
|
661
699
|
## Start \`bitmagic dev\` before you build anything
|
|
@@ -678,7 +716,7 @@ lists each generation with your prompt and progress, and they can move objects i
|
|
|
678
716
|
and screenshot a problem straight to you. Started at the end, all of that is a server nobody
|
|
679
717
|
needed — a game that appeared in one silent hour is worth less than a rough one they watched
|
|
680
718
|
arrive, because they could not steer the first. If they ask about their phone, restart with
|
|
681
|
-
\`--mobile\` (
|
|
719
|
+
\`--mobile\` (\`${PRIMARY_SKILLS_DIR}/working-with-the-creator/SKILL.md\` has the QR and the certificate
|
|
682
720
|
warning).
|
|
683
721
|
|
|
684
722
|
If you are unsure whether one is already running, \`bitmagic reload\` says so and costs nothing.
|
|
@@ -705,15 +743,19 @@ If you are unsure whether one is already running, \`bitmagic reload\` says so an
|
|
|
705
743
|
in what order.** Both yours to write and rewrite; \`bitmagic cover\` reads the first. Both are
|
|
706
744
|
excluded from the publish fingerprint, so revising them never invalidates a passing
|
|
707
745
|
\`bitmagic verify\`.
|
|
708
|
-
-
|
|
709
|
-
current with it. Every one is plain markdown at
|
|
710
|
-
whether or not your harness loads skills by
|
|
711
|
-
\`finding-engine-apis/\` (engine docs),
|
|
712
|
-
\`
|
|
713
|
-
\`
|
|
714
|
-
-
|
|
715
|
-
|
|
716
|
-
|
|
746
|
+
- \`${PRIMARY_SKILLS_DIR}/\` — **shipped by the CLI and re-rendered by \`bitmagic upgrade\`**, so
|
|
747
|
+
they stay current with it. Every one is plain markdown at
|
|
748
|
+
\`${PRIMARY_SKILLS_DIR}/<name>/SKILL.md\`, readable whether or not your harness loads skills by
|
|
749
|
+
itself: \`planning-a-game/\` (what to build first), \`finding-engine-apis/\` (engine docs),
|
|
750
|
+
\`generating-assets/\`, \`working-with-the-creator/\`, \`theming-the-hud/\`,
|
|
751
|
+
\`publishing-a-game/\`, \`judging-quality/\`, \`checking-usage/\`, \`making-a-trailer/\`,
|
|
752
|
+
\`converting-unity-levels/\`.${mirrorClause}
|
|
753
|
+
\`upgrade\` rewrites every copy, so edits to them are lost; skills you add yourself are never
|
|
754
|
+
touched.
|
|
755
|
+
- \`.claude/settings.json\` — **Claude Code only, and yours**: seeded with one Stop hook that runs
|
|
756
|
+
\`bitmagic reload\` so the owner's browser refreshes when you finish a turn. \`upgrade\` adds that
|
|
757
|
+
hook if it is missing and changes nothing else, so your permissions and your own hooks are safe
|
|
758
|
+
here. No other agent has a verified equivalent, so on those you run \`bitmagic reload\` yourself.
|
|
717
759
|
- \`AGENTS.md\` — this file. Yours to edit; \`upgrade\` refreshes it only while it is byte-identical
|
|
718
760
|
to what the CLI wrote, and otherwise keeps yours and drops the current template in
|
|
719
761
|
\`.bitmagic/AGENTS.md.latest\`. **If you edit this file, diff that after an upgrade** — new CLI
|
|
@@ -755,7 +797,7 @@ things you would do next, in order. Let them choose. Do not publish unless they
|
|
|
755
797
|
|
|
756
798
|
The full contract — what counts as a core verb, what the engine already ships so you never build it,
|
|
757
799
|
the \`mechanics-plan.md\` skeleton, and the loop after slice 1 — is in
|
|
758
|
-
|
|
800
|
+
\`${PRIMARY_SKILLS_DIR}/planning-a-game/SKILL.md\`.
|
|
759
801
|
|
|
760
802
|
## Finding an engine API
|
|
761
803
|
|
|
@@ -768,7 +810,7 @@ and read the group doc it lands in, with \`engine-api.md\` indexing the 45 group
|
|
|
768
810
|
**\`engine/\` source**, last resort. \`@docs foo.md\` in those docs means
|
|
769
811
|
\`engine/agent-docs/foo.md\` — just read the file.
|
|
770
812
|
|
|
771
|
-
|
|
813
|
+
\`${PRIMARY_SKILLS_DIR}/finding-engine-apis/SKILL.md\` carries the feature-to-doc table (use it instead of
|
|
772
814
|
guessing filenames) and translates the hosted-agent tools those shared docs name, none of which
|
|
773
815
|
exist here.
|
|
774
816
|
|
|
@@ -882,7 +924,7 @@ judge of it. After each milestone run \`bitmagic verify\` (not \`--fast\`), then
|
|
|
882
924
|
a separate vision model grades the screenshot against \`GAME-DESIGN.md\` and prints at most three
|
|
883
925
|
concrete findings (also written to \`.bitmagic/judge.json\`). Fix the ones worth fixing, confirm
|
|
884
926
|
with one re-run, then move on — **never loop on the judge**. See
|
|
885
|
-
|
|
927
|
+
\`${PRIMARY_SKILLS_DIR}/judging-quality/SKILL.md\`.
|
|
886
928
|
|
|
887
929
|
## The human may be moving objects too
|
|
888
930
|
|
|
@@ -905,7 +947,7 @@ where they click an object and drag a gizmo. A drag writes the new transform str
|
|
|
905
947
|
\`bitmagic generate prop\` command to run on their behalf.
|
|
906
948
|
|
|
907
949
|
The event shapes, the rest of the editor protocol and \`bitmagic dev --mobile\` are in
|
|
908
|
-
|
|
950
|
+
\`${PRIMARY_SKILLS_DIR}/working-with-the-creator/SKILL.md\`.
|
|
909
951
|
|
|
910
952
|
## Publishing
|
|
911
953
|
|
|
@@ -936,7 +978,7 @@ unguessable) URL.** Credential-shaped files (\`.env*\`, \`*.pem\`, \`*.key\`, \`
|
|
|
936
978
|
service-account JSON) are excluded and named in the output, but that list cannot be exhaustive —
|
|
937
979
|
so never keep a secret in this directory.
|
|
938
980
|
|
|
939
|
-
|
|
981
|
+
\`${PRIMARY_SKILLS_DIR}/publishing-a-game/SKILL.md\` has the rest, and you want it before you publish:
|
|
940
982
|
what the thumbnail comes from, category tags, \`--force\` and the one-shot \`--name\`/
|
|
941
983
|
\`--description\`, the post-publish render smoke test, and the exit-code table to branch on when
|
|
942
984
|
publish exits non-zero rather than parsing its message.
|
|
@@ -948,7 +990,7 @@ value: \`worldProfileData.hud.theme\` in \`src/work/world.json\`. **Never restyl
|
|
|
948
990
|
game code to satisfy a look request** ("rounder buttons", "orange UI", "neon glow"); use
|
|
949
991
|
\`bitmagic theme patch\` / \`set\` / \`show\` / \`check\` and read
|
|
950
992
|
\`engine/agent-docs/HUD_THEMES.md\` — its Common-asks table has a copyable patch for every frequent
|
|
951
|
-
request.
|
|
993
|
+
request. \`${PRIMARY_SKILLS_DIR}/theming-the-hud/SKILL.md\` covers the loop, including verifying with
|
|
952
994
|
\`.bitmagic/verify/screenshot.png\`.
|
|
953
995
|
|
|
954
996
|
## Generating assets
|
|
@@ -985,7 +1027,7 @@ Two things before you use them:
|
|
|
985
1027
|
Three lanes make a 3D object, and the wrong one wastes a generation: \`generate model\` mints a NEW
|
|
986
1028
|
asset, \`generate prop --asset <id>\` UPGRADES a placeholder, \`assets add <file>\` uploads your own.
|
|
987
1029
|
Splats, video and \`.vox\`/\`.fbx\` still need the web editor; never reference an asset you did not
|
|
988
|
-
make.
|
|
1030
|
+
make. \`${PRIMARY_SKILLS_DIR}/generating-assets/SKILL.md\` has the flags, the reference-image rules, what
|
|
989
1031
|
to do after a generation, and every way one refuses.
|
|
990
1032
|
|
|
991
1033
|
## Forging a whole level
|
|
@@ -1024,7 +1066,7 @@ ${renderCliUpdateSection(environment)}
|
|
|
1024
1066
|
`;
|
|
1025
1067
|
}
|
|
1026
1068
|
/**
|
|
1027
|
-
*
|
|
1069
|
+
* `<skills dir>/planning-a-game/SKILL.md` — the slice contract and the mechanic-recipe routing.
|
|
1028
1070
|
*
|
|
1029
1071
|
* These are one skill rather than two on purpose: you route to a recipe *in order to* scope slice
|
|
1030
1072
|
* 1, and slice 1 is the first section of the plan file the recipe tells you to write. Split, the
|
|
@@ -1183,7 +1225,7 @@ ${PLANNING_SKILL_REFERENCE_STEP4}4. \`bitmagic cover\` — **now**, not later. I
|
|
|
1183
1225
|
6. Write the code. Look up APIs with the \`finding-engine-apis\` skill; do not read engine source to
|
|
1184
1226
|
find out what exists.
|
|
1185
1227
|
7. \`bitmagic check\` until green.
|
|
1186
|
-
8. \`bitmagic reload\` (the Stop hook in \`.claude/settings.json\` does this for you).
|
|
1228
|
+
8. \`bitmagic reload\` (in Claude Code the Stop hook in \`.claude/settings.json\` does this for you).
|
|
1187
1229
|
9. \`bitmagic verify\` — it boots the game in a real browser and clicks Play. A clean \`check\` is
|
|
1188
1230
|
not evidence the game runs.
|
|
1189
1231
|
10. Report (below). Publish only if they ask.
|
|
@@ -1225,7 +1267,7 @@ code.
|
|
|
1225
1267
|
`;
|
|
1226
1268
|
}
|
|
1227
1269
|
/**
|
|
1228
|
-
*
|
|
1270
|
+
* `<skills dir>/finding-engine-apis/SKILL.md` — the discovery protocol in full.
|
|
1229
1271
|
*
|
|
1230
1272
|
* The problem this exists to solve is measured, not hypothetical. game-play-agent's
|
|
1231
1273
|
* engine-api-digest.ts opens with it: session analysis showed the hosted coding agent spending most
|
|
@@ -1529,7 +1571,7 @@ fail to load it.
|
|
|
1529
1571
|
`;
|
|
1530
1572
|
}
|
|
1531
1573
|
/**
|
|
1532
|
-
*
|
|
1574
|
+
* `<skills dir>/checking-usage/SKILL.md` — what the creator's sparks bought.
|
|
1533
1575
|
*
|
|
1534
1576
|
* Exists because the agent is what spends the money and the human is what pays
|
|
1535
1577
|
* for it. Before this, the only way to learn a balance was to be REFUSED one:
|
|
@@ -1602,7 +1644,7 @@ per-invoice view, the plan page on the web is the source of truth.
|
|
|
1602
1644
|
`;
|
|
1603
1645
|
}
|
|
1604
1646
|
/**
|
|
1605
|
-
*
|
|
1647
|
+
* `<skills dir>/judging-quality/SKILL.md` — when and how to run `bitmagic judge`.
|
|
1606
1648
|
*
|
|
1607
1649
|
* The point the skill has to land is the discipline, not the mechanics: judge after milestones,
|
|
1608
1650
|
* fix the findings, confirm once, stop. An agent that loops on the judge is spending the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/scaffold/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"project-files.js","sourceRoot":"","sources":["../../src/scaffold/project-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,YAAY,GAEb,MAAM,oBAAoB,CAAC;AAK5B;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;IAkBnC,CAAC;AAEL;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,2BAA2B,EAAE,SAAS;IACtC,2BAA2B,EAAE,SAAS;IACtC,kBAAkB,EAAE,QAAQ;IAC5B,MAAM,EAAE,QAAQ;IA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CAY3B,CAAC;AACF,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCR,CAAC;AACF,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type ProjectMetadata } from './project-files.js';
|
|
1
|
+
import { type ProjectMetadata, type SkillRenderer } from './project-files.js';
|
|
2
|
+
import { type AgentId } from './agent-targets.js';
|
|
2
3
|
export interface TemplateEntry {
|
|
3
4
|
id: string;
|
|
4
5
|
genre: string;
|
|
@@ -68,6 +69,17 @@ export declare const OPTIONAL_VENDORED_DIRS: string[];
|
|
|
68
69
|
* there as soon as the project moves to a version that ships it. See docs/engine-license.md.
|
|
69
70
|
*/
|
|
70
71
|
export declare const OPTIONAL_VENDORED_FILES: string[];
|
|
72
|
+
/**
|
|
73
|
+
* Throws unless the extracted tree carries every VENDORED_DIRS entry.
|
|
74
|
+
*
|
|
75
|
+
* Shared by `vendorEngine` and `upgradeProject` so the two cannot come to disagree on what counts
|
|
76
|
+
* as a complete tarball, or word the same failure two ways. Both run it as a pass of its own,
|
|
77
|
+
* BEFORE anything is written: for `upgradeProject` that ordering is load-bearing — it clears a
|
|
78
|
+
* live project's engine/ before copying, so validating inside the copy loop would demolish the
|
|
79
|
+
* tree and then fail partway through repopulating it — and for a brand new project it costs
|
|
80
|
+
* nothing.
|
|
81
|
+
*/
|
|
82
|
+
export declare function assertEngineBundleComplete(extractedEngineDir: string): void;
|
|
71
83
|
/**
|
|
72
84
|
* Copies every OPTIONAL_VENDORED_DIRS / OPTIONAL_VENDORED_FILES entry the extracted tree happens
|
|
73
85
|
* to carry into the project's `engine/`, and silently skips the ones it does not.
|
|
@@ -92,18 +104,14 @@ export declare function copyServiceWorker(extractedEngineDir: string, root: stri
|
|
|
92
104
|
/**
|
|
93
105
|
* Writes one file into a project, creating its parent directories first.
|
|
94
106
|
*
|
|
95
|
-
* The mkdir is load-bearing for the nested entries —
|
|
107
|
+
* The mkdir is load-bearing for the nested entries — `<skills dir>/<name>/SKILL.md` — in a
|
|
96
108
|
* project that predates them: without it `writeFileSync` ENOENTs, and in `upgradeProject` it does
|
|
97
109
|
* so AFTER `engine/` has been replaced, leaving the project half-upgraded. mkdir on an existing
|
|
98
110
|
* directory is a no-op, so the top-level entries pay nothing for it.
|
|
99
111
|
*/
|
|
100
112
|
export declare function writeProjectFile(root: string, relativePath: string, contents: string): void;
|
|
101
113
|
/**
|
|
102
|
-
*
|
|
103
|
-
* from these renderers with no creator content ever entering them. `bitmagic upgrade` overwrites
|
|
104
|
-
* exactly this list (plus bitmagic.json, handled separately since only its engineVersion field is
|
|
105
|
-
* platform-owned, and engine/ + sw-cache-buster.js, handled separately since they are copied, not
|
|
106
|
-
* rendered).
|
|
114
|
+
* Every skill this CLI deploys, ONCE, as a path relative to a skills directory.
|
|
107
115
|
*
|
|
108
116
|
* **Every skill this CLI deploys belongs here.** A skill documents what the CLI can do — not the
|
|
109
117
|
* creator's game — so a project stuck on the version that shipped with its scaffold is a project
|
|
@@ -112,21 +120,40 @@ export declare function writeProjectFile(root: string, relativePath: string, con
|
|
|
112
120
|
* commands was written once at init and never revisited. Whatever we add next would repeat it.
|
|
113
121
|
* Add a new skill to this list and existing projects receive it on their next `bitmagic upgrade`.
|
|
114
122
|
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
123
|
+
* Relative rather than rooted because a project holds more than one copy: agents do not agree on
|
|
124
|
+
* where project skills live, and `agent-targets.ts` argues why every one of them gets a real copy
|
|
125
|
+
* rather than a symlink or a single directory nobody all reads. The bodies are agent-independent —
|
|
126
|
+
* only `renderSkillsReadme` differs per directory, which is why the renderer signature takes the
|
|
127
|
+
* directory rather than each renderer being written twice.
|
|
128
|
+
*/
|
|
129
|
+
export declare const SHIPPED_SKILLS: Array<[string, SkillRenderer]>;
|
|
130
|
+
/**
|
|
131
|
+
* The platform-generated files that are not skills, and so sit at one fixed path whatever agents
|
|
132
|
+
* the project is set up for.
|
|
133
|
+
*/
|
|
134
|
+
export declare const PLATFORM_CONFIG_FILES: Array<[string, () => string]>;
|
|
135
|
+
/**
|
|
136
|
+
* The generated files that are pure platform output: regenerated byte-for-byte from these
|
|
137
|
+
* renderers with no creator content ever entering them. `bitmagic upgrade` overwrites exactly this
|
|
138
|
+
* list (plus bitmagic.json, handled separately since only its engineVersion field is
|
|
139
|
+
* platform-owned, and engine/ + sw-cache-buster.js, handled separately since they are copied, not
|
|
140
|
+
* rendered).
|
|
141
|
+
*
|
|
142
|
+
* Only the paths named here are rewritten; anything else under a skills directory — a skill the
|
|
143
|
+
* creator wrote themselves — is never opened. The trade is deliberate and one-directional: an edit
|
|
144
|
+
* to one of OUR skill files is lost on upgrade, which is the price of those files staying current.
|
|
118
145
|
*
|
|
119
146
|
* Deliberately excludes package.json (creators add dependencies to it), AGENTS.md/CLAUDE.md and
|
|
120
147
|
* GAME-DESIGN.md (the creator's own guidance and design — ours to seed once, theirs to own), and
|
|
121
148
|
* .gitignore (same reasoning) — those are generated once by `scaffoldProject` but are creator-owned
|
|
122
149
|
* from that point on.
|
|
123
150
|
*
|
|
124
|
-
*
|
|
125
|
-
* that can drift — the exact failure that motivated
|
|
126
|
-
* to init's inline list with no equivalent path for
|
|
127
|
-
* `upgrade` didn't exist yet.
|
|
151
|
+
* A function rather than a constant so `scaffoldProject` and `upgradeProject` still share one
|
|
152
|
+
* definition instead of two lists that can drift — the exact failure that motivated the constant it
|
|
153
|
+
* replaced: `vite.publish.config.js` was added to init's inline list with no equivalent path for
|
|
154
|
+
* existing projects to ever receive it, because `upgrade` didn't exist yet.
|
|
128
155
|
*/
|
|
129
|
-
export declare
|
|
156
|
+
export declare function platformGeneratedFiles(agents?: readonly AgentId[]): Array<[string, () => string]>;
|
|
130
157
|
/**
|
|
131
158
|
* Every template the downloaded bundle carries, in index order.
|
|
132
159
|
*
|
package/dist/scaffold/project.js
CHANGED
|
@@ -3,7 +3,9 @@ import * as path from 'path';
|
|
|
3
3
|
import { CliError } from '../errors.js';
|
|
4
4
|
import { aliasSourceDir } from './aliases.js';
|
|
5
5
|
import { renderPackageJson, renderTsconfig, renderIndexHtml, renderViteConfig, renderVitePublishConfig, renderVitePublishStandaloneConfig, renderGitignore, renderBitmagicJson, renderAgentsMd, renderGameDesignMd, renderClaudeMd, renderJudgeSkill, renderThemingSkill, renderGenerateSkill, renderPlanningSkill, renderEngineApiSkill, renderUsageSkill, } from './project-files.js';
|
|
6
|
-
import { renderCreatorCollaborationSkill, renderPublishingSkill, renderSkillsReadme, renderTrailerSkill, } from './skill-files.js';
|
|
6
|
+
import { renderCreatorCollaborationSkill, renderPublishingSkill, renderKiroSteering, renderSkillsReadme, renderTrailerSkill, } from './skill-files.js';
|
|
7
|
+
import { renderUnityLevelsSkill, renderUnityLevelsTrapsReference, renderUnityLevelsFbxReference, renderUnityLevelsPhysicsReference, renderUnityLevelsVerificationReference, } from './unity-skill-files.js';
|
|
8
|
+
import { ALWAYS_AGENTS, dedupeAgents, skillDirsFor } from './agent-targets.js';
|
|
7
9
|
import { hashAgentsMd } from './agents-md.js';
|
|
8
10
|
import { CLAUDE_SETTINGS_FILE, renderClaudeSettings } from './claude-settings.js';
|
|
9
11
|
/**
|
|
@@ -76,6 +78,24 @@ export const OPTIONAL_VENDORED_DIRS = ['agent-docs'];
|
|
|
76
78
|
* there as soon as the project moves to a version that ships it. See docs/engine-license.md.
|
|
77
79
|
*/
|
|
78
80
|
export const OPTIONAL_VENDORED_FILES = ['LICENSE.md', 'THIRD-PARTY-NOTICES.md'];
|
|
81
|
+
/**
|
|
82
|
+
* Throws unless the extracted tree carries every VENDORED_DIRS entry.
|
|
83
|
+
*
|
|
84
|
+
* Shared by `vendorEngine` and `upgradeProject` so the two cannot come to disagree on what counts
|
|
85
|
+
* as a complete tarball, or word the same failure two ways. Both run it as a pass of its own,
|
|
86
|
+
* BEFORE anything is written: for `upgradeProject` that ordering is load-bearing — it clears a
|
|
87
|
+
* live project's engine/ before copying, so validating inside the copy loop would demolish the
|
|
88
|
+
* tree and then fail partway through repopulating it — and for a brand new project it costs
|
|
89
|
+
* nothing.
|
|
90
|
+
*/
|
|
91
|
+
export function assertEngineBundleComplete(extractedEngineDir) {
|
|
92
|
+
for (const dir of VENDORED_DIRS) {
|
|
93
|
+
const source = path.join(extractedEngineDir, dir);
|
|
94
|
+
if (!fs.existsSync(source)) {
|
|
95
|
+
throw new CliError(`The engine bundle has no "${dir}" directory at ${source}. The tarball is incomplete or corrupt.`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
79
99
|
/**
|
|
80
100
|
* Copies every OPTIONAL_VENDORED_DIRS / OPTIONAL_VENDORED_FILES entry the extracted tree happens
|
|
81
101
|
* to carry into the project's `engine/`, and silently skips the ones it does not.
|
|
@@ -113,7 +133,7 @@ export function copyServiceWorker(extractedEngineDir, root) {
|
|
|
113
133
|
/**
|
|
114
134
|
* Writes one file into a project, creating its parent directories first.
|
|
115
135
|
*
|
|
116
|
-
* The mkdir is load-bearing for the nested entries —
|
|
136
|
+
* The mkdir is load-bearing for the nested entries — `<skills dir>/<name>/SKILL.md` — in a
|
|
117
137
|
* project that predates them: without it `writeFileSync` ENOENTs, and in `upgradeProject` it does
|
|
118
138
|
* so AFTER `engine/` has been replaced, leaving the project half-upgraded. mkdir on an existing
|
|
119
139
|
* directory is a no-op, so the top-level entries pay nothing for it.
|
|
@@ -124,11 +144,7 @@ export function writeProjectFile(root, relativePath, contents) {
|
|
|
124
144
|
fs.writeFileSync(filePath, contents);
|
|
125
145
|
}
|
|
126
146
|
/**
|
|
127
|
-
*
|
|
128
|
-
* from these renderers with no creator content ever entering them. `bitmagic upgrade` overwrites
|
|
129
|
-
* exactly this list (plus bitmagic.json, handled separately since only its engineVersion field is
|
|
130
|
-
* platform-owned, and engine/ + sw-cache-buster.js, handled separately since they are copied, not
|
|
131
|
-
* rendered).
|
|
147
|
+
* Every skill this CLI deploys, ONCE, as a path relative to a skills directory.
|
|
132
148
|
*
|
|
133
149
|
* **Every skill this CLI deploys belongs here.** A skill documents what the CLI can do — not the
|
|
134
150
|
* creator's game — so a project stuck on the version that shipped with its scaffold is a project
|
|
@@ -137,37 +153,83 @@ export function writeProjectFile(root, relativePath, contents) {
|
|
|
137
153
|
* commands was written once at init and never revisited. Whatever we add next would repeat it.
|
|
138
154
|
* Add a new skill to this list and existing projects receive it on their next `bitmagic upgrade`.
|
|
139
155
|
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
156
|
+
* Relative rather than rooted because a project holds more than one copy: agents do not agree on
|
|
157
|
+
* where project skills live, and `agent-targets.ts` argues why every one of them gets a real copy
|
|
158
|
+
* rather than a symlink or a single directory nobody all reads. The bodies are agent-independent —
|
|
159
|
+
* only `renderSkillsReadme` differs per directory, which is why the renderer signature takes the
|
|
160
|
+
* directory rather than each renderer being written twice.
|
|
161
|
+
*/
|
|
162
|
+
export const SHIPPED_SKILLS = [
|
|
163
|
+
['README.md', renderSkillsReadme],
|
|
164
|
+
['generating-assets/SKILL.md', renderGenerateSkill],
|
|
165
|
+
['planning-a-game/SKILL.md', renderPlanningSkill],
|
|
166
|
+
['finding-engine-apis/SKILL.md', renderEngineApiSkill],
|
|
167
|
+
['checking-usage/SKILL.md', renderUsageSkill],
|
|
168
|
+
['judging-quality/SKILL.md', renderJudgeSkill],
|
|
169
|
+
['theming-the-hud/SKILL.md', renderThemingSkill],
|
|
170
|
+
['making-a-trailer/SKILL.md', renderTrailerSkill],
|
|
171
|
+
['publishing-a-game/SKILL.md', renderPublishingSkill],
|
|
172
|
+
['working-with-the-creator/SKILL.md', renderCreatorCollaborationSkill],
|
|
173
|
+
['converting-unity-levels/SKILL.md', renderUnityLevelsSkill],
|
|
174
|
+
['converting-unity-levels/references/unity-scene-traps.md', renderUnityLevelsTrapsReference],
|
|
175
|
+
['converting-unity-levels/references/fbx-conversion.md', renderUnityLevelsFbxReference],
|
|
176
|
+
['converting-unity-levels/references/physics-and-shadows.md', renderUnityLevelsPhysicsReference],
|
|
177
|
+
['converting-unity-levels/references/verification.md', renderUnityLevelsVerificationReference],
|
|
178
|
+
];
|
|
179
|
+
/**
|
|
180
|
+
* Files a particular agent needs that are not skills, written only for a project that named it.
|
|
148
181
|
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
182
|
+
* Claude Code's two extras — `CLAUDE.md` and `.claude/settings.json` — are deliberately NOT here:
|
|
183
|
+
* one is creator-owned after seeding and the other is merged rather than overwritten, so both are
|
|
184
|
+
* handled by `writeProjectFiles` and `upgradeProject` directly. This table is for extras that are
|
|
185
|
+
* pure platform output, and Kiro's steering file is the only one so far.
|
|
153
186
|
*/
|
|
154
|
-
|
|
187
|
+
const AGENT_EXTRA_FILES = {
|
|
188
|
+
kiro: [['.kiro/steering/bitmagic.md', renderKiroSteering]],
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* The platform-generated files that are not skills, and so sit at one fixed path whatever agents
|
|
192
|
+
* the project is set up for.
|
|
193
|
+
*/
|
|
194
|
+
export const PLATFORM_CONFIG_FILES = [
|
|
155
195
|
['tsconfig.json', renderTsconfig],
|
|
156
196
|
['vite.config.js', renderViteConfig],
|
|
157
197
|
['vite.publish.config.js', renderVitePublishConfig],
|
|
158
198
|
['vite.publish-standalone.config.js', renderVitePublishStandaloneConfig],
|
|
159
199
|
['index.html', renderIndexHtml],
|
|
160
|
-
['.claude/skills/README.md', renderSkillsReadme],
|
|
161
|
-
['.claude/skills/generating-assets/SKILL.md', renderGenerateSkill],
|
|
162
|
-
['.claude/skills/planning-a-game/SKILL.md', renderPlanningSkill],
|
|
163
|
-
['.claude/skills/finding-engine-apis/SKILL.md', renderEngineApiSkill],
|
|
164
|
-
['.claude/skills/checking-usage/SKILL.md', renderUsageSkill],
|
|
165
|
-
['.claude/skills/judging-quality/SKILL.md', renderJudgeSkill],
|
|
166
|
-
['.claude/skills/theming-the-hud/SKILL.md', renderThemingSkill],
|
|
167
|
-
['.claude/skills/making-a-trailer/SKILL.md', renderTrailerSkill],
|
|
168
|
-
['.claude/skills/publishing-a-game/SKILL.md', renderPublishingSkill],
|
|
169
|
-
['.claude/skills/working-with-the-creator/SKILL.md', renderCreatorCollaborationSkill],
|
|
170
200
|
];
|
|
201
|
+
/**
|
|
202
|
+
* The generated files that are pure platform output: regenerated byte-for-byte from these
|
|
203
|
+
* renderers with no creator content ever entering them. `bitmagic upgrade` overwrites exactly this
|
|
204
|
+
* list (plus bitmagic.json, handled separately since only its engineVersion field is
|
|
205
|
+
* platform-owned, and engine/ + sw-cache-buster.js, handled separately since they are copied, not
|
|
206
|
+
* rendered).
|
|
207
|
+
*
|
|
208
|
+
* Only the paths named here are rewritten; anything else under a skills directory — a skill the
|
|
209
|
+
* creator wrote themselves — is never opened. The trade is deliberate and one-directional: an edit
|
|
210
|
+
* to one of OUR skill files is lost on upgrade, which is the price of those files staying current.
|
|
211
|
+
*
|
|
212
|
+
* Deliberately excludes package.json (creators add dependencies to it), AGENTS.md/CLAUDE.md and
|
|
213
|
+
* GAME-DESIGN.md (the creator's own guidance and design — ours to seed once, theirs to own), and
|
|
214
|
+
* .gitignore (same reasoning) — those are generated once by `scaffoldProject` but are creator-owned
|
|
215
|
+
* from that point on.
|
|
216
|
+
*
|
|
217
|
+
* A function rather than a constant so `scaffoldProject` and `upgradeProject` still share one
|
|
218
|
+
* definition instead of two lists that can drift — the exact failure that motivated the constant it
|
|
219
|
+
* replaced: `vite.publish.config.js` was added to init's inline list with no equivalent path for
|
|
220
|
+
* existing projects to ever receive it, because `upgrade` didn't exist yet.
|
|
221
|
+
*/
|
|
222
|
+
export function platformGeneratedFiles(agents = ALWAYS_AGENTS) {
|
|
223
|
+
const skillDirs = skillDirsFor(agents);
|
|
224
|
+
return [
|
|
225
|
+
...PLATFORM_CONFIG_FILES,
|
|
226
|
+
...dedupeAgents([...ALWAYS_AGENTS, ...agents]).flatMap((id) => AGENT_EXTRA_FILES[id] ?? []),
|
|
227
|
+
...skillDirs.flatMap((dir) => SHIPPED_SKILLS.map(([relativePath, render]) => [
|
|
228
|
+
`${dir}/${relativePath}`,
|
|
229
|
+
() => render({ skillsDir: dir, skillDirs }),
|
|
230
|
+
])),
|
|
231
|
+
];
|
|
232
|
+
}
|
|
171
233
|
/**
|
|
172
234
|
* Every template the downloaded bundle carries, in index order.
|
|
173
235
|
*
|
|
@@ -223,14 +285,11 @@ function copyContents(source, dest) {
|
|
|
223
285
|
* second place for that distinction to be got wrong.
|
|
224
286
|
*/
|
|
225
287
|
export function vendorEngine(extractedEngineDir, targetDir) {
|
|
288
|
+
assertEngineBundleComplete(extractedEngineDir);
|
|
226
289
|
const engineDir = path.join(targetDir, 'engine');
|
|
227
290
|
fs.mkdirSync(engineDir, { recursive: true });
|
|
228
291
|
for (const dir of VENDORED_DIRS) {
|
|
229
|
-
|
|
230
|
-
if (!fs.existsSync(source)) {
|
|
231
|
-
throw new CliError(`The engine bundle has no "${dir}" directory at ${source}. The tarball is incomplete or corrupt.`);
|
|
232
|
-
}
|
|
233
|
-
fs.cpSync(source, path.join(engineDir, dir), { recursive: true });
|
|
292
|
+
fs.cpSync(path.join(extractedEngineDir, dir), path.join(engineDir, dir), { recursive: true });
|
|
234
293
|
}
|
|
235
294
|
copyOptionalEngineEntries(extractedEngineDir, engineDir);
|
|
236
295
|
copyServiceWorker(extractedEngineDir, targetDir);
|
|
@@ -245,14 +304,17 @@ export function vendorEngine(extractedEngineDir, targetDir) {
|
|
|
245
304
|
*/
|
|
246
305
|
export function writeProjectFiles(options) {
|
|
247
306
|
const { targetDir, metadata, projectName, idea, gameDesign = 'render' } = options;
|
|
307
|
+
// The project's own declaration, so `bitmagic.json` and the file set on disk cannot disagree.
|
|
308
|
+
const agents = metadata.agents ?? ALWAYS_AGENTS;
|
|
248
309
|
// Stamped as it is written, so a later `bitmagic upgrade` can tell whether the creator has
|
|
249
310
|
// edited it since — see scaffold/agents-md.ts for what that decides. The pin goes in because the
|
|
250
311
|
// file tells the agent which npm line this project's CLI comes from, and that is the environment's
|
|
251
|
-
// answer, not a choice to put to the creator.
|
|
252
|
-
|
|
312
|
+
// answer, not a choice to put to the creator. The directory list goes in for the same reason: the
|
|
313
|
+
// file has to name the paths this project actually holds, not the ones the default would.
|
|
314
|
+
const agentsMd = renderAgentsMd(metadata.environment, skillDirsFor(agents));
|
|
253
315
|
const files = [
|
|
254
316
|
['package.json', renderPackageJson(projectName)],
|
|
255
|
-
...
|
|
317
|
+
...platformGeneratedFiles(agents).map(([name, render]) => [name, render()]),
|
|
256
318
|
['bitmagic.json', renderBitmagicJson({ ...metadata, agentsMdHash: hashAgentsMd(agentsMd) })],
|
|
257
319
|
['AGENTS.md', agentsMd],
|
|
258
320
|
// Creator-owned from here on (see PLATFORM_GENERATED_FILES): the agent rewrites it as the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/scaffold/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,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,iCAAiC,EACjC,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/scaffold/project.ts"],"names":[],"mappings":"AAAA,OAA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Q,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEvG,YAAY,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;IAE5C,4FAA4F;IAC5F,yFAAyF;IACzF,6FAA6F;IAC7F,4EAA4E;IAC5E,EAAE;IACF,4FAA4F;IAC5F,8FAA8F;IAC9F,wFAAwF;IACxF,sCAAsC;IACtC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,QAAQ,CAAC,gDAAgD,QAAQ,CAAC,KAAK,IAAI,CAAC,CAAC;IACzF,CAAC;IACD,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE/B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IAClE,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,iBAAiB,CAAC;QAChB,SAAS;QACT,QAAQ;QACR,WAAW;QACX,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACxC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* markdown, so backticks are escaped exactly as project-files.ts escapes them.
|
|
10
10
|
*/
|
|
11
11
|
/** The `## Reference image` section of the scaffolded AGENTS.md, placed before the cover section. */
|
|
12
|
-
export declare const AGENTS_MD_REFERENCE_SECTION = "## Reference image \u2014 offer it when the idea has a strong setting\n\nWhen the idea names a **place or a look** \u2014 a tropical island, a neon city \u2014 offer to make a\nconcept image of the world before generating anything else:\n\n```\nbitmagic reference make # a candidate lands in .bitmagic/reference/\nbitmagic reference make --from <id> --prompt \"same island, but at dusk\"\nbitmagic reference accept <id> # the human's call, never yours\n```\n\nShow the human each image file and let THEM iterate and accept. Once accepted, it is the default\nstyle reference for `generate skybox|background|block-type|image`, `bitmagic cover` and\n`bitmagic forge` (whose designer literally sees the picture) \u2014 one look across the whole game;\n`--no-reference` exempts a call, and a picture the human hands you for ONE request rides that\ncall as `--reference-image <file>` instead. Accepting prints a durable URL: paste it into\n`GAME-DESIGN.md`'s world/look section, since `.bitmagic/` is not committed and\n`bitmagic reference accept <url>` is how a fresh clone gets it back. Details are in\n`.
|
|
12
|
+
export declare const AGENTS_MD_REFERENCE_SECTION = "## Reference image \u2014 offer it when the idea has a strong setting\n\nWhen the idea names a **place or a look** \u2014 a tropical island, a neon city \u2014 offer to make a\nconcept image of the world before generating anything else:\n\n```\nbitmagic reference make # a candidate lands in .bitmagic/reference/\nbitmagic reference make --from <id> --prompt \"same island, but at dusk\"\nbitmagic reference accept <id> # the human's call, never yours\n```\n\nShow the human each image file and let THEM iterate and accept. Once accepted, it is the default\nstyle reference for `generate skybox|background|block-type|image`, `bitmagic cover` and\n`bitmagic forge` (whose designer literally sees the picture) \u2014 one look across the whole game;\n`--no-reference` exempts a call, and a picture the human hands you for ONE request rides that\ncall as `--reference-image <file>` instead. Accepting prints a durable URL: paste it into\n`GAME-DESIGN.md`'s world/look section, since `.bitmagic/` is not committed and\n`bitmagic reference accept <url>` is how a fresh clone gets it back. Details are in\n`.agents/skills/generating-assets/SKILL.md`; skip the offer when the idea has no visual identity\nyet.\n\n";
|
|
13
13
|
/** The planning skill's step-1 paragraph on offering a reference image. */
|
|
14
14
|
export declare const PLANNING_SKILL_REFERENCE_STEP1 = "If the idea describes a **place** \u2014 an island, a city, a specific look \u2014 offer a reference image\nbefore anything else is generated: `bitmagic reference make`, show the human the file it prints,\niterate with `--from <id>`, and run `accept` only when they choose one. Every skybox, block,\ncover and forge after that inherits the accepted image, so it is worth settling first \u2014 and worth\nskipping when the idea has no visual identity yet.\n\n";
|
|
15
15
|
/** The planning skill's step-4 list entry (rendered between the design-doc and cover steps). */
|