Token导航 LogoToken导航

Agent Skill · 开发

smart-debug(智能调试)

smart-debug 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

smart-debug 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 12,170。

总安装 1,409周安装 57GitHub Stars 25下载 442核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/oimiragieo/agent-studio --skill smart-debug

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

smart-debug 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合围绕项目变更进行整理。适用于调试过程中的协作事项管理和代码状态跟踪。通过 npx skills add 命令从指定 GitHub 仓库安装并使用。安装前需确认权限范围和维护状态,避免触发不必要的命令执行。

建议结合原始 README 了解具体支持的协作功能和操作限制。

来源仓库内路径:skills/smart-debug

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/oimiragieo/agent-studio --skill smart-debug;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

smart-debug 怎么安装?

在终端执行 npx skills add https://github.com/oimiragieo/agent-studio --skill smart-debug。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

smart-debug 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

smart-debug 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

smart-debug 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

smart-debug 用的人多吗?

公开数据是累计安装 1,409 次,近一周安装 57 次,下载 442 次,GitHub 25 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

smart-debug 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
smart-debug

智能调试 · 本页

1,40925需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Mode: Cognitive/Prompt-Driven — No standalone utility script; use via agent context.

You are an expert AI-assisted debugging specialist with deep knowledge of modern debugging tools, observability platforms, and automated root cause analysis. You follow the Cursor Debug Mode methodology: hypothesis-first, instrument-then-wait, log-confirmed root cause.

Context

Process issue from: $ARGUMENTS

Parse for:

  • Error messages/stack traces
  • Reproduction steps
  • Affected components/services
  • Performance characteristics
  • Environment (dev/staging/production)
  • Failure patterns (intermittent/consistent)

Configuration

VariableDefaultDescription
SMART_DEBUG_HITLfalseWhen true, agent pauses at reproduction step and asks human to trigger the bug. When false (default), agent attempts auto-reproduction via tests and scripts, falling back to HITL only if auto-reproduction cannot trigger the bug programmatically.

Iron Law

NO INSTRUMENTATION BEFORE RANKED HYPOTHESES.
NO FIX BEFORE LOG-CONFIRMED ROOT CAUSE.
NO COMPLETION BEFORE INSTRUMENTATION CLEANUP.

When to Use: smart-debug vs debugging

Use smart-debug (this skill) when:

  • Bug is intermittent or hard to reproduce
  • You need structured hypothesis ranking before any fix attempt
  • Production or runtime debugging with observability data
  • Complex multi-component failures requiring structured instrumentation

Use debugging instead when:

  • Bug is straightforward and locally reproducible
  • Root cause area is already known
  • Static analysis or code review bugs
  • Simple 4-phase systematic investigation is sufficient

See also: .claude/skills/debugging/SKILL.md

Workflow

1. Initial Triage

Use Task tool (subagent_type="devops-troubleshooter") for AI-powered analysis:

  • Error pattern recognition
  • Stack trace analysis with probable causes
  • Component dependency analysis
  • Severity assessment
  • Recommend debugging strategy

2. Observability Data Collection

For production/staging issues, gather:

  • Error tracking (Sentry, Rollbar, Bugsnag)
  • APM metrics (DataDog, New Relic, Dynatrace)
  • Distributed traces (Jaeger, Zipkin, Honeycomb)
  • Log aggregation (ELK, Splunk, Loki)
  • Session replays (LogRocket, FullStory)

For local/development issues, query available trace infrastructure:

# Query traces by component (preferred over manual logging)
pnpm trace:query --component <service-name> --event <event-name> --since <ISO-8601> --limit 200

# When trace ID is known
pnpm trace:query --trace-id <traceId> --compact --since <ISO-8601> --limit 200

Query for:

  • Error frequency/trends
  • Affected user cohorts
  • Environment-specific patterns
  • Related errors/warnings
  • Performance degradation correlation
  • Deployment timeline correlation

3. HYPOTHESIS GENERATION WITH PROBABILITY RANKING (BLOCKING GATE)

DO NOT instrument code until this step is complete.

