@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
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@devobsessed/code-captain",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "Unified AI Development Agent System with intelligent change detection",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"code-captain": "bin/install.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"manifest": "node scripts/build-manifest.js",
|
|
11
|
+
"dry-run": "npm publish --dry-run",
|
|
12
|
+
"test": "echo \"(no tests yet)\""
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"ai",
|
|
16
|
+
"development",
|
|
17
|
+
"agent",
|
|
18
|
+
"cursor",
|
|
19
|
+
"copilot",
|
|
20
|
+
"windsurf",
|
|
21
|
+
"claude",
|
|
22
|
+
"automation"
|
|
23
|
+
],
|
|
24
|
+
"author": "DevObsessed",
|
|
25
|
+
"contributors": [
|
|
26
|
+
"Brad Risse <brad.risse@devobsessed.com>"
|
|
27
|
+
],
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"boxen": "~7.0.0",
|
|
31
|
+
"chalk": "~5.3.0",
|
|
32
|
+
"cross-spawn": "~7.0.3",
|
|
33
|
+
"fs-extra": "~11.1.1",
|
|
34
|
+
"inquirer": "~9.2.7",
|
|
35
|
+
"node-fetch": "~3.3.1",
|
|
36
|
+
"ora": "~7.0.1"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"bin/",
|
|
40
|
+
"cursor/",
|
|
41
|
+
"copilot/",
|
|
42
|
+
"windsurf/",
|
|
43
|
+
"claude-code/",
|
|
44
|
+
"manifest.json",
|
|
45
|
+
"README.md"
|
|
46
|
+
],
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=16.0.0"
|
|
49
|
+
},
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/devobsessed/code-captain.git"
|
|
53
|
+
},
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/devobsessed/code-captain/issues"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://github.com/devobsessed/code-captain#readme"
|
|
58
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
# Code Captain for Windsurf
|
|
2
|
+
|
|
3
|
+
> **Codeium's AI-powered development environment with custom workflow integration**
|
|
4
|
+
|
|
5
|
+
Windsurf provides advanced AI capabilities with custom workflow integration, built-in context management, and intelligent code coordination.
|
|
6
|
+
|
|
7
|
+
## 🚀 Installation
|
|
8
|
+
|
|
9
|
+
### Automatic Installation (Recommended)
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx @devobsessed/code-captain
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The installer will detect Windsurf and install to:
|
|
16
|
+
- `.windsurf/` - Custom workflows and rules
|
|
17
|
+
- `.code-captain/` - Complete workflow system
|
|
18
|
+
|
|
19
|
+
### Manual Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Clone or download the windsurf/ directory contents to .windsurf/
|
|
23
|
+
cp -r windsurf/ .windsurf/
|
|
24
|
+
cp -r .code-captain/ .
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 🎯 Workflow Integration
|
|
28
|
+
|
|
29
|
+
Code Captain in Windsurf uses custom workflow files that integrate with Windsurf's AI system:
|
|
30
|
+
|
|
31
|
+
### Available Workflows
|
|
32
|
+
Located in `.windsurf/workflows/`:
|
|
33
|
+
|
|
34
|
+
- **`initialize.md`** - Project setup and analysis
|
|
35
|
+
- **`create-spec.md`** - Feature specification creation
|
|
36
|
+
- **`create-adr.md`** - Architecture Decision Records
|
|
37
|
+
- **`execute-task.md`** - Test-driven development
|
|
38
|
+
- **`explain-code.md`** - Code explanation with diagrams
|
|
39
|
+
- **`status.md`** - Project status analysis
|
|
40
|
+
- **`edit-spec.md`** - Specification modification
|
|
41
|
+
- **`new-command.md`** - Custom command creation
|
|
42
|
+
|
|
43
|
+
### Workflow Rules
|
|
44
|
+
Located in `.windsurf/rules/`:
|
|
45
|
+
|
|
46
|
+
- **`cc.md`** - Core Code Captain rules and guidelines
|
|
47
|
+
|
|
48
|
+
## 🛠️ Available Workflows
|
|
49
|
+
|
|
50
|
+
### 📋 Project Setup & Analysis
|
|
51
|
+
- **Initialize Project** - Comprehensive project analysis and documentation setup
|
|
52
|
+
- **Product Planning** - Strategic product planning with roadmap generation
|
|
53
|
+
- **Technical Research** - Systematic 4-phase research methodology
|
|
54
|
+
- **Custom Commands** - Create domain-specific workflow extensions
|
|
55
|
+
|
|
56
|
+
### 📝 Requirements & Planning
|
|
57
|
+
- **Feature Specifications** - Detailed specs with technical implementation details
|
|
58
|
+
- **Architecture Decisions** - ADRs with systematic research and alternatives analysis
|
|
59
|
+
- **Code Explanations** - Visual diagrams with comprehensive technical analysis
|
|
60
|
+
- **Specification Editing** - Contract-first approach to specification modifications
|
|
61
|
+
|
|
62
|
+
### ⚙️ Implementation
|
|
63
|
+
- **Test-Driven Development** - Systematic TDD workflow with progress tracking
|
|
64
|
+
- **Project Status** - Comprehensive status analysis with actionable recommendations
|
|
65
|
+
- **Code Cleanup** - Incremental improvements following the Boy Scout Rule
|
|
66
|
+
|
|
67
|
+
## 🔄 Workflow Examples
|
|
68
|
+
|
|
69
|
+
### Project Initialization
|
|
70
|
+
|
|
71
|
+
1. **Open Windsurf** and navigate to your project
|
|
72
|
+
2. **Reference the initialize workflow**: `.windsurf/workflows/initialize.md`
|
|
73
|
+
3. **Follow the systematic process** for project analysis
|
|
74
|
+
4. **Review generated documentation** in `.code-captain/docs/`
|
|
75
|
+
|
|
76
|
+
### Feature Development
|
|
77
|
+
|
|
78
|
+
1. **Research Phase**
|
|
79
|
+
- Use `.windsurf/workflows/create-adr.md` for architectural decisions
|
|
80
|
+
- Reference research methodology from workflows
|
|
81
|
+
|
|
82
|
+
2. **Specification Phase**
|
|
83
|
+
- Follow `.windsurf/workflows/create-spec.md`
|
|
84
|
+
- Generate comprehensive feature specifications
|
|
85
|
+
|
|
86
|
+
3. **Implementation Phase**
|
|
87
|
+
- Use `.windsurf/workflows/execute-task.md`
|
|
88
|
+
- Follow TDD methodology with progress tracking
|
|
89
|
+
|
|
90
|
+
4. **Status Monitoring**
|
|
91
|
+
- Reference `.windsurf/workflows/status.md`
|
|
92
|
+
- Get comprehensive project health analysis
|
|
93
|
+
|
|
94
|
+
### Code Understanding
|
|
95
|
+
|
|
96
|
+
1. **Code Explanation**
|
|
97
|
+
- Use `.windsurf/workflows/explain-code.md`
|
|
98
|
+
- Generate visual diagrams and technical analysis
|
|
99
|
+
|
|
100
|
+
2. **Incremental Improvements**
|
|
101
|
+
- Follow best practices from `.windsurf/rules/cc.md`
|
|
102
|
+
- Apply small, focused improvements
|
|
103
|
+
|
|
104
|
+
## 📁 File Organization
|
|
105
|
+
|
|
106
|
+
Windsurf integration creates this structure:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
.windsurf/
|
|
110
|
+
├── workflows/
|
|
111
|
+
│ ├── initialize.md
|
|
112
|
+
│ ├── create-spec.md
|
|
113
|
+
│ ├── create-adr.md
|
|
114
|
+
│ ├── execute-task.md
|
|
115
|
+
│ ├── explain-code.md
|
|
116
|
+
│ ├── status.md
|
|
117
|
+
│ ├── edit-spec.md
|
|
118
|
+
│ └── new-command.md
|
|
119
|
+
└── rules/
|
|
120
|
+
└── cc.md
|
|
121
|
+
|
|
122
|
+
.code-captain/
|
|
123
|
+
├── commands/ # Reference documentation
|
|
124
|
+
├── docs/ # Generated documentation
|
|
125
|
+
├── research/ # Technical research reports
|
|
126
|
+
├── decision-records/ # Architecture Decision Records
|
|
127
|
+
├── specs/ # Feature specifications
|
|
128
|
+
│ └── YYYY-MM-DD-feature/
|
|
129
|
+
│ ├── spec.md
|
|
130
|
+
│ ├── user-stories/
|
|
131
|
+
│ └── tasks.md
|
|
132
|
+
└── cc.md # Complete reference guide
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## 🎯 Windsurf-Specific Features
|
|
136
|
+
|
|
137
|
+
### Custom Workflow Integration
|
|
138
|
+
- **Workflow-based execution** aligned with Windsurf's AI coordination
|
|
139
|
+
- **Context-aware processing** using Windsurf's advanced context management
|
|
140
|
+
- **Intelligent file organization** with automatic workspace awareness
|
|
141
|
+
|
|
142
|
+
### Advanced AI Coordination
|
|
143
|
+
- **Multi-step workflow execution** with AI guidance
|
|
144
|
+
- **Context preservation** across workflow phases
|
|
145
|
+
- **Intelligent tool selection** based on workflow requirements
|
|
146
|
+
|
|
147
|
+
### Built-in Best Practices
|
|
148
|
+
- **Critical thinking guidelines** from `windsurf/rules/cc.md`
|
|
149
|
+
- **Systematic approaches** to complex development tasks
|
|
150
|
+
- **Quality-focused workflows** with verification steps
|
|
151
|
+
|
|
152
|
+
## 🚀 Advanced Usage
|
|
153
|
+
|
|
154
|
+
### Custom Workflow Creation
|
|
155
|
+
|
|
156
|
+
Create new workflows in `.windsurf/workflows/`:
|
|
157
|
+
|
|
158
|
+
```markdown
|
|
159
|
+
# Custom Workflow
|
|
160
|
+
|
|
161
|
+
## Overview
|
|
162
|
+
[Describe workflow purpose and capabilities]
|
|
163
|
+
|
|
164
|
+
## Process
|
|
165
|
+
[Detail step-by-step workflow execution]
|
|
166
|
+
|
|
167
|
+
## Tool Integration
|
|
168
|
+
[Specify Windsurf tool coordination]
|
|
169
|
+
|
|
170
|
+
## Output Organization
|
|
171
|
+
[Define file structure and locations]
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Rule Customization
|
|
175
|
+
|
|
176
|
+
Enhance `.windsurf/rules/cc.md` with team-specific guidelines:
|
|
177
|
+
|
|
178
|
+
```markdown
|
|
179
|
+
## Team-Specific Rules
|
|
180
|
+
|
|
181
|
+
### Code Standards
|
|
182
|
+
[Define team coding standards]
|
|
183
|
+
|
|
184
|
+
### Review Process
|
|
185
|
+
[Specify review requirements]
|
|
186
|
+
|
|
187
|
+
### Documentation Standards
|
|
188
|
+
[Define documentation expectations]
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Workflow Chaining
|
|
192
|
+
|
|
193
|
+
Chain workflows for complex development processes:
|
|
194
|
+
|
|
195
|
+
1. **Initialize** → **Research** → **Create ADR**
|
|
196
|
+
2. **Create Spec** → **Execute Task** → **Status Check**
|
|
197
|
+
3. **Explain Code** → **Swab** → **Status Update**
|
|
198
|
+
|
|
199
|
+
## 🔧 Configuration
|
|
200
|
+
|
|
201
|
+
### Windsurf Settings
|
|
202
|
+
Configure Windsurf to optimize Code Captain integration:
|
|
203
|
+
|
|
204
|
+
- **Enable advanced context management**
|
|
205
|
+
- **Configure AI coordination preferences**
|
|
206
|
+
- **Set up workspace awareness**
|
|
207
|
+
|
|
208
|
+
### Project-Specific Rules
|
|
209
|
+
Customize `.windsurf/rules/cc.md` for your project:
|
|
210
|
+
|
|
211
|
+
- **Domain-specific guidelines**
|
|
212
|
+
- **Technology-specific patterns**
|
|
213
|
+
- **Team collaboration standards**
|
|
214
|
+
|
|
215
|
+
## 📊 Workflow Reference
|
|
216
|
+
|
|
217
|
+
| Workflow | Purpose | Output Location |
|
|
218
|
+
|----------|---------|-----------------|
|
|
219
|
+
| `initialize` | Project analysis & setup | `.code-captain/docs/` |
|
|
220
|
+
| `create-spec` | Feature specification | `.code-captain/specs/` |
|
|
221
|
+
| `execute-task` | TDD implementation | Source code + tests |
|
|
222
|
+
| `create-adr` | Architecture decisions | `.code-captain/decision-records/` |
|
|
223
|
+
| `status` | Project health analysis | Terminal output |
|
|
224
|
+
|
|
225
|
+
## 🛠️ Troubleshooting
|
|
226
|
+
|
|
227
|
+
### Workflows Not Executing Properly
|
|
228
|
+
**Problem**: Windsurf doesn't follow workflow steps correctly
|
|
229
|
+
**Solution**: Ensure workflow files are in `.windsurf/workflows/` and reference them explicitly
|
|
230
|
+
|
|
231
|
+
### Context Issues
|
|
232
|
+
**Problem**: AI loses context during workflow execution
|
|
233
|
+
**Solution**: Break complex workflows into smaller steps and verify context preservation
|
|
234
|
+
|
|
235
|
+
### File Organization Problems
|
|
236
|
+
**Problem**: Generated files appear in wrong locations
|
|
237
|
+
**Solution**: Check `.code-captain/` folder structure and verify workflow output specifications
|
|
238
|
+
|
|
239
|
+
## 🤝 Contributing
|
|
240
|
+
|
|
241
|
+
Windsurf-specific contributions:
|
|
242
|
+
|
|
243
|
+
1. **Workflow Enhancement** - Improve AI coordination and workflow efficiency
|
|
244
|
+
2. **Rule Development** - Add domain-specific rules and guidelines
|
|
245
|
+
3. **Documentation** - Create Windsurf-specific examples and patterns
|
|
246
|
+
4. **Integration** - Enhance Windsurf AI coordination capabilities
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
**Ready to supercharge your Windsurf development?**
|
|
251
|
+
|
|
252
|
+
1. **Install:** `npx @devobsessed/code-captain`
|
|
253
|
+
2. **Reference:** `.windsurf/workflows/initialize.md`
|
|
254
|
+
3. **Begin:** Project initialization workflow
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create comprehensive Architecture Decision Records with systematic analysis and structured documentation
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Create ADR Workflow
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
Create comprehensive Architecture Decision Records (ADRs) that systematically document architectural decisions with clear rationale, alternatives considered, and consequences through structured analysis and review process.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
- Making significant architectural decisions affecting system structure
|
|
12
|
+
- Documenting technology choices with vendor lock-in or high switching costs
|
|
13
|
+
- Recording decisions contrary to team expectations or industry standards
|
|
14
|
+
- Capturing complex trade-offs between competing approaches
|
|
15
|
+
- Establishing architectural patterns and standards for team consistency
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
**MANDATORY:** This workflow automatically executes research if no relevant research exists.
|
|
20
|
+
|
|
21
|
+
Process:
|
|
22
|
+
1. Check for existing research on the decision topic
|
|
23
|
+
2. If no research found: **automatically execute** complete research workflow
|
|
24
|
+
3. Only proceed with ADR creation after research is completed
|
|
25
|
+
|
|
26
|
+
## Implementation Steps
|
|
27
|
+
|
|
28
|
+
### Step 1: Check for Existing Research and Auto-Execute if Missing
|
|
29
|
+
|
|
30
|
+
Use `find_by_name` to search for related research:
|
|
31
|
+
```bash
|
|
32
|
+
find .code-captain/research -name "*[topic]*" -type f
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Use `list_dir` to explore research directory structure.
|
|
36
|
+
|
|
37
|
+
If no relevant research found:
|
|
38
|
+
```
|
|
39
|
+
❌ No existing research found for this architectural decision.
|
|
40
|
+
|
|
41
|
+
🔄 AUTOMATICALLY EXECUTING RESEARCH WORKFLOW FIRST...
|
|
42
|
+
|
|
43
|
+
Reading .code-captain/commands/research.md and executing complete research process...
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Execute research workflow automatically:**
|
|
47
|
+
- Use `view_file` to read research workflow documentation
|
|
48
|
+
- Execute 4-phase research methodology:
|
|
49
|
+
- Phase 1: Define Research Scope
|
|
50
|
+
- Phase 2: Initial Discovery
|
|
51
|
+
- Phase 3: Deep Dive Analysis
|
|
52
|
+
- Phase 4: Synthesis and Recommendations
|
|
53
|
+
- Use `write_to_file` to create research document
|
|
54
|
+
- **ONLY CONTINUE** with ADR creation after research is completed
|
|
55
|
+
|
|
56
|
+
### Step 2: Analyze Decision Context and Current State
|
|
57
|
+
|
|
58
|
+
**Analysis Actions:**
|
|
59
|
+
|
|
60
|
+
1. **Understand current architectural patterns:**
|
|
61
|
+
- Use `codebase_search` with queries:
|
|
62
|
+
- "What architectural patterns are currently in use?"
|
|
63
|
+
- "How are similar decisions handled in the codebase?"
|
|
64
|
+
- "What dependencies and integrations exist?"
|
|
65
|
+
|
|
66
|
+
2. **Find existing ADRs:**
|
|
67
|
+
- Use `find_by_name` to locate existing ADRs in `.code-captain/decision-records/`
|
|
68
|
+
- Use `list_dir` to explore system structure
|
|
69
|
+
|
|
70
|
+
3. **Gather decision context:**
|
|
71
|
+
- Identify decision stakeholders and concerns
|
|
72
|
+
- Determine specific decision needed and urgency
|
|
73
|
+
- Document current architectural context
|
|
74
|
+
|
|
75
|
+
### Step 3: Define Decision Scope and Criteria
|
|
76
|
+
|
|
77
|
+
**Actions:**
|
|
78
|
+
1. Define the specific architectural decision requiring documentation
|
|
79
|
+
2. Identify driving forces and constraints:
|
|
80
|
+
- Business requirements and goals
|
|
81
|
+
- Technical constraints and limitations
|
|
82
|
+
- Performance, security, scalability requirements
|
|
83
|
+
- Team skills and organizational capabilities
|
|
84
|
+
- Timeline and budget constraints
|
|
85
|
+
3. Establish decision criteria and priorities
|
|
86
|
+
4. Determine decision maker(s) and approval process
|
|
87
|
+
5. Set boundaries for decision scope
|
|
88
|
+
|
|
89
|
+
### Step 4: Research Alternatives and Evaluate Options
|
|
90
|
+
|
|
91
|
+
**Research Actions:**
|
|
92
|
+
|
|
93
|
+
1. **Leverage existing research (if found in Step 1):**
|
|
94
|
+
- Use `view_file` to review research documents
|
|
95
|
+
- Extract key insights, alternatives, and recommendations
|
|
96
|
+
- Identify gaps needing additional investigation
|
|
97
|
+
|
|
98
|
+
2. **Conduct additional web research:**
|
|
99
|
+
- Use `search_web` for:
|
|
100
|
+
- "[technology/pattern] architectural approaches"
|
|
101
|
+
- "[decision area] best practices"
|
|
102
|
+
- "[technology] vs [alternative] comparison"
|
|
103
|
+
- "[pattern] pros and cons"
|
|
104
|
+
|
|
105
|
+
3. **Use `codebase_search` to understand current implementation**
|
|
106
|
+
|
|
107
|
+
4. **Document alternative options:**
|
|
108
|
+
- Current state/status quo option
|
|
109
|
+
- Industry standard approaches
|
|
110
|
+
- Innovative or emerging alternatives
|
|
111
|
+
- Hybrid approaches
|
|
112
|
+
|
|
113
|
+
**Evaluation Framework:**
|
|
114
|
+
For each alternative, evaluate:
|
|
115
|
+
- Technical feasibility and complexity
|
|
116
|
+
- Performance and scalability implications
|
|
117
|
+
- Security and compliance considerations
|
|
118
|
+
- Development effort and timeline
|
|
119
|
+
- Long-term maintenance and evolution
|
|
120
|
+
- Risk assessment and mitigation strategies
|
|
121
|
+
|
|
122
|
+
### Step 5: Document ADR with Decision Rationale
|
|
123
|
+
|
|
124
|
+
**Preparation:**
|
|
125
|
+
|
|
126
|
+
1. **Get current date:**
|
|
127
|
+
```bash
|
|
128
|
+
date +%Y-%m-%d
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
2. **Determine ADR number:**
|
|
132
|
+
- Check existing ADRs in `.code-captain/decision-records/`
|
|
133
|
+
- Use sequential numbering (0001, 0002, etc.)
|
|
134
|
+
|
|
135
|
+
3. **Create ADR using `write_to_file`:**
|
|
136
|
+
|
|
137
|
+
4. **After completion, create memory of the decision:**
|
|
138
|
+
Ask Cascade: "Please create a memory of this architectural decision: [brief summary of the chosen option and key rationale]"
|
|
139
|
+
|
|
140
|
+
## ADR Template
|
|
141
|
+
|
|
142
|
+
```markdown
|
|
143
|
+
# NNNN. [Decision Title]
|
|
144
|
+
|
|
145
|
+
**Date:** [Current date]
|
|
146
|
+
**Status:** [Proposed/Accepted/Deprecated/Superseded]
|
|
147
|
+
**Deciders:** [Names or roles of decision makers]
|
|
148
|
+
**Technical Story:** [Brief reference to related requirement]
|
|
149
|
+
|
|
150
|
+
## Context and Problem Statement
|
|
151
|
+
|
|
152
|
+
[Describe the architectural problem requiring decision. Include business context, technical context, and driving forces.]
|
|
153
|
+
|
|
154
|
+
### Driving Forces
|
|
155
|
+
- **Business Driver 1:** [e.g., Need to support 10x user growth]
|
|
156
|
+
- **Technical Driver 2:** [e.g., Current monolith becoming unmaintainable]
|
|
157
|
+
- **Organizational Driver 3:** [e.g., Team scaling requires better separation]
|
|
158
|
+
|
|
159
|
+
### Assumptions
|
|
160
|
+
- [Any assumptions made during decision process]
|
|
161
|
+
- [External dependencies assumed to remain stable]
|
|
162
|
+
|
|
163
|
+
## Decision Drivers
|
|
164
|
+
|
|
165
|
+
[Key factors influencing this decision, in order of importance]
|
|
166
|
+
- **Driver 1:** [e.g., Scalability requirements]
|
|
167
|
+
- **Driver 2:** [e.g., Team autonomy and development velocity]
|
|
168
|
+
- **Driver 3:** [e.g., Technology stack modernization]
|
|
169
|
+
|
|
170
|
+
## Considered Options
|
|
171
|
+
|
|
172
|
+
### Option 1: [Name, e.g., "Maintain Current Monolithic Architecture"]
|
|
173
|
+
|
|
174
|
+
**Description:** [Brief description]
|
|
175
|
+
|
|
176
|
+
**Pros:**
|
|
177
|
+
- [Positive aspect 1]
|
|
178
|
+
- [Positive aspect 2]
|
|
179
|
+
|
|
180
|
+
**Cons:**
|
|
181
|
+
- [Negative aspect 1]
|
|
182
|
+
- [Negative aspect 2]
|
|
183
|
+
|
|
184
|
+
**Effort:** [Implementation effort assessment]
|
|
185
|
+
**Risk:** [Risk level and key risks]
|
|
186
|
+
|
|
187
|
+
### Option 2: [Name, e.g., "Migrate to Microservices Architecture"]
|
|
188
|
+
|
|
189
|
+
**Description:** [Brief description]
|
|
190
|
+
|
|
191
|
+
**Pros:**
|
|
192
|
+
- [Positive aspect 1]
|
|
193
|
+
- [Positive aspect 2]
|
|
194
|
+
|
|
195
|
+
**Cons:**
|
|
196
|
+
- [Negative aspect 1]
|
|
197
|
+
- [Negative aspect 2]
|
|
198
|
+
|
|
199
|
+
**Effort:** [Implementation effort assessment]
|
|
200
|
+
**Risk:** [Risk level and key risks]
|
|
201
|
+
|
|
202
|
+
### Option 3: [Name, e.g., "Hybrid Modular Monolith Approach"]
|
|
203
|
+
|
|
204
|
+
**Description:** [Brief description]
|
|
205
|
+
|
|
206
|
+
**Pros:**
|
|
207
|
+
- [Positive aspect 1]
|
|
208
|
+
- [Positive aspect 2]
|
|
209
|
+
|
|
210
|
+
**Cons:**
|
|
211
|
+
- [Negative aspect 1]
|
|
212
|
+
- [Negative aspect 2]
|
|
213
|
+
|
|
214
|
+
**Effort:** [Implementation effort assessment]
|
|
215
|
+
**Risk:** [Risk level and key risks]
|
|
216
|
+
|
|
217
|
+
## Decision Outcome
|
|
218
|
+
|
|
219
|
+
**Chosen Option:** [Selected option with brief rationale]
|
|
220
|
+
|
|
221
|
+
### Rationale
|
|
222
|
+
[Detailed explanation of why this option was selected. Reference decision drivers and how this option best addresses them.]
|
|
223
|
+
|
|
224
|
+
### Confirmation
|
|
225
|
+
[How will we know this decision is working? What metrics will we monitor?]
|
|
226
|
+
|
|
227
|
+
## Consequences
|
|
228
|
+
|
|
229
|
+
### Positive Consequences
|
|
230
|
+
- [Positive outcome 1 - improvements this enables]
|
|
231
|
+
- [Positive outcome 2 - capabilities this provides]
|
|
232
|
+
- [Positive outcome 3 - risks this mitigates]
|
|
233
|
+
|
|
234
|
+
### Negative Consequences
|
|
235
|
+
- [Negative outcome 1 - complexities this introduces]
|
|
236
|
+
- [Negative outcome 2 - trade-offs this requires]
|
|
237
|
+
- [Negative outcome 3 - new risks this creates]
|
|
238
|
+
|
|
239
|
+
### Mitigation Strategies
|
|
240
|
+
- [Strategy 1 for addressing negative consequences]
|
|
241
|
+
- [Strategy 2 for managing introduced complexities]
|
|
242
|
+
|
|
243
|
+
## Implementation Notes
|
|
244
|
+
|
|
245
|
+
### Prerequisites
|
|
246
|
+
- [What needs to be in place before implementing]
|
|
247
|
+
- [Dependencies that must be resolved first]
|
|
248
|
+
|
|
249
|
+
### Implementation Steps
|
|
250
|
+
1. [Step 1 - immediate actions required]
|
|
251
|
+
2. [Step 2 - follow-up activities]
|
|
252
|
+
3. [Step 3 - validation and monitoring setup]
|
|
253
|
+
|
|
254
|
+
### Success Criteria
|
|
255
|
+
- [Measurable criteria for successful implementation]
|
|
256
|
+
- [Timeline for achieving implementation milestones]
|
|
257
|
+
|
|
258
|
+
## Follow-up Actions
|
|
259
|
+
- [Action item 1 with owner and timeline]
|
|
260
|
+
- [Action item 2 with owner and timeline]
|
|
261
|
+
- [Review date for evaluating decision effectiveness]
|
|
262
|
+
|
|
263
|
+
## References
|
|
264
|
+
- [Link to related ADRs]
|
|
265
|
+
- [Prior research documents from .code-captain/research/]
|
|
266
|
+
- [External documentation, articles, or research]
|
|
267
|
+
- [Code repositories or examples]
|
|
268
|
+
|
|
269
|
+
## Related Decisions
|
|
270
|
+
- [ADR-XXXX: Related decision that influences this one]
|
|
271
|
+
- [ADR-YYYY: Decision that this supersedes or is superseded by]
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Best Practices
|
|
275
|
+
|
|
276
|
+
### Decision Scope and Focus
|
|
277
|
+
- Focus on one significant architectural decision per ADR
|
|
278
|
+
- Clearly separate problem from potential solutions
|
|
279
|
+
- Include sufficient context for future readers
|
|
280
|
+
- Document decision even if it seems obvious
|
|
281
|
+
- Consider both technical and business implications
|
|
282
|
+
|
|
283
|
+
### Alternatives Analysis
|
|
284
|
+
- Always include "do nothing" or "status quo" option
|
|
285
|
+
- Research industry standards and best practices
|
|
286
|
+
- Consider short-term and long-term implications
|
|
287
|
+
- Include effort and risk assessments for each option
|
|
288
|
+
- Seek diverse perspectives and expert opinions
|
|
289
|
+
|
|
290
|
+
### Decision Documentation
|
|
291
|
+
- Use clear, jargon-free language for new team members
|
|
292
|
+
- Include relevant diagrams, code examples, or architectural sketches
|
|
293
|
+
- Reference external sources and supporting documentation
|
|
294
|
+
- Document both positive and negative consequences honestly
|
|
295
|
+
- Plan for decision review and potential revision
|
|
296
|
+
|
|
297
|
+
### Stakeholder Engagement
|
|
298
|
+
- Involve all teams affected by architectural decision
|
|
299
|
+
- Allow time for thoughtful review and feedback
|
|
300
|
+
- Document dissenting opinions and how they were addressed
|
|
301
|
+
- Ensure decision makers have sufficient context and time
|
|
302
|
+
- Follow up on implementation and measure success
|
|
303
|
+
|
|
304
|
+
## Windsurf Tools Used
|
|
305
|
+
|
|
306
|
+
- `find_by_name`: Locate existing research and ADRs
|
|
307
|
+
- `list_dir`: Explore directory structures
|
|
308
|
+
- `view_file`: Read existing documentation and research
|
|
309
|
+
- `write_to_file`: Create ADR document
|
|
310
|
+
- `codebase_search`: Understand current architectural patterns
|
|
311
|
+
- `search_web`: Research alternatives and best practices
|
|
312
|
+
- `run_command`: Get current date and system information
|
|
313
|
+
|
|
314
|
+
## Windsurf Features Used
|
|
315
|
+
|
|
316
|
+
- **Memories**: After completing the ADR, ask Cascade to "create a memory of the architectural decision and its rationale" for future reference
|
|
317
|
+
|
|
318
|
+
## Common Pitfalls to Avoid
|
|
319
|
+
|
|
320
|
+
- Rushing to document without proper analysis
|
|
321
|
+
- Making decisions without stakeholder input
|
|
322
|
+
- Failing to research alternative approaches thoroughly
|
|
323
|
+
- Not considering long-term consequences
|
|
324
|
+
- Writing ADRs too technical for business stakeholders
|
|
325
|
+
- Not updating ADR status when decisions change
|
|
326
|
+
- Creating ADRs for trivial decisions
|
|
327
|
+
- Not linking ADRs to related architectural documentation
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
*📐 Architecture decisions shape the future. Document them well.*
|