Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计提醒

systematic-debugging系统调试

Agent Skill

systematic-debugging 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

474

周安装

19

GitHub Stars

9

下载量

154
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/freenet/freenet-agent-skills --skill systematic-debugging

简介

systematic-debugging 技能提供系统级问题的排查方法与日志分析指引。

  • 适用于复杂服务故障的快速定位与根因识别。
  • 支持在多个 AI 宿主中通过 GitHub 仓库集成使用。
  • 建议配合监控工具与错误追踪平台共同使用。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Systematic Debugging

When to Use

Invoke this methodology automatically when:

  • A test fails and the cause isn't immediately obvious
  • Unexpected behavior occurs in production or development
  • An error message doesn't directly point to the fix
  • Multiple potential causes exist

Core Principles

  1. Hypothesize before acting - Form explicit hypotheses about root cause before changing code
  2. Test hypotheses systematically - Validate or eliminate each hypothesis with evidence
  3. Parallelize investigation - Use subagents for concurrent readonly exploration
  4. Preserve test integrity - Never weaken tests to make them pass

Debugging Scope Ladder

Always prefer the smallest, most reproducible scope that demonstrates the bug. Work up the ladder only when the smaller scope can't reproduce or doesn't apply:

PriorityScopeWhen to UseCommand
1Unit testLogic errors, algorithm bugs, single-function issuescargo test -p freenet -- specific_test
2Mocked unit testTransport/ring logic needing isolationUnit test with MockNetworkBridge / MockRing
3Simulation testMulti-node behavior, state machines, race conditionscargo test -p freenet --test simulation_integration -- --test-threads=1
4SimNetwork + FaultConfigFault tolerance, message loss, network partitionsSimNetwork with configured fault injection
5fdev single-processQuick multi-peer CI validationcargo run -p fdev -- test --seed 42 single-process
6freenet-test-network20+ peer large-scale behaviorDocker-based freenet-test-network
7Real networkIssues that only manifest with real UDP/NAT/latencyManual multi-peer test across machines

Why this order matters:

  • Lower scopes are faster, deterministic, and reproducible by anyone
  • Higher scopes require more infrastructure, time, and may not be accessible to all contributors
  • Gateway logs, aggregate telemetry, and production metrics are not available to every developer — don't assume access to these when designing reproduction steps

Debugging Workflow

Phase 0: Claim the Issue

If you're working on a GitHub issue, check if it's already assigned before starting. If someone else is assigned, stop and inform the user — don't duplicate effort. If unassigned, assign it to yourself so others know it's being worked on:

gh issue view <ISSUE> --repo freenet/<REPO>  # Check assignees
gh issue edit <ISSUE> --repo freenet/<REPO> --add-assignee @me

Phase 1: Reproduce and Isolate

  1. Reproduce the failure — Confirm the bug exists and is reproducible
  2. Use the scope ladder — Start at the smallest scope that can demonstrate the bug:

- Can you write a unit test? Try that first - Needs multiple nodes? Use the simulation framework with a deterministic seed - Only happens under fault conditions? Use SimNetwork with FaultConfig - Can't reproduce in simulation? Then escalate to real network testing

  1. Record the seed — When using simulation tests, always record the seed value for reproducibility
  2. Gather initial evidence — Read error messages, logs, stack traces

Simulation-first approach for distributed bugs:

# Run simulation tests deterministically
cargo test -p freenet --features simulation_tests --test sim_network -- --test-threads=1

# With logging to observe event sequences
RUST_LOG=info cargo test -p freenet --features simulation_tests --test sim_network -- --nocapture --test-threads=1

# Reproduce with a specific seed
cargo run -p fdev -- test --seed 0xDEADBEEF single-process

Phase 1b: When the Bug Is Reported from the Live Network

When a bug comes from production observations (user reports, telemetry, monitoring), the goal is to translate the network observation into a local reproduction as fast as possible. Live-network debugging has the slowest feedback loop — adding telemetry, redeploying, waiting — so minimize time spent there.

The workflow:

  1. Constrain the problem from network data — What operation type? Which peers? What hop count? What timing pattern? Use telemetry or user reports to narrow this down.
  2. Translate constraints into simulation parameters:
Network ObservationSimulation Translation
"GET times out at hop 3"#[freenet_test] with 4+ nodes, specific node_locations matching topology
"Peer X never responds"Node configured to drop/delay messages via FaultConfig
"73% timeout rate"FaultConfig {message_loss_rate: 0.7,..} or unresponsive target node
"Works for PUT but not GET"Test both operations — likely incomplete wiring in dispatch path
"Rapid connect/disconnect cycles"Simulation with transport-level fault injection
"Messages dropped after acknowledgement"FaultConfig with selective message loss after initial handshake
  1. Write the simulation test — Start with #[freenet_test] or SimNetwork + FaultConfig. Use a deterministic seed.
  2. Debug locally — Now iterate with full control: add tracing, assertions, state inspection. No redeployment needed.
  3. Validate — Optionally confirm via telemetry that the deployed fix improves live behavior.

