specweave 0.33.3 → 0.33.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CLAUDE.md +85 -19
  2. package/dist/src/cli/cleanup-zombies.js +8 -5
  3. package/dist/src/cli/cleanup-zombies.js.map +1 -1
  4. package/dist/src/cli/commands/jobs.js +19 -2
  5. package/dist/src/cli/commands/jobs.js.map +1 -1
  6. package/dist/src/cli/commands/living-docs.js +1 -1
  7. package/dist/src/cli/commands/living-docs.js.map +1 -1
  8. package/dist/src/cli/helpers/init/external-import-grouping.d.ts.map +1 -1
  9. package/dist/src/cli/helpers/init/external-import-grouping.js +11 -7
  10. package/dist/src/cli/helpers/init/external-import-grouping.js.map +1 -1
  11. package/dist/src/cli/workers/clone-worker.js +22 -5
  12. package/dist/src/cli/workers/clone-worker.js.map +1 -1
  13. package/dist/src/config/types.d.ts +203 -1208
  14. package/dist/src/config/types.d.ts.map +1 -1
  15. package/dist/src/core/background/job-dependency.d.ts.map +1 -1
  16. package/dist/src/core/background/job-dependency.js +1 -0
  17. package/dist/src/core/background/job-dependency.js.map +1 -1
  18. package/dist/src/core/background/job-launcher.js +2 -2
  19. package/dist/src/core/background/job-launcher.js.map +1 -1
  20. package/dist/src/core/background/job-manager.d.ts +8 -0
  21. package/dist/src/core/background/job-manager.d.ts.map +1 -1
  22. package/dist/src/core/background/job-manager.js +19 -1
  23. package/dist/src/core/background/job-manager.js.map +1 -1
  24. package/dist/src/core/background/types.d.ts +9 -1
  25. package/dist/src/core/background/types.d.ts.map +1 -1
  26. package/dist/src/core/background/types.js +8 -1
  27. package/dist/src/core/background/types.js.map +1 -1
  28. package/dist/src/importers/external-importer.d.ts +26 -5
  29. package/dist/src/importers/external-importer.d.ts.map +1 -1
  30. package/dist/src/importers/item-converter.d.ts.map +1 -1
  31. package/dist/src/importers/item-converter.js +18 -1
  32. package/dist/src/importers/item-converter.js.map +1 -1
  33. package/dist/src/importers/jira-importer.d.ts +10 -0
  34. package/dist/src/importers/jira-importer.d.ts.map +1 -1
  35. package/dist/src/importers/jira-importer.js +70 -6
  36. package/dist/src/importers/jira-importer.js.map +1 -1
  37. package/dist/src/init/architecture/types.d.ts +33 -140
  38. package/dist/src/init/architecture/types.d.ts.map +1 -1
  39. package/dist/src/init/compliance/types.d.ts +30 -27
  40. package/dist/src/init/compliance/types.d.ts.map +1 -1
  41. package/dist/src/init/repo/types.d.ts +11 -34
  42. package/dist/src/init/repo/types.d.ts.map +1 -1
  43. package/dist/src/init/research/src/config/types.d.ts +15 -82
  44. package/dist/src/init/research/src/config/types.d.ts.map +1 -1
  45. package/dist/src/init/research/types.d.ts +38 -93
  46. package/dist/src/init/research/types.d.ts.map +1 -1
  47. package/dist/src/init/team/types.d.ts +4 -42
  48. package/dist/src/init/team/types.d.ts.map +1 -1
  49. package/dist/src/living-docs/smart-doc-organizer.js +1 -1
  50. package/dist/src/living-docs/smart-doc-organizer.js.map +1 -1
  51. package/dist/src/sync/closure-metrics.d.ts +102 -0
  52. package/dist/src/sync/closure-metrics.d.ts.map +1 -0
  53. package/dist/src/sync/closure-metrics.js +267 -0
  54. package/dist/src/sync/closure-metrics.js.map +1 -0
  55. package/dist/src/sync/sync-coordinator.d.ts +29 -0
  56. package/dist/src/sync/sync-coordinator.d.ts.map +1 -1
  57. package/dist/src/sync/sync-coordinator.js +153 -16
  58. package/dist/src/sync/sync-coordinator.js.map +1 -1
  59. package/dist/src/utils/docs-preview/config-generator.d.ts.map +1 -1
  60. package/dist/src/utils/docs-preview/config-generator.js +4 -0
  61. package/dist/src/utils/docs-preview/config-generator.js.map +1 -1
  62. package/dist/src/utils/notification-constants.d.ts +87 -0
  63. package/dist/src/utils/notification-constants.d.ts.map +1 -0
  64. package/dist/src/utils/notification-constants.js +131 -0
  65. package/dist/src/utils/notification-constants.js.map +1 -0
  66. package/dist/src/utils/notification-manager.d.ts +24 -0
  67. package/dist/src/utils/notification-manager.d.ts.map +1 -1
  68. package/dist/src/utils/notification-manager.js +29 -0
  69. package/dist/src/utils/notification-manager.js.map +1 -1
  70. package/dist/src/utils/platform-utils.d.ts +13 -3
  71. package/dist/src/utils/platform-utils.d.ts.map +1 -1
  72. package/dist/src/utils/platform-utils.js +17 -6
  73. package/dist/src/utils/platform-utils.js.map +1 -1
  74. package/package.json +1 -1
  75. package/plugins/specweave/commands/specweave-increment.md +46 -0
  76. package/plugins/specweave/commands/specweave-jobs.md +153 -8
  77. package/plugins/specweave/commands/specweave-judge-llm.md +296 -0
  78. package/plugins/specweave/commands/specweave-organize-docs.md +2 -2
  79. package/plugins/specweave/hooks/hooks.json +10 -0
  80. package/plugins/specweave/hooks/spec-project-validator.sh +24 -2
  81. package/plugins/specweave/hooks/universal/hook-wrapper.cmd +26 -26
  82. package/plugins/specweave/hooks/universal/session-start.cmd +16 -16
  83. package/plugins/specweave/hooks/universal/session-start.ps1 +16 -16
  84. package/plugins/specweave/hooks/v2/guards/metadata-json-guard.sh +87 -0
  85. package/plugins/specweave/hooks/v2/guards/metadata-json-guard.test.sh +302 -0
  86. package/plugins/specweave/hooks/v2/guards/per-us-project-validator.sh +72 -18
  87. package/plugins/specweave/hooks/v2/guards/per-us-project-validator.test.sh +406 -0
  88. package/plugins/specweave/scripts/session-watchdog.sh +288 -134
  89. package/plugins/specweave/skills/increment-planner/SKILL.md +48 -18
  90. package/plugins/specweave/skills/increment-planner/templates/spec-multi-project.md +27 -14
  91. package/plugins/specweave/skills/increment-planner/templates/spec-single-project.md +16 -5
  92. package/plugins/specweave/skills/spec-generator/SKILL.md +74 -15
  93. package/plugins/specweave-docs/commands/build.md +4 -4
  94. package/plugins/specweave-docs/commands/generate.md +1 -1
  95. package/plugins/specweave-docs/commands/health.md +1 -1
  96. package/plugins/specweave-docs/commands/init.md +1 -1
  97. package/plugins/specweave-docs/commands/organize.md +2 -2
  98. package/plugins/specweave-docs/commands/validate.md +1 -1
  99. package/plugins/specweave-docs/commands/view.md +391 -0
  100. package/plugins/specweave-docs/skills/preview/SKILL.md +56 -17
  101. package/src/templates/AGENTS.md.template +24 -28
  102. package/src/templates/CLAUDE.md.template +12 -8
  103. package/plugins/specweave/commands/specweave-judge.md +0 -276
  104. package/plugins/specweave-docs/commands/preview.md +0 -274
  105. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +0 -738
  106. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +0 -1107
