Logo di Debug Methodology

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.

Panoramica

AutoreAmethystLuna
Repositoryembedded-workbench
Nome della skilldebug-methodology
Stelle
32
Fork
3
File inclusi
1
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • 1 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da AmethystLuna su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Debug Methodology in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/AmethystLuna/embedded-workbench/tree/master/skills/debug-methodology
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Debug Methodology in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Debug Methodology non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Debug Methodology non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA 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.

Perché usare Debug Methodology su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Debug Methodology è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Debug Methodology in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/AmethystLuna/embedded-workbench/tree/master/skills/debug-methodology. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Debug Methodology?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Debug Methodology?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Debug Methodology: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Debug Methodology è gratuita?

Sì. È pubblicata su GitHub da AmethystLuna con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