If a telemetry-monitor skill is available (project-local, not part of this plugin), use it to query the centralized OpenTelemetry collector for constraining the problem. But treat telemetry as input to simulation design, not as the primary debugging tool.

Resist the temptation to keep adding telemetry to find the root cause. Once you know *what* fails (operation type, peer pattern, timing), stop analyzing network data and reproduce locally. The simulation feedback loop is orders of magnitude faster.

Phase 2: Form Hypotheses

Before touching any code, explicitly list potential causes:

Hypotheses:
1. [Most likely] The X component isn't handling Y case
2. [Possible] Race condition between A and B
3. [Less likely] Configuration mismatch in Z

Rank by likelihood based on evidence. Avoid anchoring on the first idea.

Freenet-specific hypothesis patterns:

  • State machine bugs — Invalid transitions in operations (CONNECT, GET, PUT, UPDATE, SUBSCRIBE)
  • Ring/routing errors — Incorrect peer selection, distance calculations, topology issues
  • Transport issues — UDP packet loss handling, encryption/decryption, connection lifecycle
  • Contract execution — WASM sandbox issues, state verification failures
  • Determinism violations — Code using std::time::Instant::now() instead of TimeSource, or rand::random() instead of GlobalRng
  • Silent failure / fire-and-forget — Spawned task dies with no error propagation (check: is the JoinHandle stored and polled? what happens if the task exits?), broadcast sent to zero targets with no warning, channel overflow silently dropping messages. Look for: tokio::spawn without .await/.abort(), let _ = sender.send(), missing logging on empty target sets
  • Resource exhaustion — HashMap/Vec/channel entries inserted but never removed, causing unbounded memory growth or channel backpressure. Check: is there a cleanup path for every insert? Is cleanup triggered on both success AND failure/timeout? Run sustained operations and assert collection sizes stay bounded
  • Incomplete wiring — Feature only works for some operation types (e.g., router feedback wired for GET but not subscribe/put/update). When debugging "X doesn't work for operation Y," check all enum variants in the dispatch path — commented-out arms, _ => Irrelevant catch-alls, and missing match arms are common
  • TTL/timing race conditions — Two time-dependent operations where the first can expire before the second completes (e.g., transient TTL expires before CONNECT handshake, interest TTL expires before subscription renewal, broadcast fires before subscriptions complete). Check: what happens if operation A takes longer than timeout B?
  • Regressions from "safe" changes — A seemingly harmless change (code simplification, removing a feature flag, changing defaults) breaks an invariant that nothing tests. When a recent commit looks innocent, check what implicit behaviors it removed
  • Mock/test divergence — Bug can't be reproduced in tests because the mock runtime behaves differently from production. Check: does the mock skip side effects (e.g., BSC emission)? Does the test use a different code path than production (e.g., explicit subscribe vs background subscribe)? Does the mock socket behave differently from real UDP?

See Module-Specific Debugging Guide for detailed bug patterns, data collection strategies, and test approaches per module.

Phase 3: Investigate Systematically

For each hypothesis:

  1. Identify what evidence would confirm or refute it
  2. Gather that evidence (logs, code reading, adding debug output)
  3. Update hypothesis ranking based on findings
  4. Move to next hypothesis if current one is eliminated

Freenet-specific data gathering:

What You NeedHow to Get ItAccess
Event sequencesRUST_LOG=info + --nocapture on simulation testsEveryone
Network message patternssim.get_network_stats() in simulation testsEveryone
Convergence behaviorsim.await_convergence(timeout, poll, min_contracts)Everyone
Virtual time statesim.virtual_time().now_nanos()Everyone
Git history of affected codegit log --oneline -20 -- path/to/file.rsEveryone
Fault injection resultsSimNetwork + FaultConfig, then inspect statsEveryone
Gateway logsAccess to running gateway nodeLimited — not all contributors
Aggregate telemetrytelemetry-monitor skill (if available) or production dashboardsLimited — core team only
Real network packet capturesPhysical access to test machinesLimited — specific environments

Note on telemetry: If a telemetry-monitor skill is available in the project, use it to query network telemetry for constraining the problem (see Phase 1b). But remember: telemetry constrains, simulation reproduces. Don't spend cycles iterating on telemetry queries when you have enough information to write a simulation test.

For module-specific data gathering techniques, see Module-Specific Debugging Guide — it covers observation APIs, #[freenet_test] event capture, RUST_LOG targets, and fault injection per module.

