spawnpack 0.1.4 → 0.1.5

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 CHANGED
@@ -16,10 +16,11 @@ It generates BP/RP structure, optional Script API setup, optional rgl integratio
16
16
  - `@minecraft/math`
17
17
  - Optional `rgl` setup for faster Bedrock builds
18
18
  - Optional marketplace add-on structure using nested `namespace/projectId` folders in BP/RP content directories
19
- - Optional Rockide recommendation during setup
20
- - Optional AI setup:
21
- - `CLAUDE.md`
22
- - `.mcp.json`
19
+ - Optional Rockide recommendation during setup
20
+ - Optional AI setup:
21
+ - `CLAUDE.md` for Claude
22
+ - `AGENTS.md` for Other
23
+ - `.mcp.json`
23
24
 
24
25
  ## Runtime Requirement
25
26
 
@@ -78,7 +79,7 @@ The wizard walks through:
78
79
  6. Script packages
79
80
  7. `rgl` toggle
80
81
  8. Rockide toggle
81
- 9. AI setup toggle
82
+ 9. AI setup choice (`None`, `Claude`, or `Other`)
82
83
  10. Review screen and generation
83
84
 
84
85
  ## Generated project options
@@ -92,9 +93,10 @@ Depending on your choices, Spawnpack can generate:
92
93
  - `package.json`
93
94
  - `tsconfig.json`
94
95
  - `dprint.json`
95
- - `config.json` for `rgl`
96
- - `CLAUDE.md`
97
- - `.mcp.json`
96
+ - `config.json` for `rgl`
97
+ - `CLAUDE.md`
98
+ - `AGENTS.md`
99
+ - `.mcp.json`
98
100
 
99
101
  ## Marketplace structure mode
100
102
 
@@ -134,10 +136,11 @@ bun run build
134
136
 
135
137
  The npm package is configured to publish only:
136
138
 
137
- - `dist/spawnpack.js`
138
- - `templates/CLAUDE.md`
139
- - `README.md`
140
- - `LICENSE`
139
+ - `dist/spawnpack.js`
140
+ - `templates/CLAUDE.md`
141
+ - `templates/AGENTS.md`
142
+ - `README.md`
143
+ - `LICENSE`
141
144
  - `package.json`
142
145
 
143
146
  Internal planning files, Serena state, and local AI/project notes are excluded from the published tarball.
