Agent skill

Fix Bug

by tddworks in tddworks/ClaudeBar

Guide for fixing bugs in ClaudeBar following Chicago School TDD and rich domain design.

Apache-2.0Auto-check passedTesting & QA

Install Fix Bug

skills CLI
$ npx skills add tddworks/ClaudeBar --skill fix-bug -a claude-code

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

GitHub CLI
$ gh skill install tddworks/ClaudeBar fix-bug --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/tddworks/ClaudeBar.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/fix-bug .claude/skills/fix-bug && 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
fix-bug
GitHub stars
1.5k
Token cost
~2.2k tokens
SKILL.md length
674 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
Apache-2.0

At a glance

Guide for fixing bugs in ClaudeBar following Chicago School TDD and rich domain design.

  • Works in 3 steps: Reproduce & Understand → Write Failing Test (Red) → Fix & Verify (Green)
  • User reports a bug
  • SKILL.md covers Workflow, Phase 1: Reproduce & Understand, Phase 2: Write Failing Test… and Phase 3: Fix & Verify (Green), plus 1 more section
  • Calls xcodebuild

What it does

Fix Bug is an agent skill from tddworks/ClaudeBar. Guide for fixing bugs in ClaudeBar following Chicago School TDD and rich domain design. Use this skill when: (1) User reports a bug or unexpected behavior (2) Fixing a defect in existing functionality (3) User asks "fix this bug" or "this doesn't work correctly" (4) Correcting behavior that violates the user's mental model

Its SKILL.md is about 2.2k 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 Testing & QA, covering Debugging and Test-driven development. The repository describes itself as: A macOS menu bar application that monitors AI coding assistant usage quotas. Keep track of your Claude, Codex, Antigravity ,and Gemini usage at a glance. The licence is Apache-2.0.

When your agent uses it

  • User reports a bug
  • Unexpected behavior
  • Fixing a defect in existing functionality
  • User asks fix this bug

Example prompts

  • “fix this bug”
  • “this doesn”
  • “(4) Correcting behavior that violates the user”
  • “/fix-bug”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Reproduce & Understand
  2. Write Failing Test (Red)
  3. Fix & Verify (Green)

What it can do on your machine

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

    • xcodebuild

    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

Fix Bug loads about 2.2k tokens when it runs. Until then it costs about 83 tokens; SKILL.md has 674 words of instructions outside code blocks.

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

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 tddworks/ClaudeBar at commit 35486e8, republished under its Apache-2.0 licence (© tddworks). 674 words, ~2,214 tokens.

