@protonspy/csdd 0.1.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.
Files changed (3) hide show
  1. package/README.md +36 -0
  2. package/bin/csdd.js +66 -0
  3. package/package.json +41 -0
package/README.md ADDED
@@ -0,0 +1,36 @@
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
+ ## Install
10
+
11
+ ```bash
12
+ npm install -g @protonspy/csdd
13
+ ```
14
+
15
+ Or run it without installing:
16
+
17
+ ```bash
18
+ npx @protonspy/csdd --help
19
+ ```
20
+
21
+ This package ships a thin launcher; the native binary for your platform is
22
+ pulled in automatically as an optional dependency (no postinstall scripts, no
23
+ download at install time). Prebuilt for linux, macOS, and Windows on x64/arm64.
24
+
25
+ ## Usage
26
+
27
+ ```bash
28
+ csdd # interactive TUI
29
+ csdd spec generate photo-albums --artifact requirements # headless / CI
30
+ ```
31
+
32
+ See the [full documentation](https://github.com/protonspy/csdd#readme).
33
+
34
+ ## License
35
+
36
+ [Apache-2.0](https://github.com/protonspy/csdd/blob/main/LICENSE)
package/bin/csdd.js ADDED
@@ -0,0 +1,66 @@
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
+ const child = spawn(binPath, process.argv.slice(2), { stdio: "inherit" });
42
+
43
+ // Forward terminating signals so the TUI shuts down cleanly.
44
+ for (const sig of ["SIGINT", "SIGTERM", "SIGHUP"]) {
45
+ process.on(sig, () => {
46
+ try {
47
+ child.kill(sig);
48
+ } catch {
49
+ /* child already gone */
50
+ }
51
+ });
52
+ }
53
+
54
+ child.on("error", (err) => {
55
+ console.error(`csdd: failed to launch binary: ${err.message}`);
56
+ process.exit(1);
57
+ });
58
+
59
+ child.on("exit", (code, signal) => {
60
+ if (signal) {
61
+ // Re-raise the signal so the parent exit status reflects it.
62
+ process.kill(process.pid, signal);
63
+ } else {
64
+ process.exit(code ?? 0);
65
+ }
66
+ });
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@protonspy/csdd",
3
+ "version": "0.1.0",
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
+ "keywords": [
6
+ "claude",
7
+ "claude-code",
8
+ "spec-driven-development",
9
+ "sdd",
10
+ "cli",
11
+ "ai",
12
+ "agents"
13
+ ],
14
+ "homepage": "https://github.com/protonspy/csdd#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/protonspy/csdd/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/protonspy/csdd.git"
21
+ },
22
+ "license": "Apache-2.0",
23
+ "type": "module",
24
+ "bin": {
25
+ "csdd": "bin/csdd.js"
26
+ },
27
+ "files": [
28
+ "bin/csdd.js",
29
+ "README.md"
30
+ ],
31
+ "engines": {
32
+ "node": ">=16"
33
+ },
34
+ "optionalDependencies": {
35
+ "@protonspy/csdd-linux-x64": "0.1.0",
36
+ "@protonspy/csdd-linux-arm64": "0.1.0",
37
+ "@protonspy/csdd-darwin-x64": "0.1.0",
38
+ "@protonspy/csdd-darwin-arm64": "0.1.0",
39
+ "@protonspy/csdd-win32-x64": "0.1.0"
40
+ }
41
+ }