specweave 1.0.49 → 1.0.50

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specweave",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "description": "Spec-driven development framework for Claude Code. AI-native workflow with living documentation, intelligent agents, and multilingual support (9 languages). Enterprise-grade traceability with permanent specs and temporary increments.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -47,18 +47,36 @@ if [ -z "$INCREMENT_ID" ]; then
47
47
  fi
48
48
  ```
49
49
 
50
- **Validate increment exists**:
50
+ **Validate increment exists** (check active AND archive directories):
51
51
 
52
52
  ```bash
53
53
  INCREMENT_DIR=".specweave/increments/$INCREMENT_ID"
54
+ INCREMENT_STATUS="active"
55
+
54
56
  if [ ! -d "$INCREMENT_DIR" ]; then
55
- echo "❌ Increment $INCREMENT_ID not found at $INCREMENT_DIR"
56
- exit 1
57
+ # Check archive directory for completed increments
58
+ ARCHIVE_DIR=".specweave/increments/_archive/$INCREMENT_ID"
59
+ if [ -d "$ARCHIVE_DIR" ]; then
60
+ INCREMENT_DIR="$ARCHIVE_DIR"
61
+ INCREMENT_STATUS="completed"
62
+ echo "đŸ“Ļ Found ARCHIVED increment: $INCREMENT_ID (status: completed)"
63
+ else
64
+ echo "❌ Increment $INCREMENT_ID not found in active or archive"
65
+ exit 1
66
+ fi
67
+ else
68
+ echo "✅ Found increment: $INCREMENT_ID"
57
69
  fi
58
-
59
- echo "✅ Found increment: $INCREMENT_ID"
60
70
  ```
61
71
 
72
+ ### âš ī¸ IMPORTANT: DO NOT SKIP SYNC FOR COMPLETED/ARCHIVED INCREMENTS
73
+
74
+ **Even if INCREMENT_STATUS="completed", you MUST proceed with ALL sync steps:**
75
+ - ✅ Still create missing GitHub issues (critical for historical tracking)
76
+ - ✅ Still sync to living docs
77
+ - ✅ Still close issues if they were just created
78
+ - ❌ DO NOT print "no sync needed" for completed increments
79
+
62
80
  **Output**:
63
81
  ```
64
82
  🔍 Auto-detected active increment: 0053-safe-feature-deletion
@@ -67,6 +85,12 @@ echo "✅ Found increment: $INCREMENT_ID"
67
85
  📊 Starting comprehensive progress sync...
68
86
  ```
69
87
 
88
+ **OR for archived/completed**:
89
+ ```
90
+ đŸ“Ļ Found ARCHIVED increment: 0001-content-repurposer-mvp (status: completed)
91
+ 📊 Syncing COMPLETED increment (will create/close GitHub issues)...
92
+ ```
93
+
70
94
  ---
71
95
 
72
96
  ## STEP 2: Sync Tasks → Living Docs (ACs and User Stories)
@@ -96,29 +120,42 @@ fi
96
120
  - Updates spec.md to mark ACs as complete: `- [ ]` → `- [x]`
97
121
  - Updates metadata.json with AC completion count
98
122
 
99
- ### 2.2: Sync to Living Docs (User Stories)
123
+ ### 2.2: Sync to Living Docs (User Stories) - MANDATORY BEFORE EXTERNAL SYNC
124
+
125
+ ### âš ī¸ CRITICAL: THIS STEP IS MANDATORY AND MUST COMPLETE BEFORE ANY EXTERNAL TOOL OPERATIONS
126
+
127
+ **Why?** External tools (GitHub, JIRA, ADO) sync FROM living docs. If you skip this step:
128
+ - External issues will have stale/outdated content
129
+ - User stories won't reflect completed status
130
+ - AC checkboxes in GitHub issues won't be checked
100
131
 
101
- Call the existing `/sw:sync-specs` command:
132
+ **You MUST invoke the `/sw:sync-specs` command:**
102
133
 
103
134
  ```bash
104
135
  echo "📚 Step 2/5: Syncing increment to living docs..."
136
+ echo " âš ī¸ THIS MUST COMPLETE BEFORE EXTERNAL TOOL SYNC"
105
137
 
106
- # Sync increment specs to living docs structure
138
+ # MANDATORY: Sync increment specs to living docs structure
139
+ # This populates .specweave/docs/internal/specs/{project}/FS-XXX/
107
140
  npx specweave sync-specs "$INCREMENT_ID"
108
141
 
109
142
  if [ $? -eq 0 ]; then
110
143
  echo " ✅ Living docs sync complete"
144
+ echo " 📁 Updated: .specweave/docs/internal/specs/{project}/FS-XXX/"
111
145
  else
112
- echo " ❌ Living docs sync failed"
146
+ echo " ❌ Living docs sync failed - BLOCKING external sync"
113
147
  exit 1
