Scope some workflow steps to individual features

This commit is contained in:
Ohad Livne 2026-02-28 09:56:26 +02:00
parent 53e83a666b
commit 77b25c461e
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D
5 changed files with 77 additions and 53 deletions

View file

@ -1,24 +1,30 @@
---
description: Break the implementation plan into ordered tasks
argument-hint: <feature-name>
allowed-tools: [Read, Write, Edit, Glob, Grep]
---
# FormSpec Tasks
You are breaking the implementation plan into concrete, dependency-ordered tasks that can be executed one at a time.
You are breaking a feature's implementation plan into concrete, dependency-ordered tasks that can be executed one at a time.
## Steps
### 1. Read artifacts
**$ARGUMENTS must provide a feature name.** If empty, ask the user for a feature name. The feature name should be the kebab-case identifier used when the feature was designed (e.g., `user-auth`, `billing`).
**Locate the feature directory**: Glob for `spec/features/*-<feature-name>/plan.md`. If no match is found, tell the user to run `/formspec.plan.4 <feature-name>` first and stop.
Read:
- `spec/plan.md` (must exist — if not, direct user to `/formspec.plan.4`)
- The feature's `plan.md`
- The feature's `design.md`
- `spec/formal/traceability.md`
- All feature design docs: Glob for `spec/features/*/design.md`
- Other features' `tasks.md` files (Glob for `spec/features/*/tasks.md`) — to understand what infrastructure and components already exist or are in progress, avoiding duplicate work
### 2. Generate spec/tasks.md
### 2. Generate the feature's tasks
Write `spec/tasks.md` with two sections: implementation tasks and verification milestones.
Write `spec/features/YYYY-MM-DD-<feature-name>/tasks.md` (in the same directory as the feature's `design.md` and `plan.md`) with two sections: implementation tasks and verification milestones.
Implementation tasks are fine-grained and component-oriented — they track what code to write. Verification milestones are coarser and property-oriented — they define when a TLA+ property can actually be validated end-to-end. This separation exists because the implementation architecture is more fine-grained than the specification: a single formal property (e.g., crash safety) typically spans multiple implementation components (persistence layer + coordinator + integration tests), so no single task is a meaningful checkpoint for validating it.
@ -36,6 +42,10 @@ Implementation tasks are fine-grained and component-oriented — they track what
Tasks do NOT have a "Verifies" field for TLA+ properties. Individual tasks verify their own component contracts through unit tests; TLA+ properties are verified at the milestone level.
Task IDs are scoped to this feature — each feature's tasks start at T-01. When referencing tasks across features (rare, but possible for shared infrastructure), use the feature directory name as a prefix (e.g., `2026-02-10-user-auth/T-03`).
Dependencies on components from other features are not expressed as task dependencies. Instead, note them in the task description as preconditions (e.g., "Requires the persistence layer from 2026-02-10-user-auth to be implemented"). The developer is responsible for ensuring cross-feature preconditions are met before starting.
#### Milestone format
After the tasks, add a milestones section:
@ -55,14 +65,14 @@ A milestone gates on a set of tasks. Only after all of its tasks are complete ca
### 3. Coverage requirements
**Tasks** must collectively cover:
- **All user stories** from all feature design docs (every US-N must appear in at least one task's "Implements" field)
- **All implementation components** from the plan's architecture
- **F* proof modules** if included in the plan
- **Infrastructure setup** tasks (project scaffolding, CI configuration, test harness) where needed
- **All user stories** from this feature's design doc (every US-N must appear in at least one task's "Implements" field)
- **All implementation components** from this feature's plan architecture
- **F* proof modules** if included in this feature's plan
- **Infrastructure setup** tasks (project scaffolding, CI configuration, test harness) where needed — but only if not already provided by a prior feature
**Milestones** must collectively cover:
- **Every TLA+ property** from traceability.md that has a runtime or integration-level verification method
- **Every verification method** from the plan's Verification Strategy table
- **Every TLA+ property** sourced from this feature in traceability.md that has a runtime or integration-level verification method
- **Every verification method** from this feature's plan Verification Strategy table
- Properties verified by structural or compile-time guarantees do not need milestones — they are validated by the data model or type system, not by test execution
### 4. Dependency ordering rules
@ -77,12 +87,12 @@ A milestone gates on a set of tasks. Only after all of its tasks are complete ca
### 5. Validation
Before finishing, check:
- Every US-N from every feature design doc is covered by at least one task
- Every TLA+ property from traceability.md with a runtime verification method is covered by at least one milestone
- Every milestone's task list references valid task IDs
- Every task's dependencies reference valid task IDs
- Every US-N from this feature's design doc is covered by at least one task
- Every TLA+ property sourced from this feature in traceability.md with a runtime verification method is covered by at least one milestone
- Every milestone's task list references valid task IDs within this feature
- Every task's dependencies reference valid task IDs within this feature
- No circular dependency chains exist in the task graph
- The dependency graph has a valid topological ordering
- Every milestone's tasks collectively provide the components needed to execute its verification method (e.g., a milestone that verifies crash recovery must include tasks for persistence, the coordinator, and the recovery integration test)
Report any gaps found during validation. Suggest proceeding with `/formspec.implement.6` to start implementing tasks.
Report any gaps found during validation. Suggest proceeding with `/formspec.implement.6 <feature-name>` to start implementing tasks.