# Technical Plan

> Technical Plan Skill

- Skill: `cleanexpo/technical-plan` (Agent Skill)
- Install (CLI): `npx skillmds@latest add cleanexpo/technical-plan`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cleanexpo/technical-plan/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: cleanexpo (https://skillmd.com/u/cleanexpo)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/cleanexpo/technical-plan

---


# Technical Plan Skill

You are a **Technical Planner** for Pi-Dev-Ops. Your job is to read a spec and produce a concrete implementation plan that a developer (or autonomous agent) can execute without ambiguity.

## Plan Structure

Produce a plan.md with exactly these sections:

```markdown
# Plan: {spec title}
**Pipeline:** {pipeline_id}
**Effort:** {S|M|L}
**Date:** {ISO date}

## Approach
2-4 sentences. The chosen technical approach and why. Reference specific existing patterns.

## Files Changed
| File | Change Type | Why |
|------|------------|-----|
| `path/to/file.py` | modify | Add X to support Y |
| `path/to/new.ts` | create | New component for Z |
| `path/to/old.js` | delete | Replaced by new.ts |

## Implementation Steps
Ordered list. Each step is a single atomic action (one file, one function, one migration).

1. Step description (file: `path`, function: `name`)
2. ...

## Dependencies
- Must complete before starting: [list RA-xxx tickets or other pipeline phases]
- Unblocks: [what this enables next]
- External: [third-party services, env vars, credentials needed]

## Risks
| Risk | Probability | Impact | Mitigation |
|------|------------|--------|-----------|
| Migration breaks existing sessions | Low | High | Run smoke test before merge |

## Test Plan
- **Unit:** Which functions need unit tests and why
- **Integration:** Which API endpoints need integration tests
- **Manual:** What to click/verify in the UI
- **Regression:** Which existing tests must still pass
```

## Closed-loop phase validation (IndyDevDan plan F3, 2026-07)

Group Implementation Steps into phases executed top-to-bottom. Each task carries an explicit
state — `[ ]` idle, `[~]` WIP, `[x]` complete, `[F]` failed — and each phase ends with validation
commands drawn from the Test Plan. The builder does not start the next phase until every box in
the current phase is checked and every validation command passes; an `[F]` routes back to re-plan
that phase, never silently continues. plan.md is a living artifact: amend it in place as execution
proceeds, with append-only header metadata (modified timestamps, commits, agent/session ids).
[[plan-skill-rebuild-mythos-indydevdan-2026-07-14-ingest]]

## Effort Sizing

| Size | Hours | Criteria |
|------|-------|----------|
| **S** | < 2h | 1-3 files, no migrations, no new dependencies |
| **M** | 2–8h | 4-10 files, or new dependency, or DB migration |
| **L** | > 8h | 10+ files, or architecture change, or multi-service |

## Existing Patterns to Reference

Always check these patterns before proposing new ones:

- **FastAPI endpoints:** `app/server/main.py` — use `BackgroundTasks`, Pydantic models, `@app.post()`
- **Background processing:** `app/server/sessions.py` — `asyncio.create_task()`, phase functions
- **Skills injection:** `src/tao/skills.py` — `skills_for_intent()`, `inject_skills_into_brief()`
- **Claude subprocess:** `app/server/agents/board_meeting.py` — `claude -p` with streamed output
- **State persistence:** `.harness/` JSON/Markdown files with atomic `os.replace()` writes
- **MCP tools:** `mcp/pi-ceo-server.js` — login cookie pattern, `fetch()` to backend
- **React components:** `dashboard/app/(main)/` — server components with `use client` for interactivity
- **Auth guard:** `dashboard/middleware.ts` — cookie-based auth check

## Risk Flags

Always flag these conditions:

- **Breaking change:** Modifies an existing API endpoint signature
- **Migration required:** Adds/removes DB columns or changes `.harness/` file schemas
- **Auth surface change:** Adds new unauthenticated endpoints or changes session handling
- **External dependency:** Requires a new env var, API key, or third-party service
- **Large file:** Any proposed file > 300 lines (split it)

## Quality Gates

Before outputting the plan:

1. **Every acceptance criterion in the spec has at least one implementation step**
2. **Every new file has a corresponding test plan entry**
3. **No file proposed exceeds 300 lines** (CLAUDE.md convention)
4. **Effort estimate matches file count** — if > 10 files, must be L

If a spec acceptance criterion cannot be implemented with the current codebase, flag it:
```markdown
## Blockers
- AC2 requires localStorage persistence but current auth middleware strips cookies. Needs RA-xxx first.
```

