shipcraft 2.16.0 → 2.18.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 (2) hide show
  1. package/README.md +35 -9
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -54,10 +54,12 @@ Every refusal is three lines: **what happened, why it matters, and the next step
54
54
 
55
55
  ## Quick start
56
56
 
57
+ Installing is two steps: add the package (or the binary), then run `shipcraft init` in the project. Until `init` runs, nothing checks your commits.
58
+
57
59
  ```bash
58
60
  # A Node/TypeScript project (macOS): pin Shipcraft in the project, like any dev dependency
59
- pnpm add -D shipcraft # or: npm i -D shipcraft
60
- pnpm exec shipcraft init # the hooks call this project's install
61
+ pnpm add -D shipcraft # step 1, or: npm i -D shipcraft
62
+ pnpm exec shipcraft init # step 2, or: npx -- shipcraft init; the hooks call this project's install
61
63
 
62
64
  # macOS (Apple silicon or Intel), any language: the latest release, checksum-verified, into ~/.local/bin
63
65
  gh repo clone victorassisalves/shipcraft && bash shipcraft/install.sh
@@ -67,18 +69,30 @@ git clone https://github.com/victorassisalves/shipcraft && cd shipcraft
67
69
  cargo install --path nucleo
68
70
  ```
69
71
 
70
- `install.sh --version <v>` pins a version and `install.sh --uninstall` removes the binary. It needs `gh` logged in.
72
+ `install.sh --version <v>` pins a version and `install.sh --uninstall` removes the binary. It needs `gh` logged in. With the npm install, `shipcraft` is not on your `PATH`: run it through the project (`pnpm exec shipcraft …` or `npx -- shipcraft …`).
71
73
 
72
- Then, in your project:
74
+ With `install.sh` or `cargo install`, step 2 is, in your project (`install.sh` puts the binary in `~/.local/bin`; if that folder is not on your `PATH`, run `export PATH="$HOME/.local/bin:$PATH"` first, or add it to your shell profile):
73
75
 
74
76
  ```bash
75
77
  shipcraft init # detects the language, writes .shipcraft.toml, wires the hook
76
- git add .shipcraft.toml && git commit -m "add shipcraft"
77
78
  ```
78
79
 
