specweave 0.30.11 → 0.30.13

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 (134) hide show
  1. package/dist/src/cli/commands/init.d.ts.map +1 -1
  2. package/dist/src/cli/commands/init.js +25 -2
  3. package/dist/src/cli/commands/init.js.map +1 -1
  4. package/dist/src/cli/helpers/ado-area-selector.d.ts.map +1 -1
  5. package/dist/src/cli/helpers/ado-area-selector.js +13 -0
  6. package/dist/src/cli/helpers/ado-area-selector.js.map +1 -1
  7. package/dist/src/cli/helpers/init/living-docs-preflight.d.ts +5 -1
  8. package/dist/src/cli/helpers/init/living-docs-preflight.d.ts.map +1 -1
  9. package/dist/src/cli/helpers/init/living-docs-preflight.js +80 -28
  10. package/dist/src/cli/helpers/init/living-docs-preflight.js.map +1 -1
  11. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  12. package/dist/src/cli/helpers/issue-tracker/index.js +7 -2
  13. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  14. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts +7 -0
  15. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts.map +1 -1
  16. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js +33 -2
  17. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js.map +1 -1
  18. package/dist/src/cli/workers/brownfield-worker.d.ts +13 -0
  19. package/dist/src/cli/workers/brownfield-worker.d.ts.map +1 -1
  20. package/dist/src/cli/workers/brownfield-worker.js +154 -0
  21. package/dist/src/cli/workers/brownfield-worker.js.map +1 -1
  22. package/dist/src/cli/workers/clone-worker.js +19 -3
  23. package/dist/src/cli/workers/clone-worker.js.map +1 -1
  24. package/dist/src/cli/workers/living-docs-worker.js +272 -11
  25. package/dist/src/cli/workers/living-docs-worker.js.map +1 -1
  26. package/dist/src/core/background/brownfield-launcher.d.ts +2 -1
  27. package/dist/src/core/background/brownfield-launcher.d.ts.map +1 -1
  28. package/dist/src/core/background/brownfield-launcher.js.map +1 -1
  29. package/dist/src/core/background/types.d.ts +10 -2
  30. package/dist/src/core/background/types.d.ts.map +1 -1
  31. package/dist/src/core/discrepancy/brownfield-types.d.ts +3 -1
  32. package/dist/src/core/discrepancy/brownfield-types.d.ts.map +1 -1
  33. package/dist/src/core/living-docs/board-matcher.d.ts +120 -0
  34. package/dist/src/core/living-docs/board-matcher.d.ts.map +1 -0
  35. package/dist/src/core/living-docs/board-matcher.js +466 -0
  36. package/dist/src/core/living-docs/board-matcher.js.map +1 -0
  37. package/dist/src/core/living-docs/feature-archiver.d.ts +39 -0
  38. package/dist/src/core/living-docs/feature-archiver.d.ts.map +1 -1
  39. package/dist/src/core/living-docs/feature-archiver.js +197 -0
  40. package/dist/src/core/living-docs/feature-archiver.js.map +1 -1
  41. package/dist/src/core/living-docs/foundation-builder.js +1 -1
  42. package/dist/src/core/living-docs/foundation-builder.js.map +1 -1
  43. package/dist/src/core/living-docs/living-docs-sync.d.ts +19 -8
  44. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  45. package/dist/src/core/living-docs/living-docs-sync.js +148 -52
  46. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  47. package/dist/src/core/living-docs/suggestions-generator.js +1 -1
  48. package/dist/src/core/living-docs/suggestions-generator.js.map +1 -1
  49. package/dist/src/core/living-docs/umbrella-detector.d.ts +4 -0
  50. package/dist/src/core/living-docs/umbrella-detector.d.ts.map +1 -1
  51. package/dist/src/core/living-docs/umbrella-detector.js +20 -1
  52. package/dist/src/core/living-docs/umbrella-detector.js.map +1 -1
  53. package/dist/src/core/living-docs/workitem-matcher.js +5 -5
  54. package/dist/src/core/living-docs/workitem-matcher.js.map +1 -1
  55. package/dist/src/core/llm/availability-messages.d.ts +33 -0
  56. package/dist/src/core/llm/availability-messages.d.ts.map +1 -0
  57. package/dist/src/core/llm/availability-messages.js +170 -0
  58. package/dist/src/core/llm/availability-messages.js.map +1 -0
  59. package/dist/src/core/llm/index.d.ts +34 -0
  60. package/dist/src/core/llm/index.d.ts.map +1 -0
  61. package/dist/src/core/llm/index.js +35 -0
  62. package/dist/src/core/llm/index.js.map +1 -0
  63. package/dist/src/core/llm/provider-factory.d.ts +48 -0
  64. package/dist/src/core/llm/provider-factory.d.ts.map +1 -0
  65. package/dist/src/core/llm/provider-factory.js +274 -0
  66. package/dist/src/core/llm/provider-factory.js.map +1 -0
  67. package/dist/src/core/llm/providers/anthropic-provider.d.ts +66 -0
  68. package/dist/src/core/llm/providers/anthropic-provider.d.ts.map +1 -0
  69. package/dist/src/core/llm/providers/anthropic-provider.js +195 -0
  70. package/dist/src/core/llm/providers/anthropic-provider.js.map +1 -0
  71. package/dist/src/core/llm/providers/azure-openai-provider.d.ts +47 -0
  72. package/dist/src/core/llm/providers/azure-openai-provider.d.ts.map +1 -0
  73. package/dist/src/core/llm/providers/azure-openai-provider.js +116 -0
  74. package/dist/src/core/llm/providers/azure-openai-provider.js.map +1 -0
  75. package/dist/src/core/llm/providers/bedrock-provider.d.ts +44 -0
  76. package/dist/src/core/llm/providers/bedrock-provider.d.ts.map +1 -0
  77. package/dist/src/core/llm/providers/bedrock-provider.js +149 -0
  78. package/dist/src/core/llm/providers/bedrock-provider.js.map +1 -0
  79. package/dist/src/core/llm/providers/claude-code-provider.d.ts +115 -0
  80. package/dist/src/core/llm/providers/claude-code-provider.d.ts.map +1 -0
  81. package/dist/src/core/llm/providers/claude-code-provider.js +379 -0
  82. package/dist/src/core/llm/providers/claude-code-provider.js.map +1 -0
  83. package/dist/src/core/llm/providers/ollama-provider.d.ts +40 -0
  84. package/dist/src/core/llm/providers/ollama-provider.d.ts.map +1 -0
  85. package/dist/src/core/llm/providers/ollama-provider.js +116 -0
  86. package/dist/src/core/llm/providers/ollama-provider.js.map +1 -0
  87. package/dist/src/core/llm/providers/openai-provider.d.ts +44 -0
  88. package/dist/src/core/llm/providers/openai-provider.d.ts.map +1 -0
  89. package/dist/src/core/llm/providers/openai-provider.js +119 -0
  90. package/dist/src/core/llm/providers/openai-provider.js.map +1 -0
  91. package/dist/src/core/llm/providers/vertex-ai-provider.d.ts +46 -0
  92. package/dist/src/core/llm/providers/vertex-ai-provider.d.ts.map +1 -0
  93. package/dist/src/core/llm/providers/vertex-ai-provider.js +123 -0
  94. package/dist/src/core/llm/providers/vertex-ai-provider.js.map +1 -0
  95. package/dist/src/core/llm/types.d.ts +181 -0
  96. package/dist/src/core/llm/types.d.ts.map +1 -0
  97. package/dist/src/core/llm/types.js +56 -0
  98. package/dist/src/core/llm/types.js.map +1 -0
  99. package/dist/src/importers/item-converter.d.ts +4 -0
  100. package/dist/src/importers/item-converter.d.ts.map +1 -1
  101. package/dist/src/importers/item-converter.js +73 -12
  102. package/dist/src/importers/item-converter.js.map +1 -1
  103. package/dist/src/init/repo/types.d.ts +1 -1
  104. package/dist/src/living-docs/enterprise-analyzer.d.ts +160 -0
  105. package/dist/src/living-docs/enterprise-analyzer.d.ts.map +1 -0
  106. package/dist/src/living-docs/enterprise-analyzer.js +887 -0
  107. package/dist/src/living-docs/enterprise-analyzer.js.map +1 -0
  108. package/dist/src/living-docs/epic-id-allocator.d.ts +4 -0
  109. package/dist/src/living-docs/epic-id-allocator.d.ts.map +1 -1
  110. package/dist/src/living-docs/epic-id-allocator.js +4 -0
  111. package/dist/src/living-docs/epic-id-allocator.js.map +1 -1
  112. package/dist/src/living-docs/fs-id-allocator.d.ts +9 -0
  113. package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -1
  114. package/dist/src/living-docs/fs-id-allocator.js +16 -5
  115. package/dist/src/living-docs/fs-id-allocator.js.map +1 -1
  116. package/dist/src/living-docs/smart-doc-organizer.d.ts +114 -0
  117. package/dist/src/living-docs/smart-doc-organizer.d.ts.map +1 -0
  118. package/dist/src/living-docs/smart-doc-organizer.js +535 -0
  119. package/dist/src/living-docs/smart-doc-organizer.js.map +1 -0
  120. package/package.json +1 -1
  121. package/plugins/specweave/commands/specweave-archive.md +69 -2
  122. package/plugins/specweave/commands/specweave-judge.md +265 -0
  123. package/plugins/specweave/commands/specweave-organize-docs.md +185 -0
  124. package/plugins/specweave/hooks/hooks.json +3 -3
  125. package/plugins/specweave/hooks/universal/hook-wrapper.cmd +26 -0
  126. package/plugins/specweave/hooks/universal/hook-wrapper.sh +67 -0
  127. package/plugins/specweave-docs/commands/build.md +158 -0
  128. package/plugins/specweave-docs/commands/{docs-generate.md → generate.md} +7 -2
  129. package/plugins/specweave-docs/commands/health.md +268 -0
  130. package/plugins/specweave-docs/commands/{docs-init.md → init.md} +7 -2
  131. package/plugins/specweave-docs/commands/organize.md +184 -0
  132. package/plugins/specweave-docs/commands/preview.md +138 -0
  133. package/plugins/specweave-docs/skills/preview/SKILL.md +105 -0
  134. package/plugins/specweave-release/commands/specweave-release-npm.md +22 -235
