Compare commits
4 Commits
phase-file
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 3beed8fc8e | |||
| 626986731a | |||
| 0dcd1ab8d4 | |||
| 1b67d1f15e |
@ -53,6 +53,7 @@ Verify that the implemented code meets the following criteria:
|
||||
- [ ] Is the coverage target met?
|
||||
- [ ] Are edge cases tested?
|
||||
- [ ] Are the tests named appropriately?
|
||||
- [ ] Are there Playwright E2E tests covering the feature's acceptance criteria (e2e/*.spec.ts)?
|
||||
|
||||
**Evaluation Criteria**:
|
||||
- ✅ Sufficient: Coverage of 80% or more, covering the main cases
|
||||
@ -213,6 +214,11 @@ npm test
|
||||
npm run test:coverage
|
||||
```
|
||||
|
||||
### Run E2E Tests (Playwright)
|
||||
```bash
|
||||
npm run test:e2e
|
||||
```
|
||||
|
||||
### Build Check
|
||||
```bash
|
||||
npm run build
|
||||
|
||||
@ -121,15 +121,19 @@ If any of the following situations occur while the implementation loop is runnin
|
||||
|
||||
**Once this step completes successfully, never stop; immediately proceed to Step 7.**
|
||||
|
||||
## Step 7: Run Automated Tests
|
||||
## Step 7: Run Automated Tests (including Playwright E2E)
|
||||
|
||||
1. Run the following commands in order and confirm that all tests pass.
|
||||
1. Write or update the feature's end-to-end tests following the **e2e-testing skill** (`Skill('e2e-testing')`):
|
||||
- Create/update `e2e/[feature-name].spec.ts` covering the feature's acceptance criteria.
|
||||
- If Playwright is not yet set up in the repository, set it up first as described in the skill.
|
||||
2. Run the following commands in order and confirm that all of them pass.
|
||||
```bash
|
||||
Bash('npm test')
|
||||
Bash('npm run lint')
|
||||
Bash('npm run typecheck')
|
||||
Bash('npm run test:e2e')
|
||||
```
|
||||
2. If any command produces an error, analyze the problem, generate and apply a fix, and then run this step again.
|
||||
3. If any command produces an error, analyze the problem, generate and apply a fix, and then run this step again. Never skip or delete a failing test to make verification pass.
|
||||
|
||||
**Once this step completes successfully, never stop; immediately proceed to Step 8.**
|
||||
|
||||
@ -164,7 +168,7 @@ If any of the following situations occur while the implementation loop is runnin
|
||||
This workflow completes automatically once all of the following conditions are met.
|
||||
- Step 5: All tasks in `tasklist.md` are complete (`[x]` or skipped for a valid reason).
|
||||
- Step 6: The `implementation-validator` subagent's validation passes.
|
||||
- Step 7: The `test`, `lint`, and `typecheck` commands all succeed without errors.
|
||||
- Step 7: The `test`, `lint`, `typecheck`, and `test:e2e` (Playwright) commands all succeed without errors, and the feature has E2E tests covering its acceptance criteria.
|
||||
- Step 8: Handover notes are recorded in `tasklist.md`, all six persistent documents in `docs/` have been reconciled with the feature (updates applied, or a skip reason noted for each), and the feature is checked off in its phase file (if `docs/milestones/` exists).
|
||||
|
||||
Until these completion criteria are met, continue to think autonomously, solve problems, and carry on the work.
|
||||
|
||||
@ -23,11 +23,9 @@ claude
|
||||
↓
|
||||
/define-design ← you are here
|
||||
↓
|
||||
/generate-app web | flutter | winui3
|
||||
/plan-milestones (milestone 01 = app shell, generated from this design)
|
||||
↓
|
||||
/plan-milestones
|
||||
↓
|
||||
/add-feature
|
||||
/execute-milestones phase1-milestones.md (or /add-feature per feature)
|
||||
```
|
||||
|
||||
## Pre-Run Check
|
||||
@ -61,7 +59,7 @@ Ask the user about the following. If the user does not provide detailed preferen
|
||||
|
||||
- **Target platform**: `web`, `flutter`, `winui3`, or `multi`
|
||||
- **Visual style** (e.g. friendly/modern/rounded/calm, dark or light, density)
|
||||
- **Main screens** the app must have
|
||||
- **Main screens** the app must have (treat the answer as additions and constraints — the complete screen list is derived from the PRD in Step 3, never limited to what the user names here)
|
||||
- **Navigation style** (e.g. tab bar, drawer, sidebar, stack)
|
||||
- **Branding preferences** (name, colors, tone)
|
||||
- **Accessibility requirements** (e.g. WCAG level, minimum contrast, large-touch targets)
|
||||
@ -73,7 +71,30 @@ Collect the answers in a single round; do not pause again until generation is co
|
||||
- Load the **ui-design skill** (`Skill('ui-design')`) to create `design-brief.md`, `ui-blueprint.json`, and the SVG wireframes.
|
||||
- Load the **design-tokens skill** (`Skill('design-tokens')`) to create `design-tokens.json`.
|
||||
|
||||
### Step 3: Create the Design Brief
|
||||
### Step 3: Build the Screen Inventory (exhaustive — before designing anything)
|
||||
|
||||
The most common design failure is a missing screen — e.g. a todo app with a list screen but no screen for adding a new item. To prevent it, enumerate **every** screen the requirements imply and write the list to `docs/design/screen-inventory.md` **before** creating any other design file.
|
||||
|
||||
Derive the inventory from the documents read in Step 0. The user's Step 1 answer about main screens is input, never the ceiling.
|
||||
|
||||
1. **Walk every user story and requirement** in `docs/product-requirements.md`, and every flow in `docs/functional-design.md`. For each one, write down every screen the user passes through to complete it end-to-end. If a story cannot be completed with the screens listed so far, the missing screens go on the list.
|
||||
2. **Apply CRUD coverage to every entity** the user manages (e.g. todo item, project, profile). For each entity, explicitly decide each of: list/overview, detail, **create/add**, edit, delete confirmation. Include each as an inventory entry unless the requirements clearly exclude it. If create/edit happens in a modal, dialog, or inline form rather than a full page, it is **still an inventory entry** (record its presentation) — it still needs a blueprint entry and a wireframe.
|
||||
3. **Add the supporting screens** the requirements imply: authentication (sign in / sign up / password reset), settings, onboarding, search/filter results, empty states, error / not-found.
|
||||
|
||||
Write each entry in this format:
|
||||
|
||||
```markdown
|
||||
- [ ] `screen-id` — Title
|
||||
- Purpose: what the user accomplishes here
|
||||
- Source: the PRD user story / functional-design section it comes from
|
||||
- Reached from: the screens/actions that navigate here
|
||||
- Presentation: page | modal | drawer
|
||||
- Key elements: main components, inputs, and actions on the screen
|
||||
```
|
||||
|
||||
End the file with a **traceability table**: one row per user story, listing the screen ids that fulfill it. Every user story must map to at least one screen, and every screen must trace back to at least one requirement. Do not proceed to Step 4 until both directions are fully covered.
|
||||
|
||||
### Step 4: Create the Design Brief
|
||||
|
||||
Create `docs/design/design-brief.md` covering:
|
||||
|
||||
@ -87,7 +108,7 @@ Create `docs/design/design-brief.md` covering:
|
||||
- Examples of preferred UI style
|
||||
- Examples of UI style to avoid
|
||||
|
||||
### Step 4: Create the Design Tokens
|
||||
### Step 5: Create the Design Tokens
|
||||
|
||||
Create `docs/design/design-tokens.json` using a JSON structure inspired by the Design Tokens Community Group format (each token has `$type` and `$value`). Include:
|
||||
|
||||
@ -99,7 +120,7 @@ Create `docs/design/design-tokens.json` using a JSON structure inspired by the D
|
||||
- Animation durations / easings
|
||||
- Breakpoints (if the target includes web)
|
||||
|
||||
### Step 5: Create the UI Blueprint (source of truth)
|
||||
### Step 6: Create the UI Blueprint (source of truth)
|
||||
|
||||
Create `docs/design/ui-blueprint.json`. This is **the** source of truth for UI generation. It must describe:
|
||||
|
||||
@ -112,7 +133,9 @@ Create `docs/design/ui-blueprint.json`. This is **the** source of truth for UI g
|
||||
- Component hierarchy
|
||||
- User actions and navigation behavior
|
||||
|
||||
### Step 6: Create the Platform Mapping
|
||||
**Coverage rule**: the blueprint must contain one screen entry for **every** entry in `docs/design/screen-inventory.md` — including modal/drawer entries. As each screen is added, check it off (`[ ]` → `[x]`) in the inventory. Do not finish this step while any inventory entry is unchecked.
|
||||
|
||||
### Step 7: Create the Platform Mapping
|
||||
|
||||
Create `docs/design/platform-mapping.md` describing how the design spec is converted to each platform:
|
||||
|
||||
@ -130,7 +153,7 @@ WinUI 3:
|
||||
- ui-blueprint.json → XAML pages, UserControls, styles
|
||||
```
|
||||
|
||||
### Step 7: Generate SVG Wireframes (visual references only)
|
||||
### Step 8: Generate SVG Wireframes (visual references only)
|
||||
|
||||
For each screen in `ui-blueprint.json`, generate a corresponding SVG wireframe under `docs/design/screens/`:
|
||||
|
||||
@ -140,10 +163,12 @@ For each screen in `ui-blueprint.json`, generate a corresponding SVG wireframe u
|
||||
|
||||
**Important rule**: SVG files are **not** the source of truth. They are generated as visual references for human review only. The source of truth is `ui-blueprint.json`. If the blueprint and an SVG ever disagree, the blueprint wins and the SVG must be regenerated.
|
||||
|
||||
### Step 8: Consistency Check
|
||||
### Step 9: Consistency Check
|
||||
|
||||
Re-read all generated files and confirm:
|
||||
|
||||
- Every entry in `docs/design/screen-inventory.md` is checked off and has a matching screen (same id) in `ui-blueprint.json`.
|
||||
- Every user story in the PRD can be completed end-to-end using only the screens and actions in the blueprint — in particular, every entity the user can create, edit, or delete has a screen (or modal) for each of those operations.
|
||||
- Every screen in `ui-blueprint.json` has a matching SVG in `screens/`.
|
||||
- Token names referenced in `ui-blueprint.json` exist in `design-tokens.json`.
|
||||
- `platform-mapping.md` covers all target platforms selected in Step 1.
|
||||
@ -153,6 +178,7 @@ Fix any inconsistencies found before finishing.
|
||||
|
||||
## Completion Criteria
|
||||
|
||||
- `docs/design/screen-inventory.md` exists and every entry is checked off
|
||||
- `docs/design/design-brief.md` exists
|
||||
- `docs/design/design-tokens.json` exists and is valid JSON
|
||||
- `docs/design/ui-blueprint.json` exists and is valid JSON
|
||||
@ -164,6 +190,7 @@ Completion message:
|
||||
"Design phase is complete!
|
||||
|
||||
Design documents created:
|
||||
✅ docs/design/screen-inventory.md (exhaustive screen list — all entries covered)
|
||||
✅ docs/design/design-brief.md
|
||||
✅ docs/design/design-tokens.json
|
||||
✅ docs/design/ui-blueprint.json (source of truth)
|
||||
@ -173,7 +200,7 @@ Design documents created:
|
||||
Next steps:
|
||||
- Review docs/design/ (especially ui-blueprint.json)
|
||||
- Refine the design with /update-design <change> (or re-run /define-design) until approved — do this BEFORE generating code
|
||||
- Run /generate-app web | flutter | winui3 to generate the initial app
|
||||
- Run /plan-milestones — milestone 01 (App Shell Generation) scaffolds the app from this design
|
||||
- Use /update-design when a feature changes the UI
|
||||
- Use /add-feature to add features (it respects the design spec)
|
||||
"
|
||||
|
||||
@ -29,8 +29,6 @@ claude
|
||||
↓
|
||||
/define-design
|
||||
↓
|
||||
/generate-app web | flutter | winui3
|
||||
↓
|
||||
/plan-milestones
|
||||
↓
|
||||
/execute-milestones phase1-milestones.md ← you are here (one phase file per run)
|
||||
@ -58,6 +56,7 @@ claude
|
||||
|
||||
1. Load the **milestone-execution skill** (`Skill('milestone-execution')`) for the per-milestone steering structure, task-division rules, and the gate criteria between milestones.
|
||||
2. The **steering skill** and **development-guidelines skill** apply during implementation, exactly as in `/add-feature`.
|
||||
3. **If the milestone is the App Shell milestone (milestone 01)**, additionally load the **platform-ui-generation skill** (`Skill('platform-ui-generation')`) for the design→code mapping rules of the target platform recorded in the milestone. Its E2E verification is the `e2e/app-shell.spec.ts` smoke spec (shell renders, every blueprint route navigates).
|
||||
|
||||
### Step 2: Milestone Loop
|
||||
|
||||
@ -103,15 +102,19 @@ Use the `Task` tool to launch the `implementation-validator` subagent:
|
||||
- `description`: "Milestone implementation validation"
|
||||
- `prompt`: "Please validate the quality of all changes implemented for milestone `[NN] [name]`. The target files are `[list of implemented file paths]`. Focus on coding standards, error handling, testability, consistency with existing patterns, and whether every feature's acceptance criteria in `.steering/[dir]/requirements.md` are met."
|
||||
|
||||
#### 2.6 Run Automated Tests
|
||||
#### 2.6 Run Automated Tests (including Playwright E2E)
|
||||
|
||||
1. Write or update the milestone's end-to-end tests following the **e2e-testing skill** (`Skill('e2e-testing')`): one `e2e/[feature-name].spec.ts` per feature in the milestone, covering its acceptance criteria. Set up Playwright first (as described in the skill) if it is missing.
|
||||
2. Run:
|
||||
|
||||
```bash
|
||||
Bash('npm test')
|
||||
Bash('npm run lint')
|
||||
Bash('npm run typecheck')
|
||||
Bash('npm run test:e2e')
|
||||
```
|
||||
|
||||
If any command fails, analyze, fix, and re-run until all pass.
|
||||
If any command fails, analyze, fix, and re-run until all pass. Never skip or delete a failing test to make verification pass.
|
||||
|
||||
#### 2.7 Retrospective and Document Reconciliation
|
||||
|
||||
@ -124,7 +127,7 @@ Apply `/add-feature` Step 8 for the milestone:
|
||||
|
||||
#### 2.8 Milestone Gate — then Continue
|
||||
|
||||
The milestone is done only when: all tasks are `[x]`, validation passed, tests/lint/typecheck are green, the six documents are reconciled, and the milestone status is updated in the phase file and the roadmap.
|
||||
The milestone is done only when: all tasks are `[x]`, validation passed, tests/lint/typecheck/E2E (Playwright) are green, the six documents are reconciled, and the milestone status is updated in the phase file and the roadmap.
|
||||
|
||||
**Once the gate passes, never stop; immediately start Step 2 for the next milestone in the queue.** If the gate genuinely cannot be passed (external blocker), record the blocker in the milestone's `tasklist.md`, the phase file, and `roadmap.md`, then stop and report — this is the only permitted early stop.
|
||||
|
||||
@ -138,7 +141,7 @@ The milestone is done only when: all tasks are `[x]`, validation passed, tests/l
|
||||
- Every milestone in the specified phase file has status `Completed`.
|
||||
- The phase's status is `Completed` in both the phase file and `docs/milestones/roadmap.md`.
|
||||
- Each executed milestone has its own `.steering/[date]-milestone-[NN]-[name]/` directory with all tasks `[x]`.
|
||||
- Tests, lint, and typecheck pass on the final state.
|
||||
- Tests, lint, typecheck, and Playwright E2E tests pass on the final state, with E2E coverage for every implemented feature's acceptance criteria.
|
||||
- The six persistent documents reflect everything implemented.
|
||||
|
||||
Completion message:
|
||||
|
||||
@ -1,150 +0,0 @@
|
||||
---
|
||||
description: Generate the initial application for a target platform (web | flutter | winui3) from the design spec
|
||||
---
|
||||
|
||||
# Generate App (Platform App Generation Phase)
|
||||
|
||||
This command generates the **initial application** for the selected target platform, using the design files in `docs/design/` as the source of truth. It creates the app shell, theme, routes, screens, and reusable components — **not** feature logic. Features are added later with `/add-feature`.
|
||||
|
||||
**Target platform**: `$ARGUMENTS` — must be one of `web`, `flutter`, `winui3`.
|
||||
|
||||
## How to Run
|
||||
|
||||
```bash
|
||||
claude
|
||||
> /generate-app web
|
||||
> /generate-app flutter
|
||||
> /generate-app winui3
|
||||
```
|
||||
|
||||
## Position in the Workflow
|
||||
|
||||
```
|
||||
/setup-project
|
||||
↓
|
||||
/define-design
|
||||
↓
|
||||
/generate-app web | flutter | winui3 ← you are here
|
||||
↓
|
||||
/plan-milestones
|
||||
↓
|
||||
/add-feature
|
||||
```
|
||||
|
||||
## Pre-Run Check
|
||||
|
||||
1. Validate the target:
|
||||
- If `$ARGUMENTS` is not one of `web`, `flutter`, `winui3`, stop and ask the user to provide a valid target.
|
||||
2. Confirm the design files exist. If any of these are missing, stop and tell the user to run `/define-design` first:
|
||||
- `docs/design/design-brief.md`
|
||||
- `docs/design/design-tokens.json`
|
||||
- `docs/design/ui-blueprint.json`
|
||||
- `docs/design/platform-mapping.md`
|
||||
3. **Important**: Do **not** generate any platform-specific implementation before this command is executed. This command is the only place initial app scaffolding is created.
|
||||
4. This command generates from the design **as-is**. Refine the design first (re-run `/define-design` or use `/update-design <change>`) if anything needs to change — it is far easier to refine before code is generated than after.
|
||||
|
||||
## Procedure
|
||||
|
||||
### Step 0: Read the Inputs
|
||||
|
||||
Read all of the following:
|
||||
|
||||
- `docs/product-requirements.md`
|
||||
- `docs/functional-design.md`
|
||||
- `docs/architecture.md`
|
||||
- `docs/repository-structure.md`
|
||||
- `docs/development-guidelines.md`
|
||||
- `docs/design/design-brief.md`
|
||||
- `docs/design/design-tokens.json`
|
||||
- `docs/design/ui-blueprint.json`
|
||||
- `docs/design/platform-mapping.md`
|
||||
|
||||
### Step 1: Load the Platform Generation Skill
|
||||
|
||||
Load the **platform-ui-generation skill** (`Skill('platform-ui-generation')`) for the mapping rules from design files to the selected platform's code.
|
||||
|
||||
### Step 2: Generate the App Shell
|
||||
|
||||
Generate the initial application for the selected target. In all cases:
|
||||
|
||||
- Respect the design tokens and the UI blueprint exactly.
|
||||
- Create reusable UI components (do not inline everything into screens).
|
||||
- Create the initial screen structure (one screen per entry in `ui-blueprint.json`).
|
||||
- Create the initial route/navigation structure.
|
||||
- Use semantic, accessible markup/semantics where the platform supports it.
|
||||
- **Do not implement features that are not described in the current project documents.** Only the app shell, theme, routes, screens, and shared components.
|
||||
|
||||
### Step 3: Platform-Specific Requirements
|
||||
|
||||
Apply the requirements for the selected target:
|
||||
|
||||
#### `/generate-app web`
|
||||
- Generate a Web app using the technology defined in `docs/architecture.md`.
|
||||
- If no framework is specified, ask the user or choose a simple default suitable for the repository.
|
||||
- Convert `design-tokens.json` into CSS variables, a Tailwind config, or an equivalent styling system.
|
||||
- Convert `ui-blueprint.json` into pages, layouts, and components.
|
||||
- Use semantic HTML where possible.
|
||||
- Respect responsive layout requirements (use breakpoints from the tokens).
|
||||
|
||||
#### `/generate-app flutter`
|
||||
- Generate a Flutter app.
|
||||
- Convert `design-tokens.json` into:
|
||||
- `ThemeData`
|
||||
- `ColorScheme`
|
||||
- spacing constants
|
||||
- radius constants
|
||||
- text styles
|
||||
- Convert `ui-blueprint.json` into:
|
||||
- routes
|
||||
- screens
|
||||
- reusable widgets
|
||||
- Keep clean separation between: `screens`, `widgets`, `theme`, `models`, `services`.
|
||||
|
||||
#### `/generate-app winui3`
|
||||
- Generate a WinUI 3 application structure.
|
||||
- Convert `design-tokens.json` into:
|
||||
- `ResourceDictionary`
|
||||
- theme resources
|
||||
- styles
|
||||
- Convert `ui-blueprint.json` into:
|
||||
- XAML pages
|
||||
- `UserControl`s
|
||||
- navigation structure
|
||||
- Use C# and XAML.
|
||||
- Keep UI logic separated from business logic where possible.
|
||||
|
||||
### Step 4: Update Repository Structure Document
|
||||
|
||||
If new directories/files were created, update `docs/repository-structure.md` so it reflects the generated layout.
|
||||
|
||||
### Step 5: Verify
|
||||
|
||||
- If the target is `web` and the repo has `npm test`, `npm run lint`, `npm run typecheck`, run them and fix any errors caused by the generated code.
|
||||
- For `flutter` / `winui3`, run the platform's available static checks if the toolchain is present; otherwise note what should be checked manually.
|
||||
|
||||
## Completion Criteria
|
||||
|
||||
- The initial app shell exists for the selected target.
|
||||
- Design tokens are converted into the platform's styling system.
|
||||
- The UI blueprint is converted into screens, routes, and reusable components.
|
||||
- No feature logic beyond what the project documents describe has been implemented.
|
||||
- `docs/repository-structure.md` has been updated if the layout changed.
|
||||
|
||||
Completion message:
|
||||
```
|
||||
"App generation is complete for target: [target]
|
||||
|
||||
Generated:
|
||||
✅ App shell + entry point
|
||||
✅ Theme / styling system (from design-tokens.json)
|
||||
✅ Routes / navigation (from ui-blueprint.json)
|
||||
✅ Screens (one per blueprint screen)
|
||||
✅ Reusable components
|
||||
|
||||
Next steps:
|
||||
- Run the app and verify the shell renders
|
||||
- Run /plan-milestones to break the product into milestones with a feature list each
|
||||
- Use /add-feature to implement features (they will respect the design spec)
|
||||
- Use /update-design when a feature changes the UI
|
||||
"
|
||||
```
|
||||
@ -23,11 +23,9 @@ claude
|
||||
↓
|
||||
/define-design
|
||||
↓
|
||||
/generate-app web | flutter | winui3
|
||||
↓
|
||||
/plan-milestones ← you are here
|
||||
↓
|
||||
/execute-milestones phase1-milestones.md (one phase file at a time)
|
||||
/execute-milestones phase1-milestones.md (one phase file at a time; milestone 01 generates the app shell)
|
||||
```
|
||||
|
||||
## Pre-Run Check
|
||||
@ -36,7 +34,7 @@ claude
|
||||
- `docs/product-requirements.md`
|
||||
- `docs/functional-design.md`
|
||||
- `docs/architecture.md`
|
||||
2. Check whether the design files (`docs/design/ui-blueprint.json` etc.) exist. If they do not, warn the user that milestones will be planned without a design spec and suggest running `/define-design` first. Continue only if the user accepts.
|
||||
2. Check whether the design files (`docs/design/ui-blueprint.json` etc.) exist. If they do not, warn the user that milestones will be planned without a design spec — and that milestone 01 (App Shell Generation) is scaffolded from that spec — and suggest running `/define-design` first. Continue only if the user accepts.
|
||||
3. Create the milestones directory if it does not exist:
|
||||
```bash
|
||||
mkdir -p docs/milestones
|
||||
@ -59,6 +57,7 @@ Read all of the following:
|
||||
|
||||
If `$ARGUMENTS` does not already answer these, ask the user about the following. If the user does not provide detailed preferences, **propose a sensible default** derived from the PRD priorities and confirm it before proceeding.
|
||||
|
||||
- **Target platform** — `web`, `flutter`, or `winui3` (propose the default from `docs/architecture.md` and `docs/design/platform-mapping.md`); milestone 01 generates the app shell for this platform
|
||||
- **Number of phases** (default: 2–3) and **milestones per phase** (default: 1–3)
|
||||
- **MVP definition** — what is the smallest product worth releasing? (phase 1 must deliver it)
|
||||
- **Priorities** — features that must come first or last
|
||||
@ -83,9 +82,10 @@ Size each feature so it can be implemented with **one `/add-feature` run**. Spli
|
||||
### Step 4: Group Features into Milestones, and Milestones into Phases
|
||||
|
||||
- Number milestones globally and consecutively across all phases (`01`, `02`, …).
|
||||
- **Milestone 1 is the MVP core**: the smallest set of features that forms a coherent, end-to-end usable product.
|
||||
- **Milestone 01 is always "App Shell Generation"** (there is no separate generate-app command — the shell is built as the first milestone). Following the **platform-ui-generation skill**, it scaffolds the app for the target platform from `docs/design/`: theme from `design-tokens.json`, routes/screens (one per blueprint screen) and reusable components from `ui-blueprint.json`, **no feature logic**, plus Playwright setup with the `e2e/app-shell.spec.ts` smoke spec. Its features are pre-defined in the milestone-planning skill.
|
||||
- **Milestone 02 is the MVP core**: the smallest set of features that forms a coherent, end-to-end usable product on top of the shell.
|
||||
- Later milestones build on earlier ones, ordered by priority and dependency (a feature never lands before something it depends on).
|
||||
- **Phase 1 delivers the MVP**: it contains milestone 1 (plus any milestone needed to make the MVP releasable). Later phases group the remaining milestones by theme and priority — each phase should be a meaningful release on its own.
|
||||
- **Phase 1 delivers the MVP**: it contains milestones 01 (app shell) and 02 (plus any milestone needed to make the MVP releasable). Later phases group the remaining milestones by theme and priority — each phase should be a meaningful release on its own.
|
||||
- Every feature belongs to **exactly one** milestone, and every milestone to **exactly one** phase. Explicitly park out-of-scope items in a final "Later / Icebox" section of the roadmap.
|
||||
|
||||
### Step 5: Create the Roadmap Overview
|
||||
@ -115,6 +115,7 @@ For each phase, create `docs/milestones/phase[N]-milestones.md` (e.g. `phase1-mi
|
||||
|
||||
Re-read all generated files and confirm:
|
||||
|
||||
- Milestone 01 is the App Shell milestone (target platform recorded, features per the milestone-planning skill).
|
||||
- Every P0/P1 requirement in the PRD is covered by a milestone (or explicitly parked in the icebox).
|
||||
- Every feature appears in exactly one milestone, and every milestone in exactly one phase file.
|
||||
- Milestone numbering is global and consecutive across the phase files.
|
||||
@ -136,13 +137,13 @@ Completion message:
|
||||
|
||||
Milestone documents created:
|
||||
✅ docs/milestones/roadmap.md (overview + status)
|
||||
✅ docs/milestones/phase1-milestones.md (MVP phase: milestones 01–NN)
|
||||
✅ docs/milestones/phase1-milestones.md (MVP phase: milestone 01 = app shell, milestones 02–NN)
|
||||
✅ docs/milestones/phase2-milestones.md (milestones NN–NN)
|
||||
|
||||
Next steps:
|
||||
- Review docs/milestones/ and adjust priorities if needed
|
||||
- Run /execute-milestones phase1-milestones.md to implement phase 1 (a separate steering directory is created per milestone)
|
||||
- Or go feature by feature: run /add-feature [first feature of milestone 1]
|
||||
- Or go feature by feature: run /add-feature [first feature of milestone 01 — the app shell]
|
||||
- Either way, each feature is marked complete in its phase file as it finishes
|
||||
"
|
||||
```
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
---
|
||||
description: Refine the design before /generate-app, or update it when a feature changes the UI (blueprint first, then tokens, brief, and SVGs)
|
||||
description: Refine the design before the app shell is generated (milestone 01), or update it when a feature changes the UI (blueprint first, then tokens, brief, and SVGs)
|
||||
---
|
||||
|
||||
# Update Design
|
||||
|
||||
This command updates the design specification. It is used in two situations: (1) to refine the UI/UX **before** running `/generate-app` (e.g. adjusting screens, tokens, or layout after reviewing the initial design), and (2) to update the design when a feature changes the UI. It updates the structured design files **only** — it does **not** implement application code unless explicitly requested.
|
||||
This command updates the design specification. It is used in two situations: (1) to refine the UI/UX **before** the app shell is generated by milestone 01 (e.g. adjusting screens, tokens, or layout after reviewing the initial design), and (2) to update the design when a feature changes the UI. It updates the structured design files **only** — it does **not** implement application code unless explicitly requested.
|
||||
|
||||
**Change description**: `$ARGUMENTS` (e.g. `/update-design add a profile screen with avatar and edit form`)
|
||||
|
||||
@ -38,6 +38,8 @@ Read:
|
||||
|
||||
The blueprint is the source of truth, so it is always updated first. Add/modify screens, components, variants, states, routes, and actions to reflect the requested change. Keep the JSON valid and consistent with the existing schema.
|
||||
|
||||
If the change adds or removes screens, also update `docs/design/screen-inventory.md` (create it if missing — see the ui-design skill) so it stays the complete screen list: new screens get a checked (`[x]`) entry with purpose, source, and how they are reached; removed screens are deleted from it.
|
||||
|
||||
### Step 2: Update `design-tokens.json` (if needed)
|
||||
|
||||
If the change introduces new colors, spacing, typography, radius, shadows, or animations, add the corresponding tokens here. Reuse existing tokens where possible; do not duplicate. Use semantic names. No hard-coded values should be needed downstream.
|
||||
@ -57,6 +59,7 @@ For every screen added or modified in `ui-blueprint.json`, generate or regenerat
|
||||
### Step 6: Consistency Check
|
||||
|
||||
- Every screen in `ui-blueprint.json` has a matching SVG.
|
||||
- `docs/design/screen-inventory.md` (if present) lists exactly the blueprint's screens.
|
||||
- Token names referenced in the blueprint exist in `design-tokens.json`.
|
||||
- The brief and mapping remain consistent with the blueprint.
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
"Skill(platform-ui-generation)",
|
||||
"Skill(milestone-planning)",
|
||||
"Skill(milestone-execution)",
|
||||
"Skill(e2e-testing)",
|
||||
"Skill(steering)"
|
||||
],
|
||||
"deny": [],
|
||||
|
||||
@ -90,6 +90,7 @@ When creating development guidelines: ./template.md
|
||||
### When Designing Tests
|
||||
- "Test Strategy" in ./guides/process.md (pyramid, coverage)
|
||||
- "Test Code" in ./guides/implementation.md (implementation patterns)
|
||||
- E2E tests: the **e2e-testing skill** (Playwright — E2E is part of every verification step)
|
||||
|
||||
### When Preparing a Release
|
||||
- "Git Workflow Rules" in ./guides/process.md (policy for merging into main)
|
||||
|
||||
118
.claude/skills/e2e-testing/SKILL.md
Normal file
118
.claude/skills/e2e-testing/SKILL.md
Normal file
@ -0,0 +1,118 @@
|
||||
---
|
||||
name: e2e-testing
|
||||
description: Guide for writing and running Playwright end-to-end tests as part of every verification step. Use when verifying a feature, milestone, or generated app shell, or when setting up Playwright in the repository.
|
||||
allowed-tools: Read, Write, Edit, Bash
|
||||
---
|
||||
|
||||
# E2E Testing Skill (Playwright)
|
||||
|
||||
This skill defines how end-to-end tests are written and run in this project. **Every verification step includes E2E tests**: a feature, milestone, or app shell is not "verified" until its Playwright tests pass alongside unit tests, lint, and typecheck.
|
||||
|
||||
## Core Principles
|
||||
|
||||
1. **E2E is part of verification, not an extra**: the standard verification sequence is `npm test` → `npm run lint` → `npm run typecheck` → `npm run test:e2e`. All four must pass.
|
||||
2. **Tests are derived from acceptance criteria**: every feature's acceptance criteria (from its phase file or steering `requirements.md`) map to E2E assertions. If a criterion cannot be asserted in an E2E test, note why in the tasklist.
|
||||
3. **Blueprint-driven selectors**: screens, routes, and actions come from `docs/design/ui-blueprint.json`. Tests navigate by the blueprint's routes and interact via the blueprint's actions.
|
||||
4. **One spec file per feature** plus one smoke spec for the app shell.
|
||||
5. **Web-first**: Playwright covers the `web` target. For `flutter` use `integration_test`, for `winui3` use the platform's UI automation — apply the same acceptance-criteria mapping; note in the tasklist when Playwright does not apply.
|
||||
|
||||
## Setup (run once, on demand)
|
||||
|
||||
If Playwright is not yet set up in the repository (no `@playwright/test` in `package.json`), set it up before the first E2E run:
|
||||
|
||||
```bash
|
||||
npm install -D @playwright/test
|
||||
npx playwright install --with-deps chromium
|
||||
```
|
||||
|
||||
Create `playwright.config.ts`:
|
||||
|
||||
```typescript
|
||||
import { defineConfig } from '@playwright/test';
|
||||
|
||||
export default defineConfig({
|
||||
testDir: './e2e',
|
||||
fullyParallel: true,
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
reporter: [['list'], ['html', { open: 'never' }]],
|
||||
use: {
|
||||
baseURL: process.env.E2E_BASE_URL ?? 'http://localhost:3000',
|
||||
trace: 'retain-on-failure',
|
||||
screenshot: 'only-on-failure',
|
||||
},
|
||||
webServer: {
|
||||
command: 'npm run dev', // adjust to the project's start command
|
||||
url: 'http://localhost:3000', // adjust to the project's port
|
||||
reuseExistingServer: !process.env.CI,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Add the script to `package.json`:
|
||||
|
||||
```json
|
||||
"test:e2e": "playwright test"
|
||||
```
|
||||
|
||||
Adjust `baseURL`, `webServer.command`, and the port to the project's actual dev server (see `docs/architecture.md`). Add `e2e/` artifacts (`playwright-report/`, `test-results/`) to `.gitignore`.
|
||||
|
||||
## Test Layout
|
||||
|
||||
```
|
||||
e2e/
|
||||
├── app-shell.spec.ts # smoke: shell renders, every blueprint route navigates
|
||||
├── [feature-name].spec.ts # one spec per feature
|
||||
└── helpers/ # shared fixtures/utilities (only when duplicated 3+ times)
|
||||
```
|
||||
|
||||
## Writing Feature Specs
|
||||
|
||||
For each feature, create `e2e/[kebab-case-feature-name].spec.ts`:
|
||||
|
||||
- One `test.describe` block per feature; one `test` per acceptance criterion (or a tight group of criteria).
|
||||
- Navigate using the route of the affected screen from `ui-blueprint.json`.
|
||||
- Prefer semantic locators: `getByRole`, `getByLabel`, `getByText` — matching the blueprint's component types and labels. Avoid CSS/XPath selectors tied to implementation details.
|
||||
- No fixed waits (`waitForTimeout`); rely on Playwright's auto-waiting and explicit `expect(...).toBeVisible()` style assertions.
|
||||
- Keep tests independent: each test sets up its own state and does not depend on execution order.
|
||||
|
||||
Example:
|
||||
|
||||
```typescript
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test.describe('Edit user profile', () => {
|
||||
test('saves a changed display name', async ({ page }) => {
|
||||
await page.goto('/profile');
|
||||
await page.getByLabel('Display name').fill('New Name');
|
||||
await page.getByRole('button', { name: 'Save' }).click();
|
||||
await expect(page.getByText('Profile updated')).toBeVisible();
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
## Writing the App-Shell Smoke Spec
|
||||
|
||||
Created by the App Shell milestone (milestone 01, web target). `e2e/app-shell.spec.ts` must verify:
|
||||
|
||||
- The app starts and the entry screen renders.
|
||||
- Every route in `ui-blueprint.json` is reachable and renders its screen title.
|
||||
- Primary navigation (from the blueprint's nav component) works.
|
||||
|
||||
## Running
|
||||
|
||||
```bash
|
||||
npm run test:e2e
|
||||
```
|
||||
|
||||
- If a test fails, analyze the trace/screenshot in `test-results/`, fix the code (or the test if the spec was wrong against the acceptance criteria), and re-run until green.
|
||||
- Never delete or skip a failing test to make verification pass; a skipped test requires a written reason in the tasklist, same as a struck task.
|
||||
|
||||
## Verification Checklist
|
||||
|
||||
Used by `/add-feature` Step 7 and `/execute-milestones` Step 2.6 (including the App Shell milestone):
|
||||
|
||||
- [ ] Playwright is set up (`test:e2e` script exists) — set it up via this skill if missing.
|
||||
- [ ] Every implemented feature has `e2e/[feature].spec.ts` covering its acceptance criteria.
|
||||
- [ ] The app-shell smoke spec still passes.
|
||||
- [ ] `npm test`, `npm run lint`, `npm run typecheck`, and `npm run test:e2e` all pass.
|
||||
- [ ] No test was skipped or deleted without a written reason.
|
||||
@ -46,14 +46,15 @@ Tasks are **grouped by feature**, in the implementation order chosen in `design.
|
||||
- [ ] [Task 1: data/model layer]
|
||||
- [ ] [Task 2: logic/service layer]
|
||||
- [ ] [Task 3: UI per affected screen]
|
||||
- [ ] [Task 4: tests for the acceptance criteria]
|
||||
- [ ] [Task 4: unit tests + Playwright E2E spec for the acceptance criteria]
|
||||
|
||||
## Feature: Log in / log out
|
||||
- [ ] ...
|
||||
|
||||
## Milestone Verification
|
||||
- [ ] All acceptance criteria in requirements.md confirmed
|
||||
- [ ] npm test / lint / typecheck pass
|
||||
- [ ] E2E specs exist for every feature (e2e/[feature].spec.ts, per the e2e-testing skill)
|
||||
- [ ] npm test / lint / typecheck / test:e2e pass
|
||||
|
||||
## Post-Implementation Retrospective
|
||||
_Filled at the end: completion date, plan vs. actual, lessons learned._
|
||||
@ -62,8 +63,8 @@ _Filled at the end: completion date, plan vs. actual, lessons learned._
|
||||
## How to Divide a Feature into Tasks
|
||||
|
||||
- 3–8 tasks per feature; each completable in **one implementation-loop iteration**.
|
||||
- Slice along the natural layers the feature touches: data/model → logic/service → UI (one task per affected screen) → tests.
|
||||
- Every feature's section ends with a task that verifies its acceptance criteria.
|
||||
- Slice along the natural layers the feature touches: data/model → logic/service → UI (one task per affected screen) → tests (unit + Playwright E2E).
|
||||
- Every feature's section ends with a task that verifies its acceptance criteria via the feature's E2E spec (see the e2e-testing skill).
|
||||
- Tasks that unblock several features go into a "Shared Foundations" section at the top — never duplicated per feature.
|
||||
|
||||
## Gate Criteria Between Milestones
|
||||
@ -72,7 +73,8 @@ A milestone passes its gate only when **all** of the following hold. Only then m
|
||||
|
||||
- [ ] Every task in the milestone's `tasklist.md` is `[x]` (or struck with a technical reason).
|
||||
- [ ] The `implementation-validator` subagent's validation passed.
|
||||
- [ ] `npm test`, `npm run lint`, `npm run typecheck` all succeed.
|
||||
- [ ] Every feature of the milestone has a Playwright E2E spec covering its acceptance criteria.
|
||||
- [ ] `npm test`, `npm run lint`, `npm run typecheck`, `npm run test:e2e` all succeed.
|
||||
- [ ] The six persistent documents in `docs/` are reconciled with the milestone's changes.
|
||||
- [ ] In the phase file: every feature of the milestone is checked off, and the milestone status is `Completed` with Completion Notes.
|
||||
- [ ] `roadmap.md` points to the next milestone (or, after the phase's last milestone, the phase is `Completed` and the roadmap points to the next phase file).
|
||||
|
||||
@ -19,13 +19,14 @@ Roadmap (roadmap.md)
|
||||
|
||||
## Core Principles
|
||||
|
||||
1. **MVP first**: Phase 1 delivers the MVP; milestone 1 is its core — the smallest coherent, end-to-end usable product. Not a layer (e.g. "all the models"), but a vertical slice a user could actually use.
|
||||
2. **Vertical slices**: Each feature cuts through UI → logic → data. Avoid horizontal milestones like "backend milestone" / "frontend milestone".
|
||||
3. **One feature = one `/add-feature` run**: If a feature needs more than one steering directory to implement, split it. If it is a one-line change, merge it into a neighbor.
|
||||
4. **One phase file = one `/execute-milestones` run**: A phase groups 1–3 milestones that together form a meaningful release.
|
||||
5. **Dependency order**: A feature never lands in an earlier milestone than something it depends on, and a milestone never lands in an earlier phase than its dependencies.
|
||||
6. **Exactly-once assignment**: Every feature belongs to exactly one milestone; every milestone to exactly one phase file. Deliberately deferred items go to the roadmap's "Later / Icebox" — nothing silently disappears.
|
||||
7. **Living documents**: Phase files track status. `/add-feature` and `/execute-milestones` check off features (`[ ]` → `[x]`) as they complete, and milestone/phase statuses are updated in both the phase file and `roadmap.md`.
|
||||
1. **App shell first**: Milestone 01 is always **App Shell Generation** — there is no separate generate-app command; the initial app is built as the first milestone (see "Milestone 01" below).
|
||||
2. **MVP first**: Phase 1 delivers the MVP; milestone 02 is its core — the smallest coherent, end-to-end usable product on top of the shell. Not a layer (e.g. "all the models"), but a vertical slice a user could actually use.
|
||||
3. **Vertical slices**: Each feature cuts through UI → logic → data. Avoid horizontal milestones like "backend milestone" / "frontend milestone".
|
||||
4. **One feature = one `/add-feature` run**: If a feature needs more than one steering directory to implement, split it. If it is a one-line change, merge it into a neighbor.
|
||||
5. **One phase file = one `/execute-milestones` run**: A phase groups 1–3 milestones that together form a meaningful release.
|
||||
6. **Dependency order**: A feature never lands in an earlier milestone than something it depends on, and a milestone never lands in an earlier phase than its dependencies.
|
||||
7. **Exactly-once assignment**: Every feature belongs to exactly one milestone; every milestone to exactly one phase file. Deliberately deferred items go to the roadmap's "Later / Icebox" — nothing silently disappears.
|
||||
8. **Living documents**: Phase files track status. `/add-feature` and `/execute-milestones` check off features (`[ ]` → `[x]`) as they complete, and milestone/phase statuses are updated in both the phase file and `roadmap.md`.
|
||||
|
||||
## Inputs
|
||||
|
||||
@ -51,6 +52,20 @@ File naming: `phase[N]-milestones.md` with `N` starting at 1 (e.g. `phase1-miles
|
||||
|
||||
Use the structure in `template.md` for each phase file and for the roadmap.
|
||||
|
||||
## Milestone 01: App Shell Generation (always the first milestone)
|
||||
|
||||
The initial app is not created by a separate command — it is **milestone 01**, the first milestone of phase 1, executed like any other milestone (via `/execute-milestones phase1-milestones.md` or feature by feature with `/add-feature`). Implementation follows the **platform-ui-generation skill** for the design→code mapping.
|
||||
|
||||
Record the **target platform** (`web` | `flutter` | `winui3`) in the milestone's Scope. Its features are:
|
||||
|
||||
- [ ] Generate the app shell and theme from the design tokens — entry point, layout shell, and the platform's styling system converted from `design-tokens.json`
|
||||
- [ ] Generate routes, screens, and reusable components from the UI blueprint — one screen per `ui-blueprint.json` entry, navigation wired, shared components extracted, **no feature logic**
|
||||
- [ ] Set up Playwright and the app-shell smoke spec — `playwright.config.ts`, `test:e2e` script, and `e2e/app-shell.spec.ts` verifying the shell renders and every blueprint route navigates (see the e2e-testing skill; platform equivalents for flutter/winui3)
|
||||
|
||||
Definition of done (in addition to the standard one): the app runs, every blueprint screen is reachable, tokens are the only styling source (no hard-coded values), and no feature logic exists beyond what the documents describe.
|
||||
|
||||
**Dependency**: milestone 01 requires the design spec (`docs/design/`). Every later milestone depends on milestone 01.
|
||||
|
||||
## How to Slice Features
|
||||
|
||||
A well-sized feature:
|
||||
@ -67,10 +82,11 @@ Too small (merge it): "Change button color" → fold into the feature that owns
|
||||
## How to Group Milestones and Phases
|
||||
|
||||
1. Tag every feature with its PRD priority and its dependencies.
|
||||
2. Milestone 1 (MVP core): the minimal dependency-closed set of P0 features that forms a usable product walk-through (a user can start, do the core job, and finish).
|
||||
3. Following milestones: group remaining features by theme and priority, keeping each milestone a meaningful step on its own ("after milestone N, the user can additionally …"). Prefer 3–8 features per milestone.
|
||||
4. **Phase 1** contains milestone 1 plus any milestone required to make the MVP releasable. **Following phases** group the remaining milestones into meaningful releases — prefer 2–3 phases with 1–3 milestones each.
|
||||
5. A phase should be independently valuable: after `/execute-milestones phase[N]-milestones.md` finishes, the product is in a releasable state.
|
||||
2. Milestone 01 (App Shell): always first — see "Milestone 01" above.
|
||||
3. Milestone 02 (MVP core): the minimal dependency-closed set of P0 features that forms a usable product walk-through (a user can start, do the core job, and finish).
|
||||
4. Following milestones: group remaining features by theme and priority, keeping each milestone a meaningful step on its own ("after milestone N, the user can additionally …"). Prefer 3–8 features per milestone.
|
||||
5. **Phase 1** contains milestones 01 and 02 plus any milestone required to make the MVP releasable. **Following phases** group the remaining milestones into meaningful releases — prefer 2–3 phases with 1–3 milestones each.
|
||||
6. A phase should be independently valuable: after `/execute-milestones phase[N]-milestones.md` finishes, the product is in a releasable state.
|
||||
|
||||
## Status Tracking Rules
|
||||
|
||||
@ -84,6 +100,7 @@ Too small (merge it): "Change button color" → fold into the feature that owns
|
||||
|
||||
Before finishing:
|
||||
|
||||
- [ ] Milestone 01 is the App Shell milestone, with its target platform recorded and the three shell features listed.
|
||||
- [ ] Every P0/P1 PRD requirement maps to a feature in some milestone (or is explicitly in the icebox).
|
||||
- [ ] Every feature appears in exactly one milestone; every milestone in exactly one phase file.
|
||||
- [ ] Milestone numbering is global and consecutive across phase files.
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
Use this structure for each `docs/milestones/phase[N]-milestones.md`. A phase file contains one or more milestones; milestone numbers are global across all phase files.
|
||||
|
||||
**Milestone 01 is always "App Shell Generation"** (first milestone of phase 1): its In Scope records the target platform (`web` | `flutter` | `winui3`), its features are the three shell features defined in SKILL.md (theme from tokens, screens/routes from the blueprint, Playwright + app-shell smoke spec), and its Definition of Done additionally requires that every blueprint screen is reachable and no feature logic was implemented.
|
||||
|
||||
```markdown
|
||||
# Phase [N]: [Name]
|
||||
|
||||
@ -59,7 +61,8 @@ Use this structure for each `docs/milestones/phase[N]-milestones.md`. A phase fi
|
||||
### Definition of Done
|
||||
|
||||
- [ ] All features above are checked off
|
||||
- [ ] `npm test`, `npm run lint`, `npm run typecheck` pass
|
||||
- [ ] Every feature has a Playwright E2E spec covering its acceptance criteria
|
||||
- [ ] `npm test`, `npm run lint`, `npm run typecheck`, `npm run test:e2e` pass
|
||||
- [ ] Persistent documents in `docs/` are reconciled with all features
|
||||
- [ ] [Milestone-specific criterion, e.g. "demo flow X→Y→Z works end-to-end"]
|
||||
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
---
|
||||
name: platform-ui-generation
|
||||
description: Guide for converting the design files (design-tokens.json + ui-blueprint.json) into application code for Web, Flutter, or WinUI 3. Use when running /generate-app or implementing UI against the design spec.
|
||||
description: Guide for converting the design files (design-tokens.json + ui-blueprint.json) into application code for Web, Flutter, or WinUI 3. Use when executing the App Shell milestone (milestone 01) or implementing UI against the design spec.
|
||||
allowed-tools: Read, Write, Edit, Bash
|
||||
---
|
||||
|
||||
# Platform UI Generation Skill
|
||||
|
||||
This skill explains how to convert the design files under `docs/design/` into application code. It is used by `/generate-app` and by `/add-feature` when implementing UI.
|
||||
This skill explains how to convert the design files under `docs/design/` into application code. It is used by the **App Shell milestone** (milestone 01 — planned by `/plan-milestones`, executed by `/execute-milestones` or `/add-feature`) and by `/add-feature` when implementing UI.
|
||||
|
||||
## Core Principles
|
||||
|
||||
1. **Source of truth**: `docs/design/ui-blueprint.json` defines structure; `docs/design/design-tokens.json` defines values.
|
||||
2. **No hard-coded values**: every color, size, spacing, radius, and duration in generated code must come from a token.
|
||||
3. **Reusable components first**: extract reusable components; do not inline the entire tree into screens.
|
||||
4. **No feature logic during scaffolding**: `/generate-app` creates the shell, theme, routes, screens, and shared components only. Features come from `/add-feature`.
|
||||
4. **No feature logic during scaffolding**: the App Shell milestone creates the shell, theme, routes, screens, and shared components only. Features come from the later milestones.
|
||||
5. **Respect the platform mapping**: `docs/design/platform-mapping.md` documents how each artifact maps to each platform.
|
||||
|
||||
## Inputs
|
||||
@ -85,7 +85,7 @@ Each generated reusable component must:
|
||||
- Reference tokens for all visual values — no hard-coded literals.
|
||||
- Stay presentational: no feature/business logic.
|
||||
|
||||
## Scaffolding Scope (what `/generate-app` creates)
|
||||
## Scaffolding Scope (what the App Shell milestone creates)
|
||||
|
||||
- App entry point and shell
|
||||
- Theme/styling system from tokens
|
||||
|
||||
@ -59,6 +59,9 @@ When skipping, always state the reason clearly:
|
||||
- [ ] `npm run lint`
|
||||
- [ ] Confirm that there are no type errors
|
||||
- [ ] `npm run typecheck`
|
||||
- [ ] Confirm that the E2E tests pass (Playwright — see the e2e-testing skill)
|
||||
- [ ] E2E specs exist for this work's acceptance criteria
|
||||
- [ ] `npm run test:e2e`
|
||||
- [ ] Confirm that the build succeeds
|
||||
- [ ] `npm run build`
|
||||
|
||||
|
||||
@ -16,11 +16,12 @@ Prefer describing **what a component is and how it behaves** over describing **w
|
||||
|
||||
## Outputs
|
||||
|
||||
This skill produces three kinds of artifacts under `docs/design/`:
|
||||
This skill produces four kinds of artifacts under `docs/design/`:
|
||||
|
||||
1. `design-brief.md` — the UI/UX direction (human-readable, but concrete)
|
||||
2. `ui-blueprint.json` — the source of truth for UI generation (machine-readable)
|
||||
3. `screens/*.svg` — visual wireframes for human review (derived from the blueprint)
|
||||
1. `screen-inventory.md` — an exhaustive checklist of every screen the requirements imply (always created first)
|
||||
2. `design-brief.md` — the UI/UX direction (human-readable, but concrete)
|
||||
3. `ui-blueprint.json` — the source of truth for UI generation (machine-readable)
|
||||
4. `screens/*.svg` — visual wireframes for human review (derived from the blueprint)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@ -32,6 +33,18 @@ Before creating the design, read:
|
||||
|
||||
The design must serve the product requirements and stay consistent with the functional design.
|
||||
|
||||
## Creating `screen-inventory.md` (always first)
|
||||
|
||||
Never design screens from memory of the requirements — a screen that is not on a written list will be forgotten (the classic miss: a list screen exists but the create/add screen does not). Build the inventory before the brief or the blueprint:
|
||||
|
||||
1. **Walk every user story** in the PRD and every flow in the functional design; list every screen the user needs to complete it end-to-end. If a story cannot be completed with the screens listed so far, the missing screens go on the list.
|
||||
2. **Apply CRUD coverage per entity**: for each domain object the user manages, explicitly decide list/overview, detail, **create/add**, edit, and delete confirmation — include each unless the requirements clearly exclude it. Modal/dialog/inline forms count as inventory entries too (record the presentation); they still need blueprint entries and wireframes.
|
||||
3. **Add supporting screens**: authentication, settings, onboarding, search results, empty states, error / not-found — wherever the requirements imply them.
|
||||
|
||||
Each entry is a checkbox item with `screen-id`, title, purpose, source requirement, how it is reached, presentation (page / modal / drawer), and key elements. End the file with a traceability table mapping every user story to the screen ids that fulfill it — both directions must be covered (no story without screens, no screen without a source).
|
||||
|
||||
Check entries off (`[x]`) as their screens are added to `ui-blueprint.json`. The blueprint is not complete while any entry is unchecked.
|
||||
|
||||
## Creating `design-brief.md`
|
||||
|
||||
A concrete, opinionated document. Avoid vague phrases like "modern and clean" without elaboration. Include every section below:
|
||||
@ -150,6 +163,8 @@ Each node has:
|
||||
|
||||
Before finishing:
|
||||
|
||||
- [ ] Every entry in `screen-inventory.md` is checked off and exists in the blueprint (same id).
|
||||
- [ ] Every user story can be completed end-to-end using only blueprint screens and actions — every entity that can be created, edited, or deleted has a screen or modal for each operation.
|
||||
- [ ] Every screen in the blueprint has a matching SVG.
|
||||
- [ ] Every `variant` used in a screen is declared in `components`.
|
||||
- [ ] Every token name used in the blueprint exists in `design-tokens.json`.
|
||||
|
||||
17
CLAUDE.md
17
CLAUDE.md
@ -14,7 +14,7 @@
|
||||
1. **Document creation**: Define "what to build" in persistent documents (`docs/`)
|
||||
2. **Work planning**: Plan "what to do this time" in steering files (`.steering/`)
|
||||
3. **Implementation**: Implement according to tasklist.md and update progress as you go
|
||||
4. **Verification**: Testing and operation checks
|
||||
4. **Verification**: Testing and operation checks — unit tests, lint, typecheck, and Playwright E2E tests (see the e2e-testing skill)
|
||||
5. **Update**: Reconcile all `docs/` documents with the implemented feature (see `/add-feature` Step 8)
|
||||
|
||||
### Important Rules
|
||||
@ -79,12 +79,13 @@ Define "what to build" and "how to build it" for the entire application:
|
||||
- **glossary.md** - Ubiquitous language definitions
|
||||
|
||||
#### Design Documents (`docs/design/`)
|
||||
- **screen-inventory.md** - Exhaustive screen checklist derived from the PRD (coverage guarantee for the blueprint)
|
||||
- **design-brief.md** - UI/UX direction
|
||||
- **design-tokens.json** - Styling tokens (source of values)
|
||||
- **ui-blueprint.json** - UI structure (source of truth for UI generation)
|
||||
- **platform-mapping.md** - How the design maps to Web / Flutter / WinUI 3
|
||||
- **screens/\*.svg** - Visual wireframes (references only)
|
||||
- Created by `/define-design`, updated by `/update-design`, consumed by `/generate-app` and `/add-feature`
|
||||
- Created by `/define-design`, updated by `/update-design`, consumed by the App Shell milestone (milestone 01) and `/add-feature`
|
||||
|
||||
#### Milestone Documents (`docs/milestones/`)
|
||||
- **roadmap.md** - Overview: phase/milestone table, ordering rationale, current phase and milestone, icebox
|
||||
@ -102,8 +103,8 @@ Define "what to do this time" for a specific development task:
|
||||
### Claude Code Configuration (`.claude/`)
|
||||
|
||||
- `.claude/agents/` - Subagent definitions (doc-reviewer, implementation-validator)
|
||||
- `.claude/commands/` - Slash commands (setup-project, define-design, generate-app, update-design, plan-milestones, execute-milestones, add-feature, review-docs)
|
||||
- `.claude/skills/` - Task-specific skills (prd-writing, functional-design, architecture-design, repository-structure, development-guidelines, glossary-creation, ui-design, design-tokens, platform-ui-generation, milestone-planning, milestone-execution, steering)
|
||||
- `.claude/commands/` - Slash commands (setup-project, define-design, update-design, plan-milestones, execute-milestones, add-feature, review-docs)
|
||||
- `.claude/skills/` - Task-specific skills (prd-writing, functional-design, architecture-design, repository-structure, development-guidelines, glossary-creation, ui-design, design-tokens, platform-ui-generation, milestone-planning, milestone-execution, e2e-testing, steering)
|
||||
|
||||
## Development Process
|
||||
|
||||
@ -113,10 +114,9 @@ Define "what to do this time" for a specific development task:
|
||||
2. Create persistent documents with `/setup-project` (automatically creating six)
|
||||
3. Define the UI/UX design with `/define-design` (creates `docs/design/`)
|
||||
4. Review and refine the UI/UX with `/update-design` (or re-run `/define-design`) until approved — before generating code
|
||||
5. Generate the initial app with `/generate-app web | flutter | winui3`
|
||||
6. Plan milestones with `/plan-milestones` (creates `docs/milestones/` with one `phase[N]-milestones.md` per phase)
|
||||
7. Implement, either way:
|
||||
- `/execute-milestones phase1-milestones.md` — execute one phase file: its milestones one by one autonomously (one steering directory per milestone); repeat with the next phase file, or
|
||||
5. Plan milestones with `/plan-milestones` (creates `docs/milestones/` with one `phase[N]-milestones.md` per phase; milestone 01 is always App Shell Generation from the design spec)
|
||||
6. Implement, either way:
|
||||
- `/execute-milestones phase1-milestones.md` — execute one phase file: its milestones one by one autonomously (one steering directory per milestone; milestone 01 generates the initial app); repeat with the next phase file, or
|
||||
- `/add-feature [feature]` — one feature at a time, milestone by milestone
|
||||
|
||||
### Day-to-Day Usage
|
||||
@ -134,7 +134,6 @@ Define "what to do this time" for a specific development task:
|
||||
|
||||
# Design phase
|
||||
> /define-design
|
||||
> /generate-app web
|
||||
> /update-design add a profile screen
|
||||
|
||||
# Milestone planning and execution
|
||||
|
||||
75
README.md
75
README.md
@ -13,7 +13,7 @@ https://github.com/GenerativeAgents/claude-code-book
|
||||
How a project goes from idea to working code with this boilerplate:
|
||||
|
||||
```
|
||||
Idea → /setup-project → /define-design → refine design → /generate-app → /plan-milestones → /execute-milestones (phase by phase)
|
||||
Idea → /setup-project → /define-design → refine design → /plan-milestones → /execute-milestones (phase by phase; milestone 01 generates the app)
|
||||
```
|
||||
|
||||
### Step 1 — Write down your idea
|
||||
@ -26,10 +26,13 @@ PRD, functional design, architecture, repository structure, development guidelin
|
||||
(all under `docs/`). Review them and request edits in normal conversation if needed.
|
||||
|
||||
### Step 3 — Define the UI/UX design: `/define-design`
|
||||
Creates the design specification under `docs/design/`: design brief, design tokens,
|
||||
**`ui-blueprint.json` (the source of truth for UI generation)**, platform mapping, and SVG
|
||||
wireframes (visual references only). You'll be asked once about platform, style, screens,
|
||||
navigation, branding, and accessibility.
|
||||
First builds an **exhaustive screen inventory** (`screen-inventory.md`) from the PRD and
|
||||
functional design — every user story walked end-to-end, plus list/detail/create/edit/delete
|
||||
coverage for every entity — so no screen gets skipped. Then creates the design specification
|
||||
under `docs/design/`: design brief, design tokens, **`ui-blueprint.json` (the source of truth
|
||||
for UI generation, one entry per inventory screen)**, platform mapping, and SVG wireframes
|
||||
(visual references only). You'll be asked once about platform, style, screens, navigation,
|
||||
branding, and accessibility.
|
||||
|
||||
### Step 4 — Review and refine the design **before writing any code**
|
||||
This is the key design-decision gate: iterate on the design while it is still cheap to change.
|
||||
@ -38,18 +41,17 @@ This is the key design-decision gate: iterate on the design while it is still ch
|
||||
- Re-run `/define-design` — change the overall direction
|
||||
- Repeat until you approve the design (especially `ui-blueprint.json`)
|
||||
|
||||
### Step 5 — Generate the initial app: `/generate-app web | flutter | winui3`
|
||||
Scaffolds the app shell from the approved design: theme (from tokens), routes, screens, and
|
||||
reusable components. No feature logic yet.
|
||||
|
||||
### Step 6 — Plan milestones: `/plan-milestones`
|
||||
### Step 5 — Plan milestones: `/plan-milestones`
|
||||
Breaks the product into **phases** and milestones, and generates `docs/milestones/`:
|
||||
a `roadmap.md` overview plus **one file per phase** (`phase1-milestones.md`,
|
||||
`phase2-milestones.md`, …). Each phase file lists its milestones and **the features they
|
||||
contain** — each feature sized for exactly one `/add-feature` run, with acceptance criteria and a
|
||||
ready-to-run command. Phase 1 delivers the MVP; later phases build on it by priority and dependency.
|
||||
ready-to-run command. **Milestone 01 is always "App Shell Generation"**: it scaffolds the initial
|
||||
app from the approved design (theme from tokens, one screen per blueprint entry, routes, reusable
|
||||
components — no feature logic) plus the Playwright smoke spec; there is no separate generate-app
|
||||
step. Phase 1 delivers the MVP; later phases build on it by priority and dependency.
|
||||
|
||||
### Step 7 — Implement the milestones
|
||||
### Step 6 — Implement the milestones
|
||||
|
||||
Two ways to work through the plan:
|
||||
|
||||
@ -68,17 +70,54 @@ A fully autonomous loop, one feature per run. Each run:
|
||||
2. Reads the feature's entry in its phase file and the design spec first — and updates the design first if the feature changes the UI
|
||||
3. Implements every task in `tasklist.md`, checking items off as it goes
|
||||
4. Validates quality with the `implementation-validator` subagent
|
||||
5. Runs `npm test`, `npm run lint`, `npm run typecheck` until green
|
||||
5. Writes Playwright E2E tests for the feature's acceptance criteria, then runs `npm test`, `npm run lint`, `npm run typecheck`, and `npm run test:e2e` until green
|
||||
6. Records a retrospective, reconciles all six `docs/` documents, and checks the feature off in its phase file
|
||||
|
||||
### Step 8 — Repeat and maintain
|
||||
### Step 7 — Repeat and maintain
|
||||
- Remaining phases → `/execute-milestones <next phase file>`, or feature by feature with `/add-feature <feature>`
|
||||
- UI changes → `/update-design <change>` first, then `/add-feature`
|
||||
- Re-planning → re-run `/plan-milestones` or edit `docs/milestones/` in conversation
|
||||
- Document quality checks → `/review-docs <path>`
|
||||
|
||||
**A feature is "done" when**: all tasks in its tasklist are `[x]`, validation passes,
|
||||
test/lint/typecheck succeed, and the persistent documents are back in sync with the code.
|
||||
test/lint/typecheck and the Playwright E2E suite succeed, and the persistent documents are back
|
||||
in sync with the code.
|
||||
|
||||
## E2E Testing (Playwright)
|
||||
|
||||
Every verification step in this boilerplate includes end-to-end tests. The standard verification
|
||||
sequence — used by `/add-feature` and `/execute-milestones` — is:
|
||||
|
||||
```bash
|
||||
npm test # unit tests
|
||||
npm run lint
|
||||
npm run typecheck
|
||||
npm run test:e2e # Playwright E2E
|
||||
```
|
||||
|
||||
How it works (defined in the `e2e-testing` skill):
|
||||
|
||||
- **Setup is automatic**: on the first verification, if Playwright is missing, the agent installs
|
||||
`@playwright/test`, creates `playwright.config.ts` (dev-server integration, trace/screenshot on
|
||||
failure), and adds the `test:e2e` script.
|
||||
- **Tests are derived from acceptance criteria**: each feature gets `e2e/[feature].spec.ts` with
|
||||
one test per acceptance criterion, written before verification runs.
|
||||
- **The app shell has a smoke spec**: the App Shell milestone (milestone 01) creates `e2e/app-shell.spec.ts`, which
|
||||
checks that the shell renders and every route in `ui-blueprint.json` navigates.
|
||||
- **Blueprint-driven locators**: tests navigate by the blueprint's routes and use semantic
|
||||
locators (`getByRole`, `getByLabel`) — no CSS/XPath tied to implementation details, no fixed waits.
|
||||
- **No green-washing**: a failing E2E test is fixed, never skipped or deleted; milestone gates in
|
||||
`/execute-milestones` do not pass without a green E2E suite.
|
||||
|
||||
```
|
||||
e2e/
|
||||
├── app-shell.spec.ts # smoke: shell renders, all blueprint routes navigate
|
||||
├── [feature-name].spec.ts # one spec per feature (acceptance criteria)
|
||||
└── helpers/ # shared fixtures (only when duplicated 3+ times)
|
||||
```
|
||||
|
||||
Playwright covers the `web` target; for `flutter` the equivalent is `integration_test`, and for
|
||||
`winui3` the platform's UI automation — with the same acceptance-criteria mapping.
|
||||
|
||||
## Notes
|
||||
|
||||
@ -110,8 +149,7 @@ claude
|
||||
> /setup-project
|
||||
> /define-design
|
||||
> /update-design [refinement] # repeat until the design is approved
|
||||
> /generate-app web # or flutter | winui3
|
||||
> /plan-milestones
|
||||
> /plan-milestones # milestone 01 = app shell generation
|
||||
> /execute-milestones phase1-milestones.md # one phase at a time, or:
|
||||
> /add-feature [feature name] # one feature at a time
|
||||
```
|
||||
@ -125,8 +163,7 @@ See [Development Workflow (Step by Step)](#development-workflow-step-by-step) ab
|
||||
| `/setup-project` | Create the six persistent documents automatically | `/setup-project` |
|
||||
| `/define-design` | Create the UI/UX design spec under `docs/design/` | `/define-design` |
|
||||
| `/update-design` | Refine the design before generation, or update it when a feature changes the UI | `/update-design add a profile screen` |
|
||||
| `/generate-app` | Scaffold the initial app for a target platform | `/generate-app web` |
|
||||
| `/plan-milestones` | Plan phases and milestones; generates one `phase[N]-milestones.md` per phase | `/plan-milestones 2 phases, MVP first` |
|
||||
| `/plan-milestones` | Plan phases and milestones; generates one `phase[N]-milestones.md` per phase (milestone 01 = App Shell Generation) | `/plan-milestones 2 phases, MVP first` |
|
||||
| `/execute-milestones` | Execute one phase file: its milestones one by one, with separate steering documents per milestone (file argument required) | `/execute-milestones phase1-milestones.md` |
|
||||
| `/add-feature` | Implement a feature end-to-end (autonomous) | `/add-feature User profile editing` |
|
||||
| `/review-docs` | Detailed document review via subagent | `/review-docs docs/architecture.md` |
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# Design Specification (`docs/design/`)
|
||||
|
||||
This directory holds the project's **UI/UX design specification**. It is created and maintained by the `/define-design` and `/update-design` commands and consumed by `/generate-app` and `/add-feature`.
|
||||
This directory holds the project's **UI/UX design specification**. It is created and maintained by the `/define-design` and `/update-design` commands and consumed by the App Shell milestone (milestone 01) and `/add-feature`.
|
||||
|
||||
## Source of truth
|
||||
|
||||
@ -16,6 +16,7 @@ Generated UI must follow `design-tokens.json` — no hard-coded values.
|
||||
|
||||
```
|
||||
docs/design/
|
||||
├── screen-inventory.md # Exhaustive screen checklist derived from the PRD (built first)
|
||||
├── design-brief.md # UI/UX direction (human-readable, concrete)
|
||||
├── design-tokens.json # Styling values (color, type, spacing, radius, …)
|
||||
├── ui-blueprint.json # Source of truth: screens, components, routes, actions
|
||||
@ -28,6 +29,9 @@ docs/design/
|
||||
|
||||
## File purposes
|
||||
|
||||
### `screen-inventory.md`
|
||||
The exhaustive checklist of every screen the requirements imply — built first, before any other design file. Derived from every PRD user story walked end-to-end, CRUD coverage per entity (list/detail/create/edit/delete, modals included), and supporting screens, ending with a story→screen traceability table. Every entry must exist in `ui-blueprint.json`.
|
||||
|
||||
### `design-brief.md`
|
||||
Overall UI/UX direction: target users, design concept, visual mood, layout/navigation principles, accessibility, platform-specific notes, preferred styles, and styles to avoid.
|
||||
|
||||
@ -52,11 +56,11 @@ Low-fidelity wireframes, one per screen in `ui-blueprint.json`, named `<screen-i
|
||||
```
|
||||
/setup-project → product/architecture docs
|
||||
/define-design → creates the files above
|
||||
/generate-app web | flutter | winui3 → scaffolds the app from these files
|
||||
/plan-milestones → milestone 01 (App Shell) scaffolds the app from these files
|
||||
/update-design → updates these files when a feature changes the UI
|
||||
/add-feature → reads these files before implementing; updates them first if the UI changes
|
||||
```
|
||||
|
||||
## Status
|
||||
|
||||
This directory is populated by running `/define-design`. Until then, the files above do not exist and `/generate-app` will ask you to run `/define-design` first.
|
||||
This directory is populated by running `/define-design`. Until then, the files above do not exist and milestone planning/execution will warn you to run `/define-design` first.
|
||||
|
||||
@ -39,8 +39,7 @@ One file per phase — the execution unit for `/execute-milestones`. Contains th
|
||||
```
|
||||
/setup-project → product/architecture docs
|
||||
/define-design → UI/UX design spec
|
||||
/generate-app → initial app shell
|
||||
/plan-milestones → creates the files above
|
||||
/plan-milestones → creates the files above (milestone 01 = App Shell Generation)
|
||||
/execute-milestones phase1-milestones.md → implements that phase's milestones one by one (one steering directory per milestone), updating statuses here
|
||||
/add-feature → implements one feature, then checks it off here
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user