writing-plans
npx machina-cli add skill CodingCossack/agent-skills-library/writing-plans --openclawWriting Plans
Overview
Create implementation plans for an engineer with zero codebase context.
Each plan includes:
- Exact file paths for every operation
- Complete code (not "add validation here")
- Test-first approach with verification commands
- Bite-sized steps (2-5 min each)
Principles: DRY, YAGNI, TDD, frequent commits.
Announce at start: "I'm using the writing-plans skill to create the implementation plan."
Context: Run in dedicated worktree. If none exists, use using-git-worktrees skill first.
Save plans to: docs/plans/YYYY-MM-DD-<feature-name>.md
Before Writing
- Read spec/requirements completely
- Explore project structure (
view .) - Identify tech stack (package.json, pyproject.toml, etc.)
- Note existing patterns in similar files
- Check docs/ for existing conventions
Bite-Sized Task Granularity
Each step is one action (2-5 minutes), independently verifiable:
- "Write the failing test" — step
- "Run it to confirm failure" — step
- "Implement minimal code to pass" — step
- "Run tests to confirm pass" — step
- "Commit" — step
Plan Document Header
Every plan MUST start with this header:
# [Feature Name] Implementation Plan
**Goal:** [One sentence describing what this builds]
**Architecture:** [2-3 sentences about approach]
**Tech Stack:** [Key technologies/libraries]
---
Task Structure
### Task N: [Component Name]
**Files:**
- Create: `exact/path/to/file.py`
- Modify: `exact/path/to/existing.py:123-145`
- Test: `tests/exact/path/to/test.py`
**Step 1: Write the failing test**
```python
def test_specific_behavior():
result = function(input)
assert result == expected
```
**Step 2: Run test to verify it fails**
Run: `pytest tests/path/test.py::test_name -v`
Expected: FAIL with "function not defined"
**Step 3: Write minimal implementation**
```python
def function(input):
return expected
```
**Step 4: Run test to verify it passes**
Run: `pytest tests/path/test.py::test_name -v`
Expected: PASS
**Step 5: Commit**
```bash
git add tests/path/test.py src/path/file.py
git commit -m "feat: add specific feature"
```
Before Handoff
Verify plan completeness:
- Every file path exists or will be created
- Every command can be run exactly as written
- No TODO/placeholder text remains
- Tests cover all acceptance criteria from spec
- Include exact test code, not descriptions
Execution Handoff
After saving plan, present:
"Plan saved to docs/plans/<filename>.md. Choose execution mode:
- Subagent-Driven — same session, fresh subagent per task, fast iteration
- Parallel Session — new session, batched execution with checkpoints
Which approach?"
If Subagent-Driven chosen
- Stay in this session
- REQUIRED SUB-SKILL:
subagent-driven-development - Fresh subagent per task + two-stage review
If Parallel Session chosen
- Guide user to open new session in worktree
- REQUIRED SUB-SKILL: New session uses
executing-plans
Source
git clone https://github.com/CodingCossack/agent-skills-library/blob/main/skills/writing-plans/SKILL.mdView on GitHub Overview
Writing Plans generates end-to-end implementation plans for engineers with zero codebase context. Each plan lists exact file paths, complete code snippets, and test-first verification steps, broken into bite-sized actions (2-5 minutes). Plans follow DRY, YAGNI, and TDD principles and are saved to docs/plans.
How This Skill Works
From a given spec, the skill outputs a plan header with the feature name and goal, then a Task Structure detailing Create/Modify/Test steps with exact file paths. It includes code blocks and verification commands to support a test-first workflow and produces a commit-ready sequence. Plans are saved to docs/plans/YYYY-MM-DD-<feature-name>.md and designed for handoff within a dedicated worktree.
When to Use It
- You have a feature spec or requirements and need to turn them into executable steps.
- You’re in a repo with no codebase context and need guided implementation.
- You require exact file paths and concrete code blocks for each operation.
- You want bite-sized tasks that can be completed in 2-5 minutes each with verification.
- You’re documenting a plan for handoff or audit, saved under docs/plans.
Quick Start
- Step 1: Read the spec/requirements completely and decide the feature name for the plan header.
- Step 2: Draft the Plan Document Header and a Task Structure with exact file paths and tests; include failing-test and minimal-implementation steps.
- Step 3: Save the plan to docs/plans/YYYY-MM-DD-<feature-name>.md and prepare for handoff in a dedicated worktree.
Best Practices
- Read the full spec before drafting the plan.
- List exact file paths for every operation.
- Write the failing test first, then implement minimally to pass.
- Keep steps bite-sized (2-5 minutes) and independently verifiable.
- Commit frequently with descriptive messages and save the plan to docs/plans.
Example Use Cases
- Plan to add a new REST endpoint with full test coverage using TDD.
- Plan a feature flag integration with tests and explicit file changes.
- Plan a refactor of a module with minimal changes and verification steps.
- Plan to integrate a new API client, including mocks and tests.
- Plan a configuration migration to a new layout with tests and a docs plan.