# SOP Draft Generator Playbook

This playbook automates the creation of Standard Operating Procedures (SOPs) by converting raw process descriptions, loom transcripts, or screen recording notes into structured, professional documentation. It ensures consistency in operations and speeds up team onboarding.

## 1. Prompt Pack

These prompts guide your AI in structuring process knowledge into clear, step-by-step SOPs.

### Core SOP Generation Prompt

```
"You are an Operations Specialist. Your goal is to create a high-quality Standard Operating Procedure (SOP) based on the provided raw process notes or transcript for '[Process Name]'.

Your output must include:
- **Title:** Clear and descriptive.
- **Purpose:** 1-2 sentences explaining why this process exists and the value it provides.
- **Scope:** Who performs this task and when?
- **Prerequisites:** What tools, access, or data are needed before starting?
- **Step-by-Step Instructions:** A numbered list of clear, actionable steps. Break complex tasks into sub-steps.
- **Common Pitfalls/Troubleshooting:** List 2-3 areas where things might go wrong and how to fix them.
- **Definitions:** (If applicable) Clarify any jargon or technical terms.
- **Version Control:** End with 'Last Updated: {YYYY-MM-DD}'.

Save the output as a clean markdown file to memory/sops/[process-name].md."
```

### Prompt Variations:

*   **Video-to-SOP Prompt:**
    ```
    "Analyze this transcript of a screen recording for '[Process Name]'. Extract the underlying workflow. Ignore verbal fillers ('um', 'uh', 'you know') and conversational tangents. Focus only on the sequence of actions required to complete the task."
    ```
*   **Checklist Creator Prompt:**
    ```
    "Using the SOP for '[Process Name]', generate a simplified 'Quick Start Checklist' that an experienced team member can use to ensure no steps are missed without reading the full documentation."
    ```
*   **Gap Analysis Prompt:**
    ```
    "Review this draft SOP for '[Process Name]'. Identify any missing information, logical gaps, or steps that might be confusing for a beginner. Suggest specific additions to make the process foolproof."
    ```

## 2. Setup Guide

To implement the SOP Draft Generator Playbook:

1.  **Save the Playbook:** Save this content as `playbooks/sop-draft-generator.md` in your workspace.
2.  **Create Cron Configuration:** Create `playbooks/sop-draft-generator-cron.json` in your workspace to monitor a process-intake folder.
3.  **Integrate Process Source:**
    *   **Loom/Video Transcripts:** Paste transcripts from your recording tools into a markdown file in the intake folder.
    *   **Voice Memos:** Use a transcription service to convert voice process walkthroughs into text.
    *   **Slack/Discord Threads:** Use the agent to "distill this thread into an SOP."
4.  **Activate Cron Job:** Once the JSON config is added, OpenClaw will start monitoring.
5.  **Review and Approve:** SOPs are living documents. Always have a human expert review the AI-generated draft before moving it to the 'Approved' library.

## 3. Config Snippet

This JSON snippet defines a cron job that watches for new process recordings or notes and drafts an SOP automatically.

```json
{
  "cron": [
    {
      "name": "Automated SOP Drafting",
      "schedule": "0 9 * * *",
      "task": "Check 'inbox/process-dumps/' for any new transcripts or process notes. Use the 'Core SOP Generation Prompt' from the 'SOP Draft Generator Playbook' to create initial drafts. Save them to 'memory/sops/drafts/' and notify the COO for review.",
      "agent": "cmo",
      "model": "gemini-flash"
    }
  ]
}
```

## 4. Permissions Checklist

Your agent needs:

*   **Read Access:**
    *   Intake folder (e.g., `inbox/process-dumps/`).
    *   Existing SOP templates for style matching.
*   **Write Access:**
    *   Draft folder (e.g., `memory/sops/drafts/`).
*   **Execution Permissions:**
    *   Ability to structure and format markdown documents.

## Safety Check (Required)

- Ensure no sensitive credentials or API keys are captured in the SOP instructions.
- SOPs must be reviewed by a human for safety-critical operations (e.g., database deletions, financial transfers).
- Verify that links to external tools within the SOP are current and accessible to the intended users.
