@ftrdotdev/pi-qrspi 0.2.3 → 0.2.4

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/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@ftrdotdev/pi-qrspi",
3
- "version": "0.2.3",
4
- "homepage": "https://github.com/felixnorden/pi-mono/blob/main/packages/qrspi/README.md",
5
- "bugs": {
6
- "url": "https://github.com/felixnorden/pi-mono/issues"
7
- },
3
+ "version": "0.2.4",
8
4
  "keywords": [
5
+ "coding-agent",
6
+ "extension",
9
7
  "pi",
10
- "pi-package",
11
8
  "pi-coding-agent",
12
- "coding-agent",
9
+ "pi-package",
13
10
  "planning",
14
- "tdd",
15
11
  "qrspi",
16
- "workflow",
17
12
  "skill",
18
- "extension"
13
+ "tdd",
14
+ "workflow"
19
15
  ],
16
+ "homepage": "https://github.com/felixnorden/pi-mono/blob/main/packages/qrspi/README.md",
17
+ "bugs": {
18
+ "url": "https://github.com/felixnorden/pi-mono/issues"
19
+ },
20
20
  "license": "MIT",
21
21
  "author": "Felix Nordén <felixnorden@gmail.com>",
22
22
  "repository": {
@@ -44,7 +44,7 @@
44
44
  "fmt:check": "oxfmt --check"
45
45
  },
