specweave 0.24.1 → 0.24.8

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 (173) hide show
  1. package/CLAUDE.md +106 -0
  2. package/README.md +34 -0
  3. package/dist/src/cli/commands/init.d.ts.map +1 -1
  4. package/dist/src/cli/commands/init.js +80 -41
  5. package/dist/src/cli/commands/init.js.map +1 -1
  6. package/dist/src/cli/helpers/issue-tracker/github-multi-repo.d.ts +5 -2
  7. package/dist/src/cli/helpers/issue-tracker/github-multi-repo.d.ts.map +1 -1
  8. package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js +72 -6
  9. package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js.map +1 -1
  10. package/dist/src/cli/helpers/issue-tracker/github.d.ts +2 -1
  11. package/dist/src/cli/helpers/issue-tracker/github.d.ts.map +1 -1
  12. package/dist/src/cli/helpers/issue-tracker/github.js +4 -3
  13. package/dist/src/cli/helpers/issue-tracker/github.js.map +1 -1
  14. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  15. package/dist/src/cli/helpers/issue-tracker/index.js +26 -9
  16. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  17. package/dist/src/cli/helpers/issue-tracker/types.d.ts +2 -1
  18. package/dist/src/cli/helpers/issue-tracker/types.d.ts.map +1 -1
  19. package/dist/src/cli/helpers/issue-tracker/types.js.map +1 -1
  20. package/dist/src/config/types.d.ts +24 -24
  21. package/dist/src/core/config/types.d.ts +25 -0
  22. package/dist/src/core/config/types.d.ts.map +1 -1
  23. package/dist/src/core/config/types.js +6 -0
  24. package/dist/src/core/config/types.js.map +1 -1
  25. package/dist/src/core/repo-structure/git-error-handler.d.ts +37 -0
  26. package/dist/src/core/repo-structure/git-error-handler.d.ts.map +1 -0
  27. package/dist/src/core/repo-structure/git-error-handler.js +214 -0
  28. package/dist/src/core/repo-structure/git-error-handler.js.map +1 -0
  29. package/dist/src/core/repo-structure/git-provider.d.ts +183 -0
  30. package/dist/src/core/repo-structure/git-provider.d.ts.map +1 -0
  31. package/dist/src/core/repo-structure/git-provider.js +57 -0
  32. package/dist/src/core/repo-structure/git-provider.js.map +1 -0
  33. package/dist/src/core/repo-structure/github-validator.d.ts +1 -0
  34. package/dist/src/core/repo-structure/github-validator.d.ts.map +1 -1
  35. package/dist/src/core/repo-structure/github-validator.js +35 -9
  36. package/dist/src/core/repo-structure/github-validator.js.map +1 -1
  37. package/dist/src/core/repo-structure/platform-registry.d.ts +114 -0
  38. package/dist/src/core/repo-structure/platform-registry.d.ts.map +1 -0
  39. package/dist/src/core/repo-structure/platform-registry.js +195 -0
  40. package/dist/src/core/repo-structure/platform-registry.js.map +1 -0
  41. package/dist/src/core/repo-structure/prompt-consolidator.d.ts +30 -0
  42. package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
  43. package/dist/src/core/repo-structure/prompt-consolidator.js +69 -0
  44. package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
  45. package/dist/src/core/repo-structure/providers/bitbucket-provider.d.ts +54 -0
  46. package/dist/src/core/repo-structure/providers/bitbucket-provider.d.ts.map +1 -0
  47. package/dist/src/core/repo-structure/providers/bitbucket-provider.js +104 -0
  48. package/dist/src/core/repo-structure/providers/bitbucket-provider.js.map +1 -0
  49. package/dist/src/core/repo-structure/providers/github-provider.d.ts +53 -0
  50. package/dist/src/core/repo-structure/providers/github-provider.d.ts.map +1 -0
  51. package/dist/src/core/repo-structure/providers/github-provider.js +239 -0
  52. package/dist/src/core/repo-structure/providers/github-provider.js.map +1 -0
  53. package/dist/src/core/repo-structure/providers/gitlab-provider.d.ts +50 -0
  54. package/dist/src/core/repo-structure/providers/gitlab-provider.d.ts.map +1 -0
  55. package/dist/src/core/repo-structure/providers/gitlab-provider.js +97 -0
  56. package/dist/src/core/repo-structure/providers/gitlab-provider.js.map +1 -0
  57. package/dist/src/core/repo-structure/providers/index.d.ts +33 -0
  58. package/dist/src/core/repo-structure/providers/index.d.ts.map +1 -0
  59. package/dist/src/core/repo-structure/providers/index.js +60 -0
  60. package/dist/src/core/repo-structure/providers/index.js.map +1 -0
  61. package/dist/src/core/repo-structure/repo-bulk-discovery.d.ts +33 -0
  62. package/dist/src/core/repo-structure/repo-bulk-discovery.d.ts.map +1 -0
  63. package/dist/src/core/repo-structure/repo-bulk-discovery.js +275 -0
  64. package/dist/src/core/repo-structure/repo-bulk-discovery.js.map +1 -0
  65. package/dist/src/core/repo-structure/repo-structure-manager.d.ts +18 -2
  66. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  67. package/dist/src/core/repo-structure/repo-structure-manager.js +303 -85
  68. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  69. package/dist/src/core/repo-structure/url-generator.d.ts +80 -0
  70. package/dist/src/core/repo-structure/url-generator.d.ts.map +1 -0
  71. package/dist/src/core/repo-structure/url-generator.js +110 -0
  72. package/dist/src/core/repo-structure/url-generator.js.map +1 -0
  73. package/dist/src/init/architecture/types.d.ts +6 -6
  74. package/dist/src/utils/plugin-validator.d.ts.map +1 -1
  75. package/dist/src/utils/plugin-validator.js +15 -14
  76. package/dist/src/utils/plugin-validator.js.map +1 -1
  77. package/package.json +4 -4
  78. package/plugins/specweave/.claude-plugin/plugin.json +4 -4
  79. package/plugins/specweave/agents/pm/AGENT.md +2 -0
  80. package/plugins/specweave/commands/specweave-do.md +0 -47
  81. package/plugins/specweave/commands/specweave-increment.md +0 -82
  82. package/plugins/specweave/commands/specweave-next.md +0 -47
  83. package/plugins/specweave/hooks/post-task-completion.sh +67 -6
  84. package/plugins/specweave/hooks/pre-edit-spec.sh +11 -0
  85. package/plugins/specweave/hooks/pre-task-completion.sh +69 -2
  86. package/plugins/specweave/hooks/pre-write-spec.sh +11 -0
  87. package/plugins/specweave/skills/increment-planner/SKILL.md +124 -4
  88. package/plugins/specweave-ado/lib/ado-multi-project-sync.js +0 -1
  89. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +3 -3
  90. package/plugins/specweave/agents/pm/AGENT.md.bak +0 -1893
  91. package/plugins/specweave/hooks/docs-changed.sh.backup +0 -79
  92. package/plugins/specweave/hooks/human-input-required.sh.backup +0 -75
  93. package/plugins/specweave/hooks/lib/migrate-increment-work.sh.bak +0 -245
  94. package/plugins/specweave/hooks/lib/sync-spec-content.sh.bak +0 -149
  95. package/plugins/specweave/hooks/lib/validate-spec-status.sh.bak +0 -163
  96. package/plugins/specweave/hooks/post-first-increment.sh.backup +0 -61
  97. package/plugins/specweave/hooks/post-first-increment.sh.bak +0 -61
  98. package/plugins/specweave/hooks/post-increment-change.sh.backup +0 -98
  99. package/plugins/specweave/hooks/post-increment-completion.sh.backup +0 -231
  100. package/plugins/specweave/hooks/post-increment-planning.sh.backup +0 -1048
  101. package/plugins/specweave/hooks/post-increment-status-change.sh.backup +0 -147
  102. package/plugins/specweave/hooks/post-spec-update.sh.backup +0 -158
  103. package/plugins/specweave/hooks/post-spec-update.sh.bak +0 -158
  104. package/plugins/specweave/hooks/post-user-story-complete.sh.backup +0 -179
  105. package/plugins/specweave/hooks/post-user-story-complete.sh.bak +0 -179
  106. package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +0 -83
  107. package/plugins/specweave/hooks/pre-command-deduplication.sh.bak +0 -83
  108. package/plugins/specweave/hooks/pre-implementation.sh.backup +0 -67
  109. package/plugins/specweave/hooks/pre-task-completion.sh.backup +0 -194
  110. package/plugins/specweave/hooks/pre-tool-use.sh.backup +0 -133
  111. package/plugins/specweave/hooks/user-prompt-submit.sh.backup +0 -386
  112. package/plugins/specweave/hooks/user-prompt-submit.sh.bak +0 -386
  113. package/plugins/specweave/lib/hooks/auto-transition.js.bak +0 -50
  114. package/plugins/specweave/lib/hooks/auto-transition.ts.bak +0 -84
  115. package/plugins/specweave/lib/hooks/git-diff-analyzer.d.js.bak +0 -0
  116. package/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts.bak +0 -89
  117. package/plugins/specweave/lib/hooks/git-diff-analyzer.js.bak +0 -142
  118. package/plugins/specweave/lib/hooks/git-diff-analyzer.ts.bak +0 -269
  119. package/plugins/specweave/lib/hooks/invoke-translator-skill.d.js.bak +0 -0
  120. package/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts.bak +0 -60
  121. package/plugins/specweave/lib/hooks/invoke-translator-skill.js.bak +0 -155
  122. package/plugins/specweave/lib/hooks/invoke-translator-skill.ts.bak +0 -264
  123. package/plugins/specweave/lib/hooks/prepare-reflection-context.d.js.bak +0 -0
  124. package/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts.bak +0 -42
  125. package/plugins/specweave/lib/hooks/prepare-reflection-context.js.bak +0 -110
  126. package/plugins/specweave/lib/hooks/prepare-reflection-context.ts.bak +0 -178
  127. package/plugins/specweave/lib/hooks/reflection-config-loader.d.js.bak +0 -0
  128. package/plugins/specweave/lib/hooks/reflection-config-loader.d.ts.bak +0 -45
  129. package/plugins/specweave/lib/hooks/reflection-config-loader.js.bak +0 -92
  130. package/plugins/specweave/lib/hooks/reflection-config-loader.ts.bak +0 -156
  131. package/plugins/specweave/lib/hooks/reflection-parser.d.js.bak +0 -0
  132. package/plugins/specweave/lib/hooks/reflection-parser.d.ts.bak +0 -33
  133. package/plugins/specweave/lib/hooks/reflection-parser.js.bak +0 -301
  134. package/plugins/specweave/lib/hooks/reflection-parser.ts.bak +0 -484
  135. package/plugins/specweave/lib/hooks/reflection-prompt-builder.d.js.bak +0 -0
  136. package/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts.bak +0 -56
  137. package/plugins/specweave/lib/hooks/reflection-prompt-builder.js.bak +0 -182
  138. package/plugins/specweave/lib/hooks/reflection-prompt-builder.ts.bak +0 -306
  139. package/plugins/specweave/lib/hooks/reflection-storage.d.js.bak +0 -0
  140. package/plugins/specweave/lib/hooks/reflection-storage.d.ts.bak +0 -64
  141. package/plugins/specweave/lib/hooks/reflection-storage.js.bak +0 -231
  142. package/plugins/specweave/lib/hooks/reflection-storage.ts.bak +0 -369
  143. package/plugins/specweave/lib/hooks/run-self-reflection.d.js.bak +0 -0
  144. package/plugins/specweave/lib/hooks/run-self-reflection.d.ts.bak +0 -43
  145. package/plugins/specweave/lib/hooks/run-self-reflection.js.bak +0 -132
  146. package/plugins/specweave/lib/hooks/run-self-reflection.ts.bak +0 -258
  147. package/plugins/specweave/lib/hooks/sync-cache.js.bak +0 -294
  148. package/plugins/specweave/lib/hooks/sync-living-docs.d.js.bak +0 -1
  149. package/plugins/specweave/lib/hooks/sync-living-docs.d.ts.bak +0 -27
  150. package/plugins/specweave/lib/hooks/sync-living-docs.js.bak +0 -339
  151. package/plugins/specweave/lib/hooks/sync-us-tasks.js.bak +0 -476
  152. package/plugins/specweave/lib/hooks/translate-file.d.js.bak +0 -0
  153. package/plugins/specweave/lib/hooks/translate-file.d.ts.bak +0 -59
  154. package/plugins/specweave/lib/hooks/translate-file.js.bak +0 -289
  155. package/plugins/specweave/lib/hooks/translate-file.ts.bak +0 -428
  156. package/plugins/specweave/lib/hooks/translate-living-docs.d.js.bak +0 -0
  157. package/plugins/specweave/lib/hooks/translate-living-docs.d.ts.bak +0 -13
  158. package/plugins/specweave/lib/hooks/translate-living-docs.js.bak +0 -119
  159. package/plugins/specweave/lib/hooks/translate-living-docs.ts.bak +0 -224
  160. package/plugins/specweave/lib/hooks/update-ac-status.js.bak +0 -51
  161. package/plugins/specweave/lib/hooks/update-ac-status.ts.bak +0 -103
  162. package/plugins/specweave/lib/hooks/update-tasks-md.d.js.bak +0 -1
  163. package/plugins/specweave/lib/hooks/update-tasks-md.d.ts.bak +0 -29
  164. package/plugins/specweave/lib/hooks/update-tasks-md.js.bak +0 -296
  165. package/plugins/specweave/lib/hooks/update-tasks-md.ts.bak +0 -489
  166. package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +0 -353
  167. package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +0 -172
  168. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +0 -170
  169. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +0 -228
  170. package/plugins/specweave-github/hooks/post-task-completion.sh.backup +0 -258
  171. package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +0 -172
  172. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -444
  173. package/plugins/specweave-release/hooks/post-task-completion.sh.backup +0 -110