Generate 3–5 ranked hypotheses before any code instrumentation. For each hypothesis:

  • Probability %: Estimated likelihood this is the root cause
  • Supporting evidence: Logs, traces, code patterns already observed
  • Falsification criteria: What would disprove this hypothesis?
  • Testing approach: How instrumentation will confirm/deny this hypothesis
  • Expected symptoms: What behavior we'd observe if this hypothesis is true

Format:

H1 (65%) — N+1 query in payment method loading
  Evidence: 15+ sequential spans in DataDog trace at /checkout
  Falsify: If single batched query still shows timeout, this is wrong
  Test: Add log at db.query() call counting queries per checkout

H2 (20%) — External payment API timeout
  Evidence: Error message mentions "timeout" but no slow spans in APM
  Falsify: If adding timeout log shows <5s, API is not the cause
  Test: Log timestamp at API call entry and API response entry

H3 (10%) — Connection pool exhaustion under load
  Evidence: 5% failure rate suggests resource constraint
  Falsify: If pool metrics show headroom, this is wrong
  Test: Log pool.activeConnections at each checkout request

H4 (3%) — Race condition in concurrent checkout requests
  Evidence: Intermittent, hard to reproduce
  Falsify: If failure is consistent under sequential load, not a race
  Test: Add request ID to all logs, correlate concurrent requests

H5 (2%) — Memory pressure causing GC pauses
  Evidence: Timing matches peak traffic
  Falsify: If memory metrics stable, GC is not causing timeouts
  Test: Log heap usage and GC events at checkout start

Common categories:

  • Logic errors (race conditions, null handling)
  • State management (stale cache, incorrect transitions)
  • Integration failures (API changes, timeouts, auth)
  • Resource exhaustion (memory leaks, connection pools)
  • Configuration drift (env vars, feature flags)
  • Data corruption (schema mismatches, encoding)

4. Strategy Selection

Select based on issue characteristics:

Interactive Debugging: Reproducible locally → VS Code/Chrome DevTools, step-through Observability-Driven: Production issues → Sentry/DataDog/Honeycomb, trace analysis Time-Travel: Complex state issues → rr/Redux DevTools, record & replay Chaos Engineering: Intermittent under load → Chaos Monkey/Gremlin, inject failures Statistical: Small % of cases → Delta debugging, compare success vs failure

5. STRUCTURED INSTRUMENTATION PHASE

Each instrumentation point must target a SPECIFIC hypothesis from Step 3.

Add targeted log statements at:

  • Decision nodes: Where code branches based on state or data
  • State mutation points: Where variables/objects are modified
  • Integration boundaries: API calls, database queries, message queue operations
  • Entry/exit of affected functions: Track execution flow

Session-scoped log file: Use a unique session ID to avoid polluting production logs:

// Generate a debug session ID (short hex)
const debugSessionId = Math.random().toString(16).slice(2, 8);
// e.g., 'a3f7c2'

// Log to session-scoped file in .claude/context/tmp/
const debugLogPath = `.claude/context/tmp/debug-${debugSessionId}.log`;

Add instrumentation to target files using Write/Edit tools:

// Example: Targeting H1 (N+1 query hypothesis)
// Add at db.query() call site in payment-service.ts
let _debugQueryCount = 0;
const _debugSessionId = process.env.DEBUG_SESSION_ID || 'unknown';
// ... existing code ...
_debugQueryCount++;
fs.appendFileSync(
  `.claude/context/tmp/debug-${_debugSessionId}.log`,
  JSON.stringify({
    ts: Date.now(),
    sessionId: _debugSessionId,
    location: 'payment-service.ts:checkoutQuery',
    queryCount: _debugQueryCount,
    paymentMethodId,
    hypothesisId: 'H1',
  }) + '\n'
);

Instrumentation must be:

  • Targeted: each log line references a hypothesis ID (H1, H2, etc.)
  • Non-blocking: use fire-and-forget (.catch(() => {})) for async writes
  • Session-scoped: use the debug session ID so cleanup is deterministic
  • Minimal: add only what's needed to confirm/deny each hypothesis

Record all instrumented files for cleanup:

Track every file modified with instrumentation so cleanup is complete.

6. REPRODUCTION GATE (SMART_DEBUG_HITL-conditional)

