specweave 0.28.3 → 0.28.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -93
- package/dist/src/core/living-docs/feature-consistency-validator.d.ts +129 -0
- package/dist/src/core/living-docs/feature-consistency-validator.d.ts.map +1 -0
- package/dist/src/core/living-docs/feature-consistency-validator.js +445 -0
- package/dist/src/core/living-docs/feature-consistency-validator.js.map +1 -0
- package/dist/src/core/living-docs/index.d.ts +1 -0
- package/dist/src/core/living-docs/index.d.ts.map +1 -1
- package/dist/src/core/living-docs/index.js +1 -0
- package/dist/src/core/living-docs/index.js.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.d.ts +30 -2
- package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.js +74 -4
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
- package/dist/src/core/repo-structure/prompt-consolidator.js +6 -6
- package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
- package/dist/src/sync/frontmatter-updater.d.ts +8 -0
- package/dist/src/sync/frontmatter-updater.d.ts.map +1 -1
- package/dist/src/sync/frontmatter-updater.js +27 -2
- package/dist/src/sync/frontmatter-updater.js.map +1 -1
- package/dist/src/sync/sync-coordinator.d.ts +1 -0
- package/dist/src/sync/sync-coordinator.d.ts.map +1 -1
- package/dist/src/sync/sync-coordinator.js +6 -3
- package/dist/src/sync/sync-coordinator.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave/commands/specweave-sync-specs.md +14 -5
- package/plugins/specweave/commands/specweave-validate-features.md +203 -0
- package/plugins/specweave/commands/specweave-workflow.md +483 -0
- package/plugins/specweave-jira/skills/jira-sync/SKILL.md +4 -4
- package/plugins/specweave-jira/skills/specweave-jira-mapper/SKILL.md +3 -3
- package/plugins/specweave-kafka/skills/kafka-mcp-integration/SKILL.md +17 -0
- package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +3 -1
- package/plugins/specweave-ui/commands/ui-automate.md +5 -28
- package/src/templates/AGENTS.md.template +92 -9
|
@@ -103,11 +103,15 @@ await syncSpecs(args);
|
|
|
103
103
|
|
|
104
104
|
**This will**:
|
|
105
105
|
1. Auto-generate feature ID for greenfield increments (FS-040, FS-041, etc.)
|
|
106
|
-
2.
|
|
107
|
-
|
|
106
|
+
2. **Auto-detect project folder** from:
|
|
107
|
+
- Git remote (GitHub repo name)
|
|
108
|
+
- Sync configuration (JIRA/ADO project)
|
|
109
|
+
- Falls back to "default" if not detected
|
|
110
|
+
3. Parse spec.md for user stories and acceptance criteria
|
|
111
|
+
4. Create living docs structure:
|
|
108
112
|
- `.specweave/docs/internal/specs/_features/FS-XXX/FEATURE.md`
|
|
109
|
-
- `.specweave/docs/internal/specs/
|
|
110
|
-
- `.specweave/docs/internal/specs/
|
|
113
|
+
- `.specweave/docs/internal/specs/{project}/FS-XXX/README.md`
|
|
114
|
+
- `.specweave/docs/internal/specs/{project}/FS-XXX/us-*.md`
|
|
111
115
|
|
|
112
116
|
---
|
|
113
117
|
|
|
@@ -168,6 +172,11 @@ Title: {title from spec.md}
|
|
|
168
172
|
📂 FILE STRUCTURE
|
|
169
173
|
───────────────────────────────────────────────────────
|
|
170
174
|
|
|
175
|
+
**Project folder is auto-detected** from:
|
|
176
|
+
- Git remote (e.g., `sw-qr-menu` for `github.com/user/sw-qr-menu.git`)
|
|
177
|
+
- Sync config (JIRA project key or ADO project name)
|
|
178
|
+
- Falls back to "default" if not detected
|
|
179
|
+
|
|
171
180
|
.specweave/docs/internal/specs/
|
|
172
181
|
├── _epics/ {if epic created}
|
|
173
182
|
│ └── {EPIC-ID}/
|
|
@@ -175,7 +184,7 @@ Title: {title from spec.md}
|
|
|
175
184
|
├── _features/
|
|
176
185
|
│ └── {FS-ID}/
|
|
177
186
|
│ └── FEATURE.md ← Cross-project feature
|
|
178
|
-
└── {project}/ ← Per-project stories
|
|
187
|
+
└── {project}/ ← Per-project stories (auto-detected!)
|
|
179
188
|
└── {FS-ID}/
|
|
180
189
|
├── README.md ← Project context
|
|
181
190
|
├── us-001-{title}.md ← User story 1
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specweave:validate-features
|
|
3
|
+
description: Validate feature folder consistency between _features/ and project folders. Detects orphaned features and auto-repairs discrepancies. Use when features appear in _features but not in project folders.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Validate Feature Folder Consistency
|
|
7
|
+
|
|
8
|
+
Validates that features in `_features/` have corresponding project folders (e.g., `specweave/FS-XXX/`).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## STEP 1: Parse Arguments
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
Arguments: [user's arguments]
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Options**:
|
|
19
|
+
- `--repair`: Auto-repair discrepancies (create missing project folders)
|
|
20
|
+
- `--dry-run`: Show what would be repaired without making changes
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## STEP 2: Run Consistency Validation
|
|
25
|
+
|
|
26
|
+
**Execute**:
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import { FeatureConsistencyValidator } from './dist/src/core/living-docs/feature-consistency-validator.js';
|
|
30
|
+
|
|
31
|
+
const validator = new FeatureConsistencyValidator(process.cwd(), {
|
|
32
|
+
defaultProject: 'specweave'
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Parse repair flag
|
|
36
|
+
const autoRepair = process.argv.includes('--repair');
|
|
37
|
+
const dryRun = process.argv.includes('--dry-run');
|
|
38
|
+
|
|
39
|
+
if (dryRun) {
|
|
40
|
+
console.log('🔍 DRY RUN MODE - No files will be modified\n');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Run validation
|
|
44
|
+
const result = await validator.validate(autoRepair && !dryRun);
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## STEP 3: Report Results
|
|
50
|
+
|
|
51
|
+
**Output format**:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
═══════════════════════════════════════════════════════
|
|
55
|
+
📊 FEATURE CONSISTENCY VALIDATION REPORT
|
|
56
|
+
═══════════════════════════════════════════════════════
|
|
57
|
+
|
|
58
|
+
Total features scanned: {total}
|
|
59
|
+
Consistent: {consistent}
|
|
60
|
+
Discrepancies found: {discrepancies}
|
|
61
|
+
|
|
62
|
+
───────────────────────────────────────────────────────
|
|
63
|
+
{if discrepancies > 0}
|
|
64
|
+
⚠️ DISCREPANCIES FOUND
|
|
65
|
+
|
|
66
|
+
{for each discrepancy}
|
|
67
|
+
Feature: {featureId}
|
|
68
|
+
Type: {type}
|
|
69
|
+
Description: {description}
|
|
70
|
+
Auto-repairable: {yes/no}
|
|
71
|
+
{if linkedIncrement}
|
|
72
|
+
Linked increment: {incrementId} ({exists/not found})
|
|
73
|
+
{/if}
|
|
74
|
+
|
|
75
|
+
{/for}
|
|
76
|
+
───────────────────────────────────────────────────────
|
|
77
|
+
{/if}
|
|
78
|
+
|
|
79
|
+
{if repairs}
|
|
80
|
+
🔧 REPAIR RESULTS
|
|
81
|
+
|
|
82
|
+
{for each repair}
|
|
83
|
+
{✅/❌} {featureId}: {action}
|
|
84
|
+
{if error} Error: {error}{/if}
|
|
85
|
+
{/for}
|
|
86
|
+
{/if}
|
|
87
|
+
|
|
88
|
+
═══════════════════════════════════════════════════════
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## STEP 4: Provide Next Steps
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
🎯 NEXT STEPS
|
|
97
|
+
───────────────────────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
{if discrepancies > 0 && !repair}
|
|
100
|
+
To auto-repair these discrepancies:
|
|
101
|
+
/specweave:validate-features --repair
|
|
102
|
+
|
|
103
|
+
This will:
|
|
104
|
+
• Create missing project folders
|
|
105
|
+
• Generate README.md files
|
|
106
|
+
• Link to existing FEATURE.md
|
|
107
|
+
{/if}
|
|
108
|
+
|
|
109
|
+
{if all repaired}
|
|
110
|
+
✅ All discrepancies have been repaired!
|
|
111
|
+
|
|
112
|
+
Verify the repairs:
|
|
113
|
+
ls -la .specweave/docs/internal/specs/specweave/
|
|
114
|
+
{/if}
|
|
115
|
+
|
|
116
|
+
{if orphaned features}
|
|
117
|
+
⚠️ Some features could not be auto-repaired.
|
|
118
|
+
|
|
119
|
+
Manual intervention required for:
|
|
120
|
+
{list orphaned features}
|
|
121
|
+
|
|
122
|
+
Options:
|
|
123
|
+
1. Delete orphaned _features folder if no longer needed
|
|
124
|
+
2. Re-sync from increment if increment still exists
|
|
125
|
+
3. Create project folder manually
|
|
126
|
+
{/if}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## EXAMPLES
|
|
132
|
+
|
|
133
|
+
### Example 1: Check for discrepancies
|
|
134
|
+
```
|
|
135
|
+
User: /specweave:validate-features
|
|
136
|
+
|
|
137
|
+
Output:
|
|
138
|
+
═══════════════════════════════════════════════════════
|
|
139
|
+
📊 FEATURE CONSISTENCY VALIDATION REPORT
|
|
140
|
+
═══════════════════════════════════════════════════════
|
|
141
|
+
|
|
142
|
+
Total features scanned: 7
|
|
143
|
+
Consistent: 6
|
|
144
|
+
Discrepancies found: 1
|
|
145
|
+
|
|
146
|
+
───────────────────────────────────────────────────────
|
|
147
|
+
⚠️ DISCREPANCIES FOUND
|
|
148
|
+
|
|
149
|
+
Feature: FS-062
|
|
150
|
+
Type: missing_project_folder
|
|
151
|
+
Description: Feature FS-062 exists in _features/ but not in any project folder
|
|
152
|
+
Auto-repairable: Yes
|
|
153
|
+
Linked increment: 0062-test-living-docs-auto-sync (not found)
|
|
154
|
+
|
|
155
|
+
───────────────────────────────────────────────────────
|
|
156
|
+
|
|
157
|
+
🎯 To repair: /specweave:validate-features --repair
|
|
158
|
+
═══════════════════════════════════════════════════════
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Example 2: Auto-repair discrepancies
|
|
162
|
+
```
|
|
163
|
+
User: /specweave:validate-features --repair
|
|
164
|
+
|
|
165
|
+
Output:
|
|
166
|
+
═══════════════════════════════════════════════════════
|
|
167
|
+
📊 FEATURE CONSISTENCY VALIDATION REPORT
|
|
168
|
+
═══════════════════════════════════════════════════════
|
|
169
|
+
|
|
170
|
+
Total features scanned: 7
|
|
171
|
+
Consistent: 7
|
|
172
|
+
Discrepancies found: 1
|
|
173
|
+
|
|
174
|
+
───────────────────────────────────────────────────────
|
|
175
|
+
🔧 REPAIR RESULTS
|
|
176
|
+
|
|
177
|
+
✅ FS-062: Created .specweave/docs/internal/specs/specweave/FS-062/README.md
|
|
178
|
+
|
|
179
|
+
═══════════════════════════════════════════════════════
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## WHEN TO USE
|
|
185
|
+
|
|
186
|
+
**Use this command when**:
|
|
187
|
+
- Features appear in `_features/` but not in project folders
|
|
188
|
+
- After interrupted/failed sync operations
|
|
189
|
+
- After manual cleanup of increments
|
|
190
|
+
- Periodic health check of living docs structure
|
|
191
|
+
|
|
192
|
+
**Root cause of discrepancies**:
|
|
193
|
+
1. Sync interrupted between creating _features and project folders
|
|
194
|
+
2. Increment deleted without cleaning up living docs
|
|
195
|
+
3. Manual editing of living docs structure
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## RELATED COMMANDS
|
|
200
|
+
|
|
201
|
+
- `/specweave:sync-specs` - Sync increment to living docs (includes consistency check)
|
|
202
|
+
- `/specweave:validate` - Validate increment structure
|
|
203
|
+
- `/specweave:archive` - Archive completed increments
|