specweave 1.0.77 → 1.0.78

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/CLAUDE.md CHANGED
@@ -1017,6 +1017,8 @@ For **contributors to SpecWeave itself** (not users).
1017
1017
 
1018
1018
  ## Marketplace Installation (CRITICAL)
1019
1019
 
1020
+ ### For SpecWeave Contributors (Development)
1021
+
1020
1022
  **ALWAYS use GitHub marketplace mode. NEVER use local symlinks or directory mode.**
1021
1023
 
1022
1024
  ```bash
@@ -1037,6 +1039,32 @@ bash scripts/refresh-marketplace.sh --github
1037
1039
  bash scripts/refresh-marketplace.sh # Defaults to --github
1038
1040
  ```
1039
1041
 
1042
+ ### For End Users (Production)
1043
+
1044
+ **Users install SpecWeave globally and use CLI commands:**
1045
+
1046
+ ```bash
1047
+ # Install SpecWeave globally
1048
+ npm install -g specweave
1049
+
1050
+ # Initialize project (first time)
1051
+ specweave init .
1052
+
1053
+ # Update marketplace plugins (gets latest from GitHub)
1054
+ specweave refresh-marketplace
1055
+
1056
+ # Update instruction files (CLAUDE.md, AGENTS.md)
1057
+ specweave update-instructions
1058
+ ```
1059
+
1060
+ **After marketplace updates**: Restart Claude Code for changes to take effect.
1061
+
1062
+ **Verify installation**:
1063
+ ```bash
1064
+ specweave --version # Check SpecWeave version
1065
+ /plugin list --installed # In Claude Code - check plugins loaded
1066
+ ```
1067
+
1040
1068
  ---
1041
1069
 
1042
1070
  ## Critical Safety Rules
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specweave",
3
- "version": "1.0.77",
3
+ "version": "1.0.78",
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",
@@ -354,6 +354,28 @@ Pure Ralph Wiggum behavior:
354
354
  - **Max Iterations**: Prevents runaway loops (2500 default)
355
355
  - **Max Hours**: Time boxing (600 hours / 25 days default)
356
356
  - **stop_hook_active**: Prevents infinite continuation loops
357
+ - **Sound Notifications** (v2.6): Audible alerts when Claude stops working
358
+
359
+ ## 🔔 Sound Notifications (NEW in v2.6!)
360
+
361
+ **Auto mode plays a satisfying sound when work completes successfully!**
362
+
363
+ ### When Sound Plays
364
+
365
+ | Event | Sound | Platforms | Meaning |
366
+ |-------|-------|-----------|---------|
367
+ | **Session Complete (Success)** ✅ | Glass.aiff (macOS)<br>complete.oga (Linux)<br>Windows Notify (Windows) | All | All tasks done, tests passing - work finished! |
368
+
369
+ **Sound plays ONLY on complete success** - when all tasks are done AND all tests pass. This way you know when to check back without being interrupted during ongoing work.
370
+
371
+ ### Cross-Platform Support
372
+
373
+ The sound notification works automatically on:
374
+ - **macOS**: Glass.aiff (satisfying chime)
375
+ - **Linux**: PulseAudio/ALSA/speaker-test fallbacks
376
+ - **Windows**: PowerShell beeps
377
+
378
+ Sounds fail gracefully on systems without audio support.
357
379
 
358
380
  ## 🔧 v2.3 Per-Agent Stop Hook Behavior (NEW!)
359
381
 
@@ -117,6 +117,36 @@ Core hooks automate SpecWeave's fundamental workflows:
117
117
 
118
118
  ---
119
119
 
120
+ ### 5. `stop-auto.sh` (Auto Mode)
121
+ **Triggers**: When Claude tries to exit during autonomous execution (`/sw:auto`)
122
+
123
+ **Actions**:
124
+ 1. Checks if all tasks are complete
125
+ 2. Validates test execution (unit + E2E)
126
+ 3. Verifies completion criteria met
127
+ 4. Blocks exit if work incomplete
128
+ 5. Re-feeds prompt to continue iteration
129
+
130
+ **Configuration**: Registered in `hooks/hooks.json`:
131
+ ```json
132
+ {
133
+ "hooks": {
134
+ "Stop": [{
135
+ "hooks": [{
136
+ "type": "command",
137
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/stop-auto.sh"
138
+ }]
139
+ }]
140
+ }
141
+ }
142
+ ```
143
+
144
+ **Use case**: Enables autonomous execution loops. Claude works until ALL tasks complete and tests pass, then gracefully exits.
145
+
146
+ **See**: `/sw:auto` command documentation for full auto mode details.
147
+
148
+ ---
149
+
120
150
  ## How Hooks Work (Claude Code Native)
