.claude/skills/agentic-design-patterns/SKILL.md
# Agentic Design Patterns > Based on "Agentic Design Patterns" by Antonio Gulli & Mauro Sauco (2025) > 21 patterns across 4 tiers for building production-grade AI agent systems ## Pattern Catalog ### Part 1: Foundational Patterns #### 1. Prompt Chaining (Pipeline) Decompose complex tasks into sequential sub-problems where each step's output feeds the next. **When to use**: Task too complex for single prompt, multiple processing stages, external tool integration between steps. **Implementat
npx skillsauth add markus41/claude .claude/skills/agentic-design-patternsInstall 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.
Based on "Agentic Design Patterns" by Antonio Gulli & Mauro Sauco (2025) 21 patterns across 4 tiers for building production-grade AI agent systems
Decompose complex tasks into sequential sub-problems where each step's output feeds the next.
When to use: Task too complex for single prompt, multiple processing stages, external tool integration between steps.
Implementation:
Anti-patterns: Using for simple queries; ignoring latency cost of chaining.
Input → [Step 1: Extract] → Gate → [Step 2: Transform] → Gate → [Step 3: Generate] → Output
Introduce conditional logic for dynamic execution path selection based on input analysis.
Types:
When to use: Varying input complexity, multiple specialized handlers, need for adaptive behavior.
Implementation:
Execute independent tasks concurrently and aggregate results at synchronization points.
Variants:
When to use: Independent data lookups, multi-source research, validation checks, content generation.
Implementation:
Agent evaluates its own output and iteratively refines it through feedback loops.
Architecture: Producer-Critic separation
When to use: Quality > speed, complex content generation, code review, planning.
Stopping conditions: Quality score threshold, max iterations, explicit "PERFECT" signal.
Enable agents to interface with external systems via structured function definitions.
Execution flow:
Strategies: Sequential, Chained, Parallel, Delegated, Conditional.
Safety: Sandboxed execution, least privilege, input validation, audit logging.
Formulate action sequences from initial state to goal state with dynamic replanning.
Key question: "Does the 'how' need to be discovered, or is it already known?"
Approaches:
When to use: Complex multi-step objectives, unknown solution paths, research tasks.
Structure systems as cooperative ensembles of specialized agents.
Topologies: | Topology | Description | Best For | |----------|-------------|----------| | Single Agent | Standalone operation | Simple tasks | | Network (Flat) | Peer-to-peer, decentralized | Resilient systems | | Supervisor (Hub-Spoke) | Central coordinator | Clear authority | | Hierarchical | Multi-layered supervisors | Complex decomposition | | Custom/Hybrid | Tailored combinations | Specific requirements |
Collaboration models: Sequential Handoffs, Parallel Processing, Debate & Consensus, Hierarchical Delegation, Critic-Reviewer.
Retain and utilize information across interactions for context, learning, and personalization.
Memory types:
State prefixes: No prefix (session), user: (cross-session), app: (shared), temp: (turn-only).
Best practices: Keep state simple, clear key names, avoid deep nesting, update through event processing.
Evolve beyond initial programming through experience and environmental interaction.
Approaches:
Requirements: Clear evaluation metrics, structured feedback loops, modular architecture, oversight mechanisms.
Standardized tool integration framework for agent-external system interaction.
Components: Resources (data), Tools (actions), Prompts (templates), Sampling (nested LLM calls).
Key benefit: Single integration point for diverse external systems.
Define objectives, track progress, and adjust strategies based on measured outcomes.
Framework: Set measurable goals → Monitor progress → Detect deviations → Trigger replanning.
Integration: Works with Reflection (corrective engine) and Planning (strategy adjustment).
Detect problems, implement appropriate responses, and restore stable operation.
Detection: Invalid outputs, API errors, performance degradation, incoherent responses.
Strategies:
Implementation: Layered handlers (primary → fallback → response agent).
Integrate human oversight at critical decision points.
Modes:
When to use: High-stakes decisions, safety-critical operations, compliance requirements.
Augment agent responses with retrieved contextual information.
Pipeline: Query → Retrieve (vector search) → Augment (inject context) → Generate (informed response).
Optimizations: Chunk sizing, embedding model selection, hybrid search (keyword + semantic), re-ranking.
Open HTTP-based standard for agent collaboration across frameworks.
Components:
Discovery: Well-Known URI, Curated Registries, Direct Configuration.
Interaction modes: Synchronous, Async Polling, Streaming (SSE), Push Notifications (webhooks).
Dynamically manage computational, temporal, and financial resources during operation.
Strategies:
Advanced problem-solving methods for complex tasks.
Methods:
Scaling Law: Performance improves with inference-time compute, not just model size.
Protective mechanisms ensuring safe, ethical, trustworthy operation.
Layers:
Key areas: Jailbreak prevention, prohibited content, off-domain filtering, hallucination detection.
Production: Modular agents, structured logging, checkpointing, principle of least privilege.
Systematic performance assessment for operational agent systems.
Metrics: Response quality (semantic similarity), latency, token usage, trajectory analysis.
Methods:
Infrastructure: Persistent logging, structured formats, anomaly detection, drift detection.
Rank and order tasks by importance, urgency, and resource availability.
Frameworks: Priority queues, deadline-based scheduling, dependency-aware ordering, dynamic reprioritization.
Identify novel capabilities, solutions, and opportunities through systematic investigation.
Approaches: Hypothesis-driven exploration, curiosity-based discovery, serendipity handling, knowledge gap identification.
| Pattern | Combines Well With | Plugins Using | |---------|-------------------|---------------| | Prompt Chaining | Planning, Tool Use, Memory | All | | Routing | Parallelization, Resource-Aware | claude-code-expert, jira-orchestrator | | Parallelization | Routing, Aggregation | jira-orchestrator, exec-automator | | Reflection | Planning, Evaluation | upgrade-suggestion, claude-code-expert | | Tool Use | Guardrails, Exception Handling | All | | Planning | Reflection, Multi-Agent | jira-orchestrator, deployment-pipeline | | Multi-Agent | Routing, A2A, Memory | All multi-agent plugins | | Memory | Learning, RAG | claude-code-expert, jira-orchestrator | | Guardrails | Tool Use, HITL | All | | Evaluation | Monitoring, Reflection | All |
development
Enhanced plan-authoring skill with Pre-Writing context gathering, task metadata, non-TDD templates, Red Flags, telemetry, and an automated plan linter. Use when you have a spec or requirements for a multi-step task, before touching code.
tools
Documentation intelligence engine with graph-based API docs, algorithm library, and drift detection
tools
Ultraplan cloud planning — kick off a plan in the cloud from your terminal, review and revise in the browser, then execute remotely or send back to CLI
tools
--- name: mcp description: Configure MCP servers for Claude Code — stdio vs HTTP, authentication, Tools/Resources/Prompts distinction, channels (CI webhook, mobile relay, Discord bridge, fakechat), and cost of always-loaded tools. Use this skill whenever adding an MCP server, debugging connection issues, choosing between MCP Tools vs Prompts vs Resources, installing channel servers, or managing .mcp.json. Triggers on: "MCP server", "mcp config", "add Obsidian MCP", "install context7", "channels"