spec-starter 1.0.1 → 1.1.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.
@@ -9,6 +9,8 @@
9
9
 
10
10
  **Tech Stack:** <Key technologies, libraries, frameworks>
11
11
 
12
+ **E2E Tests:** <yes — checklist generated after implement | no — no checklist>
13
+
12
14
  ---
13
15
 
14
16
  ## Prerequisites
@@ -47,6 +47,9 @@ _Claude needs answers to these to finalize the brief. Set feature to `[?] Brief`
47
47
  - <Question 1>
48
48
  - Answer:
49
49
 
50
+ - **Does this feature need e2e test planning?** (answer: yes or no — required before brief can be finalised)
51
+ - Answer:
52
+
50
53
  ## Questions from User
51
54
 
52
55
  _User questions for Claude to research and answer._
@@ -1,26 +1,50 @@
1
1
  # <feature_title> — E2E Checklist
2
2
 
3
- Generated after implementation. Work through each scenario manually.
3
+ Generated after implementation. UI scenarios with a URL will run automatically via Playwright MCP if available; others require manual confirmation.
4
4
 
5
5
  ---
6
6
 
7
7
  ## Happy Path
8
8
 
9
- - [ ] <Scenario 1: exact steps to follow, expected outcome>
10
- - [ ] <Scenario 2>
9
+ - [ ] **<Scenario 1 title>**
10
+ - **URL:** `/<path>`
11
+ - **Steps:**
12
+ 1. <action using visible label or element description>
13
+ 2. <action>
14
+ - **Expected:** <what should be visible or true when done>
15
+
16
+ - [ ] **<Scenario 2 title>**
17
+ - **URL:** `/<path>`
18
+ - **Steps:**
19
+ 1. <action>
20
+ - **Expected:** <outcome>
11
21
 
12
22
  ## Edge Cases
13
23
 
14
- - [ ] <Edge case 1: what to do, what should happen>
15
- - [ ] <Edge case 2>
24
+ - [ ] **<Edge case 1 title>**
25
+ - **URL:** `/<path>`
26
+ - **Steps:**
27
+ 1. <how to trigger the edge case>
28
+ - **Expected:** <what the user should see>
29
+
30
+ - [ ] **<Non-browser check title>**
31
+ - <Describe what to run or check — no URL needed for non-browser scenarios>
16
32
 
17
33
  ## Error States
18
34
 
19
- - [ ] <Error scenario: how to trigger, what the user should see>
35
+ - [ ] **<Error scenario title>**
36
+ - **URL:** `/<path>`
37
+ - **Steps:**
38
+ 1. <how to trigger the error>
39
+ - **Expected:** <error message or fallback the user should see>
20
40
 
21
41
  ## Integration Points
22
42
 
23
- - [ ] <Cross-feature or external dependency check>
43
+ - [ ] **<Cross-feature or external dependency check>**
44
+ - **URL:** `/<path>`
45
+ - **Steps:**
46
+ 1. <check to perform>
47
+ - **Expected:** <expected integration behavior>
24
48
 
25
49
  ---
26
50
 
@@ -3,6 +3,7 @@
3
3
  **Slug:** `<MM.DD-feature_slug>`
4
4
  **Branch:** `<branch_name>`
5
5
  **Last Tested:** —
6
+ **E2E Tests:** —
6
7
 
7
8
  ## Progress
8
9
 
@@ -23,3 +24,7 @@
23
24
  - <Key point 1>
24
25
  - <Key point 2>
25
26
  - <Key point 3>
27
+
28
+ ## Diagram
29
+
30
+ <!-- Generated by /feature:blueprint -->
@@ -100,16 +100,41 @@ The blueprint must be:
100
100
  - **Codebase-aware** — match existing naming, import styles, test patterns
101
101
  - **Self-contained** — a fresh Claude session with only this file should be able to implement the feature
102
102
 
103
+ When filling the `**E2E Tests:**` field in the blueprint header, read the value of `**E2E Tests:**` from `1-feature.md`. Write `yes — checklist generated after implement` if yes, or `no — no checklist` if no.
104
+
103
105
  ### Step 5: Update Blueprint to `[x]`
104
106
 
105
107
  In `1-feature.md`, change `- [o] Blueprint` to `- [x] Blueprint`.
106
108
 
107
109
  **State update:** Do this immediately after blueprint.md is written.
108
110
 