@@ -8,17 +8,18 @@ created: {{DATE}}
8
8
  structure: user-stories
9
9
  test_mode: {{TEST_MODE}}
10
10
  coverage_target: {{COVERAGE_TARGET}}
11
- # MANDATORY: Run "specweave context projects" to get valid project/board IDs
12
- # For 2-level structures: BOTH project AND board are REQUIRED
13
- project: {{PROJECT_ID}}
14
- board: {{BOARD_ID}}
11
+ # MANDATORY: Must be RESOLVED values from "specweave context projects" output
12
+ # NEVER use {{PROJECT_ID}} or {{BOARD_ID}} placeholders!
13
+ # For 2-level structures: BOTH project AND board are REQUIRED per US
14
+ project: {{RESOLVED_PROJECT}}
15
+ board: {{RESOLVED_BOARD}}
15
16
  multi_project: true
16
17
  projects:
17
- - id: {{PROJECT_FE_ID}}
18
+ - id: {{RESOLVED_PROJECT_FE}}
18
19
  prefix: FE
19
- - id: {{PROJECT_BE_ID}}
20
+ - id: {{RESOLVED_PROJECT_BE}}
20
21
  prefix: BE
21
- - id: {{PROJECT_SHARED_ID}}
22
+ - id: {{RESOLVED_PROJECT_SHARED}}
22
23
  prefix: SHARED
