Plan First

v1.0.0

Solve complex multi-step tasks by generating a detailed plan before execution. Based on the Plan-and-Solve prompting research, this skill breaks tasks into c...

0· 98·0 current·0 all-time
bySimon@simoncatbot

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for simoncatbot/plan-first.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Plan First" (simoncatbot/plan-first) from ClawHub.
Skill page: https://clawhub.ai/simoncatbot/plan-first
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install plan-first

ClawHub CLI

Package manager switcher

npx clawhub@latest install plan-first
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name and description match the SKILL.md: the skill teaches a plan-then-execute workflow and provides templates and examples. It declares no binaries, env vars, or installs, which is appropriate for a purely prompting/instructional skill.
Instruction Scope
The runtime instructions are planning-focused and do not tell the agent to read system files, exfiltrate data, or call external endpoints. Examples reference real-world actions (DB migrations, sending email, running CLI tools) — which is expected — but are inherently open-ended: if the agent later executes a plan it generates, that execution could require credentials or run commands. The skill itself does not include execution commands or hidden I/O instructions.
Install Mechanism
No install spec and no code files. Lowest-risk class: nothing is written to disk or downloaded by the skill.
Credentials
No environment variables, credentials, or config paths are requested. Example plans mention services (SMTP, databases, cloud tools) but the skill does not request unrelated secrets or persistent credentials.
Persistence & Privilege
always is false and the skill does not request elevated or persistent privileges. disable-model-invocation is false (the platform default) but this is not combined with other risky indicators here.
Assessment
This skill is coherent and low-risk as-distributed: it's a prompt/template for planning complex tasks and does not by itself access your system or secrets. Before using it in an agent that will execute steps autonomously, review any generated plan carefully and do not supply credentials unless you intend the agent to perform actions that require them. If you want to limit risk, keep this skill user-invocable only (avoid allowing fully autonomous runs), and require human approval before executing any plan steps that perform network calls, modify databases, or run shell commands.

Like a lobster shell, security has layers — review code before you run it.

latestvk975ca28tj7devs8gnj4jty0xd842nv4methodologyvk975ca28tj7devs8gnj4jty0xd842nv4planningvk975ca28tj7devs8gnj4jty0xd842nv4problem-solvingvk975ca28tj7devs8gnj4jty0xd842nv4workflowvk975ca28tj7devs8gnj4jty0xd842nv4
98downloads
0stars
1versions
Updated 3w ago
v1.0.0
MIT-0

Plan First - Structured Problem Solving

Plan First implements the Plan-and-Solve research paradigm for tackling complex tasks systematically.

The core insight: Generative AI performs better when it plans before acting, especially on multi-step tasks where dependencies exist between steps.

The Analogy: Architect vs. Builder

Builder ApproachArchitect Approach (Plan First)
Start building immediatelyDesign blueprints first
Discover problems mid-projectAnticipate issues before they arise
May need to tear down and rebuildBuild correctly the first time
Works for simple structuresEssential for complex projects

When to Use Plan First

Perfect for:

  • 🏗️ Multi-step coding tasks (implement feature X that requires Y, Z, W)
  • 📝 Complex writing (reports, documentation with sections)
  • 🔬 Analysis tasks (data analysis with multiple phases)
  • 🧩 Problem-solving (math, logic, puzzles with steps)
  • 📋 Project planning (breaking down large initiatives)

Skip for:

  • ⚡ Single-step tasks ("What is 2+2?")
  • 🎯 Direct questions ("What is the capital of France?")
  • 🔄 Pure exploration (brainstorming without structure)

The Workflow

Step 1: Generate the Plan

Before ANY execution, create a detailed plan:

TASK: "Build a user authentication system"

PLAN:
1. [SETUP] Initialize database schema for users table
   - Dependencies: None
   - Success criteria: Migration runs without errors

2. [IMPLEMENTATION] Create password hashing utilities
   - Dependencies: Step 1 complete
   - Success criteria: bcrypt integration works

3. [IMPLEMENTATION] Build login endpoint
   - Dependencies: Steps 1, 2
   - Success criteria: Returns JWT on valid credentials

4. [IMPLEMENTATION] Build signup endpoint
   - Dependencies: Steps 1, 2
   - Success criteria: Creates user, returns token

5. [INTEGRATION] Add middleware for protected routes
   - Dependencies: Steps 3, 4
   - Success criteria: Unauthorized requests rejected

