planning-with-files
Install this skill
npx skills add othmanadi/planning-with-filesWorks across Claude Code, Cursor, Codex, Copilot & Antigravity
The planning-with-files skill provides a structured framework for managing long-running coding and research tasks by shifting state management from the volatile agent context window to persistent files on disk. By forcing the agent to maintain specific Markdown files like task_plan.md, findings.md, and progress.md, it prevents data loss during extended sessions or complex multi-step operations. It mandates a formal protocol for handling errors, requiring agents to record failed attempts and pivot strategies after the second failure. The system treats the local filesystem as a reliable 'working memory,' ensuring that goals, research results, and incremental progress are accessible even if the AI's short-term memory buffer is exhausted or interrupted. It enforces disciplined documentation throughout the development lifecycle.
When to Use This Skill
- β’Building full-stack features that require multiple distinct coding phases
- β’Conducting deep-dive technical research on undocumented APIs
- β’Executing long-running refactoring tasks that span multiple sessions
- β’Managing complex debugging workflows that require systematic trial and error
How to Invoke This Skill
Example prompts that trigger this skill in Claude Code, Cursor, or Antigravity:
- βLet's start a new project using the planning-with-files workflow
- βInitialize planning files for this development task
- βCreate the task_plan.md and setup the documentation structure
- βI have a complex task, let's track it in the project root
- βBegin the multi-step plan using the template system
Pro Tips
- π‘Regularly commit your planning files (`task_plan.md`, `findings.md`, `progress.md`) to version control alongside your code. This creates an auditable trail of your AI's reasoning and progress, invaluable for team collaboration or revisiting old projects.
- π‘Before executing any significant changes, review the generated `task_plan.md` carefully. Treat it as a contract with your AI, modifying it to align perfectly with your expectations and constraints. This pre-planning step minimizes costly re-dos.
- π‘Leverage the session recovery feature by running the `session-catchup.py` script proactively after any unexpected disconnect or `/clear`. This ensures no valuable context or in-progress work is lost, allowing for seamless continuation.
What this skill does
- β’Synchronizes work state across sessions using automatic script-based catchup
- β’Forces structured tracking of project phases via standardized Markdown templates
- β’Mandates an error-logging protocol to prevent repetitive failed actions
- β’Implements a 3-strike escalation rule for stubborn technical blockers
- β’Requires archival of multimodal dataβlike browser search resultsβinto text files
When not to use it
- βQuick, one-shot code modifications or syntax corrections
- βSimple informational queries that do not require file generation
- βTasks that are completed in fewer than three logical steps
Example workflow
- Execute the session catchup script to ensure environment consistency
- Generate the initial task_plan.md based on current project requirements
- Execute the first development phase and record results in progress.md
- Summarize technical findings into findings.md after tool usage
- Review all files at the start of every new interaction to verify state
- Update phase status in task_plan.md upon completion
Prerequisites
- βPython 3 installed on the host machine
- βPermission to create files in the active directory
Pitfalls & limitations
- !Forgetting to update the markdown files after completing a step
- !Overloading findings.md with redundant information instead of actionable insights
- !Failing to execute the catchup script when returning to a dormant project
FAQ
How it compares
Unlike standard agent interactions where context is lost or inferred, this skill forces a persistent, explicit external state that remains consistent even if the chat history is purged or a new session begins.
π Full skill instructions β original source: othmanadi/planning-with-files
Work like Manus: Use persistent markdown files as your "working memory on disk."
## FIRST: Check for Previous Session (v2.2.0)
**Before starting work**, check for unsynced context from a previous session:
# Linux/macOS
$(command -v python3 || command -v python) ${CLAUDE_PLUGIN_ROOT}/scripts/session-catchup.py "$(pwd)"# Windows PowerShell
& (Get-Command python -ErrorAction SilentlyContinue).Source "$env:USERPROFILE\.claude\skills\planning-with-files\scripts\session-catchup.py" (Get-Location)If catchup report shows unsynced context:
1. Run
git diff --stat to see actual code changes2. Read current planning files
3. Update planning files based on catchup + git diff
4. Then proceed with task
## Important: Where Files Go
- **Templates** are in
${CLAUDE_PLUGIN_ROOT}/templates/- **Your planning files** go in **your project directory**
| Location | What Goes There |
|----------|-----------------|
| Skill directory (
${CLAUDE_PLUGIN_ROOT}/) | Templates, scripts, reference docs || Your project directory |
task_plan.md, findings.md, progress.md |## Quick Start
Before ANY complex task:
1. **Create
task_plan.md** β Use [templates/task_plan.md](templates/task_plan.md) as reference2. **Create
findings.md** β Use [templates/findings.md](templates/findings.md) as reference3. **Create
progress.md** β Use [templates/progress.md](templates/progress.md) as reference4. **Re-read plan before decisions** β Refreshes goals in attention window
5. **Update after each phase** β Mark complete, log errors
> **Note:** Planning files go in your project root, not the skill installation folder.
## The Core Pattern
Context Window = RAM (volatile, limited)
Filesystem = Disk (persistent, unlimited)
β Anything important gets written to disk.## File Purposes
| File | Purpose | When to Update |
|------|---------|----------------|
|
task_plan.md | Phases, progress, decisions | After each phase ||
findings.md | Research, discoveries | After ANY discovery ||
progress.md | Session log, test results | Throughout session |## Critical Rules
### 1. Create Plan First
Never start a complex task without
task_plan.md. Non-negotiable.### 2. The 2-Action Rule
> "After every 2 view/browser/search operations, IMMEDIATELY save key findings to text files."
This prevents visual/multimodal information from being lost.
### 3. Read Before Decide
Before major decisions, read the plan file. This keeps goals in your attention window.
### 4. Update After Act
After completing any phase:
- Mark phase status:
in_progress β complete- Log any errors encountered
- Note files created/modified
### 5. Log ALL Errors
Every error goes in the plan file. This builds knowledge and prevents repetition.
## Errors Encountered
| Error | Attempt | Resolution |
|-------|---------|------------|
| FileNotFoundError | 1 | Created default config |
| API timeout | 2 | Added retry logic |### 6. Never Repeat Failures
if action_failed:
next_action != same_actionTrack what you tried. Mutate the approach.
## The 3-Strike Error Protocol
ATTEMPT 1: Diagnose & Fix
β Read error carefully
β Identify root cause
β Apply targeted fix
ATTEMPT 2: Alternative Approach
β Same error? Try different method
β Different tool? Different library?
β NEVER repeat exact same failing action
ATTEMPT 3: Broader Rethink
β Question assumptions
β Search for solutions
β Consider updating the plan
AFTER 3 FAILURES: Escalate to User
β Explain what you tried
β Share the specific error
β Ask for guidance## Read vs Write Decision Matrix
| Situation | Action | Reason |
|-----------|--------|--------|
| Just wrote a file | DON'T read | Content still in context |
| Viewed image/PDF | Write findings NOW | Multimodal β text before lost |
| Browser returned data | Write to file | Screenshots don't persist |
| Starting new phase | Read plan/findings | Re-orient if context stale |
| Error occurred | Read relevant file | Need current state to fix |
| Resuming after gap | Read all planning files | Recover state |
## The 5-Question Reboot Test
If you can answer these, your context management is solid:
| Question | Answer Source |
|----------|---------------|
| Where am I? | Current phase in task_plan.md |
| Where am I going? | Remaining phases |
| What's the goal? | Goal statement in plan |
| What have I learned? | findings.md |
| What have I done? | progress.md |
## When to Use This Pattern
**Use for:**
- Multi-step tasks (3+ steps)
- Research tasks
- Building/creating projects
- Tasks spanning many tool calls
- Anything requiring organization
**Skip for:**
- Simple questions
- Single-file edits
- Quick lookups
## Templates
Copy these templates to start:
- [templates/task_plan.md](templates/task_plan.md) β Phase tracking
- [templates/findings.md](templates/findings.md) β Research storage
- [templates/progress.md](templates/progress.md) β Session logging
## Scripts
Helper scripts for automation:
-
scripts/init-session.sh β Initialize all planning files-
scripts/check-complete.sh β Verify all phases complete-
scripts/session-catchup.py β Recover context from previous session (v2.2.0)## Advanced Topics
- **Manus Principles:** See [reference.md](reference.md)
- **Real Examples:** See [examples.md](examples.md)
## Anti-Patterns
| Don't | Do Instead |
|-------|------------|
| Use TodoWrite for persistence | Create task_plan.md file |
| State goals once and forget | Re-read plan before decisions |
| Hide errors and retry silently | Log errors to plan file |
| Stuff everything in context | Store large content in files |
| Start executing immediately | Create plan file FIRST |
| Repeat failed actions | Track attempts, mutate approach |
| Create files in skill directory | Create files in your project |
How to Use This Skill Unit
Option A: Project-Specific (Recommended)
- Click "Download" above
- In your project, create the directory:
.agent/skills/planning-with-files/ - Save the file as
SKILL.md - The agent will automatically discover the skill based on its description.
Option B: Global Installation (All Agents)
Save the file to these locations to make it available across all projects:
- Claude Code:
~/.claude/skills/othmanadi/planning-with-files/planning-with-files/SKILL.md - Cursor:
~/.cursor/skills/othmanadi/planning-with-files/planning-with-files/SKILL.md - Antigravity:
~/.gemini/antigravity/skills/othmanadi/planning-with-files/planning-with-files/SKILL.md
π Install with CLI:npx skills add othmanadi/planning-with-files