Skip to content
Skillpedia
Agents280k · #2

agent-architecture-audit

Makes your agent check if everything is working correctly. It finds and fixes problems in AI systems, ensuring they perform as expected.

What it does

This tool helps find and fix problems in AI systems that seem to be malfunctioning. It investigates the different parts of the system to identify where the error is occurring.

When to use it

  • ✓When an AI feature starts failing after updates.
  • ✓When the AI gives wrong or inconsistent answers.
  • ✓When you suspect something internal is breaking the response before it reaches the user.

Example of what to ask your AI

“Audit my AI agent, it's responding strangely after I added new tools.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/affaan-m/ECC/blob/main/pi/core/skills/agent-architecture-audit/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/affaan-m/ECC/blob/main/pi/core/skills/agent-architecture-audit/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

It analyzes the AI system across multiple layers, from initial instructions to how the response is displayed. It looks for issues like old information being used, tools being called incorrectly, or the response being altered along the way.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add affaan-m/ECC --skill agent-architecture-audit

Or download just the file:

curl -L https://raw.githubusercontent.com/affaan-m/ECC/main/pi/core/skills/agent-architecture-audit/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Agent Architecture Audit

A diagnostic workflow for agent systems that hide failures behind wrapper layers, stale memory, retry loops, or transport/rendering mutations.

When to Activate

MANDATORY for:

  • Releasing any agent or LLM-powered application to production
  • Shipping features with tool calling, memory, or multi-step workflows
  • Agent behavior degrades after adding wrapper layers
  • User reports "the agent is getting worse" or "tools are flaky"
  • Same model works in playground but breaks inside your wrapper
  • Debugging agent behavior for more than 15 minutes without finding root cause

Especially critical when:

  • You've added new prompt layers, tool definitions, or memory systems
  • Different agents in your system behave inconsistently
  • The model was fine yesterday but is hallucinating today
  • You suspect hidden repair/retry loops silently mutating responses

Do not use for:

  • General code debugging — use agent-introspection-debugging
  • Code review — use language-specific reviewer agents
  • Security scanning — use security-review or security-review/scan
  • Agent performance benchmarking — use agent-eval
  • Writing new features — use the appropriate workflow skill

The 12-Layer Stack

Every agent system has these layers. Any of them can corrupt the answer:

# Layer What Goes Wrong
1 System prompt Conflicting instructions, instruction bloat
2 Session history Stale context injection from previous turns
3 Long-term memory Pollution across sessions, old topics in new conversations
4 Distillation Compressed artifacts re-entering as pseudo-facts
5 Active recall Redundant re-summary layers wasting context
6 Tool selection Wrong tool routing, model skips required tools
7 Tool execution Hallucinated execution — claims to call but doesn't
8 Tool interpretation Misread or ignored tool output
9 Answer shaping Format corruption in final response
10 Platform rendering Transport-layer mutation (UI, API, CLI mutates valid answers)
11 Hidden repair loops Silent fallback/retry agents running second LLM pass
12 Persistence Expired state or cached artifacts reused as live evidence

Common Failure Patterns

1. Wrapper Regression

The base model produces correct answers, but the wrapper layers make it worse.

Symptoms:

  • Model works fine in playground or direct API call, breaks in your agent
  • Added a new prompt layer, existing behavior degraded
  • Agent sounds confident but is confidently wrong
  • "It was working before the last update"

2. Memory Contamination

Old topics leak into new conversations through history, memory retrieval, or distillation.

Symptoms:

  • Agent brings up unrelated past topics
  • User corrections don't stick (old memory overwrites new)
  • Same-session artifacts re-enter as pseudo-facts
  • Memory grows without bound, degrading response quality over time

3. Tool Discipline Failure

Tools are declared in the prompt but not enforced in code. The model skips them or hallucinates execution.

Symptoms:

  • "Must use tool X" in prompt, but model answers without calling it
  • Tool results look correct but were never actually executed
  • Different tools fight over the same responsibility
  • Model uses tool when it shouldn't, or skips it when it must

4. Rendering/Transport Corruption

The agent's internal answer is correct, but the platform layer mutates it during delivery.

Symptoms:

  • Logs show correct answer, user sees broken output
  • Markdown rendering, JSON parsing, or streaming fragments corrupt valid responses
  • Hidden fallback agent quietly replaces the answer before delivery
  • Output differs between terminal and UI

5. Hidden Agent Layers

Silent repair, retry, summarization, or recall agents run without explicit contracts.

Symptoms:

  • Output changes between internal generation and user delivery
  • "Auto-fix" loops run a second LLM pass the user doesn't know about
  • Multiple agents modify the same output without coordination
  • Answers get "smoothed" or "corrected" by invisible layers

Audit Workflow

Phase 1: Scope

Define what you're auditing:

  • Target system — what agent application?
  • Entrypoints — how do users interact with it?
  • Model stack — which LLM(s) and providers?
  • Symptoms — what does the user report?
  • Time window — when did it start?

…

FAQ

What are 'layers' in an AI system?

Think of layers as different steps in processing a question by the AI. Each step (like understanding the question, using a tool, remembering past conversations) can have a problem.

Why might an AI 'get worse' over time?

This can happen if new parts of the system (like more instructions or memory) interfere with older ones, or if the AI starts using outdated information.

What does 'tool discipline failure' mean?

It means the AI isn't following the rules about when and how to use the tools it was given. It might ignore a necessary tool or use the wrong one.

Details

Original description by the author

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehave

repo: affaan-m/ECC

Popularity

GitHub stars
280k
Ranking position
#2
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills