skills/agent-architecture-audit/SKILL.md
Audit LLM and agent applications for wrapper regressions, prompt or memory contamination, tool discipline failures, hidden repair loops, and output rendering corruption. Use before shipping agent features or when an agent works in a direct model call but fails inside the product.
npx skillsauth add shipshitdev/library agent-architecture-auditInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Diagnose failures in agent systems by inspecting each layer between the raw model call and the user-visible output.
Inputs:
Outputs:
Creates/Modifies:
External Side Effects:
Confirmation Required:
Delegates To:
debug for ordinary software defectsevaluation or advanced-evaluation for benchmark designsecurity-audit for prompt injection, secrets, auth, or privileged tool riskDo not use for general code review — only when the failure is likely in the agent stack.
Audit the stack from source instructions to delivered output:
| Layer | What Can Fail | | --- | --- | | System prompt | Conflicts, bloat, stale rules, unclear priorities | | Session history | Old turns dominate or contradict the current task | | Long-term memory | Cross-project leakage, stale preferences, agent-written facts | | Distillation | Compaction turns guesses into pseudo-facts | | Active recall | Redundant summaries waste context or revive old context | | Tool selection | Required tools are optional in code, not enforced | | Tool execution | Missing calls, failed calls, unvalidated arguments | | Tool interpretation | Output is ignored, overtrusted, or read backward | | Answer shaping | Format, schema, markdown, or JSON is changed after reasoning | | Transport/rendering | Streaming, API, CLI, or UI mutates valid content | | Hidden repair loops | A second model pass silently rewrites the answer | | Persistence | Cached artifacts or expired state are reused as live evidence |
Identify:
Search for:
Prefer file and line evidence. Compare raw model output, post-processed output, transported output, and rendered output when logs are available.
For each suspected issue, record:
Prefer fixes in this order:
Do not solve tool discipline, memory safety, or transport corruption only by adding stronger prompt wording.
| Severity | Meaning | | --- | --- | | Critical | The system can confidently perform wrong or unsafe operational behavior | | High | Correctness or stability degrades frequently under normal use | | Medium | The agent usually works, but the stack is fragile, wasteful, or hard to debug | | Low | Maintainability, observability, or cosmetic output issues |
Lead with findings:
## Findings
| Severity | Layer | Finding | Evidence | Fix |
| --- | --- | --- | --- | --- |
| High | Tool selection | Required retrieval is prompt-only and can be skipped | `src/agent/router.ts:42` | Gate final answer on retrieval result |
## Diagnosis
[Explain which layer corrupts the behavior and why.]
## Fix Plan
1. [Code-first fix]
2. [Validation]
3. [Follow-up hardening]
If no issues are found, say so and list the evidence checked plus remaining blind spots.
development
Coordinates a weekly engineering review of board accuracy, recent code changes, operational health, and scoped cleanup. Use for a recurring repository health review or a review of the last several days.
testing
Audits project board configuration and prepares explicitly requested setup, copy, or normalization changes while preserving the existing workflow and provider boundaries. Use when inspecting a board's fields, columns, scope, or configuration.
testing
Reconciles a project board with current work and delivery evidence, reports incomplete coverage and metadata gaps, and applies only approved provider-supported field changes. Use when auditing board drift, reviewing blocked work, or assessing upcoming delivery.
development
Walk through how a subsystem works. Use for "how does X work", code walkthroughs before changing something, and placement or ownership questions. Explains architecture, runtime flow, and onboarding mental models. Can critique architecture. Use why for motivation.