package/CLAUDE.md CHANGED
@@ -596,6 +596,70 @@ node -e "const yaml = require('js-yaml'); const fs = require('fs'); \
596
596
 
597
597
  ---
598
598
 
599
+ ## 17. Git Provider Abstraction (v0.24.0+)
600
+
601
+ **Architecture**: Interface-driven multi-platform support with registry pattern
602
+
603
+ **Key files**:
604
+ - `src/core/repo-structure/git-provider.ts` - Interface definition
605
+ - `src/core/repo-structure/platform-registry.ts` - Singleton registry
606
+ - `src/core/repo-structure/providers/` - Platform implementations
607
+
608
+ **Provider Interface**:
609
+ ```typescript
610
+ export interface GitProvider {
611
+ readonly config: GitProviderConfig;
612
+
613
+ validateRepository(owner: string, repo: string, token?: string): Promise<ValidationResult>;
614
+ validateOwner(owner: string, token?: string): Promise<OwnerValidationResult>;
615
+ createRepository(params: CreateRepoParams, token: string): Promise<string>;
616
+ isOrganization(owner: string, token?: string): Promise<boolean>;
617
+
618
+ getRemoteUrl(owner: string, repo: string, urlType: 'ssh' | 'https'): string;
619
+ getTokenUrl(): string;
620
+ getRequiredScopes(isOrg: boolean): string[];
621
+ }
622
+ ```
623
+
624
+ **Usage pattern**:
625
+ ```typescript
626
+ import { initializeProviders } from './providers/index.js';
627
+ import { getPlatformRegistry } from './platform-registry.js';
628
+
629
+ // Initialize providers (call once during startup)
630
+ initializeProviders();
631
+
632
+ // Get provider for user-selected platform
633
+ const registry = getPlatformRegistry();
634
+ const provider = registry.getProvider('github'); // or 'gitlab', 'bitbucket'
635
+
636
+ // Use provider methods (platform-agnostic code)
637
+ const result = await provider.validateRepository('owner', 'repo', token);
638
+ const url = provider.getRemoteUrl('owner', 'repo', 'ssh');
639
+ await provider.createRepository({ owner, name, description, visibility }, token);
640
+ ```
641
+
642
+ **Platform Support**:
643
+ - ✅ GitHub (fully supported): `github-provider.ts`
644
+ - ⏳ GitLab (stub): `gitlab-provider.ts` (throws "coming soon" error)
645
+ - ⏳ Bitbucket (stub): `bitbucket-provider.ts` (throws "coming soon" error)
646
+
647
+ **Adding new platform**:
648
+ 1. Create `src/core/repo-structure/providers/{platform}-provider.ts`
649
+ 2. Implement `GitProvider` interface
650
+ 3. Register in `providers/index.ts`: `registry.registerProvider('platform', provider)`
651
+ 4. Update platform registry metadata: `registry.registerPlatform({ type, name, description, supported })`
652
+
653
+ **NEVER**:
654
+ - ❌ Hardcode platform names (use `provider.config.name`)
655
+ - ❌ Hardcode API endpoints (use `provider.config.apiBaseUrl`)
656
+ - ❌ Hardcode Git hosts (use `provider.config.host`)
657
+ - ❌ Use GitHub-specific methods (use provider interface)
658
+
659
+ **See**: ADR-0069 (Git Provider Abstraction Layer)
660
+
661
+ ---
662
+
599
663
  ## Project Structure
