Agent skill

Silk Debug

by letsrevel in letsrevel/revel-backend

Analyze Django Silk profiling data to debug slow requests, detect N+1 queries, and optimize database performance.

MITAuto-check passedBackend & APIs

Install Silk Debug

skills CLI
$ npx skills add letsrevel/revel-backend --skill silk-debug -a claude-code

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

GitHub CLI
$ gh skill install letsrevel/revel-backend silk-debug --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/letsrevel/revel-backend.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/silk-debug .claude/skills/silk-debug && 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
silk-debug
GitHub stars
109
Token cost
~1.2k tokens
SKILL.md length
405 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Analyze Django Silk profiling data to debug slow requests, detect N+1 queries, and optimize database performance.

  • Works in 3 steps: COUNT on complex DISTINCT: Pagination… → Missing indexes: Full table scans → Complex JOINs: Multiple related tables
  • Analyzing request IDs
  • SKILL.md covers Tool Location, Quick Reference, Interpreting Results and Common Optimization Patterns, plus 1 more section
  • Calls python

What it does

Silk Debug is an agent skill from letsrevel/revel-backend. Analyze Django Silk profiling data to debug slow requests, detect N+1 queries, and optimize database performance. Use when analyzing request IDs, investigating slow endpoints, or optimizing query performance.

Its SKILL.md is about 1.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 Backend & APIs, covering Query optimization and Backend development. It works with Django and Python. The repository describes itself as: Open-source event management, ticketing and membership platform for communities, clubs, independent venues and independent artists. The licence is MIT.

When your agent uses it

  • Analyzing request IDs
  • Investigating slow endpoints
  • Optimizing query performance

Example prompts

  • “/silk-debug”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Bash(python:*), Bash(.venv/bin/python:*), Read, Grep

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. COUNT on complex DISTINCT: Pagination wrapping complex visibility subqueries
  2. Missing indexes: Full table scans
  3. Complex JOINs: Multiple related tables

What it can do on your machine

Read from SKILL.md and the folder at commit ae56c86. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(python:*)
    • Bash(.venv/bin/python:*)
    • Read
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    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

Silk Debug loads about 1.2k tokens when it runs. Until then it costs about 55 tokens; SKILL.md has 405 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~55
When it runs · the whole SKILL.md, loaded when a task matches
~1.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 letsrevel/revel-backend at commit ae56c86, republished under its MIT licence (© letsrevel). 405 words, ~1,242 tokens.