23
24
  ---
24
25
 
@@ -30,13 +31,25 @@ projects:
30
31
 
31
32
  ## User Stories
32
33
 
33
- <!-- Each US has its own **Project** and **Board** fields. User can modify per-US anytime. -->
34
+ <!--
35
+ ⚠️ MANDATORY RESOLUTION (v0.34.0+):
36
+ 1. Run: specweave context projects
37
+ 2. Parse JSON output:
38
+ - level 1: projects[].id gives valid project IDs
39
+ - level 2: projects[].id + boardsByProject[project][].id gives project AND board IDs
40
+ 3. Replace ALL placeholders with actual IDs from step 2
41
+ 4. Each US MUST have **Project**: (and **Board**: for 2-level) with RESOLVED values
42
+
43
+ ❌ FORBIDDEN: Using {{PROJECT_ID}}, {{BOARD_ID}} placeholders
44
+ ❌ FORBIDDEN: Inventing project/board names
45
+ ✅ REQUIRED: Use ONLY IDs from "specweave context projects" output
46
+ -->
34
47
 
35
48
  ### Frontend Stories
36
49
 
37
50
  #### US-FE-001: [Story Title] (P1)
38
- **Project**: {{PROJECT_ID}}
39
- **Board**: {{BOARD_FE_ID}}
51
+ **Project**: {{RESOLVED_PROJECT}}
52
+ **Board**: {{RESOLVED_BOARD_FE}}
40
53
 
41
54
  **As a** [user type]
42
55
  **I want** [goal]
@@ -51,8 +64,8 @@ projects:
51
64
  ### Backend Stories
52
65
 
53
66
  #### US-BE-001: [Story Title] (P1)
54
- **Project**: {{PROJECT_ID}}
55
- **Board**: {{BOARD_BE_ID}}
67
+ **Project**: {{RESOLVED_PROJECT}}
68
+ **Board**: {{RESOLVED_BOARD_BE}}
56
69
 
57
70
  **As a** [system/frontend application]
58
71
  **I want** [API endpoint/service goal]
@@ -67,8 +80,8 @@ projects:
67
80
  ### Shared Library Stories
68
81
 
69
82
  #### US-SHARED-001: [Story Title] (P1)
70
- **Project**: {{PROJECT_ID}}
71
- **Board**: {{BOARD_SHARED_ID}}
83
+ **Project**: {{RESOLVED_PROJECT}}
84
+ **Board**: {{RESOLVED_BOARD_SHARED}}
72
85
 
73
86
  **As a** developer in FE or BE repos
74
87
  **I want** [shared types/utilities/validators]
@@ -8,8 +8,9 @@ created: {{DATE}}
8
8
  structure: user-stories
9
9
  test_mode: {{TEST_MODE}}
10
10
  coverage_target: {{COVERAGE_TARGET}}
11
- # MANDATORY: Run "specweave context projects" to get valid project ID
12
- project: {{PROJECT_ID}}
11
+ # MANDATORY: Must be a RESOLVED value from "specweave context projects" output
12
+ # ⛔ NEVER use {{PROJECT_ID}} placeholder - always resolve BEFORE creating spec.md!
13
+ project: {{RESOLVED_PROJECT}}
13
14
  ---
14
15
 
15
16
  # Feature: {{FEATURE_TITLE}}
@@ -20,10 +21,20 @@ project: {{PROJECT_ID}}
20
21
 
21
22
  ## User Stories
22
23
 
23
- <!-- Each US can have its own **Project** field. If omitted, uses default_project from frontmatter -->
24
+ <!--
25
+ ⚠️ MANDATORY RESOLUTION (v0.34.0+):
26
+ 1. Run: specweave context projects
27
+ 2. Parse JSON: projects[].id gives valid project IDs
28
+ 3. Replace {{RESOLVED_PROJECT}} with actual ID from step 2
29
+ 4. Each US MUST have **Project**: field with RESOLVED value
30
+
31
+ ❌ FORBIDDEN: Using {{PROJECT_ID}} placeholder
32
+ ❌ FORBIDDEN: Inventing project names
33
+ ✅ REQUIRED: Use ONLY IDs from "specweave context projects" output
34
+ -->
24
35
 
25
36
  ### US-001: [Story Title] (P1)
26
- **Project**: {{PROJECT_ID}}
37
+ **Project**: {{RESOLVED_PROJECT}}
27
38
 
28
39
  **As a** [user type]
29
40
  **I want** [goal]
@@ -34,7 +45,7 @@ project: {{PROJECT_ID}}
34
45
  - [ ] **AC-US1-02**: [Another criterion]
