AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Debug Methodology

skill-amethystluna-embedded-workbench-debug-methodology · by AmethystLuna

Use when debugging embedded firmware issues — analyzing crash logs, investigating state machine lockups, tracing sensor/signal anomalies, or performing structured root-cause analysis after a crash has been located. For fault-register and stack-frame triage, load hardfault-triage first.

No reviews yet
0 installs
18 views
0.0% view→install

Install

$ agentstack add skill-amethystluna-embedded-workbench-debug-methodology

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-amethystluna-embedded-workbench-debug-methodology)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
26d ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Debug Methodology? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Debug Methodology

Debug by tracing values, not symptoms. These patterns come from real debugging sessions where surface-level fixes failed and root-cause analysis succeeded.

REQUIRED BACKGROUND: If the issue involves state machines or protocol timeouts, load Skill("state-machine-design") first. If the issue involves FreeRTOS tasks, ISRs, or NVM storage, load Skill("embedded-firmware-dev") first. Understand the domain rules before applying debugging methodology.

Red Flags

| You think | Reality | |-----------|---------| | "I know where the bug is, let me fix it" | You know the symptom location. The root cause is often 3 layers away in a different module. | | "One more round of trial fixes and I'll get it" | After 2 failed attempts, you need methodology, not persistence. | | "I'll just add a bounds check and call it done" | You're masking a symptom. The real fix is at the data source, not at every consumer. | | "The logs look normal, it must be a hardware glitch" | If you haven't correlated timestamps to code branches, you haven't actually read the logs. |

Iron Rules

  1. Log first, not code first: Correlate serial log timestamps to code branches before touching code. One log line at a known timestamp is worth more than reading five source files.
  1. Call-point census: When a value isn't updating, find all call sites of the update function. A single call site (e.g., sensor_update() only at main_loop.c:47) immediately explains why refresh is delayed or gated by irrelevant conditions.

``text grep -rn "sensor_update" --include="*.c" src/main_loop.c:128: sensor_update(&g_pressure); ``

Only two call sites. If main_loop.c is gated on wifi_connected, the sensor won't refresh until WiFi connects — that's the root cause.

  1. Cache freshness ≠ source data readiness: In embedded systems, "sensor has data" and "derived cache is refreshed" are concurrent events. Prefer pull mode (sync cache on read when source is ready). Avoid pure push mode (periodic background updaters may not fire before the first consumer reads).

```c // BAD: push mode — timer callback pushes data before consumer asks for it static void sensortimercb(TimerHandlet xTimer) { gsensor.cache = sensorreadraw(); // Timer owns refresh timing } float gettemperature(void) { return gsensor.cache.temperature; // Stale if timer hasn't fired yet }

// GOOD: pull mode — consumer triggers refresh when source is ready float gettemperature(void) { if (sensorisready()) { sensorsynccache(&gsensor); // Refresh on read } return g_sensor.cache.temperature; // As fresh as hardware allows } ```

  1. Multi-path convergence: When multiple independent code paths show the same error, find the shared state or cache they all read. Fix once at the update point — smaller fix, and future callers can't bypass it.
  1. Ownership boundary mapping: Before changing behavior, identify which module owns the truth, which derives policy, and which only consumes. Don't let the GUI control backlight policy. Don't let the backlight module control DND state.
  1. Progressive narrowing: Each investigation round shrinks scope — phenomenon → mechanism → specific state → root cause. Don't try to solve everything at once.
  1. Minimal root-cause fix: The fix is usually 1-2 lines at the data source. If you're changing 5+ call sites, stop and ask: what single state change would make all of them correct without modification?
  1. Library source is truth: After 2-3 rounds of custom implementation failure, stop iterating. Read the library source code (e.g., LVGL's lv_line.c, lv_chart.c) to understand the native mechanism. Adopt and adapt. Verified patterns beat custom math.

Fix Principles

  • Draw the failure signature, event timeline, and state transition chain before changing code.
  • For defects near state transitions: trace the exact state consumed by that output. Stale behavior often hides in derived state, not the primary truth.
  • Fix state models, don't mask symptoms: don't paper over problems with bigger limits, buffers, or retries.
  • Prefer correcting underlying logic over adding special-case branches. Only special-handle when no cleaner alternative exists.
  • If a bug is triggered by entering/leaving/recovering from a state, verify every entry path that reaches the relevant helper, not just the reproduced path.
  • After each fix, verify the normal path, failure path, and recovery path.

Exploration

For broad codebase searches (finding all callers of a function, locating cross-module patterns), use Agent(subagent_type: "Explore") instead of chaining Grep/Glob calls.

Deep Reference

This skill's references/ directory contains:

| Reference | Topic | Load When | |-----------|-------|-----------| | iterative-debug-case-study.md | 7-round progressive isolation methodology | Stuck after multiple fix attempts; need a structured debugging approach |

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.