debug-backend

debug-backend is a skill for Claude Code from yerdaulet-damir/vibe-coding-rules. It costs 62 tokens per session (1,163 once invoked), scanned A, original, MIT.

A five-step method for finding bugs in the backend of an AI-powered FastAPI application. FastAPI is a Python framework for building web APIs; the method checks routing, business logic, database access, and outside-service code separately.

In plain words
What is it for?
Use it when a bug, failed test, or unexpected backend behaviour appears, especially when the application has API routes, services, repositories, or provider integrations.
Why use it?
It helps identify the layer causing a failure before code is changed. That avoids making broad edits that introduce more problems.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is bash scripts/lint-architecture.sh.

Good fit Use it when a bug, failed test, or unexpected backend behaviour appears, especially when the application has API routes, services, repositories, or provider integrations.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/yerdaulet-damir/vibe-coding-rules
agentmods
npx agentmods add skills/yerdaulet-damir/vibe-coding-rules/debug-backend

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for debug-backend

README.md
[![agentmods](https://agentmods.dev/badge/skills/yerdaulet-damir/vibe-coding-rules/debug-backend/github.svg)](https://agentmods.dev/skills/yerdaulet-damir/vibe-coding-rules/debug-backend)
Your own site
<a href="https://agentmods.dev/skills/yerdaulet-damir/vibe-coding-rules/debug-backend"><img src="https://agentmods.dev/badge/skills/yerdaulet-damir/vibe-coding-rules/debug-backend/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for debug-backend

Your own site · 80×15
<a href="https://agentmods.dev/skills/yerdaulet-damir/vibe-coding-rules/debug-backend"><img src="https://agentmods.dev/badge/skills/yerdaulet-damir/vibe-coding-rules/debug-backend.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,163 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00062 $0.01163
Opus 5.5 $0.00025 $0.00465
Sonnet 5.5 $0.00012 $0.00233
Haiku 4.5 $0.00006 $0.00116

Measured 1mo ago against content hash 859567984bf4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

debug-backend 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 1mo 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.

.claude/skills/debug-backend/SKILL.md · 135 lines

How it starts

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

debug-backend

Stop. Do not edit any file yet. Work through these 5 steps in order.


Step 1 — Locate the layer

Run these greps to find where the bug lives. Check one layer at a time.

# Is it a routing problem? (wrong status code, missing auth, bad request parsing)
grep -n "HTTPException\|status_code\|Depends(" app/routers/<file>.py

# Is it a service logic problem? (wrong calculation, wrong state transition)
grep -n "def \|raise \|return " app/services/<file>.py

# Is it a repository problem? (wrong query, missing user_id scope, transaction issue)
grep -n "SELECT\|filter\|where\|FOR UPDATE" app/repositories/<file>.py

# Is it a provider problem? (timeout, wrong response shape, missing error handling)
grep -n "httpx\|raise\|return\|except" app/providers/<file>.py

Decision: fix only in the layer where the bug lives. Never fix a service bug in the router.


Step 2 — Check the 3 most common AI antipatterns

These cause 80% of production bugs in AI-coded backends. Grep for each:

# Antipattern 1: SQLAlchemy Session leaked into services
grep -rn "AsyncSession\|Session\|from sqlalchemy" app/services/

# Antipattern 2: Provider returning raw dict instead of domain type
grep -rn "return {" app/providers/

# Antipattern 3: Business logic in router (calculation, state change, external call)
grep -c "await.*service\|await.*repo\|if.*balance\|FOR UPDATE" app/routers/*.py
Result Root cause Principle
Session in services Hexagonal boundary broken B1
return {} from provider Missing ACL B3
Logic in router Layer violation A3 / code-standards
No user_id filter in query Multi-tenancy gap security-rules

Step 3 — Write a reproducing test first

Before changing any production code, write a failing test that captures the exact bug.

# Template: place in tests/unit/ or tests/integration/
async def test_<bug_description>():
    # Arrange: minimal setup that triggers the bug
    repo = FakeCreditsRepo()
    repo.seed_balance("user-1", Decimal("5.00"))
    service = CreditsUserService(repo=repo)

    # Act: call the exact code path that fails
    with pytest.raises(ValueError, match="Insufficient balance"):
        await service.charge("user-1", Decimal("10.00"), idempotency_key="idem-1")

    # Assert: prove the invariant that was violated
    assert await repo.get_balance("user-1") == Decimal("5.00")  # not negative

Read the full file on GitHub · 135 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. 1mo ago First seen · 135 lines · 62 tokens per session scan A 859567984bf4

Subscribe to this mod's changes

debug-backend is a skill published in the GitHub repository yerdaulet-damir/vibe-coding-rules (34 stars, last pushed 5mo ago), licensed MIT. It adds 62 tokens to every session and 1,163 once invoked, about $0.0002 per session on Opus 5.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-31.

Related

Other skills, from other repositories

error-handling-patterns

Structured error types, recovery strategies, and boundary-aware error handling. Prevents raw string errors, leaked stack traces, and silent failures.

Vimalk0703/shipworthy · 33 tokens

ring:using-assert

Using lib-observability/assert, Lerian's runtime assertion package, in two modes. Sweep Mode detects panic()/log.Fatal zero-panic violations, DIY invariant checks, hand-rolled domain predicates, and missing InitAssertionMetrics. Reference Mode catalogs the asserter lifecycle, domain predicates, observability trident…

LerianStudio/ring · 99 tokens

eval-hooks

Audit Claude Code and Codex hooks for validity, safety, and correctness across settings.json, hooks.json, config.toml, plugin, and skill or agent frontmatter hooks. Resolves each command, checks event names, handler types, matchers, exit-code and JSON decision strategy, and timeouts against each host's documented…

FlorianBruniaux/claude-code-ultimate-guide · 115 tokens

check-cache-bugs

Audit Claude Code setup for cache bugs (CC#40524): sentinel, --resume/--continue, attribution header + ArkNill B3/B4/B5.

FlorianBruniaux/claude-code-ultimate-guide · 38 tokens

sandbox-unblock

Diagnostic protocol to run before reporting a sandbox blocker or asking for a configuration change. Eleven checks that eliminate false positives, then a report template the person holding the settings can act on. On one measured day, six of eight reported blockers turned out to be false, all from the same handful of…

FlorianBruniaux/claude-code-ultimate-guide · 65 tokens

axum-idioms

Axum (0.8+) web framework patterns: type-safe extractors, Tower middleware, route routing, and graceful shutdown. Use when implementing HTTP APIs or web services in Rust. Pair with rust-idioms.

irahardianto/awesome-agv · 50 tokens