ub-mode skill
ub-mode is a skill for Claude Code, Cursor and Codex that sets edit order: make it work first, then clean up by metrics.
- 7,890 ★ on the repository
- Last commit
- MIT
Minimal access
Why this level
- The rules tell the agent to commit, push to the main line and delete code the tests do not cover.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/ub-modeDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewMinimal accessThe tool runs nothing and makes no network calls.
- The rules tell the agent to commit, push to the main line and delete code the tests do not cover.
This is third-party code. Review the repository files before installing.
What it does
ub-mode is a single `SKILL.md` that makes an agent work through every code change in three stages: make it work, make it right, then follow working practice. In the first stage the agent writes a failing test before the change, makes the smallest edit, subtracts before adding, and keeps domain logic in pure functions with validation at the boundary. The second stage leans on measurable thresholds. `crapper` scores function complexity against coverage (CRAP under 10), `dryer` finds structural duplication (similarity of 0.8 or more must go), and `mutator` tests the tests: cover the uncovered, kill surviving mutants, delete dead code. The third stage asks for an action log, a guarded context window and small ordered commits that explain why.
Who it is for. Developers who hand code changes to an agent and want TDD discipline and measurable quality instead of "seems to work".
Good fit when
- The agent edits a module with no tests and a failing test comes first.
- A new function has grown and must be split below the complexity threshold.
- The codebase has accumulated copies of the same logic.
- Before merging, you check that the tests catch broken behavior.
- A long session runs and the agent's context needs protecting.
Not a fit when
- You need a one-off typo fix in text or configuration.
- The project uses a language the `crapper`, `dryer` and `mutator` tools do not support.
- Your team forbids agents from committing and pushing to the main branch.
Example request
Add duplicate-payment handling to the billing module following ub-mode: failing test first.Limitations
The skill itself is rules only; checks come from the separate `crapper`, `dryer` and `mutator` repositories, which you install per their docs and for your project language. The last rule asks for pushes to the main line, which not every workflow accepts, so settle this before running. The CRAP 10 and 0.8 similarity thresholds are the author's and do not adapt to a project. Some rules are borrowed from the `poteto-mode` set.
How to disable. Delete the `ub-mode` folder from the agent's skills directory (for example `~/.claude/skills/ub-mode`) and restart the session.
FAQ
How do I install the skill?
Copy `SKILL.md` into the agent's skills folder as `ub-mode/SKILL.md`: `~/.claude/skills/ub-mode/SKILL.md` for Claude Code, `~/.cursor/skills/ub-mode/SKILL.md` for Cursor. Then call `/ub-mode`.
Which agents work?
Any agent with a skills directory: the README lists paths for Claude Code, Cursor and Grok. For Codex, put the same `SKILL.md` into its skills directory.
Does the skill force pushes to the main branch?
Yes, the last practice rule asks for small commits and a push to the main line at the end. If your workflow forbids it, delete that rule from your local copy.
Do I need crapper, dryer and mutator?
Not for the skill itself, yes for measurable thresholds. Without them the agent follows the rules as text but cannot compute CRAP, similarity or mutation scores.
What does the CRAP 10 threshold mean?
CRAP rates a function by cyclomatic complexity and test coverage; a value below 10 counts as fine. A function above it is split, covered by tests, or both.
Discussion
No questions or reviews yet.
Related
Skills14 skills that find the gaps in a task before the code: interviews, plans, assumption tests and proof that a bug fix works
A skill that runs a full refactor so agents read code more easily: it finds hidden links and needless dependencies.
A skill that finds AI slop in code: duplicate helpers, empty abstractions, weak tests. It cleans one pattern per commit.
A 2.4 KB charter for CLAUDE.md and three on-demand skills: the agent stops guessing, verifies results and gates irreversible steps
An evidence-first development skill: the agent wraps code in a spec and a gauntlet of checks so line-by-line review becomes optional
Over twenty skills for coding agents: MCP and hooks, plan mode, a bug-fix protocol, prompting and a bash safety hook
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Repository stars | Main difference |
|---|---|---|---|
| ub-mode (this card) | no | 7,890 | |
| TDD Guard | no | 2,375 | blocks edits without a test via hooks; ub-mode sets the overall workflow and numeric quality thresholds |
| Superpowers | no | 316,679 | a large set of development workflows; ub-mode is shorter and relies on measurable metrics |
README in short
The rules sit in one short file with nothing extra: a works-then-right-then-practice order and three external tools with numeric thresholds.