package/dist/spawnpack.js CHANGED
@@ -1571,6 +1571,15 @@ function getScriptDirectorySegments(config) {
1571
1571
  function getScriptEntryPath(config) {
1572
1572
  return [...getScriptDirectorySegments(config), "main.js"].join("/");
1573
1573
  }
1574
+ function getAiDocFilename(aiSetup) {
1575
+ if (aiSetup === "claude") {
1576
+ return "CLAUDE.md";
1577
+ }
1578
+ if (aiSetup === "other") {
1579
+ return "AGENTS.md";
1580
+ }
1581
+ return null;
1582
+ }
1574
1583
 
1575
1584
  // src/engine/manifests.ts
1576
1585
  var PACK_VERSION = [1, 0, 0];
@@ -1891,9 +1900,10 @@ function generateReadme(config) {
1891
1900
  const runtimeEntry = config.scripting === "none" ? "None" : `packs/BP/${getScriptEntryPath(config)}`;
1892
1901
  const installStep = config.scripting !== "none" ? "1. Install dependencies with `bun install` or `npm install`." : "1. No package install is required for this scaffold.";
1893
1902
  const buildSteps = config.scripting === "none" ? "2. Edit your BP/RP JSON files directly inside `packs/`." : config.useRgl ? "2. Run `rgl watch` while developing to rebuild and export your add-on automatically.\n3. Run `rgl run build` when you want a production build." : config.scripting === "typescript" ? "2. Write your gameplay scripts in `data/scripts/`.\n3. Run `bun run build` or `npm run build` to compile TypeScript into `packs/BP/scripts/`." : "2. Write your gameplay scripts in `packs/BP/scripts/` and let Minecraft copy the pack into `com.mojang`.";
1894
- const aiSection = config.useAi ? `## AI Tooling
1903
+ const aiDocFilename = getAiDocFilename(config.aiSetup);
1904
+ const aiSection = aiDocFilename !== null ? `## AI Tooling
1895
1905
 
1896
- Spawnpack generated \`CLAUDE.md\` and \`.mcp.json\` for AI-assisted development.
1906
+ Spawnpack generated \`${aiDocFilename}\` and \`.mcp.json\` for AI-assisted development.
1897
1907
 
1898
1908
  Add your own API keys before using the MCP tools:
1899
1909
 
@@ -2162,30 +2172,37 @@ async function generateMcpConfig(projectPath) {
2162
2172
  // src/provisioning/ai.ts
2163
2173
  var AI_EXCLUDE_LINES = [
2164
2174
  "# AI tool files",
2165
- "CLAUDE.md",
2166
- "AGENTS.md",
2167
- ".mcp.json",
2168
- ".claude/",
2169
- ".serena/"
2170
- ];
2171
- var CLAUDE_TEMPLATE_URLS = [
2172
- new URL("../templates/CLAUDE.md", import.meta.url),
2173
- new URL("../../templates/CLAUDE.md", import.meta.url)
2175
+ "/CLAUDE.md",
2176
+ "/AGENTS.md",
2177
+ "/.mcp.json",
2178
+ "/.claude/",
2179
+ "/.serena/"
2174
2180
  ];
2175
- async function createClaudeMdContent() {
2176
- for (const templateUrl of CLAUDE_TEMPLATE_URLS) {
2181
+ function getTemplateUrls(filename) {
2182
+ return [
2183
+ new URL(`../templates/${filename}`, import.meta.url),
2184
+ new URL(`../../templates/${filename}`, import.meta.url)
2185
+ ];
2186
+ }
2187
+ async function createAiDocContent(filename) {
2188
+ const templateUrls = getTemplateUrls(filename);
2189
+ for (const templateUrl of templateUrls) {
2177
2190
  const templateFile = Bun.file(templateUrl);
2178
2191
  const exists = await templateFile.exists().then((value) => value, () => false);
2179
2192
  if (exists) {
2180
2193
  return await templateFile.text();
2181
2194
  }
2182
2195
  }
2183
- return await Bun.file(CLAUDE_TEMPLATE_URLS[0]).text();
2196
+ return await Bun.file(templateUrls[0]).text();
2184
2197
  }
2185
- async function generateClaudeMd(projectPath) {
2186
- const claudePath = join3(projectPath, "CLAUDE.md");
2187
- const content = await createClaudeMdContent();
2188
- await Bun.write(claudePath, content).then(() => {
2198
+ async function generateAiDoc(projectPath, aiSetup) {
2199
+ const filename = getAiDocFilename(aiSetup);
2200
+ if (filename === null) {
2201
+ return;
2202
+ }
2203
+ const outputPath = join3(projectPath, filename);
2204
+ const content = await createAiDocContent(filename);
2205
+ await Bun.write(outputPath, content).then(() => {
2189
2206
  return;
2190
2207
  }, () => {
2191
2208
  return;
@@ -2218,8 +2235,11 @@ async function setupGitExcludes(projectPath) {
2218
2235
  return;
2219
2236
  });
2220
2237
  }
2221
- async function setupAi(projectPath) {
2222
- await generateClaudeMd(projectPath);
2238
+ async function setupAi(projectPath, aiSetup) {
2239
+ if (aiSetup === "none") {
2240
+ return;
2241
+ }
2242
+ await generateAiDoc(projectPath, aiSetup);
2223
2243
  await setupGitExcludes(projectPath);
2224
2244
  await generateMcpConfig(projectPath);
2225
2245
  }
@@ -2317,6 +2337,15 @@ function getScriptingLabel(choice) {
2317
2337
  }
2318
2338
  return "None";
2319
2339
  }
2340
+ function getAiSetupLabel(choice) {
2341
+ if (choice === "claude") {
2342
+ return "Claude";
2343
+ }
2344
+ if (choice === "other") {
2345
+ return "Other";
2346
+ }
2347
+ return "None";
2348
+ }
2320
2349
  function getSelectedPackages(scriptPackages) {
2321
2350
  const packages = [];
2322
2351
  if (scriptPackages.server) {
@@ -2423,8 +2452,9 @@ function showFolderTree(config) {
2423
2452
  if (config.useRgl) {
2424
2453
  lines.push(import_picocolors.default.dim("├─ config.json"));
2425
2454
  }
2426
- if (config.useAi) {
2427
- lines.push(import_picocolors.default.dim("├─ CLAUDE.md"));
2455
+ const aiDocFilename = getAiDocFilename(config.aiSetup);
2456
+ if (aiDocFilename !== null) {
2457
+ lines.push(import_picocolors.default.dim(`├─ ${aiDocFilename}`));
2428
2458
  lines.push(import_picocolors.default.dim("├─ .mcp.json"));
2429
2459
  }
2430
2460
  lines.push(import_picocolors.default.dim("├─ .gitignore"));
@@ -2452,7 +2482,7 @@ function showReview(config) {
2452
2482
  `${border} ${import_picocolors.default.dim(padLabel("Packages:"))} ${packages}`,
2453
2483
  `${border} ${import_picocolors.default.dim(padLabel("rgl:"))} ${formatToggle(config.useRgl)}`,
2454
2484
  `${border} ${import_picocolors.default.dim(padLabel("Rockide:"))} ${formatToggle(config.installRockide)}`,
2455
- `${border} ${import_picocolors.default.dim(padLabel("AI Setup:"))} ${formatToggle(config.useAi)}`,
2485
+ `${border} ${import_picocolors.default.dim(padLabel("AI Setup:"))} ${formatValue(getAiSetupLabel(config.aiSetup))}`,
2456
2486
  "",
2457
2487
  `${border} ${teal(import_picocolors.default.bold("Planned structure"))}`,
2458
2488
  ...showFolderTree(config).split(`
@@ -2483,7 +2513,7 @@ function showPostGeneration(config) {
2483
2513
  if (config.scripting === "none" && !config.useRgl) {
2484
2514
  usefulCommands.push(` ${import_picocolors.default.dim("No extra build commands needed for this scaffold")}`);
2485
2515
  }
2486
- if (config.useAi) {
2516
+ if (config.aiSetup !== "none") {
2487
2517
  usefulCommands.push("");
2488
2518
  usefulCommands.push(`${teal(import_picocolors.default.bold("Note"))} ${import_picocolors.default.dim("Add your own Exa and Browser Use MCP API keys in .mcp.json before using the AI tooling.")}`);
2489
2519
  usefulCommands.push(` ${import_picocolors.default.dim("Exa:")} ${import_picocolors.default.cyan("https://dashboard.exa.ai/api-keys")}`);
@@ -2657,11 +2687,16 @@ async function runWizard() {
2657
2687
  if (q(installRockide2)) {
2658
2688
  return abortWizard();
2659
2689
  }
2660
- const useAi = await ot2({
2661
- message: `${import_picocolors2.default.bold("AI setup?")} ${import_picocolors2.default.dim("generate CLAUDE.md with Bedrock development rules")}`,
2662
- initialValue: false
2690
+ const aiSetup = await _t({
2691
+ message: import_picocolors2.default.bold("AI setup"),
2692
+ initialValue: "none",
2693
+ options: [
2694
+ { value: "none", label: "None", hint: "no AI docs or MCP config" },
2695
+ { value: "claude", label: "Claude", hint: "generate CLAUDE.md and .mcp.json" },
2696
+ { value: "other", label: "Other", hint: "generate AGENTS.md and .mcp.json" }
2697
+ ]
2663
2698
  });
2664
- if (q(useAi)) {
2699
+ if (q(aiSetup)) {
2665
2700
  return abortWizard();
2666
2701
  }
2667
2702
  const config = {
@@ -2674,7 +2709,7 @@ async function runWizard() {
2674
2709
  scriptPackages: scripting === "none" ? { ...DEFAULT_SCRIPT_PACKAGES } : scriptPackages,
2675
2710
  useMarketplaceStructure,
2676
2711
  useRgl: scripting === "none" ? false : useRgl,
2677
- useAi,
2712
+ aiSetup,
2678
2713
  installRockide: installRockide2
2679
2714
  };
2680
2715
  showReview(config);
@@ -2703,8 +2738,8 @@ if (config === null) {
2703
2738
  var generation = fe();
2704
2739
  generation.start(teal3("Generating your Bedrock addon scaffold..."));
2705
2740
  await generateProject(config);
2706
- if (config.useAi) {
2707
- await setupAi(config.destination);
2741
+ if (config.aiSetup !== "none") {
2742
+ await setupAi(config.destination, config.aiSetup);
2708
2743
  }
2709
2744
  await runProvisioning(config);
2710
2745
  generation.stop(import_picocolors3.default.green("Spawnpack scaffold generated."));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spawnpack",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Minecraft Bedrock addon project generator — scaffold your BP+RP in seconds",
5
5
  "author": "veedy-dev",
6
6
  "license": "MIT",
@@ -12,6 +12,7 @@
12
12
  "bin/spawnpack.js",
13
13
  "dist/spawnpack.js",
14
14
  "templates/CLAUDE.md",
15
+ "templates/AGENTS.md",
15
16
  "README.md",
16
17
  "LICENSE",
17
18
  "package.json"