---
name: docs:plan
description: Create a documentation plan based on discovered modules
---

# Plan Documentation

Create an ordered documentation plan based on discovered modules. Run after `/docs:discover`.

**Usage:**
```
/docs:plan                         # Create plan interactively
/docs:plan --auto                  # Auto-generate plan (no prompts)
/docs:plan --show                  # Show existing plan
```

**What it does:**
1. Reads discovered modules from `docs/.knowledge/`
2. Analyzes dependencies and relationships
3. Suggests documentation order (core modules first)
4. Creates `docs/plan.yml` with the plan

**Interactive mode asks:**
- Which modules to include/exclude
- Priority order
- What to document per module (CRUD, specific flows)
- Include error states?

**Output: `docs/plan.yml`**
```yaml
# Documentation Plan
# Generated by /docs:plan

created_at: 2024-01-15
status: pending

modules:
  - name: users
    priority: 1
    reason: "Core module - other modules depend on it"
    document:
      - lifecycle: true
      - include_errors: true
    status: pending

  - name: campaigns
    priority: 2
    reason: "Main feature module"
    document:
      - lifecycle: true
      - flows:
          - "duplicate campaign"
          - "archive campaign"
    status: pending

  - name: orders
    priority: 3
    document:
      - lifecycle: true
    status: pending

cross_module_flows:
  - name: "user registration to first campaign"
    modules: [users, campaigns]
    status: pending
```

**Next step:** Run `/docs:execute` to generate documentation

---

**Execute workflow:** `@.claude/workflows/docs/plan/workflow.md`
