specweave 0.28.1 → 0.28.5

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.
Files changed (57) hide show
  1. package/README.md +34 -95
  2. package/dist/src/core/living-docs/feature-consistency-validator.d.ts +129 -0
  3. package/dist/src/core/living-docs/feature-consistency-validator.d.ts.map +1 -0
  4. package/dist/src/core/living-docs/feature-consistency-validator.js +445 -0
  5. package/dist/src/core/living-docs/feature-consistency-validator.js.map +1 -0
  6. package/dist/src/core/living-docs/index.d.ts +1 -0
  7. package/dist/src/core/living-docs/index.d.ts.map +1 -1
  8. package/dist/src/core/living-docs/index.js +1 -0
  9. package/dist/src/core/living-docs/index.js.map +1 -1
  10. package/dist/src/core/living-docs/living-docs-sync.d.ts +13 -0
  11. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  12. package/dist/src/core/living-docs/living-docs-sync.js +50 -0
  13. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  14. package/dist/src/core/repo-structure/platform-registry.d.ts.map +1 -1
  15. package/dist/src/core/repo-structure/platform-registry.js +3 -2
  16. package/dist/src/core/repo-structure/platform-registry.js.map +1 -1
  17. package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
  18. package/dist/src/core/repo-structure/prompt-consolidator.js +4 -2
  19. package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
  20. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  21. package/dist/src/core/repo-structure/repo-structure-manager.js +18 -32
  22. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  23. package/dist/src/utils/auth-helpers.d.ts.map +1 -1
  24. package/dist/src/utils/auth-helpers.js +13 -1
  25. package/dist/src/utils/auth-helpers.js.map +1 -1
  26. package/package.json +1 -1
  27. package/plugins/specweave/commands/specweave-validate-features.md +203 -0
  28. package/plugins/specweave/hooks/docs-changed.sh.backup +79 -0
  29. package/plugins/specweave/hooks/hooks.json +10 -0
  30. package/plugins/specweave/hooks/human-input-required.sh.backup +75 -0
  31. package/plugins/specweave/hooks/post-first-increment.sh.backup +61 -0
  32. package/plugins/specweave/hooks/post-increment-change.sh.backup +98 -0
  33. package/plugins/specweave/hooks/post-increment-completion.sh.backup +231 -0
  34. package/plugins/specweave/hooks/post-increment-planning.sh.backup +1048 -0
  35. package/plugins/specweave/hooks/post-increment-status-change.sh.backup +147 -0
  36. package/plugins/specweave/hooks/post-metadata-change.sh +18 -0
  37. package/plugins/specweave/hooks/post-spec-update.sh.backup +158 -0
  38. package/plugins/specweave/hooks/post-user-story-complete.sh.backup +179 -0
  39. package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +83 -0
  40. package/plugins/specweave/hooks/pre-implementation.sh.backup +67 -0
  41. package/plugins/specweave/hooks/pre-task-completion.sh.backup +194 -0
  42. package/plugins/specweave/hooks/pre-tool-use.sh.backup +133 -0
  43. package/plugins/specweave/hooks/user-prompt-submit.sh.backup +386 -0
  44. package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +353 -0
  45. package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +172 -0
  46. package/plugins/specweave-ado/lib/ado-multi-project-sync.js +1 -0
  47. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
  48. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +1104 -0
  49. package/plugins/specweave-github/hooks/post-task-completion.sh.backup +258 -0
  50. package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +172 -0
  51. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +3 -3
  52. package/plugins/specweave-kafka/skills/kafka-mcp-integration/SKILL.md +17 -0
  53. package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +3 -1
  54. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +1017 -0
  55. package/plugins/specweave-release/hooks/post-task-completion.sh.backup +110 -0
  56. package/plugins/specweave-ui/commands/ui-automate.md +5 -28
  57. package/src/templates/AGENTS.md.template +92 -9
package/README.md CHANGED
@@ -39,62 +39,17 @@ Every AI coding tool promises productivity. But after the chat ends:
39
39
 
40
40
  **SpecWeave is the only framework where AI decisions become permanent, searchable documentation.**
41
41
 
42
- ```
43
- ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
44
- │ Your │ │ Spec │ │ Plan │ │ Tasks │ │ Code │ │ Living │
45
- │ Idea │───▶│(permanent│───▶│(permanent│───▶│(permanent│───▶│ │───▶│ Docs │
46
- │ │ │ ✓) │ │ ✓) │ │ ✓) │ │ │ │(auto-sync│
47
- └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
48
- ```
42
+ <p align="center">
43
+ <img src="https://raw.githubusercontent.com/anton-abyzov/specweave/develop/docs-site/static/img/specweave-flow.svg" alt="SpecWeave Flow: Your Idea → Spec → Plan → Tasks → Code → Living Docs" width="800"/>
44
+ </p>
49
45
 
