Guides systematic debugging of non-trivial bugs and test failures via hypothesis formation, evidence gathering, and parallel subagent investigation.
Ships in freenet. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Invoke this methodology when a test fails and the cause isn't immediately obvious, when unexpected behavior occurs in production or development, when an error message doesn't point to the fix, or when several causes are plausible.
Form explicit hypotheses before changing code, validate or eliminate each with evidence, and use subagents for concurrent readonly exploration.
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:
| Priority | Scope | When to Use | Command |
|---|---|---|---|
| 1 | Unit test | Logic errors, algorithm bugs, single-function issues | cargo test -p freenet -- specific_test |
| 2 | Mocked unit test | Transport/ring logic needing isolation | Unit test with MockNetworkBridge / MockRing |
| 3 | Simulation test | Multi-node behavior, state machines, race conditions | cargo test -p freenet --features simulation_tests,testing --test simulation_integration |
| 4 | SimNetwork + FaultConfig | Fault tolerance, message loss, network partitions | SimNetwork with configured fault injection |
| 5 | fdev single-process | Quick multi-peer CI validation | cargo run -p fdev -- test --seed 42 single-process |
| 6 | freenet-test-network | 20+ peer large-scale behavior | Docker-based freenet-test-network |
| 7 | Real network | Issues that only manifest with real UDP/NAT/latency | Manual multi-peer test across machines |
Lower scopes are faster, deterministic and reproducible by anyone. Gateway logs, aggregate telemetry and production metrics are not available to every developer, so don't design a reproduction that depends on them.
If you're working on a GitHub issue, claim it first (see the pr-creation skill's "Claim the Issue").
# Run simulation tests
cargo test -p freenet --features simulation_tests,testing --test simulation_integration
# With logging, to observe event sequences
RUST_LOG=info cargo test -p freenet --features simulation_tests,testing --test simulation_integration -- --nocapture
# Reproduce with a specific seed
cargo run -p fdev -- test --seed 0xDEADBEEF single-process
Live-network debugging has the slowest feedback loop (add telemetry, redeploy, wait), so translate the observation into a local reproduction as fast as possible.
| Network Observation | Simulation 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 |
| "High timeout rate" | A FaultConfig loss rate tuned until the simulated rate matches |
| "Works for PUT but not GET" | Test both operations — likely incomplete wiring in dispatch path |
#[freenet_test] or SimNetwork + FaultConfig and a deterministic seed.Once you know what fails (operation type, peer pattern, timing), stop analyzing network data and reproduce locally; the simulation loop is orders of magnitude faster. If a telemetry-monitor skill is available (project-local, not part of this plugin), use it to constrain the problem, not as the primary debugging tool.
Before touching code, list the plausible causes ranked by likelihood. Freenet-specific hypothesis patterns:
std::time::Instant::now() instead of TimeSource, or rand::random() instead of GlobalRng.JoinHandle stored and polled?), a broadcast to zero targets, a channel that drops on overflow, let _ = sender.send()._ => catch-alls and commented-out arms.See Module-Specific Debugging Guide for bug patterns per module.
For each hypothesis, identify the evidence that would confirm or refute it, gather it, and update the ranking.
Evidence sources: RUST_LOG output and #[freenet_test] event capture (everyone); simulation stats (sim.get_network_stats(), sim.await_convergence(timeout, poll, min_contracts), sim.virtual_time().now_nanos()); git log --oneline -20 -- path/to/file.rs; gateway logs and aggregate telemetry (maintainers only; don't build a reproduction that depends on them). Module-specific techniques are in module-debugging.md.
Asserting on freenet-core logs from E2E tests: use structured fields, and read the log first. Tail the node log with the RUST_LOG you will use in CI and look at what is emitted around the event. Don't copy a grep pattern from an old test: a marker that no longer exists makes a negative assertion vacuously true, a false green. Prefer structured fields (phase="...", op="GET", tx=, to follow one operation across nodes). Treat log assertions as supplementary; the authoritative check is the UI assertion or a contract GET via fdev. Logs tell you how you got there, not whether you did.
When a test fails because of a conclusively traced upstream bug (for example a freenet-core relay timeout with an open issue and a recognizable log signature), quarantine the path, do not remove the test. Detect the exact upstream signature, emit a Playwright test.skip() (or equivalent) with the issue link, and keep the assertion that would have caught it. Genuine app-side regressions (contract errors, deserialization, panics, wrong state) still fail the gate. Removing or weakening the assertion loses the coverage you get for free the day upstream is fixed.
Parallel investigation: spawn freenet:codebase-investigator subagents, one per hypothesis or evidence type (similar error handling, recent history of the affected files, the test and its fixtures). They are readonly; you synthesize and decide. Make code changes sequentially, never in parallel.
cargo test -p freenet.TimeSource and GlobalRng.Always ask: "Why didn't CI catch this?" Name the test layer from the ladder that should have caught it, say why the existing tests missed it (different topology or config, mocks hiding the behavior, no fault injection, weak assertions, determinism bypass), and put the missing test in the issue or PR.
TimeSource and GlobalRng, never std::time::Instant::now() or rand::random(), in core logic (see .claude/rules/testing.md), so simulation tests stay reproducible.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
7 skills in this plugin
/dapp-builderBuild and maintain decentralized applications on Freenet using river as a template. Guides through designing contracts (shared state), delegates (private state), and UI, and through upgrading a live dApp safely. Use when user wants to create a new Freenet dApp, design contract state, implement delegates, build a Freenet-connected UI, OR upgrade an existing dApp — bump freenet-stdlib, ship a new contract/delegate version (v2), fix a bug that re-keys the WASM, or migrate state across a contract/delegate key change without breaking invites or losing data. Also use when INTEGRATING with a contract or delegate published by another app — reading another project's contract state, depending on a platform delegate, or deciding how to address someone else's artifact so it survives their re-keys./linux-testRun integration tests that require Linux (full loopback range 127.x.x.x) via Docker. Use when a test fails on macOS with "Can't assign requested address" or when the user says "/linux-test"./local-devSet up and manage local Freenet development environments and interact with a running node. Use when the user wants to test contract changes locally, debug UI issues, run a local node, query connections/diagnostics, inspect the dashboard, use the WebSocket API, or iterate on a Freenet application without deploying to the live network./pr-creationGuidelines for creating high-quality Freenet pull requests. This skill should be used when creating PRs for freenet-core, freenet-stdlib, or related repositories. Emphasizes quality over speed, thorough testing, and proper review process./pr-reviewExecutes a risk-tiered, multi-perspective PR review — triages the change, runs specialist subagents in parallel (code-first, testing, skeptical, big-picture) plus an external model pass, then posts a consolidated review to the PR./releaseOrchestrate a new freenet-core release. Runs the MANDATORY pre-cut gates (no concurrent cut, auto-update updater diff + canary suites, a 30-minute real-NAT soak of the exact ship SHA, a telemetry baseline), then determines the version, confirms with the user, triggers the release pipeline via GitHub Actions, and monitors telemetry through the 0-4h auto-update stagger. Use when the user says "do a release", "new release", "cut a release", "release", or "/release"./freenet:systematic-debuggingfrom freenet
npx claudepluginhub freenet/freenet-agent-skills --plugin freenetOther plugins' skills for the same job