no-mistakes: Skill for Claude Code

.agents/skills/gate-worktree-git-safety/SKILL.md

gate-worktree-git-safety is a skill for Claude Code from kunchenguid/no-mistakes. It costs 38 tokens per session (1,366 once invoked), scanned A, original, MIT.

A safety procedure for code pipelines that use Git worktrees, hooks, pull requests, and nested or recursive execution. It ensures these operations recognize when one pipeline is trying to start another pipeline improperly.

In plain words
What is it for?
Use it when changing gate containment, worktree placement, GitHub pull-request targets, bare-Git calls, or managed receive hooks.
Why use it?
It prevents recursive runs, unsafe directory changes, marker bypasses, and direct pushes from circumventing the pipeline's controls. It also keeps the generated user-facing skill consistent with the source code.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: installed under .agents/ (shared by several agents).

This is kunchenguid/no-mistakes's own configuration. It tells Claude Code how to work on no-mistakes itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything no-mistakes configures →

About the project

no-mistakes is a local Git proxy that validates changes in an isolated worktree before forwarding a push to the real remote and opening a pull request. It is for developers and coding agents that want automated checks, safe fixes, CI repair, and human review before changes are published.

kunchenguid/no-mistakes · 8,945 stars · on GitHub · kunchenguid.github.io

Reuse

Borrowing it