50
46
  ---
51
47
 
52
48
  ## The Workflow
53
49
 
54
- ```mermaid
55
- flowchart TB
56
- subgraph INPUT["1. TYPE ONE COMMAND"]
57
- A["/specweave:increment<br/>'Add dark mode'"]
58
- end
59
-
60
- subgraph AGENTS["2. AI AGENTS CREATE"]
61
- direction TB
62
- PM["PM Agent<br/>User stories + ACs"]
63
- ARCH["Architect Agent<br/>Design + ADRs"]
64
- PLAN["Planner Agent<br/>Tasks + Tests"]
65
- PM --> ARCH --> PLAN
66
- end
67
-
68
- subgraph OUTPUT["3. PERMANENT FILES"]
69
- direction LR
70
- SPEC["spec.md<br/>WHAT"]
71
- PLANF["plan.md<br/>HOW"]
72
- TASKS["tasks.md<br/>DO"]
73
- end
74
-
75
- subgraph EXECUTE["4. BUILD"]
76
- B["/specweave:do<br/>Autonomous execution"]
77
- end
78
-
79
- subgraph SYNC["5. AUTO-SYNC"]
80
- direction LR
81
- GH["GitHub"]
82
- JIRA["JIRA"]
83
- ADO["ADO"]
84
- DOCS["Docs"]
85
- end
86
-
87
- INPUT --> AGENTS
88
- AGENTS --> OUTPUT
89
- OUTPUT --> EXECUTE
90
- EXECUTE --> SYNC
91
-
92
- style INPUT fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
93
- style AGENTS fill:#e3f2fd,stroke:#2196f3,stroke-width:2px
94
- style OUTPUT fill:#fff3e0,stroke:#ff9800,stroke-width:2px
95
- style EXECUTE fill:#fce4ec,stroke:#e91e63,stroke-width:2px
96
- style SYNC fill:#f3e5f5,stroke:#9c27b0,stroke-width:2px
97
- ```
50
+ <p align="center">
51
+ <img src="https://raw.githubusercontent.com/anton-abyzov/specweave/develop/docs-site/static/img/workflow-diagram.svg" alt="SpecWeave Workflow: Command → AI Agents → Permanent Files → Build → Auto-Sync" width="700"/>
52
+ </p>
98
53
 
99
54
  ---
100
55
 
@@ -135,31 +90,9 @@ Then in Claude Code:
135
90
 
136
91
  SpecWeave keeps your project management tools in sync **automatically**:
137
92
 
138
- ```mermaid
139
- flowchart LR
140
- subgraph SPECWEAVE["SpecWeave"]
141
- TASK["Task Completed"]
142
- US["User Story Updated"]
143
- INC["Increment Progress"]
144
- end
145
-
146
- subgraph EXTERNAL["Your Tools (Bidirectional)"]
147
- GH["<b>GitHub Issues</b><br/>Checkboxes, comments,<br/>labels auto-update"]
148
- JIRA["<b>JIRA</b><br/>Epic/Story hierarchy,<br/>status transitions"]
149
- ADO["<b>Azure DevOps</b><br/>Work items,<br/>area paths"]
150
- end
151
-
152
- TASK -->|"hooks auto-fire"| GH
153
- TASK -->|"hooks auto-fire"| JIRA
154
- TASK -->|"hooks auto-fire"| ADO
155
-
156
- GH -->|"import existing"| INC
157
- JIRA -->|"import existing"| INC
158
- ADO -->|"import existing"| INC
159
-
160
- style SPECWEAVE fill:#e3f2fd,stroke:#2196f3,stroke-width:2px
161
- style EXTERNAL fill:#f3e5f5,stroke:#9c27b0,stroke-width:2px
162
- ```
93
+ <p align="center">
94
+ <img src="https://raw.githubusercontent.com/anton-abyzov/specweave/develop/docs-site/static/img/external-sync-diagram.svg" alt="SpecWeave External Tool Integration: Bidirectional sync with GitHub, JIRA, Azure DevOps" width="800"/>
95
+ </p>
163
96
 
164
97
  | Platform | Capabilities |
165
98
  |----------|--------------|
@@ -226,25 +159,9 @@ As a user, I want to toggle dark mode so that I can reduce eye strain at night.
226
159
 
