@mrciphersmith/keryx 0.4.27 → 0.4.28

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 (87) hide show
  1. package/README.md +2 -2
  2. package/dist/cli.js +105165 -104989
  3. package/dist/core.js +21 -197
  4. package/dist/keryx-general-worker-entry.js +22 -201
  5. package/package.json +3 -3
  6. package/src/gdskills/bundled/agents/work-planner.md +1 -1
  7. package/src/gdskills/bundled/install-manifest.json +3 -26
  8. package/src/gdskills/bundled/rules/core/code-review-learned-profile.mdc +1 -2
  9. package/src/gdskills/bundled/rules/core/definition-of-done.mdc +0 -1
  10. package/src/gdskills/bundled/rules/core/implementation-doc-mandate.mdc +4 -5
  11. package/src/gdskills/bundled/rules/core/jobs-documentation.mdc +8 -8
  12. package/src/gdskills/bundled/rules/core/skills-storage-workflow.mdc +7 -10
  13. package/src/gdskills/bundled/skills/core/reviewer-skill-creator/SKILL.md +1 -1
  14. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.md +12 -21
  15. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.md +3 -3
  16. package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/SKILL.md +1 -1
  17. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.md +1 -1
  18. package/src/gdskills/bundled/skills/orchestration/task-implementer/input-contract.schema.json +1 -1
  19. package/src/gdskills/bundled/skills/planning/autodoc-orchestrator/SKILL.md +1 -1
  20. package/src/gdskills/bundled/skills/planning/brainstorm/SKILL.md +1 -1
  21. package/src/gdskills/bundled/skills/planning/interview/SKILL.md +3 -4
  22. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.md +1 -1
  23. package/src/gdskills/bundled/skills/quality/git-publish/SKILL.md +60 -0
  24. package/src/gdskills/bundled/skills/quality/pr-issue-documenter/SKILL.md +1 -1
  25. package/src/gdskills/bundled/skills/review/code-learned-review/SKILL.md +3 -3
  26. package/src/gdskills/bundled/skills/review/review-architecture/SKILL.md +7 -7
  27. package/src/gdskills/bundled/skills/review/review-backend/SKILL.md +22 -22
  28. package/src/gdskills/bundled/skills/review/review-clean-code/SKILL.md +15 -15
  29. package/src/gdskills/bundled/skills/review/review-core-boundaries/SKILL.md +2 -2
  30. package/src/gdskills/bundled/skills/review/review-degradation/SKILL.md +7 -7
  31. package/src/gdskills/bundled/skills/review/review-flow-graph/SKILL.md +2 -2
  32. package/src/gdskills/bundled/skills/review/review-frontend/SKILL.md +34 -30
  33. package/src/gdskills/bundled/skills/review/review-frontend-conventions/SKILL.md +2 -2
  34. package/src/gdskills/bundled/skills/review/review-highload/SKILL.md +64 -135
  35. package/src/gdskills/bundled/skills/review/review-logic/SKILL.md +4 -4
  36. package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.detail.md +18 -20
  37. package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.md +12 -18
  38. package/src/gdskills/bundled/skills/review/review-orchestrator/reviewer-finding.schema.json +2 -2
  39. package/src/gdskills/bundled/skills/review/review-orchestrator/reviewer-input.schema.json +2 -10
  40. package/src/gdskills/bundled/skills/review/review-performance/SKILL.md +35 -35
  41. package/src/gdskills/bundled/skills/review/review-pr-contract/SKILL.md +4 -5
  42. package/src/gdskills/bundled/skills/review/review-premise/SKILL.md +2 -2
  43. package/src/gdskills/bundled/skills/review/review-regression/SKILL.md +3 -5
  44. package/src/gdskills/bundled/skills/review/review-security-code/SKILL.md +14 -15
  45. package/src/gdskills/bundled/skills/review/review-style/SKILL.md +14 -13
  46. package/src/gdskills/bundled/skills/review/review-testing-practices/SKILL.md +11 -11
  47. package/src/gdskills/bundled/skills/review/review-ui-ux/SKILL.md +10 -11
  48. package/src/gdskills/bundled/skills/review/review-verifier/SKILL.md +5 -5
  49. package/src/gdskills/bundled/skills/shared/git-merge-base.md +1 -1
  50. package/src/gdskills/bundled/stacks/mobx/agent-refs.json +1 -1
  51. package/src/gdskills/bundled/stacks/mobx/governance/scout.json +2 -2
  52. package/src/gdskills/bundled/stacks/mobx/skills/mobx-store-implementation/SKILL.md +2 -2
  53. package/src/gdskills/bundled/stacks/vue/governance/scout.json +1 -1
  54. package/src/gdskills/contracts/review-finding.schema.json +2 -2
  55. package/src/gdskills/bundled/rules/core/code-review-ai-assistant.mdc +0 -49
  56. package/src/gdskills/bundled/rules/core/gproject-contracts.mdc +0 -198
  57. package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.md +0 -177
  58. package/src/gdskills/bundled/skills/orchestration/job-documenter/SKILL.md +0 -414
  59. package/src/gdskills/bundled/skills/orchestration/job-documenter/input-contract.schema.json +0 -55
  60. package/src/gdskills/bundled/skills/orchestration/job-documenter/output-contract.schema.json +0 -58
  61. package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.codex.md +0 -209
  62. package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.cursor.md +0 -209
  63. package/src/gdskills/bundled/skills/planning/consistency-checker/SKILL.md +0 -208
  64. package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.codex.md +0 -255
  65. package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.cursor.md +0 -255
  66. package/src/gdskills/bundled/skills/planning/patterns-researcher/SKILL.md +0 -254
  67. package/src/gdskills/bundled/skills/planning/planner/SKILL.codex.md +0 -209
  68. package/src/gdskills/bundled/skills/planning/planner/SKILL.cursor.md +0 -209
  69. package/src/gdskills/bundled/skills/planning/planner/SKILL.md +0 -208
  70. package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.codex.md +0 -171
  71. package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.cursor.md +0 -171
  72. package/src/gdskills/bundled/skills/planning/problem-definer/SKILL.md +0 -170
  73. package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.codex.md +0 -184
  74. package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.cursor.md +0 -184
  75. package/src/gdskills/bundled/skills/planning/project-discovery/SKILL.md +0 -183
  76. package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.codex.md +0 -249
  77. package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.cursor.md +0 -249
  78. package/src/gdskills/bundled/skills/planning/spec-writer/SKILL.md +0 -248
  79. package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.codex.md +0 -199
  80. package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.cursor.md +0 -199
  81. package/src/gdskills/bundled/skills/planning/stack-advisor/SKILL.md +0 -198
  82. package/src/gdskills/bundled/skills/quality/commit/SKILL.md +0 -87
  83. package/src/gdskills/bundled/skills/quality/pr/SKILL.md +0 -95
  84. package/src/gdskills/bundled/skills/quality/push/SKILL.md +0 -73
  85. package/src/gdskills/bundled/skills/review/code-ai-review/SKILL.md +0 -238
  86. package/src/gdskills/bundled/skills/review/code-mobx-store-review/SKILL.md +0 -301
  87. package/src/gdskills/bundled/skills/review/code-style-review/SKILL.md +0 -208