@@ -0,0 +1,138 @@
1
+ ---
2
+ name: specweave-docs:preview
3
+ description: Launch Docusaurus documentation server. Supports both public (port 3016) and internal (port 8001) documentation sites.
4
+ ---
5
+
6
+ # Documentation Preview Command
7
+
8
+ Launch Docusaurus development server with hot reload, Mermaid diagrams, and auto-generated sidebar.
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ # Preview INTERNAL docs (SpecWeave living documentation) - DEFAULT
14
+ /specweave-docs:preview
15
+
16
+ # Preview PUBLIC docs (end-user documentation)
17
+ /specweave-docs:preview --public
18
+ ```
19
+
20
+ ## Two Documentation Sites
21
+
22
+ | Site | Port | Content | NPM Script |
23
+ |------|------|---------|------------|
24
+ | **Internal** | 8001 | `.specweave/docs/internal/` | `docs:internal` |
25
+ | **Public** | 3016 | `docs-site/docs/` | `docs:dev` |
26
+
27
+ ## Your Task
28
+
29
+ Execute the appropriate npm script based on user flags:
30
+
31
+ ```bash
32
+ # Check if user wants public docs
33
+ PUBLIC_FLAG="${1:-}"
34
+
35
+ cd /path/to/project
36
+
37
+ if [ "$PUBLIC_FLAG" = "--public" ]; then
38
+ echo "Launching PUBLIC documentation on port 3016..."
39
+ echo "Content: docs-site/docs/"
40
+ echo ""
41
+ npm run docs:dev
42
+ else
43
+ echo "Launching INTERNAL documentation on port 8001..."
44
+ echo "Content: .specweave/docs/internal/"
45
+ echo ""
46
+ npm run docs:internal
47
+ fi
48
+ ```
49
+
50
+ ### Alternative: Run directly with npx
51
+
52
+ If in a fresh project without the docs-site setup:
53
+
54
+ ```bash
55
+ # For internal docs
56
+ cd docs-site && npm run start:internal
57
+
58
+ # For public docs
59
+ cd docs-site && npm run start
60
+ ```
61
+
62
+ ## What You Get
63
+
64
+ - **Hot reload** - Edit markdown, see changes instantly
65
+ - **Auto sidebar** - Generated from folder structure
66
+ - **Mermaid diagrams** - Architecture diagrams render beautifully
67
+ - **Dark/light mode** - Toggle in navbar
68
+ - **Local search** - Instant search across all docs
69
+ - **Mobile responsive** - Works on any device
70
+
71
+ ## First-Time Setup
72
+
73
+ If `docs-site/node_modules` doesn't exist:
74
+
75
+ ```bash
76
+ npm run docs:install
77
+ ```
78
+
79
+ This installs Docusaurus dependencies (~200MB, ~30 seconds).
80
+
81
+ ## Ports
82
+
83
+ | Script | Port | URL |
84
+ |--------|------|-----|
85
+ | `docs:dev` | 3016 | http://localhost:3016 |
86
+ | `docs:internal` | 8001 | http://localhost:8001 |
87
+
88
+ ## Internal Docs Structure
89
+
90
+ ```
91
+ .specweave/docs/internal/
92
+ ├── strategy/ → Product strategy
93
+ ├── specs/ → Feature specifications (708 files!)
94
+ │ └── specweave/
95
+ │ ├── FS-001/ → Feature folders
96
+ │ ├── FS-002/
97
+ │ └── ...
98
+ ├── architecture/ → ADRs, HLDs, diagrams
99
+ ├── delivery/ → Release plans, guides
100
+ ├── operations/ → Runbooks, NFRs
101
+ └── governance/ → Standards, conventions
102
+ ```
103
+
104
+ ## Configuration Files
105
+
106
+ | File | Purpose |
107
+ |------|---------|
108
+ | `docusaurus.config.ts` | Public docs config |
109
+ | `docusaurus.config.internal.ts` | Internal docs config |
110
+ | `sidebars.ts` | Public docs sidebar |
111
+ | `sidebars.internal.ts` | Internal docs sidebar |
112
+
113
+ ## Troubleshooting
114
+
115
+ ### Port already in use
116
+ ```bash
117
+ # Find process using port
118
+ lsof -i :8001
119
+
120
+ # Kill it
121
+ kill -9 <PID>
122
+ ```
123
+
124
+ ### Missing dependencies
125
+ ```bash
126
+ npm run docs:install
127
+ ```
128
+
129
+ ### Build errors
130
+ ```bash
131
+ cd docs-site && npm run clear && npm run start:internal
132
+ ```
133
+
134
+ ## See Also
135
+
136
+ - `/specweave-docs:build` - Build static site for deployment
137
+ - `/specweave-docs:organize` - Generate themed indexes for large folders
138
+ - `/specweave-docs:health` - Documentation health report
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: preview
3
+ description: Documentation preview expert for Docusaurus integration. Launches interactive preview server for SpecWeave living documentation with hot reload, auto-generated sidebar, and Mermaid diagrams. Activates for preview docs, view documentation, Docusaurus server, docs UI, documentation website, local docs server, hot reload docs, static site build.
4
+ ---
5
+
6
+ # Documentation Preview Skill
7
+
8
+ Expert in launching and managing Docusaurus documentation preview for SpecWeave projects.
9
+
10
+ ## What I Do
11
+
12
+ I help you preview and build your SpecWeave living documentation with Docusaurus:
13
+
14
+ ### 1. Interactive Preview
15
+ - Launch local development server (default port: 3016)
16
+ - Auto-generate sidebar from folder structure
17
+ - Hot reload - edit markdown, see changes instantly
18
+ - Mermaid diagram rendering
19
+ - Mobile-responsive UI
20
+ - Search functionality
21
+
22
+ ### 2. Static Site Building
23
+ - Build production-ready static site
24
+ - Output to `.specweave/docs-site-internal/build/`
25
+ - Ready for deployment to any static host
26
+ - Optimized for performance
27
+
28
+ ### 3. Smart Setup
29
+ - Lazy installation (only installs when first used)
30
+ - Checks Node.js version (18+ required)
31
+ - Installs Docusaurus dependencies automatically
32
+ - Configures from `.specweave/config.json` settings
33
+
34
+ ## Available Commands
35
+
36
+ ### Preview Documentation
37
+ ```bash
38
+ /specweave-docs:preview
39
+ ```
40
+
41
+ **What it does:**
42
+ 1. Checks if Docusaurus is installed (installs if needed)
43
+ 2. Generates sidebar from `.specweave/docs/internal/` structure
44
+ 3. Starts development server on port 3016 (configurable)
45
+ 4. Opens browser automatically
46
+ 5. Enables hot reload
47
+
48
+ ### Build Static Site
49
+ ```bash
50
+ /specweave-docs:build
51
+ ```
52
+
53
+ **What it does:**
54
+ 1. Checks if Docusaurus is installed
55
+ 2. Runs production build
56
+ 3. Outputs to `.specweave/docs-site-internal/build/`
57
+ 4. Shows build stats and output path
58
+
59
+ ## When to Use This Skill
60
+
61
+ ### Activate for questions like:
62
+ - "How do I preview my documentation?"
63
+ - "Show me my docs in a UI"
64
+ - "Launch Docusaurus server"
65
+ - "View my living documentation"
66
+ - "Start docs preview"
67
+ - "Build static docs site"
68
+
69
+ ### Common workflows:
70
+
71
+ **1. First-time preview:**
72
+ ```
73
+ User: "I want to preview my docs"
74
+ You: "I'll set up the documentation preview with Docusaurus."
75
+ [Run: /specweave-docs:preview]
76
+ ```
77
+
78
+ **2. Build for deployment:**
79
+ ```
80
+ User: "I need to deploy my docs"
81
+ You: "I'll build the static site for deployment."
82
+ [Run: /specweave-docs:build]
83
+ ```
84
+
85
+ ## Configuration
86
+
87
+ ```json
88
+ {
89
+ "documentation": {
90
+ "preview": {
91
+ "enabled": true,
92
+ "autoInstall": true,
93
+ "port": 3016,
94
+ "openBrowser": true,
95
+ "theme": "default"
96
+ }
97
+ }
98
+ }
99
+ ```
100
+
101
+ ## See Also
102
+
103
+ - `/specweave-docs:organize` - Organize large folders with themed indexes
104
+ - `/specweave-docs:health` - Documentation health report
105
+ - `/specweave-docs:generate` - Generate docs from code
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: specweave-release:npm
3
- description: Bump patch version, create git tag, and trigger npm publish via GitHub Actions. Use --quick for instant release (auto-commits, PUSHES FIRST, then publishes to npmjs.org). Use --only for local publish without git push. Use --only --local for version bump only.
3
+ description: Bump patch version, auto-commit dirty changes, push to GitHub, build, publish to npmjs.org. Use --ci for GitHub Actions publish. Use --only for local publish without git push. Use --only --local for version bump only.
4
4
  ---
5
5
 
6
6
  # /specweave-release:npm - NPM Release Automation
@@ -11,10 +11,9 @@ You are the NPM Release Assistant. Your job is to automate the patch version rel
11
11
 
12
12
  | Command | Flow | Use Case |
13
13
  |---------|------|----------|
14
- | `/specweave-release:npm` | Bump → Push → **CI publishes** | Standard release (CI handles npm) |
15
- | `/specweave-release:npm --quick` | Auto-commit → **PUSH** → Bump → Build → **Publish** Push tag | **INSTANT RELEASE** (recommended!) |
14
+ | `/specweave-release:npm` | Auto-commit → **PUSH** → Bump → Build → **Publish** Push tag | **DEFAULT: INSTANT RELEASE** |
15
+ | `/specweave-release:npm --ci` | Bump → Push → **CI publishes** | Let GitHub Actions handle npm publish |
16
16
  | `/specweave-release:npm --only` | Bump → Build → **Publish locally** → NO push | Quick local release, push later |
17
- | `/specweave-release:npm --only --push` | Auto-commit → **PUSH** → Bump → Build → **Publish** → Push tag | Same as --quick |
18
17
  | `/specweave-release:npm --only --local` | **Bump ONLY** → NO build, NO publish, NO git | FASTEST: Local testing only |
19
18
 
20
19
  ## Detecting Mode
@@ -22,32 +21,29 @@ You are the NPM Release Assistant. Your job is to automate the patch version rel
22
21
  Check flags in the command invocation:
23
22
 
24
23
  ```
