ai-eng-system 0.0.10 → 0.0.12

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 (49) hide show
  1. package/README.md +50 -7
  2. package/dist/.claude-plugin/commands/optimize.md +39 -0
  3. package/dist/.claude-plugin/commands/plan.md +285 -24
  4. package/dist/.claude-plugin/commands/research.md +41 -0
  5. package/dist/.claude-plugin/commands/specify.md +445 -0
  6. package/dist/.claude-plugin/commands/work.md +83 -5
  7. package/dist/.claude-plugin/marketplace.json +51 -51
  8. package/dist/.claude-plugin/plugin.json +3 -2
  9. package/dist/.claude-plugin/skills/AGENTS.md +67 -18
  10. package/dist/{skills/research → .claude-plugin/skills}/comprehensive-research/SKILL.md +1 -1
  11. package/dist/{skills/prompting → .claude-plugin/skills}/incentive-prompting/SKILL.md +2 -2
  12. package/dist/.claude-plugin/skills/prompt-refinement/SKILL.md +301 -0
  13. package/dist/.claude-plugin/skills/prompt-refinement/templates/plan.md +411 -0
  14. package/dist/.claude-plugin/skills/prompt-refinement/templates/research.md +253 -0
  15. package/dist/.claude-plugin/skills/prompt-refinement/templates/specify.md +377 -0
  16. package/dist/.claude-plugin/skills/prompt-refinement/templates/work.md +476 -0
  17. package/dist/.claude-plugin/skills/text-cleanup/patterns/comment-patterns.json +140 -140
  18. package/dist/.claude-plugin/skills/text-cleanup/patterns/slop-patterns.json +110 -110
  19. package/dist/.opencode/command/ai-eng/optimize.md +39 -0
  20. package/dist/.opencode/command/ai-eng/plan.md +285 -24
  21. package/dist/.opencode/command/ai-eng/research.md +41 -0
  22. package/dist/.opencode/command/ai-eng/specify.md +445 -0
  23. package/dist/.opencode/command/ai-eng/work.md +83 -5
  24. package/dist/.opencode/skill/comprehensive-research/SKILL.md +1 -1
  25. package/dist/.opencode/skill/incentive-prompting/SKILL.md +2 -2
  26. package/dist/.opencode/skill/prompt-refinement/SKILL.md +301 -0
  27. package/dist/.opencode/skill/prompt-refinement/templates/plan.md +411 -0
  28. package/dist/.opencode/skill/prompt-refinement/templates/research.md +253 -0
  29. package/dist/.opencode/skill/prompt-refinement/templates/specify.md +377 -0
  30. package/dist/.opencode/skill/prompt-refinement/templates/work.md +476 -0
  31. package/dist/.opencode/skill/text-cleanup/patterns/comment-patterns.json +140 -140
  32. package/dist/.opencode/skill/text-cleanup/patterns/slop-patterns.json +110 -110
  33. package/dist/index.js +46 -2
  34. package/dist/skills/AGENTS.md +67 -18
  35. package/dist/{.claude-plugin/skills/research → skills}/comprehensive-research/SKILL.md +1 -1
  36. package/dist/{.claude-plugin/skills/prompting → skills}/incentive-prompting/SKILL.md +2 -2
  37. package/dist/skills/prompt-refinement/SKILL.md +301 -0
  38. package/dist/skills/prompt-refinement/templates/plan.md +411 -0
  39. package/dist/skills/prompt-refinement/templates/research.md +253 -0
  40. package/dist/skills/prompt-refinement/templates/specify.md +377 -0
  41. package/dist/skills/prompt-refinement/templates/work.md +476 -0
  42. package/dist/skills/text-cleanup/patterns/comment-patterns.json +140 -140
  43. package/dist/skills/text-cleanup/patterns/slop-patterns.json +110 -110
  44. package/package.json +14 -3
  45. package/scripts/install.js +122 -102
  46. /package/dist/.claude-plugin/skills/{devops/coolify-deploy → coolify-deploy}/SKILL.md +0 -0
  47. /package/dist/.claude-plugin/skills/{devops/git-worktree → git-worktree}/SKILL.md +0 -0
  48. /package/dist/skills/{devops/coolify-deploy → coolify-deploy}/SKILL.md +0 -0
  49. /package/dist/skills/{devops/git-worktree → git-worktree}/SKILL.md +0 -0
