@orderful/droid 0.25.2 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +114 -0
- package/.github/workflows/ci.yml +20 -0
- package/AGENTS.md +53 -0
- package/CHANGELOG.md +44 -0
- package/README.md +30 -4
- package/dist/bin/droid.js +62 -51
- package/dist/index.js +9 -1
- package/dist/lib/skill-config.d.ts.map +1 -1
- package/dist/tools/README.md +1 -1
- package/dist/tools/brain/.claude-plugin/plugin.json +16 -0
- package/dist/tools/brain/commands/brain.md +1 -1
- package/dist/tools/brain/commands/scratchpad.md +1 -1
- package/dist/tools/brain/skills/droid-brain/SKILL.md +1 -1
- package/dist/tools/brain/skills/droid-brain-obsidian/SKILL.md +1 -1
- package/dist/tools/coach/.claude-plugin/plugin.json +16 -0
- package/dist/tools/coach/commands/coach.md +1 -1
- package/dist/tools/coach/skills/droid-coach/SKILL.md +1 -1
- package/dist/tools/code-review/.claude-plugin/plugin.json +16 -0
- package/dist/tools/code-review/commands/code-review.md +1 -1
- package/dist/tools/code-review/skills/droid-code-review/SKILL.md +1 -1
- package/dist/tools/codex/.claude-plugin/plugin.json +16 -0
- package/dist/tools/codex/TOOL.yaml +2 -2
- package/dist/tools/codex/commands/codex.md +1 -1
- package/dist/tools/codex/skills/droid-codex/SKILL.md +1 -1
- package/dist/tools/comments/.claude-plugin/plugin.json +16 -0
- package/dist/tools/comments/commands/comments.md +1 -1
- package/dist/tools/comments/skills/droid-comments/SKILL.md +1 -1
- package/dist/tools/droid/.claude-plugin/plugin.json +15 -0
- package/dist/tools/droid/TOOL.yaml +1 -1
- package/dist/tools/droid/skills/droid/SKILL.md +1 -1
- package/dist/tools/project/.claude-plugin/plugin.json +16 -0
- package/dist/tools/project/commands/project.md +1 -1
- package/dist/tools/project/skills/droid-project/SKILL.md +1 -1
- package/dist/tools/tech-design/.claude-plugin/plugin.json +16 -0
- package/dist/tools/tech-design/TOOL.yaml +18 -0
- package/dist/tools/tech-design/commands/tech-design.md +93 -0
- package/dist/tools/tech-design/skills/droid-tech-design/SKILL.md +218 -0
- package/dist/tools/tech-design/skills/droid-tech-design/references/draft.md +321 -0
- package/dist/tools/tech-design/skills/droid-tech-design/references/gaps.md +328 -0
- package/dist/tools/tech-design/skills/droid-tech-design/references/publish.md +409 -0
- package/dist/tools/tech-design/skills/droid-tech-design/references/research-doc-template.md +129 -0
- package/dist/tools/tech-design/skills/droid-tech-design/references/rollup-template.md +55 -0
- package/dist/tools/tech-design/skills/droid-tech-design/references/start.md +353 -0
- package/dist/tools/tech-design/skills/droid-tech-design/references/think.md +356 -0
- package/dist/tools/tech-design/skills/droid-tech-design/references/thought-doc-template.md +72 -0
- package/package.json +3 -2
- package/scripts/build-plugins.ts +207 -0
- package/src/lib/skill-config.ts +95 -57
- package/src/lib/skills.ts +2 -2
- package/src/tools/README.md +1 -1
- package/src/tools/brain/.claude-plugin/plugin.json +16 -0
- package/src/tools/brain/commands/brain.md +1 -1
- package/src/tools/brain/commands/scratchpad.md +1 -1
- package/src/tools/brain/skills/droid-brain/SKILL.md +1 -1
- package/src/tools/brain/skills/droid-brain-obsidian/SKILL.md +1 -1
- package/src/tools/coach/.claude-plugin/plugin.json +16 -0
- package/src/tools/coach/commands/coach.md +1 -1
- package/src/tools/coach/skills/droid-coach/SKILL.md +1 -1
- package/src/tools/code-review/.claude-plugin/plugin.json +16 -0
- package/src/tools/code-review/commands/code-review.md +1 -1
- package/src/tools/code-review/skills/droid-code-review/SKILL.md +1 -1
- package/src/tools/codex/.claude-plugin/plugin.json +16 -0
- package/src/tools/codex/TOOL.yaml +2 -2
- package/src/tools/codex/commands/codex.md +1 -1
- package/src/tools/codex/skills/droid-codex/SKILL.md +1 -1
- package/src/tools/comments/.claude-plugin/plugin.json +16 -0
- package/src/tools/comments/commands/comments.md +1 -1
- package/src/tools/comments/skills/droid-comments/SKILL.md +1 -1
- package/src/tools/droid/.claude-plugin/plugin.json +15 -0
- package/src/tools/droid/TOOL.yaml +1 -1
- package/src/tools/droid/skills/droid/SKILL.md +1 -1
- package/src/tools/project/.claude-plugin/plugin.json +16 -0
- package/src/tools/project/commands/project.md +1 -1
- package/src/tools/project/skills/droid-project/SKILL.md +1 -1
- package/src/tools/tech-design/.claude-plugin/plugin.json +16 -0
- package/src/tools/tech-design/TOOL.yaml +18 -0
- package/src/tools/tech-design/commands/tech-design.md +93 -0
- package/src/tools/tech-design/skills/droid-tech-design/SKILL.md +218 -0
- package/src/tools/tech-design/skills/droid-tech-design/references/draft.md +321 -0
- package/src/tools/tech-design/skills/droid-tech-design/references/gaps.md +328 -0
- package/src/tools/tech-design/skills/droid-tech-design/references/publish.md +409 -0
- package/src/tools/tech-design/skills/droid-tech-design/references/research-doc-template.md +129 -0
- package/src/tools/tech-design/skills/droid-tech-design/references/rollup-template.md +55 -0
- package/src/tools/tech-design/skills/droid-tech-design/references/start.md +353 -0
- package/src/tools/tech-design/skills/droid-tech-design/references/think.md +356 -0
- package/src/tools/tech-design/skills/droid-tech-design/references/thought-doc-template.md +72 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
# Drafting Content
|
|
2
|
+
|
|
3
|
+
**Trigger:** `/tech-design draft [section]` or user wants to generate content
|
|
4
|
+
|
|
5
|
+
**Goal:** Use research doc as knowledge base, do additional exploration if needed, draft content into thought doc.
|
|
6
|
+
|
|
7
|
+
**Security Note:** All user-provided inputs must be validated before use in shell commands. File paths and search patterns should be sanitized to prevent command injection.
|
|
8
|
+
|
|
9
|
+
## Procedure
|
|
10
|
+
|
|
11
|
+
### 1. Determine Scope
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
if [ -z "$section" ]; then
|
|
15
|
+
# Whole doc - draft all three initial sections
|
|
16
|
+
sections=("Background" "Proposal" "Open Questions")
|
|
17
|
+
else
|
|
18
|
+
# Specific section
|
|
19
|
+
sections=("$section")
|
|
20
|
+
fi
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 2. Load Research Doc
|
|
24
|
+
|
|
25
|
+
**Research doc should exist** - created during `/tech-design start`.
|
|
26
|
+
|
|
27
|
+
- Read research doc: `tech-design-{project}-research.md`
|
|
28
|
+
- Extract relevant findings for the section being drafted
|
|
29
|
+
- Use as knowledge base to inform draft
|
|
30
|
+
|
|
31
|
+
**If research doc missing:**
|
|
32
|
+
|
|
33
|
+
- Warn user: "Research doc not found. Run `/tech-design start` first to create research + thought docs."
|
|
34
|
+
- Option to continue without research context
|
|
35
|
+
|
|
36
|
+
### 3. Section-Specific Drafting
|
|
37
|
+
|
|
38
|
+
For each section, use research doc findings and do additional exploration as needed.
|
|
39
|
+
|
|
40
|
+
#### Background Section
|
|
41
|
+
|
|
42
|
+
**Sources:**
|
|
43
|
+
|
|
44
|
+
- PRD context from research doc → "Codex Context" section
|
|
45
|
+
- Current state from research doc → "Similar Implementations"
|
|
46
|
+
|
|
47
|
+
**Draft structure:**
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+
## Background
|
|
51
|
+
|
|
52
|
+
### Problem
|
|
53
|
+
|
|
54
|
+
{Why we're doing this - from PRD in research doc}
|
|
55
|
+
|
|
56
|
+
### Current State
|
|
57
|
+
|
|
58
|
+
{What exists today - from research doc discoveries}
|
|
59
|
+
|
|
60
|
+
Reference findings from research:
|
|
61
|
+
|
|
62
|
+
- Existing pattern: {file path from research}
|
|
63
|
+
- Current approach: {description from research}
|
|
64
|
+
|
|
65
|
+
### Context
|
|
66
|
+
|
|
67
|
+
{Who needs this and why - from PRD}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
#### Proposal Section
|
|
71
|
+
|
|
72
|
+
**Sources:**
|
|
73
|
+
|
|
74
|
+
- Architecture patterns from research doc
|
|
75
|
+
- Integration points from research doc
|
|
76
|
+
- Dependencies from research doc
|
|
77
|
+
- Additional codebase exploration if needed
|
|
78
|
+
|
|
79
|
+
**Draft structure:**
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
## Proposal
|
|
83
|
+
|
|
84
|
+
### Overview
|
|
85
|
+
|
|
86
|
+
{High-level approach - informed by patterns in research doc}
|
|
87
|
+
|
|
88
|
+
### Architecture
|
|
89
|
+
|
|
90
|
+
{How it fits - reference integration points from research}
|
|
91
|
+
|
|
92
|
+
Follows pattern from: {file path from research doc}
|
|
93
|
+
Integrates with: {modules/services from research doc}
|
|
94
|
+
|
|
95
|
+
### Data Model
|
|
96
|
+
|
|
97
|
+
{Tables, schemas, types needed}
|
|
98
|
+
|
|
99
|
+
### API Surface
|
|
100
|
+
|
|
101
|
+
{New endpoints, methods, interfaces}
|
|
102
|
+
|
|
103
|
+
### Implementation Approach
|
|
104
|
+
|
|
105
|
+
{Step-by-step - leverage dependencies already identified in research}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Additional exploration:**
|
|
109
|
+
|
|
110
|
+
- If research doc doesn't have enough detail for a subsection, explore further
|
|
111
|
+
- Add new discoveries back to research doc
|
|
112
|
+
- Keep research doc as living knowledge base
|
|
113
|
+
|
|
114
|
+
#### Open Questions Section
|
|
115
|
+
|
|
116
|
+
**Sources:**
|
|
117
|
+
|
|
118
|
+
- Scan PRD for ambiguous requirements
|
|
119
|
+
- Gaps identified during proposal drafting
|
|
120
|
+
- Missing information from research phase
|
|
121
|
+
|
|
122
|
+
**Draft structure:**
|
|
123
|
+
|
|
124
|
+
```markdown
|
|
125
|
+
## Open Questions
|
|
126
|
+
|
|
127
|
+
- [ ] {Question from PRD ambiguity}
|
|
128
|
+
- [ ] {Question from technical exploration}
|
|
129
|
+
- [ ] {Question about integration - e.g., "How should X handle Y?"}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### 4. Write to Thought Doc
|
|
133
|
+
|
|
134
|
+
- Read existing thought doc
|
|
135
|
+
- Replace or populate the section being drafted
|
|
136
|
+
- Preserve any existing `@droid`/`@{user}` comments
|
|
137
|
+
- Keep content outside the target section unchanged
|
|
138
|
+
|
|
139
|
+
### 5. Output Summary
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
✓ Drafted: {section}
|
|
143
|
+
|
|
144
|
+
Key points from research doc:
|
|
145
|
+
• {Finding 1 referenced}
|
|
146
|
+
• {Finding 2 referenced}
|
|
147
|
+
|
|
148
|
+
{If additional exploration was done:}
|
|
149
|
+
Additional discoveries:
|
|
150
|
+
• {New finding}
|
|
151
|
+
• {Added to research doc}
|
|
152
|
+
|
|
153
|
+
Next steps:
|
|
154
|
+
• Review and refine: Open {thought_doc_path}
|
|
155
|
+
• Draft another section: /tech-design draft {section-name}
|
|
156
|
+
• Explore an idea: /tech-design think {topic}
|
|
157
|
+
• Check completeness: /tech-design gaps
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Section-Specific Guidance
|
|
161
|
+
|
|
162
|
+
### Rollout Plan
|
|
163
|
+
|
|
164
|
+
**Research doc reference:**
|
|
165
|
+
|
|
166
|
+
- Deployment patterns
|
|
167
|
+
- Feature flag setup (if found)
|
|
168
|
+
- Monitoring/observability setup
|
|
169
|
+
|
|
170
|
+
**Explore if needed:**
|
|
171
|
+
|
|
172
|
+
- How are similar features rolled out?
|
|
173
|
+
- What rollback mechanisms exist?
|
|
174
|
+
|
|
175
|
+
**Draft:**
|
|
176
|
+
|
|
177
|
+
```markdown
|
|
178
|
+
## Rollout Plan
|
|
179
|
+
|
|
180
|
+
### Phases
|
|
181
|
+
|
|
182
|
+
| Phase | Audience | Timeline | Success Criteria |
|
|
183
|
+
| ----- | -------- | -------- | ---------------- |
|
|
184
|
+
| 1 | ... | ... | ... |
|
|
185
|
+
|
|
186
|
+
### Feature Flags
|
|
187
|
+
|
|
188
|
+
{Based on feature flag patterns from research}
|
|
189
|
+
|
|
190
|
+
### Rollback Strategy
|
|
191
|
+
|
|
192
|
+
{Based on deployment patterns from research}
|
|
193
|
+
|
|
194
|
+
### Monitoring
|
|
195
|
+
|
|
196
|
+
{Based on observability setup from research}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Data Model
|
|
200
|
+
|
|
201
|
+
**Research doc reference:**
|
|
202
|
+
|
|
203
|
+
- Existing database/storage patterns
|
|
204
|
+
- Schema conventions
|
|
205
|
+
- ORM/database tooling used
|
|
206
|
+
|
|
207
|
+
**Explore if needed:**
|
|
208
|
+
|
|
209
|
+
- Similar data models in codebase
|
|
210
|
+
- Migration patterns
|
|
211
|
+
|
|
212
|
+
**Draft:**
|
|
213
|
+
|
|
214
|
+
```markdown
|
|
215
|
+
## Data Model
|
|
216
|
+
|
|
217
|
+
### Entities
|
|
218
|
+
|
|
219
|
+
{Based on patterns from research doc}
|
|
220
|
+
|
|
221
|
+
### Relationships
|
|
222
|
+
|
|
223
|
+
{How entities relate}
|
|
224
|
+
|
|
225
|
+
### Migrations
|
|
226
|
+
|
|
227
|
+
{Following migration pattern from research}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### API Surface
|
|
231
|
+
|
|
232
|
+
**Research doc reference:**
|
|
233
|
+
|
|
234
|
+
- Existing API patterns (REST, GraphQL, gRPC, etc.)
|
|
235
|
+
- Authentication/authorization patterns
|
|
236
|
+
- Rate limiting setup
|
|
237
|
+
|
|
238
|
+
**Explore if needed:**
|
|
239
|
+
|
|
240
|
+
- Similar endpoint implementations
|
|
241
|
+
- Validation patterns
|
|
242
|
+
|
|
243
|
+
**Draft:**
|
|
244
|
+
|
|
245
|
+
```markdown
|
|
246
|
+
## API Surface
|
|
247
|
+
|
|
248
|
+
### Endpoints
|
|
249
|
+
|
|
250
|
+
{Following API pattern from research}
|
|
251
|
+
|
|
252
|
+
### Authentication
|
|
253
|
+
|
|
254
|
+
{Using auth pattern from research}
|
|
255
|
+
|
|
256
|
+
### Validation
|
|
257
|
+
|
|
258
|
+
{Based on validation patterns found}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Security Considerations
|
|
262
|
+
|
|
263
|
+
**Research doc reference:**
|
|
264
|
+
|
|
265
|
+
- Auth patterns
|
|
266
|
+
- Input validation setup
|
|
267
|
+
- Audit logging
|
|
268
|
+
|
|
269
|
+
**Explore if needed:**
|
|
270
|
+
|
|
271
|
+
- How are similar features secured?
|
|
272
|
+
- What security reviews exist?
|
|
273
|
+
|
|
274
|
+
**Draft:**
|
|
275
|
+
|
|
276
|
+
```markdown
|
|
277
|
+
## Security Considerations
|
|
278
|
+
|
|
279
|
+
### Authentication & Authorization
|
|
280
|
+
|
|
281
|
+
{Based on auth patterns from research}
|
|
282
|
+
|
|
283
|
+
### Input Validation
|
|
284
|
+
|
|
285
|
+
{Based on validation patterns from research}
|
|
286
|
+
|
|
287
|
+
### Audit Logging
|
|
288
|
+
|
|
289
|
+
{Based on logging patterns from research}
|
|
290
|
+
|
|
291
|
+
### Risk Assessment
|
|
292
|
+
|
|
293
|
+
| Risk | Mitigation |
|
|
294
|
+
| ---- | ---------- |
|
|
295
|
+
| ... | ... |
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Error Handling
|
|
299
|
+
|
|
300
|
+
- **Thought doc not found:** Remind user to run `/tech-design start` first
|
|
301
|
+
- **Research doc not found:** Warn but offer to continue with limited context
|
|
302
|
+
- **Section not recognized:** List valid sections, suggest `/tech-design gaps` to see what's missing
|
|
303
|
+
- **Exploration fails:** Gracefully continue, note what couldn't be found
|
|
304
|
+
|
|
305
|
+
## Example Output
|
|
306
|
+
|
|
307
|
+
```
|
|
308
|
+
✓ Loaded research doc for transaction-templates
|
|
309
|
+
|
|
310
|
+
✓ Drafted: Proposal
|
|
311
|
+
|
|
312
|
+
Key points from research doc:
|
|
313
|
+
• Template storage pattern: Found in {file path}
|
|
314
|
+
• Validation service: Integration point at {module}
|
|
315
|
+
• Dependencies: {library} already available
|
|
316
|
+
|
|
317
|
+
Next steps:
|
|
318
|
+
• Review and refine: Open {brain_dir}/0-Inbox/plans/tech-design-transaction-templates.md
|
|
319
|
+
• Draft another section: /tech-design draft rollout
|
|
320
|
+
• Check completeness: /tech-design gaps
|
|
321
|
+
```
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
# Gap Analysis
|
|
2
|
+
|
|
3
|
+
**Trigger:** `/tech-design gaps` or user asks "what's missing?"
|
|
4
|
+
|
|
5
|
+
**Goal:** Show checklist of sections that are empty or missing. Offer `/think` for each.
|
|
6
|
+
|
|
7
|
+
## Procedure
|
|
8
|
+
|
|
9
|
+
### 1. Read Thought Doc
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
thought_doc=$(cat "$thought_doc_path")
|
|
13
|
+
|
|
14
|
+
# Parse sections (lines starting with ##)
|
|
15
|
+
sections=$(grep "^## " "$thought_doc_path" | sed 's/^## //')
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### 2. Define Expected Sections
|
|
19
|
+
|
|
20
|
+
**Core sections** (always check):
|
|
21
|
+
|
|
22
|
+
- Background
|
|
23
|
+
- Proposal
|
|
24
|
+
- Open Questions
|
|
25
|
+
|
|
26
|
+
**Common sections** (check if relevant):
|
|
27
|
+
|
|
28
|
+
- Scope / Non-goals
|
|
29
|
+
- Data Model
|
|
30
|
+
- API Surface
|
|
31
|
+
- Implementation Plan
|
|
32
|
+
- Key Decisions
|
|
33
|
+
- Trade-off Analysis
|
|
34
|
+
- Risks & Mitigations
|
|
35
|
+
- Metrics
|
|
36
|
+
- Rollout Plan
|
|
37
|
+
- Security Considerations
|
|
38
|
+
|
|
39
|
+
### 3. Identify Gaps
|
|
40
|
+
|
|
41
|
+
**A section is "empty" if:**
|
|
42
|
+
|
|
43
|
+
- It exists as a header but has no content
|
|
44
|
+
- Content is just placeholders like `{Why we're doing this}`
|
|
45
|
+
- Content is < 50 characters (likely just template)
|
|
46
|
+
|
|
47
|
+
**A section is "missing" if:**
|
|
48
|
+
|
|
49
|
+
- Not present in thought doc at all
|
|
50
|
+
- Likely needed based on PRD/project type
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# For each expected section:
|
|
54
|
+
if ! section_exists; then
|
|
55
|
+
missing+=("$section")
|
|
56
|
+
elif section_is_empty; then
|
|
57
|
+
empty+=("$section")
|
|
58
|
+
else
|
|
59
|
+
complete+=("$section")
|
|
60
|
+
fi
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 4. Determine Importance
|
|
64
|
+
|
|
65
|
+
**Critical** (should have before publishing):
|
|
66
|
+
|
|
67
|
+
- Background
|
|
68
|
+
- Proposal
|
|
69
|
+
- Risks & Mitigations
|
|
70
|
+
- Rollout Plan (for user-facing features)
|
|
71
|
+
- Security Considerations (if handling user input or sensitive data)
|
|
72
|
+
|
|
73
|
+
**Important** (nice to have):
|
|
74
|
+
|
|
75
|
+
- Scope / Non-goals
|
|
76
|
+
- Data Model (if schema changes)
|
|
77
|
+
- API Surface (if new endpoints)
|
|
78
|
+
- Implementation Plan
|
|
79
|
+
- Key Decisions
|
|
80
|
+
|
|
81
|
+
**Optional** (can skip or keep light):
|
|
82
|
+
|
|
83
|
+
- Metrics (can be in thought doc only)
|
|
84
|
+
- Trade-off Analysis (can be implicit in Decisions)
|
|
85
|
+
|
|
86
|
+
### 5. Infer from Project Context
|
|
87
|
+
|
|
88
|
+
**Check PRD for clues:**
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# If PRD mentions "API", mark API Surface as important
|
|
92
|
+
grep -i "API\|endpoint\|REST" "$prd_path" && api_needed=true
|
|
93
|
+
|
|
94
|
+
# If PRD mentions "database", mark Data Model as important
|
|
95
|
+
grep -i "database\|schema\|table\|entity" "$prd_path" && data_model_needed=true
|
|
96
|
+
|
|
97
|
+
# If PRD mentions "security\|auth\|permission", mark Security as critical
|
|
98
|
+
grep -i "security\|auth\|permission\|sensitive" "$prd_path" && security_critical=true
|
|
99
|
+
|
|
100
|
+
# If user-facing, rollout is critical
|
|
101
|
+
grep -i "user\|customer\|partner" "$prd_path" && rollout_critical=true
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 6. Output Checklist
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
echo "📋 Tech Design Gaps Analysis"
|
|
108
|
+
echo ""
|
|
109
|
+
|
|
110
|
+
if [ ${#complete[@]} -gt 0 ]; then
|
|
111
|
+
echo "✓ Complete:"
|
|
112
|
+
for section in "${complete[@]}"; do
|
|
113
|
+
echo " • $section"
|
|
114
|
+
done
|
|
115
|
+
echo ""
|
|
116
|
+
fi
|
|
117
|
+
|
|
118
|
+
if [ ${#empty[@]} -gt 0 ]; then
|
|
119
|
+
echo "⚠️ Started but empty:"
|
|
120
|
+
for section in "${empty[@]}"; do
|
|
121
|
+
criticality=$(get_criticality "$section")
|
|
122
|
+
echo " • $section [$criticality]"
|
|
123
|
+
done
|
|
124
|
+
echo ""
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
if [ ${#missing[@]} -gt 0 ]; then
|
|
128
|
+
echo "❌ Missing:"
|
|
129
|
+
for section in "${missing[@]}"; do
|
|
130
|
+
criticality=$(get_criticality "$section")
|
|
131
|
+
echo " • $section [$criticality]"
|
|
132
|
+
done
|
|
133
|
+
echo ""
|
|
134
|
+
fi
|
|
135
|
+
|
|
136
|
+
echo "Next steps:"
|
|
137
|
+
echo " • Work through a section: /tech-design think rollout"
|
|
138
|
+
echo " • Draft a section: /tech-design draft data-model"
|
|
139
|
+
echo " • Natural language also works: \"Let's think through the rollout plan\""
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### 7. Offer Guided Walkthrough
|
|
143
|
+
|
|
144
|
+
If multiple critical sections missing:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
echo ""
|
|
148
|
+
echo "Want me to walk you through these? I can:"
|
|
149
|
+
echo " 1. Guide you through each critical section"
|
|
150
|
+
echo " 2. Let you pick which to work on"
|
|
151
|
+
echo " 3. Just show the list (already done)"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
If user chooses option 1, run `/tech-design think` for each critical section in order.
|
|
155
|
+
|
|
156
|
+
## Section Criticality Logic
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
function get_criticality() {
|
|
160
|
+
local section=$1
|
|
161
|
+
|
|
162
|
+
case "$section" in
|
|
163
|
+
"Background"|"Proposal")
|
|
164
|
+
echo "CRITICAL"
|
|
165
|
+
;;
|
|
166
|
+
"Risks & Mitigations")
|
|
167
|
+
echo "CRITICAL"
|
|
168
|
+
;;
|
|
169
|
+
"Security Considerations")
|
|
170
|
+
# Critical if handling user input or sensitive data
|
|
171
|
+
if grep -qi "input\|user.*data\|sensitive\|auth" "$prd_path" 2>/dev/null; then
|
|
172
|
+
echo "CRITICAL"
|
|
173
|
+
else
|
|
174
|
+
echo "IMPORTANT"
|
|
175
|
+
fi
|
|
176
|
+
;;
|
|
177
|
+
"Rollout Plan")
|
|
178
|
+
# Critical if user-facing
|
|
179
|
+
if grep -qi "user\|customer\|partner" "$prd_path" 2>/dev/null; then
|
|
180
|
+
echo "CRITICAL"
|
|
181
|
+
else
|
|
182
|
+
echo "IMPORTANT"
|
|
183
|
+
fi
|
|
184
|
+
;;
|
|
185
|
+
"Data Model")
|
|
186
|
+
# Important if PRD mentions database
|
|
187
|
+
if grep -qi "database\|schema\|table" "$prd_path" 2>/dev/null; then
|
|
188
|
+
echo "IMPORTANT"
|
|
189
|
+
else
|
|
190
|
+
echo "OPTIONAL"
|
|
191
|
+
fi
|
|
192
|
+
;;
|
|
193
|
+
"API Surface")
|
|
194
|
+
# Important if PRD mentions API
|
|
195
|
+
if grep -qi "API\|endpoint\|REST" "$prd_path" 2>/dev/null; then
|
|
196
|
+
echo "IMPORTANT"
|
|
197
|
+
else
|
|
198
|
+
echo "OPTIONAL"
|
|
199
|
+
fi
|
|
200
|
+
;;
|
|
201
|
+
"Scope / Non-goals"|"Implementation Plan"|"Key Decisions")
|
|
202
|
+
echo "IMPORTANT"
|
|
203
|
+
;;
|
|
204
|
+
*)
|
|
205
|
+
echo "OPTIONAL"
|
|
206
|
+
;;
|
|
207
|
+
esac
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Example Output (Early Stage)
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
📋 Tech Design Gaps Analysis
|
|
215
|
+
|
|
216
|
+
✓ Complete:
|
|
217
|
+
• Background
|
|
218
|
+
• Open Questions
|
|
219
|
+
|
|
220
|
+
⚠️ Started but empty:
|
|
221
|
+
• Proposal [CRITICAL]
|
|
222
|
+
|
|
223
|
+
❌ Missing:
|
|
224
|
+
• Scope / Non-goals [IMPORTANT]
|
|
225
|
+
• Data Model [IMPORTANT] (PRD mentions database schema)
|
|
226
|
+
• API Surface [IMPORTANT] (PRD mentions REST endpoints)
|
|
227
|
+
• Risks & Mitigations [CRITICAL]
|
|
228
|
+
• Rollout Plan [CRITICAL] (user-facing feature)
|
|
229
|
+
• Security Considerations [CRITICAL] (handles user input)
|
|
230
|
+
• Implementation Plan [IMPORTANT]
|
|
231
|
+
• Key Decisions [IMPORTANT]
|
|
232
|
+
|
|
233
|
+
Next steps:
|
|
234
|
+
• Work through a section: /tech-design think rollout
|
|
235
|
+
• Draft a section: /tech-design draft data-model
|
|
236
|
+
• Natural language also works: "Let's think through the rollout plan"
|
|
237
|
+
|
|
238
|
+
Want me to walk you through these? I can:
|
|
239
|
+
1. Guide you through each critical section
|
|
240
|
+
2. Let you pick which to work on
|
|
241
|
+
3. Just show the list (already done)
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Example Output (Nearly Complete)
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
📋 Tech Design Gaps Analysis
|
|
248
|
+
|
|
249
|
+
✓ Complete:
|
|
250
|
+
• Background
|
|
251
|
+
• Proposal
|
|
252
|
+
• Scope / Non-goals
|
|
253
|
+
• Data Model
|
|
254
|
+
• API Surface
|
|
255
|
+
• Risks & Mitigations
|
|
256
|
+
• Rollout Plan
|
|
257
|
+
• Security Considerations
|
|
258
|
+
• Implementation Plan
|
|
259
|
+
|
|
260
|
+
⚠️ Started but empty:
|
|
261
|
+
• Key Decisions [IMPORTANT]
|
|
262
|
+
|
|
263
|
+
❌ Missing:
|
|
264
|
+
• Metrics [OPTIONAL]
|
|
265
|
+
• Trade-off Analysis [OPTIONAL]
|
|
266
|
+
|
|
267
|
+
Looking good! Just need to document your key decisions.
|
|
268
|
+
|
|
269
|
+
Next steps:
|
|
270
|
+
• Add key decisions: /tech-design think decisions
|
|
271
|
+
• Ready to publish: /tech-design publish
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Example Output (Ready to Publish)
|
|
275
|
+
|
|
276
|
+
```
|
|
277
|
+
📋 Tech Design Gaps Analysis
|
|
278
|
+
|
|
279
|
+
✓ Complete:
|
|
280
|
+
• Background
|
|
281
|
+
• Proposal
|
|
282
|
+
• Scope / Non-goals
|
|
283
|
+
• Data Model
|
|
284
|
+
• API Surface
|
|
285
|
+
• Risks & Mitigations
|
|
286
|
+
• Rollout Plan
|
|
287
|
+
• Security Considerations
|
|
288
|
+
• Implementation Plan
|
|
289
|
+
• Key Decisions
|
|
290
|
+
|
|
291
|
+
❌ Missing:
|
|
292
|
+
• Metrics [OPTIONAL] (can be in thought doc only, surfaced via /ask in v2)
|
|
293
|
+
|
|
294
|
+
🎉 All critical sections complete!
|
|
295
|
+
|
|
296
|
+
Ready to publish:
|
|
297
|
+
/tech-design publish
|
|
298
|
+
|
|
299
|
+
This will:
|
|
300
|
+
• Generate clean roll-up from your thought doc
|
|
301
|
+
• Create PR to codex with both docs
|
|
302
|
+
• TECH-DESIGN.md (reviewable roll-up)
|
|
303
|
+
• artifacts/thought-doc.md (your full working doc)
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## Error Handling
|
|
307
|
+
|
|
308
|
+
- **Thought doc not found:** Remind user to run `/tech-design start` first
|
|
309
|
+
- **Thought doc has only template:** Suggest running `/tech-design draft` first
|
|
310
|
+
- **Can't read PRD:** Skip context-based criticality, use defaults
|
|
311
|
+
- **Section names don't match template:** Fuzzy match and warn if unexpected sections found
|
|
312
|
+
|
|
313
|
+
## Helpful Hints
|
|
314
|
+
|
|
315
|
+
If specific sections are commonly empty, provide targeted guidance:
|
|
316
|
+
|
|
317
|
+
```
|
|
318
|
+
⚠️ Risks & Mitigations is empty
|
|
319
|
+
|
|
320
|
+
Common risks to consider:
|
|
321
|
+
• Performance: Will this handle expected load?
|
|
322
|
+
• Data: Migration issues? Data loss scenarios?
|
|
323
|
+
• Integration: What if dependent services fail?
|
|
324
|
+
• Rollout: What's the blast radius if it breaks?
|
|
325
|
+
• Security: Attack surface? Input validation?
|
|
326
|
+
|
|
327
|
+
Want to explore these? /tech-design think risks
|
|
328
|
+
```
|