Download SKILL.mdSave it as .claude/skills/fix-bug/SKILL.md (or your agent's skills folder).
name
fix-bug
description
Guide for fixing bugs in ClaudeBar following Chicago School TDD and rich domain design. Use this skill when: (1) User reports a bug or unexpected behavior (2) Fixing a defect in existing functionality (3) User asks "fix this bug" or "this doesn't work correctly" (4) Correcting behavior that violates the user's mental model

Fix Bug in ClaudeBar

Fix bugs using Chicago School TDD, root cause analysis, and rich domain design.

Workflow

┌─────────────────────────────────────────────────────────────┐
│  1. REPRODUCE & UNDERSTAND                                   │
├─────────────────────────────────────────────────────────────┤
│  • Reproduce the bug                                         │
│  • Identify expected vs actual behavior                      │
│  • Locate the root cause in code                             │
└─────────────────────────────────────────────────────────────┘
                            │
                            ▼
┌─────────────────────────────────────────────────────────────┐
│  2. WRITE FAILING TEST (Red)                                 │
├─────────────────────────────────────────────────────────────┤
│  • Write test that exposes the bug                           │
│  • Test should FAIL before fix                               │
│  • Test should verify CORRECT behavior                       │
└─────────────────────────────────────────────────────────────┘
                            │
                            ▼
┌─────────────────────────────────────────────────────────────┐
│  3. FIX & VERIFY (Green)                                     │
├─────────────────────────────────────────────────────────────┤
│  • Implement minimal fix                                     │
│  • Test now PASSES                                           │
│  • All existing tests still pass                             │
└─────────────────────────────────────────────────────────────┘

Phase 1: Reproduce & Understand

Identify the Bug
  1. Reproduce: Follow exact steps to trigger the bug
  2. Expected: What SHOULD happen (the person's mental model — USER_JOURNEYS)
  3. Actual: What IS happening (current behavior)
  4. Root cause: WHY it's happening (code analysis)

For a provider that shows the wrong thing or fails:

  • The log: ~/Library/Logs/ClaudeBar/ClaudeBar.log (info and above) — which data source answered, which step failed (lookup · fetch · mapping); debug goes to OSLog only (troubleshooting).
  • The failed step: account.lastFailedStep and lastError say whether the key, the request or the reading broke — fix that piece.
  • The real response: capture the CLI's or API's actual answer, redacted (no token, email, name or real usage), as the test's fixture. Never log a token, key or cookie while investigating.
Find the law it breaks

Read the design in order — USER_JOURNEYS, CANONICAL_MODEL, TARGET_ARCHITECTURE, then the feature's or provider's design.md. The design docs are the source of truth (AGENTS.md). A bug is usually a law in CANONICAL_MODEL.md §5 (or a feature's design.md) that the code breaks: find the law and its one owner, and fix it there, not at a call site. If the right fix changes a law or moves it to another owner, that is a design change: update the doc and ask the user to confirm before fixing. If no law covers it, propose the law first.

Locate in Architecture

Reference: MODULAR_DESIGN.md (modules) · TARGET_ARCHITECTURE.md (how a provider runs) · ARCHITECTURE.md (the app layers)

Find which module the behaviour lives in before you change it: the table in implement-feature → Architecture is the one map (where each thing lives, and where its tests go).

A bug or improvement in a provider is made in its JSON (or its mapping script), or generically in DataSources — never with vendor-named Swift, and never with a line in ClaudeBarApp that names it (providers are found by ProviderCatalog.detect()). Modules never import Domain.

Domain Invariants

Check if the bug violates domain invariants that should be maintained:

swift
// Example: QuotaMonitor should maintain selection invariants
// - selectedProviderId should always point to an enabled provider
// - Domain should be self-validating (no external "ensure" calls needed)

Phase 2: Write Failing Test (Red)

Chicago School TDD

Name each test should <outcome> [when <situation>], in the person's words, never a method, type or mechanism verb → Naming tests.

We follow Chicago School TDD (state-based testing):

  • Test state changes and return values, not interactions
  • Focus on the "what" (observable outcomes), not the "how" (method calls)
  • Mocks stub dependencies to return data, not to verify calls
  • No verify() calls - assert on resulting state instead
Show full SKILL.md (261 more words)Show less
Test Pattern

Test the CORRECT behavior, not the bug:

swift
@MainActor
@Suite
struct {Component}Tests {

    @Test func `should {correct outcome} when {the situation that showed the bug}`() async throws {
        // Given - the response that triggers the bug, captured from the real CLI/API
        let stub = try StubbedProvider(providerId: "codex")
        defer { stub.cleanUp() }
        stub.answerRPC(#"{"id":2,"result":{"rateLimits":{"primary":{"usedPercent":30,"windowDurationMins":10080}}}}"#)

        // When - the real definition reads it
        let usage = try await stub.make("codex").refreshPlain()

        // Then - assert EXPECTED behavior (will FAIL before fix)
        #expect(usage.quota(for: .session)?.windowDuration == 7 * 86400)  // the window the provider stated
    }
}
Test Location

The test goes beside the code it pins (the table in Phase 1). For a migrated provider, add the captured response to its golden tests in Modules/Providers/Tests/; for a generic worker, to Modules/DataSources/Tests/.

Run Test (Should FAIL)
bash
tuist test Providers         # one module's tests while working (schemes: Providers, DataSources, Domain, Infrastructure, AppTests, AcceptanceTests)
# tuist caches results; one suite for real, and the final check of everything:
xcodebuild test -workspace ClaudeBar.xcworkspace -scheme ClaudeBar-Workspace \
  -destination 'platform=macOS,arch=arm64' -only-testing:ProvidersTests/ClaudeAPITests
xcodebuild test -workspace ClaudeBar.xcworkspace -scheme ClaudeBar-Workspace -destination 'platform=macOS,arch=arm64'

Phase 3: Fix & Verify (Green)

Fix Guidelines
  1. Minimal change: Fix only what's broken
  2. At the law's owner: fix the one type that owns the rule (CANONICAL §5), not a call site or a view
  3. A provider is data: its JSON or script, or a generic rule in DataSources that every definition gains — never a branch on a provider's id
  4. Maintain invariants: the owner stays self-validating — tell, don't ask
  5. No over-engineering: Don't refactor unrelated code
Domain Design Principles

When fixing domain bugs, ensure:

swift
// 1. Domain maintains its own invariants
public init(...) {
    // Validate on construction
    selectFirstEnabledIfNeeded()  // Called internally, not externally
}

// 2. Public API hides implementation details
public func setProviderEnabled(_ id: String, enabled: Bool) {
    provider.isEnabled = enabled
    if !enabled {
        selectFirstEnabledIfNeeded()  // Private - called automatically
    }
}

// 3. Private methods for internal invariant maintenance
private func selectFirstEnabledIfNeeded() { ... }
Verify Fix

Run the same suite again (it should PASS now), then the full xcodebuild test (tuist test skips cached targets). Then the docs in the same change: a provider's README.md Gotchas when the person can hit it, its design.md when the reading changed, and the CHANGELOG line.

Checklist

  • Bug reproduced and understood
  • Root cause identified in code
  • Failing test written (exposes bug)
  • Test FAILS before fix
  • Minimal fix implemented
  • Test PASSES after fix
  • All existing tests still pass
  • Domain invariants maintained (if applicable)
  • Full xcodebuild test green
  • Docs updated where the person or a contributor would look (provider README / design.md)
  • One line under ## [Unreleased] in CHANGELOG.md, under its heading (Fixed / Changed): the effect in the person's words, ≤300 characters, an absolute issue or PR link

© tddworks, Apache-2.0. 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/fix-bug of tddworks/ClaudeBar.

Open the folder on GitHubat commit 35486e8

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders. This page covers the copy in tddworks/ClaudeBar, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Fix Bug 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.

Fix Bug compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Fix Bug this skilltddworks/ClaudeBar1.5k—~2.2kAutomated safety check: PassApache-2.0
Foreman DebugVisionForge-OU/foreman444—~1.1kAutomated safety check: PassCustom licence
Deck Reproasheshgoplani/agent-deck1k—~1.3kAutomated safety check: PassMIT
Bug Fix TDDstacklok/toolhive-studio170—~1.7kAutomated safety check: NotesApache-2.0
TDD Py4vaspvasp-dev/py4vasp100—~2kAutomated safety check: PassApache-2.0
Opsmill Dev Test Driving Bugsopsmill/infrahub529—~4kAutomated safety check: PassApache-2.0

Similar skills

  • Foreman Debug

    VisionForge-OU/foreman

    Headless root-cause debugging loop for a Foreman worker whose tests, build, or acceptance check are failing — especially on a retry.

    444 GitHub stars~1.1k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Deck Repro

    asheshgoplani/agent-deck

    Reproduce agent-deck bugs from an issue, transcript excerpt, or description in an isolated environment, and prove fixes with the same reproduction and a regression test.

    1k GitHub stars~1.3k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Bug Fix TDD

    stacklok/toolhive-studio

    Reproduce and fix bugs using TDD. An agent skill from stacklok/toolhive-studio.

    170 GitHub stars~1.7k tokensUpdated yesterday
    Testing & QAAuto-check: notes
  • TDD Py4vasp

    vasp-dev/py4vasp

    Carry out ONE chunk of a py4vasp change test-first: RED (watch the test fail for the right reason) → GREEN → refactor → one local commit.

    100 GitHub stars~2k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Writes a single failing test that reproduces a bug after its root-cause analysis is complete, before any fix is written.

    529 GitHub stars~4k tokensUpdated today
    Testing & QAAuto-check passed
  • Development Workflow

    ruby-git/ruby-git

    Follows a strict Test-Driven Development (TDD) workflow with four phases: triage, prepare, execute, and finalize.

    1.8k GitHub stars~6.1k tokensUpdated 6 days ago
    Testing & QAAuto-check passed

More from tddworks/ClaudeBar

  • Add Provider

    tddworks/ClaudeBar

    Add an AI provider to ClaudeBar as a JSON definition run by the one generic Provider and DataSource.

    1.5k GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Add Report

    tddworks/ClaudeBar

    Guide for adding new report cards to ClaudeBar that analyze local data sources and display metrics with comparison deltas.

    1.5k GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • GitHub Actions

    tddworks/ClaudeBar

    Manage ClaudeBar's GitHub Actions CI/CD pipelines: build, test, and release workflows.

    1.5k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Implement Feature

    tddworks/ClaudeBar

    Guide for implementing features in ClaudeBar following architecture-first design, TDD, rich domain models, and Swift 6.2 patterns.

    1.5k GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Improvement

    tddworks/ClaudeBar

    Guide for making improvements to existing ClaudeBar functionality using TDD.

    1.5k GitHub stars~2.1k tokensUpdated today
    Auto-check passed

Questions about Fix Bug

What does Fix Bug do?

Guide for fixing bugs in ClaudeBar following Chicago School TDD and rich domain design. Fix Bug is an agent skill from tddworks/ClaudeBar. Guide for fixing bugs in ClaudeBar following Chicago School TDD and rich domain design.

When should I use Fix Bug?

Fix Bug fits situations like: user reports a bug; unexpected behavior; fixing a defect in existing functionality; user asks fix this bug.

How do I install Fix Bug in Claude Code?

Run `npx skills add tddworks/ClaudeBar --skill fix-bug -a claude-code`. Or copy the skill folder (.claude/skills/fix-bug in tddworks/ClaudeBar) into .claude/skills/fix-bug in your project. Claude Code loads it when a task matches its description.

How do I install Fix Bug in Codex?

Run `npx skills add tddworks/ClaudeBar --skill fix-bug -a codex`. Or copy the skill folder (.claude/skills/fix-bug in tddworks/ClaudeBar) into .agents/skills/fix-bug in your project. Codex loads it when a task matches its description.

Can I use Fix Bug 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 tddworks/ClaudeBar --skill fix-bug -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fix-bug, .gemini/skills/fix-bug, .github/skills/fix-bug and .opencode/skills/fix-bug in your project.

What does Fix Bug need to run?

Going by SKILL.md and its folder, Fix Bug needs the command-line tools its instructions call (xcodebuild).

Does Fix Bug 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 Fix Bug 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 Fix Bug use?

Fix Bug is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Fix Bug use?

About 2.2k tokens (SKILL.md is roughly 8.9k 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 Fix Bug?

Skills that share tags, products or a category with Fix Bug: Foreman Debug (VisionForge-OU/foreman, 444 stars), Deck Repro (asheshgoplani/agent-deck, 1k stars), Bug Fix TDD (stacklok/toolhive-studio, 170 stars) and TDD Py4vasp (vasp-dev/py4vasp, 100 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Fix Bug?

tddworks (a GitHub organization) maintains it in tddworks/ClaudeBar, which has 1,527 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 7, 2026.

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