agent-architecture-audit
Skill này làm gì
Công cụ này giúp tìm và sửa các lỗi trong hệ thống AI đang hoạt động bất thường. Nó kiểm tra từng phần của hệ thống để xác định nơi xảy ra lỗi.
Khi nào nên dùng
- ✓Khi một tính năng AI bắt đầu lỗi sau khi cập nhật.
- ✓Khi AI đưa ra câu trả lời sai hoặc không nhất quán.
- ✓Khi bạn nghi ngờ có điều gì đó bên trong làm hỏng câu trả lời trước khi nó đến người dùng.
Liên kết skill
https://github.com/affaan-m/ECC/blob/main/pi/core/skills/agent-architecture-audit/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy kiểm tra agent AI của tôi, nó trả lời kỳ lạ sau khi tôi thêm công cụ mới.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ phân tích hệ thống AI qua nhiều tầng, từ chỉ dẫn ban đầu đến cách câu trả lời được hiển thị. Nó tìm các vấn đề như dùng thông tin cũ, gọi sai công cụ, hoặc câu trả lời bị thay đổi trên đường đi.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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-revieworsecurity-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?
…
Câu hỏi thường gặp
“Tầng” trong hệ thống AI là gì?
Hãy hình dung các tầng là những bước khác nhau khi AI xử lý một câu hỏi. Mỗi bước, như hiểu câu hỏi, dùng công cụ hay ghi nhớ hội thoại trước, đều có thể gặp lỗi.
Tại sao AI có thể “kém đi” theo thời gian?
Điều này có thể xảy ra nếu các phần mới của hệ thống, như thêm chỉ dẫn hoặc bộ nhớ, gây nhiễu các phần cũ, hoặc khi AI bắt đầu dùng thông tin lỗi thời.
“Lỗi kỷ luật công cụ” nghĩa là gì?
Nghĩa là AI không làm theo quy tắc về lúc nào và cách nào dùng các công cụ được cấp. Nó có thể bỏ qua một công cụ cần thiết hoặc dùng sai công cụ.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 280k
- Vị trí xếp hạng
- #127
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
accessibility
280kGiúp agent của bạn tạo giao diện mà ai cũng dùng được, đảm bảo website và app hoạt động tốt với người khuyết tật như người mù hoặc khó vận động.
agent-eval
280kGiúp agent của bạn so sánh các công cụ lập trình AI khác nhau, đo xem công cụ nào nhanh hơn, rẻ hơn và đáng tin cậy hơn cho từng tác vụ.
agent-harness-construction
280kGiúp agent của bạn hiểu rõ hơn cách thực hiện tác vụ, tối ưu các công cụ và chỉ dẫn mà agent dùng để tăng khả năng thành công.
agent-introspection-debugging
280kGiúp agent của bạn tự sửa khi có sự cố, tìm nguyên nhân lỗi và giải pháp thay vì chỉ thử lại.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.