6. [TESTING] Write comprehensive tests
   - Dependencies: Steps 3, 4, 5
   - Success criteria: All tests pass

Step 2: Validate the Plan

Self-check before proceeding:

  • Are steps in logical order?
  • Are dependencies clearly marked?
  • Is each step specific and actionable?
  • Are success criteria verifiable?
  • Did I miss any prerequisite steps?

If gaps found: Revise the plan first.

Step 3: Execute Step by Step

Execute ONE step at a time, in order:

Executing Step 1: Initialize database schema
✓ Run: CREATE TABLE users...
✓ Verify: Table exists with correct columns
✓ Mark complete

Executing Step 2: Create password hashing utilities
✓ Run: Implement hash_password(), verify_password()
✓ Verify: Unit tests pass
✓ Mark complete

... continue until all steps complete

Step 4: Handle Deviations

If a step fails:

  1. Analyze why it failed
  2. Revise plan if needed (add missing steps, reorder)
  3. Resume from current step

If requirements change:

  1. Stop execution
  2. Revise remaining plan
  3. Continue with updated plan

Plan Format Template

## Task
[Clear statement of what needs to be done]

## Plan

### Step N: [Action Verb] [What to do]
**Dependencies:** [List prerequisite steps]
**Approach:** [How to accomplish this step]
**Verification:** [How to confirm success]
**Files/Tools:** [What to modify or use]

---

### Step 1: [SETUP/IMPLEMENTATION/ANALYSIS/TESTING] Description
**Dependencies:** None
**Approach:** 
- Detail 1
- Detail 2
**Verification:** [Specific test or check]
**Files:** [Files to create/modify]

### Step 2: ...
[Continue for all steps]

## Risk Analysis
**Potential blockers:** [What could go wrong]
**Mitigation:** [How to handle issues]

## Rollback Plan
**If fails at step N:** [How to undo/reset]

Examples

Example 1: Code Implementation

Task: "Add email verification to signup flow"

## Plan

### Step 1: [SETUP] Create email_tokens table
**Dependencies:** None
**Approach:** 
- Create migration for email_tokens table
- Fields: id, user_id, token, expires_at, used
**Verification:** Migration runs, table structure correct
**Files:** migrations/003_email_tokens.sql

### Step 2: [IMPLEMENTATION] Add email sending utility
**Dependencies:** Step 1
**Approach:**
- Create utils/email.py with send_verification_email()
- Use SMTP or SendGrid
- Include token in email link
**Verification:** Can send test email successfully
**Files:** utils/email.py

### Step 3: [IMPLEMENTATION] Modify signup endpoint
**Dependencies:** Steps 1, 2
**Approach:**
- After user creation, generate token
- Send verification email
- Return "check your email" response
**Verification:** Signup creates token and sends email
**Files:** routes/auth.py

### Step 4: [IMPLEMENTATION] Create verify endpoint
**Dependencies:** Step 1
**Approach:**
- GET /verify-email?token=xxx
- Check token valid and not expired
- Mark user as verified
**Verification:** Clicking link marks user verified
**Files:** routes/auth.py

### Step 5: [INTEGRATION] Add verified check to login
**Dependencies:** Step 4
**Approach:**
- Modify login to require verified=True
- Return appropriate error if unverified
**Verification:** Unverified users can't login
**Files:** routes/auth.py

### Step 6: [TESTING] Write tests
**Dependencies:** Steps 1-5
**Approach:**
- Test signup creates token
- Test email sent
- Test verification works
- Test unverified can't login
**Verification:** All tests pass
**Files:** tests/test_auth.py

Example 2: Writing Task

Task: "Write annual report for engineering team"

## Plan

### Step 1: [ANALYSIS] Gather metrics
**Dependencies:** None
**Approach:**
- Pull deployment frequency from CI/CD
- Get incident data from monitoring
- Collect code review stats
**Verification:** Have all data points needed
**Files:** data/raw_metrics.json

### Step 2: [DRAFTING] Write executive summary
**Dependencies:** Step 1
**Approach:**
- Highlight key achievements
- Include year-over-year comparison
- Keep to 1 page
**Verification:** Covers all major points
**Files:** report/executive_summary.md

