---
name: sop-to-agent
description: Convert any business SOP (Standard Operating Procedure) into an executable AI agent workflow. Turn documented processes into automated agent tasks with error handling and human checkpoints.
metadata: {"openclaw": {"emoji": "🏭", "homepage": "https://github.com/jarvisonclaw/sop-to-agent"}}
---

# SOP-to-Agent 🏭

Convert business SOPs into executable AI agent workflows. The bridge between "how we do things" and "how agents do things."

## When to use

Use this skill when the user wants to:
- Automate a documented business process
- Turn a manual workflow into an agent task
- Create an agent playbook from existing SOPs
- Identify which parts of a process can be automated vs need human oversight
- Build an automation roadmap from existing documentation

## How to invoke

- "Turn this SOP into an agent workflow: [paste or file]"
- "Automate this process: [description]"
- "Which parts of this workflow can an agent handle? [SOP]"
- `/sop-to-agent [file path or pasted SOP]`

## Process

### Step 1: SOP Analysis
Parse the input SOP and identify:
- **Sequential steps** (must happen in order)
- **Parallel steps** (can happen simultaneously)
- **Decision points** (if/then branching)
- **Human-required steps** (judgment calls, approvals, physical actions)
- **Tool requirements** (what systems/APIs are needed)
- **Error scenarios** (what can go wrong at each step)

### Step 2: Automation Classification
Classify each step as:

| Category | Description | Example |
|----------|-------------|---------|
| ✅ **Full Auto** | Agent handles end-to-end | Data lookup, formatting, sending notifications |
| 🔄 **Semi-Auto** | Agent does work, human reviews | Drafting emails, generating reports |
| 🚫 **Human Only** | Requires human judgment/action | Strategic decisions, physical tasks, sensitive approvals |
| ⚡ **Enhance** | Agent assists human in real-time | Research while human decides, suggest options |

### Step 3: Workflow Generation
Output a structured agent workflow:

```markdown
## Agent Workflow: [Process Name]

### Trigger
[What kicks off this workflow]

### Steps
1. [Step name] — [Auto/Semi/Human/Enhance]
   - Action: [What the agent does]
   - Tools: [Required tools/APIs]
   - Input: [What it needs]
   - Output: [What it produces]
   - Error handling: [What to do if it fails]
   - Human checkpoint: [Yes/No — when to pause for review]

### Completion Criteria
[How to know the workflow succeeded]

### Estimated Time Savings
[Manual time vs automated time]
```

### Step 4: Implementation Notes
Provide:
- Which OpenClaw tools/skills are needed
- Any missing integrations or APIs
- Suggested human checkpoint placement
- Risk assessment (what's the blast radius if something goes wrong?)
- Recommended rollout: start with semi-auto, graduate to full auto

## Output Format

Present the full conversion as:

```
📋 SOP ANALYSIS
[Original process summary, N steps identified]

🤖 AUTOMATION ASSESSMENT
→ X steps fully automatable
→ Y steps semi-automatable  
→ Z steps require human action
→ Estimated time savings: N hours/week

🔧 AGENT WORKFLOW
[Full structured workflow]

⚠️ RISKS & SAFEGUARDS
[What could go wrong, how to prevent it]

🚀 ROLLOUT PLAN
[Phase 1: semi-auto → Phase 2: full auto with monitoring → Phase 3: autonomous]
```

## Quality Standards

- [ ] Every step from the original SOP is accounted for
- [ ] Human checkpoints placed at high-risk decision points
- [ ] Error handling defined for each automated step
- [ ] No sensitive operations without human approval
- [ ] Rollout plan is conservative (semi-auto first)
- [ ] Time savings estimate is realistic, not aspirational

## Key Principle

**Automate the boring, supervise the important.** The goal isn't to remove humans — it's to free them from repetitive work so they can focus on decisions that matter. Every workflow should have a human kill switch.
