shipcraft 2.14.0 → 2.17.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.
- package/README.md +33 -9
- 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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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 |
|
|
@@ -149,6 +169,8 @@ Two rules keep the config honest:
|
|
|
149
169
|
- **The config is part of the lock.** It can't change while a lock is open.
|
|
150
170
|
- **A PR is judged by the config on the base branch,** not by its own. A PR can't switch off its own review.
|
|
151
171
|
|
|
172
|
+
**Adding a package with a new suite.** Once the base branch has a `.shipcraft.toml`, a `[[suite]]` added in the same PR as its first tests doesn't run in CI, and `shipcraft ci` refuses its locked cases as missing. Bring the suite first, in a PR of its own: the package, its `[[suite]]` entry and one passing test. Once that's merged, rebase and write the RED. `shipcraft red` warns when changed test files match no suite's globs, or when the lock has cases in a suite the base doesn't have.
|
|
173
|
+
|
|
152
174
|
A layer that is switched off is labeled "off in .shipcraft.toml" on every PR, so nobody mistakes it for a check that ran.
|
|
153
175
|
|
|
154
176
|
## The layers
|
|
@@ -175,7 +197,9 @@ Every rule in Shipcraft has to pay for itself. It ships with the metric that jus
|
|
|
175
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:
|
|
176
198
|
|
|
177
199
|
- `git commit` runs the hook, and refusals say exactly what to do next;
|
|
178
|
-
- `shipcraft init` writes a short block in `AGENTS.md` that tells agents
|
|
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`.
|
|
179
203
|
|
|
180
204
|
Give the RED and the GREEN to different sessions. They can be the same model; separate context is what matters.
|
|
181
205
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shipcraft",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.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.
|
|
14
|
-
"shipcraft-darwin-x64": "2.
|
|
13
|
+
"shipcraft-darwin-arm64": "2.17.0",
|
|
14
|
+
"shipcraft-darwin-x64": "2.17.0"
|
|
15
15
|
}
|
|
16
16
|
}
|