@protonspy/csdd 0.1.10 → 0.1.11

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 (3) hide show
  1. package/README.md +41 -41
  2. package/bin/csdd.js +81 -81
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -1,41 +1,41 @@
1
- # csdd
2
-
3
- **Claude Spec-Driven Development — as an executable contract.**
4
-
5
- `csdd` is a single Go binary that turns the Spec-Driven Development (SDD)
6
- workflow for [Claude Code](https://claude.com/claude-code) into a contract that
7
- is validated mechanically — for humans *and* AI agents.
8
-
9
- ## Run
10
-
11
- No install needed — `npx` fetches the right prebuilt binary for your platform:
12
-
13
- ```bash
14
- npx @protonspy/csdd --help
15
- npx @protonspy/csdd # interactive TUI
16
- ```
17
-
18
- Prefer the short `csdd` command on your `PATH`? Install it globally:
19
-
20
- ```bash
21
- npm install -g @protonspy/csdd # then: csdd
22
- ```
23
-
24
- This package ships a thin launcher; the native binary for your platform is
25
- pulled in automatically as an optional dependency (no postinstall scripts, no
26
- download at install time). Prebuilt for linux, macOS, and Windows on x64/arm64.
27
-
28
- ## Usage
29
-
30
- ```bash
31
- npx @protonspy/csdd # interactive TUI
32
- npx @protonspy/csdd spec generate photo-albums --artifact requirements # headless / CI
33
- ```
34
-
35
- > Installed globally? Drop the `npx @protonspy/` prefix and just call `csdd`.
36
-
37
- See the [full documentation](https://github.com/protonspy/csdd#readme).
38
-
39
- ## License
40
-
41
- [Apache-2.0](https://github.com/protonspy/csdd/blob/main/LICENSE)
1
+ # csdd
2
+
3
+ **Claude Spec-Driven Development — as an executable contract.**
4
+
5
+ `csdd` is a single Go binary that turns the Spec-Driven Development (SDD)
6
+ workflow for [Claude Code](https://claude.com/claude-code) into a contract that
7
+ is validated mechanically — for humans *and* AI agents.
8
+
9
+ ## Run
10
+
11
+ No install needed — `npx` fetches the right prebuilt binary for your platform:
12
+
13
+ ```bash
14
+ npx @protonspy/csdd --help
15
+ npx @protonspy/csdd # interactive TUI
16
+ ```
17
+
18
+ Prefer the short `csdd` command on your `PATH`? Install it globally:
19
+
20
+ ```bash
21
+ npm install -g @protonspy/csdd # then: csdd
22
+ ```
23
+
24
+ This package ships a thin launcher; the native binary for your platform is
25
+ pulled in automatically as an optional dependency (no postinstall scripts, no
26
+ download at install time). Prebuilt for linux, macOS, and Windows on x64/arm64.
27
+
28
+ ## Usage
29
+
30
+ ```bash
31
+ npx @protonspy/csdd # interactive TUI
32
+ npx @protonspy/csdd spec generate photo-albums --artifact requirements # headless / CI
33
+ ```
34
+
35
+ > Installed globally? Drop the `npx @protonspy/` prefix and just call `csdd`.
36
+
37
+ See the [full documentation](https://github.com/protonspy/csdd#readme).
38
+
39
+ ## License
40
+
41
+ [Apache-2.0](https://github.com/protonspy/csdd/blob/main/LICENSE)
package/bin/csdd.js CHANGED
@@ -1,81 +1,81 @@
1
- #!/usr/bin/env node
2
- // Launcher for the csdd CLI distributed via npm.
3
- //
4
- // The actual Go binary ships in a per-platform optional dependency
5
- // (@protonspy/csdd-<platform>-<arch>). npm installs only the package whose
6
- // "os"/"cpu" match the host, so this shim just resolves that package's binary
7
- // and execs it — forwarding argv, stdio, signals, and the exit code. No
8
- // postinstall, no network at install time.
9
- import { spawn } from "node:child_process";
10
- import { createRequire } from "node:module";
11
-
12
- const require = createRequire(import.meta.url);
13
-
14
- const PLATFORM = { darwin: "darwin", linux: "linux", win32: "win32" }[process.platform];
15
- const ARCH = { x64: "x64", arm64: "arm64" }[process.arch];
16
-
17
- if (!PLATFORM || !ARCH) {
18
- console.error(
19
- `csdd: unsupported platform ${process.platform}/${process.arch}. ` +
20
- `Prebuilt binaries are available for linux, macOS, and Windows on x64/arm64.`
21
- );
22
- process.exit(1);
23
- }
24
-
25
- const pkg = `@protonspy/csdd-${PLATFORM}-${ARCH}`;
26
- const binName = process.platform === "win32" ? "csdd.exe" : "csdd";
27
-
28
- let binPath;
29
- try {
30
- binPath = require.resolve(`${pkg}/bin/${binName}`);
31
- } catch {
32
- console.error(
33
- `csdd: could not find the native binary for ${PLATFORM}-${ARCH}.\n` +
34
- `The optional dependency "${pkg}" was not installed.\n` +
35
- `Reinstall without --no-optional / --ignore-optional, or report an issue at\n` +
36
- `https://github.com/protonspy/csdd/issues`
37
- );
38
- process.exit(1);
39
- }
40
-
41
- // When invoked via `npx @protonspy/csdd` (which is `npm exec` under the hood),
42
- // echo that exact spelling in the binary's --help / usage output. A global
43
- // install runs this same launcher as the bare `csdd` command — there npm is not
44
- // in the picture (npm_command is unset), so the binary keeps its default name.
45
- // An explicit CSDD_PROG always wins.
46
- const env = { ...process.env };
47
- if (!env.CSDD_PROG) {
48
- const argv1 = process.argv[1] || "";
49
- const viaNpx =
50
- process.env.npm_command === "exec" ||
51
- argv1.includes("/_npx/") ||
52
- argv1.includes("\\_npx\\");
53
- if (viaNpx) env.CSDD_PROG = "npx @protonspy/csdd";
54
- }
55
-
56
- const child = spawn(binPath, process.argv.slice(2), { stdio: "inherit", env });
57
-
58
- // Forward terminating signals so the TUI shuts down cleanly.
59
- for (const sig of ["SIGINT", "SIGTERM", "SIGHUP"]) {
60
- process.on(sig, () => {
61
- try {
62
- child.kill(sig);
63
- } catch {
64
- /* child already gone */
65
- }
66
- });
67
- }
68
-
69
- child.on("error", (err) => {
70
- console.error(`csdd: failed to launch binary: ${err.message}`);
71
- process.exit(1);
72
- });
73
-
74
- child.on("exit", (code, signal) => {
75
- if (signal) {
76
- // Re-raise the signal so the parent exit status reflects it.
77
- process.kill(process.pid, signal);
78
- } else {
79
- process.exit(code ?? 0);
80
- }
81
- });
1
+ #!/usr/bin/env node
2
+ // Launcher for the csdd CLI distributed via npm.
3
+ //
4
+ // The actual Go binary ships in a per-platform optional dependency
5
+ // (@protonspy/csdd-<platform>-<arch>). npm installs only the package whose
6
+ // "os"/"cpu" match the host, so this shim just resolves that package's binary
7
+ // and execs it — forwarding argv, stdio, signals, and the exit code. No
8
+ // postinstall, no network at install time.
9
+ import { spawn } from "node:child_process";
10
+ import { createRequire } from "node:module";
11
+
12
+ const require = createRequire(import.meta.url);
13
+
14
+ const PLATFORM = { darwin: "darwin", linux: "linux", win32: "win32" }[process.platform];
15
+ const ARCH = { x64: "x64", arm64: "arm64" }[process.arch];
16
+
17
+ if (!PLATFORM || !ARCH) {
18
+ console.error(
19
+ `csdd: unsupported platform ${process.platform}/${process.arch}. ` +
20
+ `Prebuilt binaries are available for linux, macOS, and Windows on x64/arm64.`
21
+ );
22
+ process.exit(1);
23
+ }
24
+
25
+ const pkg = `@protonspy/csdd-${PLATFORM}-${ARCH}`;
26
+ const binName = process.platform === "win32" ? "csdd.exe" : "csdd";
27
+
28
+ let binPath;
29
+ try {
30
+ binPath = require.resolve(`${pkg}/bin/${binName}`);
31
+ } catch {
32
+ console.error(
33
+ `csdd: could not find the native binary for ${PLATFORM}-${ARCH}.\n` +
34
+ `The optional dependency "${pkg}" was not installed.\n` +
35
+ `Reinstall without --no-optional / --ignore-optional, or report an issue at\n` +
36
+ `https://github.com/protonspy/csdd/issues`
37
+ );
38
+ process.exit(1);
39
+ }
40
+
41
+ // When invoked via `npx @protonspy/csdd` (which is `npm exec` under the hood),
42
+ // echo that exact spelling in the binary's --help / usage output. A global
43
+ // install runs this same launcher as the bare `csdd` command — there npm is not
44
+ // in the picture (npm_command is unset), so the binary keeps its default name.
45
+ // An explicit CSDD_PROG always wins.
46
+ const env = { ...process.env };
47
+ if (!env.CSDD_PROG) {
48
+ const argv1 = process.argv[1] || "";
49
+ const viaNpx =
50
+ process.env.npm_command === "exec" ||
51
+ argv1.includes("/_npx/") ||
52
+ argv1.includes("\\_npx\\");
53
+ if (viaNpx) env.CSDD_PROG = "npx @protonspy/csdd";
54
+ }
55
+
56
+ const child = spawn(binPath, process.argv.slice(2), { stdio: "inherit", env });
57
+
58
+ // Forward terminating signals so the TUI shuts down cleanly.
59
+ for (const sig of ["SIGINT", "SIGTERM", "SIGHUP"]) {
60
+ process.on(sig, () => {
61
+ try {
62
+ child.kill(sig);
63
+ } catch {
64
+ /* child already gone */
65
+ }
66
+ });
67
+ }
68
+
69
+ child.on("error", (err) => {
70
+ console.error(`csdd: failed to launch binary: ${err.message}`);
71
+ process.exit(1);
72
+ });
73
+
74
+ child.on("exit", (code, signal) => {
75
+ if (signal) {
76
+ // Re-raise the signal so the parent exit status reflects it.
77
+ process.kill(process.pid, signal);
78
+ } else {
79
+ process.exit(code ?? 0);
80
+ }
81
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protonspy/csdd",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Claude Spec-Driven Development — a single Go binary that turns the SDD workflow into a mechanically validated contract for humans and AI agents.",
5
5
  "keywords": [
6
6
  "claude",
@@ -32,10 +32,10 @@
32
32
  "node": ">=16"
33
33
  },
34
34
  "optionalDependencies": {
35
- "@protonspy/csdd-linux-x64": "0.1.10",
36
- "@protonspy/csdd-linux-arm64": "0.1.10",
37
- "@protonspy/csdd-darwin-x64": "0.1.10",
38
- "@protonspy/csdd-darwin-arm64": "0.1.10",
39
- "@protonspy/csdd-win32-x64": "0.1.10"
35
+ "@protonspy/csdd-linux-x64": "0.1.11",
36
+ "@protonspy/csdd-linux-arm64": "0.1.11",
37
+ "@protonspy/csdd-darwin-x64": "0.1.11",
38
+ "@protonspy/csdd-darwin-arm64": "0.1.11",
39
+ "@protonspy/csdd-win32-x64": "0.1.11"
40
40
  }
41
41
  }