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).
npx skills add sickn33/agentic-awesome-skills --skill autonomous-agent-patterns --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Describes architectural patterns and concrete code patterns for creating autonomous coding agents, covering an agent loop with Think/Decide/Act/Observe, a multi-model selection strategy, a standard tool design (including read_file, write_file, edit_file, run_command, etc.), permissions with approval UI, sandboxing, and browser automation patterns.
How it works
- Presents an Agent Loop where the agent thinks, decides, acts, and observes within a max_iterations loop, executing tools and recording results to history; if no tool_calls are produced, it returns the response content.
- Defines a MultiModelAgent that assigns models to task types (planning, analysis, code) and selects models accordingly.
- Specifies a Tool base class with a schema property and an execute method; provides examples like ReadFileTool and EditFileTool with defined parameters, required fields, and error handling.
- Outlines Essential Agent Tools with a dictionary of tool names and descriptions (e.g., read_file, write_file, edit_file, list_directory, search_code, run_command, read_output, send_input, open_browser, click_element, type_text, screenshot, ask_user, search_web).
- Includes Edit Tool Design that supports precise file edits with conflict detection, requiring exact search text, replacing with replace text, and validating expected occurrences.
- Details Permission & Safety Patterns including PermissionLevel enums, PERMISSION_CONFIG mappings (AUTO, ASK_ONCE, ASK_EACH, NEVER) for various tools, an ApprovalManager UI flow, risk assessment for commands, and SandboxedExecution to constrain commands and paths.
- Describes Browser Automation patterns with a BrowserTool class for Playwright-like usage, a VisualAgent pattern that uses screenshots and vision-model prompts to describe pages and find/click elements.
When to use it
Use this skill when designing autonomous AI agents, planning tool/function calling APIs, implementing permission/approval systems, creating browser automation for agents, or designing human-in-the-loop workflows.
What it can touch
Declared tools include claude-code, codex, cursor. Tool schemas and examples reference file I/O (read_file, write_file, edit_file, list_directory, search_files), command execution (run_command), browser actions (open_browser, click_element, type_text, screenshot), and web/vision interactions (search_web, describe_page). The design provides concrete tool classes and parameters for these interactions.
Caveats
Declared risk: critical. License: MIT. Source: community. The skill includes sample implementations and patterns, but no guarantees of safety or success in real-world usage. The provided UI and sandboxing logic are design patterns; real deployments must ensure proper isolation and compliance with environment constraints.
# 🕹️ 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 r
- When to Use This Skill
- 1. Core Agent Architecture
- 1.1 Agent Loop
- 1.2 Multi-Model Architecture
- 2. Tool Design Patterns
- 2.1 Tool Schema
- 2.2 Essential Agent Tools
- 2.3 Edit Tool Design
- 3. Permission & Safety Patterns
- 3.1 Permission Levels
- 3.2 Approval UI Pattern
- 3.3 Sandboxing
- 4. Browser Automation
- 4.1 Browser Tool Pattern
What does the autonomous-agent-patterns skill do?
Design patterns for building autonomous coding agents, inspired by [Cline](https://github.com/cline/cline) and [OpenAI Codex](https://github.com/openai/codex).
How do I install it?
Run `npx skills add sickn33/agentic-awesome-skills --skill autonomous-agent-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From sickn33/agentic-awesome-skills, a repository with 44,414 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.