lfe-diagnose

lfe-diagnose is a skill for Claude Code, Codex from StChiotis/Library-First-Engineering. It costs 42 tokens per session (774 once invoked), scanned A, original, MIT.

A bug-diagnosis workflow that reproduces a failing behavior, forms a hypothesis, applies a minimal fix, and sends the result back for verification.

In plain words
What is it for?
Use it when an inspection finds a failure that needs a reproducible test or script, a targeted fix, and another verification pass.
Why use it?
It keeps debugging focused on the first failed inspection and avoids unrelated refactoring.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when an inspection finds a failure that needs a reproducible test or script, a targeted fix, and another verification pass.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/stchiotis/library-first-engineering/lfe-diagnose
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add StChiotis/Library-First-Engineering --skill lfe-diagnose
Clone the repo
git clone --depth 1 https://github.com/StChiotis/Library-First-Engineering

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lfe-diagnose

README.md
[![agentmods](https://agentmods.dev/badge/skills/stchiotis/library-first-engineering/lfe-diagnose/github.svg)](https://agentmods.dev/skills/stchiotis/library-first-engineering/lfe-diagnose)
Your own site
<a href="https://agentmods.dev/skills/stchiotis/library-first-engineering/lfe-diagnose"><img src="https://agentmods.dev/badge/skills/stchiotis/library-first-engineering/lfe-diagnose/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lfe-diagnose

Your own site · 80×15
<a href="https://agentmods.dev/skills/stchiotis/library-first-engineering/lfe-diagnose"><img src="https://agentmods.dev/badge/skills/stchiotis/library-first-engineering/lfe-diagnose.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 774 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.00774
Opus 5.5 $0.00017 $0.00310
Sonnet 5.5 $0.00008 $0.00155
Haiku 4.5 $0.00004 $0.00077

Measured 3mo ago against content hash f1b01bb2a1b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

lfe-diagnose scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/lfe-diagnose/SKILL.md · 67 lines

How it starts

The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LFE Diagnose

Position in Pipeline

  • Phase: 3 (Inspector sub-pipeline, Step 3 — conditional)
  • Persona: Inspector (triggers), Builder (fixes)
  • Trigger: Called by Inspector when /lfe-inspector verification fails
  • Input: Failing behavior identified during inspection
  • Output: Fix applied → returns to Builder sub-pipeline for re-verification

Hard Rules

  1. First-failure only: Diagnose may only run on the first failed inspection of a slice. The Inspector's Cycle Guard (lfe-inspector/SKILL.md Cycle Guard step) is responsible for blocking re-entry on the second failure. If you discover that .plans/inspection_report.md already records a status: failed for the same slice:, halt immediately, leave the existing report as-is, and bounce back to Inspector for Brain triage (see LOOP_ARCHITECTURE.md Scenario 2.2). This is a defensive belt-and-braces check; the Cycle Guard should have prevented this entry.
  2. Minimal fix only: Solve the diagnosed problem, nothing more. No opportunistic refactors.

Process

  1. Feedback Loop: Build a deterministic repro (test/script) that reliably demonstrates the failure.
  2. Reproduce: Run the loop and witness the failure. Confirm it matches the Inspector's reported issue.
  3. Hypothesise: Generate 3-5 ranked, falsifiable hypotheses for the root cause.
  4. Instrument: Add targeted probes to test hypotheses one at a time. Eliminate hypotheses until the root cause is confirmed.
  5. Fix: Write a regression test that captures the bug → Apply the minimal fix → Watch the test pass.
  6. Persist Diagnosis: Write .plans/diagnosis_report.md so the why of the fix survives a session crash. Schema below.
  7. Handoff: Return to Builder sub-pipeline. The Builder runs the full test suite, then the Inspector re-verifies.

Coordination File Output

Per the contract in COORDINATION_FILES.md:

---
phase: inspector
step: diagnose
status: complete
timestamp: <ISO-8601>
source: .plans/tdd_report.md
slice: <copied from active_plan.md — used by /lfe-builder to detect a stale report>
---

Read the full file on GitHub · 67 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 67 lines · 42 tokens per session scan A f1b01bb2a1b6

Subscribe to this mod's changes

lfe-diagnose is a skill published in the GitHub repository StChiotis/Library-First-Engineering (44 stars, last pushed 4mo ago), licensed MIT. It adds 42 tokens to every session and 774 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

lfe-diagnose compared with skills from other repositories

lfe-diagnose next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
lfe-diagnoseStChiotis/Library-First-EngineeringSkill444mo agoMITA42Claude Code, Codex
credit-note-fixeropenai/openai-agents-pythonSkill31kyesterdayMITA21Claude Code, Codex
code-reviewpromptfoo/promptfooSkill28kyesterdayMITA11Claude Code
reverse-engineer-anythingroedyrustam/vibes-plugSkill132todayMITA40Cursor
bug-reproducerAnastasiyaW/codex-claude-code-configSkill2182d agoMITA147Claude Code, Codex
root-cause-deliveryAnastasiyaW/codex-claude-code-configSkill2182d agoMITA94Claude Code
error-resilience-expertroedyrustam/vibes-plugSkill132todayMITA34Cursor