@@ -1,183 +0,0 @@
1
- ---
2
- name: project-discovery
3
- description: >
4
- Collects and structures initial project information from multiple sources.
5
- Use when: dispatched by gproject-orchestrator Phase 0.
6
- NOT for: direct user invocation — always called through orchestrator.
7
- triggers:
8
- - "project discovery"
9
- - "discover project"
10
- - "initial analysis"
11
- metadata:
12
- version: 1.0.0
13
- ---
14
-
15
- # gproject-discovery
16
-
17
- ## Purpose
18
-
19
- Gather raw project information from all available sources, structure it into
20
- a unified discovery brief. This is the foundation — every downstream decision
21
- depends on the quality of discovery.
22
-
23
- ## Iron Laws
24
-
25
- | # | Law |
26
- |---|-----|
27
- | 1 | NEVER assume information not explicitly provided or discovered |
28
- | 2 | ALWAYS distinguish facts from assumptions — label each |
29
- | 3 | If a critical area has no data, return NEEDS_CONTEXT — don't fill gaps with guesses |
30
- | 4 | Web research MUST cite sources |
31
- | 5 | Codebase analysis MUST reference actual file paths |
32
-
33
- ## Red Flags
34
-
35
- Stop and re-read this skill if you are thinking:
36
-
37
- | Rationalization | Rebuttal |
38
- |---|---|
39
- | "The domain is obvious from the request, so `D_domain` is safe to fill in." | Iron Law 1 and 2: an inference is an assumption and must be labelled one. `D_domain` is a decision every later phase treats as settled — an unlabelled guess here becomes a stack choice in Phase 2 nobody re-examines. |
40
- | "One area has no data, but the rest is solid — I'll note the gap and return `DONE`." | Iron Law 3: a critical area with no data is `NEEDS_CONTEXT` with a concrete A/B/C/D question. A gap recorded as a note is read by the next phase as something already handled. |
41
- | "I recognise this framework's layout, so I can describe the codebase without opening files." | Iron Law 5 requires actual file paths. A described layout that does not match the repository misdirects every phase that follows, and nothing downstream reads the code again to catch it. |
42
- | "The best-practice claim is common knowledge, so a citation is ceremony." | Iron Law 4: web research cites sources. Uncited common knowledge is where a stale convention enters the brief and survives to the architecture document as a constraint. |
43
- | "The user already explained this in the request — restating it in the brief is redundant." | The brief is the only artifact Phase 1 receives; the original request is not passed along. Anything left out of it is lost to the entire pipeline. |
44
-
45
- ---
46
-
47
- ## Input Contract
48
-
49
- ```yaml
50
- task: "Collect project discovery data"
51
- mode: "new_project" | "task_in_project"
52
- user_input: "<original user request text>"
53
- uploaded_docs: [<file paths if any>]
54
- repo_path: "<path if task_in_project>"
55
- interview_results: "<from interview skill, if already run>"
56
- ```
57
-
58
- ## Output Contract
59
-
60
- ```yaml
61
- status: "DONE" | "NEEDS_CONTEXT"
62
- summary: "<3-5 sentences: what was found, key gaps, confidence level>"
63
- new_decisions:
64
- D_mode: "new_project | task_in_project"
65
- D_domain: "<business domain>"
66
- D_audience: "<target users>"
67
- D_scale_estimate: "<rough scale: personal/team/startup/enterprise>"
68
- artifact_path: ".metaproject/jobs/<job>/artifacts/discovery-brief.md"
69
- ```
70
-
71
- If NEEDS_CONTEXT:
72
- ```yaml
73
- status: "NEEDS_CONTEXT"
74
- questions:
75
- - id: "Q1"
76
- text: "<question>"
77
- options:
78
- A: "<option>"
79
- B: "<option>"
80
- C: "<option>"
81
- D: "<option>"
82
- why: "<why this matters for downstream phases>"
83
- ```
84
-
85
- ---
86
-
87
- ## Workflow
88
-
89
- ### Step 1: Parse User Input
90
-
91
- Extract from the user's original request:
92
- - What they want to build/implement
93
- - Any constraints mentioned (budget, timeline, team size)
94
- - Any technical preferences mentioned
95
- - Target audience / users mentioned
96
-
97
- ### Step 2: Source-Specific Collection
98
-
99
- #### Mode: new_project
100
-
101
- 1. **User input analysis** — extract all explicit and implied requirements
102
- 2. **Uploaded documents** — parse any attached files (briefs, notes, mockups, transcripts)
103
- 3. **Web research** — search for:
104
- - Similar products / competitors (max 5)
105
- - Market context and trends
106
- - Common technical approaches for this type of project
107
- 4. **Gap identification** — list what's missing for confident decision-making
108
-
109
- #### Mode: task_in_project
110
-
111
- 1. **User input analysis** — extract the specific task/feature request
112
- 2. **Codebase scan** (via context-collector) — gather:
113
- - Project structure (directories, key files)
114
- - Technology stack (package.json, requirements.txt, Dockerfile, etc.)
115
- - Architecture patterns in use
116
- - Existing documentation (README, docs/, ADRs)
117
- - Related code areas (files likely affected by this task)
118
- 3. **Existing docs** — parse project documentation for context
119
- 4. **Web research** — best practices for the specific task within the detected stack
120
- 5. **Gap identification** — what's unclear about the existing codebase or requirements
121
-
122
- ### Step 3: Structure Discovery Brief
123
-
124
- Write `artifacts/discovery-brief.md` with this structure:
125
-
126
- ```markdown
127
- # Discovery Brief: <Project/Task Name>
128
-
129
- ## Source Summary
130
- - User input: <what was provided>
131
- - Documents analyzed: <list>
132
- - Codebase scanned: <yes/no, scope>
133
- - Web research: <topics covered>
134
-
135
- ## Project/Task Description
136
- <Clear 2-3 paragraph description of what needs to be built/done>
137
-
138
- ## Key Facts (confirmed)
139
- - <fact 1> [source: user input / document / codebase]
140
- - <fact 2> [source: ...]
141
-
142
- ## Assumptions (need validation)
143
- - <assumption 1> — confidence: high/medium/low
144
- - <assumption 2> — confidence: ...
145
-
146
- ## Stakeholders & Users
147
- - Primary users: <who>
148
- - Secondary users: <who>
149
- - Stakeholders: <who decides>
150
-
151
- ## Existing Context (task_in_project only)
152
- - Tech stack: <detected>
153
- - Architecture: <detected patterns>
154
- - Related components: <list with file paths>
155
- - Existing patterns to follow: <list>
156
-
157
- ## Competitive / Market Context (new_project only)
158
- - Similar products: <list with brief notes>
159
- - Differentiators mentioned: <list>
160
- - Market trends: <relevant>
161
-
162
- ## Constraints Identified
163
- - Budget: <if mentioned>
164
- - Timeline: <if mentioned>
165
- - Team: <size, skills if mentioned>
166
- - Technical: <any mentioned constraints>
167
-
168
- ## Open Questions
169
- - <question 1> — impacts: <which downstream decisions>
170
- - <question 2> — impacts: ...
171
-
172
- ## Confidence Assessment
173
- - Overall completeness: <high/medium/low>
174
- - Areas needing more data: <list>
175
- ```
176
-
177
- ### Step 4: Return Summary to Orchestrator
178
-
179
- Compose compact summary (3-5 sentences) covering:
180
- - What the project/task is about
181
- - Key constraints discovered
182
- - Confidence level
183
- - Critical gaps that need resolution
@@ -1,249 +0,0 @@
1
- ---
2
- name: spec-writer
3
- description: >
4
- Generates PRD or Implementation Plan constrained by decisions registry,
5
- architecture doc, and best practices. Does NOT invent new architectural decisions.
6
- Use when: dispatched by gproject-orchestrator Phase 4.
7
- NOT for: direct user invocation.
8
- triggers:
9
- - "write spec"
10
- - "technical specification"
11
- - "implementation plan"
12
- metadata:
13
- version: 1.0.0
14
- compatible_harnesses: "cursor,codex,zed,opencode"
15
- ---
16
-
17
- # gproject-spec-writer
18
-
19
- ## Purpose
20
-
21
- Write a comprehensive PRD (new project) or Implementation Plan (task in project)
22
- that is fully constrained by the decisions made in Phases 0-3. This agent
23
- does NOT make architectural or stack decisions — it translates existing decisions
24
- into actionable requirements and user stories.
25
-
26
- ## Iron Laws
27
-
28
- | # | Law |
29
- |---|-----|
30
- | 1 | NEVER introduce a technology not in stack-decision.md |
31
- | 2 | NEVER propose an architecture pattern not in architecture.md |
32
- | 3 | EVERY technical requirement MUST reference a constraint from tech-bestpractices.md |
33
- | 4 | EVERY user story MUST trace back to a goal in problem-statement.md |
34
- | 5 | Non-goals from problem-statement.md MUST NOT appear as features |
35
- | 6 | If a requirement conflicts with a constraint, return BLOCKED — don't resolve silently |
36
- | 7 | User stories MUST have testable acceptance criteria |
37
-
38
- ## Red Flags
39
-
40
- | Flag | What's happening | Action |
41
- |------|-----------------|--------|
42
- | Writing "we'll use X" where X is not in stack decisions | Introducing undecided tech | STOP → check stack-decision.md |
43
- | User story without acceptance criteria | Untestable requirement | STOP → add criteria or flag as incomplete |
44
- | Feature that contradicts a non-goal | Scope creep | STOP → remove or flag as conflict |
45
- | Technical spec section with no BP constraint reference | Unconstrained decision | STOP → find applicable constraint or flag gap |
46
-
47
- ---
48
-
49
- ## Input Contract
50
-
51
- ```yaml
52
- task: "Generate PRD / Implementation Plan"
53
- mode: "new_project" | "task_in_project"
54
- input_artifacts:
55
- - .metaproject/jobs/<job>/artifacts/problem-statement.md
56
- - .metaproject/jobs/<job>/artifacts/architecture.md
57
- - .metaproject/jobs/<job>/artifacts/tech-bestpractices.md
58
- - .metaproject/jobs/<job>/decisions.md
59
- decisions_so_far: <all decisions from D1 through D_arch_pattern>
60
- ```
61
-
62
- ## Output Contract
63
-
64
- ```yaml
65
- status: "DONE" | "DONE_WITH_CONCERNS" | "BLOCKED"
66
- summary: "<3-5 sentences: document type, user story count, key scope decisions>"
67
- new_decisions: {} # PRD does NOT add architectural decisions
68
- concerns: ["<if DONE_WITH_CONCERNS — gaps or ambiguities found>"]
69
- artifact_path: ".metaproject/jobs/<job>/artifacts/prd.md"
70
- ```
71
-
72
- ---
73
-
74
- ## Workflow
75
-
76
- ### Step 1: Validate Inputs
77
-
78
- Before writing anything, verify:
79
- - [ ] All referenced decisions exist in decisions.md
80
- - [ ] No contradictions between problem-statement and architecture
81
- - [ ] Best practices constraints are internally consistent
82
- - [ ] Scope (goals + non-goals) is clear
83
-
84
- If validation fails → return `STATUS: BLOCKED` with specific issues.
85
-
86
- ### Step 2: Determine Document Type
87
-
88
- ```
89
- IF mode == "new_project":
90
- → Write full PRD (template A below)
91
- ELSE IF mode == "task_in_project":
92
- → Write Implementation Plan (template B below)
93
- ```
94
-
95
- ### Step 3: Write User Stories
96
-
97
- For each goal in problem-statement.md, generate user stories:
98
-
99
- Format:
100
- ```
101
- ### US-<NNN>: <Title>
102
- **As a** <user type from D_target_users>
103
- **I want to** <action>
104
- **So that** <benefit tied to goal G_N>
105
-
106
- **Acceptance Criteria:**
107
- - [ ] <specific, testable criterion>
108
- - [ ] <specific, testable criterion>
109
- - [ ] <specific, testable criterion>
110
-
111
- **Technical Notes:**
112
- - Constraint ref: <reference to tech-bestpractices.md constraint>
113
- - Architecture ref: <reference to architecture.md section>
114
-
115
- **Priority:** P0 (must-have) | P1 (should-have) | P2 (nice-to-have)
116
- ```
117
-
118
- Prioritization rules:
119
- - **P0**: directly solves a core problem (P1/P2 in problem-statement)
120
- - **P1**: supports a goal but not critical for launch
121
- - **P2**: enhances experience, can be deferred
122
-
123
- ### Step 4: Write Document
124
-
125
- #### Template A: Full PRD (new_project)
126
-
127
- ```markdown
128
- # PRD: <Project Name>
129
-
130
- ## Document Metadata
131
- - **Based on**: problem-statement.md, architecture.md, tech-bestpractices.md
132
- - **Decisions referenced**: <list of D_* IDs>
133
- - **Generated by**: gproject-spec-writer v1.0.0
134
-
135
- ## Executive Summary
136
- <2-3 paragraphs: what, why, for whom, high-level how>
137
-
138
- ## Goals & Success Metrics
139
- <from problem-statement.md — reference, don't duplicate>
140
- | Goal ID | Goal | Success Metric | Target |
141
- |---------|------|---------------|--------|
142
- | G1 | <goal> | <metric> | <target> |
143
-
144
- ## Non-Goals
145
- <from problem-statement.md — reference explicitly>
146
-
147
- ## Technical Foundation
148
- **Stack**: <from stack-decision.md — summarize, don't duplicate>
149
- **Architecture**: <from architecture.md — summarize>
150
- **Key Constraints**: <from tech-bestpractices.md — list MUST constraints>
151
-
152
- ## User Stories
153
-
154
- ### Epic 1: <Epic Name>
155
- <Group of related user stories>
156
-
157
- #### US-001: <Title>
158
- ...
159
-
160
- ### Epic 2: <Epic Name>
161
- ...
162
-
163
- ## Data Model (High-Level)
164
- <Key entities and relationships — aligned with DB constraints from BP>
165
-
166
- ## API Surface (High-Level)
167
- <Key endpoints/operations — aligned with API constraints from BP>
168
-
169
- ## Security Requirements
170
- <Aligned with security constraints from BP>
171
-
172
- ## Testing Requirements
173
- <Aligned with testing constraints from BP — reference test pyramid targets>
174
-
175
- ## Out of Scope
176
- <Explicit reference to non-goals + any additional scope exclusions>
177
-
178
- ## Open Questions
179
- <Any remaining ambiguities — flagged for orchestrator>
180
-
181
- ## Traceability Matrix
182
- | User Story | Goal | Problem | BP Constraint | Architecture Section |
183
- |-----------|------|---------|---------------|---------------------|
184
- | US-001 | G1 | P1 | Frontend.MUST.1 | Layer: API |
185
- | US-002 | G1 | P1 | Backend.MUST.3 | Layer: Service |
186
- ```
187
-
188
- #### Template B: Implementation Plan (task_in_project)
189
-
190
- ```markdown
191
- # Implementation Plan: <Task Name>
192
-
193
- ## Document Metadata
194
- - **Based on**: discovery-brief.md, architecture.md, tech-bestpractices.md
195
- - **Existing project context**: ai/context.md
196
- - **Decisions referenced**: <list of D_* IDs>
197
-
198
- ## Summary
199
- <What needs to be done, why, and how it fits into existing architecture>
200
-
201
- ## Impact Analysis
202
- ### Files Affected
203
- | File/Module | Change Type | Risk |
204
- |------------|------------|------|
205
- | <path> | modify / create / delete | low / medium / high |
206
-
207
- ### Dependencies
208
- - <component X depends on this change>
209
- - <this change requires Y to be done first>
210
-
211
- ## Implementation Steps
212
-
213
- ### Step 1: <Title>
214
- **What**: <specific change>
215
- **Where**: <file paths>
216
- **Pattern to follow**: <reference existing project patterns>
217
- **BP constraint**: <reference tech-bestpractices.md>
218
- **Acceptance criteria**:
219
- - [ ] <testable criterion>
220
-
221
- ### Step 2: ...
222
-
223
- ## Testing Plan
224
- <Aligned with testing constraints — what tests to write, what coverage>
225
-
226
- ## Migration / Rollback Plan (if applicable)
227
- <How to roll back if something goes wrong>
228
-
229
- ## Traceability Matrix
230
- | Step | Goal | BP Constraint | Existing Pattern |
231
- |------|------|---------------|-----------------|
232
- | Step 1 | G1 | Backend.MUST.2 | existing-service.ts pattern |
233
- ```
234
-
235
- ### Step 5: Self-Validate
236
-
237
- Before returning, check:
238
- - [ ] Every user story traces to a goal
239
- - [ ] No features from non-goals list
240
- - [ ] Every technical note references a BP constraint
241
- - [ ] All acceptance criteria are testable (no "should work well")
242
- - [ ] Traceability matrix is complete
243
-
244
- If self-validation finds issues → fix them. If unfixable → return `DONE_WITH_CONCERNS`.
245
-
246
- ### Step 6: Return Summary
247
-
248
- Compact summary: document type, total user stories / steps,
249
- P0 count, any concerns or gaps found during self-validation.
@@ -1,249 +0,0 @@
1
- ---
2
- name: spec-writer
3
- description: >
4
- Generates PRD or Implementation Plan constrained by decisions registry,
5
- architecture doc, and best practices. Does NOT invent new architectural decisions.
6
- Use when: dispatched by gproject-orchestrator Phase 4.
7
- NOT for: direct user invocation.
8
- triggers:
9
- - "write spec"
10
- - "technical specification"
11
- - "implementation plan"
12
- metadata:
13
- version: 1.0.0
14
- compatible_harnesses: "cursor,codex,zed,opencode"
15
- ---
16
-
17
- # gproject-spec-writer
18
-
19
- ## Purpose
20
-
21
- Write a comprehensive PRD (new project) or Implementation Plan (task in project)
22
- that is fully constrained by the decisions made in Phases 0-3. This agent
23
- does NOT make architectural or stack decisions — it translates existing decisions
24
- into actionable requirements and user stories.
25
-
26
- ## Iron Laws
27
-
28
- | # | Law |
29
- |---|-----|
30
- | 1 | NEVER introduce a technology not in stack-decision.md |
31
- | 2 | NEVER propose an architecture pattern not in architecture.md |
32
- | 3 | EVERY technical requirement MUST reference a constraint from tech-bestpractices.md |
33
- | 4 | EVERY user story MUST trace back to a goal in problem-statement.md |
34
- | 5 | Non-goals from problem-statement.md MUST NOT appear as features |
35
- | 6 | If a requirement conflicts with a constraint, return BLOCKED — don't resolve silently |
36
- | 7 | User stories MUST have testable acceptance criteria |
37
-
38
- ## Red Flags
39
-
40
- | Flag | What's happening | Action |
41
- |------|-----------------|--------|
42
- | Writing "we'll use X" where X is not in stack decisions | Introducing undecided tech | STOP → check stack-decision.md |
43
- | User story without acceptance criteria | Untestable requirement | STOP → add criteria or flag as incomplete |
44
- | Feature that contradicts a non-goal | Scope creep | STOP → remove or flag as conflict |
45
- | Technical spec section with no BP constraint reference | Unconstrained decision | STOP → find applicable constraint or flag gap |
46
-
47
- ---
48
-
49
- ## Input Contract
50
-
51
- ```yaml
52
- task: "Generate PRD / Implementation Plan"
53
- mode: "new_project" | "task_in_project"
54
- input_artifacts:
55
- - .metaproject/jobs/<job>/artifacts/problem-statement.md
56
- - .metaproject/jobs/<job>/artifacts/architecture.md
57
- - .metaproject/jobs/<job>/artifacts/tech-bestpractices.md
58
- - .metaproject/jobs/<job>/decisions.md
59
- decisions_so_far: <all decisions from D1 through D_arch_pattern>
60
- ```
61
-
62
- ## Output Contract
63
-
64
- ```yaml
65
- status: "DONE" | "DONE_WITH_CONCERNS" | "BLOCKED"
66
- summary: "<3-5 sentences: document type, user story count, key scope decisions>"
67
- new_decisions: {} # PRD does NOT add architectural decisions
68
- concerns: ["<if DONE_WITH_CONCERNS — gaps or ambiguities found>"]
69
- artifact_path: ".metaproject/jobs/<job>/artifacts/prd.md"
70
- ```
71
-
72
- ---
73
-
74
- ## Workflow
75
-
76
- ### Step 1: Validate Inputs
77
-
78
- Before writing anything, verify:
79
- - [ ] All referenced decisions exist in decisions.md
80
- - [ ] No contradictions between problem-statement and architecture
81
- - [ ] Best practices constraints are internally consistent
82
- - [ ] Scope (goals + non-goals) is clear
83
-
84
- If validation fails → return `STATUS: BLOCKED` with specific issues.
85
-
86
- ### Step 2: Determine Document Type
87
-
88
- ```
89
- IF mode == "new_project":
90
- → Write full PRD (template A below)
91
- ELSE IF mode == "task_in_project":
92
- → Write Implementation Plan (template B below)
93
- ```
94
-
95
- ### Step 3: Write User Stories
96
-
97
- For each goal in problem-statement.md, generate user stories:
98
-
99
- Format:
100
- ```
101
- ### US-<NNN>: <Title>
102
- **As a** <user type from D_target_users>
103
- **I want to** <action>
104
- **So that** <benefit tied to goal G_N>
105
-
106
- **Acceptance Criteria:**
107
- - [ ] <specific, testable criterion>
108
- - [ ] <specific, testable criterion>
109
- - [ ] <specific, testable criterion>
110
-
111
- **Technical Notes:**
112
- - Constraint ref: <reference to tech-bestpractices.md constraint>
113
- - Architecture ref: <reference to architecture.md section>
114
-
115
- **Priority:** P0 (must-have) | P1 (should-have) | P2 (nice-to-have)
116
- ```
117
-
118
- Prioritization rules:
119
- - **P0**: directly solves a core problem (P1/P2 in problem-statement)
120
- - **P1**: supports a goal but not critical for launch
121
- - **P2**: enhances experience, can be deferred
122
-
123
- ### Step 4: Write Document
124
-
125
- #### Template A: Full PRD (new_project)
126
-
127
- ```markdown
128
- # PRD: <Project Name>
129
-
130
- ## Document Metadata
131
- - **Based on**: problem-statement.md, architecture.md, tech-bestpractices.md
132
- - **Decisions referenced**: <list of D_* IDs>
133
- - **Generated by**: gproject-spec-writer v1.0.0
134
-
135
- ## Executive Summary
136
- <2-3 paragraphs: what, why, for whom, high-level how>
137
-
138
- ## Goals & Success Metrics
139
- <from problem-statement.md — reference, don't duplicate>
140
- | Goal ID | Goal | Success Metric | Target |
141
- |---------|------|---------------|--------|
142
- | G1 | <goal> | <metric> | <target> |
143
-
144
- ## Non-Goals
145
- <from problem-statement.md — reference explicitly>
146
-
147
- ## Technical Foundation
148
- **Stack**: <from stack-decision.md — summarize, don't duplicate>
149
- **Architecture**: <from architecture.md — summarize>
150
- **Key Constraints**: <from tech-bestpractices.md — list MUST constraints>
151
-
152
- ## User Stories
153
-
154
- ### Epic 1: <Epic Name>
155
- <Group of related user stories>
156
-
157
- #### US-001: <Title>
158
- ...
159
-
160
- ### Epic 2: <Epic Name>
161
- ...
162
-
163
- ## Data Model (High-Level)
164
- <Key entities and relationships — aligned with DB constraints from BP>
165
-
166
- ## API Surface (High-Level)
167
- <Key endpoints/operations — aligned with API constraints from BP>
168
-
169
- ## Security Requirements
170
- <Aligned with security constraints from BP>
171
-
172
- ## Testing Requirements
173
- <Aligned with testing constraints from BP — reference test pyramid targets>
174
-
175
- ## Out of Scope
176
- <Explicit reference to non-goals + any additional scope exclusions>
177
-
178
- ## Open Questions
179
- <Any remaining ambiguities — flagged for orchestrator>
180
-
181
- ## Traceability Matrix
182
- | User Story | Goal | Problem | BP Constraint | Architecture Section |
183
- |-----------|------|---------|---------------|---------------------|
184
- | US-001 | G1 | P1 | Frontend.MUST.1 | Layer: API |
185
- | US-002 | G1 | P1 | Backend.MUST.3 | Layer: Service |
186
- ```
187
-
188
- #### Template B: Implementation Plan (task_in_project)
189
-
190
- ```markdown
191
- # Implementation Plan: <Task Name>
192
-
193
- ## Document Metadata
194
- - **Based on**: discovery-brief.md, architecture.md, tech-bestpractices.md
195
- - **Existing project context**: ai/context.md
196
- - **Decisions referenced**: <list of D_* IDs>
197
-
198
- ## Summary
199
- <What needs to be done, why, and how it fits into existing architecture>
200
-
201
- ## Impact Analysis
202
- ### Files Affected
203
- | File/Module | Change Type | Risk |
204
- |------------|------------|------|
205
- | <path> | modify / create / delete | low / medium / high |
206
-
207
- ### Dependencies
208
- - <component X depends on this change>
209
- - <this change requires Y to be done first>
210
-
211
- ## Implementation Steps
212
-
213
- ### Step 1: <Title>
214
- **What**: <specific change>
215
- **Where**: <file paths>
216
- **Pattern to follow**: <reference existing project patterns>
217
- **BP constraint**: <reference tech-bestpractices.md>
218
- **Acceptance criteria**:
219
- - [ ] <testable criterion>
220
-
221
- ### Step 2: ...
222
-
223
- ## Testing Plan
224
- <Aligned with testing constraints — what tests to write, what coverage>
225
-
226
- ## Migration / Rollback Plan (if applicable)
227
- <How to roll back if something goes wrong>
228
-
229
- ## Traceability Matrix
230
- | Step | Goal | BP Constraint | Existing Pattern |
231
- |------|------|---------------|-----------------|
232
- | Step 1 | G1 | Backend.MUST.2 | existing-service.ts pattern |
233
- ```
234
-
235
- ### Step 5: Self-Validate
236
-
237
- Before returning, check:
238
- - [ ] Every user story traces to a goal
239
- - [ ] No features from non-goals list
240
- - [ ] Every technical note references a BP constraint
241
- - [ ] All acceptance criteria are testable (no "should work well")
242
- - [ ] Traceability matrix is complete
243
-
244
- If self-validation finds issues → fix them. If unfixable → return `DONE_WITH_CONCERNS`.
245
-
246
- ### Step 6: Return Summary
247
-
248
- Compact summary: document type, total user stories / steps,
249
- P0 count, any concerns or gaps found during self-validation.