
Autonomous Agent Patterns
Reference Cline- and Codex-inspired patterns when designing agent loops, tool APIs, permissions, and human-in-the-loop flows for your own coding agent.
Overview
autonomous-agent-patterns is a journey-wide agent skill that documents autonomous coding-agent architecture—loops, tools, permissions, and human-in-the-loop flows—whenever a solo builder needs to design agent behavior be
Install
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill autonomous-agent-patternsWhat is this skill?
- Documented think–decide–act–observe agent loop for autonomous coding agents
- Guidance for designing tool and function-calling APIs agents can rely on
- Permission and approval system patterns for safe autonomous execution
- Browser automation considerations for agent actuators
- Human-in-the-loop workflow design aligned with Cline and OpenAI Codex inspiration
- Core agent loop with four stages: Think, Decide, Act, Observe
Adoption & trust: 747 installs on skills.sh; 40.1k GitHub stars; 1/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want an agent that can plan and execute code changes autonomously but lack a proven pattern for the loop, tools, and approval gates.
Who is it for?
Builders implementing or extending autonomous IDE agents, CLI codex-style runners, or internal dev bots who need architectural guardrails.
Skip if: Users who only invoke an off-the-shelf agent with default tools and never customize loops, permissions, or browser automation.
When should I use this skill?
Use when building autonomous AI agents, designing tool or function calling APIs, implementing permission and approval systems, creating browser automation for agents, or designing human-in-the-loop workflows.
What do I get? / Deliverables
You align your agent implementation with a structured think–decide–act–observe loop, clearer tool APIs, and permission or human-in-the-loop rules before wiring production automation.
- Agent loop and tool API design notes
- Permission and approval flow specification
- Human-in-the-loop workflow outline
Recommended Skills
Journey fit
Useful at every journey phase - explore requirements and options before committing to a direction.
Where it fits
Decide whether full autonomy or human-in-the-loop is in scope before building an internal coding agent.
Map think–decide–act–observe steps and tool schemas for a custom agent runner.
Design approval prompts before shell, git, or network tools execute.
Add observation hooks so agent results feed logs and incident review.
Document escalation paths when autonomous runs need human takeover.
How it compares
Use for agent architecture playbooks instead of a single MCP server or a one-off bash script wrapper.
Common Questions / FAQ
Who is autonomous-agent-patterns for?
Solo and indie developers designing custom autonomous coding agents, tool-calling layers, or approval workflows inspired by Cline and Codex.
When should I use autonomous-agent-patterns?
In Build while defining agent loops and tools, in Ship when designing approval and security gates, and in Operate when refining human-in-the-loop oversight after production agent runs.
Is autonomous-agent-patterns safe to install?
The skill is marked critical risk in its manifest because it guides powerful autonomous patterns; review the Security Audits panel on this page and treat permissions and approvals as your responsibility.
SKILL.md
READMESKILL.md - Autonomous Agent Patterns
# 🕹️ Autonomous Agent Patterns > Design patterns for building autonomous coding agents, inspired by [Cline](https://github.com/cline/cline) and [OpenAI Codex](https://github.com/openai/codex). ## When to Use This Skill Use this skill when: - Building autonomous AI agents - Designing tool/function calling APIs - Implementing permission and approval systems - Creating browser automation for agents - Designing human-in-the-loop workflows --- ## 1. Core Agent Architecture ### 1.1 Agent Loop ``` ┌─────────────────────────────────────────────────────────────┐ │ AGENT LOOP │ │ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ │ Think │───▶│ Decide │───▶│ Act │ │ │ │ (Reason) │ │ (Plan) │ │ (Execute)│ │ │ └──────────┘ └──────────┘ └──────────┘ │ │ ▲ │ │ │ │ ┌──────────┐ │ │ │ └─────────│ Observe │◀─────────┘ │ │ │ (Result) │ │ │ └──────────┘ │ └─────────────────────────────────────────────────────────────┘ ``` ```python class AgentLoop: def __init__(self, llm, tools, max_iterations=50): self.llm = llm self.tools = {t.name: t for t in tools} self.max_iterations = max_iterations self.history = [] def run(self, task: str) -> str: self.history.append({"role": "user", "content": task}) for i in range(self.max_iterations): # Think: Get LLM response with tool options response = self.llm.chat( messages=self.history, tools=self._format_tools(), tool_choice="auto" ) # Decide: Check if agent wants to use a tool if response.tool_calls: for tool_call in response.tool_calls: # Act: Execute the tool result = self._execute_tool(tool_call) # Observe: Add result to history self.history.append({ "role": "tool", "tool_call_id": tool_call.id, "content": str(result) }) else: # No more tool calls = task complete return response.content return "Max iterations reached" def _execute_tool(self, tool_call) -> Any: tool = self.tools[tool_call.name] args = json.loads(tool_call.arguments) return tool.execute(**args) ``` ### 1.2 Multi-Model Architecture ```python class MultiModelAgent: """ Use different models for different purposes: - Fast model for planning - Powerful model for complex reasoning - Specialized model for code generation """ def __init__(self): self.models = { "fast": "gpt-3.5-turbo", # Quick decisions "smart": "gpt-4-turbo", # Complex reasoning "code": "claude-3-sonnet", # Code generation } def select_model(self, task_type: str) -> str: if task_type == "planning": return self.models["fast"] elif task_type == "analysis": return self.models["smart"] elif task_type == "code": return self.models["code"] return self.models["smart"] ``` --- ## 2. Tool Design Patterns ### 2.1 Tool Schema ```python class Tool: """Base class for agent tools""" @property def s