[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6JH3S7Z6RAZ8C6G3ASFHVB2":3,"skill-same:01M6JH3S7Z6RAZ8C6G3ASFHVB2":79},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":31,"publishedAt":52,"linkOnly":53,"markdownContent":54,"markdownBody":55,"frontMatter":56,"refName":57,"commitSha":58,"skillDirectory":59,"forksCount":60,"repositoryHtmlUrl":61,"repositoryHomepageUrl":6,"ownerHtmlUrl":62,"ownerBlogUrl":6,"ownerDescription":63,"updatedAt":64,"install":65,"resources":78},"01M6JH3S7Z6RAZ8C6G3ASFHVB2","autonomous-agent-patterns",null,"Design patterns for building autonomous coding agents. Covers tool integration, permission systems, browser automation, and human-in-the-loop workflows. Use when building AI agents, designing tool APIs, implementing permission systems, or creating autonomous coding assistants.","transaurus\u002Fstaging-davila7-claude-code-templates","transaurus","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F210882017?v=4","01M6JH1R6ZCRXGJCTDP5ZKZBE6","Page Turner Agent","01M6JH1RBBR2P6Y0XWDGM4B0G7",0,"MIT","https:\u002F\u002Fgithub.com\u002Ftransaurus\u002Fstaging-davila7-claude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fai-research\u002Fautonomous-agent-patterns\u002FSKILL.md",[18,23,26],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":27,"categoryName":28,"taxonomyType":29,"taxonomyTypeDesc":30},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],"autonomous agent patterns","autonomous agent","agent patterns","patterns","autonomous","autonomous coding agents","design","for","implementing","human","permission","design patterns","coding","tool","loop","human-in-the-loop","browser","workflows","ai agents","browser automation","2026-11-10 10:12:30",false,"---\nname: autonomous-agent-patterns\ndescription: \"Design patterns for building autonomous coding agents. Covers tool integration, permission systems, browser automation, and human-in-the-loop workflows. Use when building AI agents, designing tool APIs, implementing permission systems, or creating autonomous coding assistants.\"\n---\n\n# ?️ Autonomous Agent Patterns\n\n> Design patterns for building autonomous coding agents, inspired by [Cline](https:\u002F\u002Fgithub.com\u002Fcline\u002Fcline) and [OpenAI Codex](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fcodex).\n\n## When to Use This Skill\n\nUse this skill when:\n\n- Building autonomous AI agents\n- Designing tool\u002Ffunction calling APIs\n- Implementing permission and approval systems\n- Creating browser automation for agents\n- Designing human-in-the-loop workflows\n\n---\n\n## 1. Core Agent Architecture\n\n### 1.1 Agent Loop\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                     AGENT LOOP                               │\n│                                                              │\n│  ┌──────────┐    ┌──────────┐    ┌──────────┐              │\n│  │  Think   │───▶│  Decide  │───▶│   Act    │              │\n│  │ (Reason) │    │ (Plan)   │    │ (Execute)│              │\n│  └──────────┘    └──────────┘    └──────────┘              │\n│       ▲                               │                     │\n│       │         ┌──────────┐          │                     │\n│       └─────────│ Observe  │◀─────────┘                     │\n│                 │ (Result) │                                │\n│                 └──────────┘                                │\n└─────────────────────────────────────────────────────────────┘\n```\n\n```python\nclass AgentLoop:\n    def __init__(self, llm, tools, max_iterations=50):\n        self.llm = llm\n        self.tools = {t.name: t for t in tools}\n        self.max_iterations = max_iterations\n        self.history = []\n\n    def run(self, task: str) -> str:\n        self.history.append({\"role\": \"user\", \"content\": task})\n\n        for i in range(self.max_iterations):\n            # Think: Get LLM response with tool options\n            response = self.llm.chat(\n                messages=self.history,\n                tools=self._format_tools(),\n                tool_choice=\"auto\"\n            )\n\n            # Decide: Check if agent wants to use a tool\n            if response.tool_calls:\n                for tool_call in response.tool_calls:\n                    # Act: Execute the tool\n                    result = self._execute_tool(tool_call)\n\n                    # Observe: Add result to history\n                    self.history.append({\n                        \"role\": \"tool\",\n                        \"tool_call_id\": tool_call.id,\n                        \"content\": str(result)\n                    })\n            else:\n                # No more tool calls = task complete\n                return response.content\n\n        return \"Max iterations reached\"\n\n    def _execute_tool(self, tool_call) -> Any:\n        tool = self.tools[tool_call.name]\n        args = json.loads(tool_call.arguments)\n        return tool.execute(**args)\n```\n\n### 1.2 Multi-Model Architecture\n\n```python\nclass MultiModelAgent:\n    \"\"\"\n    Use different models for different purposes:\n    - Fast model for planning\n    - Powerful model for complex reasoning\n    - Specialized model for code generation\n    \"\"\"\n\n    def __init__(self):\n        self.models = {\n            \"fast\": \"gpt-3.5-turbo\",      # Quick decisions\n            \"smart\": \"gpt-4-turbo\",        # Complex reasoning\n            \"code\": \"claude-3-sonnet\",     # Code generation\n        }\n\n    def select_model(self, task_type: str) -> str:\n        if task_type == \"planning\":\n            return self.models[\"fast\"]\n        elif task_type == \"analysis\":\n            return self.models[\"smart\"]\n        elif task_type == \"code\":\n            return self.models[\"code\"]\n        return self.models[\"smart\"]\n```\n\n---\n\n## 2. Tool Design Patterns\n\n### 2.1 Tool Schema\n\n```python\nclass Tool:\n    \"\"\"Base class for agent tools\"\"\"\n\n    @property\n    def schema(self) -> dict:\n        \"\"\"JSON Schema for the tool\"\"\"\n        return {\n            \"name\": self.name,\n            \"description\": self.description,\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": self._get_parameters(),\n                \"required\": self._get_required()\n            }\n        }\n\n    def execute(self, **kwargs) -> ToolResult:\n        \"\"\"Execute the tool and return result\"\"\"\n        raise NotImplementedError\n\nclass ReadFileTool(Tool):\n    name = \"read_file\"\n    description = \"Read the contents of a file from the filesystem\"\n\n    def _get_parameters(self):\n        return {\n            \"path\": {\n                \"type\": \"string\",\n                \"description\": \"Absolute path to the file\"\n            },\n            \"start_line\": {\n                \"type\": \"integer\",\n                \"description\": \"Line to start reading from (1-indexed)\"\n            },\n            \"end_line\": {\n                \"type\": \"integer\",\n                \"description\": \"Line to stop reading at (inclusive)\"\n            }\n        }\n\n    def _get_required(self):\n        return [\"path\"]\n\n    def execute(self, path: str, start_line: int = None, end_line: int = None) -> ToolResult:\n        try:\n            with open(path, 'r') as f:\n                lines = f.readlines()\n\n            if start_line and end_line:\n                lines = lines[start_line-1:end_line]\n\n            return ToolResult(\n                success=True,\n                output=\"\".join(lines)\n            )\n        except FileNotFoundError:\n            return ToolResult(\n                success=False,\n                error=f\"File not found: {path}\"\n            )\n```\n\n### 2.2 Essential Agent Tools\n\n```python\nCODING_AGENT_TOOLS = {\n    # File operations\n    \"read_file\": \"Read file contents\",\n    \"write_file\": \"Create or overwrite a file\",\n    \"edit_file\": \"Make targeted edits to a file\",\n    \"list_directory\": \"List files and folders\",\n    \"search_files\": \"Search for files by pattern\",\n\n    # Code understanding\n    \"search_code\": \"Search for code patterns (grep)\",\n    \"get_definition\": \"Find function\u002Fclass definition\",\n    \"get_references\": \"Find all references to a symbol\",\n\n    # Terminal\n    \"run_command\": \"Execute a shell command\",\n    \"read_output\": \"Read command output\",\n    \"send_input\": \"Send input to running command\",\n\n    # Browser (optional)\n    \"open_browser\": \"Open URL in browser\",\n    \"click_element\": \"Click on page element\",\n    \"type_text\": \"Type text into input\",\n    \"screenshot\": \"Capture screenshot\",\n\n    # Context\n    \"ask_user\": \"Ask the user a question\",\n    \"search_web\": \"Search the web for information\"\n}\n```\n\n### 2.3 Edit Tool Design\n\n```python\nclass EditFileTool(Tool):\n    \"\"\"\n    Precise file editing with conflict detection.\n    Uses search\u002Freplace pattern for reliable edits.\n    \"\"\"\n\n    name = \"edit_file\"\n    description = \"Edit a file by replacing specific content\"\n\n    def execute(\n        self,\n        path: str,\n        search: str,\n        replace: str,\n        expected_occurrences: int = 1\n    ) -> ToolResult:\n        \"\"\"\n        Args:\n            path: File to edit\n            search: Exact text to find (must match exactly, including whitespace)\n            replace: Text to replace with\n            expected_occurrences: How many times search should appear (validation)\n        \"\"\"\n        with open(path, 'r') as f:\n            content = f.read()\n\n        # Validate\n        actual_occurrences = content.count(search)\n        if actual_occurrences != expected_occurrences:\n            return ToolResult(\n                success=False,\n                error=f\"Expected {expected_occurrences} occurrences, found {actual_occurrences}\"\n            )\n\n        if actual_occurrences == 0:\n            return ToolResult(\n                success=False,\n                error=\"Search text not found in file\"\n            )\n\n        # Apply edit\n        new_content = content.replace(search, replace)\n\n        with open(path, 'w') as f:\n            f.write(new_content)\n\n        return ToolResult(\n            success=True,\n            output=f\"Replaced {actual_occurrences} occurrence(s)\"\n        )\n```\n\n---\n\n## 3. Permission & Safety Patterns\n\n### 3.1 Permission Levels\n\n```python\nclass PermissionLevel(Enum):\n    # Fully automatic - no user approval needed\n    AUTO = \"auto\"\n\n    # Ask once per session\n    ASK_ONCE = \"ask_once\"\n\n    # Ask every time\n    ASK_EACH = \"ask_each\"\n\n    # Never allow\n    NEVER = \"never\"\n\nPERMISSION_CONFIG = {\n    # Low risk - can auto-approve\n    \"read_file\": PermissionLevel.AUTO,\n    \"list_directory\": PermissionLevel.AUTO,\n    \"search_code\": PermissionLevel.AUTO,\n\n    # Medium risk - ask once\n    \"write_file\": PermissionLevel.ASK_ONCE,\n    \"edit_file\": PermissionLevel.ASK_ONCE,\n\n    # High risk - ask each time\n    \"run_command\": PermissionLevel.ASK_EACH,\n    \"delete_file\": PermissionLevel.ASK_EACH,\n\n    # Dangerous - never auto-approve\n    \"sudo_command\": PermissionLevel.NEVER,\n    \"format_disk\": PermissionLevel.NEVER\n}\n```\n\n### 3.2 Approval UI Pattern\n\n```python\nclass ApprovalManager:\n    def __init__(self, ui, config):\n        self.ui = ui\n        self.config = config\n        self.session_approvals = {}\n\n    def request_approval(self, tool_name: str, args: dict) -> bool:\n        level = self.config.get(tool_name, PermissionLevel.ASK_EACH)\n\n        if level == PermissionLevel.AUTO:\n            return True\n\n        if level == PermissionLevel.NEVER:\n            self.ui.show_error(f\"Tool '{tool_name}' is not allowed\")\n            return False\n\n        if level == PermissionLevel.ASK_ONCE:\n            if tool_name in self.session_approvals:\n                return self.session_approvals[tool_name]\n\n        # Show approval dialog\n        approved = self.ui.show_approval_dialog(\n            tool=tool_name,\n            args=args,\n            risk_level=self._assess_risk(tool_name, args)\n        )\n\n        if level == PermissionLevel.ASK_ONCE:\n            self.session_approvals[tool_name] = approved\n\n        return approved\n\n    def _assess_risk(self, tool_name: str, args: dict) -> str:\n        \"\"\"Analyze specific call for risk level\"\"\"\n        if tool_name == \"run_command\":\n            cmd = args.get(\"command\", \"\")\n            if any(danger in cmd for danger in [\"rm -rf\", \"sudo\", \"chmod\"]):\n                return \"HIGH\"\n        return \"MEDIUM\"\n```\n\n### 3.3 Sandboxing\n\n```python\nclass SandboxedExecution:\n    \"\"\"\n    Execute code\u002Fcommands in isolated environment\n    \"\"\"\n\n    def __init__(self, workspace_dir: str):\n        self.workspace = workspace_dir\n        self.allowed_commands = [\"npm\", \"python\", \"node\", \"git\", \"ls\", \"cat\"]\n        self.blocked_paths = [\"\u002Fetc\", \"\u002Fusr\", \"\u002Fbin\", os.path.expanduser(\"~\")]\n\n    def validate_path(self, path: str) -> bool:\n        \"\"\"Ensure path is within workspace\"\"\"\n        real_path = os.path.realpath(path)\n        workspace_real = os.path.realpath(self.workspace)\n        return real_path.startswith(workspace_real)\n\n    def validate_command(self, command: str) -> bool:\n        \"\"\"Check if command is allowed\"\"\"\n        cmd_parts = shlex.split(command)\n        if not cmd_parts:\n            return False\n\n        base_cmd = cmd_parts[0]\n        return base_cmd in self.allowed_commands\n\n    def execute_sandboxed(self, command: str) -> ToolResult:\n        if not self.validate_command(command):\n            return ToolResult(\n                success=False,\n                error=f\"Command not allowed: {command}\"\n            )\n\n        # Execute in isolated environment\n        result = subprocess.run(\n            command,\n            shell=True,\n            cwd=self.workspace,\n            capture_output=True,\n            timeout=30,\n            env={\n                **os.environ,\n                \"HOME\": self.workspace,  # Isolate home directory\n            }\n        )\n\n        return ToolResult(\n            success=result.returncode == 0,\n            output=result.stdout.decode(),\n            error=result.stderr.decode() if result.returncode != 0 else None\n        )\n```\n\n---\n\n## 4. Browser Automation\n\n### 4.1 Browser Tool Pattern\n\n```python\nclass BrowserTool:\n    \"\"\"\n    Browser automation for agents using Playwright\u002FPuppeteer.\n    Enables visual debugging and web testing.\n    \"\"\"\n\n    def __init__(self, headless: bool = True):\n        self.browser = None\n        self.page = None\n        self.headless = headless\n\n    async def open_url(self, url: str) -> ToolResult:\n        \"\"\"Navigate to URL and return page info\"\"\"\n        if not self.browser:\n            self.browser = await playwright.chromium.launch(headless=self.headless)\n            self.page = await self.browser.new_page()\n\n        await self.page.goto(url)\n\n        # Capture state\n        screenshot = await self.page.screenshot(type='png')\n        title = await self.page.title()\n\n        return ToolResult(\n            success=True,\n            output=f\"Loaded: {title}\",\n            metadata={\n                \"screenshot\": base64.b64encode(screenshot).decode(),\n                \"url\": self.page.url\n            }\n        )\n\n    async def click(self, selector: str) -> ToolResult:\n        \"\"\"Click on an element\"\"\"\n        try:\n            await self.page.click(selector, timeout=5000)\n            await self.page.wait_for_load_state(\"networkidle\")\n\n            screenshot = await self.page.screenshot()\n            return ToolResult(\n                success=True,\n                output=f\"Clicked: {selector}\",\n                metadata={\"screenshot\": base64.b64encode(screenshot).decode()}\n            )\n        except TimeoutError:\n            return ToolResult(\n                success=False,\n                error=f\"Element not found: {selector}\"\n            )\n\n    async def type_text(self, selector: str, text: str) -> ToolResult:\n        \"\"\"Type text into an input\"\"\"\n        await self.page.fill(selector, text)\n        return ToolResult(success=True, output=f\"Typed into {selector}\")\n\n    async def get_page_content(self) -> ToolResult:\n        \"\"\"Get accessible text content of the page\"\"\"\n        content = await self.page.evaluate(\"\"\"\n            () => {\n                \u002F\u002F Get visible text\n                const walker = document.createTreeWalker(\n                    document.body,\n                    NodeFilter.SHOW_TEXT,\n                    null,\n                    false\n                );\n\n                let text = '';\n                while (walker.nextNode()) {\n                    const node = walker.currentNode;\n                    if (node.textContent.trim()) {\n                        text += node.textContent.trim() + '\\\\n';\n                    }\n                }\n                return text;\n            }\n        \"\"\")\n        return ToolResult(success=True, output=content)\n```\n\n### 4.2 Visual Agent Pattern\n\n```python\nclass VisualAgent:\n    \"\"\"\n    Agent that uses screenshots to understand web pages.\n    Can identify elements visually without selectors.\n    \"\"\"\n\n    def __init__(self, llm, browser):\n        self.llm = llm\n        self.browser = browser\n\n    async def describe_page(self) -> str:\n        \"\"\"Use vision model to describe current page\"\"\"\n        screenshot = await self.browser.screenshot()\n\n        response = self.llm.chat([\n            {\n                \"role\": \"user\",\n                \"content\": [\n                    {\"type\": \"text\", \"text\": \"Describe this webpage. List all interactive elements you see.\"},\n                    {\"type\": \"image\", \"data\": screenshot}\n                ]\n            }\n        ])\n\n        return response.content\n\n    async def find_and_click(self, description: str) -> ToolResult:\n        \"\"\"Find element by visual description and click it\"\"\"\n        screenshot = await self.browser.screenshot()\n\n        # Ask vision model to find element\n        response = self.llm.chat([\n            {\n                \"role\": \"user\",\n                \"content\": [\n                    {\n                        \"type\": \"text\",\n                        \"text\": f\"\"\"\n                        Find the element matching: \"{description}\"\n                        Return the approximate coordinates as JSON: {{\"x\": number, \"y\": number}}\n                        \"\"\"\n                    },\n                    {\"type\": \"image\", \"data\": screenshot}\n                ]\n            }\n        ])\n\n        coords = json.loads(response.content)\n        await self.browser.page.mouse.click(coords[\"x\"], coords[\"y\"])\n\n        return ToolResult(success=True, output=f\"Clicked at ({coords['x']}, {coords['y']})\")\n```\n\n---\n\n## 5. Context Management\n\n### 5.1 Context Injection Patterns\n\n````python\nclass ContextManager:\n    \"\"\"\n    Manage context provided to the agent.\n    Inspired by Cline's @-mention patterns.\n    \"\"\"\n\n    def __init__(self, workspace: str):\n        self.workspace = workspace\n        self.context = []\n\n    def add_file(self, path: str) -> None:\n        \"\"\"@file - Add file contents to context\"\"\"\n        with open(path, 'r') as f:\n            content = f.read()\n\n        self.context.append({\n            \"type\": \"file\",\n            \"path\": path,\n            \"content\": content\n        })\n\n    def add_folder(self, path: str, max_files: int = 20) -> None:\n        \"\"\"@folder - Add all files in folder\"\"\"\n        for root, dirs, files in os.walk(path):\n            for file in files[:max_files]:\n                file_path = os.path.join(root, file)\n                self.add_file(file_path)\n\n    def add_url(self, url: str) -> None:\n        \"\"\"@url - Fetch and add URL content\"\"\"\n        response = requests.get(url)\n        content = html_to_markdown(response.text)\n\n        self.context.append({\n            \"type\": \"url\",\n            \"url\": url,\n            \"content\": content\n        })\n\n    def add_problems(self, diagnostics: list) -> None:\n        \"\"\"@problems - Add IDE diagnostics\"\"\"\n        self.context.append({\n            \"type\": \"diagnostics\",\n            \"problems\": diagnostics\n        })\n\n    def format_for_prompt(self) -> str:\n        \"\"\"Format all context for LLM prompt\"\"\"\n        parts = []\n        for item in self.context:\n            if item[\"type\"] == \"file\":\n                parts.append(f\"## File: {item['path']}\\n```\\n{item['content']}\\n```\")\n            elif item[\"type\"] == \"url\":\n                parts.append(f\"## URL: {item['url']}\\n{item['content']}\")\n            elif item[\"type\"] == \"diagnostics\":\n                parts.append(f\"## Problems:\\n{json.dumps(item['problems'], indent=2)}\")\n\n        return \"\\n\\n\".join(parts)\n````\n\n### 5.2 Checkpoint\u002FResume\n\n```python\nclass CheckpointManager:\n    \"\"\"\n    Save and restore agent state for long-running tasks.\n    \"\"\"\n\n    def __init__(self, storage_dir: str):\n        self.storage_dir = storage_dir\n        os.makedirs(storage_dir, exist_ok=True)\n\n    def save_checkpoint(self, session_id: str, state: dict) -> str:\n        \"\"\"Save current agent state\"\"\"\n        checkpoint = {\n            \"timestamp\": datetime.now().isoformat(),\n            \"session_id\": session_id,\n            \"history\": state[\"history\"],\n            \"context\": state[\"context\"],\n            \"workspace_state\": self._capture_workspace(state[\"workspace\"]),\n            \"metadata\": state.get(\"metadata\", {})\n        }\n\n        path = os.path.join(self.storage_dir, f\"{session_id}.json\")\n        with open(path, 'w') as f:\n            json.dump(checkpoint, f, indent=2)\n\n        return path\n\n    def restore_checkpoint(self, checkpoint_path: str) -> dict:\n        \"\"\"Restore agent state from checkpoint\"\"\"\n        with open(checkpoint_path, 'r') as f:\n            checkpoint = json.load(f)\n\n        return {\n            \"history\": checkpoint[\"history\"],\n            \"context\": checkpoint[\"context\"],\n            \"workspace\": self._restore_workspace(checkpoint[\"workspace_state\"]),\n            \"metadata\": checkpoint[\"metadata\"]\n        }\n\n    def _capture_workspace(self, workspace: str) -> dict:\n        \"\"\"Capture relevant workspace state\"\"\"\n        # Git status, file hashes, etc.\n        return {\n            \"git_ref\": subprocess.getoutput(f\"cd {workspace} && git rev-parse HEAD\"),\n            \"git_dirty\": subprocess.getoutput(f\"cd {workspace} && git status --porcelain\")\n        }\n```\n\n---\n\n## 6. MCP (Model Context Protocol) Integration\n\n### 6.1 MCP Server Pattern\n\n```python\nfrom mcp import Server, Tool\n\nclass MCPAgent:\n    \"\"\"\n    Agent that can dynamically discover and use MCP tools.\n    'Add a tool that...' pattern from Cline.\n    \"\"\"\n\n    def __init__(self, llm):\n        self.llm = llm\n        self.mcp_servers = {}\n        self.available_tools = {}\n\n    def connect_server(self, name: str, config: dict) -> None:\n        \"\"\"Connect to an MCP server\"\"\"\n        server = Server(config)\n        self.mcp_servers[name] = server\n\n        # Discover tools\n        tools = server.list_tools()\n        for tool in tools:\n            self.available_tools[tool.name] = {\n                \"server\": name,\n                \"schema\": tool.schema\n            }\n\n    async def create_tool(self, description: str) -> str:\n        \"\"\"\n        Create a new MCP server based on user description.\n        'Add a tool that fetches Jira tickets'\n        \"\"\"\n        # Generate MCP server code\n        code = self.llm.generate(f\"\"\"\n        Create a Python MCP server with a tool that does:\n        {description}\n\n        Use the FastMCP framework. Include proper error handling.\n        Return only the Python code.\n        \"\"\")\n\n        # Save and install\n        server_name = self._extract_name(description)\n        path = f\".\u002Fmcp_servers\u002F{server_name}\u002Fserver.py\"\n\n        with open(path, 'w') as f:\n            f.write(code)\n\n        # Hot-reload\n        self.connect_server(server_name, {\"path\": path})\n\n        return f\"Created tool: {server_name}\"\n```\n\n---\n\n## Best Practices Checklist\n\n### Agent Design\n\n- [ ] Clear task decomposition\n- [ ] Appropriate tool granularity\n- [ ] Error handling at each step\n- [ ] Progress visibility to user\n\n### Safety\n\n- [ ] Permission system implemented\n- [ ] Dangerous operations blocked\n- [ ] Sandbox for untrusted code\n- [ ] Audit logging enabled\n\n### UX\n\n- [ ] Approval UI is clear\n- [ ] Progress updates provided\n- [ ] Undo\u002Frollback available\n- [ ] Explanation of actions\n\n---\n\n## Resources\n\n- [Cline](https:\u002F\u002Fgithub.com\u002Fcline\u002Fcline)\n- [OpenAI Codex](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fcodex)\n- [Model Context Protocol](https:\u002F\u002Fmodelcontextprotocol.io\u002F)\n- [Anthropic Tool Use](https:\u002F\u002Fdocs.anthropic.com\u002Fclaude\u002Fdocs\u002Ftool-use)\n","# ?️ Autonomous Agent Patterns\n\n> Design patterns for building autonomous coding agents, inspired by [Cline](https:\u002F\u002Fgithub.com\u002Fcline\u002Fcline) and [OpenAI Codex](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fcodex).\n\n## When to Use This Skill\n\nUse this skill when:\n\n- Building autonomous AI agents\n- Designing tool\u002Ffunction calling APIs\n- Implementing permission and approval systems\n- Creating browser automation for agents\n- Designing human-in-the-loop workflows\n\n---\n\n## 1. Core Agent Architecture\n\n### 1.1 Agent Loop\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                     AGENT LOOP                               │\n│                                                              │\n│  ┌──────────┐    ┌──────────┐    ┌──────────┐              │\n│  │  Think   │───▶│  Decide  │───▶│   Act    │              │\n│  │ (Reason) │    │ (Plan)   │    │ (Execute)│              │\n│  └──────────┘    └──────────┘    └──────────┘              │\n│       ▲                               │                     │\n│       │         ┌──────────┐          │                     │\n│       └─────────│ Observe  │◀─────────┘                     │\n│                 │ (Result) │                                │\n│                 └──────────┘                                │\n└─────────────────────────────────────────────────────────────┘\n```\n\n```python\nclass AgentLoop:\n    def __init__(self, llm, tools, max_iterations=50):\n        self.llm = llm\n        self.tools = {t.name: t for t in tools}\n        self.max_iterations = max_iterations\n        self.history = []\n\n    def run(self, task: str) -> str:\n        self.history.append({\"role\": \"user\", \"content\": task})\n\n        for i in range(self.max_iterations):\n            # Think: Get LLM response with tool options\n            response = self.llm.chat(\n                messages=self.history,\n                tools=self._format_tools(),\n                tool_choice=\"auto\"\n            )\n\n            # Decide: Check if agent wants to use a tool\n            if response.tool_calls:\n                for tool_call in response.tool_calls:\n                    # Act: Execute the tool\n                    result = self._execute_tool(tool_call)\n\n                    # Observe: Add result to history\n                    self.history.append({\n                        \"role\": \"tool\",\n                        \"tool_call_id\": tool_call.id,\n                        \"content\": str(result)\n                    })\n            else:\n                # No more tool calls = task complete\n                return response.content\n\n        return \"Max iterations reached\"\n\n    def _execute_tool(self, tool_call) -> Any:\n        tool = self.tools[tool_call.name]\n        args = json.loads(tool_call.arguments)\n        return tool.execute(**args)\n```\n\n### 1.2 Multi-Model Architecture\n\n```python\nclass MultiModelAgent:\n    \"\"\"\n    Use different models for different purposes:\n    - Fast model for planning\n    - Powerful model for complex reasoning\n    - Specialized model for code generation\n    \"\"\"\n\n    def __init__(self):\n        self.models = {\n            \"fast\": \"gpt-3.5-turbo\",      # Quick decisions\n            \"smart\": \"gpt-4-turbo\",        # Complex reasoning\n            \"code\": \"claude-3-sonnet\",     # Code generation\n        }\n\n    def select_model(self, task_type: str) -> str:\n        if task_type == \"planning\":\n            return self.models[\"fast\"]\n        elif task_type == \"analysis\":\n            return self.models[\"smart\"]\n        elif task_type == \"code\":\n            return self.models[\"code\"]\n        return self.models[\"smart\"]\n```\n\n---\n\n## 2. Tool Design Patterns\n\n### 2.1 Tool Schema\n\n```python\nclass Tool:\n    \"\"\"Base class for agent tools\"\"\"\n\n    @property\n    def schema(self) -> dict:\n        \"\"\"JSON Schema for the tool\"\"\"\n        return {\n            \"name\": self.name,\n            \"description\": self.description,\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": self._get_parameters(),\n                \"required\": self._get_required()\n            }\n        }\n\n    def execute(self, **kwargs) -> ToolResult:\n        \"\"\"Execute the tool and return result\"\"\"\n        raise NotImplementedError\n\nclass ReadFileTool(Tool):\n    name = \"read_file\"\n    description = \"Read the contents of a file from the filesystem\"\n\n    def _get_parameters(self):\n        return {\n            \"path\": {\n                \"type\": \"string\",\n                \"description\": \"Absolute path to the file\"\n            },\n            \"start_line\": {\n                \"type\": \"integer\",\n                \"description\": \"Line to start reading from (1-indexed)\"\n            },\n            \"end_line\": {\n                \"type\": \"integer\",\n                \"description\": \"Line to stop reading at (inclusive)\"\n            }\n        }\n\n    def _get_required(self):\n        return [\"path\"]\n\n    def execute(self, path: str, start_line: int = None, end_line: int = None) -> ToolResult:\n        try:\n            with open(path, 'r') as f:\n                lines = f.readlines()\n\n            if start_line and end_line:\n                lines = lines[start_line-1:end_line]\n\n            return ToolResult(\n                success=True,\n                output=\"\".join(lines)\n            )\n        except FileNotFoundError:\n            return ToolResult(\n                success=False,\n                error=f\"File not found: {path}\"\n            )\n```\n\n### 2.2 Essential Agent Tools\n\n```python\nCODING_AGENT_TOOLS = {\n    # File operations\n    \"read_file\": \"Read file contents\",\n    \"write_file\": \"Create or overwrite a file\",\n    \"edit_file\": \"Make targeted edits to a file\",\n    \"list_directory\": \"List files and folders\",\n    \"search_files\": \"Search for files by pattern\",\n\n    # Code understanding\n    \"search_code\": \"Search for code patterns (grep)\",\n    \"get_definition\": \"Find function\u002Fclass definition\",\n    \"get_references\": \"Find all references to a symbol\",\n\n    # Terminal\n    \"run_command\": \"Execute a shell command\",\n    \"read_output\": \"Read command output\",\n    \"send_input\": \"Send input to running command\",\n\n    # Browser (optional)\n    \"open_browser\": \"Open URL in browser\",\n    \"click_element\": \"Click on page element\",\n    \"type_text\": \"Type text into input\",\n    \"screenshot\": \"Capture screenshot\",\n\n    # Context\n    \"ask_user\": \"Ask the user a question\",\n    \"search_web\": \"Search the web for information\"\n}\n```\n\n### 2.3 Edit Tool Design\n\n```python\nclass EditFileTool(Tool):\n    \"\"\"\n    Precise file editing with conflict detection.\n    Uses search\u002Freplace pattern for reliable edits.\n    \"\"\"\n\n    name = \"edit_file\"\n    description = \"Edit a file by replacing specific content\"\n\n    def execute(\n        self,\n        path: str,\n        search: str,\n        replace: str,\n        expected_occurrences: int = 1\n    ) -> ToolResult:\n        \"\"\"\n        Args:\n            path: File to edit\n            search: Exact text to find (must match exactly, including whitespace)\n            replace: Text to replace with\n            expected_occurrences: How many times search should appear (validation)\n        \"\"\"\n        with open(path, 'r') as f:\n            content = f.read()\n\n        # Validate\n        actual_occurrences = content.count(search)\n        if actual_occurrences != expected_occurrences:\n            return ToolResult(\n                success=False,\n                error=f\"Expected {expected_occurrences} occurrences, found {actual_occurrences}\"\n            )\n\n        if actual_occurrences == 0:\n            return ToolResult(\n                success=False,\n                error=\"Search text not found in file\"\n            )\n\n        # Apply edit\n        new_content = content.replace(search, replace)\n\n        with open(path, 'w') as f:\n            f.write(new_content)\n\n        return ToolResult(\n            success=True,\n            output=f\"Replaced {actual_occurrences} occurrence(s)\"\n        )\n```\n\n---\n\n## 3. Permission & Safety Patterns\n\n### 3.1 Permission Levels\n\n```python\nclass PermissionLevel(Enum):\n    # Fully automatic - no user approval needed\n    AUTO = \"auto\"\n\n    # Ask once per session\n    ASK_ONCE = \"ask_once\"\n\n    # Ask every time\n    ASK_EACH = \"ask_each\"\n\n    # Never allow\n    NEVER = \"never\"\n\nPERMISSION_CONFIG = {\n    # Low risk - can auto-approve\n    \"read_file\": PermissionLevel.AUTO,\n    \"list_directory\": PermissionLevel.AUTO,\n    \"search_code\": PermissionLevel.AUTO,\n\n    # Medium risk - ask once\n    \"write_file\": PermissionLevel.ASK_ONCE,\n    \"edit_file\": PermissionLevel.ASK_ONCE,\n\n    # High risk - ask each time\n    \"run_command\": PermissionLevel.ASK_EACH,\n    \"delete_file\": PermissionLevel.ASK_EACH,\n\n    # Dangerous - never auto-approve\n    \"sudo_command\": PermissionLevel.NEVER,\n    \"format_disk\": PermissionLevel.NEVER\n}\n```\n\n### 3.2 Approval UI Pattern\n\n```python\nclass ApprovalManager:\n    def __init__(self, ui, config):\n        self.ui = ui\n        self.config = config\n        self.session_approvals = {}\n\n    def request_approval(self, tool_name: str, args: dict) -> bool:\n        level = self.config.get(tool_name, PermissionLevel.ASK_EACH)\n\n        if level == PermissionLevel.AUTO:\n            return True\n\n        if level == PermissionLevel.NEVER:\n            self.ui.show_error(f\"Tool '{tool_name}' is not allowed\")\n            return False\n\n        if level == PermissionLevel.ASK_ONCE:\n            if tool_name in self.session_approvals:\n                return self.session_approvals[tool_name]\n\n        # Show approval dialog\n        approved = self.ui.show_approval_dialog(\n            tool=tool_name,\n            args=args,\n            risk_level=self._assess_risk(tool_name, args)\n        )\n\n        if level == PermissionLevel.ASK_ONCE:\n            self.session_approvals[tool_name] = approved\n\n        return approved\n\n    def _assess_risk(self, tool_name: str, args: dict) -> str:\n        \"\"\"Analyze specific call for risk level\"\"\"\n        if tool_name == \"run_command\":\n            cmd = args.get(\"command\", \"\")\n            if any(danger in cmd for danger in [\"rm -rf\", \"sudo\", \"chmod\"]):\n                return \"HIGH\"\n        return \"MEDIUM\"\n```\n\n### 3.3 Sandboxing\n\n```python\nclass SandboxedExecution:\n    \"\"\"\n    Execute code\u002Fcommands in isolated environment\n    \"\"\"\n\n    def __init__(self, workspace_dir: str):\n        self.workspace = workspace_dir\n        self.allowed_commands = [\"npm\", \"python\", \"node\", \"git\", \"ls\", \"cat\"]\n        self.blocked_paths = [\"\u002Fetc\", \"\u002Fusr\", \"\u002Fbin\", os.path.expanduser(\"~\")]\n\n    def validate_path(self, path: str) -> bool:\n        \"\"\"Ensure path is within workspace\"\"\"\n        real_path = os.path.realpath(path)\n        workspace_real = os.path.realpath(self.workspace)\n        return real_path.startswith(workspace_real)\n\n    def validate_command(self, command: str) -> bool:\n        \"\"\"Check if command is allowed\"\"\"\n        cmd_parts = shlex.split(command)\n        if not cmd_parts:\n            return False\n\n        base_cmd = cmd_parts[0]\n        return base_cmd in self.allowed_commands\n\n    def execute_sandboxed(self, command: str) -> ToolResult:\n        if not self.validate_command(command):\n            return ToolResult(\n                success=False,\n                error=f\"Command not allowed: {command}\"\n            )\n\n        # Execute in isolated environment\n        result = subprocess.run(\n            command,\n            shell=True,\n            cwd=self.workspace,\n            capture_output=True,\n            timeout=30,\n            env={\n                **os.environ,\n                \"HOME\": self.workspace,  # Isolate home directory\n            }\n        )\n\n        return ToolResult(\n            success=result.returncode == 0,\n            output=result.stdout.decode(),\n            error=result.stderr.decode() if result.returncode != 0 else None\n        )\n```\n\n---\n\n## 4. Browser Automation\n\n### 4.1 Browser Tool Pattern\n\n```python\nclass BrowserTool:\n    \"\"\"\n    Browser automation for agents using Playwright\u002FPuppeteer.\n    Enables visual debugging and web testing.\n    \"\"\"\n\n    def __init__(self, headless: bool = True):\n        self.browser = None\n        self.page = None\n        self.headless = headless\n\n    async def open_url(self, url: str) -> ToolResult:\n        \"\"\"Navigate to URL and return page info\"\"\"\n        if not self.browser:\n            self.browser = await playwright.chromium.launch(headless=self.headless)\n            self.page = await self.browser.new_page()\n\n        await self.page.goto(url)\n\n        # Capture state\n        screenshot = await self.page.screenshot(type='png')\n        title = await self.page.title()\n\n        return ToolResult(\n            success=True,\n            output=f\"Loaded: {title}\",\n            metadata={\n                \"screenshot\": base64.b64encode(screenshot).decode(),\n                \"url\": self.page.url\n            }\n        )\n\n    async def click(self, selector: str) -> ToolResult:\n        \"\"\"Click on an element\"\"\"\n        try:\n            await self.page.click(selector, timeout=5000)\n            await self.page.wait_for_load_state(\"networkidle\")\n\n            screenshot = await self.page.screenshot()\n            return ToolResult(\n                success=True,\n                output=f\"Clicked: {selector}\",\n                metadata={\"screenshot\": base64.b64encode(screenshot).decode()}\n            )\n        except TimeoutError:\n            return ToolResult(\n                success=False,\n                error=f\"Element not found: {selector}\"\n            )\n\n    async def type_text(self, selector: str, text: str) -> ToolResult:\n        \"\"\"Type text into an input\"\"\"\n        await self.page.fill(selector, text)\n        return ToolResult(success=True, output=f\"Typed into {selector}\")\n\n    async def get_page_content(self) -> ToolResult:\n        \"\"\"Get accessible text content of the page\"\"\"\n        content = await self.page.evaluate(\"\"\"\n            () => {\n                \u002F\u002F Get visible text\n                const walker = document.createTreeWalker(\n                    document.body,\n                    NodeFilter.SHOW_TEXT,\n                    null,\n                    false\n                );\n\n                let text = '';\n                while (walker.nextNode()) {\n                    const node = walker.currentNode;\n                    if (node.textContent.trim()) {\n                        text += node.textContent.trim() + '\\\\n';\n                    }\n                }\n                return text;\n            }\n        \"\"\")\n        return ToolResult(success=True, output=content)\n```\n\n### 4.2 Visual Agent Pattern\n\n```python\nclass VisualAgent:\n    \"\"\"\n    Agent that uses screenshots to understand web pages.\n    Can identify elements visually without selectors.\n    \"\"\"\n\n    def __init__(self, llm, browser):\n        self.llm = llm\n        self.browser = browser\n\n    async def describe_page(self) -> str:\n        \"\"\"Use vision model to describe current page\"\"\"\n        screenshot = await self.browser.screenshot()\n\n        response = self.llm.chat([\n            {\n                \"role\": \"user\",\n                \"content\": [\n                    {\"type\": \"text\", \"text\": \"Describe this webpage. List all interactive elements you see.\"},\n                    {\"type\": \"image\", \"data\": screenshot}\n                ]\n            }\n        ])\n\n        return response.content\n\n    async def find_and_click(self, description: str) -> ToolResult:\n        \"\"\"Find element by visual description and click it\"\"\"\n        screenshot = await self.browser.screenshot()\n\n        # Ask vision model to find element\n        response = self.llm.chat([\n            {\n                \"role\": \"user\",\n                \"content\": [\n                    {\n                        \"type\": \"text\",\n                        \"text\": f\"\"\"\n                        Find the element matching: \"{description}\"\n                        Return the approximate coordinates as JSON: {{\"x\": number, \"y\": number}}\n                        \"\"\"\n                    },\n                    {\"type\": \"image\", \"data\": screenshot}\n                ]\n            }\n        ])\n\n        coords = json.loads(response.content)\n        await self.browser.page.mouse.click(coords[\"x\"], coords[\"y\"])\n\n        return ToolResult(success=True, output=f\"Clicked at ({coords['x']}, {coords['y']})\")\n```\n\n---\n\n## 5. Context Management\n\n### 5.1 Context Injection Patterns\n\n````python\nclass ContextManager:\n    \"\"\"\n    Manage context provided to the agent.\n    Inspired by Cline's @-mention patterns.\n    \"\"\"\n\n    def __init__(self, workspace: str):\n        self.workspace = workspace\n        self.context = []\n\n    def add_file(self, path: str) -> None:\n        \"\"\"@file - Add file contents to context\"\"\"\n        with open(path, 'r') as f:\n            content = f.read()\n\n        self.context.append({\n            \"type\": \"file\",\n            \"path\": path,\n            \"content\": content\n        })\n\n    def add_folder(self, path: str, max_files: int = 20) -> None:\n        \"\"\"@folder - Add all files in folder\"\"\"\n        for root, dirs, files in os.walk(path):\n            for file in files[:max_files]:\n                file_path = os.path.join(root, file)\n                self.add_file(file_path)\n\n    def add_url(self, url: str) -> None:\n        \"\"\"@url - Fetch and add URL content\"\"\"\n        response = requests.get(url)\n        content = html_to_markdown(response.text)\n\n        self.context.append({\n            \"type\": \"url\",\n            \"url\": url,\n            \"content\": content\n        })\n\n    def add_problems(self, diagnostics: list) -> None:\n        \"\"\"@problems - Add IDE diagnostics\"\"\"\n        self.context.append({\n            \"type\": \"diagnostics\",\n            \"problems\": diagnostics\n        })\n\n    def format_for_prompt(self) -> str:\n        \"\"\"Format all context for LLM prompt\"\"\"\n        parts = []\n        for item in self.context:\n            if item[\"type\"] == \"file\":\n                parts.append(f\"## File: {item['path']}\\n```\\n{item['content']}\\n```\")\n            elif item[\"type\"] == \"url\":\n                parts.append(f\"## URL: {item['url']}\\n{item['content']}\")\n            elif item[\"type\"] == \"diagnostics\":\n                parts.append(f\"## Problems:\\n{json.dumps(item['problems'], indent=2)}\")\n\n        return \"\\n\\n\".join(parts)\n````\n\n### 5.2 Checkpoint\u002FResume\n\n```python\nclass CheckpointManager:\n    \"\"\"\n    Save and restore agent state for long-running tasks.\n    \"\"\"\n\n    def __init__(self, storage_dir: str):\n        self.storage_dir = storage_dir\n        os.makedirs(storage_dir, exist_ok=True)\n\n    def save_checkpoint(self, session_id: str, state: dict) -> str:\n        \"\"\"Save current agent state\"\"\"\n        checkpoint = {\n            \"timestamp\": datetime.now().isoformat(),\n            \"session_id\": session_id,\n            \"history\": state[\"history\"],\n            \"context\": state[\"context\"],\n            \"workspace_state\": self._capture_workspace(state[\"workspace\"]),\n            \"metadata\": state.get(\"metadata\", {})\n        }\n\n        path = os.path.join(self.storage_dir, f\"{session_id}.json\")\n        with open(path, 'w') as f:\n            json.dump(checkpoint, f, indent=2)\n\n        return path\n\n    def restore_checkpoint(self, checkpoint_path: str) -> dict:\n        \"\"\"Restore agent state from checkpoint\"\"\"\n        with open(checkpoint_path, 'r') as f:\n            checkpoint = json.load(f)\n\n        return {\n            \"history\": checkpoint[\"history\"],\n            \"context\": checkpoint[\"context\"],\n            \"workspace\": self._restore_workspace(checkpoint[\"workspace_state\"]),\n            \"metadata\": checkpoint[\"metadata\"]\n        }\n\n    def _capture_workspace(self, workspace: str) -> dict:\n        \"\"\"Capture relevant workspace state\"\"\"\n        # Git status, file hashes, etc.\n        return {\n            \"git_ref\": subprocess.getoutput(f\"cd {workspace} && git rev-parse HEAD\"),\n            \"git_dirty\": subprocess.getoutput(f\"cd {workspace} && git status --porcelain\")\n        }\n```\n\n---\n\n## 6. MCP (Model Context Protocol) Integration\n\n### 6.1 MCP Server Pattern\n\n```python\nfrom mcp import Server, Tool\n\nclass MCPAgent:\n    \"\"\"\n    Agent that can dynamically discover and use MCP tools.\n    'Add a tool that...' pattern from Cline.\n    \"\"\"\n\n    def __init__(self, llm):\n        self.llm = llm\n        self.mcp_servers = {}\n        self.available_tools = {}\n\n    def connect_server(self, name: str, config: dict) -> None:\n        \"\"\"Connect to an MCP server\"\"\"\n        server = Server(config)\n        self.mcp_servers[name] = server\n\n        # Discover tools\n        tools = server.list_tools()\n        for tool in tools:\n            self.available_tools[tool.name] = {\n                \"server\": name,\n                \"schema\": tool.schema\n            }\n\n    async def create_tool(self, description: str) -> str:\n        \"\"\"\n        Create a new MCP server based on user description.\n        'Add a tool that fetches Jira tickets'\n        \"\"\"\n        # Generate MCP server code\n        code = self.llm.generate(f\"\"\"\n        Create a Python MCP server with a tool that does:\n        {description}\n\n        Use the FastMCP framework. Include proper error handling.\n        Return only the Python code.\n        \"\"\")\n\n        # Save and install\n        server_name = self._extract_name(description)\n        path = f\".\u002Fmcp_servers\u002F{server_name}\u002Fserver.py\"\n\n        with open(path, 'w') as f:\n            f.write(code)\n\n        # Hot-reload\n        self.connect_server(server_name, {\"path\": path})\n\n        return f\"Created tool: {server_name}\"\n```\n\n---\n\n## Best Practices Checklist\n\n### Agent Design\n\n- [ ] Clear task decomposition\n- [ ] Appropriate tool granularity\n- [ ] Error handling at each step\n- [ ] Progress visibility to user\n\n### Safety\n\n- [ ] Permission system implemented\n- [ ] Dangerous operations blocked\n- [ ] Sandbox for untrusted code\n- [ ] Audit logging enabled\n\n### UX\n\n- [ ] Approval UI is clear\n- [ ] Progress updates provided\n- [ ] Undo\u002Frollback available\n- [ ] Explanation of actions\n\n---\n\n## Resources\n\n- [Cline](https:\u002F\u002Fgithub.com\u002Fcline\u002Fcline)\n- [OpenAI Codex](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fcodex)\n- [Model Context Protocol](https:\u002F\u002Fmodelcontextprotocol.io\u002F)\n- [Anthropic Tool Use](https:\u002F\u002Fdocs.anthropic.com\u002Fclaude\u002Fdocs\u002Ftool-use)\n",{"name":5,"description":7},"main","34fa6acf794b9a6310d298cbb8fb8c9420a5edcf","cli-tool\u002Fcomponents\u002Fskills\u002Fai-research\u002Fautonomous-agent-patterns",2,"https:\u002F\u002Fgithub.com\u002Ftransaurus\u002Fstaging-davila7-claude-code-templates","https:\u002F\u002Fgithub.com\u002Ftransaurus","Automated works of Page Turner","2026-03-28 10:12:59",{"source":8,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add transaurus\u002Fstaging-davila7-claude-code-templates --skill autonomous-agent-patterns",{"tool":71,"command":72},"bunx","bunx skills add transaurus\u002Fstaging-davila7-claude-code-templates --skill autonomous-agent-patterns",{"tool":74,"command":75},"pnpm","pnpm dlx skills add transaurus\u002Fstaging-davila7-claude-code-templates --skill autonomous-agent-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ftransaurus\u002Fstaging-davila7-claude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fai-research\u002Fautonomous-agent-patterns\u002FSKILL.md",true,[],[80,106,127,149,168,194],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":87,"publishedAt":52},"01M6JMRJR3BE0HGWFWDZSB853S","zapier-make-patterns","No-code automation democratizes workflow building. Zapier and Make (formerly Integromat) let non-developers automate business processes without writing code. But no-code doesn't mean no-complexity - these platforms have their own patterns, pitfalls, and breaking points.  This skill covers when to use which platform, how to build reliable automations, and when to graduate to code-based solutions. Key insight: Zapier optimizes for simplicity and integrations (7000+ apps), Make optimizes for power","https:\u002F\u002Fgithub.com\u002Ftransaurus\u002Fstaging-davila7-claude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fworkflow-automation\u002Fzapier-make-patterns\u002FSKILL.md",[86],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[88,35,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,39,105],"zapier make patterns","make","zapier","writing","workflow","automation","code","integrations","business","use","power","complexity","platform","apps","how to","No-Code","which","spawner",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":52},"01M6JMR8YK6SWPCTG1MCQTMN9S","yeet","Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).","https:\u002F\u002Fgithub.com\u002Ftransaurus\u002Fstaging-davila7-claude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fworkflow-automation\u002Fyeet\u002FSKILL.md",[],[108,113,114,115,116,117,118,119,120,121,122,123,97,124,125,126],"cli","github","commit","pull request","openai","pull","push","flow","open","gh","user","only","stage","github cli",{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":134,"publishedAt":52},"01M6JMQNFE64ZASQK90HARRXW8","workflow-automation","Workflow automation is the infrastructure that makes AI agents reliable. Without durable execution, a network hiccup during a 10-step payment flow means lost money and angry customers. With it, workflows resume exactly where they left off.  This skill covers the platforms (n8n, Temporal, Inngest) and patterns (sequential, parallel, orchestrator-worker) that turn brittle scripts into production-grade automation.  Key insight: The platforms make different tradeoffs. n8n optimizes for accessibility","https:\u002F\u002Fgithub.com\u002Ftransaurus\u002Fstaging-davila7-claude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fworkflow-automation\u002Fworkflow-automation\u002FSKILL.md",[133],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[92,93,135,50,136,49,137,138,139,140,141,142,143,144,145,146,147,148,39,105],"Workflow Automation","accessibility","apache","execution","inngest","parallel","orchestrator","resume","n8n","payment","worker","scripts","temporal","with",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":52},"01M6JMQDYJ0XETERPHGDR3EVGN","trigger-dev","Trigger.dev expert for background jobs, AI workflows, and reliable async execution with excellent developer experience and TypeScript-first design. Use when: trigger.dev, trigger dev, background task, ai background job, long running task.","https:\u002F\u002Fgithub.com\u002Ftransaurus\u002Fstaging-davila7-claude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fworkflow-automation\u002Ftrigger-dev\u002FSKILL.md",[],[156,157,158,38,159,49,160,137,138,161,97,162,163,164,165,166,167,148,39,105],"dev","trigger dev","trigger","typescript","async execution","first","async","developer experience","expert","task","background jobs","long",{"skillNo":169,"name":170,"nameZh":6,"description":171,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":172,"categories":173,"keywords":177,"publishedAt":52},"01M6JMQ5J6KK3GSX9FJCWWK6G6","planning-with-files","Transforms workflow to use Manus-style persistent markdown files for planning, progress tracking, and knowledge storage. Use when starting complex tasks, multi-step projects, research tasks, or when the user mentions planning, organizing work, tracking progress, or wants structured output.","https:\u002F\u002Fgithub.com\u002Ftransaurus\u002Fstaging-davila7-claude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fworkflow-automation\u002Fplanning-with-files\u002FSKILL.md",[174],{"categoryNo":175,"categoryName":176,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",[178,179,180,148,181,92,182,183,184,185,186,187,97,188,189,190,191,192,193,39],"planning with files","planning","files","with files","storage","tasks","markdown","knowledge","projects","work","manus","structured output","progress","transforms","multi","output",{"skillNo":195,"name":196,"nameZh":6,"description":197,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":198,"categories":199,"keywords":204,"publishedAt":52},"01M6JMPWAT60RXXNEC4V9TRBRS","n8n-workflow-patterns","Proven workflow architectural patterns from real n8n workflows. Use when building new workflows, designing workflow structure, choosing workflow patterns, planning workflow architecture, or asking about webhook processing, HTTP API integration, database operations, AI agent workflows, or scheduled tasks.","https:\u002F\u002Fgithub.com\u002Ftransaurus\u002Fstaging-davila7-claude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fworkflow-automation\u002Fn8n\u002Fn8n-workflow-patterns\u002FSKILL.md",[200,203],{"categoryNo":201,"categoryName":202,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[92,205,143,206,35,207,208,49,209,183,179,210,211,212,213,214,215,216,217,218],"n8n workflow patterns","workflow patterns","n8n workflow","ai agent","architecture","database","api","planning workflow","structure","database operations","webhook","processing","http api","scheduled"]