sdlc-framework 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.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +321 -0
  3. package/bin/install.js +193 -0
  4. package/package.json +39 -0
  5. package/src/commands/close.md +200 -0
  6. package/src/commands/debug.md +124 -0
  7. package/src/commands/fast.md +149 -0
  8. package/src/commands/fix.md +104 -0
  9. package/src/commands/help.md +144 -0
  10. package/src/commands/hotfix.md +99 -0
  11. package/src/commands/impl.md +142 -0
  12. package/src/commands/init.md +93 -0
  13. package/src/commands/milestone.md +136 -0
  14. package/src/commands/pause.md +115 -0
  15. package/src/commands/research.md +136 -0
  16. package/src/commands/resume.md +103 -0
  17. package/src/commands/review.md +195 -0
  18. package/src/commands/spec.md +164 -0
  19. package/src/commands/status.md +118 -0
  20. package/src/commands/verify.md +153 -0
  21. package/src/references/clarification-strategy.md +352 -0
  22. package/src/references/engineering-laws.md +374 -0
  23. package/src/references/loop-phases.md +331 -0
  24. package/src/references/playwright-testing.md +298 -0
  25. package/src/references/prompt-detection.md +264 -0
  26. package/src/references/sub-agent-strategy.md +260 -0
  27. package/src/rules/commands.md +180 -0
  28. package/src/rules/style.md +354 -0
  29. package/src/rules/templates.md +238 -0
  30. package/src/rules/workflows.md +314 -0
  31. package/src/templates/HANDOFF.md +121 -0
  32. package/src/templates/LAWS.md +521 -0
  33. package/src/templates/PROJECT.md +112 -0
  34. package/src/templates/REVIEW.md +145 -0
  35. package/src/templates/ROADMAP.md +101 -0
  36. package/src/templates/SPEC.md +231 -0
  37. package/src/templates/STATE.md +106 -0
  38. package/src/templates/SUMMARY.md +126 -0
  39. package/src/workflows/close-phase.md +189 -0
  40. package/src/workflows/debug-flow.md +302 -0
  41. package/src/workflows/fast-forward.md +340 -0
  42. package/src/workflows/fix-findings.md +235 -0
  43. package/src/workflows/hotfix-flow.md +190 -0
  44. package/src/workflows/impl-phase.md +229 -0
  45. package/src/workflows/init-project.md +249 -0
  46. package/src/workflows/milestone-management.md +169 -0
  47. package/src/workflows/pause-work.md +153 -0
  48. package/src/workflows/research.md +219 -0
  49. package/src/workflows/resume-project.md +159 -0
  50. package/src/workflows/review-phase.md +337 -0
  51. package/src/workflows/spec-phase.md +379 -0
  52. package/src/workflows/transition-phase.md +203 -0
  53. package/src/workflows/verify-phase.md +280 -0
