跳到正文
cccskills
免费在 GitHub 公开

diagnose

Structured 6-phase debugging. Build feedback loop first, reproduce deterministically, hypothesize with ranked falsifiable theories, instrument one variable at a time, fix with regression test, cleanup. Use when a bug exists, tests fail unexpectedly, or behavior is wrong and cause is unknown.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md4.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

/supergraph:diagnose

Systematic debugging. Never guess and patch — build a feedback loop, prove the hypothesis, fix once.

Announce: "🐛 /supergraph:diagnose — building feedback loop..."

Setup

Read .supergraph-env for test/lint commands (if exists):

[ -f .supergraph-env ] && source .supergraph-env

This sets $TEST_CMD, $FOCUSED_TEST_CMD, $LINT_CMD. If absent, detect from project config (package.json → jest/vitest, pubspec.yaml → flutter test, etc.) same as /supergraph:scan.

Phases

Phase 1 — Build Feedback Loop

Before touching any code, establish a fast, deterministic way to observe the bug.

# Identify the smallest command that shows the failure
$TEST_CMD --grep "<failing test name>"   # focused test run
# or
<minimal repro command>

Goal: failure visible in < 5 seconds. If not, slim down the repro. Do NOT skip this phase. Debugging without a feedback loop is guessing.

Phase 2 — Reproduce Cleanly

  • Run the feedback loop 3 times — confirm it fails consistently
  • Capture exact error output, stack trace, exit code
  • Note any flakiness → treat as separate bug before continuing
  • Add a failing regression test if one doesn't exist:
    test("<bug description>", () => { ... }) // RED
    

Phase 3 — Hypothesize (3-5 ranked theories)

List falsifiable hypotheses, ordered most-to-least likely:

1. [Most likely] — [reason] — [how to falsify]
2. [Second]      — [reason] — [how to falsify]
3. [Third]       — [reason] — [how to falsify]

Rules:

  • Each hypothesis must be falsifiable (observable test to disprove it)
  • No implementation yet — only theories
  • Use graph context if available:
    search_graph(project=CBM_PROJECT, name_pattern=<suspect>)
    trace_path(project=CBM_PROJECT, direction="inbound")
    trace_path(project=CBM_PROJECT, direction="outbound")
    

Phase 4 — Instrument (one variable at a time)

Test hypothesis #1 first. Change ONE thing to observe ONE signal:

  • Add targeted log/assertion near the suspect code
  • Run feedback loop → confirm or refute
  • Remove instrumentation after each test — never accumulate debug logs
  • If refuted → move to hypothesis #2
  • Stop when hypothesis is confirmed

Rule: Never change the code under test and the instrumentation simultaneously.

Phase 5 — Fix + Regression Test

Once root cause is confirmed:

  1. Write/update the regression test first (stays RED)
  2. Apply minimal fix
  3. Run feedback loop → GREEN
  4. Run full test suite → no regressions
  5. Run lint: $LINT_CMD

Minimal fix means: fix the cause, not the symptom. If the fix touches a hub node → get user approval first. If search/trace returns empty, label graph evidence unavailable and fall back to Serena/filesystem evidence. Use the validated test-gaps recipe for missing tests.

Phase 6 — Cleanup + Post-mortem

  • Remove all debug instrumentation and temp files
  • Update CONTEXT.md if bug revealed a hidden domain invariant
  • One-sentence post-mortem:
    Root cause: [X]
    Fix: [Y]
    Prevented recurrence by: [regression test / invariant documented]
    
  • Checkpoint:
    git add [exact files]
    git commit -m "fix: <description>"
    

Report

✅ /supergraph:diagnose complete
- Root cause: [confirmed hypothesis]
- Fix: [what changed]
- Regression test: [test name / path]
- Tests: PASS | Lint: PASS
- Next: /supergraph:fix (if more issues) or /supergraph:verify

Rules

  • Never skip Phase 1 — feedback loop is mandatory
  • Never change two variables simultaneously in Phase 4
  • Never commit without a regression test
  • If hypotheses exhausted with no match → stop, report to user with all observations

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

analyze

免费

Risk analysis and approach selection before planning. Use when requirements are ambiguous, approaches vary, or work touches hub/bridge nodes. Skip for typo fixes.

中文简介正在准备中。当前显示原文说明。

datit309/supergraph212026年10月18日 更新

Proactive architecture review — explore codebase structure, generate a self-contained HTML report with Mermaid diagrams and candidate improvements, then grill the findings. Use when planning a large refactor, onboarding to an unfamiliar codebase, or before a major architectural change.

中文简介正在准备中。当前显示原文说明。

datit309/supergraph212026年10月18日 更新

Autonomous human-like browser control and professional QA/QC testing. Powered by agent-browser (Rust native CDP, zero Playwright) with ISTQB test matrix generation, automated testcase execution, console/network error tracing, and defect reporting.

中文简介正在准备中。当前显示原文说明。

datit309/supergraph212026年10月18日 更新

caveman

免费

Persistent token-compression mode (~75% reduction) — now always-on by default. Strips filler while keeping code exact.

中文简介正在准备中。当前显示原文说明。

datit309/supergraph212026年10月18日 更新

Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across PostgreSQL, MySQL, and common ORMs (Prisma, Drizzle, Kysely, Django, TypeORM, golang-migrate).

中文简介正在准备中。当前显示原文说明。

datit309/supergraph212026年10月18日 更新

Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check.

中文简介正在准备中。当前显示原文说明。

datit309/supergraph212026年10月18日 更新

查看 datit309 的全部技能

报告此技能的问题