package/README.md CHANGED
@@ -4,6 +4,31 @@ Advanced development tools with context engineering, research orchestration, and
4
4
 
5
5
  ## 🚀 Quick Start
6
6
 
7
+ ### Spec-Driven Development (Recommended)
8
+
9
+ This toolkit follows the **spec-driven development methodology** from GitHub's official blog post: [Spec-driven development with AI: Get started with a new open source toolkit](https://github.blog/ai-and-ml/generative-ai/spec-driven-development-with-ai-get-started-with-a-new-open-source-toolkit/).
10
+
11
+ **The 5-Phase Workflow** (always in this order):
12
+
13
+ ```mermaid
14
+ flowchart LR
15
+ A[🎯 Research] --> B[📋 Specify] --> C[📝 Plan] --> D[🔨 Work] --> E[🔍 Review]
16
+ D -.->|If changes needed| E
17
+ E -.->|Repeat| D
18
+ ```
19
+
20
+ | Phase | Command | Output |
21
+ |-------|---------|--------|
22
+ | 1. Research | `/ai-eng/research` | Context and findings |
23
+ | 2. Specify | `/ai-eng/specify` | Feature specification |
24
+ | 3. Plan | `/ai-eng/plan` | Implementation plan |
25
+ | 4. Work | `/ai-eng/work` | Quality-gated code |
26
+ | 5. Review | `/ai-eng/review` | Multi-agent approval |
27
+
28
+ This approach ensures specifications are your "source of truth" for what gets built, reducing guesswork and enabling more reliable AI-assisted development.
29
+
30
+ See [docs/spec-driven-workflow.md](./docs/spec-driven-workflow.md) for complete workflow guide with examples.
31
+
7
32
  ### Claude Code (Recommended)
8
33
  ```bash
9
34
  /plugin marketplace add v1truv1us/ai-eng-system
@@ -22,11 +47,21 @@ Advanced development tools with context engineering, research orchestration, and
22
47
  ```
23
48
  ## 📋 What's Included
24
49
 