600
664
 
601
665
  ```
@@ -725,6 +789,48 @@ npm run rebuild
725
789
  - ADR-0060 (Three-tier optimization architecture)
726
790
  - `.specweave/increments/0050-*/reports/hook-crash-analysis.md` (Incident analysis)
727
791
 
792
+ ### Active Increment Filtering (v0.24.4 - ARCHITECTURAL FIX)
793
+
794
+ **Critical architectural change**: Hooks now **ONLY** process active increments.
795
+
796
+ **Problem**: The old logic used `ls -td` (time-based) which:
797
+ - Processed 50+ increments on every TodoWrite
798
+ - Could pick completed increments if recently modified
799
+ - Caused infinite loops when hitting bad AC data
800
+ - Wasted 90%+ of hook overhead on completed work
801
+
802
+ **Solution**: State-based filtering (`.specweave/state/active-increment.json`)
803
+
804
+ ```bash
805
+ # NEW: Read active increments from state file
806
+ mapfile -t ACTIVE_INCREMENTS < <(jq -r '.ids[]' "$ACTIVE_STATE_FILE")
807
+
808
+ # Process ONLY active increments
809
+ for CURRENT_INCREMENT in "${ACTIVE_INCREMENTS[@]}"; do
810
+ # Safety: Skip if completed/abandoned/archived
811
+ if [[ "$STATUS" == "completed" ]] || [[ "$STATUS" == "abandoned" ]]; then
812
+ continue
813
+ fi
814
+
815
+ # Process (tasks.md, AC sync, living docs, etc.)
816
+ done
817
+ ```
818
+
819
+ **Impact**:
820
+ - ✅ 95% reduction in hook overhead (50+ → 1-2 increments)
821
+ - ✅ Zero risk of infinite loops (completed increments never touched)
822
+ - ✅ Clean architecture (source of truth: state file)
823
+ - ✅ Multi-increment support (processes array)
824
+
825
+ **Fail-safe defaults**:
826
+ - No state file → skip all work
827
+ - Empty array → skip all work (normal when no active increments)
828
+ - Missing directory → skip increment
829
+ - Archived → skip increment
830
+ - Completed/abandoned status → skip increment
831
+
832
+ **See**: `.specweave/increments/0050-*/reports/ARCHITECTURAL-FIX-ACTIVE-INCREMENT-FILTERING.md`
833
+
728
834
  ---
729
835
 
730
836
  ## Development Workflow
package/README.md CHANGED
@@ -347,6 +347,40 @@ specweave init .
347
347
  - ☁️ **Cloud Credits Discovery** - AWS Activate, Azure Startup, GCP eligibility
348
348
  - 📦 **Repository Selection** - Batch select 1-100+ repos with intelligent routing
349
349
 
350
+ ### Multi-Platform Git Support (NEW!)
351
+
352
+ - 🌐 **Platform Choice** - GitHub (fully supported), GitLab & Bitbucket (coming soon)
353
+ - 🔑 **SSH & HTTPS URLs** - Choose your preferred Git authentication method
354
+ - 🏢 **Self-Hosted Support** - GitHub Enterprise, GitLab self-hosted, custom domains
355
+ - 🔄 **Platform-Agnostic Architecture** - Zero hardcoded platform references
356
+ - ✅ **Smart Validation** - Owner/repo/token validation before repository creation
357
+ - 📝 **Actionable Errors** - Platform-specific troubleshooting steps when things go wrong
358
+
359
+ **During `specweave init`:**
360
+ ```bash
361
+ ? Select Git hosting platform:
362
+ > GitHub (Modern, cloud-native development platform)
363
+ GitLab (Coming soon! Q1 2026)
364
+ Bitbucket (Coming soon! Q2 2026)
365
+
366
+ ? Choose Git URL format:
367
+ > SSH (Recommended - More secure, no password prompts)
368
+ HTTPS (Uses personal access token for authentication)
369
+ ```
370
+
371
+ **Result:**
372
+ ```bash
373
+ # SSH URLs (recommended)
374
+ git@github.com:owner/repo.git
375
+ git@gitlab.com:namespace/project.git
376
+ git@bitbucket.org:workspace/repo.git
377
+
378
+ # HTTPS URLs
379
+ https://github.com/owner/repo.git
380
+ https://gitlab.com/namespace/project.git
381
+ https://bitbucket.org/workspace/repo.git
382
+ ```
383
+
350
384
  ### Production Features
351
385
 
352
386
  - 🤖 **AI-Native Enterprise Sync** - Claude updates JIRA/GitHub/ADO automatically (three-permission control)
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,MAAM,EAAiB,MAAM,uBAAuB,CAAC;AAgB9D,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA8ID,wBAAsB,WAAW,CAC/B,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CA80Cf"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,MAAM,EAAiB,MAAM,uBAAuB,CAAC;AAiB9D,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA8ID,wBAAsB,WAAW,CAC/B,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAy2Cf"}
@@ -1,4 +1,4 @@
1
- import fs from 'fs-extra';
1
+ import fs from 'fs-extra'; // legacy fs-extra
2
2
  import * as path from 'path';
3
3
  import os from 'os';
4
4
  import chalk from 'chalk';
@@ -15,6 +15,7 @@ import { getLocaleManager } from '../../core/i18n/locale-manager.js';
15
15
  import { consoleLogger } from '../../utils/logger.js';
16
16
  import { generateInitialIncrement } from '../helpers/init/initial-increment-generator.js';
17
17
  import { ImportCoordinator } from '../../importers/import-coordinator.js';
18
+ import { StatusLineUpdater } from '../../core/status-line/status-line-updater.js';
18
19
  import { ItemConverter } from '../../importers/item-converter.js';
19
20
  import { loadImportConfig } from '../../config/import-config.js';
20
21
  const __dirname = getDirname(import.meta.url);
@@ -1082,6 +1083,8 @@ export async function initCommand(projectName, options = {}) {
1082
1083
  // Detect existing git remote
1083
1084
  const gitRemoteDetection = detectGitHubRemote(targetDir);
1084
1085
  let repositoryHosting = 'local';
1086
+ let isMultiRepo = false;
1087
+ let repoSelectionConfig = null;
1085
1088
  if (!isCI) {
1086
1089
  const { hosting } = await inquirer.prompt([{
1087
1090
  type: 'list',
@@ -1089,8 +1092,12 @@ export async function initCommand(projectName, options = {}) {
1089
1092
  message: 'How do you host your repository?',
1090
1093
  choices: [
1091
1094
  {
1092
- name: `🐙 GitHub ${gitRemoteDetection ? '(detected)' : '(recommended)'}`,
1093
- value: 'github'
1095
+ name: `🐙 GitHub - Single repository ${gitRemoteDetection ? '(detected)' : ''}`,
1096
+ value: 'github-single'
1097
+ },
1098
+ {
1099
+ name: '🐙 GitHub - Multiple repositories (microservices, monorepo)',
1100
+ value: 'github-multi'
1094
1101
  },
1095
1102
  {
1096
1103
  name: '💻 Local git only (no remote sync)',
@@ -1101,9 +1108,17 @@ export async function initCommand(projectName, options = {}) {
1101
1108
  value: 'other'
1102
1109
  }
1103
1110
  ],
1104
- default: gitRemoteDetection ? 'github' : 'local'
1111
+ default: gitRemoteDetection ? 'github-single' : 'local'
1105
1112
  }]);
1106
1113
  repositoryHosting = hosting;
1114
+ // Normalize for backwards compatibility
1115
+ if (hosting === 'github-single') {
1116
+ repositoryHosting = 'github';
1117
+ }
1118
+ else if (hosting === 'github-multi') {
1119
+ repositoryHosting = 'github';
1120
+ isMultiRepo = true;
1121
+ }
1107
1122
  // Show info for non-GitHub choices
1108
1123
  if (hosting === 'other') {
1109
1124
  console.log('');
@@ -1377,6 +1392,18 @@ export async function initCommand(projectName, options = {}) {
1377
1392
  console.log(chalk.green(` ✔ Created initial increment: ${incrementId}`));
1378
1393
  console.log(chalk.gray(' ✔ Status: ACTIVE (ready to work)'));
1379
1394
  console.log(chalk.gray(' ✔ Files: spec.md, plan.md, tasks.md, metadata.json'));
1395
+ // Initialize status line cache for the new increment
1396
+ try {
1397
+ const statusLineUpdater = new StatusLineUpdater(targetDir);
1398
+ await statusLineUpdater.update();
1399
+ console.log(chalk.gray(' ✔ Status line initialized'));
1400
+ }
1401
+ catch (statusLineError) {
1402
+ // Non-critical: Status line will be created on first task completion
1403
+ if (process.env.DEBUG) {
1404
+ console.log(chalk.gray(` ⚠️ Status line init skipped: ${statusLineError instanceof Error ? statusLineError.message : String(statusLineError)}`));
1405
+ }
1406
+ }
1380
1407
  console.log('');
1381
1408
  console.log(chalk.yellow(' 💡 TIP: Delete this increment and create your first real feature:'));
1382
1409
  console.log(chalk.gray(' rm -rf .specweave/increments/0001-project-setup'));
@@ -1560,49 +1587,61 @@ async function promptAndRunExternalImport(targetDir, isCI) {
1560
1587
  platforms: []
1561
1588
  };
1562
1589
  }
1563
- // US-011: Multi-Repo Selection for GitHub (if GitHub detected and token available)
1590
+ // US-011: Multi-Repo Import
1591
+ // NOTE: This is a separate function scope, so we need our own repoSelectionConfig variable
1564
1592
  let repoSelectionConfig = null;
1565
1593
  if (githubRemote && process.env.GITHUB_TOKEN) {
1566
- const { useMultiRepo } = await inquirer.prompt([
1567
- {
1568
- type: 'confirm',
1569
- name: 'useMultiRepo',
1570
- message: 'Do you want to import from multiple repositories?',
1571
- default: false
1572
- }
1573
- ]);
1574
- if (useMultiRepo) {
1575
- try {
1576
- const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });
1577
- repoSelectionConfig = await selectRepositories(octokit, process.env.GITHUB_TOKEN);
1578
- if (repoSelectionConfig) {
1579
- // Save to config.json for future imports
1580
- const configPath = path.join(targetDir, '.specweave', 'config.json');
1581
- let config = {};
1582
- if (fs.existsSync(configPath)) {
1583
- config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
1584
- }
1585
- if (!config.github) {
1586
- config.github = {};
1587
- }
1588
- config.github.repositories = repoSelectionConfig.repositories;
1589
- config.github.selectionStrategy = repoSelectionConfig.selectionStrategy;
1590
- if (repoSelectionConfig.pattern) {
1591
- config.github.pattern = repoSelectionConfig.pattern;
1592
- }
1593
- if (repoSelectionConfig.organizationName) {
1594
- config.github.organizationName = repoSelectionConfig.organizationName;
1594
+ try {
1595
+ const { useMultiRepo } = await inquirer.prompt([
1596
+ {
1597
+ type: 'confirm',
1598
+ name: 'useMultiRepo',
1599
+ message: 'Do you want to import from multiple repositories?',
1600
+ default: false
1601
+ }
1602
+ ]);
1603
+ if (useMultiRepo) {
1604
+ try {
1605
+ const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });
1606
+ repoSelectionConfig = await selectRepositories(octokit, process.env.GITHUB_TOKEN);
1607
+ if (repoSelectionConfig) {
1608
+ try {
1609
+ const configPath = path.join(targetDir, '.specweave', 'config.json');
1610
+ let config = {};
1611
+ if (fs.existsSync(configPath)) {
1612
+ config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
1613
+ }
1614
+ if (!config.github) {
1615
+ config.github = {};
1616
+ }
1617
+ config.github.repositories = repoSelectionConfig.repositories;
1618
+ config.github.selectionStrategy = repoSelectionConfig.selectionStrategy;
1619
+ if (repoSelectionConfig.pattern) {
1620
+ config.github.pattern = repoSelectionConfig.pattern;
1621
+ }
1622
+ if (repoSelectionConfig.organizationName) {
1623
+ config.github.organizationName = repoSelectionConfig.organizationName;
1624
+ }
1625
+ fs.ensureDirSync(path.dirname(configPath));
1626
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
1627
+ }
1628
+ catch {
1629
+ // Silent - config save is not critical
1630
+ }
1595
1631
  }
1596
- fs.ensureDirSync(path.dirname(configPath));
1597
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
1598
- console.log(chalk.green(`✅ Repository selection saved to config.json\n`));
1632
+ }
1633
+ catch {
1634
+ // Silent - continue with single repo
1599
1635
  }
1600
1636
  }
1601
- catch (error) {
1602
- console.error(chalk.yellow(`⚠️ Failed to select repositories: ${error instanceof Error ? error.message : String(error)}`));
1603
- console.log(chalk.gray('Continuing with single repository import...\n'));
1604
- }
1605
1637
  }
1638
+ catch {
1639
+ // Silent - skip multi-repo prompt
1640
+ }
1641
+ }
1642
+ else if (repoSelectionConfig) {
1643
+ // User already configured multi-repo in hosting section - reuse it!
1644
+ console.log(chalk.gray(`✓ Using multi-repository configuration from hosting setup\n`));
1606
1645
  }
1607
1646
  // Map config timeRangeMonths to closest prompt option
1608
1647
  let defaultTimeRange = 3; // Default to 3 months