Ai error analysis and eval design

From samarv/Shanon · View interactive version

Ai error analysis and eval design is an AI agent skill from the GitHub repository samarv/Shanon. A systematic workflow to move AI products beyond "vibe checks" by identifying specific failure modes and building automated LLM judges. Use this when your AI outputs feel "janky," when you need a feedback signal for prompt engineering, or when monitoring production performance at scale.

How to use this skill

Skill file

To build great AI products, you must transition from subjective "vibe checks" to systematic measurement. This process identifies exactly where an LLM is failing and creates a feedback loop for continuous improvement.

Phase 1: Open Coding (The "Benevolent Dictator" Phase)

Before automating, you must manually ground yourself in the data. Appoint one "Benevolent Dictator"—typically the Product Manager or domain expert—to define "good" taste.

  1. Sample the Data: Extract 50–100 "traces" (logs of full LLM interactions) from your observability tool (e.g., Braintrust, LangSmith, Phoenix).
  2. Note the Upstream Error: Read each trace. If something is wrong, write a brief, informal note (an "Open Code") describing the first thing that went wrong.
  1. Stop at Saturation: Continue until you stop learning new ways the system fails (Theoretical Saturation).

Phase 2: Axial Coding (Categorization)

Synthesize your mess of notes into actionable categories using an LLM.

  1. Export Notes: Put your open codes into a CSV or spreadsheet.
  2. Synthesize Failure Modes: Use an LLM (Claude or ChatGPT) to group your notes into 5–7 "Axial Codes" (failure categories).
  1. Map Back: Use a spreadsheet formula or LLM to categorize every trace into one of these buckets.
  2. Prioritize: Create a pivot table to count the frequency of each category. Focus your engineering efforts on the highest-frequency or highest-risk buckets.

Phase 3: Build the "LLM as Judge"

For complex, subjective failures (like "human handoff quality"), create an automated evaluator.

  1. Write the Judge Prompt: Create a separate prompt for an LLM whose only job is to evaluate one specific failure mode.
  2. Enforce Binary Scoring: Require the judge to output only True or False.
  1. Define Rules: Include specific criteria from your "Benevolent Dictator" notes.

Phase 4: Alignment & Validation

Never ship an eval until you know the judge matches human judgment.

  1. Create an Agreement Matrix: Compare the Judge's True/False labels against your manual labels from Phase 1.
  2. Review Mismatches: Specifically look at:
  1. Iterate: Refine the Judge's prompt until it aligns with the "Benevolent Dictator" at least 80–90% of the time.

Examples

Example 1: Real Estate AI Assistant

Example 2: Customer Support Handoff

Common Pitfalls

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.