25
- ### Commands (16 total)
26
- - `/ai-eng/plan` - Create detailed implementation plans
27
- - `/ai-eng/review` - Multi-perspective code review (29 agents)
28
- - `/ai-eng/seo` - SEO audits with Core Web Vitals
29
- - `/ai-eng/work` - Execute plans with quality gates
50
+ ### Spec-Driven Development Workflow
51
+
52
+ **Core workflow for systematic development** (always research → specify → plan → work → review):
53
+
54
+ | Phase | Command | Purpose |
55
+ |-------|---------|---------|
56
+ | 1. Research | `/ai-eng/research` | Multi-phase research with codebase and external context |
57
+ | 2. Specify | `/ai-eng/specify` | Create feature specifications with TCRO framework |
58
+ | 3. Plan | `/ai-eng/plan` | Create detailed implementation plans from specs |
59
+ | 4. Work | `/ai-eng/work` | Execute plans with quality gates and validation |
60
+ | 5. Review | `/ai-eng/review` | Multi-perspective code review (29 agents) |
61
+
62
+ > **Methodology**: Based on [GitHub's spec-driven development approach](https://github.blog/ai-and-ml/generative-ai/spec-driven-development-with-ai-get-started-with-a-new-open-source-toolkit/)
63
+
64
+ ### Additional Commands (12 total)
30
65
  - `/ai-eng/optimize` - Prompt enhancement (+45% quality)
31
66
  - `/ai-eng/deploy` - Pre-deployment checklists
32
67
  - `/ai-eng/compound` - Document solved problems
@@ -36,9 +71,11 @@ Advanced development tools with context engineering, research orchestration, and
36
71
  - `/ai-eng/create-command` - AI-assisted command generation
37
72
  - `/ai-eng/create-skill` - AI-assisted skill creation
38
73
  - `/ai-eng/create-tool` - AI-assisted custom tool creation
39
- - `/ai-eng/research` - Multi-phase research orchestration
40
74
  - `/ai-eng/context` - Context management and retrieval
41
75
  - `/ai-eng/clean` - Remove build artifacts and generated files
76
+ - `/ai-eng/seo` - SEO audits with Core Web Vitals
77
+
78
+ **Total Commands**: 17
42
79
 
43
80
  ### Agents (29 total)
44
81
  - **Architecture & Planning**: `architect-advisor`, `backend-architect`, `infrastructure-builder`
@@ -163,4 +200,10 @@ Commands reference specialized agents automatically:
163
200
  /ai-eng/review --agent=backend-architect # Architecture review
164
201
  ```
165
202
 
166
- **Built with research-backed prompting techniques** (+45-115% quality improvement)
203
+ **Built with research-backed prompting techniques** (+45-115% quality improvement)
204
+
205
+ ## 📖 Workflow Guide
206
+
207
+ For complete documentation on the **Research → Specify → Plan → Work → Review** workflow, see:
208
+ - **[docs/spec-driven-workflow.md](./docs/spec-driven-workflow.md)** - Visual workflow guide with examples
209
+ - **[docs/research-command-guide.md](./docs/research-command-guide.md)** - Research command deep dive
@@ -94,6 +94,44 @@ EXAMPLES:
94
94
  3. **Quality Evaluation**: Identify areas for improvement (clarity, performance, effectiveness)
95
95
  4. **Research Planning**: Determine best sources and techniques to apply
96
96
 
97
+ ### Phase 1.5: Prompt Refinement (for --prompt mode)
98
+
99
+ When `--prompt` flag is used:
100
+
101
+ Use skill: `prompt-refinement`
102
+ Phase: [auto-detect or specified]
103
+
104
+ The prompt-refinement skill provides:
105
+ - TCRO structuring (Task, Context, Requirements, Output)
106
+ - Phase-specific clarifying questions (research, specify, plan, work)
107
+ - Integration with incentive-prompting techniques
108
+
109
+ **Workflow:**
110
+ 1. Load prompt-refinement skill
111
+ 2. Detect phase based on prompt content or explicit `--phase` flag
112
+ 3. Apply phase-specific template (research, specify, plan, or work)
113
+ 4. Structure prompt into TCRO format
114
+ 5. Enhance with incentive-prompting techniques
115
+ 6. Present refined prompt for user confirmation
116
+
117
+ **Example:**
118
+ ```bash
119
+ # User provides vague prompt
120
+ /ai-eng/optimize "help me debug auth" --prompt
121
+
122
+ # System:
123
+ 1. Invokes prompt-refinement skill
124
+ 2. Detects "work" phase (debugging)
125
+ 3. Loads work.md template
126
+ 4. Asks clarifying questions:
127
+ - What error are you seeing?
128
+ - Where in the flow does it happen?
129
+ - What's your tech stack?
130
+ 5. Structures into TCRO format
131
+ 6. Applies expert persona, stakes language, step-by-step reasoning
132
+ 7. Presents refined prompt for approval
133
+ ```
134
+
97
135
  ### Phase 2: Research & Best Practices
98
136
  Based on type and sources, research:
99
137
 
@@ -102,6 +140,7 @@ Based on type and sources, research:
102
140
  - **OpenAI Guides**: Prompt engineering for GPT models
103
141
  - **OpenCode/Crush**: Community-tested optimization patterns
104
142
  - **Academic Research**: Latest papers on prompt optimization
143
+ - **prompt-refinement skill**: TCRO framework and phase-specific templates
105
144
 
106
145
  #### For Code
107
146
  - **Language-Specific**: Performance patterns for target language
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ai-eng/plan
3
- description: Create a detailed implementation plan for a feature
3
+ description: Create a detailed implementation plan for a feature with spec-driven support
4
4
  agent: plan
5
5
  ---
6
6
 
@@ -12,15 +12,17 @@ Create a structured, atomic implementation plan for: $ARGUMENTS
12
12
 
13
13
  ```bash
14
14
  /ai-eng/plan [description] [options]
15
+ /ai-eng/plan --from-spec=<path> [options]
15
16
  ```
16
17
 
17
18
  ### Options
18
19
 
20
+ - `--from-spec <path>`: Load specification from file (e.g., `specs/auth/spec.md`)
19
21
  - `--swarm`: Use Swarms multi-agent orchestration instead of legacy coordinator
20
22
  - `-s, --scope <scope>`: Plan scope (architecture|implementation|review|full) [default: full]
21
23
  - `-r, --requirements <reqs...>`: List of specific requirements
22
24
  - `-c, --constraints <constraints...>`: List of constraints to consider
23
- - `-o, --output <file>`: Output plan file [default: generated-plan.yaml]
25
+ - `-o, --output <file>`: Output plan file [default: `specs/[feature]/plan.md`]
24
26
  - `-v, --verbose`: Enable verbose output
25
27
 
26
28
  ## Planning Philosophy
@@ -31,9 +33,35 @@ Create a structured, atomic implementation plan for: $ARGUMENTS
31
33
  - Are testable in isolation
32
34
  - Don't require context from unfinished sibling tasks
33
35
 
36
+ **Spec-Driven**: When specification exists, plan is derived from spec requirements:
37
+ - Each user story maps to one or more tasks
38
+ - All spec acceptance criteria must be covered by plan
39
+ - Non-functional requirements become technical constraints
40
+
34
41
  ## Process
35
42
 
36
- ### Phase 1: Discovery (Research Mode)
43
+ ### Phase 0: Prompt Refinement
44
+ Use skill: `prompt-refinement`
45
+ Phase: `plan`
46
+
47
+ [The prompt-refinement skill will transform your input into a structured TCRO format by asking clarifying questions about task, context, requirements, and output format.]
48
+
49
+ ### Phase 1: Load Specification (if exists)
50
+
51
+ If `--from-spec` flag is provided:
52
+ 1. **Read specification** from `specs/[feature]/spec.md`
53
+ 2. **Extract user stories** and their acceptance criteria
54
+ 3. **Extract non-functional requirements** (security, performance, etc.)
55
+ 4. **Identify open questions** marked with `[NEEDS CLARIFICATION]`
56
+ 5. **Use as foundation** for technical planning
57
+
58
+ If no spec is found:
59
+ - Warn user: "No specification found. Consider running `/ai-eng/specify` first to create a detailed specification."
60
+ - Offer: "Proceed with inline requirements gathering? (y/n)"
61
+ - If yes, gather requirements through clarifying questions
62
+ - If no, exit and prompt user to run `/ai-eng/specify`
63
+
64
+ ### Phase 2: Discovery (Research Mode)
37
65
 
38
66
  #### Subagent Communication Protocol (Minimal)
39
67
 
@@ -44,8 +72,10 @@ Use:
44
72
  ```text
45
73
  <CONTEXT_HANDOFF_V1>
46
74
  Goal: (1 sentence)
47
- Constraints: (bullets)
48
- Files / folders to focus: (bullets)
75
+ Scope: (codebase|docs|external|all)
76
+ Known constraints: (bullets; optional)
77
+ What I already checked: (bullets; optional)
78
+ Files/paths to prioritize: (bullets; optional)
49
79
  Deliverable: (what you must return)
50
80
  Output format: RESULT_V1
51
81
  </CONTEXT_HANDOFF_V1>
@@ -57,7 +87,7 @@ And require:
57
87
  <RESULT_V1>
58
88
  RESULT:
59
89
  EVIDENCE:
60
- RISKS:
90
+ OPEN_QUESTIONS:
61
91
  NEXT_STEPS:
62
92
  CONFIDENCE: 0.0-1.0
63
93
  </RESULT_V1>
@@ -80,7 +110,32 @@ CONFIDENCE: 0.0-1.0
80
110
  - Identify integration points with existing code
81
111
  - Flag potential breaking changes
82
112
 
83
- ### Phase 2: Task Decomposition
113
+ ### Phase 3: Technical Planning
114
+
115
+ #### From Specification (if exists)
116
+
117
+ For each user story in spec:
118
+ 1. **Map to technical tasks**: Break user story into implementation tasks
119
+ 2. **Define acceptance criteria**: Derive from spec acceptance criteria
120
+ 3. **Apply technical constraints**: From spec's non-functional requirements
121
+
122
+ Example mapping:
123
+ ```markdown
124
+ **User Story**: US-001 User Registration
125
+ → Task REG-001: Create User database model
126
+ → Task REG-002: Implement registration API endpoint
127
+ → Task REG-003: Add email validation
128
+ → Task REG-004: Implement password hashing
129
+ ```
130
+
131
+ #### Inline Requirements (if no spec)
132
+
133
+ If proceeding without specification:
134
+ - Use clarifying questions to gather requirements
135
+ - Define technical approach
136
+ - Document assumptions and constraints
137
+
138
+ ### Phase 4: Task Decomposition
84
139
 
85
140
  Break the feature into **atomic tasks** using this hierarchy:
86
141
 
@@ -100,10 +155,82 @@ Epic (the full feature)
100
155
  | Depends On | Blocking task IDs | `FEAT-001-B` (or "None") |
101
156
  | Files | Exact files to modify/create | `src/context/session.ts` |
102
157
  | Acceptance Criteria | Checkboxes that define "done" | `[ ] Class exports correctly` |
158
+ | Spec Reference | Links to user story/acceptance criteria | `US-001: AC-2` |
103
159
  | Estimated Time | Time box | `30 min` |
104
160
  | Complexity | Low / Medium / High | `Medium` |
105
161
 
106
- ### Phase 3: Risk Assessment
162
+ ### Phase 5: Generate Supporting Artifacts
163
+
164
+ Based on feature type and technical approach, generate:
165
+
166
+ #### data-model.md (if database involved)
167
+
168
+ ```markdown
169
+ # Data Model
170
+
171
+ ## Entities
172
+
173
+ ### User
174
+ ```typescript
175
+ {
176
+ id: string (UUID, primary key)
177
+ email: string (unique, indexed)
178
+ password_hash: string (bcrypt)
179
+ created_at: timestamp
180
+ updated_at: timestamp
181
+ }
182
+ ```
183
+
184
+ ## Relationships
185
+
186
+ - User has many Sessions
187
+ - Session belongs to User
188
+
189
+ ## Indexes
190
+
191
+ - `users_email_unique` on (email) for uniqueness
192
+ - `users_created_at` for sorting
193
+ ```
194
+
195
+ #### contracts/ (if API involved)
196
+
197
+ ```markdown
198
+ # API Contracts
199
+
200
+ ## POST /api/auth/register
201
+
202
+ **Request:**
203
+ ```json
204
+ {
205
+ "email": "user@example.com",
206
+ "password": "securePassword123"
207
+ }
208
+ ```
209
+
210
+ **Response (201 Created):**
211
+ ```json
212
+ {
213
+ "success": true,
214
+ "user_id": "uuid-here"
215
+ }
216
+ ```
217
+
218
+ **Response (400 Bad Request):**
219
+ ```json
220
+ {
221
+ "error": "Invalid email format"
222
+ }
223
+ ```
224
+ ```
225
+
226
+ #### research.md (if technical decisions needed)
227
+
228
+ Document decisions made during planning:
229
+ - Technology choices with rationale
230
+ - Trade-offs considered
231
+ - Alternatives evaluated
232
+
233
+ ### Phase 6: Risk Assessment
107
234
 
108
235
  For each phase, identify:
109
236
 
@@ -111,7 +238,7 @@ For each phase, identify:
111
238
  |------|--------|------------|------------|
112
239
  | (risk description) | High/Med/Low | High/Med/Low | (strategy) |
113
240
 
114
- ### Phase 4: Testing Strategy
241
+ ### Phase 7: Testing Strategy
115
242
 
116
243
  Define testing approach for each phase:
117
244
 
@@ -120,32 +247,48 @@ Define testing approach for each phase:
120
247
  - **Manual Testing**: What scenarios to validate?
121
248
  - **Regression Checks**: What existing functionality could break?
122
249
 
123
- ### Phase 5: SEO & Performance Considerations
124
-
125
- If applicable:
126
- - Core Web Vitals impact
127
- - Bundle size changes
128
- - API response times
129
- - Caching strategies
250
+ **Spec-driven validation**: Ensure all spec acceptance criteria have corresponding tests
130
251
 
131
252
  ## Output Format
132
253
 
133
- ### File: `plans/[YYYY-MM-DD]-[feature-slug].md`
254
+ ### Directory: `specs/[feature-name]/`
255
+
256
+ ```
257
+ specs/[feature-name]/
258
+ ├── spec.md # From /ai-eng/specify (if exists)
259
+ ├── plan.md # Implementation plan (this file)
260
+ ├── tasks.md # Task breakdown (optional separate file)
261
+ ├── data-model.md # Data schemas (if applicable)
262
+ ├── research.md # Technical research (if applicable)
263
+ └── contracts/ # API contracts (if applicable)
264
+ ├── api-spec.json
265
+ └── signalr-spec.md
266
+ ```
267
+
268
+ ### File: `specs/[feature-name]/plan.md`
134
269
 
135
270
  ```markdown
136
271
  # [Feature Name] Implementation Plan
137
272
 
138
273
  **Status**: Draft | In Progress | Complete
139
274
  **Created**: [date]
275
+ **Specification**: specs/[feature-name]/spec.md (if exists)
140
276
  **Estimated Effort**: [hours/days]
141
277
  **Complexity**: Low | Medium | High
142
278
 
143
279
  ## Overview
144
- [2-3 sentence summary]
280
+ [2-3 sentence summary of technical approach]
145
281
 
146
- ## Success Criteria
147
- - [ ] [Measurable outcome 1]
148
- - [ ] [Measurable outcome 2]
282
+ ## Specification Reference
283
+
284
+ [If spec exists, summarize user stories and their technical mapping]
285
+
286
+ ### User Stories → Tasks Mapping
287
+
288
+ | User Story | Tasks | Status |
289
+ |-------------|--------|--------|
290
+ | US-001 | TASK-001, TASK-002 | Pending |
291
+ | US-002 | TASK-003 | Pending |
149
292
 
150
293
  ## Architecture
151
294
  [Diagram or description of component relationships]
@@ -158,12 +301,14 @@ If applicable:
158
301
  ### Task 1.1: [Task Title]
159
302
  - **ID**: FEAT-001-A
160
303
  - **Depends On**: None
161
- - **Files**:
304
+ - **User Story**: US-001 (if from spec)
305
+ - **Files**:
162
306
  - `path/to/file.ts` (modify)
163
307
  - `path/to/new-file.ts` (create)
164
308
  - **Acceptance Criteria**:
165
309
  - [ ] Criterion 1
166
310
  - [ ] Criterion 2
311
+ - [ ] Spec AC: [Link to spec acceptance criteria]
167
312
  - [ ] Tests pass
168
313
  - **Time**: 30 min
169
314
  - **Complexity**: Low
@@ -186,17 +331,58 @@ If applicable:
186
331
  ### Unit Tests
187
332
  - [ ] Test for [component]
188
333
 
189
- ### Integration Tests
334
+ ### Integration Tests
190
335
  - [ ] Test [interaction]
191
336
 
337
+ ### Spec Validation
338
+ - [ ] All user stories have corresponding tasks
339
+ - [ ] All spec acceptance criteria are covered by task acceptance criteria
340
+ - [ ] Non-functional requirements are implemented
341
+
192
342
  ## Rollback Plan
193
343
  [How to revert if something goes wrong]
194
344
 
195
345
  ## References
196
- - [Link to relevant docs]
346
+ - [Link to specification] (if exists)
347
+ - [Link to research findings]
197
348
  - [Link to similar implementations]
198
349
  ```
199
350
 
351
+ ### Optional: Separate tasks.md
352
+
353
+ If tasks.md is generated separately:
354
+
355
+ ```markdown
356
+ # [Feature Name] Tasks
357
+
358
+ ## Task List
359
+
360
+ ### PRIORITY TRACK - Can execute in parallel
361
+ - [ ] TASK-001
362
+ - [ ] TASK-002
363
+
364
+ ### TRACK - After PRIORITY TRACK completes
365
+ - [ ] TASK-003
366
+ - [ ] TASK-004
367
+
368
+ ## Task Details
369
+
370
+ ### TASK-001: [Task Title]
371
+ **ID**: TASK-001
372
+ **User Story**: US-001
373
+ **Depends On**: None
374
+ **Estimated**: 30 min
375
+ **Status**: Pending | In Progress | Complete
376
+
377
+ #### Acceptance Criteria
378
+ - [ ] [Criterion 1]
379
+ - [ ] [Criterion 2]
380
+
381
+ #### Files
382
+ - `file1.ts` (create)
383
+ - `file2.ts` (modify)
384
+ ```
385
+
200
386
  ## Post-Planning Actions
201
387
 
202
388
  After generating the plan:
@@ -205,6 +391,7 @@ After generating the plan:
205
391
  2. **Create GitHub issue** (optional) - Link to plan file
206
392
  3. **Estimate total effort** - Sum of all task estimates
207
393
  4. **Identify parallel tracks** - Tasks without dependencies that can run concurrently
394
+ 5. **Validate spec coverage** (if spec exists) - Ensure all spec requirements are covered
208
395
 
209
396
  ## Tips for Effective Plans
210
397
 
@@ -213,3 +400,77 @@ After generating the plan:
213
400
  - **Checkpoints**: Each phase should end with a working (possibly incomplete) state
214
401
  - **Escape hatches**: Note where you could stop and still have value
215
402
  - **Evidence-based**: Include file paths and code snippets from discovery
403
+ - **Spec-driven**: Ensure all spec acceptance criteria have corresponding task acceptance criteria
404
+
405
+ ## Integration
406
+
407
+ ### Feeds Into
408
+ - `/ai-eng/work` - Reads plan.md for task execution
409
+ - Validates task completion against spec.md acceptance criteria
410
+
411
+ ### Reads From
412
+ - `specs/[feature]/spec.md` - User stories, acceptance criteria, NFRs
413
+ - `CLAUDE.md` - Project philosophy and constraints
414
+ - `docs/research/*.md` - Optional research context
415
+
416
+ ## Example Usage
417
+
418
+ ### Example 1: Plan from Existing Spec
419
+
420
+ ```bash
421
+ # User provides feature name (spec already exists)
422
+ /ai-eng/plan --from-spec=specs/auth
423
+
424
+ # Step 0: Prompt refinement skill asks planning-specific questions
425
+ # Step 1: Loads spec from specs/auth/spec.md
426
+ # Step 2: Maps user stories to technical tasks
427
+ # Step 3: Generates plan.md, data-model.md, contracts/
428
+ # Step 4: Validates spec coverage
429
+ ```
430
+
431
+ ### Example 2: Plan Without Spec (Inline)
432
+
433
+ ```bash
434
+ # User provides description without spec
435
+ /ai-eng/plan "implement JWT-based authentication"
436
+
437
+ # Step 0: Prompt refinement asks planning questions
438
+ # Step 1: Warns about missing spec, offers to proceed
439
+ # Step 2: Gathers requirements through clarification
440
+ # Step 3: Generates plan.md
441
+ ```
442
+
443
+ ## Best Practices
444
+
445
+ ### Spec-Driven Planning
446
+
447
+ When specification exists:
448
+ 1. **Map each user story to tasks**: Don't miss any requirements
449
+ 2. **Trace acceptance criteria**: Each spec AC should have task AC
450
+ 3. **Document decisions**: Why specific tech choices were made
451
+ 4. **Mark dependencies**: Which tasks must come before others
452
+
453
+ ### Cross-Reference
454
+
455
+ Always cross-reference between artifacts:
456
+ - Tasks reference user stories (US-001)
457
+ - Acceptance criteria reference spec acceptance criteria (AC-2)
458
+ - Data models reference user story requirements
459
+
460
+ ### Task Independence
461
+
462
+ Ensure tasks are truly atomic:
463
+ - Can you complete it without touching unfinished sibling tasks?
464
+ - Is it testable in isolation?
465
+ - Does it have clear start and end states?
466
+
467
+ ## Success Criteria
468
+
469
+ Successful planning achieves:
470
+ - ✅ All tasks are atomic and independently completable
471
+ - ✅ Dependencies are clearly documented
472
+ - ✅ All spec acceptance criteria are covered (if spec exists)
473
+ - ✅ Supporting artifacts generated (data-model, contracts)
474
+ - ✅ Risk assessment completed
475
+ - ✅ Testing strategy defined
476
+ - ✅ Ready to feed into `/ai-eng/work`
@@ -33,6 +33,9 @@ outputs:
33
33
 
34
34
  Conduct comprehensive research for: $ARGUMENTS
35
35
 
36
+ > **Phase 1 of Spec-Driven Workflow**: Research → Specify → Plan → Work → Review
37
+ > See: [GitHub's spec-driven development methodology](https://github.blog/ai-and-ml/generative-ai/spec-driven-development-with-ai-get-started-with-a-new-open-source-toolkit/)
38
+
36
39
  ## Usage
37
40
 
38
41
  ```bash
@@ -47,8 +50,17 @@ Conduct comprehensive research for: $ARGUMENTS
47
50
  - `-o, --output <file>`: Output file path
48
51
  - `-f, --format <format>`: Export format (markdown|json|html) [default: markdown]
49
52
  - `--no-cache`: Disable research caching
53
+ - `--feed-into <command>`: After research, invoke specified command with research context (specify|plan)
50
54
  - `-v, --verbose`: Enable verbose output
51
55
 
56
+ ## Process
57
+
58
+ ### Phase 0: Prompt Refinement
59
+ Use skill: `prompt-refinement`
60
+ Phase: `research`
61
+
62
+ [The prompt-refinement skill will transform your input into a structured TCRO format by asking clarifying questions about research scope, sources, depth, and deliverable format.]
63
+
52
64
  ## Expert Context
53
65
 
54
66
  You are a senior research analyst with 15+ years of experience at companies like Google, Stripe, and Netflix. Your expertise is in systematic investigation, pattern recognition, and synthesizing complex information into actionable insights. This research is critical to the project's success.
@@ -196,4 +208,33 @@ Save research document to `docs/research/[date]-[topic-slug].md`
196
208
 
197
209
  Rate your confidence in the research findings (0-1) and identify any assumptions or limitations.
198
210
 
211
+ ## Integration
212
+
213
+ ### Feeds Into
214
+ - `/ai-eng/specify` - Use `--feed-into=specify` to pass research findings to specification phase
215
+ - `/ai-eng/plan` - Use `--feed-into=plan` to pass research findings directly to planning
216
+
217
+ ### Feed-Into Workflow
218
+
219
+ When `--feed-into` is used:
220
+
221
+ 1. **Save research document** to standard location
222
+ 2. **Load research findings** as context for target command
223
+ 3. **Pass research path** to target command automatically
224
+
225
+ Example:
226
+ ```bash
227
+ # Research that feeds into specification
228
+ /ai-eng/research "authentication patterns" --feed-into=specify
229
+
230
+ # This:
231
+ # 1. Completes research phase
232
+ # 2. Saves to docs/research/[date]-auth-patterns.md
233
+ # 3. Automatically invokes /ai-eng/specify --from-research=docs/research/[date]-auth-patterns.md
234
+ ```
235
+
236
+ The target command will receive the research findings in its context, eliminating the need to manually copy-paste research results.
237
+
238
+ Rate your confidence in the research findings (0-1) and identify any assumptions or limitations.
239
+
199
240
  $ARGUMENTS