Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
eafb49e
docs(specs): spec the team stamp verb and its test plan
tieubao Nov 24, 2026
1af05c4
docs(specs): amend the team stamp spec after lead review
tieubao Nov 24, 2026
c88b1bb
docs(specs): fold the validation findings into the team stamp spec
tieubao Nov 24, 2026
5ed1395
feat(stamp): add the stamp engine and its group contract
tieubao Nov 24, 2026
57f9dcc
docs(specs): drop a private layout path from the stamp spec
tieubao Nov 24, 2026
8373ef2
fix(stamp): write lock digests as sha256:<hex>, scan staged output
tieubao Nov 24, 2026
8d747d1
docs(specs): add the scan-safe digest rule to the stamp spec
tieubao Nov 24, 2026
58288e4
feat(stamp): add the rules docs group
tieubao Nov 25, 2026
7c0967a
feat(stamp): add the lessons group
tieubao Nov 25, 2026
0d40863
feat(stamp): add the command guard group
tieubao Nov 25, 2026
c111dc4
feat(stamp): add the merge guard and the negative control group
tieubao Nov 25, 2026
9f4ce2d
fix(stamp): align the guard lesson with the guard's header
tieubao Nov 25, 2026
ddadaef
chore(stamp): track the stamp templates under files/.claude
tieubao Nov 25, 2026
6729db5
feat(stamp): add the ship playbook and team digest group
tieubao Nov 25, 2026
42d5d41
feat(stamp): add the owners check group
tieubao Nov 25, 2026
fb4a687
feat(stamp): add the work queue group
tieubao Nov 25, 2026
ac062b6
feat(stamp): add the changelog and release notes group
tieubao Nov 25, 2026
d13899c
feat(stamp): add the PR shape check group
tieubao Nov 25, 2026
bf54b16
fix(stamp): clean gh text in the merge guard and match the proof guide
tieubao Nov 25, 2026
6bf7501
fix(stamp): keep repo text out of pasted fix commands
tieubao Nov 25, 2026
ce5f90c
feat(stamp): add the CI workflow and the local check group
tieubao Nov 25, 2026
5a327dd
fix(stamp): word the trust step from the vendor page, sync the lesson
tieubao Nov 25, 2026
0a37ed5
test(stamp): add the end to end stamp suite
tieubao Nov 25, 2026
0a55d84
test(stamp): add the refusal suite for every generated script
tieubao Nov 25, 2026
6ac2f28
fix(stamp): find a hook entry in any group of the same matcher
tieubao Nov 25, 2026
3b447d2
docs(stamp): add the stamp command, manual section and group notes
tieubao Nov 25, 2026
7f22b11
test(stamp): check the rendered workflow with actionlint
tieubao Nov 25, 2026
8bbac7f
test(stamp): retry the kit-free pass once on a tool crash
tieubao Nov 25, 2026
e990243
fix(stamp): strip control characters in negctl without tr
tieubao Nov 25, 2026
b4a97b3
fix(stamp): keep negctl helper functions out of pipelines
tieubao Nov 25, 2026
25c2e81
docs(stamp): keep spec ids out of the stamp command page
tieubao Nov 25, 2026
e33ab9c
docs(verification): add the proof for the team stamp integration
tieubao Nov 25, 2026
b1c25e9
fix(stamp): skip the denylist scan when no list is given
tieubao Nov 25, 2026
95499b1
test(gauntlet): add the team stamp card, checker, shim, room and tier 1
tieubao Nov 25, 2026
652906b
docs(gauntlet): record the team stamp run, tier 1 green, tier 2 not run
tieubao Nov 25, 2026
ba5eeb7
fix(stamp): split the tests job out of CI and guard it against forks
tieubao Nov 25, 2026
b6e07ee
fix(stamp): bind the merge guard to the workflow, the head and its ow…
tieubao Nov 25, 2026
32dfed2
fix(stamp): harden values, backups and the report of what is in use
tieubao Nov 25, 2026
0424892
docs(stamp): state the doors, the workflow limit and the runner advice
tieubao Nov 25, 2026
292ea00
fix(stamp): one safe rule-line filter, backslash guard, negctl head
tieubao Nov 25, 2026
8a4ac36
docs(stamp): mention the numbered backup name in the header
tieubao Nov 25, 2026
e3a45c5
fix(gauntlet): never open the probe's repo on the host, scrub binaries
tieubao Nov 25, 2026
744e0dd
docs(stamp): record the security fixes in the spec, notes and proof
tieubao Nov 25, 2026
e431059
fix(gauntlet): keep probe output off the host, check it in a container
tieubao Nov 25, 2026
45ea3c2
docs(stamp): record the eight negative controls in the proof
tieubao Nov 25, 2026
41957fe
docs: regenerate the feature table
tieubao Nov 25, 2026
984da60
fix(stamp): drop the tests job, keep CI to the base-copied gate jobs
tieubao Nov 25, 2026
e1e7b4b
fix(stamp): bind doors to case, instruction files, base and run ids
tieubao Nov 25, 2026
f8265f4
refactor(stamp): rename the internal KIT_ names the registry lint reads
tieubao Nov 25, 2026
a464e50
fix(stamp): refuse a product path that makes an invalid pattern
tieubao Nov 25, 2026
f232347
fix(stamp): filter board cells in issue-from-rows output
tieubao Nov 25, 2026
bc3363c
chore(stamp): work in progress on the round two review fixes
tieubao Nov 25, 2026
8b9340f
fix(stamp): track the engine fixture under files/.claude
tieubao Nov 25, 2026
d70b029
docs(stamp): add the stamp command to the architecture inventory
tieubao Nov 25, 2026
381863f
fix(stamp): owners match the exact path, path lists read NUL-delimited
tieubao Nov 25, 2026
146f33a
fix(stamp): a run counts only when this PR is the one PR on its head
tieubao Nov 25, 2026
cbeb891
docs(stamp): record the single-PR run rule and the verified gh fields
tieubao Nov 25, 2026
6a9b3ce
docs(stamp): add the run record template to the gauntlet readme
tieubao Nov 25, 2026
910236b
docs(stamp): record the round two negative controls and final counts
tieubao Nov 25, 2026
fa6ace8
chore(stamp): work in progress on the round three review fixes
tieubao Nov 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ node_modules/
/.claude/*
!/.claude/memory/
!/.claude/settings.json
# The team stamp templates carry files that land under a target repo's .claude/.
!/templates/team-stamp/files/.claude/
!/tests/fixtures/team-stamp/files/.claude/

# Legacy / retired artifacts the kit no longer writes: review output now lives in
# the spec's `## Review` section, and the spec location unified onto docs/specs/
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ All notable changes to dwarves-kit are documented here.
### Added
- Visual proof capture, the `proof_capture` module (new `bin/proof-capture`, new `lib/proof-capture/`, new opt-in `[modules] proof_capture`, default off, additive, NO default change): `proof-capture run page <src> <out.png>` makes a PNG with a headless Chromium-family browser on a throwaway profile, `proof-capture run tape <file.tape> <out.gif>` makes a GIF with `vhs`. It starts the child in its own process group, ends that group on success, deadline or a catchable signal, and keeps a watchdog for a KILL. It reads no kit file, so the directory also runs alone. With `[proof] visual` on, `proof-gate.sh contract` adds one `capture:` line after the `visual:` line for a ui page or tui task when the module files are present; the `visual:` text and every output with the knob off are unchanged. `commands/verify.md` Step 7b names the command and tells the reader to open the image before `proof-asset put`. Proof: `docs/verification/visual-proof-module.md`.
- Agent surface (new `agents/ui-acceptance-verifier.md`, new `lib/ui-verify/`, additive, MINOR): first slice, scenario layer only. `kit:ui-acceptance-verifier` is a read-only lens that runs the kit's runner over a pull request preview and returns a per-criterion PASS, FAIL or NO-CHECK in the acceptance-verifier grammar. The lead writes a `scenario.json` from the acceptance criteria; the runner drives a pinned headless Chromium with its sandbox on, refuses hosts and ports the lead did not name, gives the browser no proxy and none of its own environment, uses only an install root nobody else could have written, and derives every row status itself. `/kit:battery` gains one "Lens escalation" row for a UI change with a preview URL. The install root is a new `cache ui-verify` data-path entry (env `UI_VERIFY_HOME`); `--doctor` checks it. Playwright is an external dependency the operator installs, and the runner returns NO-CHECK rows, never PASS, on a host that lacks it. Not in this slice: token, layout, pixel and accessibility checks, a vision pass, preview discovery from the pull request, and a login or storage state, so a page behind a sign-in cannot be verified (a `skip` entry is NO-CHECK and the verdict escalates). The surface (`schema: 1`, exit codes, doctor output, `UI_VERIFY_HOME`, the stdout rows, the `result.json` fields) is provisional until one consumer repo has run it, and a PASS proves what the page showed the runner.
- `lib/stamp.sh` and `/kit:stamp`: write a kit-free agent harness into a repo whose team does not run the kit (a self-contained `AGENTS.md`, a project hook, a PR shape CI job with its local twin, an owners check, a merge guard, an Issues queue, a tagged changelog, a digest). Idempotent, never overwrites an edited file, reports drift, offers a per-file diff after an upgrade. Templates under `templates/team-stamp/`.
- Command surface (`lib/queue/orchestrate.sh` `_serial_level_join`, additive, NO change with `verify = "off"`): a tiered serial run joins once per DAG level. At the top of every cycle, before anything dispatches, each level whose sub-goals and lower levels are all checked and that has no `.orchestrate/join-level-<n>.ok` runs `[test] join_cmd` on origin's current base tree in a throwaway worktree, judged against the committed known-failures list with an executed count that may not drop below the last green level's. Every config key is read at the base sha pinned before the first dispatch. A red join halts the loop and a re-run joins the level again before dispatching; a stale base (origin unreachable or ahead) halts; a tiered run with no `join_cmd` halts at the first due level. The serial loop never merges (each worker merges its own PR), so unlike the wave join this one runs after the level's merges, on the base, not on a pinned pre-merge tree. A level is 0 with no `depends`, else 1 plus its deepest dependency. Proof: `docs/verification/serial-path-join.md`.
- `lib/gate/known-failures.sh` (`read`, `classify`, `guard`, `suite`): the lead-committed known-failures list and the node suite scope of a tiered mega-goal. `tests/test-known-failures.sh`, `tests/test-orchestrate-tiered.sh`, `tests/lib/node-fixture.sh` and the verify-off golden `tests/fixtures/orchestrate-golden/off.txt` pin it.
- Install surface (additive, `--no-mods` unchanged): `install.sh` now loads five Claude Code mods, not one. New vendored mods under `integrations/claude-code/`: `secrets-veil` and `memory-lens` (MIT) and `loop-detective` and `context-inspector` (Apache-2.0), each with its `LICENSE` and a `VENDORED.md` that pins the source commit and lists the local patches. One mod list drives the full install, the plugin-compat install (checkout paths) and `--uninstall` (every kit path, and only those). A mod is skipped with `[skip] <name> already loaded from <entry>` when `env.CLAUDE_CODE_PLUGIN_DIRS` already holds another entry that loads a plugin of that name (manifest name, else folder name, leading `~` expanded), and the kit's own entry for it leaves the list. `memory-lens` trusts no repo `.claude/memory` until `~/.claude/memory-lens/trusted-roots` lists a prefix. Patches to the two upstream mods: no raw failure excerpt and no status row in loop-detective, no status row and hashed non-file export targets in context-inspector. Pinned by `tests/test-install-mods.sh` and each mod's own tests. See `integrations/claude-code/README.md`.
Expand Down
87 changes: 87 additions & 0 deletions commands/stamp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
description: "Write a kit-free agent harness into a repo whose team does not run the kit: self-contained AGENTS.md and a people's copy, a project hook that blocks a bare merge and a push or commit on the default branch, session-start lessons, a ship playbook, a PR shape CI job with its local twin, an owners check, a merge guard, a negative control, an Issues work queue, a tagged changelog, a digest and a proof guide. Idempotent, never overwrites an edited file, reports drift."
---

You are stamping a repo with the team harness. One operator runs the kit; the teammates and their
coding agents do not. Every file this writes is a plain copy the repo owns and runs with no kit
installed: no file names a path under the kit, and the stamp adds no daemon and no service.

## Run

`$ARGUMENTS` may name a target dir (default: the repo root) and any of the value flags below.

1. Resolve the target: default `.` (`git rev-parse --show-toplevel`). It must be a git repo.
2. Dry run first, then write (idempotent, non-destructive):

```
bash "${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/dwarves-kit}/lib/stamp.sh" --dry-run --owner <github-login> <target>
bash "${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/dwarves-kit}/lib/stamp.sh" --owner <github-login> <target>
```

The first pull request that introduces the stamp into a repo touches every door (the workflows, `scripts/`, `.claude/`, the rules files). A second person reads it and approves it, or the operator merges it by hand: the merge guard cannot judge its own first copy.

3. Report the status lines it printed (`created`, `merged`, `unchanged`, `edited (left alone)`,
`older stamp (run --refresh)`, `missing`) and any two-line refusal with its `Fix:` line. The
operator reviews and commits the files; the stamp commits nothing.

## Flags

| Flag | Default | Used for |
|---|---|---|
| `--owner <login>` | required | the owner row of every generated script in `OWNERS.md` |
| `--default-branch <name>` | `origin/HEAD`, else refuse | the guard, the merge guard, the checks |
| `--tags a,b` | `product,dev` (`dev` is always added) | changelog tags; release notes drop `dev:` |
| `--product-paths a/,b/` | `src/` | paths that owe a tagged changelog line |
| `--door-paths p,q` and `--door-approver <login>` | empty | paths that need a second person's approval before merge |
| `--board-file <path>` | empty | the board the queue and the digest read |
| `--decision-tag <word>` | `decision` | the tag of a board row that waits on a human |

A value is remembered in `.claude/team-stamp.lock`, so a re-run with no flags renders the same bytes.

## Modes

- `--check`: write nothing; exit 0 only when every file is present and unchanged.
- `--dry-run`: print what would be written.
- `--refresh`: after a kit upgrade, print one unified diff per file whose template changed, and
the `--take <path>` command for it. It writes nothing.
- `--take <path>`: replace exactly one file the repo did not edit (its hash equals its lock hash),
keeping the old copy as `<path>.orig`. An edited file is refused and its diff printed; the
operator applies it by hand. `--take` also swaps adopt's own `AGENTS.md` pointer and proof
marker for the stamp's versions.
- `--only <group,group>`: limit the run to named template groups (group tests use it).

## What it writes

The file list lives in the team stamp spec under `docs/specs/` ("Generated files"). In short:

- `AGENTS.md` (the kit marker on line 1, a closing optional-kit section naming only the public
URL) and `docs/TEAM-WORKFLOW.md`, with a CI parity check between them.
- `.claude/settings.json` (merged by entry, never rewritten), `scripts/agent-guard.sh`,
`scripts/agent-lessons.sh`, `.claude/memory/` seeded with five CI lessons, the `ship-pr` skill.
- `.github/workflows/ci.yml` (always `runs-on: [self-hosted]`), `scripts/pr-shape.sh`,
`scripts/check.sh` (the local twin), `scripts/check-owners.sh`, `OWNERS.md`,
`scripts/pr-merge.sh`, `scripts/negctl.sh`, each with its own test under `scripts/test-*.sh`.
- The issue form, `scripts/issues-from-rows.sh`, the PR template, `CHANGELOG.md`,
`scripts/release-notes.sh`, `scripts/team-digest.sh`, `docs/verification/README.md`, and a
`.kit.toml` with the proof gate on and the lane gate off.

`OWNERS.md`, `CHANGELOG.md` and the lesson notes are written once and then belong to the repo.

## Order with adopt

Either order works. Stamp first: adopt leaves the stamp's files alone. Adopt first: the stamp
reports adopt's `AGENTS.md`, proof marker and `.kit.toml` as left alone; `--take AGENTS.md` and
`--take docs/verification/README.md` swap the first two; a `.kit.toml` with `lane_gates = true`
gets a two-line drift report and is never edited. Kit hook entries in `.claude/settings.json`
are counted in a note and left in place.

## Limits

- It binds Claude Code through the project hook and every other agent through CI. A person who
merges from the GitHub site passes everything on a plan without branch protection; the
generated rules say so.
- The workflow needs a self-hosted runner. Without one it queues; `bash scripts/check.sh` is the
check until one exists.
- Language test jobs, product playbooks and the list of irreversible paths are the repo's own.

Detail: `lib/stamp/README.md` (how a template group plugs in), and the team stamp spec under `docs/specs/`.
8 changes: 8 additions & 0 deletions docs/MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ Index by loop stage (formerly "leg"; [`reference/workflow-paths.md`](reference/w
**When to invoke:** the first time in a repo, or after editing `[modules]` in `.kit.toml` (`--refresh` re-wires). `--check` is status only. `--with a,b,c` seeds those modules in a FRESH `.kit.toml`. `--single-source` keeps one agent guide instead of a CLAUDE.md/AGENTS.md pair. Several repos at once: `bin/wrap adopt <repo>...`.
**Common gotcha:** idempotent and non-destructive. A repo's own `AGENTS.md`, `CLAUDE.md`, or `.kit.toml` is never overwritten, and `--with` on an existing `.kit.toml` is a no-op. It installs pointers, never a copy of `lib/` or the full WORKFLOW. Detail: `commands/adopt.md`.

### `/kit:stamp`

**Phase:** front door (a kit-free harness for a repo whose team does not run the kit)
**Reads:** the target dir, its `origin/HEAD` for the default branch, its existing `AGENTS.md`, `.kit.toml`, `.claude/settings.json` and `.claude/team-stamp.lock`, and `templates/team-stamp/`
**Writes:** plain repo-owned files: a self-contained `AGENTS.md` and `docs/TEAM-WORKFLOW.md`, a project hook that blocks a bare merge and a push or commit on the default branch, session-start lessons, a ship playbook, a PR shape CI job with its local twin `scripts/check.sh`, an owners check, a merge guard, a negative control, an Issues work queue, a tagged changelog with release notes, a digest, a proof guide, and the lock. It merges `.claude/settings.json` by entry and commits nothing
**When to invoke:** once per repo, by the operator (`--owner <login>` is required), then `--check` to confirm and `--refresh` after a kit upgrade, which prints a diff per file and the `--take <path>` command for it
**Common gotcha:** a file the repo edited is never overwritten, and `--take` refuses it and prints the diff to apply by hand. The generated files run with no kit installed. The workflow always runs on `[self-hosted]`; without a runner, `scripts/check.sh` is the check. Detail: `lib/stamp/README.md`

### `/kit:grill`

**Phase:** intake (between type classification and the phase-0 `Done=` line)
Expand Down
Loading
Loading