114
148
  fi
115
149
  ```
116
150
 
117
151
  **What this does**:
118
- - Syncs spec.md → living docs user stories
152
+ - Syncs spec.md → living docs user stories in `.specweave/docs/internal/specs/`
119
153
  - Updates user story completion status
120
154
  - Generates/updates feature ID if needed
121
155
  - Updates README.md in feature folder
156
+ - **Creates the content that external tools will sync FROM**
157
+
158
+ ### ⛔ DO NOT PROCEED TO STEP 3 UNTIL THIS COMPLETES SUCCESSFULLY
122
159
 
123
160
  ---
124
161
 
@@ -194,6 +231,15 @@ fi
194
231
 
195
232
  **Philosophy**: `/sw:sync-progress` is the "single button" - it should JUST WORK. If GitHub is configured and no issue exists, CREATE IT.
196
233
 
234
+ ### âš ī¸ CRITICAL RULE: DO NOT SKIP FOR COMPLETED INCREMENTS
235
+
236
+ **You MUST create GitHub issues even for COMPLETED increments!**
237
+
238
+ - ❌ WRONG: "Increment already completed - no sync needed" → SKIP creation
239
+ - ✅ CORRECT: Create issues regardless of status, then sync/close them
240
+
241
+ **Why?** Users need GitHub issues for historical tracking, team visibility, and compliance. A completed increment without a GitHub issue is an incomplete record.
242
+
197
243
  **Check and auto-create**:
198
244
 
199
245
  ```bash
@@ -389,6 +435,13 @@ if [[ " ${EXTERNAL_TOOLS[@]} " =~ " github " ]] && [ "$NO_GITHUB" != "true" ]; t
389
435
  else
390
436
  echo " âš ī¸ GitHub sync had warnings (check logs)"
391
437
  fi
438
+
439
+ # SPECIAL CASE: For completed/archived increments, also CLOSE the issue
440
+ if [ "$INCREMENT_STATUS" = "completed" ]; then
441
+ echo " 🔒 Closing GitHub issue (increment is completed)..."
442
+ /sw-github:close "$INCREMENT_ID"
443
+ echo " ✅ GitHub issue closed"
444
+ fi
392
445
  fi
393
446
  fi
394
447
  fi
@@ -401,6 +454,11 @@ fi
401
454
  - Updates labels based on status
402
455
  - Pulls external changes (comments, status changes from team)
403
456
 
457
+ **SPECIAL CASE: Completed/Archived Increments**:
458
+ - If `INCREMENT_STATUS="completed"` and issue was just created → ALSO close the issue
459
+ - Use `/sw-github:close $INCREMENT_ID` to close with completion comment
460
+ - This provides complete historical tracking
461
+
404
462
  ### 5.2: Sync to JIRA (if configured)
405
463
 
406
464
  ```bash
@@ -540,7 +598,7 @@ echo " â€ĸ Run /sw:done $INCREMENT_ID when ready to close"
540
598
  echo ""
541
599
  ```
542
600
 
543
- **Example Output**:
601
+ **Example Output (Active Increment)**:
544
602
 
545
603
  ```
546
604
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -565,6 +623,34 @@ Next steps:
565
623
  â€ĸ Run /sw:done 0053 when ready to close
566
624
  ```
567
625
 
626
+ **Example Output (COMPLETED/Archived Increment)**:
627
+
628
+ ```
629
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
630
+ ✅ PROGRESS SYNC COMPLETE (ARCHIVED INCREMENT)
631
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
632
+
633
+ đŸ“Ļ Increment: 0001-content-repurposer-mvp
634
+ 📊 Status: completed (archived)
635
+
636
+ ✅ Synced:
637
+ â€ĸ Tasks → ACs (spec.md) 54/54 ACs ✓
638
+ â€ĸ Spec → Living docs 10/10 user stories ✓
639
+ â€ĸ Status line cache 100% complete ✓
640
+
641
+ 🔗 External Tools:
642
+ â€ĸ GitHub issue AUTO-CREATED: #123
643
+ â€ĸ GitHub issue CLOSED: #123 (increment complete)
644
+
645
+ 📊 Completion:
646
+ â€ĸ Tasks: 35/35 (100%)
647
+ â€ĸ ACs: 54/54 (100%)
648
+ â€ĸ User Stories: 10/10 (100%)
649
+
650
+ â„šī¸ Archived increment synced successfully!
651
+ GitHub issues created and closed for historical tracking.
652
+ ```
653
+
568
654
  ---
569
655
 
570
656
  ## STEP 7: Dry-Run Mode (If --dry-run flag)
@@ -24,6 +24,13 @@ tasks.md → spec.md ACs → living docs → AUTO-CREATE external issues → syn
24
24
 
