specweave 1.0.78 β†’ 1.0.80

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.78",
3
+ "version": "1.0.80",
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",
@@ -1,452 +1,10 @@
1
1
  ---
2
2
  name: sw:jobs
3
3
  description: Show current work status (active increments, progress) and background jobs (imports, cloning). Even with no jobs, shows increment summary and helpful context.
4
- usage: /sw:jobs [--all] [--id <job-id>] [--resume <job-id>] [--kill <job-id>] [--follow <job-id>] [--logs <job-id>] [--diagnostics]
4
+ usage: /sw:jobs [--all] [--id <job-id>]
5
+ allowed-tools: Bash(bash:*)
5
6
  ---
6
7
 
7
8
  # Background Jobs Monitor
8
9
 
9
- **Usage**: `/sw:jobs [options]`
10
-
11
- ---
12
-
13
- ## Purpose
14
-
15
- Monitor and manage long-running background operations:
16
- - **Repository cloning** (multi-repo/umbrella setup)
17
- - **Issue import** (10K+ items from GitHub/JIRA/ADO)
18
- - **External sync** operations
19
- - **Brownfield analysis** (codebase documentation gap detection)
20
- - **Session health monitoring** (watchdog diagnostics)
21
-
22
- **ASYNC ARCHITECTURE (2025-12-01)**:
23
- - Jobs run as **detached processes** that survive terminal close
24
- - Progress tracked via filesystem (`.specweave/state/jobs/`)
25
- - Can check status anytime with `/sw:jobs`
26
-
27
- ---
28
-
29
- ## Command Options
30
-
31
- | Option | Description |
32
- |--------|-------------|
33
- | (none) | Show active jobs + session health |
34
- | `--all` | Show all jobs (including completed) |
35
- | `--id <jobId>` | Show details for specific job |
36
- | `--follow <jobId>` | Follow job progress in real-time |
37
- | `--logs <jobId>` | Show worker log output |
38
- | `--resume <jobId>` | Resume paused job |
39
- | `--kill <jobId>` | Kill running background job |
40
- | `--diagnostics` | Show detailed watchdog diagnostics |
41
-
42
- ---
43
-
44
- ## Check Job Status
45
-
46
- Read the background jobs state file and display status:
47
-
48
- ```bash
49
- # Find and read the state file
50
- STATE_FILE=".specweave/state/background-jobs.json"
51
-
52
- # Also check job-specific files:
53
- # .specweave/state/jobs/<jobId>/config.json - Job configuration
54
- # .specweave/state/jobs/<jobId>/worker.pid - Process ID (if running)
55
- # .specweave/state/jobs/<jobId>/worker.log - Worker output log
56
- # .specweave/state/jobs/<jobId>/result.json - Results (when complete)
57
- ```
58
-
59
- ### Display Format
60
-
61
- ```
62
- πŸ“‹ Background Jobs & Session Health
63
-
64
- 🩺 Session Health: βœ… healthy (last check: 30s ago)
65
-
66
- πŸ”„ Running (2):
67
- [abc12345] import-issues (ADO)
68
- Progress: 2,500/10,000 (25%)
69
- Rate: 15.2/s | ETA: ~8m 14s
70
- PID: 45678 | Started: 2 mins ago
71
-
72
- [bfa99001] brownfield-analysis
73
- Phase: 3/5 (doc-matching)
74
- Files scanned: 1,234 | Discrepancies: 45
75
- PID: 45680 | Started: 5 mins ago
76
-
77
- ⏸️ Paused (1):
78
- [def67890] import-issues (GitHub)
79
- Progress: 1,234/10,000 (12%)
80
- Reason: Rate limited (resumes in 45s)
81
- Resume: /sw:jobs --resume def67890
82
-
83
- βœ… Completed (3):
84
- [ghi11111] import-issues - 4,500 items - 5 mins ago
85
- [jkl22222] clone-repos - 4/4 repos - 1 hour ago
86
- [bfa88001] brownfield-analysis - 127 discrepancies - 2 hours ago
87
-
88
- πŸ’‘ Commands:
89
- /sw:jobs --id abc12345 β†’ Details for specific job
90
- /sw:jobs --follow abc12345 β†’ Follow progress live
91
- /sw:jobs --logs abc12345 β†’ View worker logs
92
- /sw:jobs --resume def67890 β†’ Resume paused job
93
- /sw:jobs --kill abc12345 β†’ Kill running job
94
- /sw:jobs --diagnostics β†’ Show watchdog diagnostics
95
- /sw:jobs --all β†’ Show all jobs (including old)
96
- ```
97
-
98
- ---
99
-
100
- ## Actions
101
-
102
- ### View Specific Job Details
103
-
104
- ```
105
- /sw:jobs --id abc12345
106
-
107
- πŸ“¦ Job Details: abc12345
108
-
109
- Type: import-issues
110
- Status: running
111
- Provider: ADO
112
- PID: 45678
113
-
114
- Started: 2024-01-15 10:30:00
115
- Updated: 2024-01-15 10:32:15
116
-
117
- Progress: 2,500/10,000 (25%)
118
- Current: Acme\Core-Operations
119
- Rate: 15.2 items/sec
120
- ETA: ~8 minutes
121
-
122
- Files:
123
- Config: .specweave/state/jobs/abc12345/config.json
124
- Logs: .specweave/state/jobs/abc12345/worker.log
125
- PID: .specweave/state/jobs/abc12345/worker.pid
126
- ```
127
-
128
- ### Follow Job Progress Live
129
-
130
- Watch job progress in real-time (like `tail -f`):
131
-
132
- ```
133
- /sw:jobs --follow abc12345
134
-
135
- πŸ“¦ Following job abc12345 (Ctrl+C to stop)
136
-
137
- [10:30:15] Progress: 2,500/10,000 (25%) - Acme\Core-Operations
138
- [10:30:16] Progress: 2,520/10,000 (25%) - Acme\Core-Operations
139
- [10:30:17] Progress: 2,545/10,000 (25%) - Acme\AI-Platform
140
- [10:30:18] Progress: 2,570/10,000 (26%) - Acme\AI-Platform
141
- ...
142
- ```
143
-
144
- **Implementation**: Read `.specweave/state/jobs/<jobId>/worker.log` with tail-like behavior, or poll the job state file every second.
145
-
146
- ### View Worker Logs
147
-
148
- Show detailed worker output:
149
-
150
- ```
151
- /sw:jobs --logs abc12345
152
-
153
- πŸ“‹ Worker Logs for abc12345 (last 50 lines):
154
-
155
- [2024-01-15T10:30:00.123Z] Worker started for job abc12345
156
- [2024-01-15T10:30:00.456Z] Project path: /Users/dev/my-project
157
- [2024-01-15T10:30:00.789Z] PID: 45678
158
- [2024-01-15T10:30:01.234Z] Dependencies loaded, starting import...
159
- [2024-01-15T10:30:02.567Z] Progress: 100/10000 - ado Acme\Core-Operations
160
- [2024-01-15T10:30:03.890Z] Progress: 200/10000 - ado Acme\Core-Operations
161
- ...
162
- ```
163
-
164
- **Implementation**: Read `.specweave/state/jobs/<jobId>/worker.log`
165
-
166
- ### Kill Running Job
167
-
168
- Stop a background job:
169
-
170
- ```
171
- /sw:jobs --kill abc12345
172
-
173
- ⚠️ Killing job abc12345...
174
- Type: import-issues
175
- PID: 45678
176
- Progress: 2,500/10,000 (25%)
177
-
178
- βœ… Job killed. Status changed to 'paused'.
179
- Resume later: /sw:jobs --resume abc12345
180
- ```
181
-
182
- **Implementation**:
183
- ```typescript
184
- import { killJob } from '../../../src/core/background/job-launcher.js';
185
-
186
- const success = killJob(projectPath, jobId);
187
- if (success) {
188
- console.log('Job killed successfully');
189
- }
190
- ```
191
-
192
- ### Resume Paused Job
193
-
194
- When a job is paused (rate limited, killed, or user requested), resume it:
195
-
196
- ```
197
- /sw:jobs --resume def67890
198
-
199
- πŸ”„ Resuming job def67890...
200
- Type: import-issues
201
- Provider: GitHub
202
- Resuming from: item 1,234 of 10,000
203
-
204
- ⏳ Spawning background worker...
205
- New PID: 45679
206
-
207
- βœ… Job resumed in background.
208
- Check progress: /sw:jobs --follow def67890
209
- ```
210
-
211
- **Implementation**:
212
- ```typescript
213
- import { launchImportJob } from '../../../src/core/background/job-launcher.js';
214
-
215
- // Re-launch the worker with existing config
216
- const result = await launchImportJob({
217
- type: 'import-issues',
218
- projectPath,
219
- coordinatorConfig: existingConfig,
220
- estimatedTotal: job.progress.total
221
- });
222
- ```
223
-
224
- ---
225
-
226
- ## Implementation
227
-
228
- 1. Read `.specweave/state/background-jobs.json`
229
- 2. Read `.specweave/state/.watchdog-diagnostics.json` for session health
230
- 3. Parse job entries
231
- 4. Display formatted status with health indicator
232
- 5. For --resume, update job status and continue operation
233
- 6. For --diagnostics, show detailed watchdog checks
234
-
235
- ### State File Locations
236
-
237
- ```
238
- .specweave/state/background-jobs.json - Job status and progress
239
- .specweave/state/.watchdog-diagnostics.json - Session health checks
240
- .specweave/state/jobs/<jobId>/config.json - Job configuration
241
- .specweave/state/jobs/<jobId>/worker.pid - Worker process ID
242
- .specweave/state/jobs/<jobId>/worker.log - Worker output log
243
- .specweave/logs/watchdog.log - Watchdog history
244
- ```
245
-
246
- ### Reading Session Health
247
-
248
- ```typescript
249
- import * as fs from 'fs';
250
- import * as path from 'path';
251
-
252
- function getSessionHealth(projectPath: string): SessionHealth | null {
253
- const diagnosticsPath = path.join(projectPath, '.specweave/state/.watchdog-diagnostics.json');
254
- if (!fs.existsSync(diagnosticsPath)) {
255
- return null; // Watchdog not running
256
- }
257
-
258
- try {
259
- const content = fs.readFileSync(diagnosticsPath, 'utf-8');
260
- return JSON.parse(content);
261
- } catch {
262
- return null;
263
- }
264
- }
265
-
266
- interface SessionHealth {
267
- timestamp: string;
268
- severity: 0 | 1 | 2; // INFO | WARNING | CRITICAL
269
- status: 'healthy' | 'warning' | 'critical';
270
- checks: {
271
- lock: { severity: number; message: string };
272
- zombies: { count: number; message: string };
273
- mcp: { drops: number; message: string };
274
- orphanedJobs: { count: number; message: string };
275
- };
276
- consecutiveWarnings: number;
277
- thresholdSeconds: number;
278
- checkIntervalSeconds: number;
279
- }
280
- ```
281
-
282
- ### Job Types
283
-
284
- | Type | Description | Typical Duration |
285
- |------|-------------|------------------|
286
- | `clone-repos` | Multi-repo cloning | 1-5 mins |
287
- | `import-issues` | Issue import from external | 5-60 mins |
288
- | `sync-external` | Bidirectional sync | 1-10 mins |
289
- | `brownfield-analysis` | Doc gap detection | 2-30 mins |
290
-
291
- ---
292
-
293
- ## Integration Points
294
-
295
- - Called after `specweave init` with background clone
296
- - Called after `/sw:import-external` starts background import
297
- - Called after `/sw-github:sync` for large syncs
298
- - Called after `/sw-jira:sync` for large syncs
299
- - Called after `specweave init` brownfield analysis prompt
300
-
301
- ---
302
-
303
- ## Brownfield Analysis Completion
304
-
305
- When a brownfield-analysis job completes, it shows a summary:
306
-
307
- ```
308
- βœ… Brownfield Analysis Complete (bfa88001)
309
-
310
- πŸ“Š Results Summary:
311
- Files analyzed: 2,456
312
- Modules detected: 18
313
- Duration: 12m 34s
314
-
315
- πŸ“‹ Discrepancies Found: 127
316
- By Type:
317
- missing-docs: 72 (57%)
318
- stale-docs: 28 (22%)
319
- knowledge-gap: 15 (12%)
320
- orphan-doc: 8 (6%)
321
- missing-adr: 4 (3%)
322
-
323
- By Priority:
324
- πŸ”΄ Critical: 3
325
- 🟠 High: 24
326
- 🟑 Medium: 68
327
- 🟒 Low: 32
328
-
329
- πŸ’‘ Next Steps:
330
- /sw:discrepancies β†’ View all pending discrepancies
331
- /sw:discrepancies --module auth β†’ Filter by module
332
- /sw:discrepancy-to-increment DISC-0001 DISC-0002 β†’ Create increment
333
- ```
334
-
335
- ---
336
-
337
- ## Error Handling
338
-
339
- If job failed:
340
- ```
341
- ❌ Failed (1):
342
- [xyz99999] import-issues
343
- Error: Rate limit exceeded (retry after 60s)
344
- Failed at: item 5,000 of 10,000
345
- Resume: /sw:jobs --resume xyz99999
346
- ```
347
-
348
- ---
349
-
350
- ## Session Health & Watchdog Diagnostics (v2.0)
351
-
352
- The `/sw:jobs` command now includes session health monitoring. The watchdog runs in the background and writes diagnostics that help explain any alerts you may have received.
353
-
354
- ### Display Format (with health status)
355
-
356
- ```
357
- πŸ“‹ Background Jobs & Session Health
358
-
359
- 🩺 Session Health: βœ… healthy
360
- Last check: 30 seconds ago
361
- Consecutive warnings: 0/3
362
-
363
- πŸ”„ Running (1):
364
- [abc12345] import-issues (ADO)
365
- Progress: 2,500/10,000 (25%)
366
- ...
367
- ```
368
-
369
- ### Diagnostics File
370
-
371
- The watchdog writes diagnostics to `.specweave/state/.watchdog-diagnostics.json`:
372
-
373
- ```json
374
- {
375
- "timestamp": "2025-12-10T10:30:00Z",
376
- "severity": 0,
377
- "status": "healthy",
378
- "checks": {
379
- "lock": { "severity": 0, "message": "ok" },
380
- "zombies": { "count": 0, "message": "none" },
381
- "mcp": { "drops": 2, "message": "minor instability" },
382
- "orphanedJobs": { "count": 0, "message": "none" }
383
- },
384
- "consecutiveWarnings": 0,
385
- "thresholdSeconds": 300,
386
- "checkIntervalSeconds": 60
387
- }
388
- ```
389
-
390
- ### View Detailed Diagnostics
391
-
392
- ```
393
- /sw:jobs --diagnostics
394
-
395
- 🩺 Watchdog Diagnostics
396
-
397
- Overall Status: βœ… healthy
398
- Last Check: 2025-12-10 10:30:00
399
- Severity Level: INFO (0)
400
-
401
- Checks:
402
- πŸ“ Lock File: βœ… ok
403
- πŸ’€ Zombie Procs: βœ… none (0)
404
- πŸ”Œ MCP Connection: ⚠️ 2 drops detected (minor instability)
405
- πŸ“¦ Orphaned Jobs: βœ… none (0)
406
-
407
- Alert Threshold: 3 consecutive warnings
408
- Current Warnings: 0/3
409
-
410
- Severity Levels:
411
- INFO (0) - Everything healthy, no action needed
412
- WARNING (1) - Minor issue detected, monitoring (NO notification)
413
- CRITICAL (2) - Real stuck condition detected β†’ NOTIFICATION SENT
414
-
415
- πŸ’‘ The watchdog only sends notifications for CRITICAL issues
416
- that persist across 3+ consecutive checks (prevents false positives).
417
- ```
418
-
419
- ### Why You Got a Notification
420
-
421
- If you received a notification but your job completed successfully, here's what happened:
422
-
423
- 1. **Old behavior (v1)**: Watchdog triggered on stale lock files even if no process was stuck
424
- 2. **New behavior (v2)**: Watchdog verifies actual process state before alerting
425
-
426
- Common false positive causes (now fixed):
427
- - Stale `.processor.lock` file from completed job
428
- - Missing heartbeat file (never written in normal operation)
429
- - MCP connection drops (warning only, not critical)
430
-
431
- **The v2 watchdog now requires**:
432
- 1. **Actual stuck process** (zombie heredoc, hung worker)
433
- 2. **3 consecutive checks** showing the same issue
434
- 3. **CRITICAL severity** (not just warnings)
435
-
436
- ### Watchdog Log
437
-
438
- View historical watchdog checks:
439
-
440
- ```bash
441
- cat .specweave/logs/watchdog.log
442
- ```
443
-
444
- ---
445
-
446
- ## Notes
447
-
448
- - Jobs persist across Claude sessions
449
- - Paused jobs can be resumed later
450
- - Completed jobs cleaned up after 10 entries
451
- - Rate limiting auto-pauses and notifies
452
- - Watchdog diagnostics available via `--diagnostics` flag
10
+ !`bash "${CLAUDE_PLUGIN_ROOT}/scripts/read-jobs.sh" $ARGUMENTS`
@@ -1,84 +1,10 @@
1
1
  ---
