@schilling.mark.a/software-methodology 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/copilot-instructions.md +106 -0
- package/LICENSE +21 -0
- package/README.md +174 -0
- package/atdd-workflow/SKILL.md +117 -0
- package/atdd-workflow/references/green-phase.md +38 -0
- package/atdd-workflow/references/red-phase.md +62 -0
- package/atdd-workflow/references/refactor-phase.md +75 -0
- package/bdd-specification/SKILL.md +88 -0
- package/bdd-specification/references/example-mapping.md +105 -0
- package/bdd-specification/references/gherkin-patterns.md +214 -0
- package/cicd-pipeline/SKILL.md +64 -0
- package/cicd-pipeline/references/deployment-rollback.md +176 -0
- package/cicd-pipeline/references/environment-promotion.md +159 -0
- package/cicd-pipeline/references/pipeline-stages.md +198 -0
- package/clean-code/SKILL.md +77 -0
- package/clean-code/references/behavioral-patterns.md +329 -0
- package/clean-code/references/creational-patterns.md +197 -0
- package/clean-code/references/enterprise-patterns.md +334 -0
- package/clean-code/references/solid.md +230 -0
- package/clean-code/references/structural-patterns.md +238 -0
- package/continuous-improvement/SKILL.md +69 -0
- package/continuous-improvement/references/measurement.md +133 -0
- package/continuous-improvement/references/process-update.md +118 -0
- package/continuous-improvement/references/root-cause-analysis.md +144 -0
- package/dist/atdd-workflow.skill +0 -0
- package/dist/bdd-specification.skill +0 -0
- package/dist/cicd-pipeline.skill +0 -0
- package/dist/clean-code.skill +0 -0
- package/dist/continuous-improvement.skill +0 -0
- package/dist/green-implementation.skill +0 -0
- package/dist/product-strategy.skill +0 -0
- package/dist/story-mapping.skill +0 -0
- package/dist/ui-design-system.skill +0 -0
- package/dist/ui-design-workflow.skill +0 -0
- package/dist/ux-design.skill +0 -0
- package/dist/ux-research.skill +0 -0
- package/docs/INTEGRATION.md +229 -0
- package/docs/QUICKSTART.md +126 -0
- package/docs/SHARING.md +828 -0
- package/docs/SKILLS.md +296 -0
- package/green-implementation/SKILL.md +155 -0
- package/green-implementation/references/angular-patterns.md +239 -0
- package/green-implementation/references/common-rejections.md +180 -0
- package/green-implementation/references/playwright-patterns.md +321 -0
- package/green-implementation/references/rxjs-patterns.md +161 -0
- package/package.json +57 -0
- package/product-strategy/SKILL.md +71 -0
- package/product-strategy/references/business-model-canvas.md +199 -0
- package/product-strategy/references/canvas-alignment.md +108 -0
- package/product-strategy/references/value-proposition-canvas.md +159 -0
- package/project-templates/context.md.template +56 -0
- package/project-templates/test-strategy.md.template +87 -0
- package/story-mapping/SKILL.md +104 -0
- package/story-mapping/references/backbone.md +66 -0
- package/story-mapping/references/release-planning.md +92 -0
- package/story-mapping/references/task-template.md +78 -0
- package/story-mapping/references/walking-skeleton.md +63 -0
- package/ui-design-system/SKILL.md +48 -0
- package/ui-design-system/references/accessibility.md +134 -0
- package/ui-design-system/references/components.md +257 -0
- package/ui-design-system/references/design-tokens.md +209 -0
- package/ui-design-system/references/layout.md +136 -0
- package/ui-design-system/references/typography.md +114 -0
- package/ui-design-workflow/SKILL.md +90 -0
- package/ui-design-workflow/references/acceptance-targets.md +144 -0
- package/ui-design-workflow/references/component-selection.md +108 -0
- package/ui-design-workflow/references/scenario-to-ui.md +151 -0
- package/ui-design-workflow/references/screen-flows.md +116 -0
- package/ux-design/SKILL.md +75 -0
- package/ux-design/references/information-architecture.md +144 -0
- package/ux-design/references/interaction-patterns.md +141 -0
- package/ux-design/references/onboarding.md +159 -0
- package/ux-design/references/usability-evaluation.md +132 -0
- package/ux-research/SKILL.md +75 -0
- package/ux-research/references/journey-mapping.md +168 -0
- package/ux-research/references/mental-models.md +106 -0
- package/ux-research/references/personas.md +102 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Typography
|
|
2
|
+
|
|
3
|
+
## Type Scale
|
|
4
|
+
|
|
5
|
+
A fixed scale. Every text element in the product uses exactly one of these sizes. No exceptions.
|
|
6
|
+
|
|
7
|
+
| Token | Size | Line Height | Weight | Use |
|
|
8
|
+
|---|---|---|---|---|
|
|
9
|
+
| type.display | 36px | 1.2 | 700 | Page hero, landing headlines |
|
|
10
|
+
| type.h1 | 30px | 1.3 | 700 | Page title |
|
|
11
|
+
| type.h2 | 24px | 1.3 | 600 | Section heading |
|
|
12
|
+
| type.h3 | 20px | 1.4 | 600 | Subsection heading |
|
|
13
|
+
| type.h4 | 18px | 1.4 | 600 | Card title, group heading |
|
|
14
|
+
| type.body.lg | 18px | 1.6 | 400 | Lead paragraph, introductory text |
|
|
15
|
+
| type.body.md | 16px | 1.6 | 400 | Standard body text (default) |
|
|
16
|
+
| type.body.sm | 14px | 1.5 | 400 | Secondary text, captions, helper text |
|
|
17
|
+
| type.label | 14px | 1.4 | 500 | Form labels, column headers |
|
|
18
|
+
| type.caption | 12px | 1.4 | 400 | Timestamps, metadata, fine print |
|
|
19
|
+
| type.overline | 12px | 1.4 | 600 | Category labels, tags (uppercase) |
|
|
20
|
+
| type.mono | 14px | 1.5 | 400 | Code, IDs, technical strings |
|
|
21
|
+
|
|
22
|
+
## Font Family
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
type.family.sans — system UI font stack (default for all text)
|
|
26
|
+
type.family.mono — monospace stack (code, IDs only)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Never use a serif font unless the product explicitly requires editorial content.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Heading Hierarchy Rules
|
|
34
|
+
|
|
35
|
+
- **One h1 per page.** Always. It is the page title.
|
|
36
|
+
- **h2 before h3.** Never skip levels. No h3 without a parent h2.
|
|
37
|
+
- **Headings are structural, not decorative.** Don't use a heading size just because you want bigger text. Use `type.body.lg` or bold body text instead.
|
|
38
|
+
- **Headings use ubiquitous language.** They are the first thing users scan. Make them match the domain vocabulary.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Text Color Rules
|
|
43
|
+
|
|
44
|
+
| Context | Token |
|
|
45
|
+
|---|---|
|
|
46
|
+
| Headings (h1–h4) | color.text.primary |
|
|
47
|
+
| Body text | color.text.primary |
|
|
48
|
+
| Secondary / supporting text | color.text.secondary |
|
|
49
|
+
| Placeholder text | color.neutral.400 |
|
|
50
|
+
| Disabled text | color.text.disabled |
|
|
51
|
+
| Links | color.text.link |
|
|
52
|
+
| Links on hover | color.text.link.hover |
|
|
53
|
+
| Error messages | color.feedback.error.text |
|
|
54
|
+
| Success messages | color.feedback.success.text |
|
|
55
|
+
| Warning messages | color.feedback.warning.text |
|
|
56
|
+
| Text on dark backgrounds | color.text.inverse |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Responsive Scaling
|
|
61
|
+
|
|
62
|
+
Heading sizes reduce at smaller breakpoints. Body text stays constant.
|
|
63
|
+
|
|
64
|
+
| Token | xs–sm | md | lg+ |
|
|
65
|
+
|---|---|---|---|
|
|
66
|
+
| type.display | 28px | 32px | 36px |
|
|
67
|
+
| type.h1 | 24px | 28px | 30px |
|
|
68
|
+
| type.h2 | 20px | 22px | 24px |
|
|
69
|
+
| type.h3 | 18px | 19px | 20px |
|
|
70
|
+
| type.h4 | 16px | 17px | 18px |
|
|
71
|
+
| type.body.* | no change | no change | no change |
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Text Alignment
|
|
76
|
+
|
|
77
|
+
- **Left-align by default.** Always. For all languages that read left-to-right.
|
|
78
|
+
- **Center only for:** short headlines in hero sections, empty state messages, modal titles.
|
|
79
|
+
- **Never right-align** body text or headings. Right-align only numbers in table columns for readability.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Truncation
|
|
84
|
+
|
|
85
|
+
When text overflows its container:
|
|
86
|
+
- **Single line:** ellipsis (`…`) at the end. CSS `text-overflow: ellipsis`.
|
|
87
|
+
- **Multi-line (2–3 lines):** ellipsis at the end of the last visible line. CSS `-webkit-line-clamp`.
|
|
88
|
+
- **Never hide text silently.** If text is truncated, the full text must be available on hover (tooltip) or on interaction (expand).
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Lists
|
|
93
|
+
|
|
94
|
+
**Unordered lists:**
|
|
95
|
+
- Bullet: `spacing.sm` (8px) left indent
|
|
96
|
+
- Item spacing: `spacing.sm` (8px) between items
|
|
97
|
+
- Use for items with no inherent order
|
|
98
|
+
|
|
99
|
+
**Ordered lists:**
|
|
100
|
+
- Number: `spacing.sm` (8px) left indent
|
|
101
|
+
- Item spacing: `spacing.sm` (8px) between items
|
|
102
|
+
- Use only when sequence matters
|
|
103
|
+
|
|
104
|
+
**No nesting deeper than two levels.** If you need three levels, restructure the content.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Anti-Patterns
|
|
109
|
+
|
|
110
|
+
- **All caps for emphasis.** Use font-weight instead. All caps is reserved for `type.overline` only.
|
|
111
|
+
- **More than two font weights on one screen.** 400 (regular) and 600 (semi-bold) cover almost everything. Add 700 (bold) only for display/h1.
|
|
112
|
+
- **Justified text.** Creates uneven word spacing. Left-align instead.
|
|
113
|
+
- **Line length over 75 characters.** Long lines are hard to read. Constrain text containers. Centered content columns (8 of 12 grid columns) naturally prevent this.
|
|
114
|
+
- **Font size below 12px.** Anything smaller is unreadable on most screens, especially mobile. `type.caption` at 12px is the floor.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ui-design-workflow
|
|
3
|
+
description: UI design workflow for translating Gherkin scenarios into concrete interface designs before implementation. Use when a feature has acceptance scenarios with user-facing UI, when planning what screens or components a feature needs, when the user says "design the UI", "what does this look like", or "plan the interface". Reads feature files and story map tasks. Produces screen-flow documents and component specs that acceptance tests verify against. Works alongside bdd-specification and atdd-workflow skills.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# UI Design Workflow
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
[TODO: 1-2 sentences explaining what this skill enables]
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
Bridges the gap between Gherkin scenarios and implementation. Takes the "what the user does and sees" from feature files and translates it into concrete screen flows, component decisions, and interaction specs. The output becomes the target that acceptance tests verify.
|
|
15
|
+
|
|
16
|
+
## Before Starting — Read Context
|
|
17
|
+
|
|
18
|
+
1. `/features/[domain]/[feature].feature` — the scenarios being designed for
|
|
19
|
+
2. `/docs/story-map/user-tasks/[task-id].md` — task context and acceptance criteria
|
|
20
|
+
3. `/docs/value-proposition-canvas.md` — user goals and pain points
|
|
21
|
+
4. `/docs/ui-design/design-system.md` — tokens, components, layout rules (project-specific, populated from ui-design-system skill)
|
|
22
|
+
5. `/docs/ui-design/screen-flows/` — existing screen flows for consistency
|
|
23
|
+
|
|
24
|
+
## Workflow Decision
|
|
25
|
+
|
|
26
|
+
**Feature has UI-facing scenarios?** → Follow "Design Workflow" below
|
|
27
|
+
**Feature is API-only or background processing?** → Skip this skill entirely
|
|
28
|
+
**Unsure?** → Check the Gherkin scenarios. If any Then step says "I should see", "I should be able to", or references a screen or page, it has UI.
|
|
29
|
+
|
|
30
|
+
## Design Workflow
|
|
31
|
+
|
|
32
|
+
### Step 1: Extract UI Requirements from Scenarios
|
|
33
|
+
|
|
34
|
+
Read each Gherkin scenario and identify:
|
|
35
|
+
- **Screens** — what pages or views are needed
|
|
36
|
+
- **Entry points** — how the user gets to each screen
|
|
37
|
+
- **Data displayed** — what information appears on each screen
|
|
38
|
+
- **Actions available** — what the user can do on each screen
|
|
39
|
+
- **State changes** — how the screen changes in response to actions
|
|
40
|
+
- **Error states** — what the user sees when something fails
|
|
41
|
+
|
|
42
|
+
See `references/scenario-to-ui.md` for the extraction process and mapping patterns.
|
|
43
|
+
|
|
44
|
+
### Step 2: Design Screen Flows
|
|
45
|
+
|
|
46
|
+
Map the extracted requirements into a connected flow of screens. Each screen flow document covers one feature's worth of screens.
|
|
47
|
+
|
|
48
|
+
See `references/screen-flows.md` for structure, notation, and file format.
|
|
49
|
+
|
|
50
|
+
Create: `/docs/ui-design/screen-flows/[feature-name].md`
|
|
51
|
+
|
|
52
|
+
### Step 3: Select Components
|
|
53
|
+
|
|
54
|
+
For each screen, identify which components from the design system are needed and which need to be created new.
|
|
55
|
+
|
|
56
|
+
See `references/component-selection.md` for decision guidance — when to use existing components, when to create new ones, and how to spec a new component.
|
|
57
|
+
|
|
58
|
+
### Step 4: Define Acceptance Targets
|
|
59
|
+
|
|
60
|
+
Translate design decisions into observable, testable assertions. These become the "Then" steps that acceptance tests verify.
|
|
61
|
+
|
|
62
|
+
See `references/acceptance-targets.md` for how to express design decisions as testable outcomes.
|
|
63
|
+
|
|
64
|
+
### Step 5: Update Feature File
|
|
65
|
+
|
|
66
|
+
If the design process revealed that scenarios need refinement (missing states, ambiguous actions), update the feature file in collaboration with bdd-specification skill before handing off to atdd-workflow.
|
|
67
|
+
|
|
68
|
+
## File Structure
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
docs/ui-design/
|
|
72
|
+
├── design-system.md ← Project's design system (from ui-design-system skill)
|
|
73
|
+
├── screen-flows/
|
|
74
|
+
│ ├── [feature-name].md ← Screen flow for one feature
|
|
75
|
+
│ └── [feature-name].md
|
|
76
|
+
└── components/
|
|
77
|
+
└── [component-name].md ← Spec for a new component (if needed)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Integration
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
bdd-specification → writes Gherkin scenarios (Given/When/Then)
|
|
84
|
+
↓
|
|
85
|
+
ui-design-workflow (this skill) → translates scenarios into screen flows and component specs
|
|
86
|
+
↓
|
|
87
|
+
atdd-workflow → implements with RED-GREEN-REFACTOR
|
|
88
|
+
↓ (acceptance tests verify against)
|
|
89
|
+
ui-design-workflow → screen flows and acceptance targets define what "passing" looks like
|
|
90
|
+
```
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Acceptance Targets
|
|
2
|
+
|
|
3
|
+
## What Are Acceptance Targets?
|
|
4
|
+
|
|
5
|
+
Design decisions translated into observable outcomes that acceptance tests can verify. Every significant design decision must have at least one acceptance target — otherwise it's untestable and will drift.
|
|
6
|
+
|
|
7
|
+
## What Is Testable vs What Is Not
|
|
8
|
+
|
|
9
|
+
**Testable — acceptance tests can verify:**
|
|
10
|
+
- Element is present on the screen
|
|
11
|
+
- Element contains specific text or data
|
|
12
|
+
- Element is in a specific state (visible, hidden, disabled, focused)
|
|
13
|
+
- Action produces a specific result (navigation, state change, data update)
|
|
14
|
+
- Error message appears in response to invalid input
|
|
15
|
+
- Layout relationship (element A appears before element B)
|
|
16
|
+
- Accessible properties (role, label, keyboard behavior)
|
|
17
|
+
|
|
18
|
+
**Not testable by acceptance tests — leave to visual review:**
|
|
19
|
+
- Exact color values (unless tied to a semantic meaning like error=red)
|
|
20
|
+
- Precise spacing or margins
|
|
21
|
+
- Font weight or style
|
|
22
|
+
- Animation timing or easing
|
|
23
|
+
- Aesthetic judgment calls
|
|
24
|
+
|
|
25
|
+
## Mapping Design Decisions to Targets
|
|
26
|
+
|
|
27
|
+
For each screen in the flow, identify the design decisions that matter and express them as acceptance targets.
|
|
28
|
+
|
|
29
|
+
### Pattern 1: Element Presence
|
|
30
|
+
|
|
31
|
+
**Design decision:** "The invoice detail page shows the invoice number at the top"
|
|
32
|
+
**Acceptance target:**
|
|
33
|
+
```
|
|
34
|
+
Then I should see the invoice number displayed
|
|
35
|
+
```
|
|
36
|
+
**Test verifies:** Element with invoice number text exists on the page
|
|
37
|
+
|
|
38
|
+
### Pattern 2: Element State
|
|
39
|
+
|
|
40
|
+
**Design decision:** "The Save button is disabled until all required fields are filled"
|
|
41
|
+
**Acceptance target:**
|
|
42
|
+
```
|
|
43
|
+
Then the Save button should be disabled
|
|
44
|
+
When I fill in all required fields
|
|
45
|
+
Then the Save button should be enabled
|
|
46
|
+
```
|
|
47
|
+
**Test verifies:** Button's disabled attribute changes based on form state
|
|
48
|
+
|
|
49
|
+
### Pattern 3: Conditional Visibility
|
|
50
|
+
|
|
51
|
+
**Design decision:** "The discount field only appears when the customer has a discount agreement"
|
|
52
|
+
**Acceptance target:**
|
|
53
|
+
```
|
|
54
|
+
Given customer "ACME Corp" has a discount agreement
|
|
55
|
+
Then I should see the discount field
|
|
56
|
+
|
|
57
|
+
Given customer "New Corp" has no discount agreement
|
|
58
|
+
Then I should not see the discount field
|
|
59
|
+
```
|
|
60
|
+
**Test verifies:** Element presence/absence based on data condition
|
|
61
|
+
|
|
62
|
+
### Pattern 4: Navigation
|
|
63
|
+
|
|
64
|
+
**Design decision:** "Clicking an invoice row navigates to the invoice detail page"
|
|
65
|
+
**Acceptance target:**
|
|
66
|
+
```
|
|
67
|
+
When I click on invoice "INV-2024-001"
|
|
68
|
+
Then I should be on the invoice detail page
|
|
69
|
+
And I should see invoice number INV-2024-001
|
|
70
|
+
```
|
|
71
|
+
**Test verifies:** Page transition and correct data load
|
|
72
|
+
|
|
73
|
+
### Pattern 5: Error Display
|
|
74
|
+
|
|
75
|
+
**Design decision:** "Validation errors appear inline below the field that failed"
|
|
76
|
+
**Acceptance target:**
|
|
77
|
+
```
|
|
78
|
+
When I enter an invalid amount
|
|
79
|
+
And I attempt to save
|
|
80
|
+
Then I should see error "Amount must be positive" below the amount field
|
|
81
|
+
```
|
|
82
|
+
**Test verifies:** Error message presence and location relative to the field
|
|
83
|
+
|
|
84
|
+
### Pattern 6: Data Formatting
|
|
85
|
+
|
|
86
|
+
**Design decision:** "Monetary amounts display with currency symbol and two decimal places"
|
|
87
|
+
**Acceptance target:**
|
|
88
|
+
```
|
|
89
|
+
Then I should see total displayed as "$1,500.00"
|
|
90
|
+
```
|
|
91
|
+
**Test verifies:** Exact formatted string, not raw number
|
|
92
|
+
|
|
93
|
+
### Pattern 7: Empty State
|
|
94
|
+
|
|
95
|
+
**Design decision:** "When no invoices exist, show a message prompting the user to create one"
|
|
96
|
+
**Acceptance target:**
|
|
97
|
+
```
|
|
98
|
+
Given no invoices exist
|
|
99
|
+
When I view the invoice list
|
|
100
|
+
Then I should see "No invoices yet. Create your first invoice."
|
|
101
|
+
And I should see a "Create Invoice" button
|
|
102
|
+
```
|
|
103
|
+
**Test verifies:** Empty state message and call-to-action presence
|
|
104
|
+
|
|
105
|
+
### Pattern 8: Loading State
|
|
106
|
+
|
|
107
|
+
**Design decision:** "While data is loading, show a loading indicator and disable actions"
|
|
108
|
+
**Acceptance target:**
|
|
109
|
+
```
|
|
110
|
+
When the page is loading
|
|
111
|
+
Then I should see a loading indicator
|
|
112
|
+
And all action buttons should be disabled
|
|
113
|
+
```
|
|
114
|
+
**Test verifies:** Loading state renders correctly (may require mocked slow response in test)
|
|
115
|
+
|
|
116
|
+
## Acceptance Target Document
|
|
117
|
+
|
|
118
|
+
At the end of each screen flow, produce a consolidated list:
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
## Acceptance Targets: [Feature Name]
|
|
122
|
+
|
|
123
|
+
### [Screen Name]
|
|
124
|
+
- [ ] [Target 1 — element presence]
|
|
125
|
+
- [ ] [Target 2 — state condition]
|
|
126
|
+
- [ ] [Target 3 — navigation]
|
|
127
|
+
- [ ] [Target 4 — error display]
|
|
128
|
+
- [ ] [Target 5 — empty state]
|
|
129
|
+
|
|
130
|
+
### [Screen Name]
|
|
131
|
+
- [ ] [Target 1]
|
|
132
|
+
- [ ] [Target 2]
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
These targets feed directly into the acceptance test assertions during the RED phase of atdd-workflow. Each checkbox becomes a test case.
|
|
136
|
+
|
|
137
|
+
## Traceability
|
|
138
|
+
|
|
139
|
+
Every acceptance target traces back to:
|
|
140
|
+
- A design decision in the screen flow
|
|
141
|
+
- A scenario in the feature file
|
|
142
|
+
- A Then step in Gherkin
|
|
143
|
+
|
|
144
|
+
If a target has no corresponding Then step, either add one to the feature file or remove the target — every testable design decision should be covered by a scenario.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Component Selection
|
|
2
|
+
|
|
3
|
+
## Decision: Use Existing or Create New?
|
|
4
|
+
|
|
5
|
+
For each UI element in a screen flow, run this decision tree:
|
|
6
|
+
|
|
7
|
+
### Does a component already exist in the design system that does this?
|
|
8
|
+
**Yes** → Use it. Do not create a variant unless the existing component genuinely cannot accommodate the need.
|
|
9
|
+
**No** → Continue to next question.
|
|
10
|
+
|
|
11
|
+
### Can an existing component be composed to achieve this?
|
|
12
|
+
**Yes** → Compose. Example: a labeled input is just a Label + Input + HelperText arranged vertically. No new component needed.
|
|
13
|
+
**No** → Continue to next question.
|
|
14
|
+
|
|
15
|
+
### Is this element likely to appear in more than one screen or feature?
|
|
16
|
+
**Yes** → Create a new reusable component. Spec it in `/docs/ui-design/components/[name].md`
|
|
17
|
+
**No** → Implement inline in the screen. It's a one-off layout detail, not a component.
|
|
18
|
+
|
|
19
|
+
## When Existing Components Need Modification
|
|
20
|
+
|
|
21
|
+
If an existing component almost works but needs a small addition, prefer:
|
|
22
|
+
|
|
23
|
+
1. **Props first** — can a new prop configure the existing component? (e.g., `size="compact"`, `variant="inline"`)
|
|
24
|
+
2. **Composition second** — can you wrap the component with additional elements?
|
|
25
|
+
3. **New variant last** — only if the behavior is fundamentally different, not just visually different
|
|
26
|
+
|
|
27
|
+
**Never fork a component** to create a slightly different version. Two components that drift apart are harder to maintain than one flexible component.
|
|
28
|
+
|
|
29
|
+
## Specifying a New Component
|
|
30
|
+
|
|
31
|
+
When a new component is needed, create: `/docs/ui-design/components/[component-name].md`
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
# Component: [Name]
|
|
35
|
+
|
|
36
|
+
**First used in:** [feature name], [screen name]
|
|
37
|
+
**Design system token group:** [which token group it belongs to — e.g., form, feedback, navigation]
|
|
38
|
+
|
|
39
|
+
## Purpose
|
|
40
|
+
[One sentence: what this component does for the user]
|
|
41
|
+
|
|
42
|
+
## When to Use
|
|
43
|
+
- [Situation where this component is appropriate]
|
|
44
|
+
- [Another situation]
|
|
45
|
+
|
|
46
|
+
## When NOT to Use
|
|
47
|
+
- [Situation where a different component is better]
|
|
48
|
+
|
|
49
|
+
## Props
|
|
50
|
+
|
|
51
|
+
| Prop | Type | Required | Default | Description |
|
|
52
|
+
|------|------|----------|---------|-------------|
|
|
53
|
+
| [name] | [type] | Yes/No | [value] | [what it does] |
|
|
54
|
+
|
|
55
|
+
## States
|
|
56
|
+
|
|
57
|
+
| State | Description | Visual indication |
|
|
58
|
+
|-------|-------------|-------------------|
|
|
59
|
+
| Default | [normal state] | [how it looks] |
|
|
60
|
+
| Hover | [mouse over] | [how it looks] |
|
|
61
|
+
| Focus | [keyboard focus] | [how it looks] |
|
|
62
|
+
| Disabled | [not interactive] | [how it looks] |
|
|
63
|
+
| Error | [invalid state] | [how it looks] |
|
|
64
|
+
| Loading | [waiting for data] | [how it looks] |
|
|
65
|
+
|
|
66
|
+
## Variants
|
|
67
|
+
- **[Variant name]:** [when to use this variant, how it differs]
|
|
68
|
+
|
|
69
|
+
## Accessibility
|
|
70
|
+
- **Role:** [ARIA role]
|
|
71
|
+
- **Keyboard:** [how keyboard navigation works]
|
|
72
|
+
- **Screen reader:** [what gets announced]
|
|
73
|
+
- **Color contrast:** [meets WCAG AA minimum]
|
|
74
|
+
|
|
75
|
+
## Usage Example
|
|
76
|
+
```
|
|
77
|
+
[Show the component in context — which props, which state,
|
|
78
|
+
placed within a parent layout]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Do Not
|
|
82
|
+
- [Anti-pattern specific to this component]
|
|
83
|
+
- [Another anti-pattern]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Component Categories
|
|
87
|
+
|
|
88
|
+
Organize components into these categories. New components should be placed in the correct category:
|
|
89
|
+
|
|
90
|
+
**Form** — inputs, selects, checkboxes, radio buttons, text areas, date pickers
|
|
91
|
+
**Feedback** — alerts, toasts, error messages, validation messages, loading indicators, progress bars
|
|
92
|
+
**Navigation** — nav bars, breadcrumbs, tabs, pagination, back buttons, sidebars
|
|
93
|
+
**Layout** — cards, panels, modals, drawers, accordions, grids
|
|
94
|
+
**Display** — tables, lists, badges, avatars, icons, chips/tags
|
|
95
|
+
**Action** — buttons, icon buttons, menus, dropdowns, context menus
|
|
96
|
+
|
|
97
|
+
## Reuse Rules
|
|
98
|
+
|
|
99
|
+
- A component used in 1 place is a layout detail
|
|
100
|
+
- A component used in 2+ places is a candidate for the design system
|
|
101
|
+
- A component used in 3+ places is a design system component — spec it formally
|
|
102
|
+
- All design system components must have documented props, states, and accessibility
|
|
103
|
+
|
|
104
|
+
## Naming Conventions
|
|
105
|
+
|
|
106
|
+
- PascalCase: `InvoiceStatusBadge`, not `invoice-status-badge`
|
|
107
|
+
- Name after what it IS, not where it's used: `StatusBadge`, not `InvoicePageBadge`
|
|
108
|
+
- If a component is a variant of another, use a prop: `Badge variant="status"`, not a new `StatusBadge` component
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Extracting UI Requirements from Gherkin Scenarios
|
|
2
|
+
|
|
3
|
+
## Mapping Process
|
|
4
|
+
|
|
5
|
+
Read each scenario and extract six categories of UI requirement. Not every scenario produces all six — extract only what's present.
|
|
6
|
+
|
|
7
|
+
### 1. Screens
|
|
8
|
+
|
|
9
|
+
Identify every distinct view or page the scenario touches.
|
|
10
|
+
|
|
11
|
+
**Signals in Gherkin:**
|
|
12
|
+
- "Given I am on the [X] page"
|
|
13
|
+
- "When I navigate to [X]"
|
|
14
|
+
- "Then I should see the [X] screen"
|
|
15
|
+
|
|
16
|
+
**Example:**
|
|
17
|
+
```gherkin
|
|
18
|
+
Scenario: Create invoice
|
|
19
|
+
Given I am on the invoice list page
|
|
20
|
+
When I click create
|
|
21
|
+
Then I should see the new invoice form
|
|
22
|
+
```
|
|
23
|
+
→ Screens: Invoice List, New Invoice Form
|
|
24
|
+
|
|
25
|
+
### 2. Entry Points
|
|
26
|
+
|
|
27
|
+
How does the user get to each screen? Every screen must have at least one entry point.
|
|
28
|
+
|
|
29
|
+
**Signals in Gherkin:**
|
|
30
|
+
- "When I click [X]"
|
|
31
|
+
- "When I navigate to [X]"
|
|
32
|
+
- "When I select [X] from [Y]"
|
|
33
|
+
|
|
34
|
+
**Example:**
|
|
35
|
+
```
|
|
36
|
+
Invoice List → [Create button] → New Invoice Form
|
|
37
|
+
Invoice List → [Invoice row] → Invoice Detail
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 3. Data Displayed
|
|
41
|
+
|
|
42
|
+
What information must appear on each screen for the scenario to work?
|
|
43
|
+
|
|
44
|
+
**Signals in Gherkin:**
|
|
45
|
+
- "Then I should see [specific data]"
|
|
46
|
+
- "Then I should see [entity] with [attributes]"
|
|
47
|
+
|
|
48
|
+
**Example:**
|
|
49
|
+
```gherkin
|
|
50
|
+
Then I should see invoice number INV-2024-001
|
|
51
|
+
And I should see customer "ACME Corp"
|
|
52
|
+
And I should see total $1,500.00
|
|
53
|
+
```
|
|
54
|
+
→ Invoice Detail must display: invoice number, customer name, total
|
|
55
|
+
|
|
56
|
+
### 4. Actions Available
|
|
57
|
+
|
|
58
|
+
What can the user do on each screen? Actions become buttons, links, or interactive controls.
|
|
59
|
+
|
|
60
|
+
**Signals in Gherkin:**
|
|
61
|
+
- "When I [verb] the [noun]"
|
|
62
|
+
- "When I click [X]"
|
|
63
|
+
- "When I enter [value] into [field]"
|
|
64
|
+
- "When I select [option]"
|
|
65
|
+
|
|
66
|
+
**Example:**
|
|
67
|
+
```
|
|
68
|
+
New Invoice Form actions:
|
|
69
|
+
- Enter customer name (text input)
|
|
70
|
+
- Add line item (button)
|
|
71
|
+
- Enter line item description (text input)
|
|
72
|
+
- Enter line item amount (number input)
|
|
73
|
+
- Save (button)
|
|
74
|
+
- Cancel (button)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 5. State Changes
|
|
78
|
+
|
|
79
|
+
How does the screen change in response to an action? This drives component state and conditional rendering.
|
|
80
|
+
|
|
81
|
+
**Signals in Gherkin:**
|
|
82
|
+
- "Then I should see [X] change to [Y]"
|
|
83
|
+
- "Then [element] should [appear/disappear/update]"
|
|
84
|
+
- "Then I should be redirected to [screen]"
|
|
85
|
+
|
|
86
|
+
**Example:**
|
|
87
|
+
```
|
|
88
|
+
After save:
|
|
89
|
+
- Form disappears
|
|
90
|
+
- User is redirected to Invoice Detail
|
|
91
|
+
- Invoice Detail shows the new invoice data
|
|
92
|
+
|
|
93
|
+
After add line item:
|
|
94
|
+
- New empty line item row appears in the form
|
|
95
|
+
- Total updates to include new line item
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 6. Error States
|
|
99
|
+
|
|
100
|
+
What does the user see when something goes wrong?
|
|
101
|
+
|
|
102
|
+
**Signals in Gherkin:**
|
|
103
|
+
- "Then I should see error [message]"
|
|
104
|
+
- "Then I should see validation [message]"
|
|
105
|
+
- "And the [entity] should not be saved"
|
|
106
|
+
|
|
107
|
+
**Example:**
|
|
108
|
+
```
|
|
109
|
+
New Invoice Form errors:
|
|
110
|
+
- Customer not found: inline error below customer field
|
|
111
|
+
- Amount is negative: inline error below amount field
|
|
112
|
+
- Save fails: banner error at top of form
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Extraction Template
|
|
116
|
+
|
|
117
|
+
For each feature, produce this summary before designing screen flows:
|
|
118
|
+
|
|
119
|
+
```markdown
|
|
120
|
+
## UI Requirements: [Feature Name]
|
|
121
|
+
|
|
122
|
+
### Screens
|
|
123
|
+
- [Screen 1]: [purpose]
|
|
124
|
+
- [Screen 2]: [purpose]
|
|
125
|
+
|
|
126
|
+
### Entry Points
|
|
127
|
+
- [Screen A] → [action] → [Screen B]
|
|
128
|
+
|
|
129
|
+
### Data Displayed
|
|
130
|
+
- [Screen 1]: [list of data elements]
|
|
131
|
+
- [Screen 2]: [list of data elements]
|
|
132
|
+
|
|
133
|
+
### Actions
|
|
134
|
+
- [Screen 1]: [list of actions with control types]
|
|
135
|
+
- [Screen 2]: [list of actions with control types]
|
|
136
|
+
|
|
137
|
+
### State Changes
|
|
138
|
+
- [Action] → [what changes and where]
|
|
139
|
+
|
|
140
|
+
### Error States
|
|
141
|
+
- [Error condition] → [what user sees and where]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Common Gaps
|
|
145
|
+
|
|
146
|
+
If extraction reveals any of these, the feature file needs updating before design proceeds:
|
|
147
|
+
|
|
148
|
+
- A screen with no entry point — how does the user get there?
|
|
149
|
+
- An action with no outcome — what happens when the user does this?
|
|
150
|
+
- Data displayed but never explained how it gets there — where does this data come from?
|
|
151
|
+
- An error mentioned but the recovery path is unclear — what does the user do after seeing the error?
|