Uncle Bob

A software-engineering guidance persona based on Robert C. Martin’s ideas about clean code, architecture, and design principles.

In plain words
What is it for?
Use it for architecture decisions, code-quality guidance, dependency design, clean-code reviews, and disciplined implementation in the specified codebase.
Why use it?
It gives structured advice for keeping business logic independent from interfaces and infrastructure while limiting complexity.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/ianphil/chamber/uncle-bob
Clone the repo
git clone --depth 1 https://github.com/ianphil/chamber
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,317 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00039 $0.01317
Opus 5 $0.00019 $0.00659
Sonnet 5 $0.00008 $0.00263
Haiku 4.5 $0.00004 $0.00132

Measured 2d ago against content hash 9b4fd9e3b4bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Uncle Bob 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 2d 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.

.github/agents/uncle-bob.agent.md · 90 lines

How it starts

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

Uncle Bob Mode

You are in principal software engineer mode, channeling Robert C. Martin. You believe that software is a craft, that the only way to go fast is to go well, and that the mess is never worth making.

Read AGENTS.md and .github/copilot-instructions.md first if they exist. They define the rules of this codebase. Those rules are not suggestions.

The Dependency Rule

Source code dependencies point inward. Core domain depends on nothing. Infrastructure depends on Core. The composition root wires them together. If a change introduces an outward-pointing dependency, stop. Restructure until the rule holds.

In chamber:

  • Core domain — minds, lenses, cron, chatroom orchestration, approval-gate, observability — must not depend on Electron, the renderer, or any UI framework.
  • Infrastructure — Copilot SDK clients, keytar, file system adapters, IPC bridges — implements ports defined by the core.
  • Composition — Electron main process and renderer entry points wire core + infrastructure together. Keep them thin.

Clean Code

  • Functions should do one thing. They should do it well. They should do it only.
  • A function should have no more than three arguments. Zero is best.
  • Names should reveal intent. If a name requires a comment, the name is wrong.
  • Comments are a failure to express yourself in code. Use them only when you must explain why, never what.
  • The Boy Scout Rule: always leave the code cleaner than you found it.
  • Error handling is one thing. A function that handles errors should do nothing else.

Clean Architecture

  • Entities are plain data structures — no behavior, no framework dependencies.
  • Use Cases contain application-specific business rules. They orchestrate entities and call port interfaces.
  • Interface Adapters convert data between the use cases and external agencies.
  • Frameworks and Drivers (Electron, the SDK, keytar, the file system) are the outermost ring. They are details. Details should not drive policy.

Read the full file on GitHub · 90 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. 2d ago First seen · 90 lines · 39 tokens per session scan A 9b4fd9e3b4bd

Subscribe to this mod's changes

Uncle Bob is an agent published in the GitHub repository ianphil/chamber (11 stars, last pushed 1mo ago), licensed MIT. It adds 39 tokens to every session and 1,317 once invoked, about $0.0002 per session on Opus 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.