25
- --quick INSTANT RELEASE: auto-commit, PUSH FIRST, then bump+build+publish+push tag
24
+ --ci CI MODE: push to git, GitHub Actions publishes (requires clean working tree)
26
25
  --only --local → Version bump ONLY (no build, no publish, no git) - FASTEST
27
- --only --push → Same as --quick (legacy alias)
28
26
  --only → Direct publish to npm (bypass CI), no git push
29
- (no flags) → Default: push to git, CI publishes
27
+ (no flags) → DEFAULT: INSTANT RELEASE (auto-commit, push, build, publish, push tag)
30
28
  ```
31
29
 
32
30
  **Flag Detection Order:**
33
- 1. Check for `--quick` flag → QUICK MODE (instant release!)
31
+ 1. Check for `--ci` flag → CI MODE (GitHub Actions publishes)
34
32
  2. Check for `--only` flag
35
33
  3. If `--only` present, check for `--local` flag → LOCAL MODE (fastest)
36
- 4. If `--only` present, check for `--push` flag → DIRECT MODE + PUSH (same as --quick)
37
- 5. If `--only` only DIRECT MODE
38
- 6. No flags → DEFAULT MODE
34
+ 4. If `--only` only → DIRECT MODE
35
+ 5. No flags**DEFAULT: INSTANT RELEASE** (auto-commit dirty, push, build, publish)
39
36
 
40
- **If `--quick`**: Use QUICK MODE (section "Quick Mode Workflow") - INSTANT RELEASE!
37
+ **If `--ci`**: Use CI MODE (section "CI Mode Workflow")
41
38
  **If `--only --local`**: Use LOCAL MODE (section "Local Mode Workflow") - FASTEST!
42
- **If `--only --push`**: Use DIRECT MODE WITH PUSH (section "Direct Mode + Push Workflow")
43
39
  **If `--only` only**: Use DIRECT MODE (section "Direct Mode Workflow")
44
- **If no flags**: Use DEFAULT MODE (continue with steps below)
40
+ **If no flags**: Use DEFAULT MODE = INSTANT RELEASE (section "Default Mode Workflow")
45
41
 
46
42
  ---
47
43
 
48
- ## QUICK MODE WORKFLOW (--quick flag) - RECOMMENDED!
44
+ ## DEFAULT MODE WORKFLOW (no flags) - INSTANT RELEASE
49
45
 
50
- Use this workflow when `--quick` flag is detected. This is the **instant release** mode - auto-commits any dirty changes, syncs git FIRST, then publishes to npmjs.org. One command does everything!
46
+ This is the **default** workflow when no flags are provided. Auto-commits any dirty changes, syncs git FIRST, then publishes to npmjs.org. One command does everything!
51
47
 
52
48
  **Use case**: You made changes and want to release immediately. No manual steps needed.
53
49
 
@@ -152,7 +148,7 @@ git push origin develop --follow-tags
152
148
  **Verify**: `npm view specweave version --registry https://registry.npmjs.org`
