Claude-skill-registry ai-agent-basics

Master AI agent fundamentals - architectures, ReAct patterns, cognitive loops, and autonomous system design

install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/ai-agent-basics" ~/.claude/skills/majiayu000-claude-skill-registry-ai-agent-basics && rm -rf "$T"
manifest: skills/data/ai-agent-basics/SKILL.md
source content

AI Agent Basics

Build production-grade AI agents with modern architectures and patterns.

When to Use This Skill

Invoke this skill when:

  • Designing new AI agent systems
  • Implementing ReAct or Plan-and-Execute patterns
  • Building autonomous task-solving agents
  • Integrating cognitive loops into applications

Parameter Schema

ParameterTypeRequiredDescriptionDefault
task
stringYesWhat agent capability to build-
architecture
enumNo
single
,
multi
,
hybrid
single
framework
enumNo
langchain
,
langgraph
,
custom
langgraph
complexity
enumNo
basic
,
intermediate
,
advanced
intermediate

Quick Start

# Basic ReAct Agent
from langgraph.prebuilt import create_react_agent
from langchain_anthropic import ChatAnthropic

llm = ChatAnthropic(model="claude-sonnet-4-20250514")
agent = create_react_agent(llm, tools=[search, calculator])
result = await agent.ainvoke({"messages": [("user", "What is 25 * 4?")]})

Core Patterns

1. ReAct Agent

# Thought → Action → Observation loop
graph = StateGraph(AgentState)
graph.add_node("think", reason_node)
graph.add_node("act", action_node)
graph.add_node("observe", observation_node)

2. Plan-and-Execute

# Create plan → Execute steps → Verify
planner = create_planner(llm)
executor = create_executor(llm, tools)

3. Reflexion

# Execute → Reflect → Improve
agent_with_reflection = add_reflection_layer(base_agent)

Troubleshooting

IssueSolution
Agent loops foreverAdd max_iterations limit
Wrong tool selectedImprove tool descriptions
Context too largeImplement summarization
Slow responsesUse streaming

Best Practices

  • Start with simple single-agent before multi-agent
  • Always add circuit breakers (max iterations)
  • Use verbose mode for debugging
  • Implement human-in-the-loop for critical decisions

Related Skills

  • llm-integration
    - LLM API configuration
  • tool-calling
    - Function calling implementation
  • agent-memory
    - Memory systems

References