@ftrdotdev/pi-qrspi 0.1.0 → 0.2.1
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/README.md +11 -4
- package/package.json +16 -16
- package/prompts/qrspi-design.md +2 -2
- package/prompts/qrspi-iterate.md +8 -1
- package/prompts/qrspi-plan.md +2 -2
- package/prompts/qrspi-structure.md +2 -2
- package/prompts/qrspi.md +7 -7
- package/skills/planning-workflow/README.md +33 -0
- package/skills/planning-workflow/SKILL.md +14 -10
- package/skills/planning-workflow/templates/design-concept.md +9 -10
- package/skills/planning-workflow/templates/iterate.md +7 -7
- package/skills/planning-workflow/templates/outline.md +7 -7
- package/skills/planning-workflow/templates/plan.md +14 -14
- package/skills/planning-workflow/templates/research.md +6 -7
- package/skills/planning-workflow/templates/session-summary.md +1 -1
- package/skills/tdd/README.md +36 -0
package/README.md
CHANGED
|
@@ -14,10 +14,17 @@ QRSPI stands for **Q**uestions → **R**esearch → **D**esign → **S**tructure
|
|
|
14
14
|
|
|
15
15
|
Each phase produces an artifact: a file under `.qrspi/` in your project. The next phase reads the artifact from the previous phase.
|
|
16
16
|
|
|
17
|
-
The agent pauses at every checkpoint and asks for your approval. It does not advance until you approve. If you request changes, the agent revises the phase output and shows it to you again. You never approve blind: after each phase writes its artifact, the orchestrator
|
|
17
|
+
The agent pauses at every checkpoint and asks for your approval. It does not advance until you approve. If you request changes, the agent revises the phase output and shows it to you again. You never approve blind: after each phase writes its artifact, the orchestrator presents the full content to you — stamped frontmatter included — before asking for approval, rendered by a user-facing preview tool so it never enters the agent's context.
|
|
18
18
|
|
|
19
19
|
This package is the Pi version of the [opencode-qrspi](https://github.com/felixnorden/skills/tree/main/packages/opencode-qrspi) plugin for OpenCode. Both tools use the same `.qrspi/` artifact format, so you can switch between them without losing your research or plans.
|
|
20
20
|
|
|
21
|
+
## Credits
|
|
22
|
+
|
|
23
|
+
The framework is inspired by **Harness Engineering** — the practice of customizing a coding agent's configuration (skills, agents, commands, hooks) to improve reliability and output quality. This concept was coined by [Viv Trivedy](https://x.com/Vtrivedy10) and popularized by [Dex Horthy](https://x.com/dexhorthy) and the team at [HumanLayer](https://humanlayer.dev).
|
|
24
|
+
|
|
25
|
+
- **Blog post**: [Skill Issue: Harness Engineering for Coding Agents](https://humanlayer.dev/blog/skill-issue-harness-engineering-for-coding-agents)
|
|
26
|
+
- **Talk**: Dex Horthy on context engineering and agent harnesses ([YouTube](https://www.youtube.com/watch?v=YwZR6tc7qYg))
|
|
27
|
+
|
|
21
28
|
## Installation
|
|
22
29
|
|
|
23
30
|
Install from npm, git, or a local path:
|
|
@@ -61,7 +68,7 @@ Run the complete workflow with one command:
|
|
|
61
68
|
|
|
62
69
|
### Orchestrated flow
|
|
63
70
|
|
|
64
|
-
`/qrspi` is an orchestrator. It does not draft artifacts itself; each phase runs in a **separate fresh-context subagent**, so exploration and drafting stay out of your main session's context. The orchestrator owns the session: the Q phase, launching one phase agent at a time, relaying your answers to the Design phase,
|
|
71
|
+
`/qrspi` is an orchestrator. It does not draft artifacts itself; each phase runs in a **separate fresh-context subagent**, so exploration and drafting stay out of your main session's context. The orchestrator owns the session: the Q phase, launching one phase agent at a time, relaying your answers to the Design phase, presenting each artifact in full at every checkpoint without loading it into its own context, and producing the session summary.
|
|
65
72
|
|
|
66
73
|
Each phase agent is told exactly what to do: which template to follow, which prior artifacts to read, where to write (`.qrspi/<kind>/<slug>.md`), and what to return (the inline summary plus any open questions). Phase agents never ask you questions directly — they return questions and design options to the orchestrator, which relays them to you.
|
|
67
74
|
|
|
@@ -105,7 +112,7 @@ Six prompt templates in `prompts/`, one per phase:
|
|
|
105
112
|
| `prompts/qrspi-plan.md` | `/qrspi-plan` |
|
|
106
113
|
| `prompts/qrspi-iterate.md` | `/qrspi-iterate` |
|
|
107
114
|
|
|
108
|
-
The `/qrspi` orchestrator runs each phase in a fresh subagent session, so earlier phases do not clutter your main session's context. After each phase, the orchestrator
|
|
115
|
+
The `/qrspi` orchestrator runs each phase in a fresh subagent session, so earlier phases do not clutter your main session's context. After each phase, the orchestrator presents the full content to you before the checkpoint — what you approve is exactly what was written, including the extension-stamped frontmatter — rendered by a user-facing preview tool so it never enters the orchestrator's context. The phase prompts double as standalone commands; when run standalone they keep their interactive steps (clarify, options, completion gate), and when invoked by the orchestrator they run in orchestrated mode (no direct user interaction; questions relayed through the orchestrator).
|
|
109
116
|
|
|
110
117
|
### Extension
|
|
111
118
|
|
|
@@ -138,7 +145,7 @@ Commit these files. Research and plans are project knowledge, not temporary stat
|
|
|
138
145
|
|
|
139
146
|
## Development
|
|
140
147
|
|
|
141
|
-
The
|
|
148
|
+
The `planning-workflow` and `tdd` skills are authored in the separate [`felixnorden/skills`](https://github.com/felixnorden/skills) repo. `scripts/fetch-skills.ts` shallow-clones that repo at a pinned tag (`v0.1.0`) and copies the two skill directories into `./skills`. It runs from `prepare` (on `bun install`, so skills are present for tests) and from `prepack` (before `bun pm pack`, so they land in the tarball). `./skills` is generated, git-ignored, and never committed.
|
|
142
149
|
|
|
143
150
|
The git metadata cache resolves lazily on the first artifact write and caches per working directory for 60 seconds. The orchestrator session and its subagents share the cache, so later writes never re-run git. A bash command that changes git state (`commit`, `checkout`, `rebase`, `pull`, …) resets the cache.
|
|
144
151
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ftrdotdev/pi-qrspi",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"homepage": "https://github.com/felixnorden/
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"homepage": "https://github.com/felixnorden/pi-mono/blob/main/packages/qrspi/README.md",
|
|
5
5
|
"bugs": {
|
|
6
|
-
"url": "https://github.com/felixnorden/
|
|
6
|
+
"url": "https://github.com/felixnorden/pi-mono/issues"
|
|
7
7
|
},
|
|
8
8
|
"license": "MIT",
|
|
9
|
+
"author": "Felix Nordén <felixnorden@gmail.com>",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/felixnorden/
|
|
12
|
-
"path": "packages/
|
|
12
|
+
"url": "git+https://github.com/felixnorden/pi-mono.git",
|
|
13
|
+
"path": "packages/qrspi"
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
15
16
|
"prompts",
|
|
@@ -19,24 +20,23 @@
|
|
|
19
20
|
],
|
|
20
21
|
"type": "module",
|
|
21
22
|
"scripts": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
23
|
+
"fetch:skills": "bun run scripts/fetch-skills.ts",
|
|
24
|
+
"prepare": "[ -d skills/planning-workflow ] || bun run fetch:skills",
|
|
25
|
+
"prepack": "bun run fetch:skills",
|
|
24
26
|
"pack": "bun pm pack --destination ./dist",
|
|
25
27
|
"test": "bun test",
|
|
26
28
|
"typecheck": "tsc --noEmit",
|
|
27
|
-
"lint": "oxlint
|
|
28
|
-
"lint:fix": "oxlint
|
|
29
|
-
"fmt": "oxfmt
|
|
30
|
-
"fmt:check": "oxfmt
|
|
29
|
+
"lint": "oxlint",
|
|
30
|
+
"lint:fix": "oxlint --fix",
|
|
31
|
+
"fmt": "oxfmt",
|
|
32
|
+
"fmt:check": "oxfmt --check"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
35
|
+
"@earendil-works/pi-coding-agent": "^0.84.2",
|
|
33
36
|
"@types/bun": "latest",
|
|
34
37
|
"oxfmt": "^0.63.0",
|
|
35
|
-
"oxlint": "
|
|
36
|
-
|
|
37
|
-
"peerDependencies": {
|
|
38
|
-
"@earendil-works/pi-coding-agent": "0.84.1",
|
|
39
|
-
"typescript": ">=6.0.2"
|
|
38
|
+
"oxlint": "1.77.0",
|
|
39
|
+
"typescript": "7.0.2"
|
|
40
40
|
},
|
|
41
41
|
"pi": {
|
|
42
42
|
"prompts": [
|
package/prompts/qrspi-design.md
CHANGED
|
@@ -58,10 +58,10 @@ Write to `<worktree-root>/.qrspi/designs/{slug}.md` (the package extension stamp
|
|
|
58
58
|
|
|
59
59
|
### 7 — Completion Gate
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
Preview the written artifact to the user with a user-facing preview tool (fall back to `read` only if none exists), then ask the user to confirm the design concept is sufficient before proceeding.
|
|
62
62
|
|
|
63
63
|
- If confirmed: finalize and save the document.
|
|
64
|
-
- If not confirmed: revise according to the requested changes, then
|
|
64
|
+
- If not confirmed: revise according to the requested changes, then preview the revision and ask again for confirmation.
|
|
65
65
|
|
|
66
66
|
---
|
|
67
67
|
|
package/prompts/qrspi-iterate.md
CHANGED
|
@@ -17,7 +17,7 @@ If no feedback string is present, ask the user: "What needs to change in the pla
|
|
|
17
17
|
|
|
18
18
|
## Orchestrated Mode
|
|
19
19
|
|
|
20
|
-
When invoked as a QRSPI phase subagent from `/qrspi`: the feedback arrives in the orchestrator's task, not from the user. Skip Step 1 (Clarify) and
|
|
20
|
+
When invoked as a QRSPI phase subagent from `/qrspi`: the feedback arrives in the orchestrator's task, not from the user. Skip Step 1 (Clarify) and Step 5 (Completion Gate) — state any assumption explicitly in the revision note and return the revision summary. Interactive steps apply only when run standalone.
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
@@ -60,6 +60,13 @@ Revised: {YYYY-MM-DD} — {one-line summary of what changed}
|
|
|
60
60
|
|
|
61
61
|
Write the revised plan to the same path, overwriting the original.
|
|
62
62
|
|
|
63
|
+
### 5 — Completion Gate
|
|
64
|
+
|
|
65
|
+
Preview the revised plan to the user with a user-facing preview tool (fall back to `read` only if none exists), state which slices changed, and ask the user to confirm the revision before finishing.
|
|
66
|
+
|
|
67
|
+
- If confirmed: done.
|
|
68
|
+
- If not confirmed: revise according to the feedback, then preview the revision and ask again for confirmation.
|
|
69
|
+
|
|
63
70
|
---
|
|
64
71
|
|
|
65
72
|
Return the revision summary and plan path.
|
package/prompts/qrspi-plan.md
CHANGED
|
@@ -75,10 +75,10 @@ Write to `<worktree-root>/.qrspi/plans/{slug}.md` (the package extension stamps
|
|
|
75
75
|
|
|
76
76
|
### 7 — Completion Gate
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
Preview the written plan to the user with a user-facing preview tool (fall back to `read` only if none exists), then ask the user to confirm the plan is sufficient before proceeding.
|
|
79
79
|
|
|
80
80
|
- If confirmed: finalize and save the plan.
|
|
81
|
-
- If not confirmed: revise according to the requested changes, then
|
|
81
|
+
- If not confirmed: revise according to the requested changes, then preview the revision and ask again for confirmation.
|
|
82
82
|
|
|
83
83
|
---
|
|
84
84
|
|
|
@@ -52,10 +52,10 @@ Write to `<worktree-root>/.qrspi/outlines/{slug}.md` (the package extension stam
|
|
|
52
52
|
|
|
53
53
|
### 5 — Completion Gate
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
Preview the written outline to the user with a user-facing preview tool (fall back to `read` only if none exists), then ask the user to confirm the outline is sufficient before proceeding.
|
|
56
56
|
|
|
57
57
|
- If confirmed: finalize and save the outline.
|
|
58
|
-
- If not confirmed: revise according to the requested changes, then
|
|
58
|
+
- If not confirmed: revise according to the requested changes, then preview the revision and ask again for confirmation.
|
|
59
59
|
|
|
60
60
|
---
|
|
61
61
|
|
package/prompts/qrspi.md
CHANGED
|
@@ -26,12 +26,12 @@ Per phase launch:
|
|
|
26
26
|
- One phase per run, sequential: launch the child in the foreground (blocking) and wait for it to finish, then checkpoint. Do not parallelize phases and do not background phase work — every checkpoint is human-gated.
|
|
27
27
|
- Pass `context: 'fresh'` so the child carries no session history, and `cwd: <worktree-root>` so it reads and writes the same tree.
|
|
28
28
|
- Pass `skill: 'planning-workflow'` (add `tdd` for P and I) so the child can load the templates.
|
|
29
|
-
- The task text must be self-contained: the phase, the template to follow, the input artifact paths from prior phases, the slug, the ticket (if any), the output path `.qrspi/<kind>/<slug>.md`, and the return contract (inline summary, open questions, anything the orchestrator must relay to the user).
|
|
29
|
+
- The task text must be self-contained: the phase, the template to follow, the input artifact paths from prior phases, the slug, the ticket (if any), the output path `.qrspi/<kind>/<slug>.md`, and the return contract (the final stamped artifact path, inline summary, open questions, anything the orchestrator must relay to the user).
|
|
30
30
|
- Children write the artifacts themselves. The extension stamps the `YYYYMMDD-` prefix and frontmatter on their writes too — it is shared by the orchestrator session and its subagents.
|
|
31
31
|
|
|
32
32
|
## Artifact Preview Rule
|
|
33
33
|
|
|
34
|
-
After each phase subagent completes,
|
|
34
|
+
After each phase subagent completes, present the artifact to the user before the checkpoint — stamped frontmatter included. Use a user-facing preview tool — one that renders the file for the user without adding its contents to your context — when your environment provides one. Only use `read` (which loads contents into your context) if no such tool exists. Never ask for checkpoint approval without the artifact content visible to the user.
|
|
35
35
|
|
|
36
36
|
## Phases
|
|
37
37
|
|
|
@@ -39,15 +39,15 @@ Execute in order. **Ask the user for approval at each checkpoint — do not adva
|
|
|
39
39
|
|
|
40
40
|
**Q — Questions** (you, inline): Gather goal, hard constraints, and out-of-scope items. Do not save a file. Derive the slug if not provided. Checkpoint.
|
|
41
41
|
|
|
42
|
-
**R — Research** (subagent): Launch the research phase agent. Task: load `planning-workflow` → `templates/research.md`, research the topic, write `.qrspi/research/{slug}.md`, return the inline summary and any open questions. Then
|
|
42
|
+
**R — Research** (subagent): Launch the research phase agent. Task: load `planning-workflow` → `templates/research.md`, research the topic, write `.qrspi/research/{slug}.md`, return the inline summary and any open questions. Then preview the artifact to the user, checkpoint.
|
|
43
43
|
|
|
44
|
-
**D — Design** (subagent with interactive relay): Launch the design phase agent. The child returns its clarifying questions and 2–3 design options in its output instead of asking you. Relay them to the user with the `question` tool. On direction, send the user's choice back to the design agent (resume it if your environment supports resuming, otherwise relaunch with the choice embedded in the task); it writes `.qrspi/designs/{slug}.md` and returns the summary. Then
|
|
44
|
+
**D — Design** (subagent with interactive relay): Launch the design phase agent. The child returns its clarifying questions and 2–3 design options in its output instead of asking you. Relay them to the user with the `question` tool. On direction, send the user's choice back to the design agent (resume it if your environment supports resuming, otherwise relaunch with the choice embedded in the task); it writes `.qrspi/designs/{slug}.md` and returns the summary. Then preview the artifact to the user, checkpoint.
|
|
45
45
|
|
|
46
|
-
**S — Structure** (subagent): Launch the structure phase agent. Task: load `templates/outline.md`, produce the outline from the approved design, write `.qrspi/outlines/{slug}.md`, return the outline summary and any unresolved structural decisions. Then
|
|
46
|
+
**S — Structure** (subagent): Launch the structure phase agent. Task: load `templates/outline.md`, produce the outline from the approved design, write `.qrspi/outlines/{slug}.md`, return the outline summary and any unresolved structural decisions. Then preview the artifact to the user, checkpoint.
|
|
47
47
|
|
|
48
|
-
**P — Plan** (subagent): Launch the plan phase agent with `skill: 'planning-workflow,tdd'`. Task: load `templates/plan.md` and the `tdd` skill, produce the plan from the approved outline, write `.qrspi/plans/{slug}.md`, return the plan summary. Then
|
|
48
|
+
**P — Plan** (subagent): Launch the plan phase agent with `skill: 'planning-workflow,tdd'`. Task: load `templates/plan.md` and the `tdd` skill, produce the plan from the approved outline, write `.qrspi/plans/{slug}.md`, return the plan summary. Then preview the artifact to the user, checkpoint.
|
|
49
49
|
|
|
50
|
-
**I — Iterate** (subagent, only on revision request): Launch the iterate phase agent with the user's feedback as the task. Task: load `templates/iterate.md`, revise surgically, overwrite the plan in place, return the revision summary. Then
|
|
50
|
+
**I — Iterate** (subagent, only on revision request): Launch the iterate phase agent with the user's feedback as the task. Task: load `templates/iterate.md`, revise surgically, overwrite the plan in place, return the revision summary. Then preview the revised plan to the user, noting which slices changed in one line of prose, checkpoint. If the child reports that the feedback requires a design change, return to the D phase instead of patching the plan.
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Planning Workflow
|
|
2
|
+
|
|
3
|
+
Guides structured software planning through reusable templates. Covers design concepts, implementation plans with vertical slices, and agent configuration. Use when starting a new feature, designing a solution before implementation, producing a phased plan for a build agent, or when the user mentions planning, design phase, implementation plan, QRSPI, or vertical slices.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
The skill turns a new feature into a sequence of planning artifacts a build agent can execute without ambiguity. Templates enforce order: design decisions before structure, structure before implementation tasks, and each phase independently verifiable. Implementation plans decompose work into vertical slices, units of change that deliver one complete observable behavior end-to-end.
|
|
8
|
+
|
|
9
|
+
## What problem it solves
|
|
10
|
+
|
|
11
|
+
Planning without order produces plans that cannot be verified incrementally. The skill enforces one core constraint across all templates: no implementation detail in the design phase, no design decisions in the plan phase, no new behavior in a verification gate. Horizontal slicing, grouping changes by technical layer, is the primary anti-pattern because it produces no working software until the final phase.
|
|
12
|
+
|
|
13
|
+
## How it is structured
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
skills/planning-workflow/
|
|
17
|
+
├── SKILL.md # instructions agents load
|
|
18
|
+
└── templates/
|
|
19
|
+
├── research.md # research document schema and summary format
|
|
20
|
+
├── design-concept.md # design phase template
|
|
21
|
+
├── outline.md # structure outline component schema
|
|
22
|
+
├── plan.md # implementation plan with vertical slices
|
|
23
|
+
├── iterate.md # surgical revision workflow
|
|
24
|
+
└── session-summary.md # orchestrated session summary format
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## How to use it
|
|
28
|
+
|
|
29
|
+
Run the skill when starting a new feature, designing a solution before implementation, producing a phased plan for a build agent, or when the user mentions planning, design phase, implementation plan, QRSPI, or vertical slices.
|
|
30
|
+
|
|
31
|
+
A QRSPI session follows the phases Q, R, D, S, P, I, one at a time. Every phase ends at a human checkpoint. An orchestrator runs the session, relays user answers, and previews each artifact. Phase agents load only the current phase's template and write the artifact to .qrspi/<kind>/<slug>.md. Load relevant skills before authoring any Tests First section. A plan requires an approved design concept; if none exists, complete the Design phase first.
|
|
32
|
+
|
|
33
|
+
See SKILL.md for the full agent-facing instructions.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: planning-workflow
|
|
3
|
-
description: Guides structured software planning through reusable templates. Covers design
|
|
3
|
+
description: Guides structured software planning through reusable templates. Covers design concepts, implementation plans with vertical slices, and agent configuration. Use when starting a new feature, designing a solution before implementation, producing a phased plan for a build agent, or when the user mentions planning, design phase, implementation plan, QRSPI, or vertical slices.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Planning Workflow
|
|
7
7
|
|
|
8
|
-
Planning produces artifacts
|
|
8
|
+
Planning produces artifacts a build agent can execute without ambiguity. The templates enforce order: design decisions before structure, structure before implementation tasks, and each phase independently verifiable.
|
|
9
9
|
|
|
10
10
|
The core constraint across all templates: **no implementation detail in the design phase, no design decisions in the plan phase, no new behavior in a verification gate.**
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ The core constraint across all templates: **no implementation detail in the desi
|
|
|
13
13
|
|
|
14
14
|
## Vertical Slicing
|
|
15
15
|
|
|
16
|
-
All implementation plans produced with this skill decompose work into **vertical slices
|
|
16
|
+
All implementation plans produced with this skill decompose work into **vertical slices**: units of change that deliver one complete, observable behavior end-to-end, from the outermost interface to the innermost dependency.
|
|
17
17
|
|
|
18
18
|
A vertical slice is not a layer (not "implement the database layer"). It is a behavior (e.g., "a user can place an order and receive a confirmation").
|
|
19
19
|
|
|
@@ -23,17 +23,21 @@ Each slice:
|
|
|
23
23
|
- Delivers something demonstrable at its verification gate
|
|
24
24
|
- Can be deployed or rolled back independently of other slices
|
|
25
25
|
|
|
26
|
-
**IMPORTANT**: Horizontal slicing
|
|
26
|
+
**IMPORTANT**: Horizontal slicing, grouping changes by technical layer across multiple behaviors, is the primary anti-pattern. A plan where Phase 1 is "all models", Phase 2 is "all services", Phase 3 is "all controllers" cannot be verified incrementally and produces no working software until the final phase.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Load the test-writing skill (test doubles, Arrange/Act/Assert, red-green-refactor) before authoring any Tests First section. If no such skill exists, the Tests First blocks in the plan template are the minimum contract.
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
32
|
## Session Structure (Orchestrated)
|
|
33
33
|
|
|
34
|
-
A QRSPI session runs with one orchestrator and per-phase agents. One phase at a time; every phase ends at a human checkpoint. The orchestrator never drafts artifacts
|
|
34
|
+
A QRSPI session runs with one orchestrator and per-phase agents. One phase at a time; every phase ends at a human checkpoint. The orchestrator never drafts artifacts. Phase agents draft in fresh contexts, keeping exploration and drafting out of the orchestrator's context.
|
|
35
35
|
|
|
36
|
-
**Orchestrator owns**: the Q phase, launching each phase agent, relaying user answers (Design phase),
|
|
36
|
+
**Orchestrator owns**: the Q phase, launching each phase agent, relaying user answers (Design phase), previewing each artifact to the user at its checkpoint, approving or denying advancement, coordinating Iterate, and producing the session summary.
|
|
37
|
+
|
|
38
|
+
**Q phase**: runs first, before Research, owned by the orchestrator (the main agent).
|
|
39
|
+
|
|
40
|
+
The orchestrator asks the user the scope questions directly. These answers define the scope goal statement. The design artifact takes its problem statement from the scope goal; the research topic also comes from Q.
|
|
37
41
|
|
|
38
42
|
**Phase agent owns**: loading the current phase's template, reading the prior artifacts, drafting and writing the artifact to `.qrspi/<kind>/<slug>.md`, and returning the inline summary.
|
|
39
43
|
|
|
@@ -42,9 +46,9 @@ A QRSPI session runs with one orchestrator and per-phase agents. One phase at a
|
|
|
42
46
|
- Load only the template for the current phase. Do not draft artifacts for other phases.
|
|
43
47
|
- Do not ask the user questions directly. Return clarifying questions, design options, or unresolved decisions in your final output; the orchestrator relays them.
|
|
44
48
|
- Convert unresolved ambiguities into explicit assumptions in the artifact (Open Questions / Decisions Required sections) rather than blocking.
|
|
45
|
-
-
|
|
49
|
+
- Write to `.qrspi/<kind>/YYYYMMDD-{slug}.md` and include any frontmatter the template specifies.
|
|
46
50
|
|
|
47
|
-
**Artifact visibility**: the orchestrator
|
|
51
|
+
**Artifact visibility**: the orchestrator previews each artifact to the user after the phase agent writes it, full content and frontmatter included, using a user-facing preview tool so the artifact never enters the orchestrator's context. Fall back to `read` only if no user-facing preview tool exists. Do not approve blind.
|
|
48
52
|
|
|
49
53
|
---
|
|
50
54
|
|
|
@@ -74,4 +78,4 @@ P — Plan → templates/plan.md
|
|
|
74
78
|
I — Iterate → templates/iterate.md
|
|
75
79
|
```
|
|
76
80
|
|
|
77
|
-
A
|
|
81
|
+
A plan requires an approved design concept. If none exists, complete the Design phase first.
|
|
@@ -4,18 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
**Constraints**:
|
|
6
6
|
|
|
7
|
-
- Usually 150–250 lines
|
|
7
|
+
- Usually 150–250 lines (no hard cap); the real constraint is completeness, not length
|
|
8
8
|
- No file paths, no function names, no pseudo-code, no code blocks
|
|
9
|
-
- Architecture and boundaries only
|
|
9
|
+
- Architecture and boundaries only. No implementation detail.
|
|
10
10
|
- Stop when the solution shape is unambiguous; do not pad
|
|
11
|
-
- Status remains `draft` until the orchestrator or user confirms approval
|
|
12
11
|
|
|
13
12
|
## How to Produce This Document
|
|
14
13
|
|
|
15
14
|
1. Read the research document silently. Do not summarise it back.
|
|
16
|
-
2. Identify what is still ambiguous about the solution shape.
|
|
15
|
+
2. Identify what is still ambiguous about the solution shape. Return up to 3 questions in your output for the orchestrator to relay. Do not proceed until the orchestrator returns the answers.
|
|
17
16
|
3. Present 2–3 distinct design options. For each state: what it optimises for, what it gives up, and which constraints from the scope it satisfies.
|
|
18
|
-
4.
|
|
17
|
+
4. Return the direction question ("Does this direction feel right, or should we adjust?") for the orchestrator to relay.
|
|
19
18
|
5. Once direction is agreed, write the document using the schema below.
|
|
20
19
|
6. Write to `<worktree-root>/.qrspi/designs/YYYYMMDD-{slug}.md`.
|
|
21
20
|
7. Return the artifact path and a one-paragraph summary of the chosen direction.
|
|
@@ -38,7 +37,7 @@
|
|
|
38
37
|
|
|
39
38
|
## Problem Statement
|
|
40
39
|
|
|
41
|
-
{What we are solving, in the engineer's own terms. Taken directly from the scope goal
|
|
40
|
+
{What we are solving, in the engineer's own terms. Taken directly from the scope goal; do not reframe or interpret. 2–4 sentences.}
|
|
42
41
|
|
|
43
42
|
---
|
|
44
43
|
|
|
@@ -64,9 +63,9 @@
|
|
|
64
63
|
|
|
65
64
|
## Solution Shape
|
|
66
65
|
|
|
67
|
-
{High-level description of the solution: components, their responsibilities, the boundaries between them, and the primary data or control flow. Written as prose
|
|
66
|
+
{High-level description of the solution: components, their responsibilities, the boundaries between them, and the primary data or control flow. Written as prose; no code, no file paths.}
|
|
68
67
|
|
|
69
|
-
{Each paragraph covers one component or one significant boundary. A boundary is a point where ownership or technology changes
|
|
68
|
+
{Each paragraph covers one component or one significant boundary. A boundary is a point where ownership or technology changes: between services, between infrastructure and domain logic, between synchronous and asynchronous processing.}
|
|
70
69
|
|
|
71
70
|
{End with a statement of the observable outputs: what a user or caller sees when the solution is working correctly.}
|
|
72
71
|
|
|
@@ -84,7 +83,7 @@
|
|
|
84
83
|
|
|
85
84
|
## What This Explicitly Does Not Do
|
|
86
85
|
|
|
87
|
-
{List behaviors, integrations, or concerns that are out of scope for this solution. Be specific
|
|
86
|
+
{List behaviors, integrations, or concerns that are out of scope for this solution. Be specific: "no pagination" is better than "limited scope". Each item prevents scope creep during the outline and plan phases.}
|
|
88
87
|
|
|
89
88
|
- {Excluded behavior or concern}
|
|
90
89
|
- {Excluded behavior or concern}
|
|
@@ -93,7 +92,7 @@
|
|
|
93
92
|
|
|
94
93
|
## Open Questions for the Outline Phase
|
|
95
94
|
|
|
96
|
-
{
|
|
95
|
+
{Structural unknowns the outline must resolve before planning: component interfaces, sequencing constraints, external dependencies. Design is closed.}
|
|
97
96
|
|
|
98
97
|
- {e.g., Does the notification component own its retry logic or delegate to infrastructure?}
|
|
99
98
|
- {e.g., What is the wire format between the gateway and the processing service?}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Iterate Template
|
|
2
2
|
|
|
3
|
-
**Usage**: Used during the QRSPI Iterate (I) phase
|
|
3
|
+
**Usage**: Used during the QRSPI Iterate (I) phase to revise an existing plan. Updates only the affected slices; never regenerates the full plan. Load the test-writing skill (see the plan template) when you must regenerate a Tests First section.
|
|
4
4
|
|
|
5
5
|
**Constraints**:
|
|
6
6
|
|
|
7
|
-
- Never regenerate the full plan for a partial change
|
|
7
|
+
- Never regenerate the full plan for a partial change; make surgical edits only
|
|
8
8
|
- If the feedback requires a new slice, add it; do not repurpose an existing slice to absorb new behavior
|
|
9
|
-
- Re-verify
|
|
10
|
-
- If two or more rounds of iteration
|
|
9
|
+
- Re-verify every Verification Gate for modified slices before saving
|
|
10
|
+
- If two or more rounds of iteration hit the same slice, flag it: repeated revision signals a design ambiguity; resolve it at the D or S phase, not by patching
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
|
|
16
16
|
1. Read the existing plan, outline, and research documents silently.
|
|
17
17
|
2. Identify which slices the feedback implicates. State them explicitly before making any changes.
|
|
18
|
-
3. Check whether the feedback implies a **design change
|
|
18
|
+
3. Check whether the feedback implies a **design change**: a change to solution shape, component boundaries, or technology choices. If it does, stop and return:
|
|
19
19
|
```
|
|
20
20
|
This feedback requires a design change. Return to the D phase before revising the plan.
|
|
21
21
|
Reason: {specific design decision affected}
|
|
22
22
|
```
|
|
23
|
-
4. For each implicated slice, rewrite it completely. Leave all other slices verbatim.
|
|
23
|
+
4. For each implicated slice, rewrite it completely, regenerating its Tests First section and Verification Gate for the new behavior. Leave all other slices verbatim.
|
|
24
24
|
5. Add a revision note to the plan header:
|
|
25
25
|
```
|
|
26
26
|
Revised: {YYYY-MM-DD} — {one-line summary of what changed}
|
|
27
27
|
```
|
|
28
|
-
6. Write the revised plan to the same path
|
|
28
|
+
6. Write the revised plan to the same path.
|
|
29
29
|
7. Return the output below.
|
|
30
30
|
|
|
31
31
|
---
|
|
@@ -7,16 +7,16 @@ No implementation detail; this is architecture, not tactics.
|
|
|
7
7
|
|
|
8
8
|
**Constraints**:
|
|
9
9
|
|
|
10
|
-
- Usually under 350 lines
|
|
10
|
+
- Usually under 350 lines (no hard cap); every line must earn its place
|
|
11
11
|
- No file paths, no function signatures, no pseudo-code
|
|
12
12
|
- Every component declaration must map to at least one vertical slice in the subsequent plan
|
|
13
|
-
- Sequencing constraints must state the _reason_, not just the dependency
|
|
13
|
+
- Sequencing constraints must state the _reason_, not just the dependency. The reason determines whether components can be parallelised
|
|
14
14
|
- If the design concept has unresolved open questions that affect structure, stop and flag them before writing
|
|
15
15
|
|
|
16
16
|
## How to Produce This Document
|
|
17
17
|
|
|
18
18
|
1. Read the design concept and research document silently.
|
|
19
|
-
2. Identify `Decisions Required Before Planning` implied by the design concept's open questions. For each: resolve from the research document if possible;
|
|
19
|
+
2. Identify `Decisions Required Before Planning` implied by the design concept's open questions. For each: resolve from the research document if possible; otherwise return a decision request for the orchestrator to relay, or record it as an explicit assumption in the artifact.
|
|
20
20
|
3. Write the document using the schema below.
|
|
21
21
|
4. Write to `<worktree-root>/.qrspi/outlines/YYYYMMDD-{slug}.md`.
|
|
22
22
|
5. Return the artifact path and a one-paragraph summary of the component structure.
|
|
@@ -42,8 +42,8 @@ status: draft
|
|
|
42
42
|
|
|
43
43
|
### {Component name}
|
|
44
44
|
|
|
45
|
-
**Responsibility**: {one sentence
|
|
46
|
-
**Interface**: {what it exposes
|
|
45
|
+
**Responsibility**: {one sentence stating what this component owns}
|
|
46
|
+
**Interface**: {what it exposes: inputs, outputs, events emitted; no implementation detail}
|
|
47
47
|
**Dependencies**: {other components it calls or receives from; external dependencies it crosses}
|
|
48
48
|
|
|
49
49
|
### {Next component}
|
|
@@ -62,7 +62,7 @@ status: draft
|
|
|
62
62
|
|
|
63
63
|
## Sequencing Constraints
|
|
64
64
|
|
|
65
|
-
{Which components must exist
|
|
65
|
+
{Which components must exist, or have their interface defined, before others can be built. This feeds the vertical slice ordering in the plan.}
|
|
66
66
|
|
|
67
67
|
| Component | Depends on | Reason |
|
|
68
68
|
| ----------- | ----------------- | ------ |
|
|
@@ -72,7 +72,7 @@ status: draft
|
|
|
72
72
|
|
|
73
73
|
## Decisions Required Before Planning
|
|
74
74
|
|
|
75
|
-
{Structural unknowns the planner must
|
|
75
|
+
{Structural unknowns the planner must resolve or state as explicit assumptions. Design is closed; these concern how structure maps to implementation.}
|
|
76
76
|
|
|
77
77
|
- {e.g., Does the notification component own its retry logic or delegate it to the queue infrastructure?}
|
|
78
78
|
- {e.g., What is the wire format at the gateway boundary?}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# Implementation Plan Template
|
|
2
2
|
|
|
3
|
-
**Usage**: Produced during the QRSPI Plan (P) phase.
|
|
3
|
+
**Usage**: Produced during the QRSPI Plan (P) phase. Before authoring any "Tests First" section, load the test-writing skill — the one covering test doubles, Arrange/Act/Assert, and the red-green-refactor loop. Load it once at the start of the plan; it applies to every slice below. If no such skill is loaded, the Tests First blocks below are the minimum contract. Each phase is a vertical slice: one complete, observable behavior end-to-end. Build Agent executes phases in order; each Verification Gate must pass before the next phase begins.
|
|
4
4
|
|
|
5
5
|
**Constraints**:
|
|
6
6
|
|
|
7
|
-
- Usually ~1,000 lines in total (prose plus code samples)
|
|
8
|
-
- Code samples are illustrative (locate insertion point, show pattern)
|
|
7
|
+
- Usually ~1,000 lines in total (prose plus code samples), not a hard cap; the real constraints are self-containment and per-slice verification gates
|
|
8
|
+
- Code samples are illustrative (locate insertion point, show pattern), not complete implementations
|
|
9
9
|
- Each phase must deliver something demonstrable at its verification gate
|
|
10
|
-
- No phase may be a technical layer (e.g., "implement all models")
|
|
10
|
+
- No phase may be a technical layer (e.g., "implement all models"); each phase is a behavior
|
|
11
11
|
- In verification gates, use tools over bash commands where available
|
|
12
12
|
|
|
13
13
|
## How to Produce This Document
|
|
14
14
|
|
|
15
|
-
1. Read the design concept and
|
|
16
|
-
2. If more exploration is needed,
|
|
15
|
+
1. Read the design concept and outline silently.
|
|
16
|
+
2. If more exploration is needed, look for answers in the research document first.
|
|
17
17
|
3. Write the document using the schema below.
|
|
18
18
|
4. Write to `<worktree-root>/.qrspi/plans/YYYYMMDD-{slug}.md`.
|
|
19
19
|
5. Return the artifact path and a one-paragraph summary of the plan.
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
**Status**: ready
|
|
28
28
|
**Design concept**: {path to design concept artifact}
|
|
29
29
|
**Research artifact**: {path to research artifact}
|
|
30
|
-
**Issue**: {link
|
|
30
|
+
**Issue**: {link; omit if no issue is referenced}
|
|
31
31
|
|
|
32
32
|
---
|
|
33
33
|
|
|
34
34
|
## Overview
|
|
35
35
|
|
|
36
|
-
{What we are implementing and why
|
|
36
|
+
{What we are implementing and why, in 2–4 sentences. Reference the design concept by name, not by repeating its content.}
|
|
37
37
|
|
|
38
38
|
## Skills Consulted
|
|
39
39
|
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
|
|
51
51
|
## Desired End State
|
|
52
52
|
|
|
53
|
-
{Specification of the completed feature and how to verify it is correct from the outside
|
|
53
|
+
{Specification of the completed feature and how to verify it is correct from the outside: what a caller or user observes.}
|
|
54
54
|
|
|
55
55
|
## Slice Order Rationale
|
|
56
56
|
|
|
@@ -66,16 +66,16 @@
|
|
|
66
66
|
|
|
67
67
|
### What this slice delivers
|
|
68
68
|
|
|
69
|
-
{One paragraph: what Build Agent
|
|
69
|
+
{One paragraph: what Build Agent can demonstrate at the end of this slice. Written as an observable outcome: what a caller sees, not what code was written.}
|
|
70
70
|
|
|
71
71
|
### Tests First (Red)
|
|
72
72
|
|
|
73
|
-
{Before writing any implementation, Build Agent writes these tests. They must fail at the start of this slice for the right behavioral reason
|
|
73
|
+
{Before writing any implementation, Build Agent writes these tests. They must fail at the start of this slice for the right behavioral reason, not a compilation error.}
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
Use the test-writing skill loaded at the top of this plan for double selection and test scaffold. If none was loaded, follow the test-structure block below.
|
|
76
76
|
|
|
77
77
|
- **{Test name following "subject does what when condition" convention}**
|
|
78
|
-
- Arrange: {what to set up
|
|
78
|
+
- Arrange: {what to set up: subject, doubles, inputs}
|
|
79
79
|
- Act: {what to invoke}
|
|
80
80
|
- Assert: {what observable outcome to verify}
|
|
81
81
|
|
|
@@ -133,7 +133,7 @@ Automated:
|
|
|
133
133
|
|
|
134
134
|
Manual:
|
|
135
135
|
|
|
136
|
-
- [ ] {Observable behavior to confirm from the outside
|
|
136
|
+
- [ ] {Observable behavior to confirm from the outside: what a caller or user sees}
|
|
137
137
|
|
|
138
138
|
---
|
|
139
139
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Research Document Template
|
|
2
2
|
|
|
3
3
|
**Usage**: Produced during the QRSPI Research (R) phase by the Research Agent.
|
|
4
|
-
Plan Agent reads this before
|
|
5
|
-
Do not suggest improvements, critique, or plan
|
|
4
|
+
Plan Agent reads this before the Design phase.
|
|
5
|
+
Document only what exists. Do not suggest improvements, critique, or plan.
|
|
6
6
|
|
|
7
7
|
**Constraints**:
|
|
8
8
|
|
|
9
|
-
- Document prose: ~100 words per subsection
|
|
9
|
+
- Document prose: ~100 words per subsection (guide, not a hard cap), excluding the **Research Question** and **Summary** sections
|
|
10
10
|
- Detailed Findings:
|
|
11
11
|
- succinct prose, sacrifice grammar for concision
|
|
12
12
|
- one line per sentence
|
|
@@ -28,7 +28,6 @@ git_commit: { hash }
|
|
|
28
28
|
branch: { branch }
|
|
29
29
|
repository: { repo name }
|
|
30
30
|
topic: "{topic}"
|
|
31
|
-
subagents_used: [{ roles invoked: locator | analyzer | pattern-finder }]
|
|
32
31
|
skills_consulted: [{ skill names loaded, or "none" }]
|
|
33
32
|
status: complete
|
|
34
33
|
---
|
|
@@ -37,11 +36,11 @@ status: complete
|
|
|
37
36
|
|
|
38
37
|
## Research Question
|
|
39
38
|
|
|
40
|
-
{Original topic
|
|
39
|
+
{Original topic verbatim, not reframed.}
|
|
41
40
|
|
|
42
41
|
## Summary
|
|
43
42
|
|
|
44
|
-
{3–5 sentences: key components, their connections,
|
|
43
|
+
{3–5 sentences: key components, their connections, what matters for planning. Written for Plan Agent: what must a planner know before designing a solution?}
|
|
45
44
|
|
|
46
45
|
## Detailed Findings
|
|
47
46
|
|
|
@@ -51,7 +50,7 @@ status: complete
|
|
|
51
50
|
|
|
52
51
|
## Key Patterns
|
|
53
52
|
|
|
54
|
-
{Conventions with file:line examples. Omit this section
|
|
53
|
+
{Conventions with file:line examples. Omit this section if Pattern Finder was not invoked.}
|
|
55
54
|
|
|
56
55
|
## Code References
|
|
57
56
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Session Summary Template
|
|
2
2
|
|
|
3
|
-
**Usage**:
|
|
3
|
+
**Usage**: Produced by the orchestrator after all phases are approved. Lists all artifact paths produced in the session.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Test-Driven Development
|
|
2
|
+
|
|
3
|
+
Guides test-driven development of software components using the red-green-refactor loop. Covers test doubles, dependency injection, test structure, and naming.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Leads a development cycle in three phases: write a failing test (red), write the minimum implementation to pass it (green), and refactor structure without adding behavior. Explains two schools of unit testing, the London school and the Chicago school, and picks London as the default. Covers test doubles, dependency injection, test structure, and test naming through a main file and three reference files.
|
|
8
|
+
|
|
9
|
+
## What problem it solves
|
|
10
|
+
|
|
11
|
+
Tests written before implementation force the interface to be designed from the caller's perspective. Painful test setup signals a design problem: too many dependencies, too many responsibilities, or the wrong abstraction boundary. The skill gives a rule for where to mock, so doubles do not couple to implementation details. It also keeps the loop diagnostic: a failing test must fail for the right reason, and refactors must never mix in new behavior.
|
|
12
|
+
|
|
13
|
+
## How it is structured
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
skills/tdd/
|
|
17
|
+
├── SKILL.md # the instruction file agents load
|
|
18
|
+
├── assets/
|
|
19
|
+
│ └── test-template.md # concrete scaffold for a test suite
|
|
20
|
+
└── references/
|
|
21
|
+
├── test-doubles.md # stub, spy, fake, mock, dummy taxonomy
|
|
22
|
+
├── dependency-injection.md # constructor, argument, and factory injection
|
|
23
|
+
└── test-patterns.md # naming, fixtures, assertions, test pyramid
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## How to use it
|
|
27
|
+
|
|
28
|
+
Use it when writing new features test-first, adding tests to existing code, designing a component's interface through tests, or when the user mentions TDD, unit tests, mocks, stubs, or test structure.
|
|
29
|
+
|
|
30
|
+
Run one TDD cycle at a time, and track it with the workflow checklist: write one failing test and confirm it fails for the right reason, write the minimum generalization to pass all tests, checkpoint before touching structure, refactor structure only, and stop to write a test if refactoring reveals a missing case. Read the reference files on demand: test doubles when choosing a double, dependency injection when the arrange section is complex, and test patterns when naming tests or structuring fixtures.
|
|
31
|
+
|
|
32
|
+
## Provenance
|
|
33
|
+
|
|
34
|
+
Vendored from the npm package @ftrdotdev/pi-qrspi.
|
|
35
|
+
|
|
36
|
+
See SKILL.md for the full agent-facing instructions.
|