153
149
  ```
154
150
 
155
- ## Quick Mode Success Criteria
151
+ ## Default Mode Success Criteria
156
152
 
157
153
  ✅ Any dirty changes auto-committed
158
154
  ✅ **Dirty commit pushed to remote FIRST**
@@ -164,9 +160,9 @@ git push origin develop --follow-tags
164
160
 
165
161
  ---
166
162
 
167
- ## DEFAULT MODE - Your Task
163
+ ## CI MODE WORKFLOW (--ci flag)
168
164
 
169
- Execute the following steps in order:
165
+ Use this workflow when `--ci` flag is detected. Push to git and let GitHub Actions handle npm publish.
170
166
 
171
167
  ### 1. Pre-flight Checks
172
168
 
@@ -179,20 +175,12 @@ git status --porcelain
179
175
 
180
176
  # Verify current version
181
177
  node -p "require('./package.json').version"
182
-
183
- # Calculate next version and check CHANGELOG
184
- CURRENT=$(node -p "require('./package.json').version")
185
- NEXT=$(node -p "const v='$CURRENT'.split('.'); v[2]=+v[2]+1; v.join('.')")
186
- grep -q "## \[$NEXT\]" CHANGELOG.md && echo "CHANGELOG OK" || echo "CHANGELOG MISSING for $NEXT"
187
178
  ```