227
160
  ### Autonomous Multi-Agent Orchestration
228
161
 
229
- ```mermaid
230
- flowchart LR
231
- subgraph AGENTS["15+ Specialized Agents"]
232
- PM["PM Agent"]
233
- ARCH["Architect"]
234
- TECH["Tech Lead"]
235
- QA["QA Lead"]
236
- SEC["Security"]
237
- DEVOPS["DevOps"]
238
- end
239
-
240
- PM -->|"spec.md"| ARCH
241
- ARCH -->|"plan.md"| TECH
242
- TECH -->|"code"| QA
243
- QA -->|"tests"| SEC
244
- SEC -->|"security review"| DEVOPS
245
-
246
- style AGENTS fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
247
- ```
162
+ <p align="center">
163
+ <img src="https://raw.githubusercontent.com/anton-abyzov/specweave/develop/docs-site/static/img/agents-diagram.svg" alt="SpecWeave Multi-Agent Orchestration: PM → Architect → Tech Lead → QA → Security → DevOps" width="850"/>
164
+ </p>
248
165
 
249
166
  - **PM Agent**: User stories, acceptance criteria, market analysis
250
167
  - **Architect Agent**: System design, ADRs, tech stack decisions
@@ -276,6 +193,28 @@ Three gates before any increment closes:
276
193
  - Context optimizer removes irrelevant specs
277
194
  - Sub-agent parallelization isolates context
278
195
 
