Planning with Files
Work like Manus: Use persistent markdown files as your "working memory on disk."
Multi-Project Support
This skill supports multiple project contexts via a coordinator file.
On Skill Activation
FIRST, check for a coordinator file:
- •Check if
.skogai/plan/index.mdexists (walking up from CWD like git finds.git) - •If found, determine active project using priority cascade:
- •Priority 1:
$MANUS_PROJECTenvironment variable (explicit override) - •Priority 2:
.skogai/plan/.active.override.$CLAUDE_CODE_SESSION_ID(session-local state) - •Priority 3:
active:field inindex.md(workspace default)
- •Priority 1:
- •Look up that project's path in the Projects table
- •Expand
~to the user's home directory in paths - •Use that path as
{project_path}for all planning files - •Create the directory if it doesn't exist
- •Report: "Planning context: [project-name] at [path]"
If no .skogai/plan/ found:
- •Use current directory as
{project_path}(backward compatible) - •Planning files go directly in CWD
Session ID:
Claude Code exposes $CLAUDE_CODE_SESSION_ID (a UUID) in all execution contexts.
Use this for session-local override files. TTY detection doesn't work because
Claude Code's Bash tool runs without a TTY attached.
Planning File Locations
All planning files use {project_path}:
- •
{project_path}/task_plan.md - •
{project_path}/findings.md - •
{project_path}/progress.md
Project Commands
Recognize these natural language patterns:
| User Says | Action |
|---|---|
| "switch to [name]" | Write to session override file, read new project's task_plan.md |
| "set default [name]" | Update active: in index.md (workspace default for new sessions) |
| "list projects" / "show projects" | Display all projects from index.md table |
| "which project?" / "current context" | Show active project name, source, and resolved path |
| "add project [name]" | Interactive flow to create new project (see below) |
| "set default path [path]" | Update default_path in index.md |
| "where are planning files?" | Show resolved {project_path} |
| "where is source?" | Show source path for current project |
Adding a Project
When user says "add project [name]":
First, check if project already exists in the Projects table:
- •If exists: "Project '[name]' already exists. Would you like to update it, use a different name, or switch to it?"
- •If not exists: continue with creation flow
- •
Ask for planning location using AskUserQuestion:
- •Option 1: "Default location ({default_path}/[name]/)" [Recommended]
- •Option 2: "Somewhere else (I'll specify)"
- •
If "somewhere else", ask for the custom planning path
- •
Ask for source/working folder:
- •"What's the source/working folder for this project?"
- •This is where the actual code lives
- •
Create the project:
- •Create the planning directory if it doesn't exist
- •Create task_plan.md with Source header (see template)
- •Create findings.md
- •Create progress.md
- •Add row to Projects table in index.md
- •Set as active project
- •
Report:
codeCreated project "[name]": - Planning: [resolved planning path] - Source: [source path] - Files: task_plan.md, findings.md, progress.md
Switching Projects (Session-Local)
When user requests a project switch with "switch to [name]":
- •Read
.skogai/plan/index.md - •Verify the requested project exists in the Projects table
- •Get session ID from
$CLAUDE_CODE_SESSION_IDenvironment variable - •Write the project name to
.skogai/plan/.active.override.$CLAUDE_CODE_SESSION_ID- •This is session-local - does NOT modify index.md
- •Other Claude Code sessions are unaffected
- •Read the new project's
task_plan.mdif it exists - •Report: "Switched to [name] (this session). Current task: [summary from task_plan.md or 'No active task']"
If the requested project doesn't exist, offer to create it.
Setting Workspace Default
When user says "set default [name]":
- •Verify the requested project exists in the Projects table
- •Update the
active:field in.skogai/plan/index.md - •Report: "Set [name] as workspace default. New sessions will start with this project."
This changes the default project for all new sessions in this workspace.
Intent Mismatch Detection
If the user mentions working on a project different from the active one:
- •Example: Active is "bracket" but user says "let's work on the college advisor"
- •Prompt: "You mentioned college-advisor but we're in bracket context. Switch projects?"
Example index.md
# Planning Coordinator
active: my-project
default_path: .skogai/plan
## Projects
| Name | Planning Path | Source Path | Description |
| ---------- | ------------------ | -------------------- | ------------------- |
| my-project | {default}/my-project | ~/code/my-project | Main project |
| side-proj | {default}/side-proj | ~/code/side-proj | Side project |
Path Resolution:
- •
{default}expands to thedefault_pathvalue - •
~expands to user's home directory - •Planning Path = where planning files live
- •Source Path = where project code lives
Quick Start
Before ANY complex task:
- •Check for coordinator — Read
.skogai/plan/index.mdif it exists - •Create
task_plan.md— See templates/task_plan.md - •Create
findings.md— See templates/findings.md - •Create
progress.md— See templates/progress.md - •Re-read plan before decisions — Refreshes goals in attention window
- •Update after each phase — Mark complete, log errors
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_action
Track 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/index.md — Multi-project coordinator
- •templates/task_plan.md — Phase tracking
- •templates/findings.md — Research storage
- •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
Advanced Topics
- •Manus Principles: See references/manus-principles.md
- •Real Examples: See references/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 |