attckdigital/smith/smith-bugfix
Claude Code and agent skill by attckdigital/smith
- community
Checking that the SKILL.md file is still in the repository.
Lightweight fix workflow for bugs and small changes. Autonomous from invocation through merged PR — no questions gate, no spec generation, no planning phase.
Install
npx vskill@latest install attckdigital/smith/smith-bugfixSKILL.md
SpecKit Bugfix Workflow
A streamlined alternative to /smith-new for bugs, small changes, and trivial fixes that don't require requirements gathering, planning, or a questions gate. Runs fully autonomously from invocation to merged PR.
Arguments: $ARGUMENTS
Vault Logging
Throughout this action, log significant events to the vault session log. Read the session log path from .smith/vault/.current-session. If the file is missing or the vault is not initialized, skip all logging silently.
Marker before first append: the workflow-gate denies markerless Bash redirection, so cat >> "$SESSION" appends are blocked until the active-workflow marker exists. Create the marker (Phase 1 step 2 helper) FIRST, then write the invocation entry immediately after — do not log before the marker.
Timestamps are UTC. HH:MM:SS comes from date -u +%H:%M:%S — never a local clock, never a time from memory. The append already runs through a shell, so read the clock in that same command (TS=$(date -u +%H:%M:%S)) and spend no extra tool call. Substitute the resulting value: an unexpanded $(...) reaching the log is a known regression and will not parse. Every hook-written stamp in this log is date -u, so a local-clock entry lands hours away from its neighbours and skews the workflow window hooks/workflow_summary_lib.py derives from them.
Append entries using this format:
Log at these points:
- On invocation — capture the verbatim user request AND the synthesized bug description
- After branch created — branch name
- After fix applied — files modified, brief description of the fix
- After tests — pass/fail summary
- After specs updated — which specs were updated
- On completion — PR number, merge status, success/failure
Subagent Invocation Logging
Immediately before every Agent tool call in this workflow, append a block to the session log. The Agent tool's return value does not expose subagent_type or model to the parent, so this is the only place that information can be captured.
HH:MM:SS here is UTC as well — date -u +%H:%M:%S, same rule as above. The subagent-vault-writeback.sh block that lands beside this one is hook-written and therefore already UTC; a local-clock invocation stamp would make a subagent appear to finish hours before it started.
After the Agent tool returns, the subagent-vault-writeback.sh hook automatically appends a matching "Subagent completed" block with metrics read from the sidechain transcript — do not duplicate that logging in the skill.
When to Use This (vs /smith-new)
Use /smith-bugfix when:
- Fixing a bug or broken behavior
- Making a small, well-defined change (rename, restyle, config tweak)
- The change is scoped to 1-3 files with no design ambiguity
Upgrade to /smith-new if during implementation you discover:
- Multiple systems need coordinated changes
- Design decisions require user input
- The scope is larger than initially thought
If upgrading: STOP, tell the user, and offer to switch to /smith-new with the context gathered so far.
Natural Language Triggers
If the user says any of the following (or similar phrases), treat it as invoking this command:
- "fix this"
- "bugfix this"
- "quick fix for..."
- "patch this"
- "just fix..."
When triggered by natural language, synthesize the conversation history into a concise bug/fix description and proceed as if that description was passed as $ARGUMENTS.
Phase 1: Worktree Setup
Every bugfix always runs in an isolated git worktree branched from the configured base branch (origin/$BASE_BRANCH, defaulting to origin/main). The user's current working directory and branch are NEVER touched, and concurrent Smith sessions cannot collide on the shared working tree. There is no "switch to base / stash / cancel" branching logic — the worktree is mandatory.
- Generate fix slug (2-4 words) from the fix description. Store as
$SLUG. Derive:
BRANCH=fix/$SLUGWORKTREE_PATH=/tmp/smith-bugfix-$SLUGPRIMARY_REPO=<current working directory — capture before entering the worktree>
- Resolve the configured base branch, then fetch it (does NOT change the user's current branch). Smith reads the project's integration branch from the constitution; it falls back to
mainwhen unconfigured:
``bash BASE_BRANCH=$(.specify/scripts/bash/get-base-branch.sh) git fetch origin "$BASE_BRANCH" ``
- Activate workflow tracking — invoke the shipped helper to create the per-branch marker. The workflow-gate hook (PR #20) exempts this exact helper by basename so the bootstrap runs even when no marker exists yet (per spec/31-workflow-gate-bootstrap). The helper also stamps the current session log with a
workflow-startline soworkflow-summary.sh --totals-onlycan attribute tokens to this workflow:
``bash ~/.smith/scripts/create-active-workflow.sh \ --branch "$BRANCH" \ --workflow smith-bugfix \ --slug "$SLUG" \ --worktree "$WORKTREE_PATH" ` (Falls back to scripts/create-active-workflow.sh in repo-dev layouts.) The helper exits 3 if a marker already exists for this branch under a different workflow type. The marker path is derived from --branch alone (<safe-branch>.yaml); --slug only fills the feature: field *inside* the file, so retrying with a different slug writes the identical path and exits 3 again. The remedies are to use a different branch, or — if the existing marker is stale — to clear it with clear-active-workflow.sh and retry. The marker is cleared by the Workflow Cleanup step at the end via clear-active-workflow.sh`.
- Create the worktree with the fix branch from the configured base branch (`origin/$BASE_BRANCH`):
``bash git worktree add "$WORKTREE_PATH" -b "$BRANCH" "origin/$BASE_BRANCH" ` The user's current branch is completely unaffected. They can be on main`, a feature branch, or a detached HEAD — this workflow will not interfere.
- Copy `.env` to the worktree (only if one exists in the primary repo and the fix might touch services that read it):
``bash [ -f .env ] && cp .env "$WORKTREE_PATH/.env" ``
- All subsequent phases (2-7) run inside `$WORKTREE_PATH`. Use
cd "$WORKTREE_PATH"for the first command, then keep every subsequent command scoped to that directory via absolute paths or explicitcd. Do NOTcdback to the primary repo until Phase 7.3 (merge) —gh pr mergemust run from the primary repo to avoid "main already checked out" errors.
On failure before merge: preserve the worktree for debugging and log its path in the session log. Do NOT auto-remove it. Leave the active-workflow yaml in place so the user knows the session is still holding that branch.
Ledger Context (Optional)
If .smith/vault/ledger/ exists and contains non-empty files, load relevant Ledger sections to inform this bugfix. If the directory is missing, empty, or unreadable, skip silently — the Ledger is purely additive and never required.
- Check:
ls .smith/vault/ledger/*.md 2>/dev/null - If files exist, read the following sections (higher-confidence entries first, truncate at ~2000 tokens per file):
.smith/vault/ledger/antipatterns.md.smith/vault/ledger/edge-cases.md
- Use loaded antipatterns and edge cases as additional context to avoid known failure modes. The Ledger informs judgment, it does not override spec/plan/constitution.
- Budget violation tracking: If any Ledger file was truncated (entries were dropped to fit within the ~2000 token budget per file), increment
context_budget_violationsin.smith/vault/ledger/.meta.jsonby 1. If.meta.jsondoes not exist, create it from the default template first. This signal tells the reconciliation system that the Ledger is too large for the configured budget.
Phase 2: Spec Cross-Reference
Before writing any code, check existing specs for context and conflicts.
- Identify affected systems from the fix description and map to spec directories:
services/command-center/→specs/system-15-command-center/spec.mdservices/email-pipeline/→specs/system-03-email-archive-contact-graph/spec.mdservices/sentiment-engine/→specs/sentiment-engine/spec.mdservices/communication-triage/→specs/system-05-communication-triage/spec.mdservices/voice-training/→specs/system-04-personal-voice/spec.mddocker-compose.yml→specs/system-01-core-infrastructure/spec.md- Other mappings as discovered from
specs/*/spec.mdcontent
- Read relevant spec.md files and check:
- Is the "broken" behavior actually intentional per the spec?
- Are there related requirements that could be affected by this fix?
- Are there any conflicting specs?
- If a conflict is found: STOP the workflow and alert the user. Explain the conflict and ask how to proceed. This is the ONLY point where the workflow may pause.
- If no conflicts: Continue silently.
Ledger-Informed Auto-Retry
If the bugfix execution fails, check config for auto-retry:
- Read
.smith/config.json— checkledger.auto_retryandledger.max_retries - If
auto_retryisfalse(default) or config is missing, do NOT retry — fail normally - If
auto_retryistrue:
a. Re-read .smith/vault/ledger/antipatterns.md to get the latest failure patterns b. Analyze the failure against known antipatterns to adjust the approach c. Retry the fix with the adjusted approach d. Repeat up to max_retries times (default: 2), re-reading antipatterns before each attempt e. If all retries exhausted, fail with a summary of all attempts
- Each retry attempt is logged to the session log with attempt number and adjusted approach
Phase 3: Implement the Fix
- Read the affected files to understand current behavior
- Implement the fix — keep changes minimal and focused. When the fix adds
or changes code, keep that code clean:
- Small, single-responsibility functions and files; one clear reason to change.
- Intention-revealing names (avoid
data,temp,handler,utilwhen a
meaningful name exists).
- Guard clauses over deep nesting; keep control flow shallow.
- Separation of concerns — keep I/O, business rules, and persistence in
distinct units.
- No dead code, commented-out blocks, or duplicated logic.
- Reuse existing components over recreating them — check for an existing
module/service/utility that already does it before writing something new.
This does NOT license refactoring untouched surrounding code — see the constraints below.
- Do NOT:
- Refactor surrounding code
- Add features beyond the fix
- Modify unrelated files
- Add unnecessary abstractions
Phase 3.5: Update .meta Descriptions for Touched Methods
After every Write or Edit to a source file in this fix, refresh the file's .meta description layer to reflect the new or changed methods. This step is cheap because Claude already has the source open and parsed in working memory — it does NOT regenerate descriptions for untouched methods, and it does NOT call any LLM from the save hook (the save hook remains LLM-free per data-model.md §3.2). Per data-model.md §4 and research.md §6.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/smith-bugfix/SKILL.md
Popularity
- Repository stars
- 51
- Repository forks
- 8
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/attckdigital/smith/smith-bugfix)