skills/ai-agent-design-patterns/SKILL.md
To structure autonomous AI systems that can reason, plan, and execute tools to solve complex, multi-step problems using patterns like ReAct and Multi-Agent orchestration. Use when: When the task requires multiple distinct steps (e.g., "Find the price of BTC and email me the summary"); When the LLM needs to interact with the outside world (APIs, Databases, Web Search); When the workflow is non-linear and depends on intermediate results.
npx skillsauth add jyjeanne/ai-setup-forge ai-agent-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.
To structure autonomous AI systems that can reason, plan, and execute tools to solve complex, multi-step problems using patterns like ReAct and Multi-Agent orchestration.
Define the tools your agent can use with clear descriptions.
import { z } from "zod";
import { tool } from "@langchain/core/tools";
const searchTool = tool(
async ({ query }) => {
// Implement search logic here
return `Results for ${query}...`;
},
{
name: "web_search",
description: "Search the web for current events or technical info.",
schema: z.object({
query: z.string(),
}),
}
);
Implement the Reasoning + Acting loop.
import { ChatOpenAI } from "@langchain/openai";
import { createReactAgent } from "@langchain/langgraph/prebuilt";
import { MemorySaver } from "@langchain/langgraph";
const model = new ChatOpenAI({ modelName: "gpt-4o" });
const tools = [searchTool];
const checkpointer = new MemorySaver();
const app = createReactAgent({
llm: model,
tools,
checkpointSaver: checkpointer,
});
// Usage
const result = await app.invoke(
{ messages: [{ role: "user", content: "What is the current price of Ethereum?" }] },
{ configurable: { thread_id: "user_1" } }
);
Structure specialized agents that pass tasks to each other.
// Conceptual LangGraph Flow:
// 1. Router Agent -> Decides if it's a "Coding" or "Writing" task.
// 2. Coder Agent -> Generates code.
// 3. Reviewer Agent -> Reviews code. If errors, sends back to Coder.
// 4. Final Output.
Implement safety checks for tool execution.
const safeExecute = (action: string) => {
const forbidden = ["rm -rf", "delete", "drop table"];
if (forbidden.some(word => action.includes(word))) {
throw new Error("Safety violation: forbidden command.");
}
};
Maintain the conversation and tool execution state.
// Use LangGraph state to keep track of:
// - messages
// - tool_outputs
// - current_step
maxIterations or recursion limit.A robust agentic system capable of autonomous problem solving by effectively utilizing provided tools.
development
Generate breadboard circuit mockups and visual diagrams using HTML5 Canvas drawing techniques. Use when asked to create circuit layouts, visualize electronic component placements, draw breadboard diagrams, mockup 6502 builds, generate retro computer schematics, or design vintage electronics projects. Supports 555 timers, W65C02S microprocessors, 28C256 EEPROMs, W65C22 VIA chips, 7400-series logic gates, LEDs, resistors, capacitors, switches, buttons, crystals, and wires.
development
Apply lean thinking to UX: hypothesis-driven design, collaborative sketching, and rapid experiments instead of heavy deliverables. Use when the user mentions "Lean UX", "design hypothesis", "UX experiment", "collaborative design", or "outcome over output". Covers hypothesis statements, MVPs for UX, and cross-functional collaboration. For Build-Measure-Learn, see lean-startup. For usability audits, see ux-heuristics.
development
Design MVPs, validated learning experiments, and pivot-or-persevere decisions using Build-Measure-Learn. Use when the user mentions "MVP scope", "validated learning", "pivot or persevere", "vanity metrics", or "test assumptions". Covers innovation accounting and actionable metrics. For 5-day prototype testing, see design-sprint. For customer motivation analysis, see jobs-to-be-done.
tools
Instrument, trace, evaluate, and monitor LLM applications and AI agents with LangSmith. Use when setting up observability for LLM pipelines, running offline or online evaluations, managing prompts in the Prompt Hub, creating datasets for regression testing, or deploying agent servers. Triggers on: langsmith, langchain tracing, llm tracing, llm observability, llm evaluation, trace llm calls, @traceable, wrap_openai, langsmith evaluate, langsmith dataset, langsmith feedback, langsmith prompt hub, langsmith project, llm monitoring, llm debugging, llm quality, openevals, langsmith cli, langsmith experiment, annotate llm, llm judge.