Agent skill
agentic-patterns
Install this agent skill to your Project
npx add-skill https://github.com/cuba6112/skillfactory/tree/main/skills/agentic-patterns
SKILL.md
Agentic Patterns
Overview
Use simple, composable patterns to decide when to keep a deterministic workflow versus letting an LLM drive its own control flow with tools, retrieval, and memory. Prefer minimal patterns and add agentic loops only when they unlock necessary flexibility.
When to Use
- Use this skill when the request matches the frontmatter description and triggers; otherwise start with a deterministic workflow or a single prompt.
Decision Tree
- Determine whether the task can be mapped to a fixed sequence.
- Yes: implement a workflow chain.
- No: continue.
- Determine whether the output can be evaluated with explicit criteria.
- Yes: use an evaluator-optimizer loop.
- No: continue.
- Determine whether the task decomposes into independent subtasks.
- Yes: use orchestrator-workers.
- No: add a routing step to clarify intent before tool calls.
Workflows
1. Evaluator-Optimizer Loop
- Define an evaluator rubric with pass/fail criteria and required evidence.
- Generate an initial draft with the generator.
- Evaluate the draft with the rubric and capture structured feedback.
- Feed feedback into the generator and iterate until pass or max iterations.
2. Orchestrator-Worker Task Delegation
- Decompose the request into explicit subtasks with clear outputs.
- Assign each subtask to a specialized worker prompt or tool.
- Collect worker outputs and synthesize into a single answer.
- Run a final verification pass (self-check or evaluator) before returning.
3. Tool Poka-Yoke Audit
- List all tools with names, parameters, and docstrings.
- Normalize parameter names and enforce concrete types (ids, paths, enums).
- Add minimal examples and edge cases to each docstring.
- Re-run a small task to confirm tool selection improves.
Non-Obvious Insights
- Composability beats complexity: small patterns are more reliable and easier to debug than full frameworks.
- Tool metadata is part of the control surface; sloppy names or parameters cause misrouted tool selection.
- Agentic systems rely on augmentations (retrieval, tools, memory), so design those explicitly, not as afterthoughts.
- Poka-yoke tool design reduces execution errors without changing the model.
Evidence
- "the most successful implementations use simple, composable patterns rather than complex frameworks." - Anthropic
- "Workflows are systems where LLMs and tools are orchestrated through predefined code paths. Agents, on the other hand, are systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks." - Anthropic
- "Evaluator-optimizer: one LLM call generates a response while another provides evaluation and feedback in a loop." - Anthropic
- "Poka-yoke your tools. Change the arguments so that it is harder to make mistakes." - Anthropic
- "When deciding what tool to use, your agent will use the tool's name, parameters, and docstring... So it's important to make sure the docstrings are descriptive and helpful." - LlamaIndex
Scripts
scripts/agentic-patterns_tool.py: CLI scaffolds for evaluator-optimizer, orchestrator-worker, and tool audit patterns.scripts/agentic-patterns_tool.js: Node.js CLI with the same patterns.
Dependencies
- Python 3.11+ or Node 18+.
- Optional: your LLM SDK (OpenAI/Anthropic/Gemini) for real generation/evaluation.
References
- references/README.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
prompt-engineering
Comprehensive prompt engineering techniques for Claude models. Use this skill when crafting, optimizing, or debugging prompts for Claude API, Claude Code, or any Claude-powered application. Covers system prompts, role prompting, multishot examples, chain of thought, XML structuring, long context handling, extended thinking, prompt chaining, Claude 4.x-specific best practices, and agentic orchestration including subagents, agent loops, skills, MCP integration, and multi-agent workflows.
adk-rag-agent
Build RAG (Retrieval-Augmented Generation) agents with Google ADK and Vertex AI RAG Engine. Use when implementing document Q&A, knowledge base search, or citation-backed responses. Covers VertexAiRagRetrieval tool, corpus setup, and citation formatting.
headless-cli-agents
Build agentic systems using Claude CLI in headless mode or the Claude Agent SDK. Use when building automation pipelines, CI/CD integrations, multi-agent orchestration, or programmatic Claude interactions. Covers CLI flags (-p, --output-format), session management (--resume, --continue), Python SDK (claude-agent-sdk), custom tools, and agent loop patterns.
notion-knowledge-capture
Capture conversations and decisions into structured Notion pages; use when turning chats/notes into wiki entries, how-tos, decisions, or FAQs with proper linking.
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
gh-fix-ci
Inspect GitHub PR checks with gh, pull failing GitHub Actions logs, summarize failure context, then create a fix plan and implement after user approval. Use when a user asks to debug or fix failing PR CI/CD checks on GitHub Actions and wants a plan + code changes; for external checks (e.g., Buildkite), only report the details URL and mark them out of scope.
Didn't find tool you were looking for?