### Step 3: [DRAFTING] Write detailed sections
**Dependencies:** Step 2 (for tone consistency)
**Approach:**
- Infrastructure improvements
- Team growth and hiring
- Process optimizations
- Major projects delivered
**Verification:** Each section has data + narrative
**Files:** report/sections/*.md

### Step 4: [INTEGRATION] Compile and format
**Dependencies:** Steps 2, 3
**Approach:**
- Combine sections
- Add table of contents
- Apply company template
**Verification:** Document is complete and formatted
**Files:** report/annual_report_2024.md

### Step 5: [REVIEW] Self-review and polish
**Dependencies:** Step 4
**Approach:**
- Check for typos
- Verify all numbers accurate
- Ensure flow between sections
**Verification:** Ready for stakeholder review
**Files:** [same]

Example 3: Data Analysis

Task: "Analyze customer churn for Q4"

## Plan

### Step 1: [DATA] Extract customer data
**Dependencies:** None
**Approach:**
- Query database for customers active in Q3
- Get their Q4 activity status
- Include subscription tier, signup date
**Verification:** Dataset has expected row count
**Files:** data/customers_q4.csv

### Step 2: [ANALYSIS] Calculate churn rate
**Dependencies:** Step 1
**Approach:**
- Define churn: no activity in Q4
- Calculate overall rate
- Break down by tier, acquisition channel
**Verification:** Numbers match expectations
**Files:** analysis/churn_basic.py

### Step 3: [ANALYSIS] Identify patterns
**Dependencies:** Step 2
**Approach:**
- Time-series analysis of churn
- Correlation with features
- Segment analysis
**Verification:** Charts show clear patterns
**Files:** analysis/churn_patterns.ipynb

### Step 4: [SYNTHESIS] Create recommendations
**Dependencies:** Step 3
**Approach:**
- Based on patterns, propose interventions
- Prioritize by impact/effort
- Include success metrics
**Verification:** Recommendations are actionable
**Files:** report/recommendations.md

### Step 5: [DELIVERY] Create presentation
**Dependencies:** Steps 2, 3, 4
**Approach:**
- Executive summary slide
- Key findings with charts
- Recommendations with impact
**Verification:** Stakeholders can act on it
**Files:** presentation/churn_analysis_q4.pptx

Best Practices

1. Make Steps Concrete

Vague: "Set up authentication" ✅ Concrete: "Create users table with bcrypt password hashing"

2. Define Clear Verification

Every step needs a pass/fail check:

  • "Tests pass"
  • "Database table exists with correct schema"
  • "Can send test email successfully"
  • "Response time < 200ms"

3. Keep Steps Small

Break large steps into smaller ones:

❌ "Build entire API" ✅

  • "Create database schema"
  • "Implement GET endpoint"
  • "Implement POST endpoint"
  • "Add validation"
  • "Write tests"

4. Mark Dependencies Explicitly

This prevents trying to build on foundations that don't exist.

5. Plan for Failure

Include what to do if a step fails:

  • Rollback procedure
  • Alternative approaches
  • When to stop and reassess

Comparison: Direct vs Plan-First

Task: "Build a REST API for todos"

Direct ApproachPlan-First Approach
Start coding endpointsPlan database schema first
Discover need auth laterInclude auth in initial plan
Maybe forget validationExplicit validation step
Inconsistent error handlingDefine error format upfront
Tests added at endTest steps interleaved

When Plans Change

Mid-execution discovery: "Actually we need OAuth, not simple auth"

  1. Stop current execution
  2. Reassess remaining plan
  3. Add OAuth-specific steps
  4. Update dependencies
  5. Resume with revised plan

Don't wing it. Update the plan.

Integration with Other Skills

Plan First + Team Code:

  1. Generate master plan
  2. Delegate parallelizable steps to agents
  3. Execute dependency-aware

Plan First + Self-Critique:

  1. Generate plan
  2. Critique the plan ("Am I missing anything?")
  3. Revise
  4. Execute

Quick Start Template

## Task
[Your task here]

## Plan

### Step 1: [VERB] Description
**Dependencies:** None
**Approach:**
- 
- 
**Verification:** 
**Files:** 

### Step 2: [VERB] Description
**Dependencies:** Step 1
**Approach:**
- 
- 
**Verification:** 
**Files:** 

[Continue...]

## Risk Analysis
**Blockers:** 
**Mitigation:** 

## Rollback
**If fails:** 

References

  • Research: "Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Models" (Wang et al., 2023)
  • Related: Chain-of-Thought (CoT), Tree-of-Thought (ToT), ReAct
  • See references/examples.md for more detailed examples

Comments

Loading comments...