Agent skill

Patch Discipline

by D-Robotics in D-Robotics/moss

How to make code changes in the moss repo — read-before-edit, minimal diffs, verify with real runs

MITAuto-check passed

Install Patch Discipline

skills CLI
$ npx skills add D-Robotics/moss --skill patch-discipline -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install D-Robotics/moss patch-discipline --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/D-Robotics/moss.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.moss/skills/patch-discipline .claude/skills/patch-discipline && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
patch-discipline
GitHub stars
143
Token cost
~264 tokens
SKILL.md length
120 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

How to make code changes in the moss repo — read-before-edit, minimal diffs, verify with real runs

  • Works in 7 steps: Read the real source before editing.… → Make the minimal change that fixes the… → Every user-facing success message must… → …
  • Calls npm

What it does

Patch Discipline is an agent skill from D-Robotics/moss. How to make code changes in the moss repo — read-before-edit, minimal diffs, verify with real runs

Its SKILL.md is about 260 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The licence is MIT.

Example prompts

  • “/patch-discipline”

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Read the real source before editing. Never guess behavior from file names.
  2. Make the minimal change that fixes the problem. Match surrounding style; do not refactor neighbors in the same patch.
  3. Every user-facing success message must come from a real probe, exit code, or post-condition — never a fixed string.
  4. All subprocesses go through runProcess / spawnProcess from src/utils/run-process.ts; tool paths must not use execFileSync/execSync.
  5. New tools must declare metadata.sideEffectClass (readonly vs mutating drives approval).
  6. After a logic change: npm run build then run the touched spec (npm run test:filter -- --filter ). A bug fix needs a red-then-green…
  7. Errors crossing tool/provider/CLI boundaries become MossError with the original cause preserved.

What it can do on your machine

Read from SKILL.md and the folder at commit 58e7f61. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Patch Discipline loads about 264 tokens when it runs. Until then it costs about 29 tokens; SKILL.md has 120 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~29
When it runs · the whole SKILL.md, loaded when a task matches
~264

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from D-Robotics/moss at commit 58e7f61, republished under its MIT licence (© D-Robotics). 120 words, ~264 tokens.

