# unclebob/ub-mode

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/unclebob-ub-mode).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

7,252 stars · 407 forks · MIT

## Links

- GitHub: https://github.com/unclebob/ub-mode
- awesome-repositories: https://awesome-repositories.com/repository/unclebob-ub-mode.md

## Description

ub-mode is a set of instruction files and command-line checks that steer AI coding agents toward disciplined engineering. The instructions are plain-text files loaded into each coding session, and they are paired with deterministic tools whose pass or fail results block work until numeric limits for complexity, duplication, and test thoroughness are met. The practices they encode include test-driven development, root-cause fixes, and small ordered commits.

The quality checks are what set it apart. One tool combines each function's cyclomatic complexity with its test coverage into a single risk score, and every function must stay under a fixed threshold of 10. A duplication detector compares code by structure rather than exact text and flags blocks at a similarity of 0.8 or higher, so repeated logic can be merged. A mutation testing tool makes small deliberate changes to the code to expose surviving mutants and untested lines. It also guides the removal of dead code. A dependency-graph visualizer shows components, dependency directions, coverage, complexity, and mutation scores in one diagram.

The surrounding workflow rules cover the day-to-day practice of coding. They require a failing test before any change, then only the smallest edit that makes it pass. Defects are reproduced and fixed at their underlying cause rather than hidden behind guards. Refactoring is done in small steps, with tests proving behavior is unchanged. Design guidance covers domain modeling, clear module boundaries, strict typing, and idempotent operations. Version control rules ask for a running work log, context-window management, cleanup of leftover worktrees, and small commits pushed to the main line in a sensible order.

## Tags

### Artificial Intelligence & ML

- [Agent Engineering Rule Sets](https://awesome-repositories.com/f/artificial-intelligence-ml/agent-engineering-rule-sets.md) — Provides plain-text agent instructions paired with deterministic checks that steer AI coding assistants toward test-first, root-cause, low-complexity work.
- [AI Coding Agent Platforms](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-coding-agent-platforms.md) — Pairs plain-text agent instructions with deterministic checks that fail the work when complexity, duplication, or untested code exceed fixed limits.
- [AI Agent Skills](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-agent-skills.md) — Bundles reusable instruction files and skills that teach AI coding agents test-driven development, root-cause fixes, and small ordered commits.

### Testing & Quality Assurance

- [Quality Gates](https://awesome-repositories.com/f/testing-quality-assurance/ci-integration-testing/quality-gates.md) — Pairs agent instructions with deterministic command-line checks whose pass or fail results block work until complexity, duplication, and test limits are met.
- [Mutation Testing Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/automated-test-suites/mutation-testing-frameworks.md) — Makes small deliberate code changes to check whether tests catch them, exposing surviving mutants, untested lines, and dead code.
- [Agentic Code Mutations](https://awesome-repositories.com/f/testing-quality-assurance/automated-test-suites/mutation-testing-frameworks/agentic-code-mutations.md) — Makes small deliberate code changes to expose surviving mutants and untested lines, then guides adding tests or deleting dead code. ([source](https://github.com/unclebob/ub-mode/blob/master/SKILL.md))
- [Code Quality Tools](https://awesome-repositories.com/f/testing-quality-assurance/code-quality-review/code-quality-tools.md) — Enforces deterministic checks that fail the work when functions are too complex, code is duplicated, or tests leave mutants alive. ([source](https://github.com/unclebob/ub-mode/blob/master/README.md))
- [Test-Driven Development Workflows](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/unit/unit-testing/ai-assisted-test-generators/test-driven-development-workflows.md) — Requires a failing test before any change, then only the smallest edit that makes it pass, driving every change by tests.
- [Test-Driven Development Workflows](https://awesome-repositories.com/f/testing-quality-assurance/test-driven-development-workflows.md) — Requires a failing test before every change and only the smallest edit that makes it pass, so each step is proven by tests.
- [Code Coverage Analysis](https://awesome-repositories.com/f/testing-quality-assurance/code-coverage-analysis.md) — Computes cyclomatic complexity, test coverage, and a combined risk score for every function, keeping each under a fixed threshold. ([source](https://github.com/unclebob/ub-mode/blob/master/README.md))

### DevOps & Infrastructure

- [Agent Configuration Files](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/file-based-configuration/agent-configuration-files.md) — Shapes coding agent behavior through plain-text instruction files that encode practices, workflows, and design principles loaded into each session.

### Software Engineering & Architecture

- [Code Pattern Similarity Detection](https://awesome-repositories.com/f/software-engineering-architecture/code-pattern-similarity-detection.md) — Compares code blocks by structure rather than exact text and flags pairs at or above 0.8 similarity so repeated logic can be merged.
- [Cyclomatic Complexity Analyzers](https://awesome-repositories.com/f/software-engineering-architecture/cyclomatic-complexity-analyzers.md) — Computes cyclomatic complexity per function and combines it with test coverage into a risk score that must stay under a fixed threshold.
- [Test-Driven Development Loops](https://awesome-repositories.com/f/software-engineering-architecture/test-driven-development-loops.md) — Enforces a red-green cycle where a failing test is written first and only minimal code is added to make it pass. ([source](https://github.com/unclebob/ub-mode#readme))
- [Component Architecture Visualization](https://awesome-repositories.com/f/software-engineering-architecture/component-architecture-visualization.md) — Displays components, dependency directions, coverage, complexity, and mutation scores together in one diagram to make structural problems visible. ([source](https://github.com/unclebob/ub-mode/blob/master/README.md))
- [Dependency Graph Visualizations](https://awesome-repositories.com/f/software-engineering-architecture/dependency-graph-visualizations.md) — Renders components and dependency directions as a graph annotated with coverage, complexity, and mutation scores so structural problems stand out.
- [Root Cause Fixing Practices](https://awesome-repositories.com/f/software-engineering-architecture/root-cause-fixing-practices.md) — Directs agents to fix underlying causes rather than symptoms and to restructure code in small steps that can each be verified. ([source](https://github.com/unclebob/ub-mode/blob/master/README.md))
- [Root Cause Refactoring Practices](https://awesome-repositories.com/f/software-engineering-architecture/root-cause-refactoring-practices.md) — Requires defects to be reproduced and fixed at their underlying cause, with refactoring done in small steps that tests show keep behavior unchanged.
- [Test-First Workflows](https://awesome-repositories.com/f/software-engineering-architecture/test-first-workflows.md) — Requires a failing test before each change, then only the smallest edit that makes it pass, so every change is driven by tests. ([source](https://github.com/unclebob/ub-mode/blob/master/README.md))

### Part of an Awesome List

- [Code Visualization and Metrics](https://awesome-repositories.com/f/awesome-lists/devtools/code-visualization-and-metrics.md) — Draws a dependency-graph diagram showing components, dependency directions, coverage, complexity, and mutation scores together so structural problems are visible at a glance. ([source](https://github.com/unclebob/ub-mode#readme))

### Graphics & Multimedia

- [Code Structure Visualizations](https://awesome-repositories.com/f/graphics-multimedia/code-structure-visualizations.md) — Draws a dependency-graph diagram showing components, dependency directions, coverage, complexity, and mutation scores so structural problems stand out at a glance.
