feinai 0.6.6 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +12 -14
- package/package.json +1 -2
- package/skills/feinai-dispatch/SKILL.md +9 -9
- package/skills/feinai-implement/SKILL.md +57 -57
- package/skills/feinai-write-spec/SKILL.md +132 -27
- package/skills/feinai-write-tasks/SKILL.md +1 -1
- package/src/cli.ts +123 -25
- package/src/dashboard.html +122 -24
- package/src/db.ts +8 -0
- package/src/format.ts +2 -2
- package/src/server-state.ts +180 -0
- package/src/server.ts +13 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
5
5
|
|
|
6
|
+
## [0.7.0] - 2026-06-22
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
- **Project-scoped server port tracking** (`server_state` table in `feinai.db`)
|
|
10
|
+
- `feinai status` now validates & repairs the server record before printing the exact project URL
|
|
11
|
+
- `feinai server` auto-increments from port 8272 when the default is busy
|
|
12
|
+
- `feinai server --down` targets the recorded pid/port for this project
|
|
13
|
+
- Graceful shutdown clears the server record from the DB
|
|
14
|
+
- 6 unit tests for server-state DB operations
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- **Normalized language**: removed all "Claude Code" and provider-specific references across CLI, README, and skill files
|
|
18
|
+
- `feinai-implement` skill fully translated from Spanish to English
|
|
19
|
+
- `CLAUDE.md` references → `AGENTS.md`, `.claude/ARCHITECTURE.md` → `ARCHITECTURE.md`
|
|
20
|
+
- `formatStatus` accepts optional `serverUrl` parameter
|
|
21
|
+
|
|
6
22
|
## [0.6.3] - 2026-06-11
|
|
7
23
|
|
|
8
24
|
### Fixed
|
package/README.md
CHANGED
|
@@ -109,28 +109,26 @@ Agents don't parse `QUEUE.md`. They talk to a small local coordination service i
|
|
|
109
109
|
|
|
110
110
|
---
|
|
111
111
|
|
|
112
|
-
##
|
|
112
|
+
## Agent harness skills
|
|
113
113
|
|
|
114
|
-
feinai ships
|
|
114
|
+
feinai ships three skills covering the full development loop. They activate automatically when `.feinai/feinai.db` is present:
|
|
115
115
|
|
|
116
|
-
| Skill | Purpose
|
|
117
|
-
|
|
118
|
-
| `feinai-
|
|
119
|
-
| `feinai-
|
|
120
|
-
| `feinai-
|
|
121
|
-
| `feinai-dispatch` | Orchestrates subagents in isolated git worktrees |
|
|
122
|
-
| `feinai-implement` | Claims and executes one task end‑to‑end |
|
|
116
|
+
| Skill | Purpose |
|
|
117
|
+
|---------------------|----------------------------------------------------------------------------------|
|
|
118
|
+
| `feinai-write-spec` | Full pipeline: spec + plan + tasks. With no argument runs the complete flow; with a SPEC-ID argument regenerates tasks only (use when iterating on an existing plan) |
|
|
119
|
+
| `feinai-dispatch` | Orchestrates subagents in isolated git worktrees |
|
|
120
|
+
| `feinai-implement` | Claims and executes one task end‑to‑end |
|
|
123
121
|
|
|
124
122
|
Together they cover: design → spec → plan → tasks → parallel execution → merge.
|
|
125
123
|
|
|
126
|
-
### Activating skills
|
|
124
|
+
### Activating skills
|
|
127
125
|
|
|
128
126
|
```sh
|
|
129
|
-
mkdir -p
|
|
127
|
+
mkdir -p <your-harness-skills-dir>
|
|
130
128
|
SKILLS=~/.bun/install/global/node_modules/feinai/skills
|
|
131
129
|
|
|
132
|
-
for skill in feinai-
|
|
133
|
-
ln -sf "$SKILLS/$skill"
|
|
130
|
+
for skill in feinai-write-spec feinai-dispatch feinai-implement; do
|
|
131
|
+
ln -sf "$SKILLS/$skill" <your-harness-skills-dir>/$skill
|
|
134
132
|
done
|
|
135
133
|
```
|
|
136
134
|
|
|
@@ -151,7 +149,7 @@ This installs:
|
|
|
151
149
|
|
|
152
150
|
### PATH setup (non‑interactive SSH)
|
|
153
151
|
|
|
154
|
-
In interactive shells and for local agents
|
|
152
|
+
In interactive shells and for local coding agents it should work out of the box.
|
|
155
153
|
|
|
156
154
|
For non‑interactive SSH sessions (e.g. `ssh host 'feinai status'`), you may need a one‑time setup:
|
|
157
155
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feinai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Task & spec manager for AI agents — parallel worktrees, live dashboard, SDD skills",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"keywords": [
|
|
22
22
|
"task-manager",
|
|
23
23
|
"sdd",
|
|
24
|
-
"claude-code",
|
|
25
24
|
"ai-agents",
|
|
26
25
|
"sqlite",
|
|
27
26
|
"cli",
|
|
@@ -76,19 +76,19 @@ feinai is installed but no DB in this project. Ask the user:
|
|
|
76
76
|
|
|
77
77
|
---
|
|
78
78
|
|
|
79
|
-
### Failure: skills not activating in
|
|
79
|
+
### Failure: skills not activating in your agent harness
|
|
80
80
|
|
|
81
|
-
If
|
|
81
|
+
If your agent harness doesn't recognize `feinai-dispatch` or other skills after install:
|
|
82
82
|
|
|
83
83
|
> Run this to activate the skills:
|
|
84
84
|
> ```bash
|
|
85
|
-
> mkdir -p
|
|
85
|
+
> mkdir -p <your-harness-skills-dir>
|
|
86
86
|
> SKILLS=~/.bun/install/global/node_modules/feinai/skills
|
|
87
87
|
> for skill in feinai-sdd feinai-write-spec feinai-write-tasks feinai-dispatch feinai-implement; do
|
|
88
|
-
> ln -sf "$SKILLS/$skill"
|
|
88
|
+
> ln -sf "$SKILLS/$skill" <your-harness-skills-dir>/$skill
|
|
89
89
|
> done
|
|
90
90
|
> ```
|
|
91
|
-
> Then restart
|
|
91
|
+
> Then restart your agent harness.
|
|
92
92
|
|
|
93
93
|
**Offer to run it.**
|
|
94
94
|
|
|
@@ -162,7 +162,7 @@ For each iteration:
|
|
|
162
162
|
For each task to dispatch:
|
|
163
163
|
|
|
164
164
|
```bash
|
|
165
|
-
git worktree add .
|
|
165
|
+
git worktree add .worktrees/TASK-X-id <branch>
|
|
166
166
|
```
|
|
167
167
|
|
|
168
168
|
Branch naming: `feature/TASK-X-id-slug` derived from the subject.
|
|
@@ -171,7 +171,7 @@ Branch naming: `feature/TASK-X-id-slug` derived from the subject.
|
|
|
171
171
|
|
|
172
172
|
```bash
|
|
173
173
|
feinai take TASK-X --json # atomic claim, sin worktree aún
|
|
174
|
-
feinai task edit TASK-X --worktree .
|
|
174
|
+
feinai task edit TASK-X --worktree .worktrees/TASK-X-id
|
|
175
175
|
```
|
|
176
176
|
|
|
177
177
|
Order matters: take first (atomic reservation), then edit to record the worktree path.
|
|
@@ -218,7 +218,7 @@ For each `completed` task:
|
|
|
218
218
|
|
|
219
219
|
1. Run the quality gates **again** in the worktree as a final check
|
|
220
220
|
2. Merge worktree branch into the working branch
|
|
221
|
-
3. Remove the worktree: `git worktree remove .
|
|
221
|
+
3. Remove the worktree: `git worktree remove .worktrees/TASK-X-id`
|
|
222
222
|
4. Clear the worktree field: `feinai task edit TASK-X --worktree ""`
|
|
223
223
|
|
|
224
224
|
If the merge has conflicts → treat as a failure. Go to Phase 3.
|
|
@@ -270,7 +270,7 @@ When `feinai list --spec SPEC-NNN --pending --json` returns empty:
|
|
|
270
270
|
|
|
271
271
|
### Worktree rules (non-negotiable)
|
|
272
272
|
|
|
273
|
-
- ✅ Each task gets its own worktree under `.
|
|
273
|
+
- ✅ Each task gets its own worktree under `.worktrees/`
|
|
274
274
|
- ✅ Subagent never switches branches, never works outside its worktree
|
|
275
275
|
- ✅ Worktree path is recorded in feinai (`worktree` field) immediately after `take`
|
|
276
276
|
- ❌ Never run `git checkout` on the main working tree during dispatch
|
|
@@ -17,117 +17,117 @@ If any fails: stop and report. Do not improvise.
|
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## On startup
|
|
21
21
|
|
|
22
|
-
1. `feinai list --pending --json` —
|
|
23
|
-
2.
|
|
24
|
-
3. `feinai take <TASK-ID> --owner implement-agent` —
|
|
25
|
-
4.
|
|
26
|
-
5.
|
|
22
|
+
1. `feinai list --pending --json` — find the first available task (no pending blockers)
|
|
23
|
+
2. If none exists → respond "No pending tasks" and stop
|
|
24
|
+
3. `feinai take <TASK-ID> --owner implement-agent` — claim it atomically
|
|
25
|
+
4. If the task has `spec_id` → `feinai spec content <SPEC-ID>` for context
|
|
26
|
+
5. If the task has `blocked_by` with uncompleted tasks → release with `feinai release <TASK-ID>` and stop
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Read `AGENTS.md` of the project for architecture and project-specific conventions.
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
-
##
|
|
32
|
+
## Execute the task
|
|
33
33
|
|
|
34
|
-
**
|
|
34
|
+
**Step 1 — Isolated worktree:**
|
|
35
35
|
```bash
|
|
36
36
|
feinai git worktree add .worktrees/<TASK-ID> origin/main
|
|
37
37
|
cd .worktrees/<TASK-ID>
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
**
|
|
41
|
-
|
|
40
|
+
**Step 2 — Worktree setup:**
|
|
41
|
+
Install dependencies if the project requires them. Check `AGENTS.md` of the project for the exact command.
|
|
42
42
|
|
|
43
|
-
**
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
43
|
+
**Step 3 — Read before writing:**
|
|
44
|
+
- The full task description (`feinai show <TASK-ID>`)
|
|
45
|
+
- The files you will touch — read them before editing
|
|
46
|
+
- If there is a **Workplan** in the description → follow those steps in exact order
|
|
47
47
|
|
|
48
|
-
**
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
48
|
+
**Step 4 — Implement:**
|
|
49
|
+
Exactly what the task says. No more, no less.
|
|
50
|
+
- Do not touch files outside the task scope
|
|
51
|
+
- If a file "to create" already exists → extend it instead of overwriting if it already contains valid content
|
|
52
52
|
|
|
53
|
-
**
|
|
54
|
-
|
|
53
|
+
**Step 5 — Commit:**
|
|
54
|
+
One commit per task. Conventional commits:
|
|
55
55
|
```
|
|
56
|
-
feat(scope):
|
|
56
|
+
feat(scope): concise description
|
|
57
57
|
```
|
|
58
|
-
|
|
58
|
+
Types: `feat`, `fix`, `refactor`, `test`, `chore`.
|
|
59
59
|
|
|
60
|
-
**
|
|
61
|
-
|
|
60
|
+
**Step 6 — Quality gates:**
|
|
61
|
+
Run the gates defined in the task (`quality_gates`). If the task does not specify them, check `AGENTS.md` of the project for default gates.
|
|
62
62
|
|
|
63
|
-
**
|
|
63
|
+
**Step 7 — Close:**
|
|
64
64
|
|
|
65
|
-
Gates
|
|
65
|
+
Gates pass:
|
|
66
66
|
```bash
|
|
67
|
-
#
|
|
67
|
+
# From the worktree:
|
|
68
68
|
feinai git push origin HEAD:main
|
|
69
69
|
|
|
70
|
-
#
|
|
70
|
+
# From the repo root:
|
|
71
71
|
feinai git worktree remove .worktrees/<TASK-ID>
|
|
72
72
|
feinai git complete
|
|
73
73
|
|
|
74
74
|
feinai done <TASK-ID> --result "gates ✓"
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
Gates
|
|
77
|
+
Gates fail → follow "If something fails".
|
|
78
78
|
|
|
79
|
-
**Done = 3
|
|
80
|
-
1. Quality gates
|
|
81
|
-
2.
|
|
82
|
-
3.
|
|
79
|
+
**Done = 3 observable facts:**
|
|
80
|
+
1. Quality gates pass without errors
|
|
81
|
+
2. The task files exist with correct content
|
|
82
|
+
3. Clean commit on `main` and task status `completed` in feinai
|
|
83
83
|
|
|
84
84
|
---
|
|
85
85
|
|
|
86
|
-
##
|
|
86
|
+
## If something fails
|
|
87
87
|
|
|
88
|
-
Gates
|
|
88
|
+
Gates fail, push fails, or error at any step:
|
|
89
89
|
|
|
90
|
-
1. **
|
|
91
|
-
2. Push a
|
|
90
|
+
1. **Do not clean the worktree**
|
|
91
|
+
2. Push to a backup branch:
|
|
92
92
|
```bash
|
|
93
93
|
feinai git push origin HEAD:backup/<TASK-ID>
|
|
94
94
|
```
|
|
95
|
-
3.
|
|
95
|
+
3. Mark the task as failed:
|
|
96
96
|
```bash
|
|
97
|
-
feinai fail <TASK-ID> --error "<
|
|
97
|
+
feinai fail <TASK-ID> --error "<exact command + relevant output>"
|
|
98
98
|
```
|
|
99
|
-
4.
|
|
99
|
+
4. Leave the worktree intact for manual recovery
|
|
100
100
|
|
|
101
101
|
---
|
|
102
102
|
|
|
103
|
-
## Git — `feinai git`
|
|
103
|
+
## Git — `feinai git` exclusively
|
|
104
104
|
|
|
105
|
-
`git`
|
|
105
|
+
`git` and `gh` are blocked. Use `feinai git` for everything — it is opengit bundled with feinai.
|
|
106
106
|
|
|
107
|
-
**
|
|
107
|
+
**Allowed:**
|
|
108
108
|
- `feinai git worktree add/list/lock/unlock`
|
|
109
109
|
- `feinai git add`, `commit`, `push`, `status`, `diff`, `log`, `show`
|
|
110
|
-
- `feinai git complete` —
|
|
110
|
+
- `feinai git complete` — syncs local main after push (only from repo root)
|
|
111
111
|
|
|
112
|
-
**
|
|
113
|
-
- `feinai git branch`, `checkout`, `switch` —
|
|
112
|
+
**Prohibited:**
|
|
113
|
+
- `feinai git branch`, `checkout`, `switch` — never switch branches
|
|
114
114
|
- `feinai git merge`, `rebase`, `reset`, `cherry-pick`
|
|
115
115
|
- `feinai git fetch`, `pull`, `remote`, `clone`
|
|
116
116
|
- `feinai git stash`, `tag`
|
|
117
|
-
- `feinai git worktree remove` —
|
|
117
|
+
- `feinai git worktree remove` — only after successful push
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
If `feinai git` fails → **STOP**. Do not retry, do not use `git`. Report to the user.
|
|
120
120
|
|
|
121
121
|
---
|
|
122
122
|
|
|
123
|
-
##
|
|
123
|
+
## Absolute rules
|
|
124
124
|
|
|
125
|
-
**
|
|
125
|
+
**Do not modify:**
|
|
126
126
|
- `AGENTS.md`, `CLAUDE.md`
|
|
127
|
-
-
|
|
128
|
-
-
|
|
127
|
+
- CI/CD, infrastructure, or secret configuration files (`.env`, `.env.*`)
|
|
128
|
+
- The feinai DB directly
|
|
129
129
|
|
|
130
|
-
**
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
130
|
+
**Code:**
|
|
131
|
+
- No `any` without a justified comment on the same line
|
|
132
|
+
- If a test fails: fix either the test or the implementation. Never silence, skip, or add workarounds to make the gate "pass"
|
|
133
|
+
- If the cause is not obvious → **STOP**, report to the user with the exact command and the full output
|
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: feinai-write-spec
|
|
3
|
-
description: Use when the user wants to design a new feature, refactor, or change in a project that has `.feinai/feinai.db`.
|
|
3
|
+
description: Use when the user wants to design a new feature, refactor, or change in a project that has `.feinai/feinai.db`. With no argument, runs the full pipeline (spec + plan + tasks). With a SPEC-ID argument, skips to task generation only (use when iterating on an existing plan). Replaces `brainstorming` + `writing-plans` + `feinai-write-tasks` from superpowers when feinai is active.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# feinai-write-spec
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Full pipeline: spec → plan → tasks. One skill, two entry points.
|
|
9
|
+
|
|
10
|
+
## Entry point detection
|
|
11
|
+
|
|
12
|
+
**Check the first argument before doing anything else.**
|
|
13
|
+
|
|
14
|
+
- **No argument** → full pipeline (Phases 1–5)
|
|
15
|
+
- **SPEC-ID given** (e.g. `SPEC-42`) → tasks only, jump to **Phase 4**
|
|
16
|
+
|
|
17
|
+
Ask the user which mode only if ambiguous.
|
|
18
|
+
|
|
19
|
+
---
|
|
9
20
|
|
|
10
21
|
## Preconditions
|
|
11
22
|
|
|
12
23
|
Run `feinai status` (exit 0 = feinai is active). If not active, stop and ask the
|
|
13
24
|
user if they want `feinai init` or to fall back to vanilla superpowers.
|
|
14
25
|
|
|
15
|
-
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Phase 1 — Decide entry mode (full pipeline only)
|
|
16
29
|
|
|
17
30
|
Decide which entry mode applies BEFORE doing anything else. Ask the user only if ambiguous.
|
|
18
31
|
|
|
@@ -31,12 +44,12 @@ as a minimal change (just the input + endpoint call) or shall I think wider
|
|
|
31
44
|
|
|
32
45
|
---
|
|
33
46
|
|
|
34
|
-
## Phase
|
|
47
|
+
## Phase 2 — Load project context (full pipeline only)
|
|
35
48
|
|
|
36
49
|
Read **in this order, stop early if enough**:
|
|
37
50
|
|
|
38
|
-
1. `
|
|
39
|
-
2.
|
|
51
|
+
1. `AGENTS.md` (root) — already in your context normally
|
|
52
|
+
2. `ARCHITECTURE.md` (root)
|
|
40
53
|
3. `README.md`
|
|
41
54
|
4. `decisions/` directory (just file names, read only if a name matches the topic)
|
|
42
55
|
|
|
@@ -50,9 +63,9 @@ Keep this phase tight — every read costs tokens. Stop as soon as you can write
|
|
|
50
63
|
|
|
51
64
|
---
|
|
52
65
|
|
|
53
|
-
## Phase
|
|
66
|
+
## Phase 3 — Draft and write the spec + plan (full pipeline only)
|
|
54
67
|
|
|
55
|
-
|
|
68
|
+
### Spec (what and why — not how)
|
|
56
69
|
|
|
57
70
|
Required sections:
|
|
58
71
|
- **Goal** — one sentence
|
|
@@ -90,19 +103,14 @@ feinai spec add SPEC-NNN "Short title" --stdin <<'FEINAI_EOF'
|
|
|
90
103
|
FEINAI_EOF
|
|
91
104
|
```
|
|
92
105
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
## Phase 3 — Draft and write the plan
|
|
96
|
-
|
|
97
|
-
**Plan answers: how.** Architecture decisions, file map, dependencies.
|
|
106
|
+
### Plan (how — architecture decisions, file map, dependencies)
|
|
98
107
|
|
|
99
108
|
Required sections:
|
|
100
109
|
- **Architecture overview** — 2–4 sentences
|
|
101
110
|
- **Files to touch** — explicit list
|
|
102
|
-
- **Task breakdown preview** — high-level (the actual tasks
|
|
111
|
+
- **Task breakdown preview** — high-level (the actual tasks come in Phase 4)
|
|
103
112
|
- **Quality gates** — the commands that prove correctness
|
|
104
113
|
|
|
105
|
-
**Write the plan:**
|
|
106
114
|
```bash
|
|
107
115
|
feinai plan add SPEC-NNN --stdin <<'FEINAI_EOF'
|
|
108
116
|
# Plan v1 — SPEC-NNN: Title
|
|
@@ -127,19 +135,112 @@ FEINAI_EOF
|
|
|
127
135
|
|
|
128
136
|
---
|
|
129
137
|
|
|
130
|
-
## Phase 4 —
|
|
138
|
+
## Phase 4 — Build the task graph
|
|
131
139
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
140
|
+
*Entry point when SPEC-ID is given as argument.*
|
|
141
|
+
|
|
142
|
+
### Step 1 — Load spec + plan
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
feinai spec show SPEC-NNN --full
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Read both. Internalize:
|
|
149
|
+
- The WHAT (spec)
|
|
150
|
+
- The HOW (plan)
|
|
151
|
+
- The "Files to touch" list
|
|
152
|
+
- The "Task breakdown preview" — your starting point, not a contract
|
|
153
|
+
|
|
154
|
+
### Step 2 — Analyze granularity and parallelism
|
|
155
|
+
|
|
156
|
+
**A. Granularity** — one task = one logical change a single subagent can complete in one session.
|
|
157
|
+
- Too big: "implement the entire auth system" → split by route
|
|
158
|
+
- Too small: "add a single import" → merge into larger task
|
|
159
|
+
- Sweet spot: ~50–300 lines, 1–3 files
|
|
160
|
+
|
|
161
|
+
**B. Parallelism rule — no exceptions:**
|
|
162
|
+
|
|
163
|
+
> **Tasks that touch the same file cannot run in parallel.**
|
|
164
|
+
|
|
165
|
+
When a **shared file** needs changes (e.g. `router.ts`, `index.ts`, schema), extract it first:
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
TASK-NNN-0: edit shared file once
|
|
169
|
+
↓ blocks
|
|
170
|
+
TASK-NNN-1: feature A ┐
|
|
171
|
+
TASK-NNN-2: feature B ├ parallel
|
|
172
|
+
TASK-NNN-3: feature C ┘
|
|
173
|
+
```
|
|
135
174
|
|
|
136
|
-
|
|
175
|
+
**C. Dependencies** — use `--blocked-by` for:
|
|
176
|
+
- File-level conflicts (above)
|
|
177
|
+
- Logical dependencies (B uses a type defined in A)
|
|
178
|
+
|
|
179
|
+
### Step 3 — Embed TDD instructions
|
|
180
|
+
|
|
181
|
+
Each implementation task description starts with:
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
## TDD baseline
|
|
185
|
+
Write the tests first based on the "Tests required" section of SPEC-NNN.
|
|
186
|
+
Run them — they must fail (the implementation doesn't exist yet).
|
|
187
|
+
Implement until all tests pass. Then run the quality gates.
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
No separate "write tests" tasks. Test + implementation live together.
|
|
191
|
+
|
|
192
|
+
**Exception:** if shared fixtures are needed across tasks, extract them into a tiny TASK-NNN-0 that others block on.
|
|
193
|
+
|
|
194
|
+
### Step 4 — Write the tasks
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
feinai add TASK-NNN-X "subject" \
|
|
198
|
+
--spec SPEC-NNN \
|
|
199
|
+
--desc "$(cat <<'EOF'
|
|
200
|
+
## TDD baseline
|
|
201
|
+
Write the tests first based on the "Tests required" section of SPEC-NNN.
|
|
202
|
+
Run them — they must fail. Implement until they pass.
|
|
203
|
+
|
|
204
|
+
## Files to touch
|
|
205
|
+
- packages/X/...
|
|
206
|
+
- packages/Y/...
|
|
207
|
+
|
|
208
|
+
## Implementation notes
|
|
209
|
+
<concrete, copy-pasteable details. Cite line numbers if useful.>
|
|
210
|
+
|
|
211
|
+
## Do not touch
|
|
212
|
+
- <files explicitly out of scope>
|
|
213
|
+
EOF
|
|
214
|
+
)" \
|
|
215
|
+
--package "@scope/pkg" \
|
|
216
|
+
--gate "pnpm --filter @scope/pkg typecheck" \
|
|
217
|
+
--gate "pnpm --filter @scope/pkg test -- --run" \
|
|
218
|
+
--blocked-by TASK-NNN-Y # repeatable if needed
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Task description = self-contained.** The subagent reads only the task (via `feinai take`) and gets spec+plan as `spec_context` automatically.
|
|
137
222
|
|
|
138
223
|
---
|
|
139
224
|
|
|
140
|
-
##
|
|
225
|
+
## Phase 5 — Hand off
|
|
226
|
+
|
|
227
|
+
Output a parallelism summary table:
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
TASK-NNN-0: shared file edit (sequential)
|
|
231
|
+
TASK-NNN-1: feature A (parallel with 2, 3) blocked-by 0
|
|
232
|
+
TASK-NNN-2: feature B (parallel with 1, 3) blocked-by 0
|
|
233
|
+
TASK-NNN-3: feature C (parallel with 1, 2) blocked-by 0
|
|
234
|
+
TASK-NNN-4: integration tests (sequential) blocked-by 1, 2, 3
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Tell the user:
|
|
238
|
+
> Tasks written for SPEC-NNN. View with `feinai list --spec SPEC-NNN`.
|
|
239
|
+
> Next step: run `/feinai-dispatch SPEC-NNN` to execute.
|
|
240
|
+
|
|
241
|
+
---
|
|
141
242
|
|
|
142
|
-
|
|
243
|
+
## Key questions to ask (inline, only if needed)
|
|
143
244
|
|
|
144
245
|
- Ambiguity in scope: *"Do we include X in this spec or punt to a follow-up?"*
|
|
145
246
|
- Missing architecture decision: *"This needs a choice between A and B. Default is A unless you say otherwise."*
|
|
@@ -152,18 +253,19 @@ These come up mid-session. Ask them inline, one at a time, brief:
|
|
|
152
253
|
## What NOT to do
|
|
153
254
|
|
|
154
255
|
- ❌ Write `docs/superpowers/specs/*.md` files — spec lives in feinai
|
|
155
|
-
- ❌ Create tasks in this skill — that's `feinai-write-tasks`
|
|
156
256
|
- ❌ Invent architecture if `ARCHITECTURE.md` is silent — ask the user
|
|
157
257
|
- ❌ Write spec content that is actually a plan (HOW). Keep them separated.
|
|
158
|
-
- ❌ Ask the user to confirm before writing — write
|
|
258
|
+
- ❌ Ask the user to confirm before writing — write spec/plan/tasks, then they review
|
|
259
|
+
- ❌ Re-think architecture in Phase 4 — it's in the plan, follow it
|
|
260
|
+
- ❌ Write tasks without a SPEC-ID — every task must have `--spec SPEC-NNN`
|
|
261
|
+
- ❌ Skip the same-file analysis — it's the single biggest cause of merge conflicts
|
|
262
|
+
- ❌ Hardcode worktree paths — `feinai-dispatch` assigns those at execution time
|
|
159
263
|
|
|
160
264
|
---
|
|
161
265
|
|
|
162
266
|
## Subagent isolation
|
|
163
267
|
|
|
164
|
-
If you delegate
|
|
165
|
-
the subagent must NOT use this skill — it has no context. Hand it concrete
|
|
166
|
-
findings and let it return text; you write to feinai yourself.
|
|
268
|
+
If you delegate spec drafting to a subagent, the subagent must NOT use this skill. Hand it concrete findings and let it return text; you write to feinai yourself.
|
|
167
269
|
|
|
168
270
|
---
|
|
169
271
|
|
|
@@ -176,3 +278,6 @@ findings and let it return text; you write to feinai yourself.
|
|
|
176
278
|
| Update spec content | `feinai spec set-content SPEC-N --stdin <<<` content |
|
|
177
279
|
| Write plan | `feinai plan add SPEC-N --stdin <<<` content |
|
|
178
280
|
| Show spec+plan together | `feinai spec show SPEC-N --full` |
|
|
281
|
+
| List tasks for spec | `feinai list --spec SPEC-N` |
|
|
282
|
+
| Add task | `feinai add TASK-X "subject" --spec SPEC-N --desc "..." --gate "..." [--blocked-by TASK-Y]` |
|
|
283
|
+
| Edit task | `feinai task edit TASK-X --desc "..." --gate "..."` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: feinai-write-tasks
|
|
3
|
-
description: Use when a spec + plan already exist in feinai (written by `feinai-write-spec` or manually) and need to be broken down into executable tasks. Decomposes the plan into atomic `feinai add` calls, analyzes file-level parallelism, and embeds TDD instructions. Output: a set of tasks with `blocked_by` dependencies ready for `feinai-dispatch` to execute.
|
|
3
|
+
description: "Use when a spec + plan already exist in feinai (written by `feinai-write-spec` or manually) and need to be broken down into executable tasks. Decomposes the plan into atomic `feinai add` calls, analyzes file-level parallelism, and embeds TDD instructions. Output: a set of tasks with `blocked_by` dependencies ready for `feinai-dispatch` to execute."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# feinai-write-tasks
|