@@ -0,0 +1,180 @@
1
+ ---
2
+ paths:
3
+ - "src/commands/**/*.md"
4
+ ---
5
+
6
+ # Command Rules
7
+
8
+ Rules for editing files in `src/commands/`.
9
+
10
+ ## File Structure
11
+
12
+ YAML frontmatter is required at the top of every command file.
13
+
14
+ ```yaml
15
+ ---
16
+ name: sdlc:command-name
17
+ description: One-line description of what the command does
18
+ argument-hint: "<required>" or "[optional]"
19
+ allowed-tools: [Read, Write, Bash, Glob, Grep, Edit, AskUserQuestion]
20
+ ---
21
+ ```
22
+
23
+ ### Frontmatter Field Rules
24
+
25
+ | Field | Required | Format | Notes |
26
+ |-------|----------|--------|-------|
27
+ | `name` | Yes | `sdlc:kebab-case` | Must match filename without extension |
28
+ | `description` | Yes | Single sentence, imperative voice | No period at end |
29
+ | `argument-hint` | Yes | `<angle>` = required, `[square]` = optional | Describe the argument semantically |
30
+ | `allowed-tools` | Yes | Array of tool names | Minimum set needed — no extras |
31
+
32
+ ## Section Order
33
+
34
+ Every command file contains these sections in this exact order. Do not reorder. Do not skip required sections.
35
+
36
+ ### 1. `<objective>` — REQUIRED
37
+
38
+ Explain what the command does, when to use it, and what happens after it completes. Write for a developer encountering this framework for the first time. Three components:
39
+
40
+ - **What**: One sentence stating the action performed.
41
+ - **Why**: One sentence explaining the purpose within the SDLC loop.
42
+ - **When**: One sentence describing the trigger condition (prior command output, user decision, or entry point).
43
+
44
+ ```xml
45
+ <objective>
46
+ What: Create a specification document from a task description.
47
+ Why: Specifications anchor all downstream implementation, verification, and review work.
48
+ When: Run after `/sdlc:plan` completes or when starting a new task.
49
+ </objective>
50
+ ```
51
+
52
+ ### 2. `<execution_context>` — REQUIRED
53
+
54
+ List static resources from the sdlc-framework that the command needs. Use `@`-references to workflows, templates, and references. Do not reference project-specific files here.
55
+
56
+ ```xml
57
+ <execution_context>
58
+ @workflows/spec-creation.md
59
+ @templates/spec.md
60
+ @references/engineering-laws.md
61
+ </execution_context>
62
+ ```
63
+
64
+ ### 3. `<context>` — REQUIRED
65
+
66
+ Declare dynamic content: user arguments, bash output blocks, and `@`-references to `.sdlc/` project state files.
67
+
68
+ ```xml
69
+ <context>
70
+ $ARGUMENTS — Task description provided by the user
71
+ @.sdlc/STATE.md — Current loop state and phase
72
+ @.sdlc/PLAN.md — Active plan with phase breakdown
73
+
74
+ <bash>
75
+ # Gather project structure for context
76
+ find src/ -type f -name "*.ts" | head -50
77
+ </bash>
78
+ </context>
79
+ ```
80
+
81
+ Rules for `<context>`:
82
+ - `$ARGUMENTS` is the raw user input passed to the command.
83
+ - Bash blocks gather ephemeral project state. Keep them minimal and fast.
84
+ - `@.sdlc/` references pull in persisted loop state.
85
+
86
+ ### 4. `<process>` — REQUIRED
87
+
88
+ Implementation steps. Commands are thin — delegate detailed logic to workflows. Each step is a short imperative instruction, not a paragraph.
89
+
90
+ ```xml
91
+ <process>
92
+ 1. Read STATE.md to confirm current phase permits this command.
93
+ 2. Execute @workflows/spec-creation.md with $ARGUMENTS as input.
94
+ 3. Write output to .sdlc/specs/{phase}/{spec-id}-SPEC.md using @templates/spec.md.
95
+ 4. Update STATE.md with new spec reference and next_required_action.
96
+ </process>
97
+ ```
98
+
99
+ Rules for `<process>`:
100
+ - Maximum 8 steps. If more are needed, the workflow is doing too little.
101
+ - Each step starts with an imperative verb: Read, Write, Execute, Validate, Update.
102
+ - Reference workflows by `@`-path, not by inlining their logic.
103
+ - Never put conditional branching in commands. Move it to the workflow.
104
+
105
+ ### 5. `<success_criteria>` — REQUIRED
106
+
107
+ Measurable checklist. Every item is a verifiable statement, not a vague aspiration.
108
+
109
+ ```xml
110
+ <success_criteria>
111
+ - [ ] Spec file exists at .sdlc/specs/{phase}/{spec-id}-SPEC.md
112
+ - [ ] Spec contains all required sections from @templates/spec.md
113
+ - [ ] STATE.md updated with spec reference
114
+ - [ ] Output ends with NEXT ACTION REQUIRED: /sdlc:implement
115
+ </success_criteria>
116
+ ```
117
+
118
+ **Mandatory final item**: `Output ends with NEXT ACTION REQUIRED: /sdlc:{next-command}`. Every command must force the next action. No command is terminal except `/sdlc:close`.
119
+
120
+ ## Core Principles
121
+
122
+ ### Commands Are Thin Wrappers
123
+
124
+ A command file orchestrates — it does not contain business logic. If a command's `<process>` section exceeds 8 steps or contains conditional branches, extract the complexity into a workflow.
125
+
126
+ ### Commands Force Next Action
127
+
128
+ The SDLC loop is deterministic. Every command output ends with `NEXT ACTION REQUIRED: /sdlc:{next-command}`. The user or agent must execute the specified command next. No ambiguity. No optional follow-ups.
129
+
130
+ ### Commands Are Self-Explanatory
131
+
132
+ The `<objective>` section is the command's documentation. A developer reading it for the first time understands what the command does, why it exists, and what triggers it. No external documentation needed.
133
+
134
+ ### Commands Are Idempotent Where Possible
135
+
136
+ Running the same command twice with the same input produces the same output. If idempotency is impossible (e.g., the command modifies external state), document the non-idempotent behavior in `<objective>`.
137
+
138
+ ## @-Reference Patterns
139
+
140
+ ### Static Resources (execution_context)
141
+
142
+ Reference framework-internal files that do not change per project:
143
+
144
+ ```
145
+ @workflows/{workflow-name}.md
146
+ @templates/{template-name}.md
147
+ @references/{reference-name}.md
148
+ ```
149
+
150
+ ### Dynamic Project State (context)
151
+
152
+ Reference project-specific files that change during the SDLC loop:
153
+
154
+ ```
155
+ @.sdlc/STATE.md
156
+ @.sdlc/PLAN.md
157
+ @.sdlc/specs/{phase}/{spec-id}-SPEC.md
158
+ @.sdlc/reviews/{review-id}.md
159
+ ```
160
+
161
+ ## Naming
162
+
163
+ - Command files: `kebab-case.md` (e.g., `create-spec.md`)
164
+ - Command names: `sdlc:kebab-case` (e.g., `sdlc:create-spec`)
165
+ - The filename (minus extension) must match the name after `sdlc:` in frontmatter.
166
+
167
+ ## Validation Checklist
168
+
169
+ Before merging a command file, verify:
170
+
171
+ - [ ] YAML frontmatter has all required fields
172
+ - [ ] All 5 sections present in correct order
173
+ - [ ] `<objective>` answers what/why/when
174
+ - [ ] `<process>` has 8 or fewer steps
175
+ - [ ] `<process>` delegates to at least one workflow
176
+ - [ ] `<success_criteria>` ends with NEXT ACTION REQUIRED
177
+ - [ ] All `@`-references point to files that exist
178
+ - [ ] No inline business logic — all logic lives in workflows
179
+ - [ ] Imperative voice throughout — no passive constructions
180
+ - [ ] No filler words (see style.md)
@@ -0,0 +1,354 @@
1
+ ---
2
+ paths:
3
+ - "src/**/*.md"
4
+ ---
5
+
6
+ # Style Rules
7
+
8
+ Universal style rules for ALL files in the SDLC framework. Every contributor must follow these rules in every file under `src/`.
9
+
10
+ ## Voice and Tone
11
+
12
+ ### Imperative Voice — REQUIRED
13
+
14
+ Write all instructions as direct commands. The subject is always the reader or the system.
15
+
16
+ ```markdown
17
+ <!-- Correct -->
18
+ Execute the test suite before marking verification complete.
19
+ Read STATE.md to determine the current phase.
20
+ Validate all acceptance criteria against the spec.
21
+
22
+ <!-- Wrong -->
23
+ The test suite should be executed before verification is complete.
24
+ STATE.md is read to determine the current phase.
25
+ Acceptance criteria are validated against the spec.
26
+ ```
27
+
28
+ ### Banned Filler Words
29
+
30
+ These words add no information. Remove them on sight.
31
+
32
+ | Banned | Replacement |
33
+ |--------|-------------|
34
+ | "Let me" | Remove — start with the verb |
35
+ | "Just" | Remove — the action stands alone |
36
+ | "Simply" | Remove — nothing is simple to everyone |
37
+ | "Please" | Remove — these are instructions, not requests |
38
+ | "Note that" | Remove — state the fact directly |
39
+ | "It should be noted" | Remove — state the fact directly |
40
+ | "Basically" | Remove — explain fully or not at all |
41
+ | "In order to" | "To" |
42
+ | "Make sure to" | Remove — start with the verb |
43
+ | "Go ahead and" | Remove — start with the verb |
44
+
45
+ ### Banned Sycophancy
46
+
47
+ These words signal empty enthusiasm. Remove them on sight.
48
+
49
+ | Banned | Context |
50
+ |--------|---------|
51
+ | "Great!" | Never use as a response opener or transition |
52
+ | "Awesome!" | Never use as a response opener or transition |
53
+ | "Excellent!" | Never use as a response opener or transition |
54
+ | "Perfect!" | Never use as a response opener or transition |
55
+ | "Wonderful!" | Never use as a response opener or transition |
56
+ | "Amazing!" | Never use as a response opener or transition |
57
+ | "Good job!" | Never use as feedback in framework content |
58
+ | "Well done!" | Never use as feedback in framework content |
59
+
60
+ ### Banned Temporal Language
61
+
62
+ Describe the current state. Do not reference past actions or future intentions.
63
+
64
+ ```markdown
65
+ <!-- Correct -->
66
+ STATE.md contains the current phase and next required action.
67
+
68
+ <!-- Wrong -->
69
+ STATE.md will contain the current phase after you run the command.
70
+ STATE.md now contains the current phase since we updated it.
71
+ After running the command, STATE.md has been updated with the phase.
72
+ ```
73
+
74
+ Exception: Workflow steps that describe sequential operations use "after" and "before" to indicate ordering, not past/future tense.
75
+
76
+ ```markdown
77
+ <!-- Acceptable in workflow steps -->
78
+ After validation completes, write the spec file.
79
+ Before updating STATE.md, verify the file was written.
80
+ ```
81
+
82
+ ## Naming Conventions
83
+
84
+ | Entity | Convention | Example |
85
+ |--------|-----------|---------|
86
+ | Files | `kebab-case.md` | `spec-creation.md` |
87
+ | Commands | `sdlc:kebab-case` | `sdlc:create-spec` |
88
+ | Workflow names | `kebab-case` | `spec-creation` |
89
+ | Step names | `snake_case` | `validate_preconditions` |
90
+ | Phase IDs | `NN-kebab-name` | `01-authentication` |
91
+ | Spec IDs | `NN-NN-SPEC.md` | `01-03-SPEC.md` |
92
+ | Plan IDs | `NN-PLAN.md` | `01-PLAN.md` |
93
+ | Template names | `kebab-case` | `acceptance-criterion` |
94
+ | Variable placeholders | `{kebab-case}` | `{plan-id}` |
95
+ | Human placeholders | `[Sentence case instruction]` | `[Describe the expected behavior]` |
96
+
97
+ ### File Naming Rules
98
+
99
+ - All framework source files use `.md` extension.
100
+ - Filenames match the primary entity name (command name, workflow name, template name).
101
+ - No spaces. No underscores. No camelCase. Kebab-case only.
102
+ - State files in `.sdlc/` use UPPER_CASE: `STATE.md`, `PLAN.md`.
103
+
104
+ ## XML Conventions
105
+
106
+ ### Semantic Tags
107
+
108
+ Use XML tags that describe content semantics, not presentation.
109
+
110
+ ```xml
111
+ <!-- Correct -->
112
+ <objective>
113
+ <process>
114
+ <step name="validate_input">
115
+ <success_criteria>
116
+ <template>
117
+
118
+ <!-- Wrong -->
119
+ <section>
120
+ <div>
121
+ <block>
122
+ <content>
123
+ ```
124
+
125
+ ### Tag Naming
126
+
127
+ - Tags use `snake_case` (matching step naming convention).
128
+ - Tags describe what the content IS, not where it goes.
129
+ - Avoid generic tags. Each tag name should be unique in purpose.
130
+
131
+ ### Hierarchy
132
+
133
+ Use XML tags for top-level structure. Use markdown headers for hierarchy within XML sections.
134
+
135
+ ```xml
136
+ <process>
137
+ <step name="implement_module">
138
+ ## Module Structure
139
+
140
+ Create the following files:
141
+
142
+ ### Service Layer
143
+ Write the service file at src/services/{module}.service.ts.
144
+
145
+ ### Controller Layer
146
+ Write the controller at src/controllers/{module}.controller.ts.
147
+ </step>
148
+ </process>
149
+ ```
150
+
151
+ ### Attributes
152
+
153
+ - Use attributes for metadata: `name`, `type`, `phase`.
154
+ - Use element content for instructions and descriptions.
155
+ - Attribute values use `kebab-case` or `snake_case` depending on the entity convention.
156
+
157
+ ## @-Reference Patterns
158
+
159
+ ### Framework References
160
+
161
+ Reference framework-internal files with paths relative to `src/`:
162
+
163
+ ```
164
+ @workflows/spec-creation.md
165
+ @templates/spec.md
166
+ @references/engineering-laws.md
167
+ @commands/create-spec.md
168
+ ```
169
+
170
+ ### Project State References
171
+
172
+ Reference project-specific files with paths relative to the project root:
173
+
174
+ ```
175
+ @.sdlc/STATE.md
176
+ @.sdlc/PLAN.md
177
+ @.sdlc/specs/01-auth/01-03-SPEC.md
178
+ ```
179
+
180
+ ### Reference Rules
181
+
182
+ - Every `@`-reference must point to a file that exists or will exist at execution time.
183
+ - Use `@`-references instead of prose descriptions. "Read @.sdlc/STATE.md" is better than "Read the state file."
184
+ - Do not use `@`-references for conceptual references. Use plain text: "See the engineering laws for constraint details."
185
+
186
+ ## Loop Terminology
187
+
188
+ Use these terms consistently. Do not invent synonyms.
189
+
190
+ | Term | Meaning | Usage |
191
+ |------|---------|-------|
192
+ | SPEC | Specification phase | "Run during SPEC phase" |
193
+ | IMPL | Implementation phase | "Transition to IMPL after spec approval" |
194
+ | VERIFY | Verification phase | "VERIFY phase runs all tests" |
195
+ | REVIEW | Review phase | "REVIEW phase assesses code quality" |
196
+ | CLOSE | Closing phase | "CLOSE phase commits and finalizes" |
197
+ | Loop | One full SPEC-IMPL-VERIFY-REVIEW-CLOSE cycle | "Complete the loop for each plan" |
198
+ | Phase | One stage within the loop | "Current phase: IMPL" |
199
+ | Plan | A decomposed task with phases | "Plan 01 has 4 phases" |
200
+ | Spec | A specification document | "Spec 01-03 covers authentication" |
201
+ | Artifact | Any file produced during the loop | "Add artifact path to STATE.md" |
202
+
203
+ ### Banned Synonyms
204
+
205
+ | Banned | Use Instead |
206
+ |--------|-------------|
207
+ | "Stage" | "Phase" |
208
+ | "Step" (for loop phases) | "Phase" (steps are within workflows) |
209
+ | "Task" (for loop phases) | "Phase" |
210
+ | "Cycle" | "Loop" |
211
+ | "Document" (for specs) | "Spec" |
212
+ | "Deliverable" | "Artifact" |
213
+
214
+ ## Acceptance Criteria Format
215
+
216
+ All acceptance criteria use BDD Given/When/Then format.
217
+
218
+ ```markdown
219
+ ### AC-{sequence}: [Criterion title]
220
+
221
+ **Given** [precondition — describe the initial state]
222
+ **When** [action — describe the trigger or user action]
223
+ **Then** [outcome — describe the expected observable result]
224
+ ```
225
+
226
+ ### Rules
227
+
228
+ - One acceptance criterion per testable behavior.
229
+ - "Given" describes state, not actions. No verbs in "Given".
230
+ - "When" describes exactly one action.
231
+ - "Then" describes an observable, verifiable outcome.
232
+ - Do not combine multiple behaviors into one criterion.
233
+
234
+ ```markdown
235
+ <!-- Correct -->
236
+ ### AC-01: Authenticated user accesses dashboard
237
+
238
+ **Given** a user with valid session credentials
239
+ **When** the user requests the dashboard endpoint
240
+ **Then** the system returns the dashboard view with user-specific data
241
+
242
+ <!-- Wrong — multiple behaviors in one criterion -->
243
+ ### AC-01: User login and dashboard
244
+
245
+ **Given** a user exists in the database
246
+ **When** the user logs in and navigates to the dashboard
247
+ **Then** the session is created and the dashboard shows their data
248
+ ```
249
+
250
+ ## Commit Message Format
251
+
252
+ ```
253
+ {type}({phase}-{plan}): {description}
254
+ ```
255
+
256
+ ### Components
257
+
258
+ | Component | Values | Example |
259
+ |-----------|--------|---------|
260
+ | `type` | `spec`, `impl`, `verify`, `review`, `fix`, `refactor`, `docs` | `spec` |
261
+ | `phase` | Phase ID from plan | `01-auth` |
262
+ | `plan` | Plan number | `01` |
263
+ | `description` | Imperative, max 72 chars | `add JWT validation to auth guard` |
264
+
265
+ ### Examples
266
+
267
+ ```
268
+ spec(01-auth-01): define authentication requirements
269
+ impl(01-auth-01): add JWT validation to auth guard
270
+ verify(01-auth-01): add integration tests for auth flow
271
+ review(01-auth-01): address review feedback on token expiry
272
+ fix(01-auth-01): handle expired refresh token edge case
273
+ ```
274
+
275
+ ### Commit Message Rules
276
+
277
+ - Description uses imperative voice: "add", "fix", "update" — not "added", "fixes", "updates".
278
+ - Max 72 characters for the entire first line.
279
+ - No period at the end of the description.
280
+ - Body (optional, separated by blank line) explains WHY, not WHAT.
281
+
282
+ ## Next Action Enforcement
283
+
284
+ Every command output, workflow completion, and agent response must end with:
285
+
286
+ ```
287
+ NEXT ACTION REQUIRED: /sdlc:{command-name}
288
+ ```
289
+
290
+ ### Rules
291
+
292
+ - The next action is always a specific `/sdlc:` command — never a vague instruction.
293
+ - The next action is deterministic. Given the same state, the same next action is always required.
294
+ - Only `/sdlc:close` has no next action (it terminates the loop).
295
+ - Do not suggest multiple possible next actions. One command. No ambiguity.
296
+
297
+ ```markdown
298
+ <!-- Correct -->
299
+ NEXT ACTION REQUIRED: /sdlc:implement
300
+
301
+ <!-- Wrong -->
302
+ Next steps: You could run /sdlc:implement or /sdlc:verify depending on your needs.
303
+ Consider running /sdlc:implement next.
304
+ ```
305
+
306
+ ## Formatting Rules
307
+
308
+ ### Headers
309
+
310
+ - Use markdown headers (`#`, `##`, `###`) for document structure outside XML.
311
+ - Use headers inside XML steps for sub-structure within a step.
312
+ - Do not skip header levels (no `#` followed by `###`).
313
+
314
+ ### Lists
315
+
316
+ - Use numbered lists for ordered sequences (steps, priorities).
317
+ - Use bullet lists for unordered collections (requirements, constraints).
318
+ - Do not nest lists deeper than 2 levels.
319
+
320
+ ### Tables
321
+
322
+ - Use tables for structured data with 3+ columns.
323
+ - Always include a header row.
324
+ - Align columns for readability in source.
325
+
326
+ ### Code Blocks
327
+
328
+ - Use fenced code blocks with language hints for all code.
329
+ - Use `yaml`, `xml`, `markdown`, `bash`, `typescript` as language hints.
330
+ - Do not use indented code blocks (4 spaces) — always use fences.
331
+
332
+ ### Line Length
333
+
334
+ - Prose lines: wrap at 100 characters for readability in source.
335
+ - Code blocks: no hard wrap — let the content determine length.
336
+ - Tables: no hard wrap — readability in rendered form takes priority.
337
+
338
+ ## Validation Checklist
339
+
340
+ Before merging any framework file, verify:
341
+
342
+ - [ ] Imperative voice throughout — no passive constructions
343
+ - [ ] No banned filler words
344
+ - [ ] No banned sycophancy
345
+ - [ ] No temporal language (except sequential ordering in workflow steps)
346
+ - [ ] All names follow the naming convention table
347
+ - [ ] All `@`-references use correct path format
348
+ - [ ] Loop terminology uses standard terms, not synonyms
349
+ - [ ] Acceptance criteria use Given/When/Then format
350
+ - [ ] File ends with NEXT ACTION REQUIRED (for commands and workflows)
351
+ - [ ] Commit messages follow `{type}({phase}-{plan}): {description}` format
352
+ - [ ] No headers skipped
353
+ - [ ] No lists nested deeper than 2 levels
354
+ - [ ] Code blocks use fenced format with language hints