Download SKILL.mdSave it as .claude/skills/patch-discipline/SKILL.md (or your agent's skills folder).
name
patch-discipline
description
How to make code changes in the moss repo — read-before-edit, minimal diffs, verify with real runs
when
editing any file in this repository or producing a patch

Patch discipline for moss

  1. Read the real source before editing. Never guess behavior from file names.
  2. Make the minimal change that fixes the problem. Match surrounding style; do not refactor neighbors in the same patch.
  3. Every user-facing success message must come from a real probe, exit code, or post-condition — never a fixed string.
  4. All subprocesses go through runProcess / spawnProcess from src/utils/run-process.ts; tool paths must not use execFileSync/execSync.
  5. New tools must declare metadata.sideEffectClass (readonly vs mutating drives approval).
  6. After a logic change: npm run build then run the touched spec (npm run test:filter -- --filter <module>). A bug fix needs a red-then-green regression spec.
  7. Errors crossing tool/provider/CLI boundaries become MossError with the original cause preserved.

© D-Robotics, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .moss/skills/patch-discipline of D-Robotics/moss.

Open the folder on GitHubat commit 58e7f61

Compare with similar skills

Patch Discipline next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Patch Discipline compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Patch Discipline this skillD-Robotics/moss143—~264Automated safety check: PassMIT
Surgical PatchJuliusBrussee/caveman110k1 repos~166Automated safety check: PassApache-2.0
Patch Editnexu-io/open-design100k—~470Automated safety check: PassApache-2.0
Patch Release CheckClickHouse/ClickHouse50k—~4kAutomated safety check: NotesApache-2.0
Slate Patchudecode/plate17k—~3.8kAutomated safety check: PassCustom licence
Authoring VPhone Patch SetsLakr233/vphone-cli15k—~4.6kAutomated safety check: PassMIT

Similar skills

  • Surgical Patch

    JuliusBrussee/caveman

    Fix bugs and small behavior changes at the narrowest responsible layer. Use when regression proof, preserved surrounding behavior, and task-relevant tests…

    110k GitHub starsUsed in 1 repo~166 tokens
    DevelopmentAuto-check passed
  • Patch Edit

    nexu-io/open-design

    Apply one rewrite-plan step at a time as small reviewable file edits, never rewriting whole files when a localised change suffices.

    100k GitHub stars~470 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Patch Release Check

    ClickHouse/ClickHouse

    Check whether ClickHouse's supported versions (last 3 majors + latest LTS) have recent stable patch releases, diagnose why the scheduled AutoReleases pipeline failed, and identify which releases…

    50k GitHub stars~4k tokensUpdated today
    DatabasesAuto-check: notes
  • Slate Patch

    udecode/plate

    Fix Slate v2 bugs in one pass with reproduction, behavior tests, architecture/DX/perf pressure, proactive rearchitecture when the patch is not the cleanest long-term shape, and final autoreview.

    17k GitHub stars~3.8k tokensUpdated today
    Auto-check passed
  • Authoring VPhone Patch Sets

    Lakr233/vphone-cli

    Explains how to declare a firmware patch in a vphone patch set, add a new set, or write a preset, including naming, gating and the checks that catch undeclared patches.

    15k GitHub stars~4.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Per-channel strict prompts, mention gating, silent observation, and a communication autonomy policy for agents that sit in shared channels with external counterparties.

    275k GitHub stars~2.3k tokensUpdated 3 days ago
    Productivity & AutomationAuto-check passed

More from D-Robotics/moss

  • Bench Repro

    D-Robotics/moss

    How to reproduce and grade a bench task or A/B arm for moss capability work

    143 GitHub stars~288 tokensUpdated 5 days ago
    Auto-check passed
  • Worktree Parallel

    D-Robotics/moss

    How to run writable sub-agents in isolated git worktrees and merge their lease patches

    143 GitHub stars~313 tokensUpdated 5 days ago
    Auto-check passed

Questions about Patch Discipline

What does Patch Discipline do?

How to make code changes in the moss repo — read-before-edit, minimal diffs, verify with real runs. Patch Discipline is an agent skill from D-Robotics/moss.

How do I install Patch Discipline in Claude Code?

Run `npx skills add D-Robotics/moss --skill patch-discipline -a claude-code`. Or copy the skill folder (.moss/skills/patch-discipline in D-Robotics/moss) into .claude/skills/patch-discipline in your project. Claude Code loads it when a task matches its description.

How do I install Patch Discipline in Codex?

Run `npx skills add D-Robotics/moss --skill patch-discipline -a codex`. Or copy the skill folder (.moss/skills/patch-discipline in D-Robotics/moss) into .agents/skills/patch-discipline in your project. Codex loads it when a task matches its description.

Can I use Patch Discipline in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add D-Robotics/moss --skill patch-discipline -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/patch-discipline, .gemini/skills/patch-discipline, .github/skills/patch-discipline and .opencode/skills/patch-discipline in your project.

What does Patch Discipline need to run?

Going by SKILL.md and its folder, Patch Discipline needs the command-line tools its instructions call (npm).

Does Patch Discipline access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Patch Discipline safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Patch Discipline use?

Patch Discipline is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Patch Discipline use?

About 264 tokens (SKILL.md is roughly 1.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Patch Discipline?

Skills that share tags, products or a category with Patch Discipline: Surgical Patch (JuliusBrussee/caveman, 110k stars), Patch Edit (nexu-io/open-design, 100k stars), Patch Release Check (ClickHouse/ClickHouse, 50k stars) and Slate Patch (udecode/plate, 17k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Patch Discipline?

D-Robotics (a GitHub organization) maintains it in D-Robotics/moss, which has 143 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 2, 2026.

Source: D-Robotics/moss on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.