111
+ ### Step 6: Generate Mermaid diagram and update 1-feature.md
112
+
113
+ Based on the blueprint you just wrote, generate a Mermaid architecture diagram that shows the key components or layers and data flow between them. Use `graph TD` orientation (top-down) unless the feature is a linear pipeline, in which case `graph LR` (left-right) is clearer.
114
+
115
+ Guidelines:
116
+ - 5 to 12 nodes is ideal — keep it concise
117
+ - Label edges with the action or data being passed: `-->|user input|`, `-->|SQL query|`, etc.
118
+ - Use subgraphs only if there are clearly distinct tiers (e.g. Frontend / Backend)
119
+ - No commentary inside the `## Diagram` section — only the fenced code block
120
+
121
+ Open `1-feature.md` for this feature. Find the `## Diagram` section. If the section is not present (feature created before this template update), append the `## Diagram` section to the end of the file instead. Replace from `## Diagram` to the end of the file with:
122
+
123
+ ````markdown
124
+ ## Diagram
125
+
126
+ ```mermaid
127
+ <your generated diagram here>
128
+ ```
129
+ ````
130
+
131
+ Use the Edit tool to make this replacement.
132
+
109
133
  Output:
110
134
 
111
135
  ```
112
- Blueprint written: .claude/_features/$ARGUMENTS/3-blueprint.md
136
+ Blueprint written: .claude/_features/$ARGUMENTS/3-blueprint.md
137
+ Diagram updated: .claude/_features/$ARGUMENTS/1-feature.md (## Diagram)
113
138
 
114
139
  Progress: [x] Brief [x] Blueprint [ ] Implement [ ] Review [ ] Done
115
140
  ```
@@ -134,7 +134,12 @@ Key technical decisions made during implementation.
134
134
 
135
135
  If the file already exists (resuming), append new entries.
136
136
 
137
- ### Step 7: Generate 4-e2e-checklist.md
137
+ ### Step 7: Generate 4-e2e-checklist.md (if needed)
138
+
139
+ Read `**E2E Tests:**` from `1-feature.md`.
140
+
141
+ - If `no`: skip this step entirely. Do not create `4-e2e-checklist.md`. Go directly to Step 8.
142
+ - If `yes` or `—` (unanswered — treat as yes for safety): continue with the rest of this step.
138
143
 
139
144
  Create `.claude/_features/$ARGUMENTS/4-e2e-checklist.md` using `.claude/_templates/e2e-checklist.md` as structure.
140
145
 
@@ -160,7 +165,7 @@ Tasks completed: <N>
160
165
 
161
166
  Files created:
162
167
  - .claude/_features/$ARGUMENTS/5-implementation-decisions.md
163
- - .claude/_features/$ARGUMENTS/4-e2e-checklist.md
168
+ - .claude/_features/$ARGUMENTS/4-e2e-checklist.md _(omitted if E2E Tests: no)_
164
169
 
165
170
  Next: work through the e2e checklist manually, then mark [x] Review in 1-feature.md.
