My Claude Code setup as a plugin marketplace: guardrails that hold whether or not the agent reads its instructions, and the skills I work with, adapted from mattpocock/skills, pstack, HumanLayer and tstack.
Claude Code only for now. Codex and other hosts will follow.
| Path | What it does |
|---|---|
plugins/dk-guard |
PreToolUse hook on Bash. It denies docker/podman prune, mass removal without a label or name filter, pushes to main/master (explicit, HEAD:main, or a bare push while on main, or on the branch a git checkout or git switch earlier in the call names; one that may not have run leaves both branches possible, and git checkout <name> counts only when <name> is a local branch, since it may name paths), plain force pushes (--force-with-lease and verify-assets/* are fine), git push --mirror, git clean -x, reading ~/.sentryclirc, ~/.aws/credentials, ~/.netrc or a private SSH key (ls, stat or [ -e ] pass when their output feeds no other command, and the name in the pattern or script of sed, grep, rg or awk is text, not a read, unless the script reads files itself, as sed's r or awk's getline do; Sentry events come from the Sentry helper named in the repo's docs/agents/observability.md), a zsh special parameter such as path (tied to PATH), status or argv as a for, read or assigned variable, which leaves every later command "not found" (PATH=…, path+=(…) and path=(… $path) pass), three more zsh shapes that break a call ($name: before a modifier letter, as in $c:refs, which loses :r; a variable holding a command with spaces, set in the same call or as a quoted item of a for, foreach or select list, used as the command, which zsh does not split (${=name} or an array passes); a function named like one of your zsh aliases, such as g(){ … } when g is an alias, which zsh refuses to define; the names come from the list bootstrap.sh writes, and without it this rule denies nothing), gh issue view --comments without --json, which drops the body when piped, a gh issue create whose body, a here-doc of the same call or its --body, opens with Found while working on #N (after the agent marker or a one-line note) and has no Not folded in: <test>: <why> line naming one of dk:issue-flow's fold-in tests or near compaction, so each side finding says why it was filed (a body file the call does not write is not read, nor are the call's here-docs when each issue carries its body as plain text in --body), a gh pr create (or gh pr new) or gh pr edit whose body holds Generated with [Claude Code] outside a code span or fenced block, since dk:pr ends a PR body on its Closes #N or Refs #N line (it reads --body, the here-docs that feed the body (stdin for --body-file -, a substitution in --body or in the variable it names, one written to the body file earlier in the call) and the file --body-file or -F names, from disk as the call's cds resolve it unless the call rewrites it with >; a body file that is missing, unreadable, no regular file, over 1 MiB or piped in gives no finding), rm inside a dk:verify run directory (verify.XXXXXX, named by its path, a variable the same call sets, a cd into one, or a session already there), since a rerun takes a new one and the earlier runs stay as evidence (a file inside the control checkout $RUN/base/ and a cookie jar may go (not with -r, since a jar is a file), a glob only when its text before or after the wildcards ends in an extension other than an image's, so cookies-*.txt goes and cookies.* does not; the denial names the route for the rest, a move into the run's discarded directory), a cat with no file, nothing piped in and no here-doc, here-string or < input, which waits on stdin until the call times out (one in a function body reads what the call feeds it, one in a subshell, group, loop or if reads a pipe into it or input given to it, as in { cat; } < f, and the script of bash -c reads the input given to bash; 3< f feeds descriptor 3, not the cat), and a backtick span in an unquoted here-doc body (<<EOF, <<-EOF), which the shell runs as a command, so a Markdown code span in a PR body runs (an escaped \`, $(…) and a quoted <<'EOF' pass). It also denies a CI or merge wait in the foreground (gh pr checks --watch, gh run watch, or a loop that runs gh pr, gh run or a read-only gh api call and sleeps; gh api reads with no method and no fields, with GET named last (fields then go into the query string), or as a GraphQL query, not a mutation; zsh's one-line for x (…) cmd and foreach x (…) cmd; …; end count as loops; a for over at most three literal items, holding no loop, that reads only the merge state, gh pr view --json with mergeable or mergeStateStatus and without statusCheckRollup, and sleeps at most 5 s is a retry, not a wait), which blocks the session until it returns; the same command started with run_in_background passes. It asks before rewriting or deleting pre-main, before a push to the current branch when it cannot tell which branch that is (cd "$WT" && git push resolves only with WT set to a path earlier in the call, and it, the cd and the push outside $(…), subshells, if, loops, functions and anything else that may not run, with no git checkout or switch before the push; after a git checkout, git switch or gh pr checkout whose branch it cannot read, such as -, a variable or --detach, it asks too), and before dk-gc --workspace (or a $ word that may hold it) with --yes or piped input, so the one yes for every repo stays the human's (dk-gc --yes in one repo passes). Piped gh pr view --comments gets a hint that the body is missing, and a Postgres server started by docker run (detached or without --rm) and without a dk.issue label gets a hint to use dk-pg, and git worktree remove inside a for, while or until loop gets a hint to use dk-gc. The rules match on the command's words, split once as the shell reads them (quotes, here-docs, redirections, substitutions and bash -c scripts included); a command it cannot split gets the raw-string checks. The hook has 30 s and fails closed (onFailure: block). Every hook starts with the interpreter scripts/find-python.sh names: where the first python3 on PATH is pyenv's shim, the one pyenv would pick, started directly, which saves the shim's 80 ms per call; the Bash guard runs from its bytecode cache, compiles each pattern on its first use and imports subprocess only to ask git for a branch, so a call no rule matches compiles about ten. bin/dk-pg is on the agent's PATH: dk-pg up <issue> starts a throwaway Postgres (--rm, tmpfs, labels dk.repo, dk.root and dk.issue) on a free port and prints its URL, dk-pg url <issue> reprints it, dk-pg status <issue> prints it or that none runs and exits 0 either way (the teardown check), dk-pg down <issue> removes it. dk-gc lists the worktrees and local and remote branches of merged PRs and the dk-pg databases of closed issues of the repo it runs in (--workspace: every repo under ~/workspace, grouped by repo; outside a repo it stops and names that flag), asking GitHub in parallel, then removes them after one yes (--dry-run only lists); it never removes pre-main, verify-assets/*, the base of any PR, a branch with an open PR, a worktree with uncommitted changes, or a worktree with ignored files outside a regenerable list (node_modules/, dist/, build/, .next/, .output/, target/, .venv/, __pycache__/, test-results/, .api-port, .tanstack/, *.tsbuildinfo, *.gen.*, .env*, matched at any depth, so frontend/.tanstack/tmp/ counts, but not on a folder that holds tracked files), which its "keep" line names, since git worktree remove deletes ignored files without asking, or a worktree a process still runs in (its working directory inside, as lsof reports it; an agent's background loop, a dev server), which its "keep" line names with the process and pid, keeping the worktree too when lsof cannot tell; both worktree checks run again just before each removal, and dk-gc --in-use <worktree> runs the process check alone, for a worktree removed by hand. dk-assets push <issue> <file>… pushes verify screenshots from the session's scratch directory as an orphan commit to verify-assets/<issue> (a rerun replaces it) and prints the commit SHA and one embeddable URL per file. dk-runs prints the last run of dk:retro and dk:verify-doc-check per repo from the run record both skills write with dk-runs record <skill> <outcome> (~/.claude/plugins/data/dk-guard-dk-agent-kit/runs.jsonl), and dk-runs due <skill> exits 0 once this repo's last run is 28 days old or none is recorded, which a scheduled run checks first. dk-comment-edit <comment id> <file> replaces the body of an issue or PR comment, a thread reply included, and prints its URL: only a comment the gh user wrote that opens with dk:issue-flow's agent marker (or the visible note it replaced), and only with a body that opens with the marker. Its PATCH runs inside it, so its command line matches none of the product repos' ask rules on gh api PATCH, PUT and DELETE, and a correction needs no approval. dk-gate runs the checkout's executable .claude/gate.sh and keeps a pass: before a run it hashes the committed tree, the tracked changes, the untracked files that are not ignored, the gate script (and the script it links to), the root lockfiles and the merge base with origin/pre-main, origin/main and origin/master, and when that key matches the worktree's last pass it reports the pass as cached and runs nothing (--fresh runs it anyway). Only a pass is kept, and only when the tree did not change while the gate ran; the cache lives outside the repo, one entry per worktree, in ~/.claude/plugins/data/dk-guard-dk-agent-kit/gate-cache/. At most two gates run at once on the machine, hand runs and push runs alike, whatever each session's Claude config directory: a run that needs the gate takes a slot (a flock on a file in ~/.claude/plugins/data/dk-guard-dk-agent-kit/gate-slots/, which the kernel frees when its holder dies, so a killed run leaves no stale slot), waits up to 240 s for one when both are held, and otherwise stops with a message that the gates are busy (exit 3) and does not run; a cached pass takes no slot. One gate runs per checkout at a time (a flock per checkout beside the slots): a second run on the same checkout waits for the first, holding no slot, then reuses its pass on the same tree or runs the gate (--fresh always runs), so an overlapping run can leave no stale pass; that wait counts against the same 240 s, and a checkout whose run outlasts it stops with exit 3, naming that run. The gate runs with DK_GATE_WORKERS (default 4) in its environment, for its script to pass to its tools (go test -p, vitest --maxWorkers, golangci-lint --concurrency); a gate that ignores it runs as before. DK_GATE_SLOTS, DK_GATE_WAIT and DK_GATE_WORKERS, set in the environment (env in settings.json), change the slot count, the wait and the limit; the defaults suit two gates on a 12-core machine (#149). A second PreToolUse hook gates pushes: before a git push it runs dk-gate in the checkout being pushed (the cd or git -C target, so a push from a worktree runs that worktree's gate wherever the session started), so a pass by hand or at an earlier push of the same tree is reused, and denies the push when the gate fails, with its last lines, or when the gate did not run, with a message that says why and to push again: no gate slot freed in time, the checkout's own run (by hand, say) outlasted the wait, or less of the push's 540 s was left once the tree was hashed than the checkout's last pass took, so a gate the push would kill never starts; the waits count against the 540 s. The gate runs at the push and by hand, not when a turn ends: sessions sit in the clean main checkout, so a gate on uncommitted changes there ran in 6 of 2,055 stops and blocked none (#148). Pushes of verify-assets/*, branch deletes and pushes the guard denies anyway run no gate; a push whose directory is known only at run time (as in the ask above), or does not exist before the call, runs none either, nor does one after a switch earlier in the call to another branch's tree, since the gate runs before the call, on the tree the checkout holds then (a new branch at the current commit, git checkout -b <name>, keeps the tree and is gated); the agent is told so. A gate still running after 540 s is killed and the push goes through with a message to you; the hook fails open. A PreToolUse hook on the Agent tool denies a forked subagent that is asked to implement an issue, to commit, push or open a PR, or to run git worktree add (see Session hooks), and one on the MCP tools that create or update a PR denies the same attribution line in their body. |
plugins/dk |
The skills, called as /dk:<name>. You start: triage, implement, implement-spec, batch-pr, to-spec, to-tickets, research-codebase, grill-with-docs, improve-codebase-architecture, teach, prototype, retro, verify-doc-check, handoff, modernize, setup. Other skills call: issue-flow, verify, diagnosing-bugs, post-deploy-check, tdd, code-review, pr, blast-radius, ordering-check, research, grilling, domain-modeling, codebase-design, writing-for-agents. Agents: the read-only reviewers reviewer, comment-reviewer and proof-reviewer, and HumanLayer's codebase-locator, codebase-analyzer, codebase-pattern-finder. Each repo supplies its facts in adapter files that /dk:setup writes. |
upstream/ |
UPSTREAM.md records the commit every adapted file was taken from and whether it is as-is or adapted; sync.sh shows what mattpocock/skills, pstack, HumanLayer and tstack changed since in those files. |
settings/user.fragment.json |
What a plugin cannot ship: permission allow (the sanctioned pushes, dk-assets push and dk-comment-edit), deny and ask rules, an autoMode.allow line that lets comment and label writes on issues and PRs in the maintainer's own repos past the auto-mode classifier, loops included, autoMode.hard_deny lines, the Bash timeouts (10 minutes for a call that names none, up to 30 for one that does), and attribution.pr set empty, so no PR body gets the "Generated with Claude Code" line. Merged into ~/.claude/settings.json by bootstrap.sh. |
bootstrap.sh |
Stops on a user skill in ~/.claude/skills named like a dk skill, naming the path to remove. Otherwise shows the settings diff, the zsh options block for ~/.zshenv, the zsh alias-name list for dk-guard and the --isolated change to the playwright MCP server; --apply backs both files up, writes them and the list, installs the plugins from this checkout and re-registers the server. |
tests/ |
The guard's case matrix (taken from real incidents), fixture repos for dk-gate, the push gate and the session hooks, every hook command started against a fixture pyenv, a dk-pg run against Docker, a dk-gc run against fixture repos with stubbed gh and docker, a dk-assets run against a local origin, a dk-runs run against fixture repos and a temp run record, a run of dk:post-deploy-check's due script against fixture issues with a stubbed gh, a dk-comment-edit run against the stubbed gh and the product repos' ask rules, a bootstrap test with a stubbed claude and zsh, an upstream/sync.sh run against fixture upstream repos, a check of the skill-eval fixtures, a run of the dk:retro extraction script against fixture transcripts, runs of the dk:batch-pr collection, review and finish scripts against a fixture repo with the stubbed gh, coderabbit and dk-gc, a run of dk:issue-flow's pr-wait watcher against a stubbed gh, a run of dk:issue-flow's repo-owner check against the stubbed gh and fixture remotes (forks and upstreams of another owner), a run of dk:code-review's tier script against fixture repos, a run of dk:writing-for-agents' probe against a stubbed claude, fixtures for the fork guard and the MCP PR hook, run.py, the runner that picks the checks a change needs, and replay_history.py for checking the guard against past transcripts. |
THIRD_PARTY/ |
Licenses and commits of the projects material is adapted from. |
Every rule traces back to something that went wrong in a real session: a
triage agent ran docker container prune -f and deleted other projects'
containers; prototype work in ignored docs/* was lost; an agent scraped a
token out of ~/.sentryclirc. Rules in prose did not prevent these, so they
live in a hook now. The hook raises the floor against mistakes; it is not a
security boundary.
Every issue reaches ready-for-agent by one of two paths, then follows the
same line to deploy.
flowchart LR
subgraph feature["Big feature"]
grill["dk:grill-with-docs"] --> research["dk:research-codebase"]
research --> spec["dk:to-spec<br/>epic, label spec"]
spec --> tickets["dk:to-tickets<br/>sub-issues"]
end
subgraph bug["Bug or side finding"]
new(["new issue<br/>needs-triage"]) --> triage["dk:triage<br/>agent brief"]
end
tickets --> ready(["ready-for-agent"])
triage --> ready
dk:research-codebase reads the ticket and turns it into neutral questions;
the documentarian subagent that answers them never sees the ticket or the
conversation, so it describes the code as it is rather than arguing for a
solution.
flowchart LR
ready(["ready-for-agent"]) --> implement["dk:implement<br/>worktree off pre-main"]
implement --> verify["dk:verify<br/>control run, teardown"]
verify --> review["dk:code-review<br/>axes by tier, findings answered"]
review -- "behaviour fix to a Correctness or Spec blocker or should, up to 2 rounds" --> review
review --> pr["dk:pr<br/>PR into pre-main"]
implement -. "side finding" .-> intake{"scope<br/>intake"}
intake -- "defect, same surface" --> implement
intake -- "otherwise" --> new(["the surface's open issue,<br/>or a new one"])
A bug whose cause is not known yet goes through dk:diagnosing-bugs before
the fix: a command that reproduces it, ranked hypotheses, then the
regression test through dk:tdd. A bug that only some order of events
triggers (a retry, a second writer, a webhook that overtakes the write it
follows), which the reporter's steps or a loop do not reproduce, goes from
dk:triage or dk:diagnosing-bugs to dk:ordering-check: it tries every
order up to a stated bound and leaves a failing replay test for each order
that breaks the code's promise. Each review finding carries an id and a
severity (blocker, should or nit) and gets an outcome in a ledger, kept in
the PR body: fixed, disagree or declined.
flowchart LR
open(["PR open"]) --> watch["pr-wait watches<br/>checks, people, threads, base, bot"]
watch -- "a finding or a comment" --> fix["fix and push<br/>reply on its thread"]
fix --> watch
watch -- "nothing left on the head" --> gate{"ready gate"}
gate --> verdict(["one verdict<br/>ready, waiting or blocked"])
verdict --> merged["pr-wait --until merged<br/>in the background"]
merged -- "a conflict" --> rebase["rebase and push"]
rebase --> merged
merged -- "merged" --> after(["after-merge steps<br/>waiting tickets start"])
dk:issue-flow step 6 runs pr-wait under Monitor, so each event on the
PR wakes the agent: a check that fails, one summary line once every check has
finished, a human comment, an unresolved thread, a base that moved over the
PR's files, the review bot's verdict. A comment edit wakes nothing, nor does
each check that passes, so a change asked for goes in a new comment. The ready
gate hands the PR to the maintainer with one verdict, and a condition the agent
cannot read counts as Blocked. The session that hands the PR over then
watches it with pr-wait --until merged until the merge: a conflict gets a
rebase and a push, a merge the after-merge steps, with no one relaying either.
A base workflow.md names under No CI skips the watcher's wait for checks
to register. A PR that went stale while others merged gets
/dk:modernize: it rebases the PR, or describes a rework or recommends
closing it; doing the rework and closing the PR stay the user's call.
flowchart LR
pr["merged into pre-main"] --> batch(["dk:batch-pr<br/>batch PR to main, deploys"])
batch -- "Closes" --> closed(["issue closed"])
batch -- "Refs" --> check["dk:post-deploy-check<br/>awaiting-verification"]
check --> closed
closed -.-> retro["dk:retro<br/>monthly"]
retro -. "repeat mistake" .-> guard[["new dk-guard check"]]
closed -.-> vdc["dk:verify-doc-check<br/>monthly"]
vdc -. "drifted step" .-> fix(["fix PR or new issue"])
The scope intake decides what a side finding becomes: a defect on the same
surface joins the issue as a recorded scope amendment, anything else is filed,
in the open issue its surface already has or as a new one. An issue with a
Refs line stays open until its post-deploy check passes. The check comes
due on its own: the session that labels the issue schedules a one-off run at
the due date where the host's scheduler outlives the session and runs on this
machine (T3 Code's scheduled tasks; Claude Code's CronCreate and cloud
scheduled tasks do not), and every session in the repo opens with a line
naming the checks past their date.
Two runs come back every month in each repo: /dk:retro over the month's
sessions turns each repeated mistake into a check, and /dk:verify-doc-check
runs the repo's docs/agents/verify.md in a fresh worktree and fixes or files
every step that no longer works. Each run leaves a run record that dk-runs
prints, the last run per repo. They come due on their own: /dk:setup offers
a weekly T3 Code task per run that starts it once its last run is 28 calendar days old
(a scheduled retro files its report as one needs-triage issue and changes
nothing; a scheduled doc check ends in its PR, its issues or blocked, and
records clean when nothing drifted), and on any host the session baseline
names a run more than 35 days old.
flowchart LR
subgraph call["Every Bash call"]
bash["agent runs Bash"] --> hook["L1 guard-bash<br/>PreToolUse, fails closed"]
hook -- "pass" --> deny["L2 deny rules<br/>settings.json"]
hook -- "deny, ask or hint" --> d1["bash -c '… prune'<br/>git -C … push main<br/>gh … --comments, piped"]
bash -- "git push" --> pgate["L1 push gate<br/>dk-gate in the pushed checkout:<br/>.claude/gate.sh or its cached pass,<br/>fails open"]
pgate -- "gate fails: deny, last lines fed back" --> d0["push from a worktree<br/>whose gate fails"]
pgate -- "pass" --> deny
deny -- "deny" --> d2["docker … prune …<br/>git push … main<br/>Read ~/.sentryclirc"]
deny -- "pass" --> mode{"auto<br/>mode?"}
mode -- "other modes" --> run["command runs"]
mode -- "auto mode" --> auto["L3 classifier<br/>hard_deny"]
auto -- "pass" --> run
auto -. "may deny" .-> d3["judged destructive"]
end
The hooks run before the permission rules, and nothing they return overrides
a matching deny rule. L1 (guard and push gate) and L2 are deterministic and
ship here. L3 runs only in auto mode, is a judgement call, and is only a
backstop. CI is the next layer, outside the session, and skill
text and AGENTS.md the last.
dk-guard also opens every session with a baseline of at most 15 lines:
repo and branch, primary checkout or worktree, uncommitted changes, the open
PR for the branch, the labels of the issue the branch names
(<type>/<issue>-<slug>), the dk-pg databases running for it and, from 5
linked worktrees on, their count with a pointer to dk-gc --dry-run (counted
with git alone, since a dry run asks GitHub about every branch), and the open
awaiting-verification issues whose post-deploy check is overdue: the last
Due: <UTC timestamp> line in their comments has passed with no verdict since,
and the monthly runs whose last run is more than 35 days old or unrecorded:
dk:retro in a repo set up for dk (docs/agents/workflow.md) with sessions,
dk:verify-doc-check in one with docs/agents/verify.md. The list of changed
files shrinks to keep the baseline inside 15 lines. It is silent outside a git
repo.
A repo can require worktrees with one committed setting in its
.claude/settings.json:
{ "env": { "DK_REQUIRE_WORKTREE": "1" } }An Edit or Write to a file in that repo's primary checkout is then denied
with the worktree command from its docs/agents/workflow.md, or, when that
file has none, dk:issue-flow's command on origin/pre-main (the remote's
default branch without it); the same edit in a linked worktree goes through.
Several sessions share a primary checkout and only the branch pointer moves,
which is where parallel sessions collided. Both hooks fail open: a crash never
blocks an edit.
A PreToolUse hook on the Agent tool denies a forked subagent
(subagent_type: "fork") whose description or prompt asks it to implement a
named issue, to commit, push or open a PR, or to run git worktree add. A
negated ask ("do not commit or open a PR"), a branch, an existing worktree or a
quoted mention of the command denies nothing. It reads phrases, so an ask worded
in a way it does not know goes through. A fork inherits the whole
conversation, so the deny tells the agent to relaunch it as a plain subagent
with the brief. Sweep forks that work a slice of files and leave commits to the
parent, and every plain subagent, go through. It fails open.
A PreToolUse hook on the MCP tools that create or update a PR (names ending
pull_request_create, pull_request_update, create_pull_request or
update_pull_request, on any server) denies a call whose body holds
Generated with [Claude Code] outside a code span or fenced block, as the Bash
guard does for gh pr create and gh pr edit: dk:pr ends a PR body on its
Closes #N or Refs #N line, whatever the harness asks for. It fails open.
git clone https://github.com/kaminski-dev/dk-agent-kit ~/workspace/dk-agent-kit
cd ~/workspace/dk-agent-kit
./bootstrap.sh # read the diff
./bootstrap.sh --apply # write it, add the marketplace, install dk-guard and dkThe marketplace is added from the local path, and its relative plugin
sources load straight from this checkout: after git pull, /reload-plugins
or a restart applies the changes, with no version bump and no
claude plugin update. Client-specific settings
(autoMode.environment, for example) go in ~/.config/dk-agent-kit/private.json;
bootstrap merges that file last, and it never enters this repo.
Merge rules: objects merge key by key, arrays gain the entries they lack and nothing is removed, scalars from the fragment win. A second run is a no-op.
A user skill named like a dk skill wins the bare name: /retro ran a stale
copy in ~/.claude/skills/retro in place of dk:retro. Before it shows or
writes anything, bootstrap looks in ~/.claude/skills
($CLAUDE_CONFIG_DIR/skills when set) for a directory or link, followed to
its target, that holds a SKILL.md and has the name of a skill in
plugins/dk/skills. It lists each one, with a link's target and the rm
that clears it, and exits 1. Remove those paths (a link alone, not its
target, which other tools may still use), then rerun bootstrap. Only
~/.claude/skills is checked, since Claude Code loads user skills from
there; a copy in another tool's directory such as ~/.agents/skills shadows
nothing until a link in ~/.claude/skills points at it, and the check
follows that link.
The Bash tool runs zsh, and agents write bash. Bootstrap appends a marked
block to ~/.zshenv ($ZDOTDIR/.zshenv when set) with setopt NO_NOMATCH
(an unmatched glob such as --include=*.go passes through literally) and
unsetopt EQUALS (echo ==== is not expanded to a command path). The rest
of the file stays as it is. A file that already has the marker, or sets both
options by hand, is left alone.
zsh refuses to define a function named like an alias ("defining function based
on alias"), and agents write helpers such as g(){ … }. Bootstrap asks an
interactive zsh for your alias names (the names only, never what they expand
to) and writes them to ~/.config/dk-agent-kit/zsh-aliases, beside the
private overlay, where dk-guard reads them from HOME alone; it denies a
function with one of those names. Rerun bootstrap after changing your aliases.
Two sessions started from one directory share the Playwright MCP browser
profile, and the second gets "Browser is already in use". When a user-scope
playwright MCP server runs without --isolated (in-memory profile),
bootstrap shows the args it would change, and --apply re-registers the
server through the CLI (claude mcp remove, then claude mcp add-json with
the same command, args and environment plus --isolated), keeping the old
definition in a private playwright-mcp.json.bak-* next to the settings file;
environment values are never printed. Sessions started afterwards pick it up. A server that already has the flag, or a project- or
local-scope one, is left alone, and bootstrap never adds one that isn't there.
dk:ordering-check checks most code with a test it writes in the repo's own
test style. For actors one test process cannot drive (browser tabs, a third
party's uncertain answer, an outside clock) it checks a TLA+ model instead,
which needs Node 22.18 to 22.x, Node 23.6 or later, Bun 1.1.5 or later, or
Deno 2.0 or later on PATH, and network access the first time: its
tla-toolchain script downloads a pinned Temurin 21 JDK (checked against
the checksum Adoptium publishes beside it), tla2tools.jar (against a pinned
SHA-256) and pstack's statechart (at a pinned commit), and keeps them in
~/.claude/plugins/data/dk-dk-agent-kit/tla-toolchain
($CLAUDE_CONFIG_DIR/plugins/data/… when set). Deleting that folder is safe;
the next model run downloads them again.
python3 -I tests/run.py # every check, with each one's seconds
python3 -I tests/run.py origin/main # the checks the changes since origin/main needWith a base ref, the runner reads the paths changed since the merge base
(committed, staged, unstaged and untracked) and runs the checks its map in
tests/run.py names for them, plus the always-on ones, which take under two
seconds each. A changed path the map does not know runs every check, and
tests/test_run.py fails on a test file the map does not name. The skill
checks are tests/test_skills.py for those across skills and
tests/skills/test_<skill>.py for one skill's prose. claude plugin validate .
needs claude on the PATH, and tests/test_dk_pg.sh skips without a Docker
daemon. CI runs every check once per push to a PR branch and once per push to
main.
The evals for dk:implement, dk:triage, dk:code-review (a report on all four axes, with
seeded Standards and Correctness defects, one reviewer for a small change, and a Proof axis that finds a
control run that never showed the bug) and dk:verify (a refactor whose outputs differ) live in
plugins/dk/evals/ and need a model, so they run by hand (the command is in
docs/agents/workflow.md), not in CI.
replay_history.py <commands.jsonl> runs every past Bash command through the
guard and lists what it would deny, ask or hint, so a new rule can be checked
for false positives before it ships.
A repeated mistake becomes a check, not another paragraph: add a case to
tests/hooks/guard_bash_cases.json that reproduces it, see it fail, change the
guard, and replay the history to see what else the rule catches.