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
TypeScript refactoring and modernization guidelines from a principal specialist perspective. This skill should be used when refactoring, reviewing, or modernizing TypeScript code to ensure type safety, compiler performance, and idiomatic patterns. Triggers on tasks involving TypeScript type architecture, narrowing, generics, error handling, or migration to modern TypeScript features.
tools
Resolves TypeScript and JavaScript problems across type-level programming, performance, monorepo management, migration, and modern tooling. Invoke when diagnosing "type instantiation excessively deep" errors, migrating JS to TS, configuring strict tsconfig, debugging module resolution, or choosing between Biome/ESLint/Turborepo/Nx.
tools
Turborepo monorepo build system guidance. Triggers on: `turbo.json`, task pipelines, `dependsOn`, caching, remote cache, the `turbo` CLI, `--filter`, `--affected`, CI optimization, environment variables, internal packages, monorepo structure, and package boundaries. Use when the user configures tasks or workflows, creates packages, sets up a monorepo, shares code between apps, runs changed packages, debugs cache behavior, or works in an `apps/` plus `packages/` workspace.
tools
Provides Tailwind CSS v4 performance optimization and best practices guidelines. Triggers when writing, reviewing, or refactoring Tailwind CSS v4 code; when working with Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.