188
179
 
189
180
  **STOP if**:
190
181
  - Not on `develop` branch (ask user to switch)
191
182
  - Uncommitted changes exist (ask user to commit first)
192
183
 
193
- **WARN if**:
194
- - CHANGELOG entry missing for next version (suggest adding before release, but CI will auto-generate if forgotten)
195
-
196
184
  ### 2. Bump Patch Version
197
185
 
198
186
  ```bash
@@ -200,11 +188,6 @@ grep -q "## \[$NEXT\]" CHANGELOG.md && echo "CHANGELOG OK" || echo "CHANGELOG MI
200
188
  npm version patch -m "chore: bump version to %s"
201
189
  ```
202
190
 
203
- **What this does**:
204
- - Updates `package.json` and `package-lock.json`
205
- - Creates git commit with message "chore: bump version to X.Y.Z"
206
- - Creates git tag `vX.Y.Z`
207
-
208
191
  ### 3. Extract New Version
209
192
 
210
193
  ```bash
@@ -219,15 +202,8 @@ node -p "require('./package.json').version"
219
202
  git push origin develop --follow-tags
220
203
  ```
221
204
 
222
- **What happens next**:
223
- - GitHub Actions workflow detects the tag
224
- - Runs tests
225
- - Publishes to npm
226
- - Creates GitHub release
227
-
228
205
  ### 5. Report Results
