/yka-code:fix-bugfrom yka-code
[yka-code] Systematic bug-fix workflow. Use when the user reports a bug, error, crash, failing test, unexpected behavior, or says something is "broken". Leverages claude-mem (past solutions), Explore agent (codebase), silent-failure-hunter (for fallback-hiding bugs), and existing tests. Not for new features or refactors.
Ships in yka-code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A bug is a behavior that violates an expectation. The workflow is: reproduce → understand → hypothesize → fix → prove.
Load and apply the karpathy-guidelines skill alongside this workflow. Short version:
| Condition | Tool | Why |
|---|---|---|
| Always, first thing | /claude-mem:mem-search | Cheap; might already be solved |
| Bug is in unfamiliar library code | docfork MCP (needs DOCFORK_API_KEY) | Library's current API/behavior |
| "Has anyone in OSS hit this bug?" | deepwiki MCP | Free Q&A over public repos |
| Bug spans multiple files; need cheap structural search | /claude-mem:smart-explore | AST-based; cheaper than Read + grep |
| Bug involves SQL / DB query / schema | psql / mongosh / project ORM CLI | Run EXPLAIN ANALYZE on the failing query directly |
| Bug involves an external SaaS integration | composio MCP (needs COMPOSIO_API_KEY) | Covers 500+ services |
| Need to test the fix in isolation | container-use CLI | Sandboxed branches per agent |
| Bug is a UI/form-flow regression that needs browser repro | playwright-cli skill | CLI-driven browser automation — capture snapshots + console logs per step |
| Past similar fixes in related repos | github MCP (needs GITHUB_PAT) | Cross-repo PR/issue search |
| Error trace is massive + long context | Consider context-mode MCP | Context compression for long sessions |
Before Phase 1 fires: does the fix touch >2 files, involve plan + fix + review as distinct steps, or need a verify-fix iteration loop? If ANY yes → stop fix-bug, route back to /do which will pick team-do. fix-bug is for single-file, bounded bug fixes.
Only continue if the fix is genuinely local.
Before touching any code, run /claude-mem:mem-search with the error signature / symptom. If we've solved this or a cousin before, the answer may already be in memory. This is free — always check.
Explore agent to trace the call graph from entry point to the failure pointserena MCP for type-accurate cross-references (where is this function called? what types flow in?)ast-grep to find similar patterns elsewhere that might have the same bugWrite down (in a comment or scratch buffer) your best guess for WHY the bug happens. Not what code to change — the root cause. Examples:
req.user after the handler reads it"If you can't articulate a root cause in one sentence, go back to Phase 3.
Before editing, spawn pr-review-toolkit:silent-failure-hunter on the file(s) you'll touch. Bugs often cluster — the one reported is rarely the only one. This catches catch-blocks that swallow errors, fallbacks that mask real failures, etc.
If the fix touches >1 file OR changes a public API OR crosses a module boundary, enter Claude Code's native plan mode (EnterPlanMode / Shift+Tab) with the hypothesis from Phase 4. Present the proposed fix shape — file list, approach, test strategy — to the user. Iterate until approved, then exit plan mode. Skip plan-iterate for single-file, local fixes.
Before writing the regression test, invoke Skill(skill: "test-driven-development"). Not "consider" — call. The upstream skill owns the RED → GREEN → REFACTOR cycle; the regression test must be written red-first (failing against the current, buggy code) before any fix lands.
Before claiming the fix is done, invoke Skill(skill: "verification-before-completion"). Non-negotiable. The regression-test red → green cycle and full test suite exit code must both be verified fresh. No "Done!" without this.
/code-review:code-review on the diff — a second pass in case something sneaked by/commit-commands:commit with a message like fix(scope): root cause, not symptom/claude-mem:mem-search away from being "fixed in the past".User: "The login endpoint returns 500 when the user's email has a + sign in it."
/claude-mem:mem-search "login email + sign" → no prior knowledge[email protected], see the 500. Grep logs for the error — InvalidEmail: expected RFC-5321 compliant.Explore → trace from /api/login → through validateEmail() → into lib/email.ts:42 (a regex that doesn't allow +)serena find-references → 3 other callers of validateEmail(); they're all signup/recovery — same bug affects all of them.+ is valid per RFC 5321 but /^[a-zA-Z0-9.@]+$/ rejects it."pr-review-toolkit:silent-failure-hunter on lib/email.ts → flags a try { ... } catch { return false; } that hides parse errors. Note for follow-up.+, -, _). Write test "[email protected]" → passes./code-review:code-review → clean./commit-commands:commit → fix(email): allow RFC-5321 local-part chars (+, -, _).brainstorming (UPSTREAM) — only if the user's bug report is fuzzy ("something's wrong, can't quite say what"). Normally skip.test-driven-development — See Phase 6 — invoked there as an explicit tool call, not an optional chain.verification-before-completion — See Phase 6.5 — invoked there as an explicit tool call, not an optional chain.refactor-safely — if the fix reveals tangled surrounding code, queue a separate refactor pass (don't fold it in).doc-hygiene — if the fix invalidates a doc claim, update docs in the same PR.security-audit — if the bug is a security issue (CVE, auth bypass, injection), escalate before committing.What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (youssefkadaouiabbassi/yka-code) — no native marketplace selected
npx claudepluginhub p/youssefkadaouiabbassi-code-tools-setup20 skills in this plugin
/audit-rigor[yka-code] Discipline for audit, review, and technology-comparison tasks. Use when the request is "audit X", "review our stack", "is this the best option", "compare alternatives", "what should we swap / add / drop", or any task that produces prioritized recommendations rather than new code. Enforces a ≥70% confidence threshold, delegate-retrieval-to-subagent pattern, inline citations with ISO dates, MCP-first sourcing, and a fixed output format (SWAP / ADD / DROP / KEEP-BUT-UPGRADE / SURPRISE). Pair with research-first (retrieval discipline) and karpathy-guidelines (surgical scope). Chained from security-audit, onboard-codebase, and any /do route that smells like "is this the best we have"./ci-hygiene[yka-code] CI/CD and DevOps hygiene enforcer. Activates when editing GitHub Actions workflows, Dockerfiles, docker-compose, justfile, deploy scripts, or any CI configuration. Enforces pinned versions, proper Claude Code invocation in CI (--bare, API key not Max sub), secret management, and reproducibility. Fills the DevOps gap — no plugin covers this in the wild./coding-style[yka-code] Enforce minimalist, self-documenting, defensively-sane coding style. Use ALWAYS when writing, editing, or reviewing ANY code in ANY language — every function, every edit, every diff, no exceptions. Covers five rules: (1) no comments unless critical (WHY only, never WHAT, never history), (2) clean + optimized (no dead code, no speculative abstractions, no stale imports, delete over deprecate), (3) self-documenting names (full words, verbs for functions, nouns for data), (4) smallest surface (one function one concern, extract only on 3rd reuse, validate only at boundaries), (5) no dead defense (no try/catch for impossible cases, no fallbacks for inputs you control, let errors bubble to the right handler). Pair with karpathy-guidelines for behavioral principles (Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution).Other plugins' skills for the same job