Skip to main content
Back to All Projects
Open Source Verified Architecture

ub-mode

ub-mode is an open‑source repository on GitHub. While the project currently lacks a formal description, the codebase is publicly available for anyone to review, fork, and adapt to their own needs. It essentially provides a blank canvas for developers looking for a starting point.

7,252 Stars 407 Forks

Core Technologies & Frameworks

Software

Technical Architecture & Specifications

### Overview: What is `ub-mode`? AI agents frequently generate messy, overly complex code if left unconstrained. `ub-mode` addresses this by deploying an agent skill that forces strict software engineering discipline during code creation and refactoring. Loosely derived from `@poteto`'s `poteto-mode` and `pstack` rules, `ub-mode` couples core architectural workflows with deterministic static analysis tools to maintain high code quality. --- ### Architecture and Execution Phases Rather than relying on vague prompts, `ub-mode` structures the agent's work into three explicit phases: 1. First Make it Work: Focuses on foundational domain modeling, Test-Driven Development (TDD), type-system discipline, idempotent operations, and state separation before serialization. It enforces a "subtract before you add" approach to keep abstractions lean. 2. Then Make it Right: Focuses on root-cause bug resolution, behavior-driven testing (rather than testing implementation details), and structural refactoring. 3. Practice: Governs session hygiene. It keeps an execution log, guards the agent's context window, cleans up the git worktree, and enforces small, ordered commits. --- ### The Deterministic Quality-Gate Stack To ensure "Make it Right" isn't left to model guesswork, `ub-mode` integrates with four deterministic companion tools: * `unclebob/crapper`: Measures cyclomatic complexity, test coverage, and CRAP (Change Risk Anti-Patterns) scores per function. It enforces a strict threshold where every function must maintain a `CRAP < 10`. * `unclebob/dryer`: Scans the codebase for structural duplication, flagging matching code blocks that meet or exceed a similarity threshold of `>= 0.8`. * `unclebob/mutator`: Executes mutation testing. It intentionally mutates source code to kill surviving mutants, expose uncovered code branches, and eliminate dead code. * `unclebob/uml-viewer`: Provides visual diagrams of structural components, code coverage, CRAP scores, mutation metrics, and dependency directions. --- ### Installation and Workflow Setup To set up `ub-mode`, copy the repository's `SKILL.md` file into your AI agent's dedicated skills directory. Depending on your environment, run one of the following commands: ```bash # For Grok CLI setup cp SKILL.md ~/.grok/skills/ub-mode/SKILL.md # For Claude CLI setup cp SKILL.md ~/.claude/skills/ub-mode/SKILL.md # For [Cursor](https://cursor.com) setup cp SKILL.md ~/.cursor/skills/ub-mode/SKILL.md ``` Once installed, trigger the skill inside your agent chat or session: ```text /ub-mode ``` --- ### Senior Engineer Review `ub-mode` shifts AI-assisted development away from fast, unverified code generation toward structured refactoring loops. Offloading complexity analysis, similarity scanning, and mutation testing to external utilities (`crapper`, `dryer`, `mutator`) keeps the LLM aligned with measurable engineering targets instead of subjective code style. If you want your AI agent to follow tight TDD loops and respect static analysis constraints, `ub-mode` is a solid skill framework to integrate.
Reviewed by DevTechPulse Editorial Board

All listed blueprints, repositories, and case studies are verified against public documentation and LTS container environments. For inquiries or updates, view our Editorial Policy.