Agent skill

Cb Code Quality

by BlkLeg in BlkLeg/CircuitBreaker

Circuit Breaker code conventions and the quality gates that actually block a push — ruff, mypy, eslint, the pytest coverage ratchet, and the make verify tiers.

MITAuto-check passedDevelopment

Install Cb Code Quality

skills CLI
$ npx skills add BlkLeg/CircuitBreaker --skill cb-code-quality -a claude-code

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

GitHub CLI
$ gh skill install BlkLeg/CircuitBreaker cb-code-quality --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/BlkLeg/CircuitBreaker.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/cb-code-quality .claude/skills/cb-code-quality && 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
cb-code-quality
GitHub stars
201
Token cost
~1.9k tokens
SKILL.md length
802 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Circuit Breaker code conventions and the quality gates that actually block a push — ruff, mypy, eslint, the pytest coverage ratchet, and the make verify tiers.

  • Tasks that involve Linting and formatting
  • SKILL.md covers Run the real gates, not…, The frontend is JavaScript,…, Backend types are enforced and Constants, plus 5 more sections
  • Calls make, python and mypy
  • Tasks that involve Code quality

What it does

Cb Code Quality is an agent skill from BlkLeg/CircuitBreaker. Circuit Breaker code conventions and the quality gates that actually block a push — ruff, mypy, eslint, the pytest coverage ratchet, and the make verify tiers. Use this whenever writing, reviewing, or refactoring backend Python (FastAPI/SQLAlchemy under apps/backend/src/app) or frontend JavaScript/JSX (apps/frontend/src), before committing or pushing anything, when a lint or type error needs fixing, or when asked about naming, constants, error handling, file structure, or test requirements in this repo.

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

It sits in Development, covering Linting and formatting, Code quality and React components. It works with JavaScript, Ruff, Python and ESLint. The repository describes itself as: Bring your homelab to life. A self-hosted IPAM and service mapper that visualizes complex hardware, compute, and network relationships in real-time. The licence is MIT.

When your agent uses it

  • Tasks that involve Linting and formatting
  • Tasks that involve Code quality
  • Tasks that involve React components

Example prompts

  • “/cb-code-quality”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit fc44f2e. 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:

    • make
    • python
    • mypy

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

  • Network

    No URLs in SKILL.md.

    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

Cb Code Quality loads about 1.9k tokens when it runs. Until then it costs about 131 tokens; SKILL.md has 802 words of instructions outside code blocks.

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

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 BlkLeg/CircuitBreaker at commit fc44f2e, republished under its MIT licence (© BlkLeg). 802 words, ~1,885 tokens.