25
25
  **No more "No GitHub issue linked" errors!** The command auto-creates missing issues.
26
26
 
27
+ ### âš ī¸ CRITICAL: Works on COMPLETED/ARCHIVED Increments Too!
28
+
29
+ **This command MUST create and sync GitHub issues even for completed increments:**
30
+ - Creates issues for historical tracking
31
+ - Closes issues immediately after creation (since increment is complete)
32
+ - Never skips with "no sync needed" for completed increments
33
+
27
34
  ---
28
35
 
29
36
  ## When to Use This Command
@@ -7,6 +7,29 @@ description: Close GitHub issue for completed SpecWeave increment. Posts complet
7
7
 
8
8
  Close the GitHub issue associated with a completed SpecWeave increment.
9
9
 
10
+ ## ⛔ MANDATORY: Sync Living Docs BEFORE Closing
11
+
12
+ **GitHub issue content is generated FROM living docs.** If living docs are stale, the closing summary will have outdated information.
13
+
14
+ **You MUST run `/sw:sync-specs` BEFORE closing (unless using /sw:sync-progress):**
15
+
16
+ ```bash
17
+ # STEP 1: Ensure living docs reflect final state
18
+ /sw:sync-specs <increment-id>
19
+
20
+ # STEP 2: Then close GitHub issue
21
+ /sw-github:close <increment-id>
22
+ ```
23
+
24
+ **Why?**
25
+ - Closing comment includes final stats from living docs
26
+ - User story completion status read from living docs
27
+ - AC checkboxes reflect living docs state
28
+
29
+ **Note:** `/sw:done` and `/sw:sync-progress` call sync-specs automatically.
30
+
31
+ ---
32
+
10
33
  **Usage**: `/sw-github:close <increment-id>`
11
34
 
12
35
  ```bash
@@ -7,6 +7,30 @@ description: Create a GitHub issue for a SpecWeave increment. Generates issue fr
7
7
 
8
8
  Create a GitHub issue for the specified SpecWeave increment.
9
9
 
10
+ ## ⛔ MANDATORY: Sync Living Docs BEFORE Creating Issue
11
+
12
+ **GitHub issue content is generated FROM living docs.** If living docs don't exist or are stale, the issue will be incomplete.
13
+
14
+ **You MUST run `/sw:sync-specs` BEFORE creating (unless using /sw:sync-progress):**
15
+
16
+ ```bash
17
+ # STEP 1: Ensure living docs exist and are current
18
+ /sw:sync-specs <increment-id>
19
+
20
+ # STEP 2: Then create GitHub issue
21
+ /sw-github:create <increment-id>
22
+ ```
23
+
24
+ **Why?**
25
+ - Issue body is generated from `.specweave/docs/internal/specs/FS-XXX/`
26
+ - User stories and ACs come from living docs
27
+ - Task checklist reflects living docs structure
28
+ - Without sync-specs, issue will be created from raw increment spec.md (less structured)
29
+
30
+ **Note:** `/sw:sync-progress` calls sync-specs automatically before creating issues.
31
+
32
+ ---
33
+
10
34
  **Usage**: `/sw-github:create <increment-id>`
11
35
 
12
36
  ```bash
@@ -5,9 +5,30 @@ description: Synchronize SpecWeave increment with GitHub issue (Multi-Project Su
5
5
 
6
6
  # Sync Increment with GitHub Issue (Multi-Project)
7
7
 
8
- ## âš ī¸ CRITICAL: Sync Routing (Read First!)
8
+ ## âš ī¸ CRITICAL: Pre-Sync Requirements (Read First!)
9
9
 
10
- **Before executing ANY sync, you MUST determine the correct sync path:**
10
+ ### ⛔ MANDATORY: Sync Living Docs BEFORE GitHub Sync
11
+
12
+ **GitHub sync reads FROM living docs.** If living docs are stale, GitHub issues will have outdated content.
13
+
14
+ **You MUST run `/sw:sync-specs` (or ensure it ran) BEFORE this command:**
15
+
16
+ ```bash
17
+ # STEP 1: Ensure living docs are current (MANDATORY)
18
+ /sw:sync-specs <increment-id>
19
+
20
+ # STEP 2: Then sync to GitHub
21
+ /sw-github:sync <increment-id>
22
+ ```
23
+
24
+ **Why?**
25
+ - GitHub issues are generated FROM `.specweave/docs/internal/specs/FS-XXX/`
26
+ - If you skip sync-specs, GitHub will show stale user stories/ACs
27
+ - `/sw:sync-progress` calls sync-specs automatically, but `/sw-github:sync` does NOT
28
+
29
+ **If you're calling this directly (not via /sw:sync-progress), run sync-specs first!**
30
+
31
+ ---
11
32
 
12
33
  ### Step 0: Detect Project Structure
13
34