46
46
  "devDependencies": {
47
- "@earendil-works/pi-coding-agent": "1.0.0",
47
+ "@earendil-works/pi-coding-agent": "1.1.0",
48
48
  "@types/bun": "latest",
49
49
  "oxfmt": "^0.63.0",
50
50
  "oxlint": "1.82.0",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: planning-workflow
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.
3
+ description: Produces software planning artifacts, including design concepts, structure outlines, and phased plans split into vertical slices. Use when the user asks for a planning document, design concept, structure outline, phased plan, or QRSPI session, or when the user mentions vertical slices. Do not use when the user asks to write, change, or debug code or tests.
4
4
  ---
5
5
 
6
6
  # Planning Workflow
@@ -25,7 +25,7 @@ Each slice:
25
25
 
26
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
- 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.
28
+ Load the `tdd` skill (test doubles, Arrange/Act/Assert, red-green-refactor) before authoring any Tests First section. If that skill is not installed, the Tests First blocks in the plan template are the minimum contract.
29
29
 
30
30
  ---
31
31
 
@@ -0,0 +1,48 @@
1
+ {
2
+ "skill": "planning-workflow",
3
+ "trigger_cases": [
4
+ { "query": "I want to plan a new feature before writing any code.", "should_trigger": true, "split": "train" },
5
+ { "query": "Help me design the solution for our sync engine.", "should_trigger": true, "split": "train" },
6
+ { "query": "Produce a phased plan I can hand to a build agent.", "should_trigger": true, "split": "train" },
7
+ { "query": "Split this work into vertical slices.", "should_trigger": true, "split": "train" },
8
+ { "query": "Run a QRSPI session for this refactor.", "should_trigger": true, "split": "train" },
9
+ { "query": "Write a design concept for the new auth model.", "should_trigger": true, "split": "train" },
10
+ { "query": "I need a structure outline before planning the implementation.", "should_trigger": true, "split": "train" },
11
+ { "query": "What should the research document cover for this change?", "should_trigger": true, "split": "validation" },
12
+ { "query": "Turn this approved design into an implementation plan.", "should_trigger": true, "split": "validation" },
13
+
14
+ { "query": "Implement the login feature now.", "should_trigger": false, "split": "train" },
15
+ { "query": "Fix the failing test in the payment service.", "should_trigger": false, "split": "train" },
16
+ { "query": "Write unit tests for this parser.", "should_trigger": false, "split": "train" },
17
+ { "query": "Review my pull request.", "should_trigger": false, "split": "train" },
18
+ { "query": "Rename these variables to match our style guide.", "should_trigger": false, "split": "train" },
19
+ { "query": "Deploy the current build to staging.", "should_trigger": false, "split": "validation" },
20
+ { "query": "Summarize the architecture document for me.", "should_trigger": false, "split": "validation" }
21
+ ],
22
+ "output_cases": [
23
+ {
24
+ "id": "layer-vs-slice",
25
+ "prompt": "Here is my plan: Phase 1 is all database models, Phase 2 is all services, Phase 3 is all controllers. What is wrong with it, and how should it change?",
26
+ "assertions": [
27
+ "The answer identifies the plan as horizontal, layer-by-layer slicing.",
28
+ "The answer asks for behavior-level vertical slices instead."
29
+ ]
30
+ },
31
+ {
32
+ "id": "no-design-in-plan",
33
+ "prompt": "Write the implementation plan for adding CSV export, and include the database schema choice you think is best.",
34
+ "assertions": [
35
+ "The answer keeps the schema choice out of the plan or flags it as a design-phase decision.",
36
+ "The answer records the schema decision in the design artifact, not in the plan."
37
+ ]
38
+ },
39
+ {
40
+ "id": "test-first-section",
41
+ "prompt": "Draft the Tests First section for a slice that adds a discount code to checkout.",
42
+ "assertions": [
43
+ "The answer writes the test before the implementation and states that it fails first.",
44
+ "The answer points to the tdd skill for the test structure."
45
+ ]
46
+ }
47
+ ]
48
+ }
@@ -1,6 +1,6 @@
1
1
  # Iterate Template
2
2
 
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.
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 `tdd` skill (see the plan template) when you must regenerate a Tests First section.
4
4
 
5
5
  **Constraints**:
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Implementation Plan Template
2
2
 
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.
3
+ **Usage**: Produced during the QRSPI Plan (P) phase. Before authoring any "Tests First" section, load the `tdd` skill, which covers 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 that skill is not installed, 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
 
@@ -10,6 +10,21 @@
10
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
+ ## Contents
14
+
15
+ - How to Produce This Document
16
+ - Overview
17
+ - Skills Consulted
18
+ - Research Summary
19
+ - Current State Analysis
20
+ - Desired End State
21
+ - Slice Order Rationale
22
+ - Out of Scope
23
+ - Slice 1
24
+ - Slice 2
25
+ - Risk Register
26
+ - Final Verification
27
+
13
28
  ## How to Produce This Document
14
29
 
15
30
  1. Read the design concept and outline silently.
@@ -72,7 +87,7 @@
72
87
 
73
88
  {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
89
 
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.
90
+ Use the `tdd` skill loaded at the top of this plan for double selection and test scaffold. If it is not installed, follow the test-structure block below.
76
91
 
77
92
  - **{Test name following "subject does what when condition" convention}**
78
93
  - Arrange: {what to set up: subject, doubles, inputs}
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: tdd
3
- description: Guides test-driven development of software components using the red-green-refactor loop. Covers test doubles, dependency injection, test structure, and naming. Use 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.
3
+ description: Writes tests before implementation with the red-green-refactor loop, and designs interfaces through failing tests. Use when writing a new feature test-first, adding tests to existing code, or when the user mentions TDD, unit tests, test doubles, mocks, stubs, or test structure. Do not use to fix a failing suite, raise coverage, write end-to-end tests, or answer general testing questions.
4
4
  ---
5
5
 
6
6
  # Test-Driven Development
@@ -1,5 +1,11 @@
1
1
  # Test Template
2
2
 
3
+ ## Contents
4
+
5
+ - London School — Double at Module Boundaries
6
+ - Chicago School — Real Collaborators, Double Only Infrastructure
7
+ - Builder Reference
8
+
3
9
  Language-agnostic pseudo-code scaffold for a well-formed test suite. Two variants are shown: London school (doubles at boundaries) and Chicago school (real collaborators, double only external infrastructure). Choose based on the guidance in SKILL.md.
4
10
 
5
11
  ---
@@ -0,0 +1,49 @@
1
+ {
2
+ "skill": "tdd",
3
+ "trigger_cases": [
4
+ { "query": "Add a feature to the invoice service test-first.", "should_trigger": true, "split": "train" },
5
+ { "query": "Write unit tests for this parser before the implementation.", "should_trigger": true, "split": "train" },
6
+ { "query": "Design the interface for a new notifier by writing tests.", "should_trigger": true, "split": "train" },
7
+ { "query": "Where should the mock boundary be for the payment gateway?", "should_trigger": true, "split": "train" },
8
+ { "query": "This test setup is painful; help me refactor it.", "should_trigger": true, "split": "train" },
9
+ { "query": "I keep writing tests that pass for the wrong reason.", "should_trigger": true, "split": "train" },
10
+ { "query": "How should I structure the arrange section for this service?", "should_trigger": true, "split": "validation" },
11
+ { "query": "Should I mock the clock in this unit test?", "should_trigger": true, "split": "validation" },
12
+ { "query": "Walk me through red green refactor for this change.", "should_trigger": true, "split": "validation" },
13
+
14
+ { "query": "Run the existing test suite and fix the failures.", "should_trigger": false, "split": "train" },
15
+ { "query": "Write a Playwright end-to-end test for the login flow.", "should_trigger": false, "split": "train" },
16
+ { "query": "What is the difference between TDD and BDD?", "should_trigger": false, "split": "train" },
17
+ { "query": "Set up continuous integration for this repository.", "should_trigger": false, "split": "train" },
18
+ { "query": "Increase the test coverage number for this module.", "should_trigger": false, "split": "train" },
19
+ { "query": "Write a database migration for the new column.", "should_trigger": false, "split": "validation" },
20
+ { "query": "Fix this flaky integration test against the real database.", "should_trigger": false, "split": "validation" }
21
+ ],
22
+ "output_cases": [
23
+ {
24
+ "id": "order-tax",
25
+ "prompt": "Write the first test for an order total that adds 20 percent tax for the EU region. The Order type has a region and a pricing service.",
26
+ "assertions": [
27
+ "The test fails first for a behavioral reason, not a compile error or a harness error.",
28
+ "The test uses Arrange, Act, Assert.",
29
+ "No internal class is mocked; only a boundary collaborator is doubled."
30
+ ]
31
+ },
32
+ {
33
+ "id": "five-mocks",
34
+ "prompt": "My test class needs five mocks to run. What does that signal?",
35
+ "assertions": [
36
+ "The answer names a design signal, such as too many responsibilities or the wrong boundary.",
37
+ "The answer names the dependency-structure signal and a design remedy, such as decompose the class or move the boundary."
38
+ ]
39
+ },
40
+ {
41
+ "id": "which-double",
42
+ "prompt": "Which test double should I use for the system clock in a unit test?",
43
+ "assertions": [
44
+ "The answer injects a clock abstraction at a boundary.",
45
+ "The answer does not mock a domain entity."
46
+ ]
47
+ }
48
+ ]
49
+ }
@@ -1,5 +1,11 @@
1
1
  # Dependency Injection
2
2
 
3
+ ## Contents
4
+
5
+ - Patterns
6
+ - Choosing a Pattern
7
+ - Depth of Injection
8
+
3
9
  Dependency injection (DI) is the practice of supplying a component's dependencies from outside rather than having the component create or locate them itself. It is the primary mechanism that makes code testable without resorting to global state, monkey-patching, or mocking internals.
4
10
 
5
11
  The core rule: a unit under test should never instantiate its own collaborators that cross a boundary. If it does, you cannot substitute a double in tests.
@@ -1,5 +1,11 @@
1
1
  # Test Doubles
2
2
 
3
+ ## Contents
4
+
5
+ - The Five Types
6
+ - Decision Guide
7
+ - Where to Draw the Mock Boundary
8
+
3
9
  Test doubles are controlled replacements for real dependencies in tests. The word "mock" is colloquially used for all of them, but the types are meaningfully distinct — using the wrong one produces tests that are either too brittle or too blind.
4
10
 
5
11
  Taxonomy from Meszaros, _xUnit Test Patterns_.
@@ -1,5 +1,14 @@
1
1
  # Test Patterns
2
2
 
3
+ ## Contents
4
+
5
+ - Structure: Arrange / Act / Assert
6
+ - Naming
7
+ - One Behavior Per Test
8
+ - Assertion Quality
9
+ - Fixture Patterns
10
+ - Test Pyramid
11
+
3
12
  Patterns for structuring, naming, and asserting in tests. The goal throughout is that each test reads as an unambiguous specification of a behavior, fails with a message that diagnoses the problem without requiring a debugger, and survives refactors that leave the behavior intact.
4
13
 
5
14
  ---