Token导航 LogoToken导航TokenDH.com
研究检索权限需确认github未标认证来源可访问许可证需确认审计通过

systematic-debugging系统调试

Agent Skill

用于辅助 Python 项目开发、测试、依赖管理和常见框架工作流。它适合让 Agent 阅读 Python 代码、定位测试问题、整理运行命令、生成脚本或分析数据处理逻辑。使用时需要确认项目虚拟环境、依赖版本和测试入口;涉及执行脚本、读写文件、访问数据库或调用外部 API 时,应先明确运行目录和输入输出范围,避免误改生产数据。

总安装

267

周安装

11

GitHub Stars

126

下载量

87
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:systematic-debugging(系统调试)
来源仓库:https://github.com/kjnez/claude-code-django
仓库路径:skills/systematic-debugging
安装命令:
npx skills add https://github.com/kjnez/claude-code-django --skill systematic-debugging
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/kjnez/claude-code-django --skill systematic-debugging

简介

systematic-debugging 辅助 Python 项目开发、测试、依赖管理和常见框架工作流。

  • 适合让 Agent 阅读 Python 代码、定位测试问题、整理运行命令或分析数据处理逻辑。
  • 使用时需确认项目虚拟环境、依赖版本和测试入口;涉及脚本执行时应明确运行目录。
  • 访问数据库或调用外部 API 前,应确认输入输出范围和权限边界,避免误改生产数据。
  • 该技能当前无额外说明,功能以实际实现为准。

SKILL.md

Systematic Debugging for Django

Core Principle

NO FIXES WITHOUT ROOT CAUSE FIRST

Never apply patches that mask underlying problems. Understand WHY something fails before attempting to fix it.

Four-Phase Framework

Phase 1: Reproduce and Investigate

Before touching any code:

  1. Write a failing test - Captures the bug behavior
  2. Read error messages thoroughly - Every word matters
  3. Examine recent changes - git diff, git log
  4. Trace data flow - Follow the call chain to find where bad values originate
# Write a failing test first
@pytest.mark.django_db
def test_bug_reproduction():
    """Reproduces issue #123."""
    user = UserFactory()
    response = Client().post("/profile/", {"bio": "New"})
    assert response.status_code == 200  # Currently failing

Phase 2: Isolate

Narrow down the problem:

# Add strategic logging
import logging
logger = logging.getLogger(__name__)

def problematic_view(request):
    logger.debug(f"Method: {request.method}")
    logger.debug(f"POST: {request.POST}")
    logger.debug(f"User: {request.user}")

    form = MyForm(request.POST)
    logger.debug(f"Valid: {form.is_valid()}")
    logger.debug(f"Errors: {form.errors}")

Phase 3: Identify Root Cause

  • Read the full stack trace
  • Use debugger to inspect state
  • Check what assumptions are violated

Phase 4: Fix and Verify

  1. Implement fix at the root cause
  2. Run reproduction test (should pass)
  3. Run full test suite
  4. Verify manually if needed

Django Debug Tools

Django Debug Toolbar

# settings/dev.py
INSTALLED_APPS += ["debug_toolbar"]
MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"]
INTERNAL_IPS = ["127.0.0.1"]

Check SQL panel for N+1 queries, slow queries > 10ms.

Python Debugger

def problematic_view(request):
    breakpoint()  # Execution stops here

    # Commands: n(ext), s(tep), c(ontinue), p var, q(uit)
# Drop into debugger on test failure
uv run pytest --pdb -x

Query Debugging

# Log all SQL queries
LOGGING = {
    "loggers": {
        "django.db.backends": {"level": "DEBUG", "handlers": ["console"]},
    },
}

# Count queries in tests
from django.test.utils import CaptureQueriesContext
from django.db import connection

def test_no_n_plus_one():
    with CaptureQueriesContext(connection) as ctx:
        list(Post.objects.select_related("author"))
    assert len(ctx) <= 2

Common Django Issues

N+1 Queries

# Problem
for post in Post.objects.all():
    print(post.author.email)  # Query per post!

# Fix
for post in Post.objects.select_related("author"):
    print(post.author.email)  # Single query

Form Not Saving

# Check these:
# 1. form.is_valid() returns True?
# 2. form.save() called?
# 3. If commit=False, did you call .save() on instance?

def debug_form(request):
    form = MyForm(request.POST)
    print(f"Valid: {form.is_valid()}")
    print(f"Errors: {form.errors}")

CSRF 403 Errors

<!-- Check: csrf_token in form -->
<form method="post">
    {% csrf_token %}
</form>

Migration Issues

uv run python manage.py showmigrations
uv run python manage.py migrate app_name 0001 --fake

Debugging Celery

# Run synchronously for debugging
my_task(arg)  # Direct call, not .delay()

# Or set in settings
CELERY_TASK_ALWAYS_EAGER = True

Debugging HTMX

<script>htmx.logAll();</script>
def view(request):
    print(f"HTMX: {request.headers.get('HX-Request')}")

Checklist

Before claiming fixed:

  • Root cause identified
  • Reproduction test passes
  • Full test suite passes (uv run pytest)
  • No type errors (uv run pyright)
  • No lint errors (uv run ruff check.)

Red Flags

Stop if you're thinking:

  • "Quick fix now, investigate later"
  • "One more attempt" (after 3+ failures)
  • "This should work" (without understanding why)

Three consecutive failed fixes = architectural problem. Stop and discuss.

Integration with Other Skills

  • pytest-django-patterns: Write reproduction tests
  • django-models: Debug QuerySet issues
  • celery-patterns: Debug async task failures
  • htmx-alpine-patterns: Debug HTMX requests
  • django-extensions: Use show_urls, list_model_info, and shell_plus for project introspection
  • skill-creator: Create debugging-specific skills for recurring issues

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.12%
按下载量换算31

Claude

30.23%
按下载量换算26

Cursor

19.07%
按下载量换算17

Gemini CLI

9.52%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills