agentleFS
kuker24kuker24/OpenCodeBestFriend/skills/agent-architecture-audit/SKILL.md

agent-architecture-audit

Skill0 starsChanged 2 months agoMITView on GitHub

Audit agent system architectures, LLM pipelines, prompt wrapper layers, tool loop boundaries, and context propagation. Use when an agent application exhibits regressions, tool calling failures, context pollution, or infinite repair loops. Not for code-level defensive security or secrets auditing (full-audit-keamanan), web UI (impeccable), or ordinary application bugs (diagnosing-bugs).

14 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use security-review.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    security-review

    Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify that streaming chunks do not truncate tool argument JSON.

    line 31
  2. Distinctive:

    Ensure explicit compaction points and sliding context windows with clear eviction policies.

    line 35
  3. Distinctive:

    Verify tool parameter schema conformance, strict types, and robust JSON decoding.

    line 38
  4. Distinctive:

    Ensure fail-closed terminal states so runaway retries abort cleanly before token exhaustion.

    line 43
  5. Distinctive:

    Verify that tool execution failures return structured, actionable feedback to the model rather than generic exception strings.

    line 46

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agent Architecture Audit

Diagnostic specialist for LLM application architectures, autonomous agent loops, prompt orchestration wrappers, and tool execution boundaries.

This skill isolates failures in compound AI systems where errors are obscured behind multi-tier wrappers, bloated context windows, recursive retry loops, or degraded tool dispatching.

Boundaries & Handoffs

NeedRoute
Defensive security, secrets scanning, prompt injection attack defense, authfull-audit-keamanan
Reproducing ordinary application code defects with red-green testsdiagnosing-bugs
Measuring agent accuracy, pass@k, and prompt benchmark regressionseval-harness
Designing cost-optimized model tiering, token budgets, and prompt cachingcost-aware-llm-pipeline
Authoring or editing SKILL.md, AGENTS.md, or agent configuration fileswriting-for-agents
Systematic architectural diagnosis of agent pipelines and failure modesagent-architecture-audit

Audit Dimensions

Review references/layers.md for detailed checklists across the primary diagnostic planes:

  1. Wrapper & Transport Layer:
    • Detect proxy regressions, middleware mutations of tool payloads, and loss of raw error signals.
    • Verify that streaming chunks do not truncate tool argument JSON.
  2. Context & Token Discipline:
    • Detect runaway conversation history, repeated duplicate system prompts, and memory leaks across turns.
    • Ensure explicit compaction points and sliding context windows with clear eviction policies.
  3. Tool Dispatch & Boundary Discipline:
    • Verify tool parameter schema conformance, strict types, and robust JSON decoding.
    • Detect tool hallucination, redundant repetitive tool invocations, and missing validation gates.
  4. State Machine & Loop Termination:
    • Guard every recursive or autonomous repair loop with hard iteration ceilings.
    • Ensure fail-closed terminal states so runaway retries abort cleanly before token exhaustion.
  5. Error Propagation & Recovery:
    • Verify that tool execution failures return structured, actionable feedback to the model rather than generic exception strings.
    • Distinguish transient infrastructure faults from model reasoning deadlocks.

Diagnostic Output Format

Produce findings structured by severity:

### [CRITICAL | HIGH | MEDIUM | LOW] Layer: <Layer Name>
- **Symptom:** Observed failure or degradation pattern.
- **Root Cause:** Architectural seam or mechanism producing the failure.
- **Evidence:** Concrete log trace, payload snippet, or code location.
- **Remediation:** Code-first architectural fix (e.g. adding hard loop guards, pruning context, schema correction).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.