Scope some workflow steps to individual features
This commit is contained in:
parent
53e83a666b
commit
77b25c461e
5 changed files with 77 additions and 53 deletions
|
|
@ -1,36 +1,40 @@
|
|||
---
|
||||
description: Implement tasks with continuous formal verification
|
||||
argument-hint: [task-id]
|
||||
argument-hint: <feature-name> [task-id]
|
||||
allowed-tools: [Read, Write, Edit, Glob, Grep, Bash, Task]
|
||||
model: opus
|
||||
---
|
||||
|
||||
# FormSpec Implement
|
||||
|
||||
You are implementing tasks from `spec/tasks.md` with continuous verification against the formal specification.
|
||||
You are implementing tasks from a feature's `tasks.md` with continuous verification against the formal specification.
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Read context
|
||||
|
||||
**$ARGUMENTS must provide at least a feature name.** It may optionally include a task ID or milestone ID (e.g., `user-auth T-03` or `user-auth M-01`). If the feature name is missing, ask the user for it.
|
||||
|
||||
**Locate the feature directory**: Glob for `spec/features/*-<feature-name>/tasks.md`. If no match is found, tell the user to run `/formspec.tasks.5 <feature-name>` first and stop.
|
||||
|
||||
Read:
|
||||
- `spec/tasks.md`
|
||||
- `spec/plan.md`
|
||||
- The feature's `tasks.md`
|
||||
- The feature's `plan.md`
|
||||
- The feature's `design.md`
|
||||
- `spec/formal/traceability.md`
|
||||
- `spec/formal/System.tla`
|
||||
- Relevant feature design docs (determine which ones from the task's "Implements" field)
|
||||
|
||||
### 2. Select task
|
||||
|
||||
If `$ARGUMENTS` specifies a task ID (e.g., `T-03`) or milestone ID (e.g., `M-01`): implement that task or all remaining tasks for that milestone. Verify dependencies are complete first — if not, warn the user and suggest implementing dependencies first.
|
||||
If $ARGUMENTS includes a task ID (e.g., `T-03`) or milestone ID (e.g., `M-01`): implement that task or all remaining tasks for that milestone. Verify dependencies are complete first — if not, warn the user and suggest implementing dependencies first.
|
||||
|
||||
If `$ARGUMENTS` is empty: find the next task whose dependencies are all complete. If multiple tasks are ready, pick the lowest-numbered one.
|
||||
If no task ID is specified: find the next task in this feature's `tasks.md` whose dependencies are all complete. If multiple tasks are ready, pick the lowest-numbered one.
|
||||
|
||||
If all tasks are complete, report that and suggest running `/formspec.docs.7` to generate documentation, then `/formspec.check.8` to validate consistency.
|
||||
|
||||
### 3. Implement the task
|
||||
|
||||
Read the task's full specification from `spec/tasks.md`.
|
||||
Read the task's full specification from the feature's `tasks.md`.
|
||||
|
||||
Follow TDD:
|
||||
1. Write unit tests first, derived from the task's acceptance criteria. These tests verify the component's contract in isolation — they are not TLA+ property checks, they are component-level correctness checks.
|
||||
|
|
@ -39,7 +43,7 @@ Follow TDD:
|
|||
|
||||
Unit tests at this level serve two purposes: they catch implementation bugs early (before dependent tasks build on a broken foundation), and they force component boundaries to remain clear and well-defined, which makes later integration smoother.
|
||||
|
||||
**a. Implement the code** following the plan's architecture and technology choices. When the task involves a component that exposes or consumes an interface, refer to the Interface Contract section in the relevant design doc for the concrete schemas, wire formats, and error conventions.
|
||||
**a. Implement the code** following the feature plan's architecture and technology choices. When the task involves a component that exposes or consumes an interface, refer to the Interface Contract section in the feature's design doc for the concrete schemas, wire formats, and error conventions.
|
||||
|
||||
**b. Run the task's unit-level verification**:
|
||||
- Unit tests for the component being implemented
|
||||
|
|
@ -62,7 +66,7 @@ If the failure reveals an **inconsistency with the TLA+ spec** (the implementati
|
|||
|
||||
**d. Mark task complete**:
|
||||
|
||||
After unit tests pass, mark the task complete in `spec/tasks.md` (e.g., append `✓ COMPLETE` to the title).
|
||||
After unit tests pass, mark the task complete in the feature's `tasks.md` (e.g., append `✓ COMPLETE` to the title).
|
||||
|
||||
**e. Continue to next task**:
|
||||
|
||||
|
|
@ -75,7 +79,7 @@ Stop regardless of the developer's preference when:
|
|||
|
||||
### 4. Verify milestones
|
||||
|
||||
After completing a task, check whether any verification milestones in `spec/tasks.md` have all their tasks complete. For each newly-completed milestone:
|
||||
After completing a task, check whether any verification milestones in the feature's `tasks.md` have all their tasks complete. For each newly-completed milestone:
|
||||
|
||||
**a. Run the milestone's verification**: If `spec/hooks/run-checks` exists and is executable, delegate the milestone's verification to it (see `/formspec.init` for the hook interface). The request should include the milestone's properties, verification methods, and hints (e.g., the test commands from the plan). The external system runs the checks independently and returns results.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue