@specsafe/cli 2.0.4 → 2.2.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/README.md +56 -18
- package/canonical/personas/prism-aria.md +31 -0
- package/canonical/personas/sage-nolan.md +30 -0
- package/canonical/rules/.cursorrules.mdc +29 -6
- package/canonical/rules/.rules +28 -5
- package/canonical/rules/AGENTS.md +28 -5
- package/canonical/rules/CLAUDE.md +45 -22
- package/canonical/rules/CONVENTIONS.md +46 -15
- package/canonical/rules/GEMINI.md +28 -5
- package/canonical/rules/continue-config.yaml +1 -1
- package/canonical/skills/specsafe-architecture/SKILL.md +7 -0
- package/canonical/skills/specsafe-architecture/workflow.md +248 -0
- package/canonical/skills/specsafe-brainstorm/SKILL.md +7 -0
- package/canonical/skills/specsafe-brainstorm/workflow.md +218 -0
- package/canonical/skills/specsafe-brief/SKILL.md +7 -0
- package/canonical/skills/specsafe-brief/workflow.md +113 -0
- package/canonical/skills/specsafe-code/workflow.md +3 -0
- package/canonical/skills/specsafe-context/SKILL.md +7 -0
- package/canonical/skills/specsafe-context/workflow.md +175 -0
- package/canonical/skills/specsafe-party-mode/SKILL.md +7 -0
- package/canonical/skills/specsafe-party-mode/workflow.md +177 -0
- package/canonical/skills/specsafe-prd/SKILL.md +7 -0
- package/canonical/skills/specsafe-prd/workflow.md +196 -0
- package/canonical/skills/specsafe-principles/SKILL.md +7 -0
- package/canonical/skills/specsafe-principles/workflow.md +197 -0
- package/canonical/skills/specsafe-readiness/SKILL.md +7 -0
- package/canonical/skills/specsafe-readiness/workflow.md +247 -0
- package/canonical/skills/specsafe-skill-creator/SKILL.md +7 -0
- package/canonical/skills/specsafe-skill-creator/workflow.md +250 -0
- package/canonical/skills/specsafe-test/workflow.md +3 -0
- package/canonical/skills/specsafe-ux/SKILL.md +7 -0
- package/canonical/skills/specsafe-ux/workflow.md +283 -0
- package/canonical/templates/claude-code-prompt-template.md +65 -0
- package/canonical/templates/specsafe-config-template.json +1 -2
- package/generators/dist/adapters/aider.js +41 -3
- package/generators/dist/adapters/aider.js.map +1 -1
- package/generators/dist/adapters/antigravity.js +1 -2
- package/generators/dist/adapters/antigravity.js.map +1 -1
- package/generators/dist/adapters/continue.js +1 -1
- package/generators/dist/adapters/continue.js.map +1 -1
- package/generators/dist/adapters/cursor.js +1 -2
- package/generators/dist/adapters/cursor.js.map +1 -1
- package/generators/dist/adapters/gemini.js +13 -3
- package/generators/dist/adapters/gemini.js.map +1 -1
- package/generators/dist/adapters/index.d.ts +7 -7
- package/generators/dist/adapters/index.js +11 -11
- package/generators/dist/adapters/index.js.map +1 -1
- package/generators/dist/adapters/opencode.js +1 -2
- package/generators/dist/adapters/opencode.js.map +1 -1
- package/generators/dist/adapters/types.d.ts +2 -2
- package/generators/dist/adapters/types.js.map +1 -1
- package/generators/dist/adapters/utils.js +4 -3
- package/generators/dist/adapters/utils.js.map +1 -1
- package/generators/dist/adapters/zed.js +43 -11
- package/generators/dist/adapters/zed.js.map +1 -1
- package/generators/dist/doctor.js +11 -7
- package/generators/dist/doctor.js.map +1 -1
- package/generators/dist/index.js +2 -2
- package/generators/dist/index.js.map +1 -1
- package/generators/dist/init.d.ts +0 -1
- package/generators/dist/init.js +14 -24
- package/generators/dist/init.js.map +1 -1
- package/generators/dist/install.js +6 -6
- package/generators/dist/install.js.map +1 -1
- package/generators/dist/registry.js.map +1 -1
- package/generators/dist/update.js +2 -2
- package/generators/dist/update.js.map +1 -1
- package/package.json +19 -16
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# SpecSafe Skill Creator — Cass the Release Manager
|
|
2
|
+
|
|
3
|
+
> **Persona:** Cass the Release Manager. Concise, checklist-driven, ceremony-aware.
|
|
4
|
+
> **Principles:** Skills must be complete, valid, and integrate cleanly. Every skill needs guardrails.
|
|
5
|
+
|
|
6
|
+
**Input:** User intent for a new skill (described conversationally)
|
|
7
|
+
|
|
8
|
+
## Preconditions
|
|
9
|
+
|
|
10
|
+
- [ ] Verify `specsafe.config.json` exists in the project root. If not, STOP and inform the user: "Project not initialized. Run `/specsafe-init` first."
|
|
11
|
+
- [ ] Verify `canonical/skills/` directory exists. If not, STOP and inform the user: "SpecSafe canonical directory not found. Are you in the correct project root?"
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
### Step 1: Understand Intent
|
|
16
|
+
|
|
17
|
+
Ask the user these questions one at a time. Wait for answers before proceeding:
|
|
18
|
+
|
|
19
|
+
1. **"What should this skill do?"** — Get a one-sentence description.
|
|
20
|
+
2. **"When would someone use it?"** — Understand the trigger or context (e.g., "after writing tests", "when starting a new feature", "to check code quality").
|
|
21
|
+
3. **"Does it fit between existing pipeline stages, or is it a standalone utility?"** — Determine pipeline position. For reference, the pipeline stages are: BRAINSTORM → PRINCIPLES → BRIEF → PRD → UX → ARCH → READINESS → SPEC → TEST → CODE → QA → COMPLETE.
|
|
22
|
+
4. **"Which persona should it use?"** — Present the available personas:
|
|
23
|
+
- **Scout / Elena** — Research & Discovery (EXPLORE)
|
|
24
|
+
- **Mason / Kai** — Specification & Structure (BRIEF, PRD, SPEC, NEW)
|
|
25
|
+
- **Forge / Reva** — Test Engineering (TEST)
|
|
26
|
+
- **Bolt / Zane** — Implementation (CODE)
|
|
27
|
+
- **Warden / Lyra** — Verification & Quality (VERIFY, QA, READINESS)
|
|
28
|
+
- **Herald / Cass** — Lifecycle & Ceremony (COMPLETE, STATUS, ARCHIVE, INIT, DOCTOR)
|
|
29
|
+
- **Prism / Aria** — UX Design (UX)
|
|
30
|
+
- **Sage / Nolan** — System Architecture (ARCH)
|
|
31
|
+
- Or: **"I need a new persona"** — we'll create one in Step 4.
|
|
32
|
+
|
|
33
|
+
### Step 2: Classify
|
|
34
|
+
|
|
35
|
+
Based on the user's answers, determine the skill type:
|
|
36
|
+
|
|
37
|
+
- **Simple Utility** — Self-contained SKILL.md with all logic inline (like `specsafe-doctor`, `specsafe-status`). Best for: read-only checks, reports, diagnostics.
|
|
38
|
+
- **Workflow Skill** — SKILL.md + workflow.md (like `specsafe-code`, `specsafe-qa`). Best for: multi-step processes, interactive workflows, anything that modifies files.
|
|
39
|
+
- **Pipeline Skill** — Workflow skill that fits between stages and modifies PROJECT_STATE.md. Best for: new stages or gates in the TDD pipeline.
|
|
40
|
+
|
|
41
|
+
Present the classification to the user:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
Skill classification:
|
|
45
|
+
Name: specsafe-<name>
|
|
46
|
+
Type: <Simple Utility | Workflow Skill | Pipeline Skill>
|
|
47
|
+
Persona: <archetype> / <name>
|
|
48
|
+
Position: <standalone | after STAGE, before STAGE>
|
|
49
|
+
|
|
50
|
+
Does this look right?
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Wait for confirmation before proceeding.
|
|
54
|
+
|
|
55
|
+
### Step 3: Design
|
|
56
|
+
|
|
57
|
+
Work with the user to define the skill's structure. For each section, propose a draft and ask for feedback:
|
|
58
|
+
|
|
59
|
+
1. **Preconditions** — What must be true before this skill runs? (e.g., config exists, spec is at a certain stage, specific files exist)
|
|
60
|
+
2. **Workflow Steps** — What does the skill do, in order? Keep steps atomic and numbered.
|
|
61
|
+
3. **State Changes** — What files does it create or modify? (spec files, PROJECT_STATE.md, new files in docs/ or tests/)
|
|
62
|
+
4. **Guardrails** — What must this skill NEVER do? What safety constraints apply?
|
|
63
|
+
5. **Handoff** — What comes next after this skill completes? Which skill should the user run?
|
|
64
|
+
|
|
65
|
+
For pipeline skills, also define:
|
|
66
|
+
- **Entry Stage** — what PROJECT_STATE stage triggers this skill
|
|
67
|
+
- **Exit Stage** — what stage does PROJECT_STATE transition to after this skill completes
|
|
68
|
+
|
|
69
|
+
### Step 4: Create the Skill Files
|
|
70
|
+
|
|
71
|
+
#### For Simple Utility skills:
|
|
72
|
+
|
|
73
|
+
Create `canonical/skills/specsafe-<name>/SKILL.md`:
|
|
74
|
+
|
|
75
|
+
```markdown
|
|
76
|
+
---
|
|
77
|
+
name: specsafe-<name>
|
|
78
|
+
description: <one-line description>
|
|
79
|
+
disable-model-invocation: true
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
# <Skill Title> — <Persona Name> the <Persona Role>
|
|
83
|
+
|
|
84
|
+
> **Persona:** <Name> the <Role>. <Communication style summary>.
|
|
85
|
+
> **Principles:** <2-3 guiding principles>
|
|
86
|
+
|
|
87
|
+
## Workflow
|
|
88
|
+
|
|
89
|
+
### Step 1: <title>
|
|
90
|
+
<instructions>
|
|
91
|
+
|
|
92
|
+
### Step 2: <title>
|
|
93
|
+
<instructions>
|
|
94
|
+
|
|
95
|
+
...
|
|
96
|
+
|
|
97
|
+
## Guardrails
|
|
98
|
+
|
|
99
|
+
- NEVER <guardrail>
|
|
100
|
+
- ALWAYS <guardrail>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### For Workflow skills:
|
|
104
|
+
|
|
105
|
+
Create `canonical/skills/specsafe-<name>/SKILL.md`:
|
|
106
|
+
|
|
107
|
+
```markdown
|
|
108
|
+
---
|
|
109
|
+
name: specsafe-<name>
|
|
110
|
+
description: <one-line description>
|
|
111
|
+
disable-model-invocation: true
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
Read the file ./workflow.md now and follow every instruction in it step by step.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Create `canonical/skills/specsafe-<name>/workflow.md`:
|
|
118
|
+
|
|
119
|
+
```markdown
|
|
120
|
+
# <Skill Title> — <Persona Name> the <Persona Role>
|
|
121
|
+
|
|
122
|
+
> **Persona:** <Name> the <Role>. <Communication style summary>.
|
|
123
|
+
> **Principles:** <2-3 guiding principles>
|
|
124
|
+
|
|
125
|
+
**Input:** <what the user provides>
|
|
126
|
+
|
|
127
|
+
## Preconditions
|
|
128
|
+
|
|
129
|
+
- [ ] <precondition>
|
|
130
|
+
- [ ] <precondition>
|
|
131
|
+
|
|
132
|
+
## Workflow
|
|
133
|
+
|
|
134
|
+
### Step 1: <title>
|
|
135
|
+
<instructions>
|
|
136
|
+
|
|
137
|
+
### Step 2: <title>
|
|
138
|
+
<instructions>
|
|
139
|
+
|
|
140
|
+
...
|
|
141
|
+
|
|
142
|
+
## State Changes
|
|
143
|
+
|
|
144
|
+
<what files are created/modified>
|
|
145
|
+
|
|
146
|
+
## Guardrails
|
|
147
|
+
|
|
148
|
+
- NEVER <guardrail>
|
|
149
|
+
- ALWAYS <guardrail>
|
|
150
|
+
|
|
151
|
+
## Handoff
|
|
152
|
+
|
|
153
|
+
Next skill: `/specsafe-<next>` (<reason>)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
#### If a new persona is needed:
|
|
157
|
+
|
|
158
|
+
Create `canonical/personas/<archetype>-<name>.md`:
|
|
159
|
+
|
|
160
|
+
```markdown
|
|
161
|
+
# <Archetype> <Name> — <Role>
|
|
162
|
+
|
|
163
|
+
> **Archetype:** <Archetype> | **Stages:** <STAGES>
|
|
164
|
+
|
|
165
|
+
## Identity
|
|
166
|
+
- **Name:** <Name>
|
|
167
|
+
- **Role:** <Role>
|
|
168
|
+
- **Archetype:** <Archetype>
|
|
169
|
+
- **Stage(s):** <STAGES>
|
|
170
|
+
|
|
171
|
+
## Communication Style
|
|
172
|
+
<2-3 sentences describing how this persona communicates>
|
|
173
|
+
|
|
174
|
+
## Principles
|
|
175
|
+
1. <principle>
|
|
176
|
+
2. <principle>
|
|
177
|
+
3. <principle>
|
|
178
|
+
|
|
179
|
+
## Capabilities
|
|
180
|
+
- <capability>
|
|
181
|
+
- <capability>
|
|
182
|
+
|
|
183
|
+
## Guardrails
|
|
184
|
+
- NEVER <guardrail>
|
|
185
|
+
- ALWAYS <guardrail>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Step 5: Validate
|
|
189
|
+
|
|
190
|
+
After creating the files, run these checks and report results:
|
|
191
|
+
|
|
192
|
+
1. **SKILL.md frontmatter** — verify `name`, `description`, and `disable-model-invocation: true` are present
|
|
193
|
+
2. **workflow.md sections** — if workflow skill, verify these sections exist: Persona block, Preconditions, Workflow (with numbered steps), State Changes, Guardrails, Handoff
|
|
194
|
+
3. **Persona reference** — verify the persona file exists in `canonical/personas/` or was just created
|
|
195
|
+
4. **Handoff validity** — verify the handoff references a skill that exists in `canonical/skills/`
|
|
196
|
+
5. **Description quality** — verify the description is specific enough for auto-discovery (not generic like "helps with code")
|
|
197
|
+
6. **Guardrails present** — verify at least 2 guardrails are defined
|
|
198
|
+
|
|
199
|
+
Report:
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
Skill validation:
|
|
203
|
+
[PASS] SKILL.md frontmatter valid
|
|
204
|
+
[PASS] workflow.md has all required sections
|
|
205
|
+
[PASS] Persona reference valid: <persona file>
|
|
206
|
+
[PASS] Handoff target exists: specsafe-<next>
|
|
207
|
+
[PASS] Description is specific
|
|
208
|
+
[PASS] Guardrails defined: <N> rules
|
|
209
|
+
|
|
210
|
+
Skill created successfully: canonical/skills/specsafe-<name>/
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
If any check fails, report it as `[FAIL]` with a specific fix instruction, apply the fix, and re-validate.
|
|
214
|
+
|
|
215
|
+
### Step 6: Install
|
|
216
|
+
|
|
217
|
+
After validation passes, offer to update tool files:
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
Skill specsafe-<name> is ready.
|
|
221
|
+
|
|
222
|
+
To make it available in your AI tool, run:
|
|
223
|
+
specsafe install <tool>
|
|
224
|
+
|
|
225
|
+
This will regenerate the tool's skill files to include the new skill.
|
|
226
|
+
|
|
227
|
+
Want me to run this now? (Specify which tool, or 'all' for all configured tools.)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
If the user says yes, run `specsafe install <tool>` for the requested tool(s).
|
|
231
|
+
|
|
232
|
+
## State Changes
|
|
233
|
+
|
|
234
|
+
- Creates `canonical/skills/specsafe-<name>/SKILL.md`
|
|
235
|
+
- Creates `canonical/skills/specsafe-<name>/workflow.md` (for workflow/pipeline skills)
|
|
236
|
+
- Optionally creates `canonical/personas/<archetype>-<name>.md` (if new persona requested)
|
|
237
|
+
|
|
238
|
+
## Guardrails
|
|
239
|
+
|
|
240
|
+
- NEVER create skills that bypass the TDD workflow (no skipping TEST or QA stages)
|
|
241
|
+
- NEVER create a skill without guardrails — every skill must have at least 2 guardrail rules
|
|
242
|
+
- NEVER create a skill with a generic description — descriptions must be specific enough for auto-discovery
|
|
243
|
+
- ALWAYS validate the created skill structure before reporting success
|
|
244
|
+
- ALWAYS include guardrails in the new skill
|
|
245
|
+
- ALWAYS use `disable-model-invocation: true` in SKILL.md frontmatter
|
|
246
|
+
- ALWAYS confirm the skill classification with the user before creating files
|
|
247
|
+
|
|
248
|
+
## Handoff
|
|
249
|
+
|
|
250
|
+
Run `specsafe install <tool>` to regenerate tool files with the new skill included. The new skill is then available via `/specsafe-<name>` in the user's AI tool.
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
- [ ] Verify `specsafe.config.json` exists in the project root
|
|
11
11
|
- [ ] Read `specsafe.config.json` and extract: `testFramework`, `language`, `testCommand`
|
|
12
|
+
- [ ] Check whether the spec names any frameworks, SDKs, platforms, tools, or MCPs that shape the expected tests
|
|
13
|
+
- [ ] If named tools exist, note that current official documentation should be consulted before or during test design
|
|
14
|
+
- [ ] This is a reminder, not a blocker — continue even if documentation review has not happened yet
|
|
12
15
|
- [ ] Verify the spec file exists at `specs/active/<SPEC-ID>.md`
|
|
13
16
|
- [ ] Verify the spec's `Stage` field is `SPEC`
|
|
14
17
|
- [ ] Verify the spec has requirements with acceptance criteria (GIVEN/WHEN/THEN format)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specsafe-ux
|
|
3
|
+
description: Create UX design principles, design system foundations, and accessibility guidelines. Best used after PRD creation.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Read the file ./workflow.md now and follow every instruction in it step by step.
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
# specsafe-ux — Aria the UX Designer
|
|
2
|
+
|
|
3
|
+
> **Persona:** Aria the UX Designer. Empathetic, user-centered, accessibility-first.
|
|
4
|
+
> **Principles:** Every design decision traces to a user need. Accessibility is a requirement, not a feature. Design tokens over magic values.
|
|
5
|
+
|
|
6
|
+
**Input:** An optional focus area (e.g., "onboarding flow", "dashboard", "design tokens only"). Defaults to full UX design foundations.
|
|
7
|
+
|
|
8
|
+
## Preconditions
|
|
9
|
+
|
|
10
|
+
- [ ] Verify the project is initialized: `specsafe.config.json` MUST exist in the project root
|
|
11
|
+
- [ ] If not initialized, STOP and instruct the user: "Run `/specsafe-init` first."
|
|
12
|
+
- [ ] Read `docs/prd.md` if it exists (primary source of user and requirements context)
|
|
13
|
+
- [ ] Read `docs/product-brief.md` if it exists (secondary context)
|
|
14
|
+
- [ ] If NEITHER exists, ask the user: "I don't see a product brief or PRD. To design well, I need to understand the product. Can you tell me: What kind of product is this (web app, CLI, API, mobile app)? Who are the primary users? What are the 2-3 most important things they'll do with it?"
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
### Step 1: Understand the Users
|
|
19
|
+
|
|
20
|
+
From the PRD/brief or user input, establish:
|
|
21
|
+
|
|
22
|
+
1. **Primary Users:** Who are they? What's their context?
|
|
23
|
+
- Device(s): desktop, mobile, tablet, or all
|
|
24
|
+
- Environment: office, field, commute, home
|
|
25
|
+
- Technical expertise: novice, intermediate, expert
|
|
26
|
+
- Accessibility needs: visual, motor, cognitive, auditory considerations
|
|
27
|
+
- Frequency of use: daily power user, weekly, occasional
|
|
28
|
+
|
|
29
|
+
2. **Secondary Users:** Who else interacts with the system?
|
|
30
|
+
- Admins, managers, support staff, API consumers
|
|
31
|
+
|
|
32
|
+
3. **Usage Context:** Where and when do people use this product?
|
|
33
|
+
- Lighting conditions (outdoor? low-light?)
|
|
34
|
+
- Attention level (focused? distracted? multitasking?)
|
|
35
|
+
- Connectivity (always online? intermittent? offline?)
|
|
36
|
+
|
|
37
|
+
Present your understanding to the user: "Here's who I'm designing for. Is this right?"
|
|
38
|
+
|
|
39
|
+
### Step 2: Design Principles
|
|
40
|
+
|
|
41
|
+
Establish 3-5 core UX principles for the project. These are the rules that resolve design debates.
|
|
42
|
+
|
|
43
|
+
Format:
|
|
44
|
+
|
|
45
|
+
```markdown
|
|
46
|
+
## Design Principles
|
|
47
|
+
|
|
48
|
+
### 1. [Principle Name]
|
|
49
|
+
**Means:** [what this looks like in practice]
|
|
50
|
+
**Example:** [a concrete example of applying this principle]
|
|
51
|
+
**Anti-pattern:** [what violating this principle looks like]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Common principles to consider (pick what fits, don't use all):
|
|
55
|
+
- Progressive disclosure (show basics first, details on demand)
|
|
56
|
+
- Mobile-first (design for smallest screen, enhance upward)
|
|
57
|
+
- Keyboard navigable (every action reachable without a mouse)
|
|
58
|
+
- Minimal surprise (UI behaves as users expect)
|
|
59
|
+
- Error prevention over error handling (make mistakes impossible, not just recoverable)
|
|
60
|
+
- Speed as a feature (perceived performance matters)
|
|
61
|
+
- Offline-resilient (graceful degradation without connectivity)
|
|
62
|
+
|
|
63
|
+
Ask the user: "Here are the design principles I'd recommend for your product. Do these feel right? Any to add, remove, or change?"
|
|
64
|
+
|
|
65
|
+
### Step 3: Design Tokens
|
|
66
|
+
|
|
67
|
+
Define the foundational design tokens. These are the single source of truth for visual consistency.
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
## Design Tokens
|
|
71
|
+
|
|
72
|
+
### Color Palette
|
|
73
|
+
**Primary:**
|
|
74
|
+
- `--color-primary`: [hex] — [usage: buttons, links, focus rings]
|
|
75
|
+
- `--color-primary-hover`: [hex]
|
|
76
|
+
- `--color-primary-active`: [hex]
|
|
77
|
+
|
|
78
|
+
**Neutral:**
|
|
79
|
+
- `--color-background`: [hex] — [main background]
|
|
80
|
+
- `--color-surface`: [hex] — [cards, panels]
|
|
81
|
+
- `--color-text-primary`: [hex] — [body text]
|
|
82
|
+
- `--color-text-secondary`: [hex] — [helper text, captions]
|
|
83
|
+
- `--color-border`: [hex] — [dividers, input borders]
|
|
84
|
+
|
|
85
|
+
**Semantic:**
|
|
86
|
+
- `--color-success`: [hex]
|
|
87
|
+
- `--color-warning`: [hex]
|
|
88
|
+
- `--color-error`: [hex]
|
|
89
|
+
- `--color-info`: [hex]
|
|
90
|
+
|
|
91
|
+
### Typography Scale
|
|
92
|
+
- `--font-family-body`: [font stack]
|
|
93
|
+
- `--font-family-heading`: [font stack]
|
|
94
|
+
- `--font-family-mono`: [font stack]
|
|
95
|
+
- `--font-size-xs`: [size] — [usage: captions, fine print]
|
|
96
|
+
- `--font-size-sm`: [size] — [usage: helper text]
|
|
97
|
+
- `--font-size-base`: [size] — [usage: body text]
|
|
98
|
+
- `--font-size-lg`: [size] — [usage: subheadings]
|
|
99
|
+
- `--font-size-xl`: [size] — [usage: section headings]
|
|
100
|
+
- `--font-size-2xl`: [size] — [usage: page headings]
|
|
101
|
+
- `--line-height-tight`: [value]
|
|
102
|
+
- `--line-height-normal`: [value]
|
|
103
|
+
- `--line-height-relaxed`: [value]
|
|
104
|
+
|
|
105
|
+
### Spacing System
|
|
106
|
+
Base unit: [value, e.g., 4px or 0.25rem]
|
|
107
|
+
- `--space-1`: [1x base] — [usage: tight gaps]
|
|
108
|
+
- `--space-2`: [2x base] — [usage: related elements]
|
|
109
|
+
- `--space-3`: [3x base]
|
|
110
|
+
- `--space-4`: [4x base] — [usage: section padding]
|
|
111
|
+
- `--space-6`: [6x base] — [usage: section gaps]
|
|
112
|
+
- `--space-8`: [8x base] — [usage: page margins]
|
|
113
|
+
|
|
114
|
+
### Breakpoints
|
|
115
|
+
- `--breakpoint-sm`: [value] — mobile landscape
|
|
116
|
+
- `--breakpoint-md`: [value] — tablet
|
|
117
|
+
- `--breakpoint-lg`: [value] — desktop
|
|
118
|
+
- `--breakpoint-xl`: [value] — wide desktop
|
|
119
|
+
|
|
120
|
+
### Borders & Shadows
|
|
121
|
+
- `--radius-sm`: [value] — [usage: buttons, inputs]
|
|
122
|
+
- `--radius-md`: [value] — [usage: cards]
|
|
123
|
+
- `--radius-lg`: [value] — [usage: modals]
|
|
124
|
+
- `--shadow-sm`: [value] — [usage: dropdowns]
|
|
125
|
+
- `--shadow-md`: [value] — [usage: cards]
|
|
126
|
+
- `--shadow-lg`: [value] — [usage: modals]
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
If the product is a CLI or API (no visual UI), skip this step and note: "Design tokens not applicable for CLI/API products."
|
|
130
|
+
|
|
131
|
+
Ask the user: "Here's the token system. Any brand colors or typography preferences I should incorporate?"
|
|
132
|
+
|
|
133
|
+
### Step 4: Component Strategy
|
|
134
|
+
|
|
135
|
+
Identify the key UI components the product needs:
|
|
136
|
+
|
|
137
|
+
```markdown
|
|
138
|
+
## Component Strategy
|
|
139
|
+
|
|
140
|
+
### Core Components
|
|
141
|
+
| Component | Purpose | States | Accessibility Notes |
|
|
142
|
+
|-----------|---------|--------|---------------------|
|
|
143
|
+
| [Button] | [primary actions] | [default, hover, active, disabled, loading] | [keyboard focus, aria-label] |
|
|
144
|
+
| [Input] | [data entry] | [empty, filled, error, disabled] | [label association, error announcements] |
|
|
145
|
+
| ... | ... | ... | ... |
|
|
146
|
+
|
|
147
|
+
### Interaction Patterns
|
|
148
|
+
- **Navigation:** [sidebar, top nav, breadcrumbs, tabs — pick what fits]
|
|
149
|
+
- **Data Display:** [tables, cards, lists — when to use each]
|
|
150
|
+
- **Feedback:** [toast notifications, inline errors, loading states, empty states]
|
|
151
|
+
- **Forms:** [inline validation, step-by-step wizard, or single page]
|
|
152
|
+
|
|
153
|
+
### State Management (UI)
|
|
154
|
+
- **Loading states:** [skeleton screens, spinners, progress bars — when to use each]
|
|
155
|
+
- **Empty states:** [illustration + CTA, or text-only]
|
|
156
|
+
- **Error states:** [inline, toast, full-page — hierarchy]
|
|
157
|
+
- **Success states:** [confirmation, redirect, inline update]
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Step 5: Accessibility Requirements
|
|
161
|
+
|
|
162
|
+
Define the accessibility standard and specific requirements:
|
|
163
|
+
|
|
164
|
+
```markdown
|
|
165
|
+
## Accessibility
|
|
166
|
+
|
|
167
|
+
### Target Standard
|
|
168
|
+
**WCAG Level:** [A / AA / AAA] — [justify the choice]
|
|
169
|
+
|
|
170
|
+
### Requirements
|
|
171
|
+
- **Keyboard Navigation:** All interactive elements MUST be reachable and operable via keyboard. Tab order MUST follow visual order.
|
|
172
|
+
- **Screen Reader Support:** All images MUST have alt text. All form inputs MUST have associated labels. Dynamic content changes MUST be announced via ARIA live regions.
|
|
173
|
+
- **Color Contrast:** Text MUST meet minimum contrast ratios ([4.5:1 for normal text, 3:1 for large text] for AA).
|
|
174
|
+
- **Focus Indicators:** All focusable elements MUST have a visible focus indicator. NEVER rely solely on color to indicate focus.
|
|
175
|
+
- **Motion:** Respect `prefers-reduced-motion`. Animations MUST be pausable or disableable.
|
|
176
|
+
- **Touch Targets:** Interactive elements MUST have a minimum touch target of 44x44px on mobile.
|
|
177
|
+
- **Text Scaling:** Layout MUST remain functional at 200% text zoom.
|
|
178
|
+
|
|
179
|
+
### Testing Strategy
|
|
180
|
+
- **Automated:** [axe-core, Lighthouse accessibility audit]
|
|
181
|
+
- **Manual:** [keyboard-only navigation test, screen reader walkthrough]
|
|
182
|
+
- **User Testing:** [include users with disabilities in testing plan]
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Step 6: User Flows
|
|
186
|
+
|
|
187
|
+
Map 2-3 critical user flows, including both happy path and error states:
|
|
188
|
+
|
|
189
|
+
```markdown
|
|
190
|
+
## User Flows
|
|
191
|
+
|
|
192
|
+
### Flow: [Flow Name]
|
|
193
|
+
**User:** [persona]
|
|
194
|
+
**Goal:** [what they want to accomplish]
|
|
195
|
+
**Entry Point:** [where they start]
|
|
196
|
+
|
|
197
|
+
#### Happy Path
|
|
198
|
+
1. [User sees/does X] -> [System shows Y]
|
|
199
|
+
2. [User sees/does X] -> [System shows Y]
|
|
200
|
+
3. ...
|
|
201
|
+
**End State:** [what success looks like]
|
|
202
|
+
|
|
203
|
+
#### Error Path: [error scenario]
|
|
204
|
+
1. [User sees/does X] -> [System shows Y]
|
|
205
|
+
2. [Error occurs] -> [System shows error state Z]
|
|
206
|
+
3. [User recovers by doing A] -> [System returns to state B]
|
|
207
|
+
**End State:** [recovered state]
|
|
208
|
+
|
|
209
|
+
#### Edge Cases
|
|
210
|
+
- [Edge case 1]: [how the design handles it]
|
|
211
|
+
- [Edge case 2]: [how the design handles it]
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Focus on the flows that are most common or most critical to get right. Present each flow to the user for validation.
|
|
215
|
+
|
|
216
|
+
### Step 7: Responsive Strategy
|
|
217
|
+
|
|
218
|
+
Define how the design adapts across breakpoints:
|
|
219
|
+
|
|
220
|
+
```markdown
|
|
221
|
+
## Responsive Strategy
|
|
222
|
+
|
|
223
|
+
### Approach: [Mobile-first / Desktop-first / Adaptive]
|
|
224
|
+
**Rationale:** [why this approach for these users]
|
|
225
|
+
|
|
226
|
+
### Layout Behavior
|
|
227
|
+
| Breakpoint | Navigation | Content Layout | Sidebar |
|
|
228
|
+
|-----------|------------|----------------|---------|
|
|
229
|
+
| Mobile (<sm) | [hamburger menu] | [single column] | [hidden] |
|
|
230
|
+
| Tablet (sm-md) | [compact nav] | [two column] | [collapsible] |
|
|
231
|
+
| Desktop (md+) | [full nav] | [multi-column] | [visible] |
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
If the product is not a visual UI, skip this step.
|
|
235
|
+
|
|
236
|
+
### Step 8: Review with User
|
|
237
|
+
|
|
238
|
+
Present the complete UX design document. Walk through each section:
|
|
239
|
+
|
|
240
|
+
1. "Do the design principles resonate with your product vision?"
|
|
241
|
+
2. "Are the design tokens a good starting point? Any brand guidelines to incorporate?"
|
|
242
|
+
3. "Does the accessibility level match your requirements and resources?"
|
|
243
|
+
4. "Do the user flows cover the most critical interactions?"
|
|
244
|
+
|
|
245
|
+
Iterate based on feedback.
|
|
246
|
+
|
|
247
|
+
### Step 9: Save
|
|
248
|
+
|
|
249
|
+
1. Write the final approved UX design to `docs/ux-design.md`.
|
|
250
|
+
2. Confirm to the user:
|
|
251
|
+
|
|
252
|
+
```
|
|
253
|
+
UX design document saved: docs/ux-design.md
|
|
254
|
+
Status: Draft
|
|
255
|
+
|
|
256
|
+
Summary:
|
|
257
|
+
Design principles: [count]
|
|
258
|
+
Design tokens: [defined / not applicable]
|
|
259
|
+
Components identified: [count]
|
|
260
|
+
User flows mapped: [count]
|
|
261
|
+
Accessibility target: [WCAG level]
|
|
262
|
+
|
|
263
|
+
Next: Run /specsafe-architecture to design the system architecture informed by the UX design.
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
## State Changes
|
|
267
|
+
|
|
268
|
+
- Create `docs/ux-design.md`
|
|
269
|
+
- No PROJECT_STATE.md changes (UX design is above the spec level)
|
|
270
|
+
|
|
271
|
+
## Guardrails
|
|
272
|
+
|
|
273
|
+
- NEVER skip accessibility considerations — they are requirements, not nice-to-haves
|
|
274
|
+
- NEVER use magic values (hardcoded colors, pixel values) — always reference design tokens
|
|
275
|
+
- NEVER design without understanding the target users and their context
|
|
276
|
+
- NEVER assume desktop-only — always consider the full range of devices and contexts
|
|
277
|
+
- ALWAYS specify component states (default, hover, active, disabled, loading, error, empty)
|
|
278
|
+
- ALWAYS consider users with disabilities — visual, motor, cognitive, and auditory
|
|
279
|
+
- ALWAYS present design decisions as recommendations the user can modify, not dictates
|
|
280
|
+
|
|
281
|
+
## Handoff
|
|
282
|
+
|
|
283
|
+
Next skill: `/specsafe-architecture` to design the system architecture. Architecture is downstream of UX in the canonical workflow — it should support the intended experience.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Claude Code Prompt Template
|
|
2
|
+
|
|
3
|
+
## Objective
|
|
4
|
+
|
|
5
|
+
- What should Claude Code accomplish?
|
|
6
|
+
- What should exist or be true when the task is complete?
|
|
7
|
+
|
|
8
|
+
## Current Phase
|
|
9
|
+
|
|
10
|
+
- Phase: `<planning | development>`
|
|
11
|
+
- Stage / skill context: `<brainstorm | principles | brief | prd | ux | architecture | readiness | spec | test | code | qa | verify | complete>`
|
|
12
|
+
|
|
13
|
+
## Spec Slice
|
|
14
|
+
|
|
15
|
+
- Slice name or ID: `<fill in>`
|
|
16
|
+
- Scope: `<the exact unit of work>`
|
|
17
|
+
- Acceptance criteria:
|
|
18
|
+
- `<criterion 1>`
|
|
19
|
+
- `<criterion 2>`
|
|
20
|
+
- `<criterion 3>`
|
|
21
|
+
|
|
22
|
+
## Constraints from Planning
|
|
23
|
+
|
|
24
|
+
- Product principles: `<relevant principles>`
|
|
25
|
+
- UX rules: `<relevant flows, states, accessibility expectations>`
|
|
26
|
+
- Architecture decisions: `<relevant boundaries, patterns, interfaces, data-model constraints>`
|
|
27
|
+
- Non-goals / scope exclusions: `<what Claude Code must not expand into>`
|
|
28
|
+
|
|
29
|
+
## Documentation References
|
|
30
|
+
|
|
31
|
+
- Official docs for named frameworks / SDKs / platforms / tools:
|
|
32
|
+
- `<name>`: `<link or reference>`
|
|
33
|
+
- `<name>`: `<link or reference>`
|
|
34
|
+
- MCP references or tool-specific docs:
|
|
35
|
+
- `<MCP or tool>`: `<reference>`
|
|
36
|
+
|
|
37
|
+
## Testing Requirements
|
|
38
|
+
|
|
39
|
+
- Tests to write: `<unit / integration / e2e / contract / other>`
|
|
40
|
+
- Commands to run:
|
|
41
|
+
- `pnpm test`
|
|
42
|
+
- `<project-specific command>`
|
|
43
|
+
- Coverage expectations: `<threshold or expectation>`
|
|
44
|
+
|
|
45
|
+
## Edge Cases
|
|
46
|
+
|
|
47
|
+
- `<edge case 1>`
|
|
48
|
+
- `<edge case 2>`
|
|
49
|
+
- `<failure mode or empty state>`
|
|
50
|
+
|
|
51
|
+
## Security Considerations
|
|
52
|
+
|
|
53
|
+
- `<auth / permissions / secrets / input validation / tenancy / data exposure concerns>`
|
|
54
|
+
- `<or write "None specific" if not applicable>`
|
|
55
|
+
|
|
56
|
+
## Quality Bar
|
|
57
|
+
|
|
58
|
+
Do not mark this task complete unless:
|
|
59
|
+
|
|
60
|
+
- all tests pass
|
|
61
|
+
- lint/typecheck clean
|
|
62
|
+
- implementation matches spec
|
|
63
|
+
- architecture alignment verified
|
|
64
|
+
- edge cases handled
|
|
65
|
+
- documentation consulted for named tools
|
|
@@ -1,17 +1,55 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { readCanonicalRule } from './utils.js';
|
|
4
|
+
const SPECSAFE_READ_ENTRIES = ['CONVENTIONS.md', 'PROJECT_STATE.md'];
|
|
4
5
|
export const aiderAdapter = {
|
|
5
6
|
name: 'aider',
|
|
6
7
|
displayName: 'Aider',
|
|
7
8
|
async detect(projectRoot) {
|
|
8
9
|
return existsSync(join(projectRoot, '.aider.conf.yml'));
|
|
9
10
|
},
|
|
10
|
-
async generate(_skills, canonicalDir) {
|
|
11
|
+
async generate(_skills, canonicalDir, projectRoot) {
|
|
11
12
|
const files = [];
|
|
13
|
+
const readEntries = [...SPECSAFE_READ_ENTRIES];
|
|
14
|
+
let otherLines = [];
|
|
15
|
+
if (projectRoot) {
|
|
16
|
+
const confPath = join(projectRoot, '.aider.conf.yml');
|
|
17
|
+
if (existsSync(confPath)) {
|
|
18
|
+
try {
|
|
19
|
+
const existing = readFileSync(confPath, 'utf-8');
|
|
20
|
+
// Separate "read:" block from all other config lines
|
|
21
|
+
const lines = existing.split('\n');
|
|
22
|
+
let inReadBlock = false;
|
|
23
|
+
for (const line of lines) {
|
|
24
|
+
if (/^read:\s*$/.test(line)) {
|
|
25
|
+
inReadBlock = true;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (inReadBlock && /^\s+-\s+/.test(line)) {
|
|
29
|
+
// Read entry — merge with dedup
|
|
30
|
+
const entry = line.replace(/^\s+-\s+/, '').trim();
|
|
31
|
+
if (entry && !readEntries.includes(entry)) {
|
|
32
|
+
readEntries.push(entry);
|
|
33
|
+
}
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
// Any non-read line ends the read block
|
|
37
|
+
inReadBlock = false;
|
|
38
|
+
if (line.trim() !== '') {
|
|
39
|
+
otherLines.push(line);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// Can't read — use defaults
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const readYaml = readEntries.map((e) => ` - ${e}`).join('\n');
|
|
49
|
+
const otherYaml = otherLines.length > 0 ? `\n${otherLines.join('\n')}\n` : '';
|
|
12
50
|
files.push({
|
|
13
51
|
path: '.aider.conf.yml',
|
|
14
|
-
content:
|
|
52
|
+
content: `read:\n${readYaml}\n${otherYaml}`,
|
|
15
53
|
});
|
|
16
54
|
const conventions = readCanonicalRule(canonicalDir, 'CONVENTIONS.md');
|
|
17
55
|
if (conventions) {
|