Plan

From fortunto2/solo-factory · View interactive version

Plan is an AI agent skill from the GitHub repository fortunto2/solo-factory. Use when "plan this feature", "create implementation plan", "write a spec", "battle plan", describing a feature/bug/refactor, or need task breakdown before building. Do NOT use for idea validation (/validate) or execution (/build).

How to use this skill

Skill file

/plan

This skill is self-contained — follow the steps below instead of delegating to external planning skills (superpowers, etc.).

Research the codebase and create a spec + phased implementation plan. Zero interactive questions — explores the code instead.

When to use

Creates a track for any feature, bug fix, or refactor with a concrete, file-level implementation plan. Works with or without /setup.

MCP Tools (use if available)

If MCP tools are not available, fall back to Glob + Grep + Read.

Steps

  1. Parse task description from $ARGUMENTS.
  1. Detect context — determine where plan files should be stored:

Project context (normal project with code):

Knowledge base context (documentation-centric project):

Set $PLAN_ROOT based on detected context. All subsequent file paths use $PLAN_ROOT.

  1. Load project context (parallel reads):
  1. Auto-classify track type from keywords in task description:
  1. Research phase — explore the codebase to understand what needs to change:

a. Get architecture overview (if MCP available — do this FIRST):

```

project_info(name="{project name from CLAUDE.md or directory name}")

```

Gives you: stack, languages, directory layers, key patterns, top dependencies, files with the most definitions.

c. Find relevant files — Glob + Grep for patterns related to the task:

d. Precedent retrieval (context graph pattern — search past solutions BEFORE planning):

```

session_search(query="{task description keywords}")

```

Look for: how similar tasks were solved, what went wrong, what patterns worked.

```

kb_search(query="{task type}: {keywords}")

```

Check for: harness patterns, architectural constraints, quality scores.

e. Search code across projects (if MCP available):

```

symbol_search("<words>")

```

f. Check dependencies of affected files — Grep their imports, and Grep for the

module name to find who imports them.

g. Read existing tests in the affected area — understand testing patterns used.

h. Read CLAUDE.md architecture constraints — understand boundaries and conventions.

i. Detect deploy infrastructure — search for deploy scripts/configs to include deploy phase in plan:

```bash

find . -maxdepth 3 \( -name 'deploy.sh' -o -name 'Dockerfile' -o -name 'docker-compose.yml' -o -name 'wrangler.toml' -o -name 'sst.config.ts' \) -type f 2>/dev/null

```

If found, read them to understand deploy targets. Include a deploy phase in the plan with concrete commands.

  1. Detect overlapping plans — before creating a new track, check for existing plans that cover similar scope:

```bash

ls docs/plan//plan.md docs/plan//spec.md 2>/dev/null

```

For each existing plan found:

If overlap detected:

If no overlap: proceed normally.

  1. Generate track ID:
  1. Create track directory:

```bash

mkdir -p $PLAN_ROOT

```

  1. Generate $PLAN_ROOT/spec.md:

Based on research findings, NOT generic questions.

```markdown

# Specification: {Title}

Track ID: {trackId}

Type: {Feature|Bug|Refactor|Chore}

Created: {YYYY-MM-DD}

Status: Draft

## Summary

{1-2 paragraph description based on research}

## Acceptance Criteria

{3-8 criteria based on research findings}

## Dependencies

## Out of Scope

## Technical Notes

```

  1. Generate $PLAN_ROOT/plan.md:

Concrete, file-level plan from research. Keep it tight: 2-4 phases, 5-15 tasks total.

Critical format rules (parsed by /build):

```markdown

# Implementation Plan: {Title}

Track ID: {trackId}

Spec: spec.md

Created: {YYYY-MM-DD}

Status: [ ] Not Started

## Overview

{1-2 sentences on approach}

## Phase 1: {Name}

{brief description of phase goal}

### Tasks

### Verification

## Phase 2: {Name}

### Tasks

### Verification

{2-4 phases total}

## Phase {N-1}: Deploy (if deploy infrastructure exists)

_Include this phase ONLY if the project has deploy scripts/configs (deploy.sh, Dockerfile, docker-compose.yml, wrangler.toml, sst.config.ts, vercel.json). Skip if no deploy infra found._

### Tasks

### Verification

## Phase {N}: Docs & Cleanup

### Tasks

### Verification

## Final Verification

## Context Handoff

_Summary for /build to load at session start — keeps context compact._

### Session Intent

{1 sentence: what this track accomplishes}

### Key Files

{list of files that will be modified, from research}

### Decisions Made

{key architecture decisions from research phase — why X over Y}

### Risks

{known risks or edge cases discovered during research}


_Generated by /plan. Tasks marked [~] in progress and [x] complete by /build._

```

Plan quality rules:

  1. Create progress task list for pipeline visibility:

After writing plan.md, create TaskCreate entries so progress is trackable:

If superpowers:writing-plans skill is available, follow its granularity format: bite-sized tasks (2-5 minutes each), complete code in task descriptions, exact file paths, verification steps per task. This enhances the built-in format above.

  1. Show plan for approval via AskUserQuestion:

Present the spec summary + plan overview. Options:

If "Edit plan": tell user to edit $PLAN_ROOT/plan.md manually, then run /build.

Output

Track created: {trackId}

  Type:   {Feature|Bug|Refactor|Chore}
  Phases: {N}
  Tasks:  {N}
  Spec:   $PLAN_ROOT/spec.md
  Plan:   $PLAN_ROOT/plan.md

Research findings:
  - {key finding 1}
  - {key finding 2}
  - {reusable code found, if any}

Next: /build {trackId}

Rationalizations Catalog

These thoughts mean STOP — you're skipping research:

| Thought | Reality |

|---------|---------|

| "I know this codebase" | You know what you've seen. Search for what you haven't. |

| "The plan is obvious" | Obvious plans miss edge cases. Research first. |

| "Let me just start coding" | 10 minutes of research prevents 2 hours of rework. |

| "This is a small feature" | Small features touch many files. Map the blast radius. |

| "I'll figure it out as I go" | That's not a plan. Write the file paths first. |

| "70 tasks should cover it" | 5-15 tasks. If you need more, split into tracks. |

Compatibility Notes

Common Issues

Plan has too many tasks

Cause: Feature scope too broad or tasks not atomic enough.

Fix: Target 5-15 tasks across 2-4 phases. Split large features into multiple tracks.

Context detection wrong (project vs KB)

Cause: Directory has both code manifests and KB-style directories.

Fix: Project context takes priority if package.json/pyproject.toml exists.

Research phase finds no relevant code

Cause: New project with minimal codebase or MCP tools unavailable.

Fix: Skill falls back to Glob + Grep. For new projects, the plan will rely more on CLAUDE.md architecture and stack conventions.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.