121
151
 
122
152
  **CRITICAL**: Hooks are **NOT copied** to `.claude/hooks/`. They stay in `plugins/specweave/hooks/` and Claude Code discovers them automatically.
@@ -31,6 +31,16 @@
31
31
  }
32
32
  ]
33
33
  }
34
+ ],
35
+ "Stop": [
36
+ {
37
+ "hooks": [
38
+ {
39
+ "type": "command",
40
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/stop-auto.sh"
41
+ }
42
+ ]
43
+ }
34
44
  ]
35
45
  }
36
46
  }
@@ -570,6 +570,54 @@ detect_command_timeout() {
570
570
  fi
571
571
  }
572
572
 
573
+ # ================================================================
574
+ # SOUND NOTIFICATION HELPER (v2.6)
575
+ # Cross-platform sound notification for user awareness
576
+ # ================================================================
577
+ play_notification_sound() {
578
+ local sound_type="${1:-attention}" # "success" or "attention"
579
+
580
+ # Detect OS and play appropriate sound
581
+ case "$(uname -s)" in
582
+ Darwin)
583
+ # macOS - use afplay with system sounds
584
+ if [ "$sound_type" = "success" ]; then
585
+ afplay /System/Library/Sounds/Glass.aiff 2>/dev/null &
586
+ else
587
+ afplay /System/Library/Sounds/Ping.aiff 2>/dev/null &
588
+ fi
589
+ ;;
590
+ Linux)
591
+ # Linux - try multiple sound systems (paplay, aplay, speaker-test)
592
+ if command -v paplay >/dev/null 2>&1; then
593
+ # PulseAudio (most common on modern Linux)
594
+ if [ "$sound_type" = "success" ]; then
595
+ paplay /usr/share/sounds/freedesktop/stereo/complete.oga 2>/dev/null &
596
+ else
597
+ paplay /usr/share/sounds/freedesktop/stereo/bell.oga 2>/dev/null &
598
+ fi
599
+ elif command -v aplay >/dev/null 2>&1; then
600
+ # ALSA fallback
601
+ aplay /usr/share/sounds/alsa/Front_Center.wav 2>/dev/null &
602
+ elif command -v speaker-test >/dev/null 2>&1; then
603
+ # Last resort - system beep
604
+ speaker-test -t sine -f 1000 -l 1 >/dev/null 2>&1 &
605
+ fi
606
+ ;;
607
+ MINGW*|MSYS*|CYGWIN*)
608
+ # Windows (Git Bash, WSL, Cygwin)
609
+ if command -v powershell.exe >/dev/null 2>&1; then
610
+ # Use PowerShell to play sound
611
+ if [ "$sound_type" = "success" ]; then
612
+ powershell.exe -c "(New-Object Media.SoundPlayer 'C:\Windows\Media\Windows Notify System Generic.wav').PlaySync();" 2>/dev/null &
613
+ else
614
+ powershell.exe -c "[console]::beep(800, 300)" 2>/dev/null &
615
+ fi
616
+ fi
617
+ ;;
618
+ esac
619
+ }
620
+
573
621
  # Helper: Output approve decision
574
622
  # ALWAYS log why we're stopping for debugging
575
623
  # Enhanced v2.4: Agent-aware labeling with clear hierarchy
@@ -644,12 +692,13 @@ approve() {
644
692
  echo "┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛"
645
693
 
646
694
  # ================================================================
647
- # SUCCESS SOUND NOTIFICATION (NEW - v2.5)
648
- # Play a satisfying sound when auto session completes successfully
649
- # Glass.aiff is a clean, satisfying completion sound on macOS
695
+ # SOUND NOTIFICATION ON SUCCESS (v2.6)
696
+ # Play sound ONLY when session completes successfully
697
+ # This lets users know they can check back - work is done!
698
+ # Cross-platform support via helper function
650
699
  # ================================================================
651
700
  if [ "$is_success" = "true" ]; then
652
- afplay /System/Library/Sounds/Glass.aiff 2>/dev/null &
701
+ play_notification_sound "success"
653
702
  fi
654
703
  else
655
704
  # Subagent stopping - this is a RETURN TO PARENT
@@ -742,6 +791,9 @@ block() {
742
791
  echo ""
743
792
  } >&2
744
793
 
794
+ # NOTE: No sound notification on block - sounds only play on SUCCESS
795
+ # When Claude is continuing work, user doesn't need to be notified
796
+
745
797
  if [ -n "$system_message" ]; then
746
798
  # Escape special characters for JSON
747
799
  local escaped_message=$(echo "$system_message" | jq -Rs .)