Skip to content
Back to skills

Plan

ASecurity

Plans the build of an approved Factree spec. Use when asked to plan a spec, to write its design.md and tasks.md, or to split a spec into tasks that several build agents can build in parallel. Reads the code first, follows the patterns it finds, and writes .factree/specs/<capability>/design.md and .factree/specs/<capability>/tasks.md. Never writes code and never changes the spec.

  • 8 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
developmentrustgoexpressgitbackend

Security analysis

A100/100

Scanned December 4, 2026

npx -y skills add factree-dev/factree --skill plan --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Plan?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Plan
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/factree-dev-plan/badge)](https://www.skillsdirectory.com/skills/factree-dev-plan)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: plan
description: Plans the build of an approved Factree spec. Use when asked to plan a spec, to write its design.md and tasks.md, or to split a spec into tasks that several build agents can build in parallel. Reads the code first, follows the patterns it finds, and writes .factree/specs/<capability>/design.md and .factree/specs/<capability>/tasks.md. Never writes code and never changes the spec.
argument-hint: "[capability id or path to a spec.md]"
---

# Plan

Turn an approved spec into a plan: a short design that fits the code as it is, and a split into tasks that several build agents can build at the same time without colliding. The spec's format is defined by the factree:spec-format skill. Load it before reading the spec.

Input: $ARGUMENTS

## Why this skill exists

A spec says what the software must do. It deliberately does not say how. If several agents each decide "how" on their own, they invent three ways to do one thing, build the same helper twice, and edit the same file in ways that do not merge. The plan is where "how" is decided once, by someone who has read the code.

Two readers come after you, and neither can ask you anything:

- **Each build agent** gets the spec, your design, and one task. It does not see the other agents' work until theirs has landed. Whatever two tasks must agree on (a name, a type, a file, a route) has to be in the design, or they will disagree.
- **The factory** reads `tasks.md` to decide what runs when: a task waits for every task it depends on, and tasks that list the same file take turns. A plan that leaves a scenario to no task, names a task or scenario that does not exist, or has tasks that depend on each other in a circle is not built at all. Nor is one with a task outside exactly one repository, when the spec covers several (see "Several repositories" in step 2).

<HARD-GATE>
This skill writes exactly two files, `design.md` and `tasks.md`, in the spec's own folder, `.factree/specs/<capability>/`. It never edits `spec.md`, never writes or edits code, tests, config or dependencies, and never commits. Reading code is expected and is most of the work.
</HARD-GATE>

## Process

### 1. Read the spec

Read `.factree/specs/<capability>/spec.md` in full. Open it by path: the folder is local and ignored by git, so a search may skip it. To see the other specs, list `.factree/specs/`. List every scenario id (`R1.S1`, `R1.S2`, …): each must end up covered by exactly the tasks that make it hold. Read the Scope's anti-goals and the Decisions: a plan that contradicts either is wrong however tidy it is.

If the spec has a `## Code` section, treat it as a lead, not as truth. Check it against the code.

### 2. Read the code before deciding anything

The plan must fit the code as it is. For each thing the spec needs, find how the codebase already does that kind of thing:

- Where does code of this kind live? Read the repository's own description of its layout (README, CLAUDE.md, contributing notes) and then look.
- Is there an existing pattern for it: how routes are registered, how state is stored, how errors are shown, how tests are written, how a screen is added? Open one or two real examples of each and read them.
- What already exists that the work should reuse rather than rebuild?
- What conventions would a reviewer of this repository reject a change for breaking?

Do not design from memory of how projects like this usually look. A pattern you did not open a file to see is a guess.

**Several repositories.** The folder that holds `.factree/` is usually a git repository, and then this paragraph does not apply. When that folder is in no git repository and git repositories lie directly below it, the spec covers all of them: a multi-repo workspace. A folder directly below belongs when its `.git` is a directory and it has at least one commit. In a multi-repo workspace:

- Each repository has its own description, patterns and conventions. Read those of every repository the work reaches.
- Every path in the plan is written relative to the folder that holds `.factree/`, so it starts with the repository's name: `backend/app/links.rb`.
- Each task changes exactly one repository.

### 3. Decide, and ask only what a person must confirm

Most decisions are yours: you have read the code, and the plan should follow its current patterns and good practice. Make them and record them.

Ask a person only to confirm a decision that the code and the spec cannot settle and that would be expensive to reverse: a choice between two existing patterns that both fit, a new dependency, a change to something outside the spec's scope that the work seems to need. Ask at most 3 questions for the whole plan, each a single sentence with the answer you recommend. If you have no such decision, ask nothing. If you have used your three, decide the rest yourself.

Never ask what the spec already answers, and never ask about behaviour: behaviour is the spec's business, and a gap in it is a reason to stop and say so, not to plan around it.

### 4. Write `design.md`

Short: a page, not a document. Exactly these three sections, in this order.

```md
## Approach
Two to six sentences: how the capability will be built, in terms of the code that exists. Name the
pieces and how they connect. Anything two tasks must agree on (a type's name, a function's
signature, a file's location, a route) is stated here, exactly.

## Patterns followed
- Routes are registered in `src/server/http/server.ts`, one regular expression per route; the new export route follows it.
- State is folded from events in `src/shared/lanes.ts`; the report is a new fold beside it, not a table.

## Decisions
- The export reuses the CSV writer in `src/export/csv.ts`, because it already escapes quotes and newlines.
- Reports are built on request rather than stored, because the spec's scope excludes history. Yes, confirmed by Maya Chen.
```

Rules the factory checks, and rules it cannot check but the build depends on:

- **Every line under `## Patterns followed` names at least one file path that exists in the repository**, written relative to its root (in a multi-repo workspace: relative to the folder that holds `.factree/`). It cites the place you saw the pattern. A path that does not exist stops the build. One pattern per line.
- **Every line under `## Decisions` gives its reason after the word `because`.** One decision per line. A decision without a reason cannot be revisited sensibly later.
- **A decision a person confirmed says so:** the line contains their answer and the words `confirmed by` followed by their name.
- **Do not invent a pattern where the codebase has one.** If you depart from an existing pattern, that is a decision: record it with its reason.
- No code listings beyond a signature or a type that tasks must share. The design says where and how, not the lines.

### 5. Write `tasks.md`

One block per task, in the order they would naturally be built. Nothing else in the file needs to be there; a line of introduction above the first block is allowed.

```md
## T1 · Report model
covers: R1.S1, R1.S2
touches: src/report/model.ts, tests/report-model.test.ts
depends_on:

## T2 · Export endpoint
covers: R2.S1
touches: src/server/http/server.ts, src/report/export.ts
depends_on: T1
```

The format, exactly:

- The heading is `## T<n> · <name>`: `T` and a number, a middle dot, a short name. Number from `T1` with no gaps.
- `covers:` the scenario ids this task makes hold, comma-separated, exactly as the spec writes them (`R2.S1`).
- `touches:` the files this task expects to create or change, comma-separated, relative to the repository's root. In a multi-repo workspace they are relative to the folder that holds `.factree/`, there is at least one, and all of one task's files lie in the same repository.
- `depends_on:` the ids of tasks whose work must exist first, comma-separated; empty when there are none.

How to split:

- **Every scenario of the spec is covered by at least one task.** A scenario nobody covers stops the build. Check the list from step 1 against your `covers` lines before you finish.
- **Only real ids.** A scenario id that is not in the spec, or a task id that is not in the plan, stops the build.
- **No circles.** If T1 needs T2 and T2 needs T1, they are one task.
- **One repository per task, in a multi-repo workspace.** Work that reaches two repositories is at least two tasks, with `depends_on` where one needs the other. What they must agree on (a route, a payload) goes in Approach. A task whose `touches` is empty, names a file in no repository, or names files of two repositories stops the build.
- **Split along seams that already exist in the code**: a module, a layer, a screen. A task should be something one agent can build and test without needing another agent's unfinished work.
- **`depends_on` only for a real need**: the task uses a type, function or file another task creates. A dependency makes a task wait; an unnecessary one makes the build slower for nothing. Shared foundations (a type, an event, a schema) usually belong in one early task that others depend on.
- **`touches` honestly.** Two tasks that list the same file take turns, which is safe. Two tasks that change the same file without listing it collide, and one of them fails. When in doubt, list the file. Files that almost every change edits (a route table, an index, a composition root) are worth giving to one task, or to tasks that depend on each other.
- **Fewer, whole tasks beat many slivers.** A small spec is one task, and that is a good plan. Do not split work that would have to be understood together to be built correctly.
- **Tests go with the task they test**, in its `touches`, not in a separate task at the end.

### 6. Check the plan

Before you finish, check it against this list. If you are running inside Factree and have been lent a tool that checks the plan, use it as well, and fix what it reports.

1. `design.md` has `## Approach`, `## Patterns followed` and `## Decisions`, in that order.
2. Every Patterns line names a path, and each path exists (open it or list it; do not trust memory).
3. Every Decisions line contains `because`. Every answer a person gave is on a Decisions line with `confirmed by` and their name.
4. Every task has the four parts: heading, `covers:`, `touches:`, `depends_on:`.
5. Every scenario id in the spec appears in some task's `covers`. No `covers` names an id the spec does not have.
6. Every id in a `depends_on` is a task in this plan, and no chain of dependencies leads back to its start.
7. Anything two tasks must agree on is written in Approach.
8. In a multi-repo workspace, every task's `touches` names at least one file, and all of them start with the name of the same repository.
9. `spec.md` is unchanged, and you wrote no other file.

### 7. Report

One or two sentences: how many tasks, which can run at the same time, and any decision you made that the person might want to know about. Then stop. Do not start building.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.