35
46
 
36
47
  ### US-002: [Story Title] (P2)
37
- **Project**: {{PROJECT_ID}}
48
+ **Project**: {{RESOLVED_PROJECT}}
38
49
 
39
50
  [Repeat structure - change Project per US if spanning multiple projects]
40
51
 
@@ -85,34 +85,93 @@ The LLM MUST resolve these from context - see RULE 0 in increment-planner.
85
85
 
86
86
  ---
87
87
 
88
+ ### MANDATORY STEP 0: Get Project Context FIRST (v0.34.0+ BLOCKING!)
89
+
90
+ **⛔ YOU CANNOT GENERATE spec.md UNTIL YOU COMPLETE THIS STEP!**
91
+
92
+ **This step is BLOCKING - do not proceed until you have actual project/board IDs.**
93
+
94
+ **1. Run the context API command:**
95
+ ```bash
96
+ specweave context projects
97
+ ```
98
+
99
+ **2. Parse the JSON output:**
100
+ ```json
101
+ {
102
+ "level": 1,
103
+ "projects": [{"id": "frontend-app", "name": "Frontend App"}],
104
+ "detectionReason": "multiProject configuration"
105
+ }
106
+ ```
107
+ For 2-level:
108
+ ```json
109
+ {
110
+ "level": 2,
111
+ "projects": [{"id": "acme-corp", "name": "ACME Corp"}],
112
+ "boardsByProject": {
113
+ "acme-corp": [
114
+ {"id": "digital-ops", "name": "Digital Operations"},
115
+ {"id": "mobile-team", "name": "Mobile Team"}
116
+ ]
117
+ }
118
+ }
119
+ ```
120
+
121
+ **3. STORE the actual IDs for use in spec.md:**
122
+ ```
123
+ RESOLVED_PROJECT = "frontend-app" // from projects[].id
124
+ RESOLVED_BOARD = "digital-ops" // from boardsByProject (2-level only)
125
+ ```
126
+
127
+ **4. Now generate spec.md using RESOLVED values (NEVER placeholders!)**
128
+
129
+ ---
130
+
88
131
  ### Per-US Project Resolution (v0.33.0+ MANDATORY)
89
132
 
90
- **🧠 USE ALL AVAILABLE CONTEXT TO RESOLVE PROJECT/BOARD:**
133
+ **🧠 USE CONTEXT API OUTPUT + LIVING DOCS TO RESOLVE PROJECT/BOARD:**
91
134
 
92
- Before generating spec.md, analyze:
93
- 1. **Living docs folders**: `ls .specweave/docs/internal/specs/` actual project IDs
94
- 2. **Recent increment patterns**: `grep "**Project**:" .specweave/increments/*/spec.md`
95
- 3. **Config projectMappings**: Exact project IDs from config
96
- 4. **Feature keywords**: Map to actual projects (not generic terms)
135
+ After running `specweave context projects`, you have the valid project/board IDs.
136
+ Now map each user story to the correct project:
137
+
138
+ **Resolution Flow:**
139
+ ```
140
+ 1. Get valid projects from context API: ["frontend-app", "backend-api", "shared"]
141
+ 2. Analyze feature description for keywords
142
+ 3. Map keywords to ACTUAL project IDs (from step 1, NOT generic terms!)
143
+ 4. Assign each US to its project
144
+ ```
97
145
 
98
146
  **Resolution Example:**
99
147
  ```
148
+ Context API returned: projects = ["frontend-app", "backend-api", "shared"]
149
+
100
150
  Feature: "Add OAuth login to React frontend"
101
- Detected: "React", "frontend", "login"
151
+ Detected keywords: "React", "frontend", "login"
102
152
 
103
- Step 1: Check living docs → folders: frontend-app/, backend-api/, shared/
104
- Step 2: "frontend" keyword → matches "frontend-app" folder
105
- Step 3: Assign **Project**: frontend-app (NOT "frontend"!)
153
+ Mapping:
154
+ - "frontend" keyword → matches "frontend-app" (from context API)
155
+ - "login" spans frontend + backend
106
156
 
107
- If cross-cutting ("OAuth" = both frontend + backend):
157
+ Result:
108
158
  US-001 (Login UI) → **Project**: frontend-app
109
159
  US-002 (Auth API) → **Project**: backend-api
110
160
  ```
111
161
 