196
+ ### Why Skills, Not MCP?
197
+
198
+ **Community insight**: Anthropic's engineering team discovered that [code execution beats direct tool calls](https://www.anthropic.com/engineering/code-execution-with-mcp) for AI agent efficiency.
199
+
200
+ **The MCP Problem**:
201
+ | Issue | Impact |
202
+ |-------|--------|
203
+ | Tool definition bloat | All tools loaded upfront → context waste |
204
+ | Data duplication | Same data flows through model 2-3× |
205
+ | Token explosion | 150,000 tokens vs 2,000 with code-first |
206
+
207
+ **SpecWeave's Approach**:
208
+ ```
209
+ ❌ MCP: Load 50 tools → model picks → fetch → model processes → call another
210
+ ✅ Skills: Load 1 skill on-demand → Claude writes code → process locally
211
+ ```
212
+
213
+ > "LLMs are adept at writing code and developers should take advantage of this strength."
214
+ > — [Anthropic Engineering](https://www.anthropic.com/engineering/code-execution-with-mcp)
215
+
216
+ **Result**: 98%+ token reduction, deterministic execution, reusable skill library.
217
+
279
218
  ---
280
219
 
281
220
  ## Commands Reference
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Feature Consistency Validator
3
+ *
4
+ * Validates and repairs consistency between:
5
+ * - .specweave/docs/internal/specs/_features/FS-XXX/
6
+ * - .specweave/docs/internal/specs/{project}/FS-XXX/
7
+ *
8
+ * PROBLEM SOLVED:
9
+ * Living docs sync creates _features/ and {project}/ folders sequentially.
10
+ * If sync fails midway or increment is deleted, folders can get out of sync.
11
+ *
12
+ * SOLUTION:
13
+ * 1. Detect discrepancies (orphaned _features without project folders)
14
+ * 2. Auto-repair by creating missing project folders
15
+ * 3. Report issues for manual intervention when auto-repair not possible
16
+ *
17
+ * @see ADR-0142 (if created) for architectural decision
18
+ */
19
+ import { Logger } from '../../utils/logger.js';
20
+ export interface DiscrepancyReport {
21
+ /** Feature ID (e.g., "FS-062") */
22
+ featureId: string;
23
+ /** Type of discrepancy */
24
+ type: 'missing_project_folder' | 'missing_features_folder' | 'orphaned_feature';
25
+ /** Description of the issue */
26
+ description: string;
27
+ /** Can this be auto-repaired? */
28
+ autoRepairable: boolean;
29
+ /** Path to _features folder (if exists) */
30
+ featuresPath?: string;
31
+ /** Path to project folder (if exists) */
32
+ projectPath?: string;
33
+ /** Linked increment ID (if found in FEATURE.md) */
34
+ linkedIncrementId?: string;
35
+ /** Whether linked increment exists */
36
+ incrementExists?: boolean;
37
+ }
38
+ export interface ValidationResult {
39
+ /** Total features scanned */
40
+ totalFeatures: number;
41
+ /** Number of consistent features */
42
+ consistentCount: number;
43
+ /** List of discrepancies found */
44
+ discrepancies: DiscrepancyReport[];
45
+ /** Auto-repair results (if repair was attempted) */
46
+ repairs?: RepairResult[];
47
+ }
48
+ export interface RepairResult {
49
+ featureId: string;
50
+ success: boolean;
51
+ action: string;
52
+ error?: string;
53
+ }
54
+ export interface ValidatorOptions {
55
+ /** Logger instance */
56
+ logger?: Logger;
57
+ /** Default project name (for creating missing project folders) */
58
+ defaultProject?: string;
59
+ /** Whether to include archived features in validation */
60
+ includeArchived?: boolean;
61
+ }
62
+ export declare class FeatureConsistencyValidator {
63
+ private projectRoot;
64
+ private specsPath;
65
+ private incrementsPath;
66
+ private logger;
67
+ private defaultProject;
68
+ private includeArchived;
69
+ constructor(projectRoot: string, options?: ValidatorOptions);
70
+ /**
71
+ * Validate consistency between _features and project folders
72
+ *
73
+ * @param autoRepair - If true, attempt to auto-repair discrepancies
74
+ * @returns Validation result with discrepancies and repair results
75
+ */
76
+ validate(autoRepair?: boolean): Promise<ValidationResult>;
77
+ /**
78
+ * Get all feature folder IDs from _features directory
79
+ */
80
+ private getFeatureFolders;
81
+ /**
82
+ * Get all project folder names (excluding _features, _epics, _archive)
83
+ */
84
+ private getProjectFolders;
85
+ /**
86
+ * Check if a feature has consistent folders across _features and projects
87
+ */
88
+ private checkFeatureConsistency;
89
+ /**
90
+ * Check if a feature is from an external source (GitHub, JIRA, ADO)
91
+ * External features should NOT be considered orphaned even if local increment is missing
92
+ */
93
+ private isExternalFeature;
94
+ /**
95
+ * Extract linked increment ID from FEATURE.md
96
+ */
97
+ private extractLinkedIncrement;
98
+ /**
99
+ * Check if an increment exists (in active or archive folder)
100
+ */
101
+ private checkIncrementExists;
102
+ /**
103
+ * Attempt to repair a discrepancy
104
+ */
105
+ private repairDiscrepancy;
106
+ /**
107
+ * Archive an orphaned feature (increment was deleted)
108
+ * Delegates to FeatureArchiver for consistent archiving behavior
109
+ */
110
+ private archiveOrphanedFeature;
111
+ /**
112
+ * Create missing project folder for a feature
113
+ */
114
+ private repairMissingProjectFolder;
115
+ /**
116
+ * Log validation summary
117
+ */
118
+ private logValidationSummary;
119
+ /**
120
+ * Quick check: Are there any discrepancies?
121
+ * Use this for fast validation without full report
122
+ */
123
+ hasDiscrepancies(): Promise<boolean>;
124
+ /**
125
+ * Get list of orphaned features (features in _features without corresponding project folder)
126
+ */
127
+ getOrphanedFeatures(): Promise<string[]>;
128
+ }
129
+ //# sourceMappingURL=feature-consistency-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-consistency-validator.d.ts","sourceRoot":"","sources":["../../../../src/core/living-docs/feature-consistency-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EAAE,MAAM,EAAiB,MAAM,uBAAuB,CAAC;AAE9D,MAAM,WAAW,iBAAiB;IAChC,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,0BAA0B;IAC1B,IAAI,EAAE,wBAAwB,GAAG,yBAAyB,GAAG,kBAAkB,CAAC;IAChF,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,cAAc,EAAE,OAAO,CAAC;IACxB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sCAAsC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,eAAe,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,oDAAoD;IACpD,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,qBAAa,2BAA2B;IACtC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,eAAe,CAAU;gBAErB,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAS/D;;;;;OAKG;IACG,QAAQ,CAAC,UAAU,GAAE,OAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAqDtE;;OAEG;YACW,iBAAiB;IAmB/B;;OAEG;YACW,iBAAiB;IAoB/B;;OAEG;YACW,uBAAuB;IAqErC;;;OAGG;YACW,iBAAiB;IAiC/B;;OAEG;YACW,sBAAsB;IA6BpC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAM5B;;OAEG;YACW,iBAAiB;IAsC/B;;;OAGG;YACW,sBAAsB;IA0BpC;;OAEG;YACW,0BAA0B;IAwExC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA+C5B;;;OAGG;IACG,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;IAK1C;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAM/C"}