smashspace 0.1.7 → 0.1.8

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
@@ -34,11 +34,17 @@ server below. (Headless? use `smash login --token <PAT>`.)
34
34
 
35
35
  ## Onboard a project for agents: `smash init`
36
36
 
37
- Run once per repo to scaffold everything agents (Claude Code / Codex) need to
38
- operate SmashSpace as the task backbone — no manual copying:
37
+ **One project = one `smash init` = one space.** Run it once inside each repo, so
38
+ that project's agents (Claude Code / Codex) operate their own space:
39
39
 
40
40
  ```bash
41
- smash init --board-id b_xxxxxxxx
41
+ cd your/dir/project
42
+
43
+ # create a new space and pin it to this project
44
+ smash init --new-space "Your Project"
45
+
46
+ # …or pin an existing space
47
+ smash init --space-id s_xxxxxxxx
42
48
  ```
43
49
 
44
50
  It writes (and is safe to re-run — existing config is kept unless `--force`):
@@ -46,12 +52,16 @@ It writes (and is safe to re-run — existing config is kept unless `--force`):
46
52
  - `.claude/skills/smash/SKILL.md` + `.codex/skills/smash/SKILL.md` — the
47
53
  SmashSpace Operator playbook (CLI/MCP usage + Inbox→Todo→Doing→Review→Done
48
54
  workflow + safety rules). Always refreshed to the installed CLI version.
49
- - `.smashspace.json` — pins the instance + board.
55
+ - `.smashspace.json` — pins the instance + space (which space this dir talks to).
50
56
  - `.mcp.json` — wires the `smashspace` MCP server (merged, other servers kept).
51
57
 
52
- Flags: `--skills-only` (just the operator skill), `--no-mcp`, `--force`,
53
- `--board-id <id>`. Then `smash login` once on the machine and the agents are
54
- ready.
58
+ Plain `smash init` (no space flag) is safe: it installs the skill and writes a
59
+ `.smashspace.json` with a **placeholder** space id, then prints how to set a real
60
+ one (`--new-space` / `--space-id`). It never guesses or deletes anything.
61
+
62
+ Flags: `--new-space <name>`, `--space-id <id>` (`--board-id` is a legacy alias),
63
+ `--skills-only` (just the operator skill), `--no-mcp`, `--force`. Sign in once
64
+ with `smash login` first (`--new-space` needs it).
55
65
 
56
66
  ## Project config: `.smashspace.json`
57
67
 
package/dist/smash.mjs CHANGED
@@ -4763,7 +4763,7 @@ program2.command("status").aliases(["context", "where"]).description(
4763
4763
  });
4764
4764
  program2.command("init").description(
4765
4765
  "Scaffold this project for agents: operator skill + .smashspace.json + .mcp.json"
4766
- ).option("--board-id <id>", "Board/space id to pin in .smashspace.json / .mcp.json").option("--skills-only", "Only (re)install the operator skill files").option("--no-mcp", "Skip writing .mcp.json").option("-f, --force", "Overwrite .smashspace.json / .mcp.json if they exist").action(
4766
+ ).option("--new-space <name>", "create a new space with this name, then pin it (needs login)").option("--space-id <id>", "existing space id to pin, e.g. s_xxxxxxxx").option("--board-id <id>", "alias for --space-id (legacy)").option("--skills-only", "Only (re)install the operator skill files").option("--no-mcp", "Skip writing .mcp.json").option("-f, --force", "Overwrite .smashspace.json / .mcp.json if they exist").action(
4767
4767
  async (opts) => {
4768
4768
  const cwd = process.cwd();
4769
4769
  const actions = [];
@@ -4788,15 +4788,26 @@ program2.command("init").description(
4788
4788
  "\u2713 operator skill \u2192 .claude/skills/smash/ + .codex/skills/smash/"
4789
4789
  );
4790
4790
  const baseUrl = resolveBaseUrl();
4791
- const boardId = opts.boardId ?? "b_xxxxxxxx";
4792
- const placeholder = boardId === "b_xxxxxxxx";
4791
+ let boardId;
4792
+ if (opts.newSpace) {
4793
+ const space = await api(
4794
+ "/api/boards",
4795
+ { method: "POST", body: JSON.stringify({ title: opts.newSpace }) },
4796
+ baseUrl
4797
+ );
4798
+ boardId = space.id;
4799
+ actions.push(`\u2713 created space "${space.title || opts.newSpace}" (${space.id})`);
4800
+ } else {
4801
+ boardId = opts.spaceId ?? opts.boardId ?? "s_xxxxxxxx";
4802
+ }
4803
+ const placeholder = boardId === "s_xxxxxxxx";
4793
4804
  if (!opts.skillsOnly) {
4794
4805
  if (await exists(CONFIG_FILENAME) && !opts.force) {
4795
4806
  actions.push(`\u2022 ${CONFIG_FILENAME} exists \u2014 kept (use --force)`);
4796
4807
  } else {
4797
4808
  await put(CONFIG_FILENAME, smashspaceJson(baseUrl, boardId));
4798
4809
  actions.push(
4799
- `\u2713 ${CONFIG_FILENAME}${placeholder ? " (placeholder space_id \u2014 edit it)" : ` (${boardId})`}`
4810
+ `\u2713 ${CONFIG_FILENAME}${placeholder ? " (placeholder space_id \u2014 set a real one below)" : ` \u2192 ${boardId}`}`
4800
4811
  );
4801
4812
  }
4802
4813
  if (opts.mcp !== false) {
@@ -4831,9 +4842,14 @@ program2.command("init").description(
4831
4842
  }
4832
4843
  }
4833
4844
  }
4834
- const next = ["", "Next:", " 1. smash login # sign in (browser approval)"];
4845
+ const next = ["", "Next:"];
4835
4846
  if (!opts.skillsOnly && placeholder) {
4836
- next.push(" 2. edit .smashspace.json # set your real space_id (`smash board list` to find it)");
4847
+ next.push(" This project isn't pinned to a space yet. Pick one:");
4848
+ next.push(' smash init --new-space "My Project" --force # create + pin a new space');
4849
+ next.push(" smash init --space-id s_xxxxxxxx --force # pin an existing space");
4850
+ next.push(" (find ids with: smash space list)");
4851
+ } else if (!opts.skillsOnly) {
4852
+ next.push(" smash login # if you haven't yet \u2014 then you're ready.");
4837
4853
  }
4838
4854
  next.push(
4839
4855
  " \u2192 Claude Code / Codex pick up .claude|.codex/skills/smash automatically"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smashspace",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "SmashSpace CLI + MCP — operate SmashSpace boards from your terminal, Claude Code, Cursor, and Codex.",
5
5
  "type": "module",
6
6
  "bin": {