agentleFS
tellmefrankietellmefrankie/ai-investment-skills/debug-trail/SKILL.md

debug-trail

Skill14 starsChanged 6 months agoMITView on GitHub

Automatically document your debugging session as you go. When the bug is fixed, you have a complete trail: what you tried, what you learned, what solved it. You spend 3 hours debugging. You find the fix. Your manager asks you to write it up. You stare at the blank Confluence page and try to remember what you tried 2 hours ago. Or worse: the same bug comes back in 3 months and you have to debug it again from scratch.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No API keys needed

    line 114

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Debug Trail

Automatically document your debugging session as you go. When the bug is fixed, you have a complete trail: what you tried, what you learned, what solved it.

The problem

You spend 3 hours debugging. You find the fix. Your manager asks you to write it up. You stare at the blank Confluence page and try to remember what you tried 2 hours ago.

Or worse: the same bug comes back in 3 months and you have to debug it again from scratch.

What it does

At the start of a debugging session, activate this skill. As you work, it tracks:

  • Each hypothesis you formed and tested
  • Commands run and their output
  • Files examined and what you found
  • Dead ends (just as important as the solution)
  • The actual root cause and fix

At the end: structured bug report, ready to paste anywhere.

Usage

Start of session:

Start debug trail for: TypeScript type error in options/analyzer.ts line 247
Error: Type 'string' is not assignable to type '"rising" | "falling" | "stable"'

During session — the skill tracks your work automatically as you run commands and read files.

End of session:

Close debug trail. Write up the full report.

Example Report Output

# Debug Trail — TS2322 lottery_trend Type Error
Date: 2026-05-13 | Duration: 23 minutes | Status: RESOLVED

## The Bug
File: src/options/weekly-anomaly-report.ts:24
Error: Type 'string' is not assignable to type '"rising" | "falling" | "stable"'

## Root Cause
TypeScript's type narrowing failed on the ternary expression:
  const trend = last - first > 20 ? 'rising' : last - first < -20 ? 'falling' : 'stable'

TypeScript inferred `trend` as `string` (widened from string literals).
The TickerWeekly interface expected the literal union type.

## What I Tried

[DEAD END] Tried casting: `trend as 'rising' | 'falling' | 'stable'`
  → Works but is unsafe — type assertion, not type inference

[DEAD END] Tried `as const` on the ternary
  → Syntax error — as const only works on object/array literals

[SOLUTION] Explicit type annotation on the variable:
  const trend: 'rising' | 'falling' | 'stable' = ...
  → TypeScript now validates the ternary against the declared type

## Files Changed
- src/options/weekly-anomaly-report.ts:24 — added explicit type annotation

## Lesson Learned
When TypeScript widens string literal ternaries to `string`, add explicit
type annotation rather than casting. The annotation lets TS validate, the
cast just suppresses the error.

## Commands Run
- npx tsc --noEmit  (initial discovery)
- npx tsc --noEmit  (verification after fix)

Why dead ends matter

Most bug reports only document the solution. That is only half the value.

The dead ends are what prevent the next person from trying the same wrong approaches. A 3-hour debug session with 2 hours of dead ends is more valuable to document than just the 1 hour that worked.

Formats

markdown (default): Full structured report, paste into any doc tool

jira: Structured for Jira bug ticket description

slack: Compressed summary for #dev-incidents channel

gist: Ready to gh gist create directly

Close debug trail. Format: gist. Create it with gh CLI.

Session commands

Start debug trail: [bug description]    — begin tracking
Hypothesis: [what I think is wrong]    — log a hypothesis
Tried: [what I just did]               — log an attempt
Dead end: [why this did not work]      — log a failure
Found: [what I discovered]             — log a discovery
Close debug trail                      — generate report

Requirements

  • Bash tool access (for command tracking)
  • No API keys needed

Free

Fully free and open source.

→ https://github.com/tellmefrankie/news-engine

Author

Built after spending 4 hours on a bug, fixing it, and then having no record of what I tried. Three months later, the same bug appeared. Debugged it in 20 minutes because I had the trail from the first time.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.