229
206
 
230
- Show the user:
231
207
  ```markdown
232
208
  ✅ Release initiated successfully!
233
209
 
@@ -239,34 +215,9 @@ Show the user:
239
215
  1. Monitor GitHub Actions workflow (1-2 minutes)
240
216
  2. Verify npm publish: https://www.npmjs.com/package/specweave
241
217
  3. Check GitHub release notes
242
-
243
- **Note**: GitHub Actions will automatically:
244
- - Build and test the package
245
- - Publish to npm
246
- - Create GitHub release with CHANGELOG notes
247
218
  ```
248
219
 
249
- ## Error Handling
250
-
251
- **If `npm version` fails**:
252
- - Check if version already exists
253
- - Verify package.json is valid
254
- - Ask user to manually fix and retry
255
-
256
- **If `git push` fails**:
257
- - Check network connection
258
- - Verify git credentials
259
- - Check branch protection rules
260
-
261
- ## Safety Rules
262
-
263
- - ✅ ONLY bump patch version (never minor/major without confirmation)
264
- - ✅ ALWAYS check for uncommitted changes first
265
- - ✅ ALWAYS verify on develop branch
266
- - ✅ NEVER force push
267
- - ✅ NEVER skip pre-flight checks
268
-
269
- ## Success Criteria (Default Mode)
220
+ ## CI Mode Success Criteria
270
221
 
