Skip to main content
ClaudeWave
Slash Command3.6k estrellas del repoactualizado yesterday

plan

The /octo:plan command creates strategic execution plans by capturing user intent through structured questions, analyzing requirements, and generating weighted execution strategies without immediately executing them. Plans and intent contracts are saved to files for review, with optional execution available through the /octo:embrace command when the user is ready to proceed.

Instalar en Claude Code
Copiar
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/nyldn/claude-octopus/HEAD/.claude/commands/plan.md -o ~/.claude/commands/plan.md
Después abre una sesión nueva de Claude Code; el slash command carga automáticamente.

plan.md

# Plan - Intelligent Plan Builder

**Creates strategic execution plans based on user intent. Saves plans for review and optional execution with /octo:embrace.**

## Key Behavior

- **Creates plans** - Captures intent, analyzes requirements, generates weighted execution strategy
- **Saves to files** - Stores plan (`.claude/session-plan.md`) and intent contract (`.claude/session-intent.md`)
- **Doesn't execute** - Plans are saved for review; execution requires user confirmation
- **Optional execution** - Can invoke `/octo:embrace` immediately or user can execute later

## 🤖 INSTRUCTIONS FOR CLAUDE

### MANDATORY COMPLIANCE — DO NOT SKIP

**When the user explicitly invokes `/octo:plan`, you MUST execute the structured planning workflow below.** You are PROHIBITED from doing the task directly, skipping the intent capture questions, or deciding the task is "too simple" for structured planning. The user chose this command deliberately — respect that choice.

---

When the user invokes this command (e.g., `/octo:plan <arguments>`):

### Step 1: Capture Comprehensive Intent

**CRITICAL: Start by capturing the user's full intent using structured questions.**

Ask 5 comprehensive questions to understand what they're trying to accomplish:

```javascript
AskUserQuestion({
  questions: [
    {
      question: "What are you ultimately trying to accomplish?",
      header: "Goal",
      multiSelect: false,
      options: [
        {label: "Research a topic", description: "Gather information and options"},
        {label: "Make a decision", description: "Choose between alternatives"},
        {label: "Build something", description: "Create implementation or artifact"},
        {label: "Review/improve existing", description: "Assess and enhance what's there"},
        {label: "I'll describe it", description: "Let me write my own goal"}
      ]
    },
    {
      question: "How much do you already know about this?",
      header: "Knowledge",
      multiSelect: false,
      options: [
        {label: "Just starting", description: "Need to learn the landscape"},
        {label: "Some familiarity", description: "Know basics, need deeper dive"},
        {label: "Well-informed", description: "Know options, need execution"},
        {label: "Expert", description: "Just need implementation/validation"}
      ]
    },
    {
      question: "How clear is the scope?",
      header: "Clarity",
      multiSelect: false,
      options: [
        {label: "Vague idea", description: "Not sure exactly what I need"},
        {label: "General direction", description: "Know the area, need specifics"},
        {label: "Clear requirements", description: "Know what to build"},
        {label: "Fully specified", description: "Have detailed specifications"}
      ]
    },
    {
      question: "What defines success for you?",
      header: "Success",
      multiSelect: true,
      options: [
        {label: "Clear understanding", description: "I know what to do next"},
        {label: "Team alignment", description: "Everyone agrees on approach"},
        {label: "Working solution", description: "Implementation that functions"},
        {label: "Production-ready", description: "Fully tested and validated"}
      ]
    },
    {
      question: "What are your key constraints?",
      header: "Constraints",
      multiSelect: true,
      options: [
        {label: "Time pressure", description: "Need results quickly"},
        {label: "Must fit architecture", description: "Constrained by existing systems"},
        {label: "Team skill set", description: "Limited by team capabilities"},
        {label: "High stakes", description: "Significant risk if wrong"}
      ]
    }
  ]
})
```

**If user selected "I'll describe it" for goal, follow up with:**
```
Can you describe in 1-2 sentences what you're trying to accomplish?
```

### Step 2: Create Intent Contract

**Use the skill-intent-contract system to capture this formally:**

1. Create `.claude/session-intent.md` with:
   - Job statement (what user is trying to accomplish)
   - Success criteria (from their answers)
   - Boundaries (derived from constraints)
   - Context (knowledge level, clarity, constraints)

2. Store answers from the 5 questions in the contract

### Step 3: Analyze and Route (v7.24.0+: Hybrid Planning)

**NEW in v7.24.0:** Intelligent routing between native plan mode and octopus workflows.

#### Native Plan Mode Detection

First, check if native `EnterPlanMode` would be beneficial:

```javascript
// Conditions that favor native plan mode
const nativePlanModePreferred = (
  goal === "Build something" &&
  scope_clarity === "Clear requirements" &&
  knowledge_level === "Well-informed" &&
  !requires_multi_ai &&  // Simple single-phase planning
  !success.includes("Team alignment")  // No multi-perspective needs
)

if (nativePlanModePreferred) {
  // Suggest native plan mode
  AskUserQuestion({
    questions: [{
      question: "Would you like to use native plan mode or multi-AI orchestration?",
      header: "Planning Mode",
      multiSelect: false,
      options: [
        {
          label: "Native plan mode (Recommended)",
          description: "Fast, single-phase planning with Claude. Good for straightforward implementation plans."
        },
        {
          label: "Multi-AI orchestration",
          description: "Research with Codex + Gemini + Claude. Better for complex problems requiring diverse perspectives."
        }
      ]
    }]
  })
}
```

**When to use native EnterPlanMode:**
- ✅ Single-phase planning (just need a plan, no execution)
- ✅ Well-defined requirements
- ✅ Quick architectural decisions
- ✅ When context clearing after planning is OK

**When to use /octo:plan (octopus workflows):**
- ✅ Multi-AI orchestration (Codex + Gemini + Claude)
- ✅ Double Diamond 4-phase execution
- ✅ State needs to persist across sessions
- ✅ Complex intent capture with routing
- ✅ High-stakes decisions requiring multiple perspectives

#### Routing Logic (Octopus