79
- A cycle:
80
+ Either way, `init` ends with the files to commit (`shipcraft: ready. Commit …`): `.shipcraft.toml`, `.shipcraft/`, and the hook manager's file and `AGENTS.md`/`CLAUDE.md` when it wrote them. Commit all of them, plus `package.json` and its lockfile with the npm install:
81
+
82
+ ```bash
83
+ git add .shipcraft.toml .shipcraft # plus every other file init listed (AGENTS.md, CLAUDE.md, the hook manager's file),
84
+ # and package.json with pnpm-lock.yaml or package-lock.json
85
+ git commit -m "add shipcraft"
86
+ ```
87
+
88
+ Git does not commit hooks: every other clone installs the dependencies and runs `init` once (or the hook manager's install). Until then nothing runs at its commits, and CI is the backstop.
89
+
90
+ A cycle (with the npm install, run each `shipcraft` command through the project's install, from the repository root: `pnpm exec shipcraft red` or `npx -- shipcraft red`; `git` stays as is):
80
91
 
81
92
  ```bash
93
+ # work on a branch: `shipcraft pr` refuses the default branch
94
+ git switch -c invoice-rounding
95
+
82
96
  # RED: write the failing tests, then lock them
83
97
  shipcraft red
84
98
  git add -A && git commit -m "red: invoice rounding"
@@ -86,15 +100,21 @@ git add -A && git commit -m "red: invoice rounding"
86
100
  # GREEN: write the code; commit as often as you like
87
101
  git commit -am "fix rounding" # the lock closes on the first fully green commit
88
102
 
89
- # open the PR: CI and review run, and their statuses are published
103
+ # open the PR (needs a GitHub remote named origin and gh logged in): CI runs, then the review
104
+ # when an agent is configured (init turns review off if it finds no codex, claude or gemini),
105
+ # and their statuses are published
90
106
  shipcraft pr --title "Invoice rounding"
91
107
 
92
- # merge only when both are green
108
+ # merge only when CI is green and the review approved (or is off)
93
109
  shipcraft merge 42
94
110
  ```
95
111
 
96
112
  `shipcraft status` shows the open locks and how protected the repository really is.
97
113
 
114
+ Without a GitHub remote, the cycle still works up to the commits: `red`, the hook and `shipcraft ci --base <ref>` run locally; `pr` and `merge` need GitHub.
115
+
116
+ Upgrading: with the npm install, `pnpm add -DE shipcraft@latest` (or `npm i -D --save-exact shipcraft@latest`) and commit `package.json` with the lockfile; every clone then gets the same version. To go back, pin the previous one exactly: `pnpm add -DE shipcraft@<version>`, and commit both files again. With `install.sh`, run it again, or `install.sh --version <version>`. A version older than the config's `shipcraft_min` refuses to run: going back past it also means lowering `shipcraft_min` in `.shipcraft.toml`, with no lock open. Release notes say which version to go back to when a release changes something you may want to undo.
117
+
98
118
  ## Commands
99
119
 
100
120
  | Command | What it does |
@@ -177,7 +197,9 @@ Every rule in Shipcraft has to pay for itself. It ships with the metric that jus
177
197
  Agents don't need a plugin, an MCP server or a skill. They find Shipcraft the same way they find every other project constraint:
178
198
 
179
199
  - `git commit` runs the hook, and refusals say exactly what to do next;
180
- - `shipcraft init` writes a short block in `AGENTS.md` that tells agents to run `shipcraft red` after writing tests. In our trials (four runs per arm, a small sample) this took agents from 0/4 to 4/4 running `shipcraft red` before the first commit.
200
+ - `shipcraft init` writes a short block in `AGENTS.md` that tells agents the cycle: write the failing test and stub, run `shipcraft red`, commit the tests with the lock, then implement. In our trials (four runs per arm, a small sample) the earlier block took agents from 0/4 to 4/4 running `shipcraft red` before the first commit.
201
+ - Since 2.17, the block also asks for the RED and the GREEN in separate sessions (a subagent per phase in Claude Code, a new `codex exec` per phase in Codex), and `init` adds an import of it to `CLAUDE.md` when Claude Code is installed or the file exists, since Claude Code reads `CLAUDE.md`. `init` upgrades a block it wrote earlier and keeps one you edited; while `AGENTS.md` holds an edited or older block, `CLAUDE.md` is left alone and `init` says so.
202
+ - `shipcraft --version` and `shipcraft --help` say when the repository has no `.shipcraft.toml` yet, so an agent that checks the install is told to run `init`.
181
203
 
182
204
  Give the RED and the GREEN to different sessions. They can be the same model; separate context is what matters.
183
205
 
@@ -199,6 +221,10 @@ bash acceptance/run.sh nucleo/target/release/shipcraft all # the full acceptan
199
221
 
200
222
  Shipcraft is developed with Shipcraft: specs in `docs/`, RED and GREEN by separate agents, and every change gated by the battery and a review.
201
223
 
224
+ ## Contributing
225
+
226
+ Pull requests from outside the project are not accepted for now; bug reports and field reports are welcome as issues. See [CONTRIBUTING.md](CONTRIBUTING.md), and [SECURITY.md](SECURITY.md) for vulnerabilities.
227
+
202
228
  ## License
203
229
 
204
230
  [Apache License 2.0](LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipcraft",
3
- "version": "2.16.0",
3
+ "version": "2.18.0",
4
4
  "description": "A seatbelt for test-driven development with coding agents: locks the tests at RED so GREEN cannot quietly undo them.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": { "type": "git", "url": "git+https://github.com/victorassisalves/shipcraft.git" },
@@ -10,7 +10,7 @@
10
10
  "files": ["bin/shipcraft.js", "LICENSE", "README.md"],
11
11
  "engines": { "node": ">=18" },
12
12
  "optionalDependencies": {
13
- "shipcraft-darwin-arm64": "2.16.0",
14
- "shipcraft-darwin-x64": "2.16.0"
13
+ "shipcraft-darwin-arm64": "2.18.0",
14
+ "shipcraft-darwin-x64": "2.18.0"
15
15
  }
16
16
  }