271
222
  ✅ Version bumped in package.json
272
223
  ✅ Git commit created
@@ -383,191 +334,27 @@ Show the user:
383
334
 
384
335
  ---
385
336
 
386
- ## DIRECT MODE + PUSH WORKFLOW (--only --push flags)
387
-
388
- Use this workflow when BOTH `--only` AND `--push` flags are detected. This is the **complete local release** - publishes to npm directly AND pushes to git.
389
-
390
- **Use case**: You want full control - publish immediately, then sync git. No CI involvement in npm publish.
391
-
392
- ### 1. Pre-flight Checks
393
-
394
- ```bash
395
- # Verify we're on develop branch
396
- git rev-parse --abbrev-ref HEAD
397
-
398
- # Check for uncommitted changes
399
- git status --porcelain
400
-
401
- # Verify current version
402
- node -p "require('./package.json').version"
403
- ```
404
-
405
- **STOP if**:
406
- - Not on `develop` branch (ask user to switch)
407
-
408
- **If uncommitted changes exist → AUTO-COMMIT FIRST (Step 1b)**
409
-
410
- ### 1b. Auto-Commit Uncommitted Changes (if any)
411
-
412
- When `--only --push` is used, uncommitted changes should be committed automatically before version bump.
413
-
414
- **Algorithm to generate commit message:**
415
-
416
- 1. Run `git status --porcelain` and categorize files:
417
- - `src/**` → code changes
418
- - `*.md`, `docs/` → documentation
419
- - `.specweave/docs/internal/**` → internal docs
420
- - `plugins/**` → plugin changes
421
- - `tests/**`, `*.test.ts` → test changes
422
- - `package*.json`, `*.config.*` → config/deps
423
-
424
- 2. Determine primary category (most files) and action (add/update/remove):
425
- - New files (`??`, `A`) → "add"
426
- - Modified (`M`) → "update"
427
- - Deleted (`D`) → "remove"
428
-
429
- 3. Generate concise message: `type: action description`
430
-
431
- **Examples:**
432
- - Many ADR renames + docs moves → `chore: reorganize internal docs structure`
433
- - Plugin command updates → `feat(release): add --push flag to npm release`
434
- - Mixed code + docs → `chore: update code and documentation`
435
-
436
- **Execute auto-commit:**
437
- ```bash
438
- git add -A
439
- git commit -m "[generated message]"
440
- ```
441
-
442
- ### 1c. PUSH DIRTY COMMIT TO REMOTE FIRST! (CRITICAL!)
443
-
444
- **BEFORE any release operations, sync git:**
445
-
446
- ```bash
447
- # Push dirty commit to remote FIRST - ensures code is safe before release
448
- git push origin develop
449
- ```
450
-
451
- **Why this order?**
452
- - ✅ Your changes are safely on GitHub BEFORE release starts
453
- - ✅ If npm publish fails later, git is already synced
454
- - ✅ No risk of "released but not pushed" state
455
-
456
- Then continue with version bump.
457
-
458
- ### 2. Bump Patch Version
459
-
460
- ```bash
461
- # This creates commit + tag automatically
462
- npm version patch -m "chore: bump version to %s"
463
- ```
464
-
465
- ### 3. Extract New Version
466
-
467
- ```bash
468
- # Get the new version
469
- node -p "require('./package.json').version"
470
- ```
471
-
472
- ### 4. Build Package
473
-
474
- ```bash
475
- # Build the package before publishing
476
- npm run rebuild
477
- ```
478
-
479
- **Critical**: Must rebuild to ensure dist/ is up-to-date before publishing.
480
-
481
- ### 5. Publish to NPM Directly
482
-
483
- ```bash
484
- # Publish directly to npmjs.org (bypasses GitHub Actions)
485
- # CRITICAL: Always specify registry to avoid ~/.npmrc redirecting to private feeds!
486
- npm publish --registry https://registry.npmjs.org
487
- ```
488
-
489
- ### 6. Push to Git (NEW!)
490
-
491
- ```bash
492
- # Push commit and tag to sync with remote
493
- git push origin develop --follow-tags
494
- ```
495
-
496
- **What this does**:
497
- - Syncs your version bump commit to GitHub
498
- - Pushes the version tag (vX.Y.Z)
499
- - Does NOT trigger CI npm publish (already published!)
500
-
501
- ### 7. Report Results (Direct Mode + Push)
502
-
503
- Show the user:
504
- ```markdown
505
- ✅ **Complete local release!**
506
-
507
- 📦 **Version**: vX.Y.Z
508
- 🔗 **NPM**: https://www.npmjs.com/package/specweave
509
- 🏷️ **Git Tag**: https://github.com/anton-abyzov/specweave/releases/tag/vX.Y.Z
510
-
511
- **What happened**:
512
- - ✅ Version bumped and committed
513
- - ✅ Git tag created
514
- - ✅ Package built (npm run rebuild)
515
- - ✅ Published to npm directly
516
- - ✅ Pushed to GitHub (commit + tag)
517
-
518
- **Verify**:
519
- - NPM: https://www.npmjs.com/package/specweave
520
- - Version: `npm view specweave version`
521
- - GitHub: Check releases page
522
-
523
- **Note**: This was a direct publish. GitHub Actions will NOT republish
524
- (the tag already exists, CI skips existing versions).
525
- ```
526
-
527
- ## Direct Mode + Push Safety Rules
528
-
529
- - ✅ ALWAYS rebuild before publishing
530
- - ✅ Publishes FIRST, then pushes (ensures npm has the version)
531
- - ✅ If push fails, npm already has the release (safe state)
532
- - ✅ CI will skip publishing for this version (tag already exists)
533
- - ⚠️ Use when you need immediate npm availability + git sync
534
-
535
- ## Success Criteria (Direct Mode + Push)
536
-
537
- ✅ Version bumped in package.json
538
- ✅ Git commit created
539
- ✅ Git tag created
540
- ✅ Package rebuilt
541
- ✅ Published to npm directly
542
- ✅ Pushed to GitHub (commit + tag synced)
543
-
544
- ---
545
-
546
337
  ## Quick Reference