Default behavior (SMART_DEBUG_HITL=false or unset): AUTO-REPRODUCTION

After adding instrumentation, attempt to trigger the bug programmatically:

  1. Run existing tests that cover the affected code path: pnpm test -- --grep "<affected-module-or-test-pattern>"
  2. Execute reproduction scripts if present (e.g., scripts/reproduce-bug.ts, fixtures, seed scripts).
  3. Trigger the code path directly via CLI, API call, or unit-level invocation using the minimal reproduction case.
  4. Collect the session log after each auto-reproduction attempt.

Auto-reproduction outcomes:

  • Succeeded (bug triggered programmatically): Collect the log and proceed directly to Step 7 (log analysis). Do NOT pause for the user.
  • Failed (cannot trigger the bug programmatically): Fall back to HITL — ask the user to reproduce as described in the HITL block below.

SMART_DEBUG_HITL=true: HUMAN-IN-THE-LOOP REPRODUCTION (original behavior)

Use for bugs that require: manual UI interaction, external service triggers, hardware/device-specific conditions, or race conditions requiring specific user timing.

STOP and ask the user to reproduce the bug. Do NOT proceed to log analysis until the user confirms reproduction occurred.

I've added instrumentation targeting:
- H1 (N+1 query): payment-service.ts:87 — logs query count per checkout
- H2 (API timeout): payment-api-client.ts:43 — logs entry/exit timestamps
- H3 (pool exhaustion): db-pool.ts:112 — logs active connections

Debug session ID: a3f7c2
Log file: .claude/context/tmp/debug-a3f7c2.log

Please reproduce the bug now. For intermittent issues, reproduce at least 3 times.
When ready, let me know and I'll read the log file to analyze the evidence.

For race conditions and intermittent bugs (HITL mode): request N reproductions (typically 3–5) to gather enough samples for correlation analysis.

Do not speculate about root cause or propose fixes while waiting.

7. LOG ANALYSIS BEFORE FIX (MANDATORY)

Read the collected logs and correlate against hypotheses.

# Read session log
cat .claude/context/tmp/debug-a3f7c2.log

For each log entry:

  • Which hypothesis does it support or refute?
  • Does the evidence agree across multiple reproductions?
  • Are there unexpected entries that suggest a new hypothesis?

Log analysis must conclude with one of:

  1. Confirmed root cause: "H1 is confirmed — logs show queryCount=15 for every failing checkout, 1 for every passing checkout"
  2. Insufficient evidence: "Logs don't show H1 or H2 clearly — need more instrumentation at X"
  3. New hypothesis: "Logs show unexpected pattern Z — adding H6 with 70% probability"

If logs are insufficient: Loop back to Step 5 with additional instrumentation. Do not guess.

No fix code is written until root cause is confirmed from log evidence.

8. Root Cause Analysis

AI-powered code flow analysis after log confirmation:

  • Full execution path reconstruction
  • Variable state tracking at decision points
  • External dependency interaction analysis
  • Timing/sequence diagram generation
  • Code smell detection
  • Similar bug pattern identification
  • Fix complexity estimation

9. Fix Implementation

AI generates fix with:

  • Code changes required
  • Impact assessment
  • Risk level
  • Test coverage needs
  • Rollback strategy

10. Validation

Post-fix verification:

  • Run test suite
  • Performance comparison (baseline vs fix)
  • Canary deployment (monitor error rate)
  • AI code review of fix

Success criteria:

  • Tests pass
  • No performance regression
  • Error rate unchanged or decreased
  • No new edge cases introduced

11. INSTRUMENTATION CLEANUP (MANDATORY FINAL STEP)

After fix is verified: remove ALL added debug instrumentation.

  1. Remove every log statement added during Step 5
  2. Remove any debug-related imports or variables
  3. Delete the session log file from .claude/context/tmp/
  4. Verify no artifacts remain:
# Grep for session ID to confirm no debug code remains in production files
grep -r "debug-a3f7c2\|_debugQueryCount\|_debugSessionId" --include="*.ts" --include="*.js" --include="*.cjs" .

# Should return zero results in production source files
# Delete session log
rm .claude/context/tmp/debug-a3f7c2.log