Parallel investigation with subagents:

Use general-purpose agents with codebase-investigator instructions for independent, readonly investigations. Spawn multiple in parallel, each with a specific focus.

Spawn investigators in parallel using Task tool (subagent_type="general-purpose"):

1. "You are a codebase-investigator. [Include agents/codebase-investigator.md instructions]
    Search for similar error handling patterns in the codebase related to [bug description]"

2. "You are a codebase-investigator. [Include agents/codebase-investigator.md instructions]
    Check git history for recent changes to [affected module/files]"

3. "You are a codebase-investigator. [Include agents/codebase-investigator.md instructions]
    Read and analyze [test file] and related fixtures for [component]"

Guidelines:

  • Each investigator focuses on one hypothesis or evidence type
  • Only parallelize readonly tasks — code changes must be sequential
  • Investigators report findings; you synthesize and decide next steps

Phase 4: Fix and Verify

  1. Fix the root cause — Not symptoms
  2. Verify with deterministic reproduction — Re-run the failing test with the same seed
  3. Check for regressionscargo test -p freenet
  4. Consider edge cases — Does the fix handle similar scenarios?
  5. Verify determinism — If you added new code, ensure it uses TimeSource and GlobalRng (not std::time / rand directly)

Phase 5: Test Coverage Analysis

Always ask: "Why didn't CI catch this?"

Freenet has multiple test layers:

LayerScopeWhat It Catches
Unit tests (~1000)Individual functionsLogic errors, algorithm bugs
Integration tests (~80)Component interactionsInterface mismatches, data flow bugs
Simulation testsMulti-node deterministicState machine bugs, race conditions, protocol errors
fdev single-processQuick multi-peerBasic distributed behavior
freenet-test-network20+ peers in DockerScale-dependent bugs, realistic network behavior
Real network testsPhysical machinesNAT traversal, real latency, UDP behavior

If a bug reached production or manual testing, there's a gap. Investigate:

  1. Which test layer should have caught this?

- Logic error → unit test - Component interaction bug → integration test - Distributed/state machine behavior → simulation test with #[freenet_test] - Fault tolerance → SimNetwork with FaultConfig - Scale-dependent → freenet-test-network

  1. Why didn't the existing tests catch it?

- Tests use different topology/configuration than production - Tests mock components that exhibit the bug in real usage - Simulation doesn't inject the right fault conditions - Test assertions too weak to detect the failure - Determinism violation — code path bypasses TimeSource/GlobalRng

  1. Document the gap — Include in the issue/PR:

- What test would have caught this - Why existing tests didn't - Whether a new test should be added to prevent regression

Anti-Patterns to Avoid

Jumping to conclusions

  • Wrong: See error, immediately change code that seems related
  • Right: Form hypothesis, gather evidence, then act

Tunnel vision

  • Wrong: Spend hours on one theory despite contradicting evidence
  • Right: Set time bounds, pivot when evidence points elsewhere

Weakening tests

  • Wrong: Test fails, reduce assertions or add exceptions to make it pass
  • Right: Understand why the test expects what it does, fix the code to meet that expectation
  • Exception: The test itself has a bug or tests incorrect behavior (rare, requires clear justification)

Sequential investigation when parallel is possible

  • Wrong: Read file A, wait, read file B, wait, read file C
  • Right: Spawn codebase-investigator agents to read A, B, C concurrently, synthesize findings

Fixing without understanding

  • Wrong: Copy a fix from Stack Overflow that makes the error go away
  • Right: Understand why the fix works and whether it addresses root cause

Skipping the scope ladder

  • Wrong: Jump straight to real network debugging when the bug could be reproduced in a unit test
  • Right: Start small — unit test, then simulation, then real network

Breaking determinism

  • Wrong: Use std::time::Instant::now() or rand::random() in core logic
  • Right: Use TimeSource trait and GlobalRng so simulation tests remain reproducible

Assuming data access

  • Wrong: "Check the gateway logs to see what happened" (not everyone has gateway access)
  • Right: Design reproduction steps using simulation tests and RUST_LOG that any contributor can run

Checklist Before Declaring "Fixed"

  • Root cause identified and understood
  • Fix addresses root cause, not symptoms
  • Original failure no longer reproduces
  • No new test failures introduced
  • Test added if one didn't exist (when practical)
  • No test assertions weakened or disabled
  • Answered "why didn't CI catch this?" and documented the test gap

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

38.98%
按下载量换算60

Claude

29.41%
按下载量换算45

Cursor

18.18%
按下载量换算28

Gemini CLI

9.92%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/freenet/freenet-agent-skills --skill systematic-debugging 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

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

来源信息

继续浏览同类 Skills