2
2
  name: sw:progress
3
3
  description: Show progress for all active increments with task completion status
4
+ usage: /sw:progress [incrementId]
5
+ allowed-tools: Bash(bash:*)
4
6
  ---
5
7
 
6
- # Progress Tracking
8
+ # Increment Progress
7
9
 
8
- Simple, fast progress check for all active increments.
9
-
10
- ## Usage
11
-
12
- ```bash
13
- /sw:progress
14
- ```
15
-
16
- ## Implementation
17
-
18
- ```bash
19
- #!/bin/bash
20
- #
21
- # Instant progress tracking (v0.32.0+)
22
- # Uses pre-computed dashboard cache for <10ms response time
23
- #
24
-
25
- # Call instant bash script (reads from cache, no Node.js needed)
26
- bash "$(dirname "${BASH_SOURCE[0]}")"/../scripts/read-progress.sh "$@"
27
- ```
28
-
29
- ## Example Output
30
-
31
- ### Legacy Format (no User Stories)
32
- ```
33
- πŸ“Š Increment Progress
34
- ============================================================
35
-
36
- 🟒 ACTIVE: 0037-project-specific-tasks
37
- β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘ 84% (72/85 tasks)
38
-
39
- Next: /sw:do 0037-project-specific-tasks
40
-
41
- ============================================================
42
- Summary:
43
- Active increments: 1
44
- Other non-completed: 0
45
-
46
- πŸ’‘ Continue with /sw:do
47
- ```
48
-
49
- ### Enhanced Format (with User Story grouping)
50
- ```
51
- πŸ“Š Increment Progress
52
- ============================================================
53
-
54
- ⏸️ ACTIVE: 0047-us-task-linkage
55
- β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 59% (13/22 tasks)
56
-
57
- Progress by User Story:
58
- βœ… US-001: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% (4/4)
59
- βœ… US-002: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% (3/3)
60
- β”œβ”€ US-003: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 60% (3/5)
61
- βœ… US-004: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100% (3/3)
62
- β”œβ”€ US-005: β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 0% (0/4)
63
- β”œβ”€ US-006: β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 0% (0/3)
64
-
65
- Resume: /sw:resume 0047-us-task-linkage
66
-
67
- ============================================================
68
- Summary:
69
- Active increments: 0
70
- Other non-completed: 1
71
-
72
- πŸ’‘ No active work. Run /sw:increment to start new work
73
- ```
74
-
75
- ## What It Shows
76
-
77
- - **Overall progress**: Visual bar + percentage + task count
78
- - **Per-User Story progress** (if US linkage exists): Completion status for each US
79
- - **Progress bars**: Color-coded (green β‰₯80%, yellow 50-79%, red <50%)
80
- - **Completion indicators**: βœ… for 100% complete USs
81
- - **Orphan tasks warning**: If tasks exist without User Story linkage
82
- - **Next action**: Command to continue work
83
-
84
- **Note**: Skips completed and archived increments. Automatically detects and displays US-level progress for increments using US-task linkage (v0.23.0+).
10
+ !`bash "${CLAUDE_PLUGIN_ROOT}/scripts/read-progress.sh" $ARGUMENTS`