Download SKILL.mdSave it as .claude/skills/silk-debug/SKILL.md (or your agent's skills folder).
name
silk-debug
description
Analyze Django Silk profiling data to debug slow requests, detect N+1 queries, and optimize database performance. Use when analyzing request IDs, investigating slow endpoints, or optimizing query performance.
allowed-tools
Bash(python:*), Bash(.venv/bin/python:*), Read, Grep

Silk Debug Tool

A CLI tool for analyzing Django Silk profiling data to debug slow requests, detect N+1 queries, and optimize database performance.

Tool Location

bash
.venv/bin/python scripts/silk_debug.py

Quick Reference

Analyze a Specific Request

When given a Silk request ID (UUID), use --full for comprehensive analysis:

bash
.venv/bin/python scripts/silk_debug.py <request_id> --full

This shows:

  • Request info (path, method, status, time, query count)
  • Duplicate/similar queries (N+1 detection)
  • Slow queries (>5ms by default)
  • Queries grouped by table
  • Query execution timeline
  • Python cProfile data (if enabled)
List and Filter Requests
bash
# List recent requests
.venv/bin/python scripts/silk_debug.py --list

# Sort by different criteria
.venv/bin/python scripts/silk_debug.py --list --sort queries     # Most queries
.venv/bin/python scripts/silk_debug.py --list --sort duration    # Slowest total time
.venv/bin/python scripts/silk_debug.py --list --sort db_time     # Most DB time

# Filter requests
.venv/bin/python scripts/silk_debug.py --list --path /api/events --min-queries 20
.venv/bin/python scripts/silk_debug.py --list --method POST --min-time 100
Aggregate Analysis
bash
# Overall statistics
.venv/bin/python scripts/silk_debug.py --stats

# Endpoint summary (grouped by path pattern, shows P95)
.venv/bin/python scripts/silk_debug.py --endpoints

# Find slow endpoints
.venv/bin/python scripts/silk_debug.py --slow-endpoints --slow-endpoint-threshold 100

Interpreting Results

N+1 Query Detection

When you see duplicate queries like:

🔴 15x similar queries:
SELECT "events_ticket"."id" FROM "events_ticket" WHERE "events_ticket"."event_id" = '<UUID>'

This indicates an N+1 problem. Fix with:

  • select_related() for ForeignKey fields
  • prefetch_related() for reverse relations or M2M fields
Slow Queries

Common causes of slow queries:

  1. COUNT on complex DISTINCT: Pagination wrapping complex visibility subqueries
    • Fix: Materialize IDs in Python first, then filter with simple IN clause
  2. Missing indexes: Full table scans
    • Fix: Add database indexes on filtered/joined columns
  3. Complex JOINs: Multiple related tables
    • Fix: Optimize query structure or denormalize if appropriate
Timeline Analysis

The timeline shows query execution order with visual bars:

  1. +    0.0ms [  2.5ms] █ "accounts_reveluser"
  7. +   60.2ms [  2.8ms] █ "__count"

Look for:

  • Large gaps between queries (indicates Python processing time)
  • Queries that could run in parallel but are sequential
  • Expensive queries that block subsequent operations

Common Optimization Patterns

Expensive COUNT with DISTINCT

When you see:

sql
SELECT COUNT(*) FROM (SELECT DISTINCT ... complex subquery ...)

Fix by materializing IDs:

python
# Before (slow COUNT)
qs = Event.objects.for_user(user).filter(...).distinct()

# After (fast COUNT)
event_ids = list(Event.objects.for_user(user).values_list("id", flat=True).distinct())
qs = Event.objects.full().filter(id__in=event_ids)
Redundant Visibility Checks

When the same for_user() query appears multiple times:

  • Create a method that accepts already-checked objects
  • Cache visibility results within the request
Show full SKILL.md (166 more words)Show less
Batch Operations

When creating multiple objects:

  • Use bulk_create() instead of individual .save() calls
  • Fetch shared data (settings, related objects) once before the loop
  • Send notifications in batches, not per-item

CLI Options Reference

Single Request Analysis
  • --full, -f: Run all analyses
  • --duplicates, -d: Show N+1 candidates
  • --slow, -s: Show slow queries
  • --slow-threshold N: Slow query threshold in ms (default: 5)
  • --tables, -t: Group queries by table
  • --timeline: Show execution timeline
  • --traceback, -tb: Show code locations for duplicates
  • --profile, -prof: Show Python cProfile data
Listing and Filtering
  • --list, -l: List requests
  • --limit N: Number of results (default: 20)
  • --sort {recent,queries,duration,db_time}: Sort order
  • --path, -p: Filter by path (contains)
  • --method, -m: Filter by HTTP method
  • --status: Filter by status code
  • --min-queries N: Minimum query count
  • --min-time N: Minimum response time (ms)
  • --min-db-time N: Minimum DB time (ms)
Aggregate Views
  • --stats: Show aggregate statistics
  • --endpoints: Show endpoint summary with P95
  • --slow-endpoints: Group slow requests by endpoint
  • --slow-endpoint-threshold N: Threshold in ms (default: 200)
  • --min-count N: Minimum requests for endpoint summary

© letsrevel, 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/silk-debug of letsrevel/revel-backend.

Open the folder on GitHubat commit ae56c86

Compare with similar skills

Silk Debug 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.

Silk Debug compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Silk Debug this skillletsrevel/revel-backend109—~1.2kAutomated safety check: PassMIT
Profiling Slow API EndpointsPostHog/posthog-foss721—~1kAutomated safety check: PassMIT
Assess Migrationmendixlabs/mxcli128—~3.6kAutomated safety check: NotesApache-2.0
Django Q2hashgraph-online/awesome-codex-plugins1.2k—~1.7kAutomated safety check: PassMIT
Backend Analysis Skilljiushiwon/wg-skills110—~1kAutomated safety check: PassApache-2.0
Django DB Performancehashgraph-online/awesome-codex-plugins1.2k—~888Automated safety check: PassMIT

Similar skills

  • Profiling Slow API Endpoints

    PostHog/posthog-foss

    Official

    Profiles slow PostHog API endpoints when the main cost is in Postgres or Python.

    721 GitHub stars~1k tokensUpdated today
    DatabasesAuto-check passed
  • Assess Migration

    mendixlabs/mxcli

    Investigate an existing non-Mendix application (Java, .NET, Python, Node, PHP, …) and produce a structured migration assessment for Mendix.

    128 GitHub stars~3.6k tokensUpdated today
    Backend & APIsAuto-check: notes
  • Django Q2

    hashgraph-online/awesome-codex-plugins

    A skill your agent uses when adding, changing, testing, or debugging Django Q2 background tasks, scheduled jobs, qcluster workers, Redis broker configuration, or ORM broker fallback in Django…

    1.2k GitHub stars~1.7k tokensUpdated today
    Backend & APIsAuto-check passed
  • Backend Analysis Skill

    jiushiwon/wg-skills

    后端项目静态分析技能。不运行项目,直接扫描源码,为 Java(Spring Boot/Spring Cloud)、Go(Gin/Echo)、Python(FastAPI/Django/Flask)、Node.js(Express/NestJS) 项目产出 4 份报告:① 接口报告(全部 API 清单:方法/路径/入参/出参/鉴权)② 技术报告(语言/框架版本、中间件如…

    110 GitHub stars~1k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Django DB Performance

    hashgraph-online/awesome-codex-plugins

    Diagnose and improve slow Django database-backed endpoints with evidence-first profiling, query-plan review, index selection, ORM loading fixes, batching, database-side computation, materialized…

    1.2k GitHub stars~888 tokensUpdated today
    Backend & APIsAuto-check passed
  • Django Index Design

    hashgraph-online/awesome-codex-plugins

    Design safe Django and PostgreSQL indexes from measured query plans, including B-tree, composite, covering, partial, expression, GIN/JSONB, BRIN, and concurrent migration patterns.

    1.2k GitHub stars~643 tokensUpdated today
    Backend & APIsAuto-check passed

More from letsrevel/revel-backend

  • Loki Logs

    letsrevel/revel-backend

    A skill your agent uses when investigating production behaviour from logs — a 500/error in prod, a failing or stuck Celery task, tracing one request/traceid/user across services, or confirming a…

    109 GitHub stars~918 tokensUpdated today
    Auto-check: notes
  • Update Changelog

    letsrevel/revel-backend

    Update CHANGELOG.md comprehensively based on git tags, merged PRs, and actual code diffs.

    109 GitHub stars~1.9k tokensUpdated today
    Auto-check: notes
  • Whats New

    letsrevel/revel-backend

    Draft a "What's New" community update for the Revel Discord covering changes across backend, frontend, and infra over a time window.

    109 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Updating Deps

    letsrevel/revel-backend

    Update Python dependencies using UV. An agent skill from letsrevel/revel-backend.

    109 GitHub stars~746 tokensUpdated today
    Auto-check passed

Works with

Questions about Silk Debug

What does Silk Debug do?

Analyze Django Silk profiling data to debug slow requests, detect N+1 queries, and optimize database performance. Silk Debug is an agent skill from letsrevel/revel-backend. Analyze Django Silk profiling data to debug slow requests, detect N+1 queries, and optimize database performance.

When should I use Silk Debug?

Silk Debug fits situations like: analyzing request IDs; investigating slow endpoints; optimizing query performance.

How do I install Silk Debug in Claude Code?

Run `npx skills add letsrevel/revel-backend --skill silk-debug -a claude-code`. Or copy the skill folder (.claude/skills/silk-debug in letsrevel/revel-backend) into .claude/skills/silk-debug in your project. Claude Code loads it when a task matches its description.

How do I install Silk Debug in Codex?

Run `npx skills add letsrevel/revel-backend --skill silk-debug -a codex`. Or copy the skill folder (.claude/skills/silk-debug in letsrevel/revel-backend) into .agents/skills/silk-debug in your project. Codex loads it when a task matches its description.

Can I use Silk Debug 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 letsrevel/revel-backend --skill silk-debug -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/silk-debug, .gemini/skills/silk-debug, .github/skills/silk-debug and .opencode/skills/silk-debug in your project.

What does Silk Debug need to run?

Going by SKILL.md and its folder, Silk Debug needs the command-line tools its instructions call (python). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Bash(python:*), Bash(.venv/bin/python:*), Read, Grep.

Does Silk Debug 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 Silk Debug 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 Silk Debug use?

Silk Debug 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 Silk Debug use?

About 1.2k tokens (SKILL.md is roughly 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 Silk Debug?

Skills that share tags, products or a category with Silk Debug: Profiling Slow API Endpoints (PostHog/posthog-foss, 721 stars), Assess Migration (mendixlabs/mxcli, 128 stars), Django Q2 (hashgraph-online/awesome-codex-plugins, 1.2k stars) and Backend Analysis Skill (jiushiwon/wg-skills, 110 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Silk Debug?

letsrevel (a GitHub organization) maintains it in letsrevel/revel-backend, which has 109 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 6, 2026.

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