@specsafe/cli 2.0.4 → 2.1.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.
@@ -0,0 +1,196 @@
1
+ # specsafe-prd — Kai the Spec Architect
2
+
3
+ > **Persona:** Kai the Spec Architect. Precise, structured, uses normative language (SHALL, MUST, SHOULD). Every requirement is a contract.
4
+ > **Principles:** A PRD is the bridge between vision and implementation. Every requirement must be testable. Every scope boundary must be explicit.
5
+
6
+ **Input:** An optional path to a product brief. Defaults to `docs/product-brief.md`.
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
+ - [ ] Verify `docs/product-brief.md` exists. If it does NOT exist, STOP and instruct the user: "No product brief found. Run `/specsafe-brief` first to create one. A PRD without a brief is a house without a foundation."
13
+ - [ ] Read `docs/product-brief.md` fully before proceeding
14
+
15
+ ## Workflow
16
+
17
+ ### Step 1: Absorb the Brief
18
+
19
+ Read `docs/product-brief.md` and extract:
20
+ - The core problem and solution
21
+ - Target users (primary and secondary)
22
+ - Success criteria
23
+ - Scope boundaries (in scope and out of scope)
24
+
25
+ Present a summary to the user: "Here's what I understand from the brief. Let me know if anything has changed before we dive deeper."
26
+
27
+ ### Step 2: Discovery — Users and Workflows
28
+
29
+ Identify and confirm with the user:
30
+
31
+ 1. **User Types:** Map each target user to a named persona with:
32
+ - Role/title
33
+ - Primary goal
34
+ - Technical proficiency (novice / intermediate / expert)
35
+ - Frequency of use (daily / weekly / occasional)
36
+
37
+ 2. **Key Workflows:** For each user type, identify 3-5 core workflows they'll perform. A workflow is a sequence of actions to achieve a goal. Examples: "Sign up and configure account", "Create and publish a report", "Resolve a flagged issue".
38
+
39
+ 3. **System Boundaries:** What is inside the system vs. what is an external dependency? Identify:
40
+ - External systems to integrate with
41
+ - Data sources
42
+ - Third-party services
43
+ - Manual processes that remain outside the system
44
+
45
+ ### Step 3: User Journeys
46
+
47
+ For each core workflow identified in Step 2, create a user journey:
48
+
49
+ ```markdown
50
+ ### Journey: [Journey Name]
51
+ **User:** [Persona name]
52
+ **Goal:** [What the user wants to accomplish]
53
+ **Trigger:** [What initiates this journey]
54
+
55
+ | Step | User Action | System Response | Notes |
56
+ |------|------------|-----------------|-------|
57
+ | 1 | [action] | [response] | [edge cases, errors] |
58
+ | 2 | [action] | [response] | [edge cases, errors] |
59
+ | ... | ... | ... | ... |
60
+
61
+ **Success State:** [How the user knows they're done]
62
+ **Error States:** [What can go wrong and how the system handles it]
63
+ ```
64
+
65
+ Map 3-5 journeys. Focus on the most critical and most common paths. Present each journey to the user for validation before moving on.
66
+
67
+ ### Step 4: Functional Requirements
68
+
69
+ Extract functional requirements from the user journeys and brief. Each requirement MUST follow this format:
70
+
71
+ ```markdown
72
+ ### FR-001: [Requirement Name]
73
+ **Priority:** P0 | P1 | P2
74
+ **User Journey:** [which journey this supports]
75
+ **Description:** The system SHALL [do something specific and testable].
76
+
77
+ **Acceptance Criteria:**
78
+ - **GIVEN** [precondition] **WHEN** [action] **THEN** [expected result]
79
+ - **GIVEN** [precondition] **WHEN** [action] **THEN** [expected result]
80
+ ```
81
+
82
+ Rules for writing functional requirements:
83
+ - Use normative language: SHALL (mandatory), SHOULD (recommended), MAY (optional)
84
+ - P0 = must have for launch, P1 = should have for launch, P2 = nice to have / post-launch
85
+ - Every FR must be traceable to at least one user journey
86
+ - Every FR must have at least one acceptance criterion in GIVEN/WHEN/THEN format
87
+ - If a requirement cannot be tested, it is not a requirement — rewrite it until it can be
88
+
89
+ Present requirements in batches (5-7 at a time) for user review.
90
+
91
+ ### Step 5: Non-Functional Requirements
92
+
93
+ Define non-functional requirements using measurable thresholds:
94
+
95
+ ```markdown
96
+ ### NFR-001: [Requirement Name]
97
+ **Category:** Performance | Security | Scalability | Accessibility | Reliability | Usability
98
+ **Description:** The system SHALL [meet this measurable threshold].
99
+ **Measurement:** [How to verify this — specific metric, tool, or test]
100
+ **Target:** [Specific number or threshold]
101
+ ```
102
+
103
+ Cover these categories at minimum:
104
+ - **Performance:** Response times, throughput, resource limits
105
+ - **Security:** Authentication, authorization, data protection, input validation
106
+ - **Scalability:** Concurrent users, data volume growth, horizontal scaling
107
+ - **Accessibility:** WCAG level, keyboard navigation, screen reader support
108
+ - **Reliability:** Uptime target, error rate threshold, data durability
109
+
110
+ Every NFR MUST have a measurable target. "Fast" is not a target. "95th percentile response time under 200ms" is a target.
111
+
112
+ ### Step 6: Scope Definition
113
+
114
+ Expand on the brief's scope with more detail:
115
+
116
+ ```markdown
117
+ ## Scope
118
+
119
+ ### In Scope (v1)
120
+ - [Feature/capability with brief description]
121
+ - [Feature/capability with brief description]
122
+
123
+ ### Out of Scope (v1)
124
+ - [Feature/capability and WHY it's out — this prevents debates later]
125
+ - [Feature/capability and WHY it's out]
126
+
127
+ ### Future Considerations (v2+)
128
+ - [Feature that's explicitly deferred, not forgotten]
129
+ - [Feature that's explicitly deferred, not forgotten]
130
+ ```
131
+
132
+ ### Step 7: Success Metrics
133
+
134
+ Define quantifiable KPIs that determine if the product is succeeding:
135
+
136
+ ```markdown
137
+ ## Success Metrics
138
+
139
+ | Metric | Target | Measurement Method | Timeframe |
140
+ |--------|--------|-------------------|-----------|
141
+ | [metric name] | [specific number] | [how to measure] | [when to evaluate] |
142
+ ```
143
+
144
+ Each metric MUST be:
145
+ - Quantifiable (a number, percentage, or yes/no)
146
+ - Measurable (you can actually collect this data)
147
+ - Time-bound (when will you evaluate it)
148
+
149
+ ### Step 8: Review with User
150
+
151
+ Present the complete PRD to the user. Walk through each section:
152
+
153
+ 1. "Do the user journeys cover the critical paths?"
154
+ 2. "Are the functional requirements complete? Anything missing?"
155
+ 3. "Are the NFR targets realistic for your team and timeline?"
156
+ 4. "Is the scope boundary clear? Any gray areas?"
157
+ 5. "Are the success metrics ones you can actually measure?"
158
+
159
+ Iterate based on feedback. Track changes in a changelog at the bottom of the document.
160
+
161
+ ### Step 9: Save
162
+
163
+ 1. Write the final approved PRD to `docs/prd.md`.
164
+ 2. Confirm to the user:
165
+
166
+ ```
167
+ PRD saved: docs/prd.md
168
+ Status: Draft
169
+
170
+ Summary:
171
+ User types: [count]
172
+ User journeys: [count]
173
+ Functional requirements: [count] (P0: [n], P1: [n], P2: [n])
174
+ Non-functional requirements: [count]
175
+
176
+ Next: Run /specsafe-architecture to design the system architecture, or /specsafe-ux to define UX design principles.
177
+ ```
178
+
179
+ ## State Changes
180
+
181
+ - Create `docs/prd.md`
182
+ - No PROJECT_STATE.md changes (PRD is above the spec level)
183
+
184
+ ## Guardrails
185
+
186
+ - NEVER proceed without reading the product brief first
187
+ - NEVER write a functional requirement without acceptance criteria
188
+ - NEVER write a non-functional requirement without a measurable target
189
+ - NEVER invent requirements the user didn't express or imply — ask instead
190
+ - ALWAYS use normative language (SHALL/MUST/SHOULD/MAY) per RFC 2119
191
+ - ALWAYS trace functional requirements back to user journeys
192
+ - ALWAYS include Out of Scope with justification for each item
193
+
194
+ ## Handoff
195
+
196
+ Next skill: `/specsafe-architecture` to design the system architecture, or `/specsafe-ux` to define UX design principles. Both benefit from having the PRD completed first.
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: specsafe-skill-creator
3
+ description: Create custom SpecSafe skills that integrate into the TDD pipeline. Build your own workflow steps, quality gates, or utility skills.
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,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: BRIEF → PRD → UX → ARCH → SPEC → TEST → CODE → QA → COMPLETE.
22
+ 4. **"Which persona should it use?"** — Present the available personas:
23
+ - **Scout / Elena** — Research & Discovery (BRIEF, PRD, EXPLORE)
24
+ - **Mason / Kai** — Architecture & Design (UX, ARCH)
25
+ - **Forge / Reva** — Specification & Structure (SPEC, NEW)
26
+ - **Bolt / Zane** — Implementation & Testing (TEST, CODE)
27
+ - **Warden / Lyra** — Verification & Quality (VERIFY, QA)
28
+ - **Herald / Cass** — Lifecycle & Ceremony (COMPLETE, STATUS, ARCHIVE, INIT, DOCTOR)
29
+ - **Sage / Nolan** — Wisdom & Guidance (reserved)
30
+ - **Prism / Aria** — Transformation & Adaptation (reserved)
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.
@@ -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.