112
- **NEVER:**
113
- - ❌ Use generic keywords as project names ("frontend", "backend")
114
- - ❌ Ask user when context provides the answer
115
- - Leave `{{PROJECT_ID}}` placeholders
162
+ **VALIDATION RULES:**
163
+
164
+ ```
165
+ REQUIRED: Run "specweave context projects" BEFORE generating spec.md
166
+ ✅ REQUIRED: Use ONLY project IDs from the API response
167
+ ✅ REQUIRED: Each US has explicit **Project**: field with resolved value
168
+ ✅ REQUIRED: For 2-level, each US has explicit **Board**: field with resolved value
169
+
170
+ ❌ FORBIDDEN: Generating spec.md without running context API first
171
+ ❌ FORBIDDEN: Using {{PROJECT_ID}} or {{BOARD_ID}} placeholders
172
+ ❌ FORBIDDEN: Using generic keywords as project names ("frontend" vs "frontend-app")
173
+ ❌ FORBIDDEN: Inventing project names not in the API response
174
+ ```
116
175
 
117
176
  ## Success Metrics
118
177
  [How we'll measure success]
@@ -52,7 +52,7 @@ if [ ! -d ".specweave/cache/docs-site/node_modules" ]; then
52
52
  fi
53
53
  ```
54
54
 
55
- If not set up, follow the same setup steps as `/specweave-docs:preview` (Step 3 in preview.md).
55
+ If not set up, follow the same setup steps as `/specweave-docs:view` (Step 3 in view.md).
56
56
 
57
57
  ### Step 3: Run Build
58
58
 
@@ -131,8 +131,8 @@ git commit -m "docs: update documentation site"
131
131
 
132
132
  ### Build fails with broken links
133
133
  ```bash
134
- # Preview first to find errors
135
- /specweave-docs:preview
134
+ # View docs first to find errors
135
+ /specweave-docs:view
136
136
  # Fix broken links, then build
137
137
  /specweave-docs:build
138
138
  ```
@@ -155,6 +155,6 @@ rm -rf .specweave/cache/docs-site
155
155
 
156
156
  ## See Also
157
157
 
158
- - `/specweave-docs:preview` - Preview docs locally with hot reload
158
+ - `/specweave-docs:view` - View docs locally with hot reload
159
159
  - `/specweave-docs:organize` - Organize large folders with themed indexes
160
160
  - `/specweave-docs:health` - Documentation health report
@@ -408,7 +408,7 @@ cat ./docs/api/index.md ./docs/specs/index.md > ./docs/complete-reference.md
408
408
  ## Related Commands
409
409
 
410
410
  - `/specweave-docs:init` - Initialize Docusaurus documentation site
411
- - `/specweave-docs:preview` - Preview generated documentation
411
+ - `/specweave-docs:view` - View generated documentation
412
412
  - `/specweave-docs:build` - Build static site from generated docs
413
413
 
414
414
  ## Requirements
@@ -264,5 +264,5 @@ jobs:
264
264
  ## See Also
265
265
 
266
266
  - `/specweave-docs:organize` - Organize large folders with themed indexes
267
- - `/specweave-docs:preview` - Preview documentation with Docusaurus
267
+ - `/specweave-docs:view` - View documentation with Docusaurus
268
268
  - `/specweave-docs:generate` - Generate docs from code
@@ -309,7 +309,7 @@ themeConfig: {
309
309
  ## Related Commands
310
310
 
311
311
  - `/specweave-docs:generate` - Generate docs from code/specs
312
- - `/specweave-docs:preview` - Launch documentation preview server
312
+ - `/specweave-docs:view` - Launch documentation server
313
313
  - `/specweave-docs:build` - Build static documentation site
314
314
 
315
315
  ## Requirements
@@ -161,7 +161,7 @@ Generated 9 index files:
161
161
  After running this command, use:
162
162
 
163
163
  ```bash
164
- /specweave-docs:preview
164
+ /specweave-docs:view
165
165
  ```
166
166
 
167
167
  The generated indexes will appear in the sidebar:
@@ -179,6 +179,6 @@ The generated indexes will appear in the sidebar:
179
179
 
180
180
  ## See Also
181
181
 
182
- - `/specweave-docs:preview` - Preview documentation with Docusaurus
182
+ - `/specweave-docs:view` - View documentation with Docusaurus
183
183
  - `/specweave-docs:build` - Build static documentation site
184
184
  - `/specweave-docs:health` - Documentation health report
@@ -245,6 +245,6 @@ onBrokenMarkdownLinks: 'warn',
245
245
 
246
246
  ## See Also
247
247
 
248
- - `/specweave-docs:preview` - Preview docs (runs validation first)
248
+ - `/specweave-docs:view` - View docs (runs validation first)
249
249
  - `/specweave-docs:build` - Build docs (runs validation first)
250
250
  - `/specweave-docs:health` - Full documentation health report