specweave 0.26.4 → 0.26.9
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.md +154 -4
- package/bin/specweave.js +15 -0
- package/dist/plugins/specweave-github/lib/completion-calculator.js +2 -2
- package/dist/plugins/specweave-github/lib/completion-calculator.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-feature-sync.d.ts +28 -1
- package/dist/plugins/specweave-github/lib/github-feature-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-feature-sync.js +191 -19
- package/dist/plugins/specweave-github/lib/github-feature-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.d.ts +3 -0
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.js +25 -2
- package/dist/plugins/specweave-github/lib/user-story-issue-builder.js.map +1 -1
- package/dist/src/cli/commands/archive.d.ts +10 -0
- package/dist/src/cli/commands/archive.d.ts.map +1 -0
- package/dist/src/cli/commands/archive.js +78 -0
- package/dist/src/cli/commands/archive.js.map +1 -0
- package/dist/src/cli/commands/init.js +2 -2
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/helpers/init/initial-increment-generator.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/initial-increment-generator.js +48 -8
- package/dist/src/cli/helpers/init/initial-increment-generator.js.map +1 -1
- package/dist/src/core/increment/increment-reopener.d.ts.map +1 -1
- package/dist/src/core/increment/increment-reopener.js +13 -14
- package/dist/src/core/increment/increment-reopener.js.map +1 -1
- package/dist/src/core/increment/metadata-manager.d.ts.map +1 -1
- package/dist/src/core/increment/metadata-manager.js +19 -0
- package/dist/src/core/increment/metadata-manager.js.map +1 -1
- package/dist/src/core/increment/status-change-sync-trigger.d.ts +85 -0
- package/dist/src/core/increment/status-change-sync-trigger.d.ts.map +1 -0
- package/dist/src/core/increment/status-change-sync-trigger.js +137 -0
- package/dist/src/core/increment/status-change-sync-trigger.js.map +1 -0
- package/dist/src/core/increment/sync-circuit-breaker.d.ts +64 -0
- package/dist/src/core/increment/sync-circuit-breaker.d.ts.map +1 -0
- package/dist/src/core/increment/sync-circuit-breaker.js +95 -0
- package/dist/src/core/increment/sync-circuit-breaker.js.map +1 -0
- package/dist/src/core/living-docs/living-docs-sync.d.ts +12 -0
- package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.js +157 -24
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
- package/dist/src/init/repo/types.d.ts +1 -1
- package/package.json +2 -2
- package/plugins/specweave/agents/pm/AGENT.md +13 -7
- package/plugins/specweave/commands/sync-diagnostics.md +227 -0
- package/plugins/specweave/hooks/docs-changed.sh.backup +79 -0
- package/plugins/specweave/hooks/human-input-required.sh.backup +75 -0
- package/plugins/specweave/hooks/post-first-increment.sh.backup +61 -0
- package/plugins/specweave/hooks/post-increment-change.sh.backup +98 -0
- package/plugins/specweave/hooks/post-increment-completion.sh.backup +231 -0
- package/plugins/specweave/hooks/post-increment-planning.sh.backup +1048 -0
- package/plugins/specweave/hooks/post-increment-status-change.sh.backup +147 -0
- package/plugins/specweave/hooks/post-spec-update.sh.backup +158 -0
- package/plugins/specweave/hooks/post-user-story-complete.sh.backup +179 -0
- package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +83 -0
- package/plugins/specweave/hooks/pre-implementation.sh.backup +67 -0
- package/plugins/specweave/hooks/pre-task-completion.sh.backup +194 -0
- package/plugins/specweave/hooks/pre-tool-use.sh.backup +133 -0
- package/plugins/specweave/hooks/user-prompt-submit.sh +20 -8
- package/plugins/specweave/hooks/user-prompt-submit.sh.backup +386 -0
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +19 -0
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -1
- package/plugins/specweave/skills/brownfield-analyzer/SKILL.md +267 -868
- package/plugins/specweave/skills/increment-planner/SKILL.md +379 -1245
- package/plugins/specweave/skills/role-orchestrator/SKILL.md +293 -969
- package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +353 -0
- package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +172 -0
- package/plugins/specweave-ado/lib/ado-multi-project-sync.js +1 -0
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
- package/plugins/specweave-docs/skills/technical-writing/SKILL.md +333 -839
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +1080 -0
- package/plugins/specweave-github/hooks/post-task-completion.sh.backup +258 -0
- package/plugins/specweave-github/lib/completion-calculator.js +1 -1
- package/plugins/specweave-github/lib/completion-calculator.ts +2 -2
- package/plugins/specweave-github/lib/github-feature-sync.js +152 -18
- package/plugins/specweave-github/lib/github-feature-sync.ts +225 -22
- package/plugins/specweave-github/lib/user-story-issue-builder.js +21 -1
- package/plugins/specweave-github/lib/user-story-issue-builder.ts +31 -3
- package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +172 -0
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +3 -3
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +981 -0
- package/plugins/specweave-release/hooks/post-task-completion.sh.backup +110 -0
- package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +269 -749
- package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +318 -810
|
@@ -3,1006 +3,405 @@ name: brownfield-analyzer
|
|
|
3
3
|
description: Analyzes existing brownfield projects to map documentation structure to SpecWeave's PRD/HLD/Spec/Runbook pattern. Scans folders, classifies documents, detects external tools (Jira, ADO, GitHub), and creates project context map for just-in-time migration. Activates for brownfield, existing project, migrate, analyze structure, legacy documentation.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Brownfield Analyzer
|
|
6
|
+
# Brownfield Analyzer
|
|
7
7
|
|
|
8
|
-
**
|
|
9
|
-
|
|
10
|
-
**When to Use**: When onboarding an existing project to SpecWeave.
|
|
11
|
-
|
|
12
|
-
**Philosophy**: Document structure migration (one-time), feature migration (just-in-time per increment). NO big-bang planning of all features upfront.
|
|
8
|
+
**Self-contained brownfield project analysis for ANY existing codebase.**
|
|
13
9
|
|
|
14
10
|
---
|
|
15
11
|
|
|
16
|
-
##
|
|
12
|
+
## Purpose
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
2. **Scan Project Structure** - Recursively scan folders for documentation
|
|
20
|
-
3. **Classify Documents** - Identify PRD, HLD, ADR, Spec, Runbook candidates
|
|
21
|
-
4. **Detect External Tools** - Find Jira, ADO, GitHub project references
|
|
22
|
-
5. **Analyze Diagrams** - Identify architecture diagrams (PNG, SVG, drawio)
|
|
23
|
-
6. **Discover Coding Standards** - Auto-detect naming conventions, patterns, linting rules 🆕
|
|
24
|
-
7. **Generate Migration Plan** - Create actionable migration plan with effort estimate
|
|
25
|
-
8. **Suggest Increment Mapping** - Map Jira Epics/ADO Features to SpecWeave Increments
|
|
26
|
-
9. **Support Two Paths** - Quick Start (incremental) OR Comprehensive (upfront) 🆕
|
|
14
|
+
Analyze existing projects and create migration plan to SpecWeave structure. Two paths supported: Quick Start (incremental) or Comprehensive (upfront).
|
|
27
15
|
|
|
28
16
|
---
|
|
29
17
|
|
|
30
|
-
## Two
|
|
18
|
+
## Two Migration Paths
|
|
31
19
|
|
|
32
|
-
|
|
20
|
+
### Path 1: Quick Start (Recommended for Large Projects)
|
|
33
21
|
|
|
34
|
-
|
|
35
|
-
**Best for**: Large projects (50k+ LOC), fast iteration, small teams
|
|
22
|
+
**Best for**: 50k+ LOC, fast iteration, small teams
|
|
36
23
|
|
|
37
24
|
**Process**:
|
|
38
|
-
1. Initial scan: Document core architecture
|
|
25
|
+
1. Initial scan: Document core architecture (1-3 hours)
|
|
39
26
|
2. Start working immediately
|
|
40
27
|
3. Per increment: Document → Modify → Update docs
|
|
41
28
|
4. Documentation grows with changes
|
|
42
29
|
|
|
43
30
|
**Benefits**:
|
|
44
31
|
- Start in days, not weeks
|
|
45
|
-
- Focus
|
|
32
|
+
- Focus where it matters
|
|
46
33
|
- No analysis paralysis
|
|
47
|
-
- Always safe (document before touching code)
|
|
48
34
|
|
|
49
35
|
### Path 2: Comprehensive Upfront
|
|
50
|
-
|
|
36
|
+
|
|
37
|
+
**Best for**: <50k LOC, teams, regulated industries
|
|
51
38
|
|
|
52
39
|
**Process**:
|
|
53
|
-
1. Full
|
|
40
|
+
1. Full analysis (1-4 weeks)
|
|
54
41
|
2. Document all modules, business rules
|
|
55
|
-
3. Create
|
|
56
|
-
4. Then start increments
|
|
42
|
+
3. Create baseline tests
|
|
43
|
+
4. Then start increments
|
|
57
44
|
|
|
58
45
|
**Benefits**:
|
|
59
46
|
- Complete context upfront
|
|
60
47
|
- Full regression coverage
|
|
61
|
-
-
|
|
62
|
-
-
|
|
48
|
+
- Team coordination
|
|
49
|
+
- Compliance ready
|
|
63
50
|
|
|
64
|
-
### Automatic
|
|
51
|
+
### Automatic Recommendation
|
|
65
52
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
|
69
|
-
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
| **Large** | 50k-200k LOC | 2-4 weeks | Quick Start |
|
|
73
|
-
| **Very Large** | 200k+ LOC | 1-3 months | Quick Start (Mandatory) |
|
|
53
|
+
| Project Size | LOC | Upfront Effort | Recommended |
|
|
54
|
+
|--------------|-----|----------------|-------------|
|
|
55
|
+
| Small | <10k | 4-8 hours | Comprehensive |
|
|
56
|
+
| Medium | 10k-50k | 1-2 weeks | User Choice |
|
|
57
|
+
| Large | 50k-200k | 2-4 weeks | Quick Start |
|
|
58
|
+
| Very Large | 200k+ | 1-3 months | Quick Start (Mandatory) |
|
|
74
59
|
|
|
75
60
|
---
|
|
76
61
|
|
|
77
|
-
##
|
|
78
|
-
|
|
79
|
-
**Keywords**: brownfield, existing project, legacy, migrate, analyze, scan, documentation structure, existing documentation
|
|
80
|
-
|
|
81
|
-
**User Requests**:
|
|
82
|
-
- "Analyze my existing project"
|
|
83
|
-
- "I have a legacy codebase with scattered documentation"
|
|
84
|
-
- "Migrate my project to SpecWeave"
|
|
85
|
-
- "Scan my documentation and suggest structure"
|
|
86
|
-
- "I have Jira epics I want to map to SpecWeave"
|
|
62
|
+
## Analysis Workflow
|
|
87
63
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
## Analysis Process
|
|
91
|
-
|
|
92
|
-
### Step 0: Complexity Assessment 🆕
|
|
93
|
-
|
|
94
|
-
**FIRST, estimate project size to recommend path**:
|
|
95
|
-
|
|
96
|
-
**Metrics to collect**:
|
|
97
|
-
```typescript
|
|
98
|
-
interface ComplexityMetrics {
|
|
99
|
-
totalLOC: number; // Lines of code
|
|
100
|
-
totalFiles: number; // Number of files
|
|
101
|
-
languages: string[]; // Programming languages detected
|
|
102
|
-
modules: number; // Estimated number of modules
|
|
103
|
-
dependencies: number; // External dependencies
|
|
104
|
-
testCoverage: number; // Existing test coverage (%)
|
|
105
|
-
documentationFiles: number; // Existing docs
|
|
106
|
-
diagramsFound: number; // Existing diagrams
|
|
107
|
-
externalTools: string[]; // Jira, ADO, GitHub detected
|
|
108
|
-
}
|
|
109
|
-
```
|
|
64
|
+
### Step 1: Project Assessment
|
|
110
65
|
|
|
111
|
-
**LOC Estimation Commands**:
|
|
112
66
|
```bash
|
|
113
|
-
#
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
# Or use tokei (faster)
|
|
117
|
-
tokei
|
|
118
|
-
|
|
119
|
-
# Or manual approach
|
|
120
|
-
find . -name "*.ts" -o -name "*.js" | xargs wc -l
|
|
67
|
+
# Scan project
|
|
68
|
+
find . -type f -name "*.ts" -o -name "*.js" -o -name "*.py" | wc -l
|
|
69
|
+
find . -type f \( -name "*.ts" -o -name "*.js" \) -exec wc -l {} + | awk '{sum+=$1} END {print sum}'
|
|
121
70
|
```
|
|
122
71
|
|
|
123
|
-
**
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (metrics.totalLOC < 10_000) {
|
|
129
|
-
return {
|
|
130
|
-
size: "Small",
|
|
131
|
-
effort: "4-8 hours",
|
|
132
|
-
recommendedPath: "Comprehensive Upfront",
|
|
133
|
-
confidence: "High"
|
|
134
|
-
};
|
|
135
|
-
} else if (metrics.totalLOC < 50_000) {
|
|
136
|
-
return {
|
|
137
|
-
size: "Medium",
|
|
138
|
-
effort: "1-2 weeks",
|
|
139
|
-
recommendedPath: "User Choice (Ask preference)",
|
|
140
|
-
confidence: "Medium"
|
|
141
|
-
};
|
|
142
|
-
} else if (metrics.totalLOC < 200_000) {
|
|
143
|
-
return {
|
|
144
|
-
size: "Large",
|
|
145
|
-
effort: "2-4 weeks",
|
|
146
|
-
recommendedPath: "Quick Start",
|
|
147
|
-
confidence: "High"
|
|
148
|
-
};
|
|
149
|
-
} else {
|
|
150
|
-
return {
|
|
151
|
-
size: "Very Large",
|
|
152
|
-
effort: "1-3 months",
|
|
153
|
-
recommendedPath: "Quick Start (Mandatory)",
|
|
154
|
-
confidence: "Critical"
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
```
|
|
72
|
+
**Calculate**:
|
|
73
|
+
- Total files
|
|
74
|
+
- Total LOC
|
|
75
|
+
- Module count
|
|
76
|
+
- Test coverage (if exists)
|
|
159
77
|
|
|
160
|
-
**Output
|
|
161
|
-
```
|
|
162
|
-
🔍 Analyzing project complexity...
|
|
163
|
-
|
|
164
|
-
Metrics:
|
|
165
|
-
• 85,420 LOC detected
|
|
166
|
-
• 342 files analyzed
|
|
167
|
-
• Languages: TypeScript (65%), JavaScript (30%), CSS (5%)
|
|
168
|
-
• Estimated modules: 12
|
|
169
|
-
• Test coverage: 45%
|
|
170
|
-
• Existing docs: 23 files
|
|
171
|
-
• External tools: Jira (PROJ-*)
|
|
172
|
-
|
|
173
|
-
Complexity Assessment: LARGE PROJECT
|
|
174
|
-
• Size: Large (85k LOC)
|
|
175
|
-
• Full analysis effort: 2-3 weeks
|
|
176
|
-
• Recommended path: Quick Start
|
|
177
|
-
|
|
178
|
-
Recommendation:
|
|
179
|
-
✓ Document core architecture only (2-3 hours)
|
|
180
|
-
✓ Start working immediately
|
|
181
|
-
✓ Document incrementally per feature
|
|
182
|
-
→ Avoid 2-3 week upfront analysis
|
|
183
|
-
|
|
184
|
-
Alternative:
|
|
185
|
-
⚠️ Comprehensive upfront (2-3 weeks)
|
|
186
|
-
→ Only if you need full context before starting
|
|
187
|
-
|
|
188
|
-
Proceed with Quick Start? (y/n)
|
|
78
|
+
**Output**:
|
|
189
79
|
```
|
|
80
|
+
📊 Project Analysis
|
|
81
|
+
Files: 1,245
|
|
82
|
+
LOC: 45,678
|
|
83
|
+
Modules: 23
|
|
84
|
+
Tests: 45% coverage
|
|
190
85
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
### Step 1: Initial Scan
|
|
194
|
-
|
|
195
|
-
**Scan depth depends on chosen path**:
|
|
196
|
-
|
|
197
|
-
#### Quick Start Path:
|
|
198
|
-
**Scan ONLY for**:
|
|
199
|
-
- Core architecture files (`architecture/**/*.md`)
|
|
200
|
-
- Main README files
|
|
201
|
-
- Tech stack indicators (`package.json`, `requirements.txt`, `.csproj`)
|
|
202
|
-
- High-level business domains (folder structure)
|
|
203
|
-
- Critical patterns (auth, payment, security)
|
|
204
|
-
|
|
205
|
-
**Skip detailed**:
|
|
206
|
-
- Individual module documentation
|
|
207
|
-
- Detailed business rules
|
|
208
|
-
- Code-level documentation
|
|
209
|
-
|
|
210
|
-
**Result**: High-level understanding (1-3 hours)
|
|
211
|
-
|
|
212
|
-
#### Comprehensive Path:
|
|
213
|
-
**Scan ALL patterns**:
|
|
214
|
-
```
|
|
215
|
-
docs/**/*.md
|
|
216
|
-
documentation/**/*.md
|
|
217
|
-
wiki/**/*.md
|
|
218
|
-
architecture/**/*.{md,png,svg,drawio}
|
|
219
|
-
runbooks/**/*.md
|
|
220
|
-
**/*spec*.{md,yaml,json}
|
|
221
|
-
**/*design*.md
|
|
222
|
-
**/*decision*.md
|
|
223
|
-
**/*adr*.md
|
|
224
|
-
**/*rfc*.md
|
|
225
|
-
**/README.md
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
**Exclude**:
|
|
229
|
-
```
|
|
230
|
-
node_modules/**
|
|
231
|
-
vendor/**
|
|
232
|
-
dist/**
|
|
233
|
-
build/**
|
|
234
|
-
.git/**
|
|
86
|
+
💡 Recommendation: Medium project → User choice (Quick Start or Comprehensive)
|
|
235
87
|
```
|
|
236
88
|
|
|
237
89
|
### Step 2: Document Classification
|
|
238
90
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
#### PRD Candidates (Strategy)
|
|
242
|
-
**Indicators**:
|
|
243
|
-
- Filenames: `*requirement*`, `*spec*`, `*product*`, `*feature*`, `*prd*`
|
|
244
|
-
- Content keywords: "user story", "acceptance criteria", "success metrics", "business goal", "target users"
|
|
245
|
-
- Section headers: "Problem", "Requirements", "User Stories", "Acceptance Criteria"
|
|
246
|
-
|
|
247
|
-
**Output**: `prd-{name}.md` → `docs/internal/strategy/`
|
|
248
|
-
|
|
249
|
-
#### HLD Candidates (Architecture)
|
|
250
|
-
**Indicators**:
|
|
251
|
-
- Filenames: `*architecture*`, `*design*`, `*system*`, `*hld*`
|
|
252
|
-
- Content keywords: "component diagram", "data model", "system design", "architecture overview"
|
|
253
|
-
- Section headers: "Architecture", "Components", "Data Model", "Integrations"
|
|
254
|
-
- Diagrams present (PNG, SVG, Mermaid)
|
|
255
|
-
|
|
256
|
-
**Output**: `hld-{system}.md` → `docs/internal/architecture/`
|
|
257
|
-
|
|
258
|
-
#### ADR Candidates (Architecture Decisions)
|
|
259
|
-
**Indicators**:
|
|
260
|
-
- Filenames: `*decision*`, `*adr*`, `*choice*`
|
|
261
|
-
- Content keywords: "we decided", "rationale", "alternatives considered", "consequences"
|
|
262
|
-
- Section headers: "Decision", "Context", "Consequences", "Alternatives"
|
|
263
|
-
- Sequential numbering (0001, 0002, etc.)
|
|
91
|
+
Scan for documentation:
|
|
264
92
|
|
|
265
|
-
**
|
|
93
|
+
**PRD Candidates** (Product Requirements):
|
|
94
|
+
- `requirements.md`, `PRD.md`, `product-spec.md`
|
|
95
|
+
- `docs/product/`, `specs/requirements/`
|
|
266
96
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
-
|
|
270
|
-
- Content keywords: "API design", "endpoint", "schema", "request/response", "OpenAPI"
|
|
271
|
-
- File formats: `.yaml`, `.json`, `.openapi`
|
|
272
|
-
- Section headers: "API", "Endpoints", "Schema", "Data Flow"
|
|
97
|
+
**HLD Candidates** (High-Level Design):
|
|
98
|
+
- `architecture.md`, `design.md`, `ARCHITECTURE.md`
|
|
99
|
+
- `docs/architecture/`, `docs/design/`
|
|
273
100
|
|
|
274
|
-
**
|
|
101
|
+
**ADR Candidates** (Architecture Decision Records):
|
|
102
|
+
- `adr/`, `decisions/`, `docs/decisions/`
|
|
103
|
+
- Files with "ADR-" prefix or "decision" in name
|
|
275
104
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
-
|
|
279
|
-
- Content keywords: "procedure", "step-by-step", "troubleshooting", "incident", "monitoring"
|
|
280
|
-
- Section headers: "Procedures", "Common Failures", "Diagnostics", "SLO", "Escalation"
|
|
105
|
+
**Spec Candidates** (Technical Specs):
|
|
106
|
+
- `spec.md`, `technical-spec.md`
|
|
107
|
+
- `docs/specs/`, `docs/technical/`
|
|
281
108
|
|
|
282
|
-
**
|
|
109
|
+
**Runbook Candidates** (Operations):
|
|
110
|
+
- `runbook.md`, `operations.md`, `deployment.md`
|
|
111
|
+
- `docs/ops/`, `docs/runbooks/`
|
|
283
112
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
-
|
|
287
|
-
- Content keywords: "security policy", "compliance", "audit", "data retention", "privacy"
|
|
288
|
-
|
|
289
|
-
**Output**: `{topic}.md` → `docs/internal/governance/`
|
|
113
|
+
**Diagrams**:
|
|
114
|
+
- `*.png`, `*.svg`, `*.drawio`, `*.mmd`
|
|
115
|
+
- `diagrams/`, `docs/diagrams/`
|
|
290
116
|
|
|
291
117
|
### Step 3: External Tool Detection
|
|
292
118
|
|
|
293
|
-
**
|
|
294
|
-
|
|
295
|
-
#### Jira
|
|
296
|
-
**Patterns**:
|
|
297
|
-
- URLs: `https://*.atlassian.net/browse/*`
|
|
298
|
-
- Project keys: `[A-Z]+-\d+` (e.g., PROJ-123)
|
|
299
|
-
- Files: `.jira-config`, `jira.yaml`
|
|
300
|
-
|
|
301
|
-
**Extract**:
|
|
302
|
-
- Jira URL
|
|
303
|
-
- Project key
|
|
304
|
-
- Active Epics (via Jira API if credentials provided)
|
|
305
|
-
|
|
306
|
-
#### Azure DevOps
|
|
307
|
-
**Patterns**:
|
|
308
|
-
- URLs: `https://dev.azure.com/*`
|
|
309
|
-
- Work item IDs: `#\d+`
|
|
310
|
-
- Files: `azure-pipelines.yml`
|
|
311
|
-
|
|
312
|
-
**Extract**:
|
|
313
|
-
- ADO URL
|
|
314
|
-
- Project name
|
|
315
|
-
- Active Epics/Features
|
|
316
|
-
|
|
317
|
-
#### GitHub
|
|
318
|
-
**Patterns**:
|
|
319
|
-
- URLs: `https://github.com/*/*`
|
|
320
|
-
- Issue references: `#\d+`
|
|
321
|
-
- Files: `.github/`, `CODEOWNERS`
|
|
322
|
-
|
|
323
|
-
**Extract**:
|
|
324
|
-
- Repository
|
|
325
|
-
- Active Milestones
|
|
326
|
-
- Open Issues
|
|
327
|
-
|
|
328
|
-
### Step 4: Diagram Analysis
|
|
329
|
-
|
|
330
|
-
**Identify diagrams**:
|
|
331
|
-
- PNG files in `architecture/`, `diagrams/`, `docs/`
|
|
332
|
-
- DrawIO files (`.drawio`)
|
|
333
|
-
- SVG files
|
|
334
|
-
- Mermaid diagrams (already in markdown)
|
|
335
|
-
|
|
336
|
-
**Conversion plan**:
|
|
337
|
-
- PNG/DrawIO → Suggest Mermaid conversion
|
|
338
|
-
- Estimate: 15-30 minutes per diagram
|
|
339
|
-
|
|
340
|
-
### Step 4.5: Coding Standards Discovery 🆕
|
|
341
|
-
|
|
342
|
-
**Auto-detect coding standards from codebase** using code-standards-detective agent.
|
|
343
|
-
|
|
344
|
-
**Execution**:
|
|
119
|
+
**Jira Integration**:
|
|
345
120
|
```bash
|
|
346
|
-
#
|
|
347
|
-
|
|
121
|
+
# Search for Jira references
|
|
122
|
+
grep -r "JIRA" . --include="*.md" --include="*.txt"
|
|
123
|
+
grep -r "jira.atlassian" . --include="*.md"
|
|
348
124
|
```
|
|
349
125
|
|
|
350
|
-
**
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
4. **Type Safety** - Count `any` usage, interface vs type preference
|
|
355
|
-
5. **Error Handling** - Analyze try/catch patterns, custom error classes
|
|
356
|
-
|
|
357
|
-
**Statistical Analysis**:
|
|
358
|
-
- Confidence levels (HIGH 90%+, MEDIUM 70-89%, LOW 50-69%)
|
|
359
|
-
- Real code examples from codebase
|
|
360
|
-
- Inconsistency warnings
|
|
361
|
-
|
|
362
|
-
**Output**:
|
|
363
|
-
```
|
|
364
|
-
.specweave/docs/internal/governance/coding-standards-analysis.md
|
|
126
|
+
**Azure DevOps**:
|
|
127
|
+
```bash
|
|
128
|
+
grep -r "dev.azure.com" . --include="*.md"
|
|
129
|
+
grep -r "visualstudio.com" . --include="*.md"
|
|
365
130
|
```
|
|
366
131
|
|
|
367
|
-
**
|
|
368
|
-
|
|
369
|
-
-
|
|
370
|
-
|
|
371
|
-
- ✅ Provides baseline for code quality improvements
|
|
372
|
-
- ✅ Identifies technical debt (large functions, missing error handling)
|
|
373
|
-
|
|
374
|
-
**Integration**: This step runs automatically during brownfield analysis, providing coding standards context alongside documentation structure.
|
|
375
|
-
|
|
376
|
-
### Step 5: Effort Estimation
|
|
377
|
-
|
|
378
|
-
**Calculate total effort**:
|
|
132
|
+
**GitHub Issues**:
|
|
133
|
+
```bash
|
|
134
|
+
grep -r "github.com/.*/issues" . --include="*.md"
|
|
135
|
+
```
|
|
379
136
|
|
|
380
|
-
|
|
381
|
-
|------|-----------------|-------------|-------------|
|
|
382
|
-
| Migrate documents | 5 min | X | Y |
|
|
383
|
-
| Convert diagrams | 20 min | X | Y |
|
|
384
|
-
| Number ADRs | 2 min | X | Y |
|
|
385
|
-
| Create metadata.yaml | 10 min | X | Y |
|
|
386
|
-
| Sync with Jira/ADO | 15 min | X | Y |
|
|
387
|
-
| Verification | - | - | 0.5 |
|
|
388
|
-
| **Total** | | | **Z hours** |
|
|
137
|
+
### Step 4: Coding Standards Discovery
|
|
389
138
|
|
|
390
|
-
|
|
139
|
+
**Auto-detect**:
|
|
140
|
+
- ESLint config (`.eslintrc`, `eslint.config.js`)
|
|
141
|
+
- Prettier config (`.prettierrc`)
|
|
142
|
+
- TypeScript config (`tsconfig.json`)
|
|
143
|
+
- Test config (`vitest.config`, `jest.config`)
|
|
391
144
|
|
|
392
|
-
|
|
145
|
+
**Analyze patterns**:
|
|
146
|
+
```bash
|
|
147
|
+
# Naming conventions
|
|
148
|
+
grep -rh "^export function" src/ | head -20
|
|
149
|
+
grep -rh "^export class" src/ | head -20
|
|
393
150
|
|
|
394
|
-
|
|
151
|
+
# Import patterns
|
|
152
|
+
grep -rh "^import" src/ | sort | uniq -c | sort -rn | head -10
|
|
153
|
+
```
|
|
395
154
|
|
|
396
|
-
###
|
|
155
|
+
### Step 5: Generate Migration Plan
|
|
397
156
|
|
|
157
|
+
**Quick Start Plan**:
|
|
398
158
|
```markdown
|
|
399
|
-
#
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
- Comprehensive: ~{weeks} weeks (Full documentation)
|
|
418
|
-
|
|
419
|
-
**Recommended Path**: Quick Start
|
|
159
|
+
# Migration Plan: Quick Start Path
|
|
160
|
+
|
|
161
|
+
## Phase 1: Initial Setup (1-2 hours)
|
|
162
|
+
- [ ] Run `specweave init`
|
|
163
|
+
- [ ] Document core architecture only
|
|
164
|
+
- [ ] Create 1-2 ADRs for critical decisions
|
|
165
|
+
|
|
166
|
+
## Phase 2: First Increment (1-3 days)
|
|
167
|
+
- [ ] Select first feature to modify
|
|
168
|
+
- [ ] Document module before touching
|
|
169
|
+
- [ ] Create increment with /specweave:increment
|
|
170
|
+
- [ ] Implement changes
|
|
171
|
+
- [ ] Update docs
|
|
172
|
+
|
|
173
|
+
## Phase 3: Iterate
|
|
174
|
+
- [ ] Repeat per feature
|
|
175
|
+
- [ ] Documentation grows organically
|
|
176
|
+
```
|
|
420
177
|
|
|
421
|
-
**
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
178
|
+
**Comprehensive Plan**:
|
|
179
|
+
```markdown
|
|
180
|
+
# Migration Plan: Comprehensive Path
|
|
181
|
+
|
|
182
|
+
## Phase 1: Documentation Baseline (1-2 weeks)
|
|
183
|
+
- [ ] Map all modules to .specweave/docs/internal/modules/
|
|
184
|
+
- [ ] Create ADRs for major architectural decisions
|
|
185
|
+
- [ ] Document business rules
|
|
186
|
+
- [ ] Identify technical debt
|
|
187
|
+
|
|
188
|
+
## Phase 2: Test Baseline (1 week)
|
|
189
|
+
- [ ] Add baseline tests for core functionality
|
|
190
|
+
- [ ] Target 60-70% coverage
|
|
191
|
+
- [ ] Document test strategy
|
|
192
|
+
|
|
193
|
+
## Phase 3: Structure Migration (2-3 days)
|
|
194
|
+
- [ ] Run `specweave init`
|
|
195
|
+
- [ ] Migrate existing docs
|
|
196
|
+
- [ ] Organize by SpecWeave structure
|
|
197
|
+
|
|
198
|
+
## Phase 4: Ready for Increments
|
|
199
|
+
- [ ] Start feature work with full context
|
|
200
|
+
```
|
|
425
201
|
|
|
426
202
|
---
|
|
427
203
|
|
|
428
|
-
##
|
|
204
|
+
## Migration Checklist
|
|
429
205
|
|
|
430
|
-
|
|
431
|
-
- {Component 1}: {Brief description}
|
|
432
|
-
- {Component 2}: {Brief description}
|
|
433
|
-
- {Component 3}: {Brief description}
|
|
206
|
+
### Before SpecWeave Init
|
|
434
207
|
|
|
435
|
-
|
|
436
|
-
-
|
|
437
|
-
-
|
|
438
|
-
-
|
|
439
|
-
-
|
|
208
|
+
- [ ] Assess project size (LOC, files)
|
|
209
|
+
- [ ] Choose path (Quick Start or Comprehensive)
|
|
210
|
+
- [ ] Backup existing docs
|
|
211
|
+
- [ ] Identify external tool integrations
|
|
212
|
+
- [ ] Check coding standards exist
|
|
440
213
|
|
|
441
|
-
|
|
442
|
-
- Frontend: {frameworks}
|
|
443
|
-
- Backend: {frameworks}
|
|
444
|
-
- Database: {databases}
|
|
445
|
-
- Infrastructure: {platform}
|
|
214
|
+
### During Migration
|
|
446
215
|
|
|
447
|
-
**
|
|
448
|
-
-
|
|
449
|
-
-
|
|
450
|
-
-
|
|
216
|
+
**Quick Start**:
|
|
217
|
+
- [ ] Document core architecture only
|
|
218
|
+
- [ ] Create 1-2 critical ADRs
|
|
219
|
+
- [ ] Set up external tool sync (optional)
|
|
220
|
+
- [ ] Start first increment immediately
|
|
451
221
|
|
|
452
|
-
|
|
222
|
+
**Comprehensive**:
|
|
223
|
+
- [ ] Scan all documentation
|
|
224
|
+
- [ ] Classify and organize docs
|
|
225
|
+
- [ ] Create complete module docs
|
|
226
|
+
- [ ] Document all business rules
|
|
227
|
+
- [ ] Create ADRs for decisions
|
|
228
|
+
- [ ] Add baseline tests
|
|
229
|
+
- [ ] Set up external tool sync
|
|
453
230
|
|
|
454
|
-
|
|
231
|
+
### After Migration
|
|
455
232
|
|
|
456
|
-
-
|
|
457
|
-
-
|
|
233
|
+
- [ ] Verify `.specweave/` structure exists
|
|
234
|
+
- [ ] Test increment workflow
|
|
235
|
+
- [ ] Train team on SpecWeave
|
|
236
|
+
- [ ] Document migration decisions
|
|
458
237
|
|
|
459
238
|
---
|
|
460
239
|
|
|
461
|
-
##
|
|
240
|
+
## Document Mapping
|
|
462
241
|
|
|
463
|
-
|
|
464
|
-
2. ✅ **Create `.specweave/` structure** (5 minutes)
|
|
465
|
-
3. ✅ **Document core architecture** (1-2 hours)
|
|
466
|
-
- Create `.specweave/docs/internal/architecture/core-architecture.md`
|
|
467
|
-
- Document high-level components from above
|
|
468
|
-
4. ✅ **Start first increment** (immediate)
|
|
469
|
-
- Choose feature to implement/modify
|
|
470
|
-
- Document affected code BEFORE modifying
|
|
471
|
-
- Implement with regression tests
|
|
472
|
-
- Update docs AFTER change
|
|
242
|
+
**Map existing docs to SpecWeave structure**:
|
|
473
243
|
|
|
474
|
-
**Total Time to Start**: 2-3 hours
|
|
475
|
-
|
|
476
|
-
**Per-Increment Pattern**:
|
|
477
244
|
```
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
245
|
+
Existing Structure SpecWeave Structure
|
|
246
|
+
───────────────── ───────────────────
|
|
247
|
+
docs/product/ .specweave/docs/internal/strategy/
|
|
248
|
+
docs/architecture/ .specweave/docs/internal/architecture/
|
|
249
|
+
docs/decisions/ .specweave/docs/internal/architecture/adr/
|
|
250
|
+
docs/specs/ .specweave/docs/internal/specs/
|
|
251
|
+
docs/runbooks/ .specweave/docs/public/runbooks/
|
|
252
|
+
docs/api/ .specweave/docs/public/api-docs/
|
|
253
|
+
README.md .specweave/docs/public/README.md
|
|
254
|
+
CONTRIBUTING.md .specweave/docs/public/CONTRIBUTING.md
|
|
482
255
|
```
|
|
483
256
|
|
|
484
257
|
---
|
|
485
258
|
|
|
486
|
-
##
|
|
487
|
-
|
|
488
|
-
The following will be documented **per increment** as needed:
|
|
489
|
-
- Detailed module documentation
|
|
490
|
-
- Complete business rules catalog
|
|
491
|
-
- Full API documentation
|
|
492
|
-
- Comprehensive test coverage
|
|
493
|
-
|
|
494
|
-
**This is intentional** - focuses effort where it matters.
|
|
495
|
-
|
|
496
|
-
---
|
|
497
|
-
|
|
498
|
-
## Alternative: Switch to Comprehensive
|
|
259
|
+
## External Tool Migration
|
|
499
260
|
|
|
500
|
-
|
|
501
|
-
- Run: `brownfield-analyzer --comprehensive`
|
|
502
|
-
- Effort: ~{weeks} weeks
|
|
503
|
-
- Result: Complete specs before any code changes
|
|
261
|
+
### Jira → SpecWeave
|
|
504
262
|
|
|
505
|
-
|
|
263
|
+
**1. Detect Jira usage**:
|
|
264
|
+
```bash
|
|
265
|
+
grep -r "jira" . --include="*.md" | head -5
|
|
506
266
|
```
|
|
507
267
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
**Project**: {project-name}
|
|
514
|
-
**Analyzed**: {date}
|
|
515
|
-
**Mode**: Comprehensive (Upfront Documentation)
|
|
516
|
-
**Total Files Scanned**: {count}
|
|
517
|
-
|
|
518
|
-
---
|
|
519
|
-
|
|
520
|
-
## Complexity Assessment 🆕
|
|
268
|
+
**2. Map Jira structure**:
|
|
269
|
+
- Epic → Feature (FS-XXX)
|
|
270
|
+
- Story → User Story (US-XXX)
|
|
271
|
+
- Task → Task (T-XXX)
|
|
521
272
|
|
|
522
|
-
**
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
---
|
|
527
|
-
|
|
528
|
-
## Executive Summary
|
|
529
|
-
|
|
530
|
-
- **Documentation Files**: {count} markdown files found
|
|
531
|
-
- **Diagrams**: {count} diagrams found ({png}, {drawio}, {svg})
|
|
532
|
-
- **External Tools**: {Jira/ADO/GitHub detected}
|
|
533
|
-
- **Suggested Increments**: {count} (based on {Jira Epics/ADO Features})
|
|
534
|
-
- **Estimated Migration Effort**: {hours} hours
|
|
535
|
-
|
|
536
|
-
---
|
|
537
|
-
|
|
538
|
-
## Existing Documentation Structure
|
|
273
|
+
**3. Sync strategy**:
|
|
274
|
+
```bash
|
|
275
|
+
# Option 1: Import existing Jira items
|
|
276
|
+
/specweave-jira:sync --import
|
|
539
277
|
|
|
278
|
+
# Option 2: Start fresh, sync new work only
|
|
279
|
+
# (Use SpecWeave as source of truth)
|
|
540
280
|
```
|
|
541
|
-
{project}/
|
|
542
|
-
├── docs/
|
|
543
|
-
│ ├── requirements.md
|
|
544
|
-
│ ├── architecture.md
|
|
545
|
-
│ └── ... ({count} files)
|
|
546
|
-
├── wiki/
|
|
547
|
-
│ └── ... ({count} files)
|
|
548
|
-
└── ...
|
|
549
|
-
```
|
|
550
|
-
|
|
551
|
-
---
|
|
552
281
|
|
|
553
|
-
|
|
282
|
+
### Azure DevOps → SpecWeave
|
|
554
283
|
|
|
555
|
-
|
|
556
|
-
-
|
|
557
|
-
-
|
|
558
|
-
-
|
|
284
|
+
**Map work items**:
|
|
285
|
+
- Feature → Feature (FS-XXX)
|
|
286
|
+
- User Story → User Story (US-XXX)
|
|
287
|
+
- Task → Task (T-XXX)
|
|
559
288
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
-
|
|
563
|
-
|
|
564
|
-
### Architecture Decision Records (ADR candidates)
|
|
565
|
-
- `docs/decisions/use-postgres.md` → `docs/internal/architecture/adr/0001-use-postgres.md`
|
|
566
|
-
- `docs/decisions/microservices.md` → `docs/internal/architecture/adr/0002-microservices.md`
|
|
567
|
-
- **Total**: {count} documents (will be numbered 0001-{count})
|
|
568
|
-
|
|
569
|
-
### API Specifications (Spec candidates)
|
|
570
|
-
- `api-specs/booking-api.yaml` → `docs/internal/architecture/rfc/0001-booking-api.md`
|
|
571
|
-
- **Total**: {count} documents
|
|
572
|
-
|
|
573
|
-
### Operations Documents (Runbook candidates)
|
|
574
|
-
- `runbooks/api-server.md` → `docs/internal/operations/runbook-api-server.md`
|
|
575
|
-
- **Total**: {count} documents
|
|
576
|
-
|
|
577
|
-
### Governance Documents
|
|
578
|
-
- `docs/security-policy.md` → `docs/internal/governance/security-model.md`
|
|
579
|
-
- **Total**: {count} documents
|
|
580
|
-
|
|
581
|
-
### Diagrams
|
|
582
|
-
- `architecture/system-diagram.png` → Convert to Mermaid (`hld-system-overview.context.mmd`)
|
|
583
|
-
- **Total**: {count} diagrams ({count} need conversion)
|
|
584
|
-
|
|
585
|
-
---
|
|
586
|
-
|
|
587
|
-
## External Tool Integration (Awareness Only)
|
|
588
|
-
|
|
589
|
-
**NOTE**: We detect external tools for AWARENESS, not for creating increments upfront.
|
|
590
|
-
|
|
591
|
-
### Jira
|
|
592
|
-
- **URL**: https://company.atlassian.net
|
|
593
|
-
- **Project**: PROJ
|
|
594
|
-
- **Active Epics**: {count}
|
|
595
|
-
- PROJ-123: User Authentication
|
|
596
|
-
- PROJ-124: Payment Processing
|
|
597
|
-
- ... (list all)
|
|
598
|
-
|
|
599
|
-
**Context Mapping** (saved to `.specweave/brownfield-context.json`):
|
|
600
|
-
```json
|
|
601
|
-
{
|
|
602
|
-
"jira": {
|
|
603
|
-
"url": "https://company.atlassian.net",
|
|
604
|
-
"project": "PROJ",
|
|
605
|
-
"epics": [
|
|
606
|
-
{
|
|
607
|
-
"id": "PROJ-123",
|
|
608
|
-
"title": "User Authentication",
|
|
609
|
-
"suggestedIncrementName": "0001-user-authentication",
|
|
610
|
-
"status": "In Progress"
|
|
611
|
-
},
|
|
612
|
-
{
|
|
613
|
-
"id": "PROJ-124",
|
|
614
|
-
"title": "Payment Processing",
|
|
615
|
-
"suggestedIncrementName": "0002-payment-processing",
|
|
616
|
-
"status": "To Do"
|
|
617
|
-
}
|
|
618
|
-
]
|
|
619
|
-
}
|
|
620
|
-
}
|
|
289
|
+
**Sync**:
|
|
290
|
+
```bash
|
|
291
|
+
/specweave-ado:sync --import
|
|
621
292
|
```
|
|
622
293
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
### Azure DevOps
|
|
626
|
-
- (if detected, same awareness approach)
|
|
627
|
-
|
|
628
|
-
### GitHub
|
|
629
|
-
- (if detected, same awareness approach)
|
|
630
|
-
|
|
631
|
-
---
|
|
632
|
-
|
|
633
|
-
## Recommended Migration Plan
|
|
634
|
-
|
|
635
|
-
### Phase 1: Structure Creation (15 minutes)
|
|
636
|
-
1. Create `docs/internal/` structure (5 pillars)
|
|
637
|
-
2. Create `docs/public/` structure
|
|
638
|
-
3. Create `features/` directory
|
|
639
|
-
|
|
640
|
-
### Phase 2: Document Migration ({X} hours)
|
|
641
|
-
1. Migrate {count} PRD candidates → `docs/internal/strategy/`
|
|
642
|
-
2. Migrate {count} HLD candidates → `docs/internal/architecture/`
|
|
643
|
-
3. Migrate {count} ADR candidates → `docs/internal/architecture/adr/` (with numbering)
|
|
644
|
-
4. Migrate {count} Spec candidates → `docs/internal/architecture/rfc/` (with numbering)
|
|
645
|
-
5. Migrate {count} Runbook candidates → `docs/internal/operations/`
|
|
646
|
-
6. Migrate {count} Governance docs → `docs/internal/governance/`
|
|
647
|
-
|
|
648
|
-
### Phase 3: Diagram Conversion ({X} hours)
|
|
649
|
-
1. Convert {count} PNG/DrawIO diagrams to Mermaid
|
|
650
|
-
2. Co-locate diagrams with markdown files
|
|
651
|
-
|
|
652
|
-
### Phase 4: External Tool Context ({X} hours) 🔄 CHANGED
|
|
653
|
-
**NOTE**: We DON'T create increments upfront. Instead, we create awareness.
|
|
654
|
-
|
|
655
|
-
1. Create `.specweave/brownfield-context.json` with:
|
|
656
|
-
- Jira Epic inventory ({count} epics detected)
|
|
657
|
-
- ADO Feature inventory (if detected)
|
|
658
|
-
- GitHub Milestone inventory (if detected)
|
|
659
|
-
- Mapping suggestions (Epic ID → suggested increment name)
|
|
660
|
-
2. Document external tool configuration for future sync
|
|
661
|
-
3. When user creates increment via `/specweave:inc`:
|
|
662
|
-
- Auto-detect if it matches a known Epic
|
|
663
|
-
- Offer to link and sync
|
|
664
|
-
- Include Epic context in spec
|
|
665
|
-
|
|
666
|
-
**Why not create increments now?**
|
|
667
|
-
- ❌ User hasn't decided what to work on yet
|
|
668
|
-
- ❌ Creating 50+ placeholder increments is overwhelming
|
|
669
|
-
- ❌ Violates just-in-time philosophy
|
|
670
|
-
- ✅ Just-in-time: Create increment when user chooses to work on it
|
|
671
|
-
|
|
672
|
-
### Phase 5: Verification (30 minutes)
|
|
673
|
-
1. Run `specweave verify`
|
|
674
|
-
2. Review migration report
|
|
675
|
-
3. Manual review of {count} documents flagged for attention
|
|
676
|
-
|
|
677
|
-
---
|
|
678
|
-
|
|
679
|
-
## Effort Estimate
|
|
680
|
-
|
|
681
|
-
| Phase | Estimated Hours |
|
|
682
|
-
|-------|-----------------|
|
|
683
|
-
| Structure Creation | 0.25 |
|
|
684
|
-
| Document Migration | {X} |
|
|
685
|
-
| Diagram Conversion | {Y} |
|
|
686
|
-
| External Tool Context (awareness only) | 0.5 |
|
|
687
|
-
| Verification | 0.5 |
|
|
688
|
-
| **Total** | **{Total} hours** |
|
|
689
|
-
|
|
690
|
-
**Note**: Increments are created just-in-time when user works on features, not upfront.
|
|
691
|
-
|
|
692
|
-
---
|
|
693
|
-
|
|
694
|
-
## Next Steps
|
|
695
|
-
|
|
696
|
-
1. **Review this report** - Confirm document classifications
|
|
697
|
-
2. **Adjust mappings** - Modify if document classifications are incorrect
|
|
698
|
-
3. **Approve migration plan** - Confirm effort estimate
|
|
699
|
-
4. **Execute migration**:
|
|
700
|
-
```bash
|
|
701
|
-
specweave migrate --plan analysis-report.md --execute
|
|
702
|
-
```
|
|
703
|
-
5. **Create brownfield context** - Generate `.specweave/brownfield-context.json` with Epic/Feature inventory
|
|
704
|
-
6. **Start working** - Create your first increment via `/specweave:inc "feature name"`
|
|
705
|
-
- SpecWeave will auto-detect if it matches a Jira Epic
|
|
706
|
-
- Offer to link and sync
|
|
707
|
-
- Include existing code analysis in spec
|
|
708
|
-
|
|
709
|
-
---
|
|
710
|
-
|
|
711
|
-
## Questions for User
|
|
712
|
-
|
|
713
|
-
- [ ] Are document classifications correct?
|
|
714
|
-
- [ ] Should we track external tools (Jira/ADO/GitHub) for awareness?
|
|
715
|
-
- [ ] Any documents to exclude from migration?
|
|
716
|
-
- [ ] Proceed with migration?
|
|
717
|
-
|
|
718
|
-
**Note**: We won't create increments for all Jira Epics upfront. Instead, when you create an increment, we'll offer to link it to a matching Epic if found.
|
|
719
|
-
|
|
720
|
-
---
|
|
294
|
+
### GitHub Issues → SpecWeave
|
|
721
295
|
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
2. ...
|
|
727
|
-
|
|
728
|
-
### HLD Candidates
|
|
729
|
-
1. `docs/architecture/system-design.md`
|
|
730
|
-
2. ...
|
|
731
|
-
|
|
732
|
-
### ADR Candidates
|
|
733
|
-
1. `docs/decisions/use-postgres.md` → `0001-use-postgres.md`
|
|
734
|
-
2. ...
|
|
735
|
-
|
|
736
|
-
(Full list of all classified documents)
|
|
737
|
-
|
|
738
|
-
---
|
|
296
|
+
**Map issues**:
|
|
297
|
+
- Milestone → Feature (FS-XXX)
|
|
298
|
+
- Issue → User Story (US-XXX)
|
|
299
|
+
- Task list → Tasks (T-XXX)
|
|
739
300
|
|
|
740
|
-
**
|
|
301
|
+
**Sync**:
|
|
302
|
+
```bash
|
|
303
|
+
/specweave-github:sync --import
|
|
741
304
|
```
|
|
742
305
|
|
|
743
306
|
---
|
|
744
307
|
|
|
745
|
-
##
|
|
746
|
-
|
|
747
|
-
### Initial Request
|
|
748
|
-
**User**: "Analyze my existing project at /path/to/project"
|
|
749
|
-
|
|
750
|
-
### Your Response (Step 1: Complexity Assessment) 🆕
|
|
751
|
-
|
|
752
|
-
```
|
|
753
|
-
I'll analyze your existing project to determine the best onboarding approach.
|
|
754
|
-
|
|
755
|
-
Step 1: Assessing project complexity...
|
|
308
|
+
## Best Practices
|
|
756
309
|
|
|
757
|
-
|
|
310
|
+
**✅ DO**:
|
|
311
|
+
- Choose appropriate path (Quick Start for large projects)
|
|
312
|
+
- Document before modifying code
|
|
313
|
+
- Migrate incrementally (don't big-bang)
|
|
314
|
+
- Preserve existing docs (don't delete)
|
|
315
|
+
- Use external tool sync for existing items
|
|
316
|
+
- Train team on SpecWeave workflow
|
|
758
317
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
• Test coverage: 45% (from coverage reports)
|
|
767
|
-
• Existing docs: 23 markdown files
|
|
768
|
-
• External tools: Jira (PROJ-*), GitHub
|
|
769
|
-
|
|
770
|
-
Complexity Assessment: LARGE PROJECT
|
|
771
|
-
• Size: Large (85k LOC)
|
|
772
|
-
• Full analysis effort: 2-3 weeks
|
|
773
|
-
• Recommended path: Quick Start
|
|
318
|
+
**❌ DON'T**:
|
|
319
|
+
- Force Comprehensive for 100k+ LOC projects
|
|
320
|
+
- Delete existing documentation
|
|
321
|
+
- Migrate all features upfront (Quick Start)
|
|
322
|
+
- Skip coding standards discovery
|
|
323
|
+
- Ignore external tool integrations
|
|
324
|
+
- Over-analyze in Quick Start mode
|
|
774
325
|
|
|
775
326
|
---
|
|
776
327
|
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
Why?
|
|
780
|
-
✓ Large codebase (85k LOC)
|
|
781
|
-
✓ Full documentation would take 2-3 weeks
|
|
782
|
-
✓ Start delivering value in 2-3 hours instead
|
|
783
|
-
✓ Document incrementally as you modify code
|
|
784
|
-
|
|
785
|
-
Quick Start Process:
|
|
786
|
-
1. Document core architecture only (2-3 hours)
|
|
787
|
-
2. Start first increment immediately
|
|
788
|
-
3. Per increment: Document → Modify → Update
|
|
789
|
-
4. Documentation grows with changes
|
|
790
|
-
|
|
791
|
-
Alternative: Comprehensive Upfront
|
|
792
|
-
⚠️ Full documentation (2-3 weeks)
|
|
793
|
-
→ Only if you need complete context before starting
|
|
328
|
+
## Example: Large Project Migration
|
|
794
329
|
|
|
795
|
-
|
|
330
|
+
**Scenario**: 85k LOC Node.js backend, Jira, 15% test coverage
|
|
796
331
|
|
|
797
|
-
|
|
798
|
-
1. Quick Start (recommended) - Start in 2-3 hours
|
|
799
|
-
2. Comprehensive - Full analysis (2-3 weeks)
|
|
800
|
-
3. Let me decide based on your recommendation
|
|
332
|
+
**Recommended**: Quick Start
|
|
801
333
|
|
|
334
|
+
**Plan**:
|
|
802
335
|
```
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
336
|
+
Week 1: Setup (2 hours)
|
|
337
|
+
- Run specweave init
|
|
338
|
+
- Document core architecture (5 modules)
|
|
339
|
+
- Create 2 ADRs (database, API design)
|
|
340
|
+
- Configure Jira sync
|
|
341
|
+
|
|
342
|
+
Week 1-2: First Increment
|
|
343
|
+
- Select first feature: "Add rate limiting"
|
|
344
|
+
- Document rate-limiting module
|
|
345
|
+
- Create increment with /specweave:increment
|
|
346
|
+
- Implement with TDD
|
|
347
|
+
- Update docs
|
|
348
|
+
|
|
349
|
+
Week 3+: Iterate
|
|
350
|
+
- Repeat per feature
|
|
351
|
+
- Documentation grows to 40% over 3 months
|
|
352
|
+
- Eventually covers critical paths
|
|
806
353
|
```
|
|
807
|
-
Great! I'll perform a Quick Start analysis focusing on core concepts.
|
|
808
|
-
|
|
809
|
-
Step 2: Scanning for core architecture...
|
|
810
|
-
|
|
811
|
-
Found:
|
|
812
|
-
- 12 high-level modules
|
|
813
|
-
- 4 critical patterns (auth, payment, data flow, error handling)
|
|
814
|
-
- 23 existing markdown files
|
|
815
|
-
- 8 diagrams
|
|
816
|
-
- Jira project detected (PROJ) with 12 active epics
|
|
817
|
-
|
|
818
|
-
Extracting core architecture... ✅
|
|
819
354
|
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
**Core Architecture Extracted**:
|
|
823
|
-
- API Gateway (routing, auth)
|
|
824
|
-
- User Service (user management, profiles)
|
|
825
|
-
- Payment Service (Stripe integration)
|
|
826
|
-
- Notification Service (email/SMS)
|
|
827
|
-
- Database Layer (PostgreSQL)
|
|
828
|
-
|
|
829
|
-
**Critical Patterns**:
|
|
830
|
-
- Auth: JWT tokens, refresh mechanism
|
|
831
|
-
- Payment: Stripe webhooks, idempotency
|
|
832
|
-
- Data Flow: Event-driven (Redis pub/sub)
|
|
833
|
-
- Errors: Centralized error handler
|
|
834
|
-
|
|
835
|
-
**Tech Stack**:
|
|
836
|
-
- Frontend: Next.js 14, React, Tailwind
|
|
837
|
-
- Backend: Node.js 20, Express, TypeScript
|
|
838
|
-
- Database: PostgreSQL 16, Prisma ORM
|
|
839
|
-
- Infrastructure: Docker, Hetzner Cloud
|
|
840
|
-
|
|
841
|
-
**External Tools**: Jira (12 active epics) → Can map to increments
|
|
842
|
-
|
|
843
|
-
**Estimated Time to Start**: 2-3 hours (document core architecture)
|
|
355
|
+
**Result**: Started working in 2 hours, documentation grows naturally.
|
|
844
356
|
|
|
845
357
|
---
|
|
846
358
|
|
|
847
|
-
|
|
848
|
-
1. ✅ Create `.specweave/` structure (5 min)
|
|
849
|
-
2. ✅ Document core architecture (2 hours) - I can help
|
|
850
|
-
3. ✅ Start first increment (immediate)
|
|
851
|
-
|
|
852
|
-
Should I:
|
|
853
|
-
1. Create the SpecWeave structure and document core architecture?
|
|
854
|
-
2. Show the full Quick Start report first?
|
|
855
|
-
3. Map Jira epics to increments?
|
|
856
|
-
```
|
|
857
|
-
|
|
858
|
-
### User Chooses Comprehensive
|
|
859
|
-
|
|
860
|
-
```
|
|
861
|
-
Understood! I'll perform a comprehensive analysis of the entire codebase.
|
|
862
|
-
|
|
863
|
-
⚠️ This will take some time for a project of this size.
|
|
864
|
-
|
|
865
|
-
Step 2: Comprehensive scan...
|
|
866
|
-
|
|
867
|
-
Scanning: /path/to/project
|
|
868
|
-
|
|
869
|
-
Found:
|
|
870
|
-
- 342 source files
|
|
871
|
-
- 23 markdown files
|
|
872
|
-
- 8 diagrams
|
|
873
|
-
- Jira project detected (PROJ)
|
|
874
|
-
|
|
875
|
-
Analyzing... (this may take a few minutes)
|
|
876
|
-
|
|
877
|
-
✅ Analysis complete!
|
|
878
|
-
|
|
879
|
-
I've generated a comprehensive analysis report. Here's the summary:
|
|
359
|
+
## Example: Small Project Migration
|
|
880
360
|
|
|
881
|
-
**
|
|
882
|
-
- PRD candidates: 3
|
|
883
|
-
- HLD candidates: 2
|
|
884
|
-
- ADR candidates: 8
|
|
885
|
-
- Spec candidates: 3
|
|
886
|
-
- Runbook candidates: 5
|
|
887
|
-
- Governance: 2
|
|
361
|
+
**Scenario**: 8k LOC Python app, GitHub Issues, 60% test coverage
|
|
888
362
|
|
|
889
|
-
**
|
|
363
|
+
**Recommended**: Comprehensive Upfront
|
|
890
364
|
|
|
891
|
-
**
|
|
892
|
-
|
|
893
|
-
**External Tools**: Jira project PROJ with 12 active epics
|
|
894
|
-
|
|
895
|
-
**Suggested**: Create 12 increments (one per Jira epic)
|
|
896
|
-
|
|
897
|
-
**Estimated Migration Effort**: 2-3 weeks (full documentation)
|
|
898
|
-
|
|
899
|
-
Would you like me to:
|
|
900
|
-
1. Show the full comprehensive report?
|
|
901
|
-
2. Start migration (Phase 1: Structure creation)?
|
|
902
|
-
3. Adjust any classifications?
|
|
365
|
+
**Plan**:
|
|
903
366
|
```
|
|
904
|
-
|
|
905
|
-
|
|
367
|
+
Week 1: Full Documentation (8 hours)
|
|
368
|
+
- Document all 5 modules
|
|
369
|
+
- Create 8 ADRs
|
|
370
|
+
- Map business rules
|
|
371
|
+
- Document API contracts
|
|
372
|
+
|
|
373
|
+
Week 1: Test Baseline (4 hours)
|
|
374
|
+
- Add missing unit tests (80% coverage)
|
|
375
|
+
- Document test strategy
|
|
376
|
+
|
|
377
|
+
Week 1: Structure Migration (2 hours)
|
|
378
|
+
- Run specweave init
|
|
379
|
+
- Migrate existing docs
|
|
380
|
+
- Configure GitHub sync
|
|
381
|
+
|
|
382
|
+
Week 2+: Start Increments
|
|
383
|
+
- Full context available
|
|
384
|
+
- High confidence changes
|
|
906
385
|
```
|
|
907
|
-
Great! I'll execute the migration plan.
|
|
908
|
-
|
|
909
|
-
Step 1: Creating docs/internal/ structure...
|
|
910
|
-
✅ Structure created
|
|
911
|
-
|
|
912
|
-
Step 2: Migrating documents...
|
|
913
|
-
✅ Migrated 3 PRD candidates → docs/internal/strategy/
|
|
914
|
-
✅ Migrated 2 HLD candidates → docs/internal/architecture/
|
|
915
|
-
✅ Migrated 8 ADR candidates → docs/internal/architecture/adr/ (numbered 0001-0008)
|
|
916
|
-
✅ Migrated 3 Spec candidates → docs/internal/architecture/rfc/ (numbered 0001-0003)
|
|
917
|
-
✅ Migrated 5 Runbooks → docs/internal/operations/
|
|
918
|
-
✅ Migrated 2 Governance docs → docs/internal/governance/
|
|
919
|
-
|
|
920
|
-
Step 3: Converting diagrams...
|
|
921
|
-
⏳ Converting 6 PNG/DrawIO diagrams to Mermaid...
|
|
922
|
-
✅ Converted 6 diagrams
|
|
923
|
-
|
|
924
|
-
Step 4: Creating increments...
|
|
925
|
-
✅ Created 12 increments (mapped to Jira epics)
|
|
926
|
-
✅ Created metadata.yaml for each increment
|
|
927
|
-
|
|
928
|
-
Step 5: Syncing with Jira...
|
|
929
|
-
✅ Linked 12 Jira epics to increments
|
|
930
|
-
✅ Synced Epic statuses
|
|
931
|
-
|
|
932
|
-
Step 6: Verification...
|
|
933
|
-
✅ All documents migrated
|
|
934
|
-
✅ All diagrams converted
|
|
935
|
-
✅ All epics mapped
|
|
936
|
-
⚠️ 3 documents need manual review (see verification report)
|
|
937
|
-
|
|
938
|
-
Migration complete! 🎉
|
|
939
386
|
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
Next steps:
|
|
943
|
-
1. Review migrated documents
|
|
944
|
-
2. Run: npm run docs:dev (to view documentation)
|
|
945
|
-
3. Configure ongoing sync: specweave sync --daemon
|
|
946
|
-
```
|
|
387
|
+
**Result**: 2 weeks to full documentation, then smooth increment workflow.
|
|
947
388
|
|
|
948
389
|
---
|
|
949
390
|
|
|
950
|
-
##
|
|
951
|
-
|
|
952
|
-
**When analyzing**:
|
|
953
|
-
- Use `Glob` to find files matching patterns
|
|
954
|
-
- Use `Read` to read document contents
|
|
955
|
-
- Use `Grep` to search for keywords
|
|
391
|
+
## Troubleshooting
|
|
956
392
|
|
|
957
|
-
**
|
|
958
|
-
|
|
959
|
-
// Find all markdown files
|
|
960
|
-
glob("**/*.md", { exclude: ["node_modules/**", "dist/**"] })
|
|
393
|
+
**Issue**: Can't find existing documentation
|
|
394
|
+
**Solution**: Check common locations: `docs/`, `wiki/`, `.github/`, Notion exports
|
|
961
395
|
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
content = read(file)
|
|
965
|
-
classify(content) // PRD, HLD, ADR, Spec, Runbook?
|
|
966
|
-
}
|
|
967
|
-
```
|
|
396
|
+
**Issue**: Too many documents to classify
|
|
397
|
+
**Solution**: Focus on architecture docs first, skip implementation details
|
|
968
398
|
|
|
969
|
-
|
|
399
|
+
**Issue**: Conflicting documentation
|
|
400
|
+
**Solution**: Use git history to find latest/canonical version
|
|
970
401
|
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
**Default scan patterns** are built-in. Advanced users can customize by creating `.specweave/brownfield-config.yaml`:
|
|
974
|
-
|
|
975
|
-
```yaml
|
|
976
|
-
brownfield:
|
|
977
|
-
analysis:
|
|
978
|
-
scan_patterns:
|
|
979
|
-
- "docs/**/*.md"
|
|
980
|
-
- "documentation/**/*.md"
|
|
981
|
-
- "wiki/**/*.md"
|
|
982
|
-
- "architecture/**/*.{md,png,svg,drawio}"
|
|
983
|
-
- "runbooks/**/*.md"
|
|
984
|
-
exclude_patterns:
|
|
985
|
-
- "node_modules/**"
|
|
986
|
-
- "vendor/**"
|
|
987
|
-
- "dist/**"
|
|
988
|
-
diagram_conversion:
|
|
989
|
-
enabled: true
|
|
990
|
-
formats:
|
|
991
|
-
- png
|
|
992
|
-
- drawio
|
|
993
|
-
- svg
|
|
994
|
-
```
|
|
402
|
+
**Issue**: External tool API limits
|
|
403
|
+
**Solution**: Use throttled sync, batch imports
|
|
995
404
|
|
|
996
405
|
---
|
|
997
406
|
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
- [BROWNFIELD-INTEGRATION-STRATEGY.md](../../../docs/internal/delivery/BROWNFIELD-INTEGRATION-STRATEGY.md)
|
|
1001
|
-
- [Tool Concept Mapping](../../../docs/internal/delivery/guides/tool-concept-mapping.md)
|
|
1002
|
-
- [increment-metadata-template.yaml](../../../templates/increment-metadata-template.yaml)
|
|
1003
|
-
|
|
1004
|
-
---
|
|
1005
|
-
|
|
1006
|
-
## Test Cases
|
|
1007
|
-
|
|
1008
|
-
See `test-cases/` directory for validation scenarios.
|
|
407
|
+
**This skill is self-contained and works for ANY brownfield project.**
|