Download SKILL.mdSave it as .claude/skills/cb-code-quality/SKILL.md (or your agent's skills folder).
name
cb-code-quality
description
Circuit Breaker code conventions and the quality gates that actually block a push — ruff, mypy, eslint, the pytest coverage ratchet, and the make verify tiers. Use this whenever writing, reviewing, or refactoring backend Python (FastAPI/SQLAlchemy under apps/backend/src/app) or frontend JavaScript/JSX (apps/frontend/src), before committing or pushing anything, when a lint or type error needs fixing, or when asked about naming, constants, error handling, file structure, or test requirements in this repo.

Circuit Breaker — Code Quality

Run the real gates, not remembered ones

Every check below is wired into the Makefile. Prefer these over ad-hoc tool invocations — they carry the flags, paths, and env the repo actually needs, and they are the same commands CI runs.

bash
make lint          # ruff check + mypy src/app + eslint          (fast)
make format        # ruff format + prettier
make verify        # Tier 0 static + Tier 1 unit — THE PRE-PUSH GATE (~3m20s)
make verify-full   # verify + the backend suite                  (~6m45s)
make test-backend  # integration tests; provisions the test DB first
make test-frontend # vitest

make verify is the gate to run before pushing. make verify-fast (~90s) is the Tier 0 static subset when you only need a quick signal.

There is no flake8 and no cognitive-complexity plugin in this project. Do not install them — ruff is the Python linter (line-length = 100, select = ["E", "F", "I", "UP", "ASYNC"]) and it is also the formatter.

.pre-commit-config.yaml runs gitleaks, ruff, ruff-format, and mypy --strict on commit. If a commit is rejected, read which hook failed before changing code — a gitleaks rejection means a secret reached a staged file and the fix is to remove the secret, never to bypass the hook.

The frontend is JavaScript, not TypeScript

apps/frontend/src is 318 .jsx + 123 .js files and one stray .ts. There is a tsconfig.json, but it is not what the code is written in.

Write .jsx for components and .js for hooks, API modules, and helpers, and match the surrounding file. Do not add TypeScript annotations, interface declarations, or .ts/.tsx files to existing directories — a lone typed file in a JS tree is churn for the next reader, not an upgrade. Type intent goes in JSDoc and PropTypes where the surrounding code already uses them.

Backend types are enforced

[tool.mypy] sets disallow_untyped_defs = true, check_untyped_defs = true, and warn_return_any = true against src/app. Every function you add needs annotated parameters and a return type, or make lint fails:

python
async def get_cached_telemetry(hardware_id: int) -> dict | None:

ignore_missing_imports is on and import-untyped is disabled, so third-party libraries without stubs will not fight you. Your own code has no such excuse.

Constants

Backend  : apps/backend/src/app/core/constants.py
Frontend : apps/frontend/src/lib/constants.js

Name any literal that carries meaning — a TTL, a threshold, a retry budget, a port. The value is that a reader meets TELEMETRY_CACHE_TTL_SECONDS instead of 300 and does not have to reconstruct intent from a number.

python
await redis.setex(cache_key, TELEMETRY_CACHE_TTL_SECONDS, payload)   # not 300

Exempt: 0, 1, "", booleans, and format strings. A literal used exactly once, immediately beside the thing that explains it, is often clearer inline — use judgment rather than extracting on reflex.

Error handling

Anything touching I/O — DB, Redis, NATS, HTTP, filesystem, SNMP/IPMI/Redfish — needs a handler that names the exception it expects. The reason to catch specifically is that a broad catch hides the failure you did not anticipate, and this project runs unattended in other people's homelabs where a silently swallowed error is indistinguishable from working software.

python
try:
    raw = await get_redis().get(cache_key)
except redis.ConnectionError as exc:
    logger.warning("[telemetry_cache] Redis unavailable for hw:%s: %s", hardware_id, exc)
    return None
except json.JSONDecodeError as exc:
    logger.error("[telemetry_cache] corrupt cache for hw:%s: %s", hardware_id, exc)
    return None

Every handler either logs and returns a typed fallback, or re-raises. Never except Exception: pass. Prefix log messages with [module_name] and use logger, never print().

Degradation is a first-class path here: Redis or NATS being down should leave the app serving REST, not crashing. CB_ALLOW_DEGRADED_DEPENDENCIES exists for exactly this and the integration suite runs with it on.

Show full SKILL.md (329 more words)Show less

Structure — targets for code you write

Aim for functions under ~40 lines, nesting at or below 3 levels, and modules that hold one responsibility. Prefer splitting a long function into named helpers over compressing it — _is_active_hardware(r) tells a reader what the condition means in a way a stacked boolean never does.

These are targets for new and modified code, not a mandate to refactor what is already here. 166 of 301 backend files exceed 150 lines; db/models.py is 2846 and services/discovery_service.py is 2805. Those sizes are a known property of the codebase, not a defect list to burn down. When you touch a large file, add your change in the local style and leave the rest alone unless splitting it is the task you were actually given. Unrequested refactors of a 2800-line module are how a small fix becomes an unreviewable diff.

Naming

Python functions : verb_noun()      poll_device(), write_telemetry()
Python classes   : PascalCase       TelemetryCollector, VaultService
Constants        : UPPER_SNAKE      MAX_RETRY_COUNT, CACHE_TTL_SECONDS
Booleans         : is_/has_/can_    is_active, has_telemetry, can_retry
JSX components   : PascalCase.jsx   TelemetryBadge, NodeCard
React hooks      : useCamelCase.js  useTelemetryStream, useDiscoveryStream

Avoid single letters outside loop counters, and avoid cfg/mgr/proc/res. Comments explain why; the code should already say what.

Tests and the coverage ratchet

apps/backend/tests/          unit + service tests   (pytest, asyncio_mode=auto)
tests/integration/           needs live PostgreSQL  (make test-backend)
tests/build/                 repo-policy/governance suites
apps/frontend/src/__tests__/ vitest, *.test.jsx

Backend coverage is gated at --cov-fail-under=56, deliberately ratcheted to the suite's measured value. Never lower it to make a red build green — the number moves up only after real coverage clears the new figure.

New endpoints, services, and hooks need at least a happy path and one error or edge case. Root-suite pytest runs with filterwarnings = error: a new warning fails the run, and the fix is the underlying defect, not an ignore entry. If an ignore is genuinely unavoidable, it must name an owner and a removal condition — tests/build/test_skip_register.py enforces that.

Before you push

  • make lint clean — ruff, mypy, eslint
  • make verify passes (or make verify-full if you touched backend logic)
  • New/changed functions carry full type annotations
  • I/O paths catch specific exceptions and log with a [module] prefix
  • Meaningful literals live in constants.py / constants.js
  • New behavior has a test; coverage gate not lowered
  • No print(), no commented-out code, no secrets in the diff
  • Frontend additions are .js/.jsx, matching the file around them

© BlkLeg, 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 .claude/skills/cb-code-quality of BlkLeg/CircuitBreaker.

Open the folder on GitHubat commit fc44f2e

Compare with similar skills

Cb Code Quality 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.

Cb Code Quality compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cb Code Quality this skillBlkLeg/CircuitBreaker201—~1.9kAutomated safety check: PassMIT
Pythonericrisco/rsc-harness156—~3.8kAutomated safety check: PassMIT
Python Rulessoftspark/ai-toolkit179—~2.9kAutomated safety check: PassApache-2.0
Kedro Babysitkedro-org/kedro11k—~4kAutomated safety check: PassCustom licence
Ha Code QualityFutureTense/keymaster349—~462Automated safety check: PassMIT
Modern Pythonmycelium-io/mycelium119—~752Automated safety check: PassCustom licence

Similar skills

  • Python

    ericrisco/rsc-harness

    A skill your agent uses when the task is Python itself, in any framework or none: PEP 695 generics, mypy --strict typing, dataclass/Protocol/TypedDict/Enum choices, asyncio.TaskGroup, stdlib idioms…

    156 GitHub stars~3.8k tokensUpdated today
    Backend & APIsAuto-check passed
  • Python Rules

    softspark/ai-toolkit

    Python coding rules: style, patterns, security, testing. An agent skill from softspark/ai-toolkit.

    179 GitHub stars~2.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • Kedro Babysit

    kedro-org/kedro

    Run Kedro's local lint / format / type-check / tests on changed files (uses the project's pre-commit hooks, ruff, mypy, pytest, lint-imports, detect-secrets, Make targets — in the right venv), or…

    11k GitHub stars~4k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Ha Code Quality

    FutureTense/keymaster

    Standards and commands for linting, code formatting, typing validation (Ruff, MyPy, Codespell, ESLint, Pre-commit/Prek, Tox), and adherence to Home Assistant Python 3.14 standards in Keymaster.

    349 GitHub stars~462 tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Modern Python

    mycelium-io/mycelium

    Modern Python tooling practices for the mycelium project. An agent skill from mycelium-io/mycelium.

    119 GitHub stars~752 tokensUpdated today
    DevelopmentAuto-check passed
  • Python Pro

    Jeffallan/claude-skills

    Writes type-annotated Python 3.11+ with async patterns, dataclasses and pytest suites, validated with mypy in strict mode, black and ruff.

    12k GitHub stars~1.6k tokensUpdated 4 days ago
    DevelopmentAuto-check passed

