specweave 0.17.16 → 0.17.19
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 +405 -2495
- package/README.md +92 -2
- package/dist/locales/de/.gitkeep +0 -0
- package/dist/locales/de/cli.json +108 -0
- package/dist/locales/en/cli.json +287 -0
- package/dist/locales/en/errors.json +7 -0
- package/dist/locales/en/templates.json +6 -0
- package/dist/locales/es/.gitkeep +0 -0
- package/dist/locales/es/cli.json +41 -0
- package/dist/locales/fr/.gitkeep +0 -0
- package/dist/locales/fr/cli.json +108 -0
- package/dist/locales/ja/.gitkeep +0 -0
- package/dist/locales/ja/cli.json +108 -0
- package/dist/locales/ko/.gitkeep +0 -0
- package/dist/locales/ko/cli.json +108 -0
- package/dist/locales/pt/.gitkeep +0 -0
- package/dist/locales/pt/cli.json +108 -0
- package/dist/locales/ru/.gitkeep +0 -0
- package/dist/locales/ru/cli.json +269 -0
- package/dist/locales/zh/.gitkeep +0 -0
- package/dist/locales/zh/cli.json +108 -0
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.d.ts.map +1 -1
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js +188 -36
- package/dist/plugins/specweave/lib/hooks/sync-living-docs.js.map +1 -1
- package/dist/plugins/specweave-ado/lib/ado-spec-content-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-ado/lib/ado-spec-content-sync.js +65 -6
- package/dist/plugins/specweave-ado/lib/ado-spec-content-sync.js.map +1 -1
- package/dist/plugins/specweave-ado/lib/ado-status-sync.d.ts +54 -0
- package/dist/plugins/specweave-ado/lib/ado-status-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/ado-status-sync.js +86 -0
- package/dist/plugins/specweave-ado/lib/ado-status-sync.js.map +1 -0
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.d.ts +25 -0
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.js +191 -0
- package/dist/plugins/specweave-ado/lib/enhanced-ado-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.d.ts +139 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.js +389 -0
- package/dist/plugins/specweave-github/lib/duplicate-detector.js.map +1 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts +26 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +249 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/epic-content-builder.d.ts +63 -0
- package/dist/plugins/specweave-github/lib/epic-content-builder.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/epic-content-builder.js +216 -0
- package/dist/plugins/specweave-github/lib/epic-content-builder.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-client.d.ts +1 -1
- package/dist/plugins/specweave-github/lib/github-client.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-client.js +25 -13
- package/dist/plugins/specweave-github/lib/github-client.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts +83 -0
- package/dist/plugins/specweave-github/lib/github-epic-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-epic-sync.js +466 -0
- package/dist/plugins/specweave-github/lib/github-epic-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.d.ts +43 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.js +82 -0
- package/dist/plugins/specweave-github/lib/github-status-sync.js.map +1 -0
- package/dist/plugins/specweave-github/lib/task-sync.d.ts +5 -0
- package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/task-sync.js +38 -2
- package/dist/plugins/specweave-github/lib/task-sync.js.map +1 -1
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts +28 -0
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js +156 -0
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.d.ts +66 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.js +274 -0
- package/dist/plugins/specweave-jira/lib/jira-epic-sync.js.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.d.ts +56 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.d.ts.map +1 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.js +93 -0
- package/dist/plugins/specweave-jira/lib/jira-status-sync.js.map +1 -0
- package/dist/spec-parser.js +629 -0
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +107 -3
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.js +48 -3
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
- package/dist/src/core/deduplication/command-deduplicator.d.ts +166 -0
- package/dist/src/core/deduplication/command-deduplicator.d.ts.map +1 -0
- package/dist/src/core/deduplication/command-deduplicator.js +254 -0
- package/dist/src/core/deduplication/command-deduplicator.js.map +1 -0
- package/dist/src/core/living-docs/hierarchy-mapper.d.ts +142 -0
- package/dist/src/core/living-docs/hierarchy-mapper.d.ts.map +1 -0
- package/dist/src/core/living-docs/hierarchy-mapper.js +453 -0
- package/dist/src/core/living-docs/hierarchy-mapper.js.map +1 -0
- package/dist/src/core/living-docs/index.d.ts +10 -84
- package/dist/src/core/living-docs/index.d.ts.map +1 -1
- package/dist/src/core/living-docs/index.js +10 -164
- package/dist/src/core/living-docs/index.js.map +1 -1
- package/dist/src/core/living-docs/spec-distributor.d.ts +106 -0
- package/dist/src/core/living-docs/spec-distributor.d.ts.map +1 -0
- package/dist/src/core/living-docs/spec-distributor.js +823 -0
- package/dist/src/core/living-docs/spec-distributor.js.map +1 -0
- package/dist/src/core/living-docs/types.d.ts +201 -0
- package/dist/src/core/living-docs/types.d.ts.map +1 -0
- package/dist/src/core/living-docs/types.js +15 -0
- package/dist/src/core/living-docs/types.js.map +1 -0
- package/dist/src/core/logging/prompt-logger.d.ts +70 -0
- package/dist/src/core/logging/prompt-logger.d.ts.map +1 -0
- package/dist/src/core/logging/prompt-logger.js +247 -0
- package/dist/src/core/logging/prompt-logger.js.map +1 -0
- package/dist/src/core/status-line/status-line-manager.d.ts +15 -24
- package/dist/src/core/status-line/status-line-manager.d.ts.map +1 -1
- package/dist/src/core/status-line/status-line-manager.js +33 -70
- package/dist/src/core/status-line/status-line-manager.js.map +1 -1
- package/dist/src/core/status-line/types.d.ts +19 -31
- package/dist/src/core/status-line/types.d.ts.map +1 -1
- package/dist/src/core/status-line/types.js +5 -9
- package/dist/src/core/status-line/types.js.map +1 -1
- package/dist/src/core/sync/conflict-resolver.d.ts +66 -0
- package/dist/src/core/sync/conflict-resolver.d.ts.map +1 -0
- package/dist/src/core/sync/conflict-resolver.js +108 -0
- package/dist/src/core/sync/conflict-resolver.js.map +1 -0
- package/dist/src/core/sync/enhanced-content-builder.d.ts +55 -0
- package/dist/src/core/sync/enhanced-content-builder.d.ts.map +1 -0
- package/dist/src/core/sync/enhanced-content-builder.js +202 -0
- package/dist/src/core/sync/enhanced-content-builder.js.map +1 -0
- package/dist/src/core/sync/label-detector.d.ts +66 -0
- package/dist/src/core/sync/label-detector.d.ts.map +1 -0
- package/dist/src/core/sync/label-detector.js +211 -0
- package/dist/src/core/sync/label-detector.js.map +1 -0
- package/dist/src/core/sync/retry-logic.d.ts +64 -0
- package/dist/src/core/sync/retry-logic.d.ts.map +1 -0
- package/dist/src/core/sync/retry-logic.js +165 -0
- package/dist/src/core/sync/retry-logic.js.map +1 -0
- package/dist/src/core/sync/spec-content-sync.d.ts +88 -0
- package/dist/src/core/sync/spec-content-sync.d.ts.map +1 -0
- package/dist/src/core/sync/spec-content-sync.js +5 -0
- package/dist/src/core/sync/spec-content-sync.js.map +1 -0
- package/dist/src/core/sync/spec-increment-mapper.d.ts +100 -0
- package/dist/src/core/sync/spec-increment-mapper.d.ts.map +1 -0
- package/dist/src/core/sync/spec-increment-mapper.js +424 -0
- package/dist/src/core/sync/spec-increment-mapper.js.map +1 -0
- package/dist/src/core/sync/status-cache.d.ts +91 -0
- package/dist/src/core/sync/status-cache.d.ts.map +1 -0
- package/dist/src/core/sync/status-cache.js +140 -0
- package/dist/src/core/sync/status-cache.js.map +1 -0
- package/dist/src/core/sync/status-mapper.d.ts +69 -0
- package/dist/src/core/sync/status-mapper.d.ts.map +1 -0
- package/dist/src/core/sync/status-mapper.js +90 -0
- package/dist/src/core/sync/status-mapper.js.map +1 -0
- package/dist/src/core/sync/status-sync-engine.d.ts +162 -0
- package/dist/src/core/sync/status-sync-engine.d.ts.map +1 -0
- package/dist/src/core/sync/status-sync-engine.js +347 -0
- package/dist/src/core/sync/status-sync-engine.js.map +1 -0
- package/dist/src/core/sync/sync-event-logger.d.ts +99 -0
- package/dist/src/core/sync/sync-event-logger.d.ts.map +1 -0
- package/dist/src/core/sync/sync-event-logger.js +103 -0
- package/dist/src/core/sync/sync-event-logger.js.map +1 -0
- package/dist/src/core/sync/types.d.ts +52 -0
- package/dist/src/core/sync/types.d.ts.map +1 -0
- package/dist/src/core/sync/types.js +5 -0
- package/dist/src/core/sync/types.js.map +1 -0
- package/dist/src/core/sync/workflow-detector.d.ts +95 -0
- package/dist/src/core/sync/workflow-detector.d.ts.map +1 -0
- package/dist/src/core/sync/workflow-detector.js +175 -0
- package/dist/src/core/sync/workflow-detector.js.map +1 -0
- package/dist/src/core/types/config.d.ts +51 -0
- package/dist/src/core/types/config.d.ts.map +1 -1
- package/dist/src/core/types/config.js +47 -0
- package/dist/src/core/types/config.js.map +1 -1
- package/dist/src/core/types/increment-metadata.d.ts +4 -0
- package/dist/src/core/types/increment-metadata.d.ts.map +1 -1
- package/dist/src/core/types/increment-metadata.js.map +1 -1
- package/dist/src/utils/github-url.d.ts +53 -0
- package/dist/src/utils/github-url.d.ts.map +1 -0
- package/dist/src/utils/github-url.js +90 -0
- package/dist/src/utils/github-url.js.map +1 -0
- package/dist/src/utils/spec-parser.d.ts +145 -0
- package/dist/src/utils/spec-parser.d.ts.map +1 -0
- package/dist/src/utils/spec-parser.js +640 -0
- package/dist/src/utils/spec-parser.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
- package/plugins/specweave/agents/pm/AGENT.md +160 -13
- package/plugins/specweave/agents/pm/templates/increment-spec.md +158 -0
- package/plugins/specweave/agents/pm/templates/living-docs-spec.md +113 -0
- package/plugins/specweave/commands/specweave-done.md +163 -0
- package/plugins/specweave/commands/specweave.md +70 -405
- package/plugins/specweave/hooks/hooks.json +4 -0
- package/plugins/specweave/hooks/lib/sync-spec-content.sh +2 -2
- package/plugins/specweave/hooks/lib/update-status-line.sh +79 -111
- package/plugins/specweave/hooks/post-increment-planning.sh +133 -37
- package/plugins/specweave/hooks/pre-command-deduplication.sh +86 -0
- package/plugins/specweave/lib/hooks/sync-living-docs.js +139 -34
- package/plugins/specweave/lib/hooks/sync-living-docs.ts +234 -38
- package/plugins/specweave/skills/SKILLS-INDEX.md +4 -24
- package/plugins/specweave/skills/increment-planner/SKILL.md +94 -0
- package/plugins/specweave/skills/increment-work-router/SKILL.md +466 -0
- package/plugins/specweave-ado/commands/specweave-ado-sync-spec.md +1 -1
- package/plugins/specweave-ado/lib/ado-spec-content-sync.js +49 -5
- package/plugins/specweave-ado/lib/ado-spec-content-sync.ts +72 -6
- package/plugins/specweave-ado/lib/ado-status-sync.js +80 -0
- package/plugins/specweave-ado/lib/ado-status-sync.ts +121 -0
- package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
- package/plugins/specweave-github/commands/specweave-github-cleanup-duplicates.md +205 -0
- package/plugins/specweave-github/commands/specweave-github-sync-epic.md +248 -0
- package/plugins/specweave-github/commands/specweave-github-sync-spec.md +1 -1
- package/plugins/specweave-github/hooks/post-task-completion.sh +32 -0
- package/plugins/specweave-github/lib/duplicate-detector.js +370 -0
- package/plugins/specweave-github/lib/duplicate-detector.ts +525 -0
- package/plugins/specweave-github/lib/enhanced-github-sync.js +220 -0
- package/plugins/specweave-github/lib/enhanced-github-sync.ts +322 -0
- package/plugins/specweave-github/lib/epic-content-builder.js +227 -0
- package/plugins/specweave-github/lib/epic-content-builder.ts +317 -0
- package/plugins/specweave-github/lib/github-client.js +21 -10
- package/plugins/specweave-github/lib/github-client.ts +27 -16
- package/plugins/specweave-github/lib/github-epic-sync.js +488 -0
- package/plugins/specweave-github/lib/github-epic-sync.ts +715 -0
- package/plugins/specweave-github/lib/github-status-sync.js +71 -0
- package/plugins/specweave-github/lib/github-status-sync.ts +107 -0
- package/plugins/specweave-github/lib/task-sync.js +33 -2
- package/plugins/specweave-github/lib/task-sync.ts +44 -2
- package/plugins/specweave-jira/commands/specweave-jira-sync-epic.md +267 -0
- package/plugins/specweave-jira/commands/specweave-jira-sync-spec.md +1 -1
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +134 -0
- package/plugins/specweave-jira/lib/enhanced-jira-sync.ts +196 -0
- package/plugins/specweave-jira/lib/jira-epic-sync.js +304 -0
- package/plugins/specweave-jira/lib/jira-epic-sync.ts +459 -0
- package/plugins/specweave-jira/lib/jira-status-sync.js +79 -0
- package/plugins/specweave-jira/lib/jira-status-sync.ts +139 -0
- package/plugins/specweave-release/commands/specweave-release-platform.md +1 -1
- package/plugins/specweave-release/hooks/post-task-completion.sh +2 -2
- package/src/templates/AGENTS.md.template +88 -1
- package/src/templates/CLAUDE.md.template +49 -0
- package/plugins/specweave/skills/increment-quality-judge/SKILL.md +0 -524
- package/plugins/specweave/skills/plugin-installer/SKILL.md +0 -353
|
@@ -34,6 +34,56 @@ The increment-planner skill automates the creation of implementation plans for A
|
|
|
34
34
|
- Separation of WHAT/WHY (spec) from HOW (plan) from STEPS (tasks with test plans)
|
|
35
35
|
- **v0.7.0+**: Test-Aware Planning (bidirectional AC↔Task↔Test linking)
|
|
36
36
|
- **v0.8.0+**: Multi-Project Support (specs organized by project/team)
|
|
37
|
+
- **v0.18.0+**: Bidirectional Task↔User Story Linking (automatic during `/specweave:done`)
|
|
38
|
+
|
|
39
|
+
## Bidirectional Linking (v0.18.0+)
|
|
40
|
+
|
|
41
|
+
**CRITICAL FEATURE**: When you create tasks, ensure they have **AC**: fields so bidirectional links can be created automatically.
|
|
42
|
+
|
|
43
|
+
### How It Works
|
|
44
|
+
|
|
45
|
+
1. **During Planning**: Create tasks with AC-IDs
|
|
46
|
+
```markdown
|
|
47
|
+
## T-001: Implement User Login
|
|
48
|
+
|
|
49
|
+
**AC**: AC-US1-01, AC-US1-02, AC-US1-03 ← CRITICAL!
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
2. **During Completion**: `/specweave:done` automatically:
|
|
53
|
+
- Extracts user stories to `.specweave/docs/internal/specs/{project}/{feature}/`
|
|
54
|
+
- Parses tasks.md for AC-IDs
|
|
55
|
+
- **Injects bidirectional links** into tasks.md
|
|
56
|
+
- Creates complete traceability (Tasks ↔ User Stories)
|
|
57
|
+
|
|
58
|
+
3. **Result**: Tasks now link back to user stories:
|
|
59
|
+
```markdown
|
|
60
|
+
## T-001: Implement User Login
|
|
61
|
+
|
|
62
|
+
**User Story**: [US-001: User Authentication](../../docs/internal/specs/default/auth-service/us-001-user-authentication.md)
|
|
63
|
+
|
|
64
|
+
**AC**: AC-US1-01, AC-US1-02, AC-US1-03
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Requirements
|
|
68
|
+
|
|
69
|
+
**MUST HAVE** for bidirectional linking:
|
|
70
|
+
- ✅ Tasks with **AC**: field
|
|
71
|
+
- ✅ AC-IDs in format: `AC-US{number}-{criteria}` (e.g., `AC-US1-01`)
|
|
72
|
+
- ✅ Matching user stories in spec.md (e.g., `### US-001:` or `#### US-001:`)
|
|
73
|
+
|
|
74
|
+
**Multi-Project Support**:
|
|
75
|
+
- Works with `specs/default/`, `specs/backend/`, `specs/frontend/`, etc.
|
|
76
|
+
- Paths automatically adapt to project structure
|
|
77
|
+
- No additional configuration needed
|
|
78
|
+
|
|
79
|
+
### Benefits
|
|
80
|
+
|
|
81
|
+
- ✅ **Complete Traceability**: Navigate from tasks to user stories and back
|
|
82
|
+
- ✅ **Automatic**: Zero manual linking during `/specweave:done`
|
|
83
|
+
- ✅ **LLM-Friendly**: AI can understand relationships bidirectionally
|
|
84
|
+
- ✅ **Multi-Project Aware**: Works across all projects
|
|
85
|
+
|
|
86
|
+
**For complete details**: See `.specweave/docs/public/guides/bidirectional-linking.md`
|
|
37
87
|
|
|
38
88
|
## Increment Types (v0.7.0+)
|
|
39
89
|
|
|
@@ -80,6 +130,50 @@ Do NOT activate if:
|
|
|
80
130
|
- ❌ User is already in an active increment planning workflow
|
|
81
131
|
- ❌ Increment files (spec.md, plan.md, tasks.md) are currently being created
|
|
82
132
|
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Increment Naming Convention
|
|
136
|
+
|
|
137
|
+
**CRITICAL**: All increments MUST use descriptive names, not just numbers.
|
|
138
|
+
|
|
139
|
+
**Format**: `####-descriptive-kebab-case-name`
|
|
140
|
+
|
|
141
|
+
**Examples**:
|
|
142
|
+
- ✅ `0001-core-framework`
|
|
143
|
+
- ✅ `0002-core-enhancements`
|
|
144
|
+
- ✅ `0003-intelligent-model-selection`
|
|
145
|
+
- ❌ `0003` (too generic, rejected)
|
|
146
|
+
- ❌ `0004` (no description, rejected)
|
|
147
|
+
|
|
148
|
+
**Rationale**:
|
|
149
|
+
- **Clear intent at a glance** - "0003-intelligent-model-selection" tells you exactly what it does
|
|
150
|
+
- **Easy to reference** - "the model selection increment" vs "increment 3"
|
|
151
|
+
- **Better git history** - Commit messages naturally include feature name
|
|
152
|
+
- **Searchable by feature** - `git log --grep="model-selection"` works
|
|
153
|
+
- **Self-documenting** - Increment folders are readable without opening files
|
|
154
|
+
|
|
155
|
+
**Rules**:
|
|
156
|
+
- `####` = Zero-padded 4-digit number (0001, 0002, 0003, ...)
|
|
157
|
+
- `-descriptive-name` = Kebab-case description (lowercase, hyphens)
|
|
158
|
+
- Max 50 chars total (for readability)
|
|
159
|
+
- No special characters except hyphens
|
|
160
|
+
|
|
161
|
+
**When Creating Increments**:
|
|
162
|
+
```bash
|
|
163
|
+
# ❌ Wrong
|
|
164
|
+
/specweave:increment "0004"
|
|
165
|
+
|
|
166
|
+
# ✅ Correct
|
|
167
|
+
/specweave:increment "0004-cost-optimization"
|
|
168
|
+
/specweave:increment "0005-github-sync-enhancements"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Enforcement**:
|
|
172
|
+
- `/specweave:increment` command validates naming (rejects bare numbers)
|
|
173
|
+
- Code review requirement (descriptive names mandatory)
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
83
177
|
## 🔗 External Sync Architecture (CRITICAL)
|
|
84
178
|
|
|
85
179
|
**Source of Truth**: `.specweave/docs/specs/` (LOCAL) is the permanent source of truth. External tools (GitHub, Jira, ADO) are **MIRRORS**.
|
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: increment-work-router
|
|
3
|
+
description: Smart work continuation system that detects implementation intent and routes to active increment or creates new one. Activates for implement, complete, build, add, develop, work on, continue, resume, finish, fix, resolve, address, let's implement, let's build, start working, begin implementation, add feature, create feature.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Increment Work Router - Smart Work Continuation
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
The increment-work-router skill is an **intelligent work continuation system** that:
|
|
11
|
+
- ✅ Detects implementation/continuation intent (not just new projects)
|
|
12
|
+
- ✅ Checks for active increments automatically
|
|
13
|
+
- ✅ Routes to existing increment OR creates new one
|
|
14
|
+
- ✅ Bridges the gap between planning and execution
|
|
15
|
+
|
|
16
|
+
**Key Insight**: When user says "implement X" or "complete Y", they expect the system to handle routing intelligently without manual commands.
|
|
17
|
+
|
|
18
|
+
## When to Activate
|
|
19
|
+
|
|
20
|
+
This skill activates when user expresses **implementation/continuation intent**:
|
|
21
|
+
|
|
22
|
+
### High-Confidence Triggers (Auto-Route)
|
|
23
|
+
|
|
24
|
+
**Action Verbs** (with specific target):
|
|
25
|
+
- "Implement [feature]"
|
|
26
|
+
- "Complete [task]"
|
|
27
|
+
- "Build [component]"
|
|
28
|
+
- "Add [functionality]"
|
|
29
|
+
- "Develop [module]"
|
|
30
|
+
- "Create [feature]"
|
|
31
|
+
|
|
32
|
+
**Continuation Phrases**:
|
|
33
|
+
- "Work on [feature]"
|
|
34
|
+
- "Continue [increment]"
|
|
35
|
+
- "Resume [work]"
|
|
36
|
+
- "Finish [task]"
|
|
37
|
+
- "Let's implement [X]"
|
|
38
|
+
- "Let's build [Y]"
|
|
39
|
+
- "Start working on [Z]"
|
|
40
|
+
|
|
41
|
+
**Bug/Fix Intent**:
|
|
42
|
+
- "Fix [issue]"
|
|
43
|
+
- "Resolve [bug]"
|
|
44
|
+
- "Address [problem]"
|
|
45
|
+
|
|
46
|
+
### Medium-Confidence Triggers (Clarify)
|
|
47
|
+
|
|
48
|
+
**Vague Intent** (needs target clarification):
|
|
49
|
+
- "Let's continue"
|
|
50
|
+
- "Keep working"
|
|
51
|
+
- "What's next?"
|
|
52
|
+
- "Continue where we left off"
|
|
53
|
+
|
|
54
|
+
### Don't Activate For
|
|
55
|
+
|
|
56
|
+
**Planning/Discussion** (let other skills handle):
|
|
57
|
+
- "What should we build?" → project-kickstarter
|
|
58
|
+
- "How does X work?" → Regular conversation
|
|
59
|
+
- "Should we use Y?" → Technical discussion
|
|
60
|
+
- "Plan a new feature" → increment-planner
|
|
61
|
+
|
|
62
|
+
**Already in Workflow**:
|
|
63
|
+
- User is already executing `/specweave:do`
|
|
64
|
+
- Increment planning is in progress
|
|
65
|
+
- Another skill is handling the request
|
|
66
|
+
|
|
67
|
+
## Core Algorithm
|
|
68
|
+
|
|
69
|
+
### Step 1: Detect Intent
|
|
70
|
+
|
|
71
|
+
Scan user message for implementation keywords:
|
|
72
|
+
```
|
|
73
|
+
Action verbs: implement, complete, build, add, develop, create
|
|
74
|
+
Continuation: work on, continue, resume, finish, start
|
|
75
|
+
Bug/Fix: fix, resolve, address
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Calculate confidence:
|
|
79
|
+
- **High (>80%)**: Action verb + specific target ("implement user auth")
|
|
80
|
+
- **Medium (50-80%)**: Action verb only ("let's continue")
|
|
81
|
+
- **Low (<50%)**: No clear intent
|
|
82
|
+
|
|
83
|
+
### Step 2: Check Active Increments
|
|
84
|
+
|
|
85
|
+
**Read increment state:**
|
|
86
|
+
```bash
|
|
87
|
+
# Find all increments with status = "active"
|
|
88
|
+
find .specweave/increments -name "metadata.json" -type f \
|
|
89
|
+
-exec jq -r 'select(.status == "active") | .id' {} \;
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Three scenarios:**
|
|
93
|
+
1. **One active increment** → Check relevance and route
|
|
94
|
+
2. **Multiple active increments** → Ask user to select
|
|
95
|
+
3. **No active increments** → Suggest creating new one
|
|
96
|
+
|
|
97
|
+
### Step 3: Check Relevance (if active increment exists)
|
|
98
|
+
|
|
99
|
+
**Relatedness Analysis:**
|
|
100
|
+
Compare user's request against active increment:
|
|
101
|
+
- Check increment title/description
|
|
102
|
+
- Check task list (tasks.md)
|
|
103
|
+
- Check spec.md for related features
|
|
104
|
+
|
|
105
|
+
**Scoring:**
|
|
106
|
+
- **High match (>70%)**: Same feature area → Auto-resume
|
|
107
|
+
- **Medium match (40-70%)**: Related area → Ask confirmation
|
|
108
|
+
- **Low match (<40%)**: Unrelated → Suggest new increment
|
|
109
|
+
|
|
110
|
+
### Step 4: Route Intelligently
|
|
111
|
+
|
|
112
|
+
**Scenario A: High relevance to active increment**
|
|
113
|
+
```
|
|
114
|
+
User: "Implement user authentication"
|
|
115
|
+
Active: 0031-user-authentication-system
|
|
116
|
+
|
|
117
|
+
✅ High match → Auto-resume:
|
|
118
|
+
|
|
119
|
+
"I see you have an active increment for user authentication (0031).
|
|
120
|
+
Resuming work on that increment now with /specweave:do..."
|
|
121
|
+
|
|
122
|
+
[Automatically invokes /specweave:do]
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Scenario B: Unrelated to active increment**
|
|
126
|
+
```
|
|
127
|
+
User: "Implement payment processing"
|
|
128
|
+
Active: 0031-user-authentication-system
|
|
129
|
+
|
|
130
|
+
⚠️ Low match → Ask:
|
|
131
|
+
|
|
132
|
+
"I see you have an active increment (0031-user-authentication-system).
|
|
133
|
+
|
|
134
|
+
Your request for payment processing seems unrelated. Would you like to:
|
|
135
|
+
1. **Create new increment** for payment processing (recommended)
|
|
136
|
+
2. **Continue current increment** (0031) and add payment to it
|
|
137
|
+
3. **Pause current** and create new increment
|
|
138
|
+
|
|
139
|
+
What would you prefer?"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Scenario C: No active increment**
|
|
143
|
+
```
|
|
144
|
+
User: "Implement user authentication"
|
|
145
|
+
Active: None
|
|
146
|
+
|
|
147
|
+
→ Suggest new increment:
|
|
148
|
+
|
|
149
|
+
"No active increment found. Let's create one for user authentication.
|
|
150
|
+
|
|
151
|
+
I'm going to create a SpecWeave increment with:
|
|
152
|
+
- Specification (WHAT & WHY)
|
|
153
|
+
- Technical plan (HOW)
|
|
154
|
+
- Task breakdown (STEPS with embedded tests)
|
|
155
|
+
|
|
156
|
+
Creating increment now with /specweave:increment..."
|
|
157
|
+
|
|
158
|
+
[Automatically invokes /specweave:increment "user authentication"]
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Scenario D: Multiple active increments**
|
|
162
|
+
```
|
|
163
|
+
User: "Continue working"
|
|
164
|
+
Active: 0031-user-auth, 0032-payment-system
|
|
165
|
+
|
|
166
|
+
→ Ask to clarify:
|
|
167
|
+
|
|
168
|
+
"You have 2 active increments:
|
|
169
|
+
1. **0031-user-authentication-system** (3/10 tasks complete)
|
|
170
|
+
2. **0032-payment-processing** (1/8 tasks complete)
|
|
171
|
+
|
|
172
|
+
Which one would you like to work on?"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Scenario E: Vague continuation intent**
|
|
176
|
+
```
|
|
177
|
+
User: "Let's continue"
|
|
178
|
+
Active: 0031-user-authentication-system
|
|
179
|
+
|
|
180
|
+
✅ Auto-resume (only one active):
|
|
181
|
+
|
|
182
|
+
"Resuming increment 0031-user-authentication-system...
|
|
183
|
+
Progress: 3/10 tasks complete (30%)
|
|
184
|
+
|
|
185
|
+
Next task: T-004 Implement password hashing
|
|
186
|
+
|
|
187
|
+
[Automatically invokes /specweave:do]"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Integration Architecture
|
|
191
|
+
|
|
192
|
+
**Workflow:**
|
|
193
|
+
```
|
|
194
|
+
User: "Implement [feature]"
|
|
195
|
+
↓
|
|
196
|
+
increment-work-router (detects intent)
|
|
197
|
+
↓
|
|
198
|
+
[Check .specweave/increments/*/metadata.json]
|
|
199
|
+
↓
|
|
200
|
+
┌───────────────────┬──────────────────┬────────────────┐
|
|
201
|
+
│ Active increment │ Multiple active │ No active │
|
|
202
|
+
│ (relevant) │ (ambiguous) │ (none) │
|
|
203
|
+
└─────┬─────────────┴──────┬───────────┴──────┬─────────┘
|
|
204
|
+
│ │ │
|
|
205
|
+
↓ ↓ ↓
|
|
206
|
+
/specweave:do Ask to select /specweave:increment
|
|
207
|
+
(auto-resume) (clarify) (create new)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Calls:**
|
|
211
|
+
- `/specweave:do` - Resume active increment
|
|
212
|
+
- `/specweave:increment` - Create new increment
|
|
213
|
+
- `/specweave:status` - Check increment state (if needed)
|
|
214
|
+
|
|
215
|
+
**Called By:**
|
|
216
|
+
- Automatically when implementation intent detected
|
|
217
|
+
- Works alongside `project-kickstarter` (projects) and `increment-planner` (planning)
|
|
218
|
+
|
|
219
|
+
## Decision Matrix
|
|
220
|
+
|
|
221
|
+
| User Intent | Active Increments | Relevance | Action |
|
|
222
|
+
|-------------|------------------|-----------|--------|
|
|
223
|
+
| "Implement auth" | 1 (auth-related) | High (>70%) | Auto `/specweave:do` |
|
|
224
|
+
| "Implement auth" | 1 (unrelated) | Low (<40%) | Ask: New or add to current? |
|
|
225
|
+
| "Implement auth" | 0 | N/A | Auto `/specweave:increment` |
|
|
226
|
+
| "Implement auth" | 2+ | N/A | Ask which increment |
|
|
227
|
+
| "Let's continue" | 1 | N/A | Auto `/specweave:do` |
|
|
228
|
+
| "Let's continue" | 2+ | N/A | Ask which increment |
|
|
229
|
+
| "Let's continue" | 0 | N/A | "No active increment. What should we build?" |
|
|
230
|
+
|
|
231
|
+
## Relevance Matching Logic
|
|
232
|
+
|
|
233
|
+
**How to determine if request relates to active increment:**
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
function calculateRelevance(userRequest: string, increment: Increment): number {
|
|
237
|
+
let score = 0;
|
|
238
|
+
|
|
239
|
+
// 1. Title/ID match (strongest signal)
|
|
240
|
+
if (increment.title.toLowerCase().includes(extractKeywords(userRequest))) {
|
|
241
|
+
score += 40;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// 2. Tasks match (check tasks.md)
|
|
245
|
+
const tasks = readTasksFile(increment);
|
|
246
|
+
const matchingTasks = tasks.filter(t =>
|
|
247
|
+
t.title.toLowerCase().includes(extractKeywords(userRequest))
|
|
248
|
+
);
|
|
249
|
+
score += (matchingTasks.length / tasks.length) * 30;
|
|
250
|
+
|
|
251
|
+
// 3. Spec match (check spec.md user stories)
|
|
252
|
+
const spec = readSpecFile(increment);
|
|
253
|
+
if (spec.includes(extractKeywords(userRequest))) {
|
|
254
|
+
score += 20;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// 4. Type match (feature vs bug vs hotfix)
|
|
258
|
+
const requestType = detectType(userRequest);
|
|
259
|
+
if (requestType === increment.type) {
|
|
260
|
+
score += 10;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return score; // 0-100
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**Example:**
|
|
268
|
+
```
|
|
269
|
+
User: "Implement JWT token refresh"
|
|
270
|
+
Active: 0031-user-authentication-system
|
|
271
|
+
|
|
272
|
+
Checks:
|
|
273
|
+
✅ Title contains "authentication" (user mentions "JWT token") → +40 points
|
|
274
|
+
✅ Tasks.md has "T-005: Implement JWT refresh logic" → +30 points
|
|
275
|
+
✅ Spec.md mentions "token management" → +20 points
|
|
276
|
+
✅ Both are "feature" type → +10 points
|
|
277
|
+
|
|
278
|
+
Total: 100/100 → High relevance → Auto-resume
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## Examples
|
|
282
|
+
|
|
283
|
+
### Example 1: Auto-Resume (High Relevance)
|
|
284
|
+
|
|
285
|
+
**Context:**
|
|
286
|
+
```
|
|
287
|
+
Active: 0031-user-authentication-system
|
|
288
|
+
Progress: 3/10 tasks complete
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**User:**
|
|
292
|
+
```
|
|
293
|
+
Implement JWT token refresh
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
**increment-work-router:**
|
|
297
|
+
```
|
|
298
|
+
✅ Intent detected: "implement" + specific target
|
|
299
|
+
✅ Active increment found: 0031-user-authentication-system
|
|
300
|
+
✅ Relevance check: 95% match (authentication-related)
|
|
301
|
+
|
|
302
|
+
→ AUTO-RESUME
|
|
303
|
+
|
|
304
|
+
"I see you have an active increment for user authentication (0031).
|
|
305
|
+
Task T-005 'Implement JWT token refresh' is already in your plan.
|
|
306
|
+
|
|
307
|
+
Resuming increment 0031 now with /specweave:do...
|
|
308
|
+
|
|
309
|
+
[Automatically invokes /specweave:do]
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Example 2: Create New (No Active Increment)
|
|
313
|
+
|
|
314
|
+
**Context:**
|
|
315
|
+
```
|
|
316
|
+
Active: None
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**User:**
|
|
320
|
+
```
|
|
321
|
+
Implement payment processing with Stripe
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
**increment-work-router:**
|
|
325
|
+
```
|
|
326
|
+
✅ Intent detected: "implement" + specific target
|
|
327
|
+
❌ No active increment found
|
|
328
|
+
|
|
329
|
+
→ CREATE NEW
|
|
330
|
+
|
|
331
|
+
"No active increment found. Let's create one for payment processing.
|
|
332
|
+
|
|
333
|
+
I'm going to create a SpecWeave increment with:
|
|
334
|
+
- Specification (Stripe integration requirements)
|
|
335
|
+
- Technical plan (API integration, webhooks, security)
|
|
336
|
+
- Task breakdown (implementation steps with tests)
|
|
337
|
+
|
|
338
|
+
Creating increment now with /specweave:increment...
|
|
339
|
+
|
|
340
|
+
[Automatically invokes /specweave:increment "payment processing with Stripe"]
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Example 3: Unrelated Request (Ask)
|
|
344
|
+
|
|
345
|
+
**Context:**
|
|
346
|
+
```
|
|
347
|
+
Active: 0031-user-authentication-system
|
|
348
|
+
Progress: 3/10 tasks complete
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**User:**
|
|
352
|
+
```
|
|
353
|
+
Implement email notifications
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
**increment-work-router:**
|
|
357
|
+
```
|
|
358
|
+
✅ Intent detected: "implement" + specific target
|
|
359
|
+
✅ Active increment found: 0031-user-authentication-system
|
|
360
|
+
⚠️ Relevance check: 15% match (unrelated)
|
|
361
|
+
|
|
362
|
+
→ ASK FOR CLARIFICATION
|
|
363
|
+
|
|
364
|
+
"I see you have an active increment (0031-user-authentication-system) with 3/10 tasks complete.
|
|
365
|
+
|
|
366
|
+
Your request for email notifications seems unrelated. Would you like to:
|
|
367
|
+
1. **Create new increment** for email notifications (recommended - keeps work focused)
|
|
368
|
+
2. **Add to current increment** (0031) - if notifications are for auth emails
|
|
369
|
+
3. **Pause current increment** and start notifications
|
|
370
|
+
|
|
371
|
+
SpecWeave works best with focused increments. What would you prefer?"
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Example 4: Multiple Active (Clarify)
|
|
375
|
+
|
|
376
|
+
**Context:**
|
|
377
|
+
```
|
|
378
|
+
Active: 0031-user-authentication-system (3/10 tasks)
|
|
379
|
+
Active: 0032-payment-processing (1/8 tasks)
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
**User:**
|
|
383
|
+
```
|
|
384
|
+
Let's continue working
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
**increment-work-router:**
|
|
388
|
+
```
|
|
389
|
+
✅ Intent detected: "continue" (vague)
|
|
390
|
+
✅ Multiple active increments found: 2
|
|
391
|
+
|
|
392
|
+
→ ASK TO SELECT
|
|
393
|
+
|
|
394
|
+
"You have 2 active increments:
|
|
395
|
+
|
|
396
|
+
1. **0031-user-authentication-system**
|
|
397
|
+
- Progress: 3/10 tasks (30%)
|
|
398
|
+
- Next: T-004 Implement password hashing
|
|
399
|
+
|
|
400
|
+
2. **0032-payment-processing**
|
|
401
|
+
- Progress: 1/8 tasks (12%)
|
|
402
|
+
- Next: T-002 Set up Stripe SDK
|
|
403
|
+
|
|
404
|
+
Which one would you like to work on?"
|
|
405
|
+
|
|
406
|
+
[Wait for user selection, then invoke /specweave:do {selected-id}]
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
### Example 5: Vague Intent + Single Active (Auto-Resume)
|
|
410
|
+
|
|
411
|
+
**Context:**
|
|
412
|
+
```
|
|
413
|
+
Active: 0031-user-authentication-system (3/10 tasks)
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
**User:**
|
|
417
|
+
```
|
|
418
|
+
What's next?
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
**increment-work-router:**
|
|
422
|
+
```
|
|
423
|
+
✅ Intent detected: "what's next" (continuation)
|
|
424
|
+
✅ One active increment: 0031-user-authentication-system
|
|
425
|
+
|
|
426
|
+
→ AUTO-RESUME
|
|
427
|
+
|
|
428
|
+
"Resuming increment 0031-user-authentication-system...
|
|
429
|
+
Progress: 3/10 tasks complete (30%)
|
|
430
|
+
|
|
431
|
+
Next task: **T-004 Implement password hashing**
|
|
432
|
+
|
|
433
|
+
[Automatically invokes /specweave:do]"
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
## Opt-Out Mechanism
|
|
437
|
+
|
|
438
|
+
Users can override auto-routing with explicit instructions:
|
|
439
|
+
- "Don't resume, create new" → Forces new increment
|
|
440
|
+
- "Just discuss first" → Regular conversation
|
|
441
|
+
- "Plan without implementing" → Routes to `/specweave:increment` only
|
|
442
|
+
- "Show me the current state" → Uses `/specweave:status` instead
|
|
443
|
+
|
|
444
|
+
## Success Criteria
|
|
445
|
+
|
|
446
|
+
- ✅ Users can say "implement X" and work starts automatically
|
|
447
|
+
- ✅ Smart routing to active increments (no manual `/specweave:do`)
|
|
448
|
+
- ✅ Detects unrelated requests and prevents scope creep
|
|
449
|
+
- ✅ No "which increment?" confusion (auto-handles single active)
|
|
450
|
+
- ✅ Clear choices when ambiguous (multiple active or unrelated)
|
|
451
|
+
- ✅ Seamless integration with existing skills (project-kickstarter, increment-planner)
|
|
452
|
+
|
|
453
|
+
## Related Skills
|
|
454
|
+
|
|
455
|
+
- **project-kickstarter**: For NEW project descriptions (complements, doesn't overlap)
|
|
456
|
+
- **increment-planner**: For creating increment structure (invoked by this skill)
|
|
457
|
+
- **specweave-detector**: For checking SpecWeave context
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
**Key Distinction:**
|
|
462
|
+
- `project-kickstarter` = "I want to BUILD a new product" (project-level)
|
|
463
|
+
- `increment-work-router` = "IMPLEMENT this feature/task" (execution-level)
|
|
464
|
+
- `increment-planner` = "PLAN this increment" (planning-level)
|
|
465
|
+
|
|
466
|
+
This skill bridges planning → execution by auto-detecting implementation intent.
|
|
@@ -4,8 +4,9 @@ import {
|
|
|
4
4
|
hasExternalLink,
|
|
5
5
|
updateSpecWithExternalLink
|
|
6
6
|
} from "../../../src/core/spec-content-sync.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import { SpecIncrementMapper } from "../../../src/core/sync/spec-increment-mapper.js";
|
|
8
|
+
import * as path from "path";
|
|
9
|
+
import * as fs from "fs/promises";
|
|
9
10
|
async function syncSpecContentToAdo(options) {
|
|
10
11
|
const { specPath, client, dryRun = false, verbose = false } = options;
|
|
11
12
|
try {
|
|
@@ -44,8 +45,9 @@ async function syncSpecContentToAdo(options) {
|
|
|
44
45
|
async function createAdoFeature(client, spec, options) {
|
|
45
46
|
const { specPath, dryRun, verbose } = options;
|
|
46
47
|
try {
|
|
48
|
+
const tasks = await getTaskMappings(specPath, spec.id);
|
|
47
49
|
const title = `[${spec.id.toUpperCase()}] ${spec.title}`;
|
|
48
|
-
const description = buildAdoDescription(spec);
|
|
50
|
+
const description = buildAdoDescription(spec, tasks);
|
|
49
51
|
if (verbose) {
|
|
50
52
|
console.log(`
|
|
51
53
|
\u{1F4DD} Creating ADO feature:`);
|
|
@@ -125,8 +127,9 @@ async function updateAdoFeature(client, spec, workItemId, options) {
|
|
|
125
127
|
console.log(` - ${change}`);
|
|
126
128
|
}
|
|
127
129
|
}
|
|
130
|
+
const tasks = await getTaskMappings(specPath, spec.id);
|
|
128
131
|
const newTitle = `[${spec.id.toUpperCase()}] ${spec.title}`;
|
|
129
|
-
const newDescription = buildAdoDescription(spec);
|
|
132
|
+
const newDescription = buildAdoDescription(spec, tasks);
|
|
130
133
|
if (dryRun) {
|
|
131
134
|
console.log("\n\u{1F50D} Dry run - would update feature:");
|
|
132
135
|
console.log(` Title: ${newTitle}`);
|
|
@@ -160,7 +163,7 @@ ${newDescription}`);
|
|
|
160
163
|
};
|
|
161
164
|
}
|
|
162
165
|
}
|
|
163
|
-
function buildAdoDescription(spec) {
|
|
166
|
+
function buildAdoDescription(spec, tasks) {
|
|
164
167
|
let html = "";
|
|
165
168
|
if (spec.description) {
|
|
166
169
|
html += `<p>${escapeHtml(spec.description)}</p>`;
|
|
@@ -179,11 +182,52 @@ function buildAdoDescription(spec) {
|
|
|
179
182
|
}
|
|
180
183
|
}
|
|
181
184
|
}
|
|
185
|
+
if (tasks && tasks.length > 0) {
|
|
186
|
+
html += "<h2>Implementation Tasks</h2>";
|
|
187
|
+
html += "<ul>";
|
|
188
|
+
for (const task of tasks) {
|
|
189
|
+
html += `<li><strong>${task.id}</strong>: ${escapeHtml(task.title)}`;
|
|
190
|
+
if (task.userStories && task.userStories.length > 0) {
|
|
191
|
+
html += ` (${task.userStories.join(", ")})`;
|
|
192
|
+
}
|
|
193
|
+
html += "</li>";
|
|
194
|
+
}
|
|
195
|
+
html += "</ul>";
|
|
196
|
+
}
|
|
182
197
|
if (spec.metadata.priority) {
|
|
183
198
|
html += `<p><strong>Priority:</strong> ${spec.metadata.priority}</p>`;
|
|
184
199
|
}
|
|
185
200
|
return html;
|
|
186
201
|
}
|
|
202
|
+
async function getTaskMappings(specPath, specId) {
|
|
203
|
+
try {
|
|
204
|
+
const rootDir = await findSpecWeaveRoot(specPath);
|
|
205
|
+
const mapper = new SpecIncrementMapper(rootDir);
|
|
206
|
+
const mapping = await mapper.mapSpecToIncrements(specId);
|
|
207
|
+
if (mapping.increments.length > 0) {
|
|
208
|
+
return mapping.increments[0].tasks;
|
|
209
|
+
}
|
|
210
|
+
return void 0;
|
|
211
|
+
} catch (error) {
|
|
212
|
+
return void 0;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
async function findSpecWeaveRoot(specPath) {
|
|
216
|
+
let currentDir = path.dirname(specPath);
|
|
217
|
+
while (true) {
|
|
218
|
+
const specweaveDir = path.join(currentDir, ".specweave");
|
|
219
|
+
try {
|
|
220
|
+
await fs.access(specweaveDir);
|
|
221
|
+
return currentDir;
|
|
222
|
+
} catch {
|
|
223
|
+
const parentDir = path.dirname(currentDir);
|
|
224
|
+
if (parentDir === currentDir) {
|
|
225
|
+
throw new Error(".specweave directory not found");
|
|
226
|
+
}
|
|
227
|
+
currentDir = parentDir;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
187
231
|
function escapeHtml(text) {
|
|
188
232
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
189
233
|
}
|