AI Agent Core Loop

Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).

45 stars 6 forksAI, LLMs & Agents

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add j4flmao/agent-skills --skill ai-agent-core-loop
Manual install
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/ai/ai-agents/core-architectures ~/.claude/skills/ai-agent-core-loop

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Agent Core Loop

## Purpose
Every agent reduces to a loop: build context from state, ask the model for the next action, execute it, record the observation, decide whether to stop. Reliability comes from the parts around the model call: how context is assembled, how actions are validated, how progress is measured, and when the loop terminates. This skill covers those mechanics and the trade-offs between ReAct, plan-and-solve, and reflection variants.

## Agent Protocol

### Trigger
"agent loop", "ReAct", "plan-and-solve", "re-planning", "self-reflection", "Reflexion", "agent stuck in a loop", "termination condition", "max iterations".

### Input Context
- Current loop code or framework config.
- Typical task length and failure transcripts (where it loops, stalls, or stops early).
- Tool list with side-effect classification.

### Output Artifact
Loop specification or patch: state object, step function, termination rules, reflection policy.

### Response Format
```
Variant: {react|plan-and-solve|plan-execute-replan|reflexion}
State: {fields}
Step: assemble_context -> decide -> validate -> execute -> observe -> update
Stop when: {success test} OR steps>={n} OR no_progress>={k} OR budget>={usd}
Reflection: {trigger, input signal, where lessons are stored}
```

### Completion Criteria
- [ ] Success is a checkable predicate, not "model says done".
- [ ] Explicit caps and a no-progress detector.
- [ ] Actions validated before execution.
Read the full skill on GitHub

Details

Skill name
ai-agent-core-loop
Path
skills/ai/ai-agents/core-architectures/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the AI Agent Core Loop skill do?

Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).

How do I install the AI Agent Core Loop skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill ai-agent-core-loop. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is AI Agent Core Loop popular?

It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.

Related skills

Agent Observability

45

j4flmao/agent-skills

Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).

DevOps & Cloud

AI Agent Architectures

45

j4flmao/agent-skills

Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).

AI, LLMs & Agents

AI Agent Memory Systems

45

j4flmao/agent-skills

Use when the user asks about agent memory, long-term memory across sessions, remembering user preferences, context window full, conversation summarization, episodic or semantic memory. Produces memory tiers, a store schema and write/retrieve/expiry policies with per-user isolation. Not for document RAG (use llm-rag-retrieval-internals) or vector DB operations (use data-vector-databases).

AI, LLMs & Agents

AI Agentic Workflows

45

j4flmao/agent-skills

Use when the user asks about an agentic workflow, prompt chaining, router, orchestrator-workers, evaluator-optimizer, ReAct, plan-and-execute or a LangGraph workflow with human checkpoints. Produces the simplest workflow pattern with typed state, loop bounds and approval points. Not for multi-agent runtimes (use ai-multi-agent-systems) or single-loop mechanics (use ai-agent-core-loop).

AI, LLMs & Agents

Stop Slop Zh

11

leeguooooo/stop-slop-zh

写、起草、生成、润色任何面向人读的中文时,都要用本 Skill——公众号、博客、知乎、小红书、技术文档、技术方案、设计文档、README、公文、学术摘要、产品文案、复盘、提案、新闻稿、邮件、对外通知,以及回别人的评论 / IM / PR 意见。无论是从零写新稿,还是改稿、审稿,只要在产出中文长文,写完、定稿、交付、发布前都必须调用它过一遍:它识别并消除中文 AI 写作的典型痕迹——套话、排比三件套、名词化、抽象主语、金句收尾、总分总八股、标点指纹、标题套路、评级悬念开头、转述腔、提示语冒号、翻译腔、相邻句同构、同义词轮换——让文本读起来像有人在说话,而不是 AI 在生成。技术与对外文档另有专项(第三节:不写术语表、不解释读者本来就会的概念、结论文档不写过程、对外文档不写内部日记);回复类另有专项(第四节:不写开场白、不写客套、陈述事实而不是承诺)。简言之:只要这次任务的产物里有一段是要给人读的中文,就触发本 Skill。

AI, LLMs & Agents

AI Multi Agent Systems

45

j4flmao/agent-skills

Use when the user asks about a multi-agent system in LangGraph, AutoGen, CrewAI or OpenAI Agents SDK handoffs, shared blackboard state, A2A, checkpointing or human approval in an agent graph. Produces a runtime design: typed state, nodes, routing, durable checkpointer, interrupts, budgets and tracing. Not for choosing the topology (use multi-agent-topology).

AI, LLMs & Agents

Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.