More from BlkLeg/CircuitBreaker

  • Cb Build Test

    BlkLeg/CircuitBreaker

    How Circuit Breaker is built, tested, packaged, and kept secret-safe — the make dev/verify/test targets, the PostgreSQL integration test database and its fixtures, the mono Docker image and native…

    201 GitHub stars~1.9k tokensUpdated 2 days ago
    Auto-check passed
  • Cb Realtime API

    BlkLeg/CircuitBreaker

    How Circuit Breaker moves data between backend and frontend — the NATS internal bus, Redis pub/sub, the WebSocket stream endpoints and their first-message JWT handshake, SSE log/event streams, and…

    201 GitHub stars~1.7k tokensUpdated 2 days ago
    Auto-check passed
  • Cb Release

    BlkLeg/CircuitBreaker

    How a Circuit Breaker release is cut, approved, published and followed up — the candidate→approval→promote flow in release.yml, the release environment gate, the make release- targets, the…

    201 GitHub stars~1.8k tokensUpdated 2 days ago
    Auto-check passed
  • Cb Security Hardening

    BlkLeg/CircuitBreaker

    Enforces Circuit Breaker security hardening conventions across backend, frontend, Docker, and nginx.

    201 GitHub stars~2.1k tokensUpdated 2 days ago
    Auto-check passed
  • Cb Automation

    BlkLeg/CircuitBreaker

    The maintenance automation around Circuit Breaker — which bots and scheduled workflows exist (Discord notifications, ledger watch, branch cleanup, Dependabot lockfile sync, the required-checks…

    201 GitHub stars~2.4k tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Cb Code Quality

What does Cb Code Quality do?

Circuit Breaker code conventions and the quality gates that actually block a push — ruff, mypy, eslint, the pytest coverage ratchet, and the make verify tiers. Cb Code Quality is an agent skill from BlkLeg/CircuitBreaker. Circuit Breaker code conventions and the quality gates that actually block a push — ruff, mypy, eslint, the pytest coverage ratchet, and the make verify tiers.

When should I use Cb Code Quality?

Cb Code Quality fits situations like: tasks that involve Linting and formatting; tasks that involve Code quality; tasks that involve React components.

How do I install Cb Code Quality in Claude Code?

Run `npx skills add BlkLeg/CircuitBreaker --skill cb-code-quality -a claude-code`. Or copy the skill folder (.claude/skills/cb-code-quality in BlkLeg/CircuitBreaker) into .claude/skills/cb-code-quality in your project. Claude Code loads it when a task matches its description.

How do I install Cb Code Quality in Codex?

Run `npx skills add BlkLeg/CircuitBreaker --skill cb-code-quality -a codex`. Or copy the skill folder (.claude/skills/cb-code-quality in BlkLeg/CircuitBreaker) into .agents/skills/cb-code-quality in your project. Codex loads it when a task matches its description.

Can I use Cb Code Quality 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 BlkLeg/CircuitBreaker --skill cb-code-quality -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cb-code-quality, .gemini/skills/cb-code-quality, .github/skills/cb-code-quality and .opencode/skills/cb-code-quality in your project.

What does Cb Code Quality need to run?

Going by SKILL.md and its folder, Cb Code Quality needs the command-line tools its instructions call (make, python and mypy). Our summary lists: Python 3.

Does Cb Code Quality access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cb Code Quality 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 Cb Code Quality use?

Cb Code Quality 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 Cb Code Quality use?

About 1.9k tokens (SKILL.md is roughly 7.5k 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 Cb Code Quality?

Skills that share tags, products or a category with Cb Code Quality: Python (ericrisco/rsc-harness, 156 stars), Python Rules (softspark/ai-toolkit, 179 stars), Kedro Babysit (kedro-org/kedro, 11k stars) and Ha Code Quality (FutureTense/keymaster, 349 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cb Code Quality?

BlkLeg (a GitHub user) maintains it in BlkLeg/CircuitBreaker, which has 201 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 5, 2026.

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