specweave 0.26.13 ā 0.27.0
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 +73 -1
- package/README.md +111 -466
- package/dist/plugins/specweave-jira/lib/setup-wizard.d.ts.map +1 -1
- package/dist/plugins/specweave-jira/lib/setup-wizard.js +57 -78
- package/dist/plugins/specweave-jira/lib/setup-wizard.js.map +1 -1
- package/dist/src/cli/commands/import-docs.d.ts.map +1 -1
- package/dist/src/cli/commands/import-docs.js +23 -31
- package/dist/src/cli/commands/import-docs.js.map +1 -1
- package/dist/src/cli/commands/import-external.d.ts.map +1 -1
- package/dist/src/cli/commands/import-external.js +6 -10
- package/dist/src/cli/commands/import-external.js.map +1 -1
- package/dist/src/cli/commands/init-multiproject.d.ts.map +1 -1
- package/dist/src/cli/commands/init-multiproject.js +58 -73
- package/dist/src/cli/commands/init-multiproject.js.map +1 -1
- package/dist/src/cli/commands/init.d.ts +17 -11
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +221 -1874
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/install.d.ts.map +1 -1
- package/dist/src/cli/commands/install.js +14 -22
- package/dist/src/cli/commands/install.js.map +1 -1
- package/dist/src/cli/commands/migrate-config.d.ts.map +1 -1
- package/dist/src/cli/commands/migrate-config.js +6 -10
- package/dist/src/cli/commands/migrate-config.js.map +1 -1
- package/dist/src/cli/commands/switch-project.d.ts.map +1 -1
- package/dist/src/cli/commands/switch-project.js.map +1 -1
- package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -1
- package/dist/src/cli/helpers/ado-area-path-mapper.js +36 -49
- package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -1
- package/dist/src/cli/helpers/github/increment-profile-selector.d.ts.map +1 -1
- package/dist/src/cli/helpers/github/increment-profile-selector.js.map +1 -1
- package/dist/src/cli/helpers/github/profile-manager.d.ts.map +1 -1
- package/dist/src/cli/helpers/github/profile-manager.js +8 -11
- package/dist/src/cli/helpers/github/profile-manager.js.map +1 -1
- package/dist/src/cli/helpers/github-repo-selector.d.ts.map +1 -1
- package/dist/src/cli/helpers/github-repo-selector.js +26 -50
- package/dist/src/cli/helpers/github-repo-selector.js.map +1 -1
- package/dist/src/cli/helpers/import-strategy-prompter.d.ts.map +1 -1
- package/dist/src/cli/helpers/import-strategy-prompter.js +39 -52
- package/dist/src/cli/helpers/import-strategy-prompter.js.map +1 -1
- package/dist/src/cli/helpers/init/config-detection.d.ts +40 -0
- package/dist/src/cli/helpers/init/config-detection.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/config-detection.js +125 -0
- package/dist/src/cli/helpers/init/config-detection.js.map +1 -0
- package/dist/src/cli/helpers/init/directory-structure.d.ts +26 -0
- package/dist/src/cli/helpers/init/directory-structure.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/directory-structure.js +190 -0
- package/dist/src/cli/helpers/init/directory-structure.js.map +1 -0
- package/dist/src/cli/helpers/init/external-import.d.ts +15 -0
- package/dist/src/cli/helpers/init/external-import.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/external-import.js +251 -0
- package/dist/src/cli/helpers/init/external-import.js.map +1 -0
- package/dist/src/cli/helpers/init/index.d.ts +15 -0
- package/dist/src/cli/helpers/init/index.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/index.js +26 -0
- package/dist/src/cli/helpers/init/index.js.map +1 -0
- package/dist/src/cli/helpers/init/next-steps.d.ts +15 -0
- package/dist/src/cli/helpers/init/next-steps.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/next-steps.js +72 -0
- package/dist/src/cli/helpers/init/next-steps.js.map +1 -0
- package/dist/src/cli/helpers/init/path-utils.d.ts +41 -0
- package/dist/src/cli/helpers/init/path-utils.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/path-utils.js +146 -0
- package/dist/src/cli/helpers/init/path-utils.js.map +1 -0
- package/dist/src/cli/helpers/init/plugin-installer.d.ts +28 -0
- package/dist/src/cli/helpers/init/plugin-installer.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/plugin-installer.js +238 -0
- package/dist/src/cli/helpers/init/plugin-installer.js.map +1 -0
- package/dist/src/cli/helpers/init/repository-setup.d.ts +28 -0
- package/dist/src/cli/helpers/init/repository-setup.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/repository-setup.js +78 -0
- package/dist/src/cli/helpers/init/repository-setup.js.map +1 -0
- package/dist/src/cli/helpers/init/smart-reinit.d.ts +30 -0
- package/dist/src/cli/helpers/init/smart-reinit.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/smart-reinit.js +140 -0
- package/dist/src/cli/helpers/init/smart-reinit.js.map +1 -0
- package/dist/src/cli/helpers/init/testing-config.d.ts +27 -0
- package/dist/src/cli/helpers/init/testing-config.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/testing-config.js +131 -0
- package/dist/src/cli/helpers/init/testing-config.js.map +1 -0
- package/dist/src/cli/helpers/init/types.d.ts +86 -0
- package/dist/src/cli/helpers/init/types.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/types.js +5 -0
- package/dist/src/cli/helpers/init/types.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +10 -12
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado.js +43 -60
- package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/github-multi-repo.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js +193 -230
- package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/github.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/github.js +43 -54
- package/dist/src/cli/helpers/issue-tracker/github.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 +27 -40
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/jira.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/jira.js +54 -70
- package/dist/src/cli/helpers/issue-tracker/jira.js.map +1 -1
- package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -1
- package/dist/src/cli/helpers/smart-filter.js +62 -85
- package/dist/src/cli/helpers/smart-filter.js.map +1 -1
- package/dist/src/core/increment/auto-transition-manager.d.ts +12 -0
- package/dist/src/core/increment/auto-transition-manager.d.ts.map +1 -1
- package/dist/src/core/increment/auto-transition-manager.js +45 -0
- package/dist/src/core/increment/auto-transition-manager.js.map +1 -1
- package/dist/src/core/increment/metadata-manager.d.ts.map +1 -1
- package/dist/src/core/increment/metadata-manager.js +46 -0
- package/dist/src/core/increment/metadata-manager.js.map +1 -1
- package/dist/src/core/increment/status-change-sync-trigger.d.ts +12 -0
- package/dist/src/core/increment/status-change-sync-trigger.d.ts.map +1 -1
- package/dist/src/core/increment/status-change-sync-trigger.js +48 -2
- package/dist/src/core/increment/status-change-sync-trigger.js.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.d.ts +13 -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 +40 -0
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
- package/dist/src/core/repo-structure/repo-bulk-discovery.d.ts.map +1 -1
- package/dist/src/core/repo-structure/repo-bulk-discovery.js +63 -83
- package/dist/src/core/repo-structure/repo-bulk-discovery.js.map +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.js +339 -424
- package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
- package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -1
- package/dist/src/core/sync/bidirectional-engine.js +21 -29
- package/dist/src/core/sync/bidirectional-engine.js.map +1 -1
- package/dist/src/init/InitFlow.js +15 -19
- package/dist/src/init/InitFlow.js.map +1 -1
- package/dist/src/init/repo/types.d.ts +1 -1
- package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -1
- package/dist/src/integrations/ado/area-path-mapper.js +19 -23
- package/dist/src/integrations/ado/area-path-mapper.js.map +1 -1
- package/dist/src/utils/external-resource-validator.d.ts.map +1 -1
- package/dist/src/utils/external-resource-validator.js +41 -65
- package/dist/src/utils/external-resource-validator.js.map +1 -1
- package/dist/src/utils/project-detection.d.ts.map +1 -1
- package/dist/src/utils/project-detection.js +19 -21
- package/dist/src/utils/project-detection.js.map +1 -1
- package/dist/src/utils/project-validator.d.ts.map +1 -1
- package/dist/src/utils/project-validator.js +5 -7
- package/dist/src/utils/project-validator.js.map +1 -1
- package/package.json +2 -3
- package/plugins/PLUGINS-INDEX.md +120 -0
- package/plugins/specweave/agents/tech-lead/AGENT.md +9 -0
- package/plugins/specweave/commands/specweave-increment.md +1 -1
- package/plugins/specweave/commands/specweave-update-scope.md +2 -2
- package/plugins/specweave/hooks/post-user-story-complete.sh +86 -35
- package/plugins/specweave/lib/hooks/us-completion-orchestrator.js +62 -1
- package/plugins/specweave/lib/hooks/us-completion-orchestrator.ts +106 -3
- package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.d.ts +12 -0
- package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js +45 -0
- package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js.map +1 -1
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +46 -0
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -1
- package/plugins/specweave/skills/SKILLS-INDEX.md +69 -225
- package/plugins/specweave/skills/increment-planner/SKILL.md +10 -5
- package/plugins/specweave/skills/specweave-framework/SKILL.md +6 -4
- package/plugins/specweave/templates/coding-standards.md.template +36 -0
- package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +1 -1
- package/plugins/specweave-ado/lib/project-selector.js +56 -67
- package/plugins/specweave-ado/lib/project-selector.ts +72 -85
- package/plugins/specweave-ado/skills/ado-resource-validator/SKILL.md +1 -1
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +6 -0
- package/plugins/specweave-github/lib/repo-selector.js +55 -66
- package/plugins/specweave-github/lib/repo-selector.ts +73 -84
- package/plugins/specweave-jira/commands/import-projects.js +3 -5
- package/plugins/specweave-jira/commands/import-projects.ts +3 -5
- package/plugins/specweave-jira/lib/project-selector.js +60 -71
- package/plugins/specweave-jira/lib/project-selector.ts +78 -91
- package/plugins/specweave-jira/lib/setup-wizard.js +51 -72
- package/plugins/specweave-jira/lib/setup-wizard.ts +56 -74
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +9 -0
- package/src/templates/CLAUDE.md.template +14 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# SpecWeave Plugins Index
|
|
2
|
+
|
|
3
|
+
**Purpose**: Lightweight plugin manifest for progressive disclosure. Load plugin content only when triggers match.
|
|
4
|
+
|
|
5
|
+
**Total Plugins**: 27 | **Last Updated**: 2025-11-24
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Progressive Loading Pattern
|
|
10
|
+
|
|
11
|
+
1. **Scan this index** at session start (~5KB)
|
|
12
|
+
2. **Match triggers** to user intent
|
|
13
|
+
3. **Load plugin content** only when matched
|
|
14
|
+
4. **Savings**: ~95% (index only vs all plugins)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Core Plugins (Essential)
|
|
19
|
+
|
|
20
|
+
| Plugin | Triggers | Description |
|
|
21
|
+
|--------|----------|-------------|
|
|
22
|
+
| **specweave** | increment, feature, plan, spec, tasks, TDD, PM, architect | Core framework. Planning, specs, TDD, living docs. |
|
|
23
|
+
|
|
24
|
+
## Integration Plugins
|
|
25
|
+
|
|
26
|
+
| Plugin | Triggers | Description |
|
|
27
|
+
|--------|----------|-------------|
|
|
28
|
+
| **specweave-github** | GitHub, issues, gh, sync to GitHub, GitHub sync | Bidirectional GitHub Issues sync |
|
|
29
|
+
| **specweave-jira** | JIRA, Jira, epics, stories, sync to JIRA | JIRA integration and sync |
|
|
30
|
+
| **specweave-ado** | Azure DevOps, ADO, work items, Azure boards | Azure DevOps integration |
|
|
31
|
+
|
|
32
|
+
## Infrastructure Plugins
|
|
33
|
+
|
|
34
|
+
| Plugin | Triggers | Description |
|
|
35
|
+
|--------|----------|-------------|
|
|
36
|
+
| **specweave-infrastructure** | deploy, terraform, kubernetes, docker, CI/CD, devops, AWS, Azure, GCP | Infrastructure-as-Code, DevOps, SRE |
|
|
37
|
+
| **specweave-kubernetes** | k8s, kubernetes, EKS, AKS, GKE, pods, helm, GitOps | Kubernetes architecture, GitOps |
|
|
38
|
+
| **specweave-kafka** | Kafka, event streaming, MSK, Event Hubs, kcat, topics | Apache Kafka integration |
|
|
39
|
+
| **specweave-kafka-streams** | Kafka Streams, KStream, KTable, stream processing | Kafka Streams topology |
|
|
40
|
+
| **specweave-confluent** | Confluent, eCKU, Schema Registry, ksqlDB | Confluent Cloud architecture |
|
|
41
|
+
|
|
42
|
+
## Frontend Plugins
|
|
43
|
+
|
|
44
|
+
| Plugin | Triggers | Description |
|
|
45
|
+
|--------|----------|-------------|
|
|
46
|
+
| **specweave-frontend** | React, Vue, Angular, Next.js, frontend, UI, components | Frontend architecture, design systems |
|
|
47
|
+
| **specweave-ui** | UI components, design system, Storybook, Figma | UI component development |
|
|
48
|
+
| **specweave-figma** | Figma, design tokens, design-to-code | Figma integration |
|
|
49
|
+
| **specweave-mobile** | React Native, mobile, iOS, Android | Mobile app development |
|
|
50
|
+
|
|
51
|
+
## Backend Plugins
|
|
52
|
+
|
|
53
|
+
| Plugin | Triggers | Description |
|
|
54
|
+
|--------|----------|-------------|
|
|
55
|
+
| **specweave-backend** | backend, API, REST, GraphQL, database, microservices | Backend architecture |
|
|
56
|
+
| **specweave-payments** | Stripe, PayPal, payments, checkout, subscription, PCI | Payment integration |
|
|
57
|
+
|
|
58
|
+
## ML/AI Plugins
|
|
59
|
+
|
|
60
|
+
| Plugin | Triggers | Description |
|
|
61
|
+
|--------|----------|-------------|
|
|
62
|
+
| **specweave-ml** | ML, machine learning, model, training, MLOps | ML pipelines, model deployment |
|
|
63
|
+
|
|
64
|
+
## Quality & Testing
|
|
65
|
+
|
|
66
|
+
| Plugin | Triggers | Description |
|
|
67
|
+
|--------|----------|-------------|
|
|
68
|
+
| **specweave-testing** | test, E2E, Playwright, Vitest, Jest, QA | Test automation, QA strategy |
|
|
69
|
+
|
|
70
|
+
## Documentation & Release
|
|
71
|
+
|
|
72
|
+
| Plugin | Triggers | Description |
|
|
73
|
+
|--------|----------|-------------|
|
|
74
|
+
| **specweave-docs** | documentation, README, API docs, technical writing | Documentation generation |
|
|
75
|
+
| **specweave-docs-preview** | docs site, Docusaurus, preview, build docs | Documentation preview server |
|
|
76
|
+
| **specweave-release** | release, version, npm publish, changelog, RC | Release management |
|
|
77
|
+
|
|
78
|
+
## Specialized Plugins
|
|
79
|
+
|
|
80
|
+
| Plugin | Triggers | Description |
|
|
81
|
+
|--------|----------|-------------|
|
|
82
|
+
| **specweave-diagrams** | diagram, Mermaid, C4, architecture diagram | Mermaid diagram generation |
|
|
83
|
+
| **specweave-n8n** | n8n, workflow, automation, no-code | n8n workflow templates |
|
|
84
|
+
| **specweave-alternatives** | alternative, compare, evaluation, technology choice | Technology comparison |
|
|
85
|
+
| **specweave-cost-optimizer** | cost, optimize, reduce cost, cloud cost | Cloud cost optimization |
|
|
86
|
+
|
|
87
|
+
## Development Plugins
|
|
88
|
+
|
|
89
|
+
| Plugin | Triggers | Description |
|
|
90
|
+
|--------|----------|-------------|
|
|
91
|
+
| **specweave-core** | core utilities, shared, common | Core shared utilities |
|
|
92
|
+
| **specweave-plugin-dev** | create plugin, plugin development | Plugin development guide |
|
|
93
|
+
| **specweave-tooling** | tooling, skill create, agent create | SpecWeave tooling |
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Quick Lookup Table
|
|
98
|
+
|
|
99
|
+
| User Intent | Load Plugin |
|
|
100
|
+
|-------------|-------------|
|
|
101
|
+
| "Plan a feature" | `specweave` |
|
|
102
|
+
| "Sync to GitHub" | `specweave-github` |
|
|
103
|
+
| "Deploy to AWS" | `specweave-infrastructure` |
|
|
104
|
+
| "Create React app" | `specweave-frontend` |
|
|
105
|
+
| "Add Stripe payments" | `specweave-payments` |
|
|
106
|
+
| "Set up Kafka" | `specweave-kafka` |
|
|
107
|
+
| "Create K8s manifest" | `specweave-kubernetes` |
|
|
108
|
+
| "ML pipeline" | `specweave-ml` |
|
|
109
|
+
| "Write E2E tests" | `specweave-testing` |
|
|
110
|
+
| "Create release" | `specweave-release` |
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Token Efficiency
|
|
115
|
+
|
|
116
|
+
- **This index**: ~150 lines (~3KB)
|
|
117
|
+
- **All plugins loaded**: ~24.6 MB markdown
|
|
118
|
+
- **Savings**: ~99.98% by loading on-demand
|
|
119
|
+
|
|
120
|
+
**Pattern**: Load index ā Match triggers ā Load only matched plugin content
|
|
@@ -36,6 +36,15 @@ Task({
|
|
|
36
36
|
|
|
37
37
|
**VIOLATION CAUSES CLAUDE CODE CRASHES!** (Incident: 2025-11-24, tech-lead identified as HIGH RISK for 2000+ line implementations)
|
|
38
38
|
|
|
39
|
+
### šØ CRITICAL: NEVER SPAWN MULTIPLE TECH-LEAD AGENTS IN PARALLEL
|
|
40
|
+
|
|
41
|
+
**Context is SHARED, not isolated!** Spawning 4 tech-lead agents for "parallel migration" caused 144k token crash on 2025-11-24.
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
ā FORBIDDEN: "Large migration... let me use parallel agents"
|
|
45
|
+
ā
CORRECT: Single agent, ONE FILE AT A TIME, sequential execution
|
|
46
|
+
```
|
|
47
|
+
|
|
39
48
|
When implementing features with multiple files, you MUST create **ONE FILE AT A TIME**:
|
|
40
49
|
|
|
41
50
|
1. **First Response**: Analyze task, list all files needed, ASK which to start with (< 500 tokens)
|
|
@@ -236,7 +236,7 @@ if (activeCount >= limits.maxActiveIncrements) {
|
|
|
236
236
|
console.log(chalk.dim(' Accept productivity cost (20% slower)\n'));
|
|
237
237
|
|
|
238
238
|
const choice = await prompt({
|
|
239
|
-
type: '
|
|
239
|
+
type: 'select',
|
|
240
240
|
message: 'Choose an option:',
|
|
241
241
|
choices: [
|
|
242
242
|
{ name: 'Complete current work', value: 'complete' },
|
|
@@ -87,7 +87,7 @@ if (active.length === 0) {
|
|
|
87
87
|
if (active.length > 1) {
|
|
88
88
|
// Multiple active - ask which one
|
|
89
89
|
const choice = await prompt({
|
|
90
|
-
type: '
|
|
90
|
+
type: 'select',
|
|
91
91
|
message: 'Which increment to update?',
|
|
92
92
|
choices: active.map(inc => ({ name: inc.id, value: inc.id }))
|
|
93
93
|
});
|
|
@@ -120,7 +120,7 @@ const report = fs.readFileSync(reportPath, 'utf-8');
|
|
|
120
120
|
|
|
121
121
|
```typescript
|
|
122
122
|
const changeType = await prompt({
|
|
123
|
-
type: '
|
|
123
|
+
type: 'select',
|
|
124
124
|
message: 'What changed?',
|
|
125
125
|
choices: [
|
|
126
126
|
'Added user story',
|
|
@@ -45,17 +45,50 @@ echo "š Post-User-Story-Complete Hook"
|
|
|
45
45
|
echo " Spec: $SPEC_ID"
|
|
46
46
|
echo " User Story: $USER_STORY_ID"
|
|
47
47
|
|
|
48
|
-
# Find
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
# Find user story file in living docs
|
|
49
|
+
# Input: SPEC_ID = increment ID (e.g., "0059-context-optimization-crash-prevention")
|
|
50
|
+
# USER_STORY_ID = US ID (e.g., "US-001")
|
|
51
|
+
# Search in: .specweave/docs/internal/specs/**/us-*.md
|
|
52
|
+
|
|
53
|
+
# STEP 1: Get feature ID from increment spec.md
|
|
54
|
+
INCREMENT_SPEC=".specweave/increments/$SPEC_ID/spec.md"
|
|
55
|
+
FEATURE_ID=""
|
|
56
|
+
|
|
57
|
+
if [[ -f "$INCREMENT_SPEC" ]]; then
|
|
58
|
+
FEATURE_ID=$(head -20 "$INCREMENT_SPEC" | grep "^feature_id:" | head -1 | sed 's/feature_id: *//; s/ *$//' || echo "")
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
echo " š Looking for $USER_STORY_ID in feature $FEATURE_ID"
|
|
62
|
+
|
|
63
|
+
# STEP 2: Find user story file by ID AND feature
|
|
64
|
+
# Prioritize files in the correct feature folder
|
|
65
|
+
US_FILE=""
|
|
66
|
+
while IFS= read -r file; do
|
|
67
|
+
# Check if file has matching user story ID in frontmatter
|
|
68
|
+
if head -20 "$file" 2>/dev/null | grep -q "^id: $USER_STORY_ID"; then
|
|
69
|
+
# If feature ID is known, verify the file is in the correct feature folder
|
|
70
|
+
if [[ -n "$FEATURE_ID" ]]; then
|
|
71
|
+
FILE_FEATURE=$(head -20 "$file" 2>/dev/null | grep "^feature:" | head -1 | sed 's/feature: *//; s/ *$//' || echo "")
|
|
72
|
+
if [[ "$FILE_FEATURE" == "$FEATURE_ID" ]]; then
|
|
73
|
+
US_FILE="$file"
|
|
74
|
+
break
|
|
75
|
+
fi
|
|
76
|
+
else
|
|
77
|
+
# No feature filter - take first match
|
|
78
|
+
US_FILE="$file"
|
|
79
|
+
break
|
|
80
|
+
fi
|
|
81
|
+
fi
|
|
82
|
+
done < <(find .specweave/docs/internal/specs -name "us-*.md" -type f 2>/dev/null)
|
|
83
|
+
|
|
84
|
+
if [[ -z "$US_FILE" ]]; then
|
|
85
|
+
echo "ā Error: User story file not found for $USER_STORY_ID (feature: $FEATURE_ID) in increment $SPEC_ID"
|
|
56
86
|
exit 1
|
|
57
87
|
fi
|
|
58
88
|
|
|
89
|
+
echo " š Found user story file: $US_FILE"
|
|
90
|
+
SPEC_FILE="$US_FILE"
|
|
91
|
+
|
|
59
92
|
# Load config to check if auto-sync is enabled
|
|
60
93
|
CONFIG_FILE=".specweave/config.json"
|
|
61
94
|
if [[ ! -f "$CONFIG_FILE" ]]; then
|
|
@@ -71,41 +104,48 @@ if [[ "$AUTO_SYNC" != "true" ]]; then
|
|
|
71
104
|
exit 0
|
|
72
105
|
fi
|
|
73
106
|
|
|
74
|
-
# Parse
|
|
75
|
-
#
|
|
76
|
-
|
|
107
|
+
# Parse user story frontmatter to detect external links
|
|
108
|
+
# User story files have format:
|
|
109
|
+
# external:
|
|
110
|
+
# github:
|
|
111
|
+
# issue: 745
|
|
112
|
+
# url: https://github.com/...
|
|
113
|
+
|
|
114
|
+
# Extract GitHub issue number from frontmatter
|
|
115
|
+
GITHUB_ISSUE=$(head -20 "$SPEC_FILE" | grep -A 5 "github:" | grep "issue:" | head -1 | sed 's/.*issue: *//; s/ *$//' || echo "")
|
|
77
116
|
|
|
78
|
-
#
|
|
79
|
-
|
|
117
|
+
# Extract Jira issue from frontmatter
|
|
118
|
+
JIRA_ISSUE=$(head -20 "$SPEC_FILE" | grep -A 5 "jira:" | grep "issue:" | head -1 | sed 's/.*issue: *//; s/ *$//' || echo "")
|
|
80
119
|
|
|
81
|
-
#
|
|
82
|
-
|
|
120
|
+
# Extract ADO work item from frontmatter
|
|
121
|
+
ADO_ITEM=$(head -20 "$SPEC_FILE" | grep -A 5 "ado:" | grep "item:" | head -1 | sed 's/.*item: *//; s/ *$//' || echo "")
|
|
83
122
|
|
|
84
123
|
# Determine which provider to sync
|
|
85
124
|
PROVIDER=""
|
|
86
|
-
|
|
125
|
+
EXTERNAL_ID=""
|
|
126
|
+
if [[ -n "$GITHUB_ISSUE" ]]; then
|
|
87
127
|
PROVIDER="github"
|
|
88
|
-
EXTERNAL_ID="$
|
|
89
|
-
elif [[ -n "$
|
|
128
|
+
EXTERNAL_ID="$GITHUB_ISSUE"
|
|
129
|
+
elif [[ -n "$JIRA_ISSUE" ]]; then
|
|
90
130
|
PROVIDER="jira"
|
|
91
|
-
EXTERNAL_ID="$
|
|
92
|
-
elif [[ -n "$
|
|
131
|
+
EXTERNAL_ID="$JIRA_ISSUE"
|
|
132
|
+
elif [[ -n "$ADO_ITEM" ]]; then
|
|
93
133
|
PROVIDER="ado"
|
|
94
|
-
EXTERNAL_ID="$
|
|
134
|
+
EXTERNAL_ID="$ADO_ITEM"
|
|
95
135
|
fi
|
|
96
136
|
|
|
97
137
|
# No external link found - skip sync
|
|
98
138
|
if [[ -z "$PROVIDER" ]]; then
|
|
99
|
-
echo " ā¹ļø
|
|
139
|
+
echo " ā¹ļø User story not linked to external tool, skipping sync"
|
|
100
140
|
exit 0
|
|
101
141
|
fi
|
|
102
142
|
|
|
103
|
-
echo " š Detected external link: $PROVIDER"
|
|
143
|
+
echo " š Detected external link: $PROVIDER (ID: $EXTERNAL_ID)"
|
|
104
144
|
|
|
105
145
|
# Update external tool based on provider
|
|
106
146
|
case "$PROVIDER" in
|
|
107
147
|
github)
|
|
108
|
-
echo " š Updating GitHub Issue for $USER_STORY_ID..."
|
|
148
|
+
echo " š Updating GitHub Issue #$EXTERNAL_ID for $USER_STORY_ID..."
|
|
109
149
|
|
|
110
150
|
# Check if GitHub CLI is available
|
|
111
151
|
if ! command -v gh &> /dev/null; then
|
|
@@ -113,26 +153,37 @@ case "$PROVIDER" in
|
|
|
113
153
|
exit 0
|
|
114
154
|
fi
|
|
115
155
|
|
|
116
|
-
#
|
|
117
|
-
|
|
156
|
+
# Use issue number from frontmatter (EXTERNAL_ID = issue number)
|
|
157
|
+
ISSUE_NUMBER="$EXTERNAL_ID"
|
|
118
158
|
REPO=$(git remote get-url origin | sed -E 's/.*github\.com[:/]([^/]+\/[^/]+)(\.git)?$/\1/')
|
|
119
159
|
|
|
120
|
-
|
|
121
|
-
|
|
160
|
+
if [[ -z "$ISSUE_NUMBER" || "$ISSUE_NUMBER" == "null" ]]; then
|
|
161
|
+
echo " ā ļø No GitHub Issue number found in user story metadata"
|
|
162
|
+
exit 0
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
echo " š Using GitHub Issue #$ISSUE_NUMBER from metadata"
|
|
122
166
|
|
|
123
|
-
if
|
|
124
|
-
|
|
167
|
+
# Check if issue is already closed
|
|
168
|
+
ISSUE_STATE=$(gh issue view "$ISSUE_NUMBER" --repo "$REPO" --json state --jq '.state' 2>/dev/null || echo "")
|
|
169
|
+
if [[ "$ISSUE_STATE" == "CLOSED" ]]; then
|
|
170
|
+
echo " ā
GitHub Issue #$ISSUE_NUMBER already closed"
|
|
125
171
|
exit 0
|
|
126
172
|
fi
|
|
127
173
|
|
|
128
|
-
|
|
174
|
+
# Close issue with completion comment
|
|
175
|
+
gh issue close "$ISSUE_NUMBER" --repo "$REPO" --comment "ā
**User Story Verified Complete**
|
|
176
|
+
|
|
177
|
+
š **Completion Status**:
|
|
178
|
+
- ā
All Acceptance Criteria satisfied
|
|
179
|
+
- ā
All implementation tasks complete
|
|
129
180
|
|
|
130
|
-
|
|
131
|
-
|
|
181
|
+
**User Story**: $USER_STORY_ID
|
|
182
|
+
**Increment**: $SPEC_ID
|
|
132
183
|
|
|
133
|
-
š¤ Auto-closed by SpecWeave
|
|
184
|
+
š¤ Auto-closed by SpecWeave US Completion Hook
|
|
134
185
|
Completed at: $(date -u +%Y-%m-%dT%H:%M:%SZ)" 2>/dev/null || {
|
|
135
|
-
echo " ā ļø Failed to close issue"
|
|
186
|
+
echo " ā ļø Failed to close issue (may already be closed)"
|
|
136
187
|
exit 0
|
|
137
188
|
}
|
|
138
189
|
|
|
@@ -3,6 +3,59 @@ import { USCompletionDetector } from "../../../../dist/src/core/us-completion-de
|
|
|
3
3
|
import { LivingDocsSync } from "../../../../dist/src/core/living-docs/living-docs-sync.js";
|
|
4
4
|
import { USSyncThrottle } from "../../../../dist/src/core/us-sync-throttle.js";
|
|
5
5
|
import { consoleLogger } from "../vendor/utils/logger.js";
|
|
6
|
+
import { spawn } from "child_process";
|
|
7
|
+
import { existsSync } from "fs";
|
|
8
|
+
import * as path from "path";
|
|
9
|
+
async function triggerUserStoryCompleteHook(incrementId, usId, projectRoot) {
|
|
10
|
+
const hookPaths = [
|
|
11
|
+
path.join(projectRoot, "plugins/specweave/hooks/post-user-story-complete.sh"),
|
|
12
|
+
path.join(projectRoot, ".claude/hooks/post-user-story-complete.sh")
|
|
13
|
+
];
|
|
14
|
+
let hookPath = null;
|
|
15
|
+
for (const p of hookPaths) {
|
|
16
|
+
if (existsSync(p)) {
|
|
17
|
+
hookPath = p;
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (!hookPath) {
|
|
22
|
+
console.log(` \u2139\uFE0F post-user-story-complete.sh hook not found (skipping external sync)`);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
const hookProcess = spawn("bash", [hookPath, incrementId, usId], {
|
|
27
|
+
cwd: projectRoot,
|
|
28
|
+
env: {
|
|
29
|
+
...process.env,
|
|
30
|
+
SPECWEAVE_INCREMENT_ID: incrementId,
|
|
31
|
+
SPECWEAVE_USER_STORY_ID: usId
|
|
32
|
+
},
|
|
33
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
34
|
+
});
|
|
35
|
+
let stdout = "";
|
|
36
|
+
let stderr = "";
|
|
37
|
+
hookProcess.stdout.on("data", (data) => {
|
|
38
|
+
stdout += data.toString();
|
|
39
|
+
});
|
|
40
|
+
hookProcess.stderr.on("data", (data) => {
|
|
41
|
+
stderr += data.toString();
|
|
42
|
+
});
|
|
43
|
+
hookProcess.on("close", (code) => {
|
|
44
|
+
if (code === 0) {
|
|
45
|
+
resolve();
|
|
46
|
+
} else {
|
|
47
|
+
reject(new Error(`Hook exited with code ${code}: ${stderr || stdout}`));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
hookProcess.on("error", (error) => {
|
|
51
|
+
reject(new Error(`Hook spawn failed: ${error.message}`));
|
|
52
|
+
});
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
hookProcess.kill("SIGTERM");
|
|
55
|
+
reject(new Error("Hook timed out after 30s"));
|
|
56
|
+
}, 3e4);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
6
59
|
async function syncCompletedUserStories(incrementId) {
|
|
7
60
|
try {
|
|
8
61
|
console.log(`
|
|
@@ -52,7 +105,15 @@ async function syncCompletedUserStories(incrementId) {
|
|
|
52
105
|
console.log(` Feature: ${syncResult.featureId}`);
|
|
53
106
|
console.log(` Files updated: ${syncResult.filesCreated.length + syncResult.filesUpdated.length}`);
|
|
54
107
|
console.log(`
|
|
55
|
-
\u{1F4E1}
|
|
108
|
+
\u{1F4E1} Triggering external tool updates for ${newlyCompleted.length} completed user stories...`);
|
|
109
|
+
for (const us of newlyCompleted) {
|
|
110
|
+
try {
|
|
111
|
+
await triggerUserStoryCompleteHook(incrementId, us.usId, projectRoot);
|
|
112
|
+
console.log(` \u2705 ${us.usId}: External tool updated`);
|
|
113
|
+
} catch (hookError) {
|
|
114
|
+
console.warn(` \u26A0\uFE0F ${us.usId}: Hook failed (${hookError.message})`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
56
117
|
throttle.recordSync(incrementId);
|
|
57
118
|
console.log(` \u23F1\uFE0F Throttle recorded (next sync allowed in 60s)`);
|
|
58
119
|
} else {
|
|
@@ -39,6 +39,88 @@ import { USCompletionDetector } from '../../../../dist/src/core/us-completion-de
|
|
|
39
39
|
import { LivingDocsSync } from '../../../../dist/src/core/living-docs/living-docs-sync.js';
|
|
40
40
|
import { USSyncThrottle } from '../../../../dist/src/core/us-sync-throttle.js';
|
|
41
41
|
import { consoleLogger } from '../vendor/utils/logger.js';
|
|
42
|
+
import { spawn } from 'child_process';
|
|
43
|
+
import { existsSync } from 'fs';
|
|
44
|
+
import * as path from 'path';
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Trigger post-user-story-complete hook for external tool updates
|
|
48
|
+
*
|
|
49
|
+
* This bridges the orchestrator to the shell hook that handles:
|
|
50
|
+
* - GitHub issue closure with completion comment
|
|
51
|
+
* - JIRA story transition (if implemented)
|
|
52
|
+
* - ADO work item completion (if implemented)
|
|
53
|
+
*
|
|
54
|
+
* @param incrementId - Increment ID (e.g., "0059-context-optimization")
|
|
55
|
+
* @param usId - User story ID (e.g., "US-003")
|
|
56
|
+
* @param projectRoot - Project root path
|
|
57
|
+
*/
|
|
58
|
+
async function triggerUserStoryCompleteHook(
|
|
59
|
+
incrementId: string,
|
|
60
|
+
usId: string,
|
|
61
|
+
projectRoot: string
|
|
62
|
+
): Promise<void> {
|
|
63
|
+
// Find the hook in multiple possible locations
|
|
64
|
+
const hookPaths = [
|
|
65
|
+
path.join(projectRoot, 'plugins/specweave/hooks/post-user-story-complete.sh'),
|
|
66
|
+
path.join(projectRoot, '.claude/hooks/post-user-story-complete.sh'),
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
let hookPath: string | null = null;
|
|
70
|
+
for (const p of hookPaths) {
|
|
71
|
+
if (existsSync(p)) {
|
|
72
|
+
hookPath = p;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (!hookPath) {
|
|
78
|
+
console.log(` ā¹ļø post-user-story-complete.sh hook not found (skipping external sync)`);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return new Promise((resolve, reject) => {
|
|
83
|
+
// Call hook with spec-id and user-story-id as arguments
|
|
84
|
+
const hookProcess = spawn('bash', [hookPath, incrementId, usId], {
|
|
85
|
+
cwd: projectRoot,
|
|
86
|
+
env: {
|
|
87
|
+
...process.env,
|
|
88
|
+
SPECWEAVE_INCREMENT_ID: incrementId,
|
|
89
|
+
SPECWEAVE_USER_STORY_ID: usId,
|
|
90
|
+
},
|
|
91
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
let stdout = '';
|
|
95
|
+
let stderr = '';
|
|
96
|
+
|
|
97
|
+
hookProcess.stdout.on('data', (data) => {
|
|
98
|
+
stdout += data.toString();
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
hookProcess.stderr.on('data', (data) => {
|
|
102
|
+
stderr += data.toString();
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
hookProcess.on('close', (code) => {
|
|
106
|
+
if (code === 0) {
|
|
107
|
+
resolve();
|
|
108
|
+
} else {
|
|
109
|
+
reject(new Error(`Hook exited with code ${code}: ${stderr || stdout}`));
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
hookProcess.on('error', (error) => {
|
|
114
|
+
reject(new Error(`Hook spawn failed: ${error.message}`));
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// Timeout after 30 seconds
|
|
118
|
+
setTimeout(() => {
|
|
119
|
+
hookProcess.kill('SIGTERM');
|
|
120
|
+
reject(new Error('Hook timed out after 30s'));
|
|
121
|
+
}, 30000);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
42
124
|
|
|
43
125
|
export interface USSyncResult {
|
|
44
126
|
success: boolean;
|
|
@@ -146,9 +228,30 @@ export async function syncCompletedUserStories(incrementId: string): Promise<USS
|
|
|
146
228
|
console.log(` Feature: ${syncResult.featureId}`);
|
|
147
229
|
console.log(` Files updated: ${syncResult.filesCreated.length + syncResult.filesUpdated.length}`);
|
|
148
230
|
|
|
149
|
-
//
|
|
150
|
-
//
|
|
151
|
-
|
|
231
|
+
// ========================================================================
|
|
232
|
+
// EXTERNAL TOOL SYNC: Close issues for completed user stories (v0.26.15)
|
|
233
|
+
// ========================================================================
|
|
234
|
+
// livingDocsSync.syncIncrement() updates CONTENT but doesn't CLOSE issues.
|
|
235
|
+
// We need to explicitly trigger post-user-story-complete hook for each US.
|
|
236
|
+
//
|
|
237
|
+
// Flow:
|
|
238
|
+
// 1. For each newly completed US
|
|
239
|
+
// 2. Call post-user-story-complete.sh with spec-id and us-id
|
|
240
|
+
// 3. Hook handles: find issue, add completion comment, close issue
|
|
241
|
+
//
|
|
242
|
+
// Gate checks happen inside the hook based on config flags.
|
|
243
|
+
|
|
244
|
+
console.log(`\nš” Triggering external tool updates for ${newlyCompleted.length} completed user stories...`);
|
|
245
|
+
|
|
246
|
+
for (const us of newlyCompleted) {
|
|
247
|
+
try {
|
|
248
|
+
await triggerUserStoryCompleteHook(incrementId, us.usId, projectRoot);
|
|
249
|
+
console.log(` ā
${us.usId}: External tool updated`);
|
|
250
|
+
} catch (hookError: any) {
|
|
251
|
+
// Non-blocking: Log but continue with next US
|
|
252
|
+
console.warn(` ā ļø ${us.usId}: Hook failed (${hookError.message})`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
152
255
|
|
|
153
256
|
// Record successful sync for throttling
|
|
154
257
|
throttle.recordSync(incrementId);
|
|
@@ -36,8 +36,20 @@ export declare class AutoTransitionManager {
|
|
|
36
36
|
/**
|
|
37
37
|
* Handle tasks.md creation event
|
|
38
38
|
* PLANNING/BACKLOG ā ACTIVE
|
|
39
|
+
*
|
|
40
|
+
* CRITICAL FIX (2025-11-24): Also trigger living docs sync if feature_id is null
|
|
41
|
+
* In single-prompt scenarios, increment may be created with "active" status
|
|
42
|
+
* directly, bypassing the normal transition flow. When tasks.md is created,
|
|
43
|
+
* we know spec.md exists and can safely sync living docs.
|
|
39
44
|
*/
|
|
40
45
|
handleTasksCreated(incrementId: string): Promise<AutoTransitionResult>;
|
|
46
|
+
/**
|
|
47
|
+
* Trigger living docs sync if feature_id is missing
|
|
48
|
+
*
|
|
49
|
+
* Called when tasks.md is created but increment is already ACTIVE.
|
|
50
|
+
* At this point spec.md exists, so sync will succeed.
|
|
51
|
+
*/
|
|
52
|
+
private triggerLivingDocsSyncIfNeeded;
|
|
41
53
|
/**
|
|
42
54
|
* Handle first task started event
|
|
43
55
|
* PLANNING ā ACTIVE
|
|
@@ -55,6 +55,11 @@ export class AutoTransitionManager {
|
|
|
55
55
|
/**
|
|
56
56
|
* Handle tasks.md creation event
|
|
57
57
|
* PLANNING/BACKLOG ā ACTIVE
|
|
58
|
+
*
|
|
59
|
+
* CRITICAL FIX (2025-11-24): Also trigger living docs sync if feature_id is null
|
|
60
|
+
* In single-prompt scenarios, increment may be created with "active" status
|
|
61
|
+
* directly, bypassing the normal transition flow. When tasks.md is created,
|
|
62
|
+
* we know spec.md exists and can safely sync living docs.
|
|
58
63
|
*/
|
|
59
64
|
async handleTasksCreated(incrementId) {
|
|
60
65
|
try {
|
|
@@ -64,6 +69,7 @@ export class AutoTransitionManager {
|
|
|
64
69
|
const from = metadata.status;
|
|
65
70
|
validateTransition(from, IncrementStatus.ACTIVE);
|
|
66
71
|
MetadataManager.updateStatus(incrementId, IncrementStatus.ACTIVE);
|
|
72
|
+
// Note: updateStatus() triggers StatusChangeSyncTrigger which handles living docs sync
|
|
67
73
|
return {
|
|
68
74
|
transitioned: true,
|
|
69
75
|
from,
|
|
@@ -71,6 +77,11 @@ export class AutoTransitionManager {
|
|
|
71
77
|
reason: 'tasks.md created - execution phase started'
|
|
72
78
|
};
|
|
73
79
|
}
|
|
80
|
+
// CRITICAL FIX: Even if already ACTIVE, check if living docs need sync
|
|
81
|
+
// This handles single-prompt scenarios where increment was created with "active" status
|
|
82
|
+
if (metadata.status === IncrementStatus.ACTIVE) {
|
|
83
|
+
await this.triggerLivingDocsSyncIfNeeded(incrementId);
|
|
84
|
+
}
|
|
74
85
|
return {
|
|
75
86
|
transitioned: false,
|
|
76
87
|
reason: `Already in ${metadata.status} - no transition needed`
|
|
@@ -83,6 +94,40 @@ export class AutoTransitionManager {
|
|
|
83
94
|
};
|
|
84
95
|
}
|
|
85
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Trigger living docs sync if feature_id is missing
|
|
99
|
+
*
|
|
100
|
+
* Called when tasks.md is created but increment is already ACTIVE.
|
|
101
|
+
* At this point spec.md exists, so sync will succeed.
|
|
102
|
+
*/
|
|
103
|
+
async triggerLivingDocsSyncIfNeeded(incrementId) {
|
|
104
|
+
try {
|
|
105
|
+
const metadataPath = path.join(this.projectRoot, '.specweave/increments', incrementId, 'metadata.json');
|
|
106
|
+
if (!fs.existsSync(metadataPath)) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const content = fs.readFileSync(metadataPath, 'utf-8');
|
|
110
|
+
const metadata = JSON.parse(content);
|
|
111
|
+
// Only sync if feature_id is missing
|
|
112
|
+
if (!metadata.feature_id) {
|
|
113
|
+
console.log(`š Increment ${incrementId} missing feature_id - triggering living docs sync...`);
|
|
114
|
+
// Dynamic import to avoid circular dependency
|
|
115
|
+
const { LivingDocsSync } = await import('../living-docs/living-docs-sync.js');
|
|
116
|
+
const sync = new LivingDocsSync(this.projectRoot);
|
|
117
|
+
const result = await sync.syncIncrement(incrementId);
|
|
118
|
+
if (result.success) {
|
|
119
|
+
console.log(`ā
Living docs synced for ${incrementId} ā ${result.featureId}`);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
console.warn(`ā ļø Living docs sync completed with errors for ${incrementId}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
// Non-fatal - log warning but don't fail the transition
|
|
128
|
+
console.warn(`ā ļø Failed to check/trigger living docs sync: ${error}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
86
131
|
/**
|
|
87
132
|
* Handle first task started event
|
|
88
133
|
* PLANNING ā ACTIVE
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-transition-manager.js","sourceRoot":"","sources":["../../../../src/core/increment/auto-transition-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAiB7B;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAGhC,YAAY,WAAmB;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,sDAAsD;QACtD,2EAA2E;QAC3E,2DAA2D;IAC7D,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,iBAAiB,CAAC,WAAmB;QACzC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAEnD,2CAA2C;YAC3C,IAAI,QAAQ,CAAC,MAAM,KAAK,eAAe,CAAC,OAAO,EAAE,CAAC;gBAChD,kBAAkB,CAAC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;gBAE9D,eAAe,CAAC,YAAY,CAAC,WAAW,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;gBAEpE,OAAO;oBACL,YAAY,EAAE,IAAI;oBAClB,IAAI,EAAE,eAAe,CAAC,OAAO;oBAC7B,EAAE,EAAE,eAAe,CAAC,QAAQ;oBAC5B,MAAM,EAAE,0CAA0C;iBACnD,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,YAAY,EAAE,KAAK;gBACnB,MAAM,EAAE,cAAc,QAAQ,CAAC,MAAM,yBAAyB;aAC/D,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,YAAY,EAAE,KAAK;gBACnB,MAAM,EAAE,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;aAC3E,CAAC;QACJ,CAAC;IACH,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"auto-transition-manager.js","sourceRoot":"","sources":["../../../../src/core/increment/auto-transition-manager.ts"],"names":[],"mappings":"AAAA;;;;;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