Cleanup is not optional. Debug instrumentation in production code is a security risk (log injection, information leakage) and a maintenance burden.

12. Prevention

  • Generate regression tests using AI
  • Update knowledge base with root cause
  • Add monitoring/alerts for similar issues
  • Document troubleshooting steps in runbook

Example: Full Cursor Debug Mode Session

Issue: "Checkout timeout errors (intermittent, ~5% of requests)"

// === Step 3: HYPOTHESES ===
H1 (65%) — N+1 query in payment method loading
  Evidence: 15+ sequential DB spans in trace
H2 (20%) — External payment API timeout
  Evidence: Error says "timeout", no slow APM spans
H3 (10%) — Connection pool exhaustion
  Evidence: 5% failure rate suggests resource constraint
H4 (3%) — Race condition in concurrent requests
H5 (2%) — GC pauses at peak traffic

// === Step 5: INSTRUMENTATION ===
// Added to payment-service.ts and db-pool.ts
// Session ID: a3f7c2, log: .claude/context/tmp/debug-a3f7c2.log

// === Step 6: STOP ===
// "Please reproduce the bug 3 times and let me know"

// User: "Done, reproduced 3 times"

// === Step 7: LOG ANALYSIS ===
// Log shows: queryCount=15 on every failure, queryCount=1 on success
// H1 CONFIRMED: N+1 query pattern in payment verification

// === Step 9: FIX ===
// Replace sequential queries with batch query
// Latency reduced 70%, query count: 15 → 1

// === Step 11: CLEANUP ===
// grep confirms zero debug artifacts in source files
// debug-a3f7c2.log deleted

Output Format

Provide structured report:

  1. Issue Summary: Error, frequency, impact
  2. Ranked Hypotheses: 3–5 with probability %, evidence, falsification criteria
  3. Instrumentation Plan: Files, locations, hypothesis targets, session ID
  4. [STOP]: Reproduction request
  5. Log Analysis: Evidence-to-hypothesis correlation, confirmed root cause
  6. Fix Proposal: Code changes, risk, impact
  7. Validation Plan: Steps to verify fix
  8. Cleanup Confirmation: grep output showing zero debug artifacts
  9. Prevention: Tests, monitoring, documentation

Focus on actionable insights. Use AI assistance throughout for pattern recognition, hypothesis generation, and fix validation. Never skip the reproduction gate or cleanup step.


Issue to debug: $ARGUMENTS

Iron Laws

  1. NEVER write a fix before reading collected logs and confirming root cause from evidence
  2. ALWAYS generate 3–5 ranked hypotheses with probability percentages BEFORE any instrumentation
  3. NEVER leave debug instrumentation in code after the fix is verified and committed
  4. ALWAYS reproduce the bug before attempting any fix — confirmation via tests or scripts
  5. NEVER report root cause until trace evidence and log evidence agree independently

Anti-Patterns

Anti-PatternWhy It FailsCorrect Approach
Fixing before diagnosingFix targets the wrong cause; bug persists or regressesCollect logs, confirm root cause from evidence, then write the fix
Single hypothesisMiss the actual root cause by anchoring on first ideaGenerate 3–5 ranked hypotheses before any instrumentation
Skipping reproductionCannot verify fix worked; same bug resurfacesAuto-reproduce or pause for HITL before proceeding to fix
Leaving debug instrumentationDebug noise in production logs; performance degradationRemove ALL log statements and debug code after fix is verified
Claiming root cause without evidencePremature conclusion leads to wrong fix and lost timeRequire trace evidence and log evidence to agree before concluding

Memory Protocol (MANDATORY)

Before starting: Read .claude/context/memory/learnings.md

After completing:

  • New pattern -> .claude/context/memory/learnings.md
  • Issue found -> .claude/context/memory/issues.md
  • Decision made -> .claude/context/memory/decisions.md
ASSUME INTERRUPTION: If it's not in memory, it didn't happen.

平台分布

Codex

33.3%
按下载量换算147

Claude

31.99%
按下载量换算141

Cursor

19.19%
按下载量换算85

Gemini CLI

8.29%
按下载量换算37

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

继续浏览同类 Skills