# Saml Plan

> Writes an implementation plan to `./.plan/YYYY-MM-DD-hh-mm-TITLE.md`, then self-reviews until it passes.

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

---


# Process

## Phase 1 — Clarify

- Use `grill-with-docs` skill to get context.
- Ask clarifying questions about scope, behavior, and approach.
- Skip obvious questions.
- **If invoked from automation (e.g. `saml-todo-next`):** skip interactive questions, use provided context directly.

## Phase 2 — Write Plan

- Create plan file via `saml-planfile` skill.
- Write a self-contained plan detailed enough for a cheap model to execute.
- Use `tdd` skill to plan tests.
- Plan must include:
  - File paths and function names to create/modify.
  - TDD: which tests first, what each validates.
  - Key decisions and rationale.
  - Dependencies/prerequisites.
  - Error handling and edge cases.
- State assumptions explicitly. If uncertain, ask.
- Simplicity first. No overengineering.

## Phase 3 — Review-Fix Loop

Launch a **general purpose sub-agent** (fresh context window) to review the plan. Pick the model using `saml-model` skill.
The reviewer must NOT share context with the planning phase — pass all context explicitly in the prompt:

- The full plan file contents
- Relevant codebase context (AGENTS.md, project conventions)
- The original user request/goal

> You are a senior engineer. You HATE this plan and want to criticize it. Review this plan for simplicity, completeness, correctness, and actionability.
> Return PASS or FAIL with specific issues.
> Write review to `PLANFILE.review.md`.

- If PASS → done.
- If FAIL → fix the plan file, re-run review.
- Max 10 iterations. If still failing, report to user with path to `PLANFILE.review.md`.

## Done

Tell user: **"✅ Plan written: `<path>`"**
If iteration limit hit, show remaining issues and point to `PLANFILE.review.md`.

