Debug Methodology logo

Debug Methodology

Community
AmethystLuna
debug-methodology

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.

Overview

PublisherAmethystLuna
Repositoryembedded-workbench
Skill namedebug-methodology
Stars
32
Forks
3
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by AmethystLuna on GitHub. Read the source before you install it.

Installation

Install the Debug Methodology AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/AmethystLuna/embedded-workbench/tree/master/skills/debug-methodology
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AmethystLuna/embedded-workbench.git /tmp/embedded-workbench
mkdir -p .claude/skills
cp -r /tmp/embedded-workbench/skills/debug-methodology .claude/skills/debug-methodology
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Debug Methodology in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Debug Methodology on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Debug Methodology is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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 thinkReality
"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.

  2. 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.

  3. 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 sensor_timer_cb(TimerHandle_t xTimer) {
        g_sensor.cache = sensor_read_raw();  // Timer owns refresh timing
    }
    float get_temperature(void) {
        return g_sensor.cache.temperature;    // Stale if timer hasn't fired yet
    }
    
    // GOOD: pull mode — consumer triggers refresh when source is ready
    float get_temperature(void) {
        if (sensor_is_ready()) {
            sensor_sync_cache(&g_sensor);     // Refresh on read
        }
        return g_sensor.cache.temperature;    // As fresh as hardware allows
    }
  4. 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.

  5. 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.

  6. Progressive narrowing: Each investigation round shrinks scope — phenomenon → mechanism → specific state → root cause. Don't try to solve everything at once.

  7. 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?

  8. 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:

ReferenceTopicLoad When
iterative-debug-case-study.md7-round progressive isolation methodologyStuck after multiple fix attempts; need a structured debugging approach

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Debug Methodology AI skill do?

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.

Why use Debug Methodology on TypingMind?

Because you install it once and use it with any model. Debug Methodology is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Debug Methodology in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/AmethystLuna/embedded-workbench/tree/master/skills/debug-methodology. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Debug Methodology?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Debug Methodology?

As many as you like. As long as a model supports skills, you can use Debug Methodology with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Debug Methodology AI skill free?

Yes. It is published on GitHub by AmethystLuna under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