Nothing to install: this file belongs to kunchenguid/no-mistakes. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/kunchenguid/no-mistakes/main/.agents/skills/gate-worktree-git-safety/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/kunchenguid/no-mistakes

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gate-worktree-git-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/kunchenguid/no-mistakes/gate-worktree-git-safety/github.svg)](https://agentmods.dev/skills/kunchenguid/no-mistakes/gate-worktree-git-safety)
Your own site
<a href="https://agentmods.dev/skills/kunchenguid/no-mistakes/gate-worktree-git-safety"><img src="https://agentmods.dev/badge/skills/kunchenguid/no-mistakes/gate-worktree-git-safety/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gate-worktree-git-safety

Your own site · 80×15
<a href="https://agentmods.dev/skills/kunchenguid/no-mistakes/gate-worktree-git-safety"><img src="https://agentmods.dev/badge/skills/kunchenguid/no-mistakes/gate-worktree-git-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,366 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.01366
Opus 5.5 $0.00015 $0.00546
Sonnet 5.5 $0.00008 $0.00273
Haiku 4.5 $0.00004 $0.00137

Measured 9d ago against content hash 730d0d07ee61, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

gate-worktree-git-safety scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/gate-worktree-git-safety/SKILL.md · 36 lines

How it starts

The opening of the file, as written. The whole thing — 36 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Recursive Gate-Execution Containment

  • internal/gatecontext is the single classifier for recursive pipeline control. It combines canonical registered gate common-directory identity with OS-authenticated IPC peer ancestry; NO_MISTAKES_GATE is diagnostic only. CLI preflight, daemon mutation ingress, gate init/eject, branch-sync mutation, and the managed pre-receive hook must all keep using that owner so marker removal, cwd changes, and direct pushes cannot bypass refusal. Read-only AXI status/logs, help, and doctor remain available. Regressions: internal/gatecontext, TestGateStepCannotStartRecursivePipeline.
  • Every pipeline agent prompt receives the phase boundary from internal/gateguidance, and the generated user-level skill reuses the same owner. Step agents return only their assigned phase; the outer executor alone controls other validation, push, PR, and CI phases. Edit internal/skill/skill.go, then run make skill; never edit the generated skill directly.

Filesystem and Paths

  • Use filepath.Join; respect NM_HOME for app state; directories are 0o755 and files 0o644 by convention.
  • On macOS, path comparisons may need symlink resolution (/var vs /private/var); use worktrees.Canonical/worktrees.Contains wherever run worktree paths are compared, so one spelling matches everywhere.
  • Run worktree placement (worktree_roots) is owned by internal/worktrees. Configuration decides it exactly once, at run creation (Layout.Dir in RunManager.startRunWithIntentSource), and the result is persisted in runs.worktree_dir; every later consumer - resume, step diff, startup cleanup, procreap, eject, gatecontext attribution - must read it back through worktrees.RecordedDir and never re-derive it from config, so a mid-flight edit can neither strand a parked run nor point a removal at a directory the run never used. An empty column means the default <NM_HOME>/worktrees/<repoID>/<runID>.
  • worktrees.CheckPlacement is the single policy for an unusable root (inside NM_HOME, inside any registered checkout); config.ValidateWorktreeRoots owns what the config can judge alone. The daemon refuses to start on an unusable placement, so init --worktree-root must refuse exactly the same set or it prints a paste that takes the operator's CLI down, and EVERY init refuses to register a checkout that contains a configured root - the same state reached from the other direction. User-facing semantics live in docs/src/content/docs/reference/global-config.md. Regressions: internal/worktrees, internal/config/config_worktree_roots_test.go, internal/daemon/worktree_roots_test.go, internal/gate/eject_sweep_test.go, internal/cli/init_test.go.

Git on Bare Gate Repos (safe.bareRepository)

  • Agent harnesses and hardened CI inject safe.bareRepository=explicit, which forbids cwd-based discovery of bare repositories. Route every gate git call through git.Run, which detects a bare git dir and prepends --git-dir=<dir>; never shell out to git in a bare gate repo relying on cmd.Dir or -C discovery (issue #362).
  • Startup gate migration is DB-authoritative with a strict validated <id>.git legacy fallback; it must reject non-gates before hook or Git mutation and use git.RunBare so a malformed directory cannot discover an ancestor worktree. Completed migrations carry the content-versioned gate-config stamp and normal restarts must stay filesystem-only for current gates. Regressions: TestMigrateGateConfigsRejectsInvalidDirectoriesAndSkipsCurrentGates, TestColdDetachedStartupProductionGateCardinality.
  • Regressions: TestRunOnBareRepoUnderSafeBareRepositoryExplicit, TestWorktreeAddRemoveOnBareRepoUnderSafeBareRepositoryExplicit, TestInitUnderSafeBareRepositoryExplicit.

gh PR-Targeting From the Bare Gate Repo (internal/scm/github)

  • The daemon runs gh from the detached bare gate repo whose HEAD is the default branch, so every PR-targeting command must name the exact PR explicitly: an empty positional makes gh pr <verb> infer the cwd branch (main) and return no pull requests found for branch main even when the feature PR's checks are green. GetChecks, GetPRState, GetMergeableState, and UpdatePR route through the shared prSelector (number, else URL, else fail closed); UpdatePR then derives the number and owner/repo for a REST gh api --method PATCH repos/<slug>/pulls/<n> --input - (never gh pr edit, whose GraphQL lookup needs read:org) and also fails closed when no repository is known - never append a bare pr.Number/pr.URL that can be empty. This is the gh analogue of the git bare-gate-repo trap above.
  • Regressions: TestGetChecksTargetsKnownPRByURLWhenNumberMissing, TestPRTargetingReadsFailClosedWithoutIdentity, TestPRStateAndMergeableTargetKnownPRByURL, TestUpdatePRTargetsKnownPRByURLWhenNumberMissing, TestUpdatePRFailsClosedWithoutIdentity, TestUpdatePRPatchesPullRequestOverREST.

Read the full file on GitHub · 36 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago Changed 730d0d07ee61
  2. 1mo ago First seen · 36 lines · 38 tokens per session scan A 23689dd07326

Subscribe to this mod's changes

gate-worktree-git-safety is a skill published in the GitHub repository kunchenguid/no-mistakes (8,945 stars, last pushed today), licensed MIT. It adds 38 tokens to every session and 1,366 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.