547
338
 
548
339
  ```bash
549
- # RECOMMENDED: Instant release (auto-commits dirty, publishes, pushes)
550
- /specweave-release:npm --quick
551
-
552
- # Standard release (CI handles npm publish)
340
+ # DEFAULT: Instant release (auto-commits dirty, publishes, pushes)
553
341
  /specweave-release:npm
554
342
 
343
+ # CI release (GitHub Actions handles npm publish) - requires clean tree
344
+ /specweave-release:npm --ci
345
+
555
346
  # Quick local publish, sync git later
556
347
  /specweave-release:npm --only
557
348
 
558
- # Complete local release (publish + push) - same as --quick
559
- /specweave-release:npm --only --push
560
-
561
349
  # FASTEST: Version bump only (no publish, no git, no build)
562
350
  /specweave-release:npm --only --local
563
351
  ```
564
352
 
565
353
  | Scenario | Command | Auto-Commit Dirty? | NPM Published By | Git Pushed |
566
354
  |----------|---------|-------------------|------------------|------------|
567
- | **INSTANT RELEASE** | `--quick` | ✅ Yes | You (npmjs.org) | ✅ Yes |
568
- | Normal release | (no flags) | ❌ STOP | GitHub Actions | ✅ Yes |
355
+ | **INSTANT RELEASE** | (no flags) | ✅ Yes | You (npmjs.org) | ✅ Yes |
356
+ | CI release | `--ci` | ❌ STOP | GitHub Actions | ✅ Yes |
569
357
  | Quick local, push later | `--only` | ❌ STOP | You (npmjs.org) | ❌ No |
570
- | Complete local release | `--only --push` | ✅ Yes | You (npmjs.org) | ✅ Yes |
571
358
  | **FASTEST local test** | `--only --local` | N/A | ❌ None | ❌ No |
572
359
 
573
360
  ---