166
171
  ```
@@ -77,10 +77,13 @@ Find which checkbox has `[?]` and act accordingly:
77
77
  2. Answer any unanswered "Questions from User" using codebase research
78
78
  3. Review "Questions from Claude" — if the user has answered them, incorporate those answers into the relevant brief sections (Overview, Goals, Requirements, etc.)
79
79
  4. Identify any remaining gaps — if the brief is still incomplete, add new questions and keep `[?] Brief`
80
- 5. If the brief is complete (no unanswered Questions from Claude remain), update `1-feature.md`:
80
+ 5. **E2E gate:** Before marking the brief complete, verify the "Does this feature need e2e test planning?" question in `2-brief.md` has an answer of `yes` or `no`.
81
+ - If unanswered: surface it as a blocking question, keep `[?] Brief`, and stop — do not proceed to step 6.
82
+ - If answered: extract the value (`yes` or `no`) and update `**E2E Tests:**` in `1-feature.md` to that value.
83
+ 6. If the brief is otherwise complete (no other unanswered Questions from Claude remain), update `1-feature.md`:
81
84
  - Change `- [?] Brief` to `- [x] Brief`
82
- 6. **State update:** Always update `1-feature.md` after taking action.
83
- 7. Output what changed and what the next step is.
85
+ 7. **State update:** Always update `1-feature.md` after taking action.
86
+ 8. Output what changed and what the next step is.
84
87
 
85
88
  **`[?] Blueprint`:**
86
89
  1. Read `.claude/_features/$ARGUMENTS/2-brief.md` and `.claude/_features/$ARGUMENTS/3-blueprint.md`
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  description: Run through the e2e checklist for a completed feature
3
3
  argument-hint: "<MM.DD-slug>"
4
- allowed-tools: Read, Edit, Glob, Bash
4
+ allowed-tools: Read, Edit, Glob, Bash, mcp__playwright__*
5
5
  ---
6
6
 
7
7
  Walk through the e2e checklist for a feature interactively. The feature must be marked `[x] Done` before testing is allowed.
@@ -89,6 +89,11 @@ Then stop.
89
89
 
90
90
  **Read shared testing instructions:** Check if `.claude/testing.md` exists. If it does, read it and use it throughout — it contains app-specific context like how to start the app, base URLs, test accounts, browser/device preferences, and any other setup needed to run scenarios correctly.
91
91
 
92
+ **Playwright check:** Use the Skill tool to invoke the `playwright-test` skill. It will check whether Playwright MCP tools are available and report back.
93
+
94
+ - If available → use Playwright automatically for all UI scenarios (those with a **URL** field). Note this as `playwright_available = true`.
95
+ - If not available → fall back to manual for all UI scenarios. Note this as `playwright_available = false`.
96
+
92
97
  ### Step 2: Present the checklist and run scenarios
93
98
 
94
99
  Output a summary of what you're about to test:
@@ -104,10 +109,16 @@ Then work through each section of the checklist in order:
104
109
 
105
110
  For each unchecked scenario (`- [ ]`):
106
111
  1. Present the scenario clearly — what to do and what to expect
107
- 2. For any scenario involving CLI commands or scripts, run them using Bash and report the result
108
- 3. For UI or manual scenarios, describe exactly what to check and ask the user to confirm: `Pass or fail?`
109
- 4. If the user confirms pass: mark the item `- [x]` in `e2e-checklist.md` using the Edit tool
110
- 5. If the user says fail: mark the item `- [!]` in `e2e-checklist.md`, note what failed, and continue to the next scenario
112
+ 2. For CLI/script scenarios: run with Bash and report the result
113
+ 3. For UI scenarios (those with **URL**, **Steps**, and **Expected** fields):
114
+ - If `playwright_available = true`: run the scenario automatically using the `playwright-test` skill.
115
+ - PASS mark the item `[x]`
116
+ - FAIL → mark the item `[!]`, note what failed, continue
117
+ - `[!] ERROR` → mark the item `[!]`, record the error evidence, continue
118
+ - If `playwright_available = false`: describe exactly what to check and ask the user: `Pass or fail?`
119
+ 4. For manual scenarios (no URL field): describe exactly what to check and ask the user: `Pass or fail?`
120
+ 5. If the user confirms pass: mark the item `- [x]` in `e2e-checklist.md` using the Edit tool
121
+ 6. If the user says fail: mark the item `- [!]` in `e2e-checklist.md`, note what failed, and continue to the next scenario
111
122
 
112
123
  Skip scenarios already marked `[x]` (previously passed) — report them as already passing.
113
124
 
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: playwright-test
3
+ description: Run UI scenarios automatically using Playwright MCP browser automation tools.
4
+ ---
5
+
6
+ # Playwright Test
7
+
8
+ Automate UI e2e scenario execution using Playwright MCP browser tools.
9
+
10
+ ## Availability check
11
+
12
+ Before using this skill, confirm that Playwright MCP tools are present in your tool list (look for tools prefixed with `mcp__playwright__` or similar browser automation tools). If they are available, proceed with this skill. If they are not available, stop immediately and report to the caller: "Playwright MCP not available." Do not execute any scenarios. The caller is responsible for handling unavailability (typically by asking the user to confirm each scenario manually).
13
+
14
+ ## Scenario structure
15
+
16
+ Each UI scenario in `4-e2e-checklist.md` follows this format:
17
+
18
+ ```
19
+ - [ ] **<Scenario title>**
20
+ - **URL:** `/<path>`
21
+ - **Steps:** numbered list of actions
22
+ - **Expected:** what should be visible/true when done
23
+ ```
24
+
25
+ Scenarios that have a URL, Steps, and Expected field are in scope for this skill. Scenarios without a URL (CLI checks, API checks, or manual-only verifications) are out of scope — the caller handles those via Bash or manual confirmation.
26
+
27
+ ## Building full URLs
28
+
29
+ The `## Base URL` section in `.claude/testing.md` provides the origin. If a scenario URL is relative (starts with `/`), prepend the base URL.
30
+
31
+ Example: base URL `http://localhost:3000` + scenario URL `/dashboard` = `http://localhost:3000/dashboard`.
32
+
33
+ If `testing.md` has no base URL, ask the user to provide it before proceeding.
34
+
35
+ ## Test accounts
36
+
37
+ If `.claude/testing.md` defines test credentials under `## Test accounts`, use them for any login flow before navigating to a protected route. Log in once at the start of the test run and reuse the session for subsequent scenarios where possible.
38
+
39
+ ## Running a scenario
40
+
41
+ For each in-scope scenario:
42
+
43
+ ### 1. Navigate
44
+
45
+ Navigate to the full URL using the Playwright navigation tool.
46
+
47
+ ### 2. Execute steps
48
+
49
+ Work through the numbered steps in order:
50
+
51
+ - **Clicks:** locate the element by its visible label, text, or ARIA role — not by CSS selector. Then click it.
52
+ - **Form inputs:** use fill tools to enter values into fields, identified by their visible label or placeholder text.
53
+ - **Keyboard actions** (Enter, Tab, Escape, etc.): use key press tools.
54
+
55
+ After all steps are complete, take a screenshot to capture the final state.
56
+
57
+ ### 3. Verify expected outcome
58
+
59
+ Use page content reading tools (accessibility tree or page text) to check whether the expected text or elements are present.
60
+
61
+ - If the expected outcome is present: **PASS**.
62
+ - If the expected outcome is absent or an error is visible: **FAIL**.
63
+
64
+ ## Result reporting format
65
+
66
+ After each scenario, report the result in this format:
67
+
68
+ ```
69
+ Scenario: <title>
70
+ Result: PASS
71
+ Evidence: <what was observed>
72
+ ```
73
+
74
+ or
75
+
76
+ ```
77
+ Scenario: <title>
78
+ Result: FAIL
79
+ Evidence: <what was observed>
80
+ ```
81
+
82
+ Include specific observed text, element presence, or error messages as evidence. Do not report vague evidence like "page loaded correctly."
83
+
84
+ This skill reports results to the conversation only. It does not modify `4-e2e-checklist.md`. The caller is responsible for marking scenarios `[x]` (pass) or `[!]` (fail) based on this skill's reported outcomes.
85
+
86
+ ## Error handling
87
+
88
+ If navigation fails or an element cannot be found, try once more using an alternate approach (e.g. a different locator strategy or a short wait before retrying).
89
+
90
+ If the scenario still cannot be completed after the second attempt, mark it with `[!]`, report the specific error and evidence, and continue to the next scenario. Never hang or retry infinitely.
91
+
92
+ ```
93
+ Scenario: <title>
94
+ Result: [!] ERROR
95
+ Evidence: <specific error message or what was observed>
96
+ ```
97
+
98
+ ## Output summary
99
+
100
+ After all scenarios are complete, output a summary table:
101
+
102
+ ```
103
+ ## E2E Results
104
+
105
+ | Scenario | Result |
106
+ |----------|--------|
107
+ | <title> | PASS |
108
+ | <title> | FAIL |
109
+ | <title> | [!] ERROR |
110
+ ```
111
+
112
+ Then list any FAIL or ERROR scenarios with their full evidence for follow-up.
@@ -34,6 +34,7 @@ Ask one question about manual/e2e testing setup:
34
34
  - Are there test accounts or credentials needed?
35
35
  - Any browser or device requirements?
36
36
  - Anything else needed to run through features manually?
37
+ - Is this a web app? If yes, what is the local dev base URL? (e.g. `http://localhost:3000`)
37
38
 
38
39
  ### 3. Update CLAUDE.md
39
40
 
@@ -57,7 +58,10 @@ Write `.claude/testing.md` with the manual testing setup gathered in Step 2. Thi
57
58
  # Testing
58
59
 
59
60
  ## How to start the app
60
- <dev server command and URL, or staging URL>
61
+ <dev server command>
62
+
63
+ ## Base URL
64
+ <base URL for the running app, e.g. http://localhost:3000 — or "N/A" if not a web app>
61
65
 
62
66
  ## Test accounts
63
67
  <credentials or "none required">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-starter",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "Claude Code project template for structured feature development",
5
5
  "bin": {
6
6
  "spec-starter": "bin/index.js"