by huangjia2019
A 7×6 framework for agent architecture. 28 patterns, each placed at a coordinate, runnable Python code with verified engineering slices from Claude Code, Aider, OpenHands, DeerFlow. Companion to Designing AI Agents (Manning) by Jia Huang.
# Add to your Claude Code skills
git clone https://github.com/huangjia2019/agent-design-patternsGuides for using ai agents skills like agent-design-patterns.
Last scanned: 6/26/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-06-26T07:53:28.726Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}See how agent-design-patterns compares with popular alternatives.
agent-design-patterns is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by huangjia2019. A 7×6 framework for agent architecture. 28 patterns, each placed at a coordinate, runnable Python code with verified engineering slices from Claude Code, Aider, OpenHands, DeerFlow. Companion to Designing AI Agents (Manning) by Jia Huang. It has 281 GitHub stars.
Yes. agent-design-patterns passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/huangjia2019/agent-design-patterns" and add it to your Claude Code skills directory (see the Installation section above).
agent-design-patterns is primarily written in HTML. It is open-source under huangjia2019 on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh agent-design-patterns against similar tools.
No comments yet. Be the first to share your thoughts!
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
See comparison
Reference code and editable ADPS documentation for agent architecture: 27 core patterns, extension patterns, and three cross-cutting engineering concerns.
English documents · 中文文档 · Review and publishing
Code and documentation now share this repository. Propose article changes through a PR, or comment on a passage on the website. Accepted source revisions are published separately; each website article links to the exact source commit it displays.
简体中文 README · Pattern Docs · Manning · Designing AI Agents · Paper · arXiv:2605.13850 · 极客时间专栏 · Newsletter · Author site
📖 Browse the full pattern documentation — every pattern with its whitepaper, organized by cognitive function, with a left-rail index: adpsagent.com/zh/patterns. Enterprise case studies (蓝皮书) live at adpsagent.com/zh/cases.
Looking for the full Argus running example as one evolving codebase, organized by book chapter? See the companion repo huangjia2019/designing-ai-agents — Argus grows module by module from Ch2 to Ch10, with each chapter's
patterns/+argus/side by side. That repo follows the book's narrative; this repo is the standalone pattern catalog.
Designing AI Agents — the design-pattern catalogue for production AI agents. (Manning)
The two-axis framework, the 27 named patterns, and the five pattern-selection laws are introduced in A Two-Dimensional Framework for AI Agent Design Patterns: Cognitive Function × Execution Topology (Huang & Zhou, arXiv:2605.13850). This repository is the runnable companion to the paper.
Most "agent architecture" guides give you a flat list — Reflection, ReAct, Multi-Agent, Tree of Thoughts, Reflexive Metacognitive, and so on. A flat list answers what patterns exist. It does not answer where my problem sits, and which pattern lives at that coordinate.
A loan-evaluation agent crashes not because Reflection is missing but because Perception-stage budget allocation dropped the disqualifying document. A multi-agent code reviewer drifts not because ReAct is wrong but because two Reflection critics contradict each other and there is no governance gate to resolve it. These are not different patterns — they are patterns sitting at specific coordinates in a structured design space. Without the coordinates you can't see them.
This repo gives you the coordinates.
Every agent pattern sits at the intersection of two orthogonal axes.
The current public framework places 27 core patterns in the seven-by-six matrix. Observability, Evaluation & Validation, and Security & Identity are cross-cutting concerns. The book and older examples may use earlier catalogue versions; the current pattern documentation records the public definitions and historical entries.
The framework's claim is not that everything fits the matrix. The claim is that giving a pattern a coordinate forces an answer to "why is this pattern here and not somewhere else". A flat list lets you skip the question. A matrix does not.

Every pattern below lives at one coordinate. Click any pattern name to enter that folder's code and README. Cells marked ✅ have runnable code; cells marked 🟡 are scaffolded.
| Chain | Route | Parallel | Loop | Hierarchy | Orchestrate | |
|---|---|---|---|---|---|---|
| Perceive | Semantic Compaction ✅ | Context Triage ✅ | Multi-Modal Fusion ✅ | Progressive Discovery ✅ | — | — |
| Remember | RAG ✅ | — | — | Failure Journals ✅ | Hierarchical Retention ✅ | Progress Tracking ✅ |
| Reason | Chain of Thought ✅ | Complexity Routing ✅ | Parallel Exploration ✅ | Iterative Hypothesis Testing ✅ | — | — |
| Act | Prompt Chaining ✅ | Tool Dispatch ✅ | — | — | Guardrail Sandwich ✅ | Plan & Execute ✅ |
| Reflect | Generator-Critic ✅ | Skill Package 🟡 | — | Self-Heal Loop 🟡 | Experience Replay 🟡 | — |
| Collaborate | Handoff Chain ✅ | — | Fan-out & Gather ✅ | Adversarial Review ✅ | Hierarchical Delegation ✅ | — |
| Govern | Progressive Commitment ✅ | Approval Gate ✅ | — | — | Blast Radius ✅ | — |
X1 Observability retains the existing Observability Harness code. Its folder is not moved, so older book and course links continue to work. See also X2 Evaluation & Validation and X3 Security & Identity.
Composition (putting patterns together): Pattern Selection Card · Six-Step Methodology · Argus Full Case Study · Checklist Benchmark Case
Empty cells do not establish an industry gap. A pattern may have several implementations; the matrix records its primary coordinate.
Each pattern folder follows the same shape: pattern.py (the minimal
honest reference, 50–250 lines), example.py (a real-scenario case that
runs without API keys), test_pattern.py (the invariants the pattern
must hold), and bilingual README.md / README.zh-CN.md.
Collaboration bonus:
asyncio.gatheror a multi-agent Harness can put outputs in one list; it cannot define when that list earns a business conclusion. Run lightweight workbench B1 for bank timeout, duplicate lineage, unit mismatch, and the case where all workers succeed while the business release is correctly denied.
Every pattern's README cites real production code. Citations are file-and-line in upstream open-source projects, verified at the time of writing. If you find a citation that no longer matches the upstream code, open an issue — that's a bug, not a documentation choice.
| Pattern | Upstream slices cited |
|---|---|
| Context Triage | Aider's RepoMap, Claude Code memory hierarchy, DeerFlow schema-driven triage |
| Semantic Compaction | OpenHands condenser_config, Aider history.py, Manus Context Engineering blog |
| Hierarchical Retention | Claude Code 4-layer memory, MemGPT virtual memory hierarchy (arxiv:2310.08560) |
| RAG | Anthropic Contextual Retrieval, Reciprocal Rank Fusion (Cormack 2009), agentic-search vs. RAG decomposition |
| Progress Tracking | Claude Code TodoWrite (three fields), DeepAgents TodoListMiddleware, DeerFlow context-loss detection, Anthropic effective-context-engineering (U-shaped attention) |
| Failure Journals | Hermes Agent error_classifier (13 FailoverReason), Aider self-heal loop, Manus Context Engineering, [arxiv:2509.25370 Where LLM Agents Fail](https://arxiv.org/abs/ |