with one click
writing-plans
// Use when you have a CEO-approved FeatureForge spec for a multi-step task and need to write the implementation plan before touching code
// Use when you have a CEO-approved FeatureForge spec for a multi-step task and need to write the implementation plan before touching code
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | writing-plans |
| description | Use when you have a CEO-approved FeatureForge spec for a multi-step task and need to write the implementation plan before touching code |
_REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
_BRANCH_RAW=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo current)
[ -n "$_BRANCH_RAW" ] && [ "$_BRANCH_RAW" != "HEAD" ] || _BRANCH_RAW="current"
_BRANCH="$_BRANCH_RAW"
_FEATUREFORGE_INSTALL_ROOT="$HOME/.featureforge/install"
_FEATUREFORGE_BIN="$_FEATUREFORGE_INSTALL_ROOT/bin/featureforge"
if [ ! -x "$_FEATUREFORGE_BIN" ] && [ -f "$_FEATUREFORGE_INSTALL_ROOT/bin/featureforge.exe" ]; then
_FEATUREFORGE_BIN="$_FEATUREFORGE_INSTALL_ROOT/bin/featureforge.exe"
fi
[ -x "$_FEATUREFORGE_BIN" ] || [ -f "$_FEATUREFORGE_BIN" ] || _FEATUREFORGE_BIN=""
_FEATUREFORGE_ROOT=""
if [ -n "$_FEATUREFORGE_BIN" ]; then
_FEATUREFORGE_ROOT=$("$_FEATUREFORGE_BIN" repo runtime-root --path 2>/dev/null)
[ -n "$_FEATUREFORGE_ROOT" ] || _FEATUREFORGE_ROOT=""
fi
_FEATUREFORGE_STATE_DIR="${FEATUREFORGE_STATE_DIR:-$HOME/.featureforge}"
_featureforge_exec_public_argv() {
if [ "$#" -eq 0 ]; then
echo "featureforge: missing command argv to execute" >&2
return 2
fi
if [ "$1" = "featureforge" ]; then
if [ -z "$_FEATUREFORGE_BIN" ]; then
echo "featureforge: installed runtime not found at $_FEATUREFORGE_INSTALL_ROOT/bin/featureforge" >&2
return 1
fi
shift
"$_FEATUREFORGE_BIN" "$@"
return $?
fi
"$@"
}
Live FeatureForge workflow routing is install-owned:
$_FEATUREFORGE_BIN for live workflow control-plane commands./bin/featureforgetarget/debug/featureforgecargo runWhen a helper returns recommended_public_command_argv, treat it as exact argv. If recommended_public_command_argv[0] == "featureforge", execute through the installed runtime by replacing argv[0] with $_FEATUREFORGE_BIN (for example via _featureforge_exec_public_argv ...).
Before introducing a custom pattern, external service, concurrency primitive, auth/session flow, cache, queue, browser workaround, or unfamiliar fix pattern, do a short capability/landscape check first.
Use three lenses, then decide from local repo truth:
External search results are inputs, not answers. Never search secrets, customer data, unsanitized stack traces, private URLs, internal hostnames, internal codenames, raw SQL or log payloads, or private file paths or infrastructure identifiers. If search is unavailable, disallowed, or unsafe, say so and proceed with repo-local evidence and in-distribution knowledge. If safe sanitization is not possible, skip external search.
See $_FEATUREFORGE_ROOT/references/search-before-building.md.
For every interactive user question, use this structure:
RECOMMENDATION: Choose [X] because [one-line reason]A) ... B) ... C) ...Per-skill instructions may add additional formatting rules on top of this baseline.
Write comprehensive implementation plans for skilled engineers with little repo/tool context. Document files, code paths, tests, docs, validation, and test expectations as bite-sized tasks. DRY. YAGNI. TDD.
Announce at start: "I'm using the writing-plans skill to create the implementation plan."
Save plans to: docs/featureforge/plans/YYYY-MM-DD-<feature-name>.md
workflow expect or workflow sync helpers.Before writing or updating the plan file on disk, run the shared repo-safety preflight for the exact plan-writing scope:
$_FEATUREFORGE_BIN repo-safety check --intent write --stage featureforge:writing-plans --task-id <current-plan-write> --path docs/featureforge/plans/YYYY-MM-DD-<feature-name>.md --write-target plan-artifact-write
allowed, continue with the plan write.blocked, name the branch, the stage, and the blocking failure_class, then route to either a feature branch / featureforge:using-git-worktrees or explicit user approval for this exact plan-writing scope.$_FEATUREFORGE_BIN repo-safety approve --stage featureforge:writing-plans --task-id <current-plan-write> --reason "<explicit user approval>" --path docs/featureforge/plans/YYYY-MM-DD-<feature-name>.md --write-target plan-artifact-write [--write-target git-commit]
$_FEATUREFORGE_BIN repo-safety check --intent write --stage featureforge:writing-plans --task-id <current-plan-write> --path docs/featureforge/plans/YYYY-MM-DD-<feature-name>.md --write-target plan-artifact-write [--write-target git-commit]
allowed.git commit on the same protected branch, re-run the gate with the same task id, the same repo-relative path, and the same approved write-target set.approve plus full-scope check before continuing.Before writing the plan, inspect the selected spec and validate these exact header lines:
**Workflow State:** CEO Approved
**Spec Revision:** <integer>
**Last Reviewed By:** plan-ceo-review
**Workflow State:** is not CEO Approved, stop and direct the agent to featureforge:plan-ceo-review.## Requirement Index before planning begins. If the approved spec does not include one, stop and return to featureforge:plan-ceo-review.An approved spec may also include a trailing ## CEO Review Summary. Treat that block as additive context only:
## Requirement Index remain the prerequisite gate$_FEATUREFORGE_BIN plan contract checksIf the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
Before breaking work into tasks, make sure the plan explicitly covers:
Requirement Coverage MatrixDo not make fresh search the default here.
Landscape Snapshot when presentX over custom Y, reflect that explicitly in task structure, file paths, and implementation stepsWhen Layer 2 materially affects reuse or warnings, capture it in plan-body sections such as:
## Existing Capabilities / Built-ins to Reuse
## Known Footguns / Constraints
docs/project_notes/decisions.md for relevant prior decisions that should shape task decomposition.docs/project_notes/key_facts.md for durable repo facts worth carrying into the plan.featureforge:project-memory summary update to docs/project_notes/decisions.md may be appropriate after approval.Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
Optional task step checklists should be concrete, ordered, and small enough for an executor to verify. Use one action per step: write the failing test, run it to verify failure, implement, rerun, update docs, commit. Keep exact commands and expected outcomes when they matter.
See $_FEATUREFORGE_ROOT/references/writing-plans-examples.md for expanded task and execution-topology examples.
Every plan MUST start with this header:
# [Feature Name] Implementation Plan
> **For Codex and GitHub Copilot workers:** REQUIRED: Use `$_FEATUREFORGE_BIN workflow operator --plan <approved-plan-path>` as routing authority after engineering approval, and follow the runtime-selected execution owner skill; do not choose solely from isolated-agent availability. Steps use checkbox (`- [ ]`) syntax for tracking.
**Workflow State:** Draft
**Plan Revision:** 1
**Execution Mode:** none
**Source Spec:** [Exact path to approved spec]
**Source Spec Revision:** [Integer copied from approved spec]
**Last Reviewed By:** writing-plans
**QA Requirement:** required | not-required
**Goal:** [One sentence describing what this builds]
**Architecture:** [2-3 sentences about approach]
**Tech Stack:** [Key technologies/libraries]
---
QA Requirement is a plan-level finish-gating decision. It does not replace task-level Done when bullets, and task-level Done when bullets must not be used to infer whether QA is required.## Requirement Coverage Matrix
- REQ-001 -> Task 1
- REQ-002 -> Task 1, Task 2
## Task N: [Component Name]
**Spec Coverage:** REQ-001, DEC-001
**Goal:** [One sentence describing the exact outcome this task produces]
**Context:**
- [Why this task exists in the plan]
- [Repo or architecture fact the implementer/reviewer must know]
- [Spec, decision, or non-goal reference when required by review/plan-task-contract.md]
**Constraints:**
- [Hard rule inherited from the approved spec or review]
- [Hard rule inherited from decomposition, file ownership, sequencing, or reuse law]
**Done when:**
- [Atomic, binary, objectively reviewable completion condition]
- [Atomic, binary, objectively reviewable completion condition]
**Files:**
- Create: `exact/path/to/file.py`
- Modify: `exact/path/to/existing.py`
- Test: `tests/exact/path/to/test.py`
- [ ] **Step 1:** [optional execution aid with exact command/expected result when useful]
## Task N: is canonical. Do not use ### Task N:.Spec Coverage, Goal, Context, Constraints, Done when, and a parseable Files: block in the order defined by review/plan-task-contract.md.Open Questions is not part of the final approved task contract. Draft-only questions belong outside approved task bodies before approval.Goal must be one sentence and describe one exact outcome rather than a bucket of related work.Context must be a bullet list that makes the task self-contained enough for a fresh implementer and fresh reviewer to reach the same interpretation.Context only when one of the trigger conditions in review/plan-task-contract.md applies.Constraints must be hard rules, including reuse law when the task must extend an existing parser, normalizer, validator, routing path, policy path, prompt assembly path, or other shared implementation. For example: Extend the existing task-contract parser; do not add a second parser path.Done when bullets must be atomic, binary, objectively reviewable, reviewable without interpretation drift, and concrete. A bullet may be verified by diff inspection, targeted tests, or artifacts; it does not have to map to one command.Files are optional execution aids, not required task-contract surface.Spec Coverage.## Execution Strategy and ## Dependency Diagram.## Execution Strategy must assign every task exactly once to either an explicitly justified serial directive or an explicitly owned parallel worktree directive.worktree. Either declare one isolated worktree per task or state an explicit worktree count that exactly matches the parallel batch size.## Dependency Diagram must reflect the same fastest-safe topology the task list and Execution Strategy claim.Canonical topology examples stay in $_FEATUREFORGE_ROOT/references/writing-plans-examples.md; keep the governing rules here:
Execute Task 1 serially when it establishes a shared foundation.
After the serial seam, create two worktrees and run Tasks 2 and 3 in parallel only when their write scopes and ownership are disjoint.
Task 2 owns one exact implementation surface; Task 3 owns another exact implementation surface.
Execute Task 4 serially as the reintegration point when parallel work must merge before later tasks.
After Task 4, create three worktrees and run Tasks 5, 6, and 7 in parallel:
Execute Task 8 serially after Tasks 5 and 6 merge back.
Use Files: blocks as concrete write-scope truth for every task.
If tasks share hotspot files, do not pretend they are parallel. Move the hotspot into an explicit later serial seam and name that seam in ## Execution Strategy.
Do not serialize work just because one lane feels simpler. If a serial directive covers more than one task, the plan must prove a real hazard such as overlapping write scope or an explicit reintegration seam that cannot be isolated.
Reject these shapes during drafting instead of leaving them for review:
Task Outcome, Plan Constraints, or task-level Open Questions.Done when bullets such as "the UX feels right" or "the implementation is robust".Context that omits the existing abstraction, spec requirement, approved decision, non-goal, or repo-local architecture fact needed for a fresh implementer/reviewer to choose the same implementation path.Done when bullets that depend on interpretation instead of objective evidence.Use exact file paths, complete task-level implementation direction, exact commands with expected output when they matter, relevant skill names, and the approved spec path/revision. New execution plans start at **Plan Revision:** 1 and **Execution Mode:** none.
After saving the full plan:
"$_FEATUREFORGE_BIN" plan contract lint \
--spec docs/featureforge/specs/YYYY-MM-DD-<feature-name>-design.md \
--plan docs/featureforge/plans/YYYY-MM-DD-<feature-name>.md
featureforge:plan-eng-review for the first engineering review pass.featureforge:plan-fidelity-review directly from writing-plans; plan-fidelity runs only after engineering-review edits are complete and plan-eng-review has set **Last Reviewed By:** plan-eng-review on the final draft.featureforge:writing-plans for plan repair**Workflow State:** Draft and **Last Reviewed By:** writing-plans until all engineering-review issues are resolvedfeatureforge:plan-eng-review owns the handoff to featureforge:plan-fidelity-reviewThe terminal state is invoking featureforge:plan-eng-review.
plan-eng-review presents the normal execution preflight handoff after the written plan is approved. Do NOT offer execution options directly from writing-plans.