@devobsessed/code-captain 0.0.3
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/README.md +214 -0
- package/bin/install.js +1048 -0
- package/claude-code/README.md +276 -0
- package/claude-code/agents/code-captain.md +121 -0
- package/claude-code/agents/spec-generator.md +271 -0
- package/claude-code/agents/story-creator.md +309 -0
- package/claude-code/agents/tech-spec.md +440 -0
- package/claude-code/commands/cc-initialize.md +520 -0
- package/copilot/README.md +210 -0
- package/copilot/chatmodes/Code Captain.chatmode.md +60 -0
- package/copilot/docs/best-practices.md +74 -0
- package/copilot/prompts/create-adr.prompt.md +468 -0
- package/copilot/prompts/create-spec.prompt.md +430 -0
- package/copilot/prompts/edit-spec.prompt.md +396 -0
- package/copilot/prompts/execute-task.prompt.md +144 -0
- package/copilot/prompts/explain-code.prompt.md +292 -0
- package/copilot/prompts/initialize.prompt.md +65 -0
- package/copilot/prompts/new-command.prompt.md +310 -0
- package/copilot/prompts/plan-product.prompt.md +450 -0
- package/copilot/prompts/research.prompt.md +329 -0
- package/copilot/prompts/status.prompt.md +424 -0
- package/copilot/prompts/swab.prompt.md +217 -0
- package/cursor/README.md +224 -0
- package/cursor/cc.md +183 -0
- package/cursor/cc.mdc +69 -0
- package/cursor/commands/create-adr.md +504 -0
- package/cursor/commands/create-spec.md +430 -0
- package/cursor/commands/edit-spec.md +405 -0
- package/cursor/commands/execute-task.md +514 -0
- package/cursor/commands/explain-code.md +289 -0
- package/cursor/commands/initialize.md +397 -0
- package/cursor/commands/new-command.md +312 -0
- package/cursor/commands/plan-product.md +466 -0
- package/cursor/commands/research.md +317 -0
- package/cursor/commands/status.md +413 -0
- package/cursor/commands/swab.md +209 -0
- package/cursor/docs/best-practices.md +74 -0
- package/cursor/integrations/azure-devops/create-azure-work-items.md +403 -0
- package/cursor/integrations/azure-devops/sync-azure-work-items.md +486 -0
- package/cursor/integrations/github/create-github-issues.md +765 -0
- package/cursor/integrations/github/scripts/create-issues-batch.sh +272 -0
- package/cursor/integrations/github/sync-github-issues.md +237 -0
- package/cursor/integrations/github/sync.md +305 -0
- package/manifest.json +381 -0
- package/package.json +58 -0
- package/windsurf/README.md +254 -0
- package/windsurf/rules/cc.md +5 -0
- package/windsurf/workflows/create-adr.md +331 -0
- package/windsurf/workflows/create-spec.md +280 -0
- package/windsurf/workflows/edit-spec.md +273 -0
- package/windsurf/workflows/execute-task.md +276 -0
- package/windsurf/workflows/explain-code.md +292 -0
- package/windsurf/workflows/initialize.md +298 -0
- package/windsurf/workflows/new-command.md +321 -0
- package/windsurf/workflows/status.md +213 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
# Enhanced Create Spec Command (cc: create-spec)
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Generate comprehensive feature specifications using a contract-first approach that ensures complete alignment between developer and AI before creating any supporting files. This command eliminates presumptuous file creation by establishing a clear "contract" through structured clarification rounds.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cc: create-spec "rough feature description"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Command Process
|
|
14
|
+
|
|
15
|
+
### Phase 1: Contract Establishment (No File Creation)
|
|
16
|
+
|
|
17
|
+
**Mission Statement:**
|
|
18
|
+
> Your goal is to turn my rough feature idea into a very clear work specification. You will deliver the complete spec package only after we both agree on the requirements contract. **Important: Challenge ideas that don't make technical or business sense - it's better to surface concerns early than build the wrong thing.**
|
|
19
|
+
|
|
20
|
+
#### Step 1.1: Initial Context Scan
|
|
21
|
+
- Scan existing `.code-captain/specs/` for related specifications
|
|
22
|
+
- Analyze current codebase architecture and patterns using `codebase_search`
|
|
23
|
+
- Load project context files (`tech-stack.md`, `code-style.md`, `objective.md`)
|
|
24
|
+
- **Output:** Context summary (no files created yet)
|
|
25
|
+
|
|
26
|
+
#### Step 1.2: Gap Analysis & Silent Enumeration
|
|
27
|
+
**Internal Process (not shown to user):**
|
|
28
|
+
- Silently list every missing fact, constraint, or requirement
|
|
29
|
+
- Identify ambiguities in the initial description
|
|
30
|
+
- Note potential integration points and dependencies
|
|
31
|
+
- Catalog unknowns across these domains:
|
|
32
|
+
- Purpose & business value
|
|
33
|
+
- Target audience & user personas
|
|
34
|
+
- Technical constraints & requirements
|
|
35
|
+
- Success criteria & acceptance tests
|
|
36
|
+
- Scope boundaries (in/out of scope)
|
|
37
|
+
- UI/UX requirements & design constraints
|
|
38
|
+
- Performance & scalability needs
|
|
39
|
+
- Security & compliance requirements
|
|
40
|
+
- Integration points with existing systems
|
|
41
|
+
- Risk tolerance & implementation approach
|
|
42
|
+
|
|
43
|
+
#### Step 1.3: Structured Clarification Loop
|
|
44
|
+
**Rules:**
|
|
45
|
+
- Ask ONE focused question at a time
|
|
46
|
+
- After each answer, re-scan codebase for new context if relevant
|
|
47
|
+
- Continue until reaching 95% confidence on deliverable
|
|
48
|
+
- Each question should target the highest-impact unknown
|
|
49
|
+
- **Never declare "final question"** - let the conversation flow naturally
|
|
50
|
+
- Let the user signal when they're ready to lock the contract
|
|
51
|
+
- **Challenge ideas that don't make technical or business sense** - better to surface concerns early than build the wrong thing
|
|
52
|
+
|
|
53
|
+
**Critical Analysis Responsibility:**
|
|
54
|
+
- If requirements seem technically infeasible with current architecture, explain why and suggest alternatives
|
|
55
|
+
- If scope seems too large for a single feature, recommend breaking it down
|
|
56
|
+
- If user requests conflict with existing patterns found in codebase, point out the inconsistency
|
|
57
|
+
- If business logic doesn't align with stated user value, ask clarifying questions
|
|
58
|
+
- If performance/security/scalability concerns arise, surface them proactively
|
|
59
|
+
|
|
60
|
+
**Pushback Phrasing Examples:**
|
|
61
|
+
- "I see a potential issue with [requirement] because [technical reason]. Would [alternative approach] work better?"
|
|
62
|
+
- "Based on your existing codebase, [proposed approach] might conflict with [existing pattern]. How should we handle this?"
|
|
63
|
+
- "The scope you're describing sounds like it might be 3-4 separate features. Should we focus on [core piece] first?"
|
|
64
|
+
- "I'm concerned that [requirement] could create [specific problem]. Have you considered [alternative]?"
|
|
65
|
+
|
|
66
|
+
**Question Categories (examples):**
|
|
67
|
+
- "What specific user problem does this solve, and who experiences it?"
|
|
68
|
+
- "Should this integrate with [existing system found in codebase], or remain separate?"
|
|
69
|
+
- "What does 'success' look like - how will we measure if this works?"
|
|
70
|
+
- "Are there performance requirements (response time, throughput, scale)?"
|
|
71
|
+
- "What UI/UX constraints exist - web only, mobile responsive, accessibility needs?"
|
|
72
|
+
- "What's your risk tolerance - prefer stable/proven approaches or cutting-edge solutions?"
|
|
73
|
+
|
|
74
|
+
**Transition to Contract:**
|
|
75
|
+
- When confidence is high, present contract without declaring it "final"
|
|
76
|
+
- Use phrases like "I think I have enough to create a solid contract" or "Based on our discussion, here's what I understand"
|
|
77
|
+
- Always leave room for more questions if needed
|
|
78
|
+
|
|
79
|
+
#### Step 1.4: Echo Check (Contract Proposal)
|
|
80
|
+
When confident, present a contract proposal with any concerns surfaced:
|
|
81
|
+
|
|
82
|
+
**Format:**
|
|
83
|
+
```
|
|
84
|
+
## Specification Contract
|
|
85
|
+
|
|
86
|
+
**Deliverable:** [One clear sentence describing what will be built]
|
|
87
|
+
|
|
88
|
+
**Must Include:** [Critical requirement that makes this valuable]
|
|
89
|
+
|
|
90
|
+
**Hardest Constraint:** [Biggest technical/business limitation to navigate]
|
|
91
|
+
|
|
92
|
+
**Success Criteria:** [How we'll know it's working correctly]
|
|
93
|
+
|
|
94
|
+
**Scope Boundaries:**
|
|
95
|
+
- In Scope: [2-3 key features]
|
|
96
|
+
- Out of Scope: [2-3 things we won't build]
|
|
97
|
+
|
|
98
|
+
**⚠️ Technical Concerns (if any):**
|
|
99
|
+
- [Specific concern about feasibility, performance, or architecture]
|
|
100
|
+
- [Suggested alternative or mitigation approach]
|
|
101
|
+
|
|
102
|
+
**💡 Recommendations:**
|
|
103
|
+
- [Suggestions for improving the approach based on codebase analysis]
|
|
104
|
+
- [Ways to reduce risk or complexity]
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
Options:
|
|
108
|
+
- Type 'yes' to lock this contract and create the spec package
|
|
109
|
+
- Type 'edit: [your changes]' to modify the contract
|
|
110
|
+
- Type 'risks' to explore potential implementation risks in detail
|
|
111
|
+
- Type 'blueprint' to see the planned folder structure and documents
|
|
112
|
+
- Ask more questions if anything needs clarification
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Phase 2: Spec Package Creation (Post-Agreement Only)
|
|
116
|
+
|
|
117
|
+
**Triggered only after user confirms contract with 'yes'**
|
|
118
|
+
|
|
119
|
+
#### Step 2.1: Initialize Tracking
|
|
120
|
+
```bash
|
|
121
|
+
# Use todo_write to track creation process
|
|
122
|
+
1. Determine current date for folder naming
|
|
123
|
+
2. Create spec folder structure
|
|
124
|
+
3. Generate core specification document
|
|
125
|
+
4. Create user stories with acceptance criteria
|
|
126
|
+
5. Generate technical sub-specifications
|
|
127
|
+
6. Create implementation task breakdown
|
|
128
|
+
7. Present package for user review and validation
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### Step 2.2: Determine Current Date
|
|
132
|
+
**Objective:** Get current date for folder naming and document timestamps
|
|
133
|
+
|
|
134
|
+
**Date Determination Process:**
|
|
135
|
+
|
|
136
|
+
1. **CREATE** directory if not exists: `.code-captain/specs/`
|
|
137
|
+
2. **CREATE** temporary file: `.code-captain/specs/.date-check`
|
|
138
|
+
3. **READ** file creation timestamp from filesystem
|
|
139
|
+
4. **EXTRACT** date in YYYY-MM-DD format
|
|
140
|
+
5. **DELETE** temporary file
|
|
141
|
+
6. **STORE** date in variable for folder naming
|
|
142
|
+
|
|
143
|
+
**Fallback Method:** If file system method fails:
|
|
144
|
+
1. **STATE**: "I need to confirm today's date for the specification folder"
|
|
145
|
+
2. **ASK**: "What is today's date? (YYYY-MM-DD format)"
|
|
146
|
+
3. **WAIT** for user response
|
|
147
|
+
4. **VALIDATE** format matches `^\d{4}-\d{2}-\d{2}$`
|
|
148
|
+
- year: 2024-2030
|
|
149
|
+
- month: 01-12
|
|
150
|
+
- day: 01-31
|
|
151
|
+
5. **STORE** date for folder naming
|
|
152
|
+
|
|
153
|
+
**Error Handling:**
|
|
154
|
+
- **IF** date_invalid: USE fallback_method
|
|
155
|
+
- **IF** both_methods_fail: ERROR "Unable to determine current date"
|
|
156
|
+
|
|
157
|
+
#### Step 2.3: Create Directory Structure
|
|
158
|
+
**Generated folder (using determined date):**
|
|
159
|
+
```
|
|
160
|
+
.code-captain/specs/[DATE]-{feature-name}/
|
|
161
|
+
├── spec.md # Main specification (from contract)
|
|
162
|
+
├── spec-lite.md # Condensed version for AI context
|
|
163
|
+
├── user-stories/ # Individual user story files
|
|
164
|
+
│ ├── README.md # Overview and progress tracking
|
|
165
|
+
│ ├── story-1-{name}.md # Individual user story with focused tasks
|
|
166
|
+
│ ├── story-2-{name}.md # Each story kept small and manageable
|
|
167
|
+
│ └── story-N-{name}.md # Max 5-7 implementation tasks per story
|
|
168
|
+
└── sub-specs/ # Technical deep-dives
|
|
169
|
+
├── technical-spec.md # Architecture & implementation details
|
|
170
|
+
├── database-schema.md # Database changes (if needed)
|
|
171
|
+
├── api-spec.md # API documentation (if needed)
|
|
172
|
+
└── ui-wireframes.md # UI/UX specifications (if needed)
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### Step 2.4: Generate Core Documents
|
|
176
|
+
|
|
177
|
+
**spec.md** - Built directly from the locked contract:
|
|
178
|
+
```markdown
|
|
179
|
+
# [Feature Name] Specification
|
|
180
|
+
|
|
181
|
+
> Created: [DATE from Step 2.2 determination process]
|
|
182
|
+
> Status: Planning
|
|
183
|
+
> Contract Locked: ✅
|
|
184
|
+
|
|
185
|
+
## Contract Summary
|
|
186
|
+
[Echo check content verbatim]
|
|
187
|
+
|
|
188
|
+
## Detailed Requirements
|
|
189
|
+
[Expanded from clarification responses]
|
|
190
|
+
|
|
191
|
+
## Implementation Approach
|
|
192
|
+
[Technical strategy based on codebase analysis]
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**user-stories/ folder structure** - Individual user story files for better organization:
|
|
196
|
+
|
|
197
|
+
**user-stories/README.md** - Overview and progress tracking:
|
|
198
|
+
```markdown
|
|
199
|
+
# User Stories Overview
|
|
200
|
+
|
|
201
|
+
> **Specification:** [Feature Name]
|
|
202
|
+
> **Created:** [DATE]
|
|
203
|
+
> **Status:** Planning
|
|
204
|
+
|
|
205
|
+
## Stories Summary
|
|
206
|
+
|
|
207
|
+
| Story | Title | Status | Tasks | Progress |
|
|
208
|
+
|-------|-------|--------|-------|----------|
|
|
209
|
+
| 1 | [Story title] | Not Started | 5 | 0/5 |
|
|
210
|
+
| 2 | [Story title] | Not Started | 4 | 0/4 |
|
|
211
|
+
| 3 | [Story title] | Not Started | 6 | 0/6 |
|
|
212
|
+
|
|
213
|
+
**Total Progress:** 0/15 tasks (0%)
|
|
214
|
+
|
|
215
|
+
## Story Dependencies
|
|
216
|
+
- Story 2 depends on Story 1 completion
|
|
217
|
+
- Story 3 can run parallel to Story 2
|
|
218
|
+
|
|
219
|
+
## Quick Links
|
|
220
|
+
- [Story 1: User Login](./story-1-user-login.md)
|
|
221
|
+
- [Story 2: Password Reset](./story-2-password-reset.md)
|
|
222
|
+
- [Story 3: Profile Management](./story-3-profile-management.md)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
**user-stories/story-1-{name}.md** - Individual story files (max 5-7 tasks each):
|
|
226
|
+
```markdown
|
|
227
|
+
# Story 1: [Title from contract deliverable]
|
|
228
|
+
|
|
229
|
+
> **Status:** Not Started
|
|
230
|
+
> **Priority:** High
|
|
231
|
+
> **Dependencies:** None
|
|
232
|
+
|
|
233
|
+
## User Story
|
|
234
|
+
**As a** [user type from clarification]
|
|
235
|
+
**I want to** [action from contract]
|
|
236
|
+
**So that** [value from contract must-include]
|
|
237
|
+
|
|
238
|
+
## Acceptance Criteria
|
|
239
|
+
- [ ] Given [context], when [action], then [outcome]
|
|
240
|
+
- [ ] Given [context], when [action], then [outcome]
|
|
241
|
+
- [ ] Given [context], when [action], then [outcome]
|
|
242
|
+
|
|
243
|
+
## Implementation Tasks
|
|
244
|
+
- [ ] 1.1 Write tests for [specific component]
|
|
245
|
+
- [ ] 1.2 [Focused technical step]
|
|
246
|
+
- [ ] 1.3 [Focused technical step]
|
|
247
|
+
- [ ] 1.4 [Focused technical step]
|
|
248
|
+
- [ ] 1.5 Verify acceptance criteria are met
|
|
249
|
+
- [ ] 1.6 Verify all tests pass
|
|
250
|
+
|
|
251
|
+
## Notes
|
|
252
|
+
[Any specific technical considerations, risks, or dependencies for this story]
|
|
253
|
+
|
|
254
|
+
## Definition of Done
|
|
255
|
+
- [ ] All tasks completed
|
|
256
|
+
- [ ] All acceptance criteria met
|
|
257
|
+
- [ ] Tests passing
|
|
258
|
+
- [ ] Code reviewed
|
|
259
|
+
- [ ] Documentation updated
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
#### Step 2.5: Generate Technical Sub-Specs
|
|
263
|
+
|
|
264
|
+
**Only create relevant sub-specs based on contract requirements:**
|
|
265
|
+
|
|
266
|
+
- **technical-spec.md**: Always created - architecture, patterns, dependencies
|
|
267
|
+
- **database-schema.md**: Only if database changes needed (determined during clarification)
|
|
268
|
+
- **api-spec.md**: Only if new API endpoints required
|
|
269
|
+
- **ui-wireframes.md**: Only if UI/UX requirements were discussed
|
|
270
|
+
|
|
271
|
+
**Cross-reference integration**: Each sub-spec references relevant user stories from the user-stories/ folder to maintain traceability between technical details and user value.
|
|
272
|
+
|
|
273
|
+
#### Step 2.6: Create User Stories Folder Structure
|
|
274
|
+
|
|
275
|
+
**user-stories/ folder** - Organized individual story files with focused task groups:
|
|
276
|
+
|
|
277
|
+
**Structure Philosophy:**
|
|
278
|
+
- Each user story gets its own file for better organization
|
|
279
|
+
- Implementation tasks are kept small and focused (max 5-7 per story)
|
|
280
|
+
- Complex stories are broken into multiple smaller stories
|
|
281
|
+
- README.md provides overview and progress tracking
|
|
282
|
+
- Acceptance criteria become verification checkpoints
|
|
283
|
+
- Each story follows TDD: test → implement → verify acceptance criteria
|
|
284
|
+
|
|
285
|
+
**Benefits of Folder Structure:**
|
|
286
|
+
- **Manageability**: Each file stays focused and readable
|
|
287
|
+
- **Navigation**: Easy to find and work on specific stories
|
|
288
|
+
- **Parallel Work**: Multiple developers can work on different stories
|
|
289
|
+
- **Version Control**: Smaller, focused diffs when stories change
|
|
290
|
+
- **Progress Tracking**: Clear visibility of completion status
|
|
291
|
+
- **Traceability**: Every technical task traces to user value
|
|
292
|
+
|
|
293
|
+
**File Organization:**
|
|
294
|
+
- **README.md**: Overview, progress summary, dependencies
|
|
295
|
+
- **story-N-{name}.md**: Individual stories with focused tasks (5-7 tasks max)
|
|
296
|
+
- **Story Naming**: Clear, descriptive names for easy identification
|
|
297
|
+
- **Task Numbering**: N.1, N.2, N.3... within each story file
|
|
298
|
+
|
|
299
|
+
**Task Breakdown Strategy:**
|
|
300
|
+
- If a story would have >7 tasks, split into multiple stories
|
|
301
|
+
- Each story should deliver standalone user value
|
|
302
|
+
- Tasks within a story should be cohesive and related
|
|
303
|
+
- Always start with tests (N.1 Write tests...)
|
|
304
|
+
- Always end with verification (N.X Verify acceptance criteria met)
|
|
305
|
+
|
|
306
|
+
#### Step 2.7: Final Package Review & User Validation
|
|
307
|
+
|
|
308
|
+
Present complete package with file references:
|
|
309
|
+
```
|
|
310
|
+
✅ Specification package created successfully!
|
|
311
|
+
|
|
312
|
+
📁 .code-captain/specs/[DATE]-feature-name/
|
|
313
|
+
├── 📋 spec.md - Main specification document
|
|
314
|
+
├── 📝 spec-lite.md - AI context summary
|
|
315
|
+
├── 👥 user-stories/ - Individual user story files
|
|
316
|
+
│ ├── 📊 README.md - Overview and progress tracking
|
|
317
|
+
│ ├── 📝 story-1-{name}.md - Focused story with 5-7 tasks
|
|
318
|
+
│ ├── 📝 story-2-{name}.md - Manageable task groups
|
|
319
|
+
│ └── 📝 story-N-{name}.md - Easy navigation and parallel work
|
|
320
|
+
└── 📂 sub-specs/
|
|
321
|
+
├── 🔧 technical-spec.md - Technical requirements
|
|
322
|
+
[Additional specs as created]
|
|
323
|
+
|
|
324
|
+
**Stories Created:** [N] user stories with focused task groups (max 5-7 tasks each)
|
|
325
|
+
**Total Tasks:** [X] implementation tasks across all stories
|
|
326
|
+
**Organization:** Each story is self-contained for better workflow management
|
|
327
|
+
|
|
328
|
+
Please take a moment to review the specification documents. The spec captures everything we discussed, including:
|
|
329
|
+
- [Brief summary of key features/requirements]
|
|
330
|
+
- [Notable technical approach or constraint]
|
|
331
|
+
- [Implementation approach or user story highlights]
|
|
332
|
+
|
|
333
|
+
Please read through the files and let me know:
|
|
334
|
+
- Does this accurately capture your vision?
|
|
335
|
+
- Are there any missing requirements or incorrect assumptions?
|
|
336
|
+
- Are the user stories appropriately sized (5-7 tasks each)?
|
|
337
|
+
- Should any stories be split further or combined?
|
|
338
|
+
|
|
339
|
+
The user-stories folder structure allows you to:
|
|
340
|
+
- Work on one story at a time for focused development
|
|
341
|
+
- Track progress easily with the README overview
|
|
342
|
+
- Assign different stories to different team members
|
|
343
|
+
- Keep task lists manageable and actionable
|
|
344
|
+
|
|
345
|
+
Once you're satisfied with the specification, I can help you start implementation with the first story, or we can make any needed adjustments.
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
## Key Improvements Over Original
|
|
349
|
+
|
|
350
|
+
### 1. Contract-First Approach
|
|
351
|
+
- **No presumptuous file creation** - Nothing gets built until contract is locked
|
|
352
|
+
- **Structured clarification** - One question at a time, building understanding
|
|
353
|
+
- **Echo check validation** - Clear contract summary before proceeding
|
|
354
|
+
|
|
355
|
+
### 2. Codebase-Aware Questioning
|
|
356
|
+
- **Context scanning between questions** - Each answer triggers fresh codebase analysis
|
|
357
|
+
- **Integration-focused queries** - Questions shaped by what exists in the codebase
|
|
358
|
+
- **Architecture consistency** - Recommendations align with existing patterns
|
|
359
|
+
|
|
360
|
+
### 3. User Control & Transparency
|
|
361
|
+
- **Clear decision points** - User explicitly approves before file creation
|
|
362
|
+
- **Risk assessment option** - Can explore implementation risks before committing
|
|
363
|
+
- **Blueprint preview** - Can see planned structure before creation
|
|
364
|
+
- **Edit capability** - Can modify contract before locking
|
|
365
|
+
|
|
366
|
+
### 4. Efficient Clarification Process
|
|
367
|
+
- **Gap enumeration** - Systematically identifies all unknowns
|
|
368
|
+
- **95% confidence threshold** - Stops asking when ready to deliver
|
|
369
|
+
- **Token efficiency** - Focused questions, no verbose explanations during clarification
|
|
370
|
+
|
|
371
|
+
## Example Usage Flow
|
|
372
|
+
|
|
373
|
+
```
|
|
374
|
+
Developer: cc: create-spec "real-time multiplayer chat with blockchain integration"
|
|
375
|
+
|
|
376
|
+
Agent: I'm ready to help you create a comprehensive specification.
|
|
377
|
+
|
|
378
|
+
Let me first scan your codebase to understand the current architecture...
|
|
379
|
+
|
|
380
|
+
[Scans existing code, finds a simple React app with basic authentication]
|
|
381
|
+
|
|
382
|
+
I found your existing React application with basic user authentication, but I'm seeing some potential concerns with your request.
|
|
383
|
+
|
|
384
|
+
First question: You mentioned "real-time multiplayer chat with blockchain integration" - I see technical challenges with this combination. Real-time chat typically requires sub-100ms latency, but blockchain transactions can take seconds or minutes to confirm. What specific problem are you trying to solve with blockchain in a chat context?
|
|
385
|
+
|
|
386
|
+
Developer: I want messages to be permanently stored and verifiable, plus users should pay crypto to send messages to prevent spam
|
|
387
|
+
|
|
388
|
+
Agent: I understand the anti-spam goal, but I'm concerned about the user experience. If users have to wait 30+ seconds for transaction confirmation before each message appears, that breaks the "real-time" chat experience.
|
|
389
|
+
|
|
390
|
+
Would a hybrid approach work better - immediate message delivery with blockchain settlement in the background? Or are you thinking of a different model where users pre-purchase message credits?
|
|
391
|
+
|
|
392
|
+
Developer: Oh, that's a good point. Let's do the hybrid approach with background settlement
|
|
393
|
+
|
|
394
|
+
Agent: [Continues with more informed questions about the hybrid architecture...]
|
|
395
|
+
|
|
396
|
+
## Specification Contract
|
|
397
|
+
|
|
398
|
+
**Deliverable:** Hybrid real-time chat with immediate message delivery and background blockchain verification for anti-spam
|
|
399
|
+
|
|
400
|
+
**Must Include:** Sub-second message delivery while maintaining blockchain verification for spam prevention
|
|
401
|
+
|
|
402
|
+
**Hardest Constraint:** Balancing real-time UX with blockchain settlement delays and gas cost management
|
|
403
|
+
|
|
404
|
+
**⚠️ Technical Concerns:**
|
|
405
|
+
- Gas costs could make casual chat expensive ($1-5 per message during network congestion)
|
|
406
|
+
- Background settlement failures need graceful handling and user notification
|
|
407
|
+
- Wallet integration adds authentication complexity to existing simple auth system
|
|
408
|
+
|
|
409
|
+
**💡 Recommendations:**
|
|
410
|
+
- Consider Layer 2 solution (Polygon) to reduce gas costs to $0.01-0.10 per message
|
|
411
|
+
- Implement message batching to settle multiple messages in single transaction
|
|
412
|
+
- Add fallback mode for when blockchain settlement fails
|
|
413
|
+
|
|
414
|
+
**Success Criteria:** Messages appear instantly, spam is prevented via crypto payments, blockchain verification happens within 5 minutes
|
|
415
|
+
|
|
416
|
+
**Scope Boundaries:**
|
|
417
|
+
- In Scope: Real-time chat, wallet integration, background blockchain settlement
|
|
418
|
+
- Out of Scope: Advanced chat features (file sharing, voice), custom token creation
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
Options: [yes/edit/risks/blueprint]
|
|
422
|
+
|
|
423
|
+
Developer: yes
|
|
424
|
+
|
|
425
|
+
Agent: ✅ Contract locked! Creating specification package...
|
|
426
|
+
|
|
427
|
+
[Creates files that account for the technical concerns and hybrid architecture discussed]
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
This approach ensures that every specification is built on solid understanding rather than assumptions, while respecting the developer's time and maintaining control over the process.
|