vibe-forge 0.8.3 → 0.8.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.
@@ -1,106 +1,106 @@
1
- ---
2
- description: Start a persistent worker loop (Ralph-style)
3
- argument-hint: <agent> [--max-idle 10] | stop
4
- ---
5
-
6
- # Worker Loop Command
7
-
8
- Start a persistent worker loop for the specified agent. The worker will:
9
- 1. Check for assigned tasks
10
- 2. Work on tasks until complete
11
- 3. Loop back and check for more tasks
12
- 4. Only exit after N idle checks with no work found
13
-
14
- ## Activation Modes
15
-
16
- Worker Loop can be activated in two ways:
17
-
18
- ### 1. Config-based (Recommended)
19
-
20
- Enable during `forge init` or toggle anytime:
21
-
22
- ```bash
23
- forge config worker-loop on # Enable for all workers
24
- forge config worker-loop off # Disable
25
- forge config worker-loop # Check status
26
- ```
27
-
28
- When enabled, ALL workers will automatically stay running and check for new tasks.
29
-
30
- ### 2. Runtime (Per-session)
31
-
32
- Use this command for fine-grained control:
33
-
34
- ```
35
- /worker-loop anvil # Start Anvil in persistent loop
36
- /worker-loop furnace --max-idle 20 # Custom idle limit
37
- /worker-loop stop # Stop the current loop
38
- ```
39
-
40
- ## Arguments
41
-
42
- - `$1` - Agent name (anvil, furnace, crucible, etc.) or "stop"
43
- - `--max-idle N` - Exit after N checks with no tasks (default: 10)
44
-
45
- ## Implementation
46
-
47
- Based on `$ARGUMENTS`:
48
-
49
- ### If first argument is "stop"
50
-
51
- Remove the worker loop state file and confirm:
52
-
53
- ```bash
54
- rm -f "${CLAUDE_LOCAL_DIR:-$HOME/.claude}/forge-worker-loop.json"
55
- ```
56
-
57
- Output: "Worker loop stopped."
58
-
59
- ### Otherwise, start a loop
60
-
61
- 1. Resolve the agent name to canonical form
62
- 2. Create state file at `${CLAUDE_LOCAL_DIR}/forge-worker-loop.json`:
63
-
64
- ```json
65
- {
66
- "agent": "<resolved-agent>",
67
- "max_idle_checks": 10,
68
- "idle_count": 0,
69
- "poll_interval": 5,
70
- "started_at": "<ISO timestamp>"
71
- }
72
- ```
73
-
74
- 3. Load the agent's personality file
75
- 4. Start working with this system prompt addition:
76
-
77
- ```
78
- You are in PERSISTENT WORKER MODE. After completing each task:
79
- 1. Check for more tasks assigned to you in tasks/pending/ and tasks/needs-changes/
80
- 2. If tasks found, immediately begin working
81
- 3. If no tasks, announce you are idle and waiting
82
-
83
- Do NOT ask permission to continue - work autonomously until no tasks remain.
84
- ```
85
-
86
- 5. The stop hook (hooks/worker-loop.js) will intercept exit attempts and:
87
- - If tasks exist: feed prompt to continue working
88
- - If no tasks: increment idle counter
89
- - If max idle reached: allow exit
90
-
91
- ## How It Works
92
-
93
- The Worker Loop uses Claude Code's **Stop Hook** feature:
94
-
95
- 1. When a worker tries to exit, the hook script runs
96
- 2. It checks for pending tasks in `tasks/pending/` and `tasks/needs-changes/`
97
- 3. If tasks found: blocks exit and feeds a prompt to continue working
98
- 4. If no tasks: allows exit (or waits, depending on config)
99
-
100
- ## Benefits
101
-
102
- - Workers stay active and pick up new tasks automatically
103
- - No need to manually respawn workers
104
- - Tasks can be added to pending/ and workers will find them
105
- - Config-based mode requires zero per-session setup
106
- - Configurable idle timeout prevents infinite waiting
1
+ ---
2
+ description: Start a persistent worker loop (Ralph-style)
3
+ argument-hint: <agent> [--max-idle 10] | stop
4
+ ---
5
+
6
+ # Worker Loop Command
7
+
8
+ Start a persistent worker loop for the specified agent. The worker will:
9
+ 1. Check for assigned tasks
10
+ 2. Work on tasks until complete
11
+ 3. Loop back and check for more tasks
12
+ 4. Only exit after N idle checks with no work found
13
+
14
+ ## Activation Modes
15
+
16
+ Worker Loop can be activated in two ways:
17
+
18
+ ### 1. Config-based (Recommended)
19
+
20
+ Enable during `forge init` or toggle anytime:
21
+
22
+ ```bash
23
+ forge config worker-loop on # Enable for all workers
24
+ forge config worker-loop off # Disable
25
+ forge config worker-loop # Check status
26
+ ```
27
+
28
+ When enabled, ALL workers will automatically stay running and check for new tasks.
29
+
30
+ ### 2. Runtime (Per-session)
31
+
32
+ Use this command for fine-grained control:
33
+
34
+ ```
35
+ /worker-loop anvil # Start Anvil in persistent loop
36
+ /worker-loop furnace --max-idle 20 # Custom idle limit
37
+ /worker-loop stop # Stop the current loop
38
+ ```
39
+
40
+ ## Arguments
41
+
42
+ - `$1` - Agent name (anvil, furnace, crucible, etc.) or "stop"
43
+ - `--max-idle N` - Exit after N checks with no tasks (default: 10)
44
+
45
+ ## Implementation
46
+
47
+ Based on `$ARGUMENTS`:
48
+
49
+ ### If first argument is "stop"
50
+
51
+ Remove the worker loop state file and confirm:
52
+
53
+ ```bash
54
+ rm -f "${CLAUDE_LOCAL_DIR:-$HOME/.claude}/forge-worker-loop.json"
55
+ ```
56
+
57
+ Output: "Worker loop stopped."
58
+
59
+ ### Otherwise, start a loop
60
+
61
+ 1. Resolve the agent name to canonical form
62
+ 2. Create state file at `${CLAUDE_LOCAL_DIR}/forge-worker-loop.json`:
63
+
64
+ ```json
65
+ {
66
+ "agent": "<resolved-agent>",
67
+ "max_idle_checks": 10,
68
+ "idle_count": 0,
69
+ "poll_interval": 5,
70
+ "started_at": "<ISO timestamp>"
71
+ }
72
+ ```
73
+
74
+ 3. Load the agent's personality file
75
+ 4. Start working with this system prompt addition:
76
+
77
+ ```
78
+ You are in PERSISTENT WORKER MODE. After completing each task:
79
+ 1. Check for more tasks assigned to you in tasks/pending/ and tasks/needs-changes/
80
+ 2. If tasks found, immediately begin working
81
+ 3. If no tasks, announce you are idle and waiting
82
+
83
+ Do NOT ask permission to continue - work autonomously until no tasks remain.
84
+ ```
85
+
86
+ 5. The stop hook (hooks/worker-loop.js) will intercept exit attempts and:
87
+ - If tasks exist: feed prompt to continue working
88
+ - If no tasks: increment idle counter
89
+ - If max idle reached: allow exit
90
+
91
+ ## How It Works
92
+
93
+ The Worker Loop uses Claude Code's **Stop Hook** feature:
94
+
95
+ 1. When a worker tries to exit, the hook script runs
96
+ 2. It checks for pending tasks in `tasks/pending/` and `tasks/needs-changes/`
97
+ 3. If tasks found: blocks exit and feeds a prompt to continue working
98
+ 4. If no tasks: allows exit (or waits, depending on config)
99
+
100
+ ## Benefits
101
+
102
+ - Workers stay active and pick up new tasks automatically
103
+ - No need to manually respawn workers
104
+ - Tasks can be added to pending/ and workers will find them
105
+ - Config-based mode requires zero per-session setup
106
+ - Configurable idle timeout prevents infinite waiting
@@ -1,45 +1,45 @@
1
- #!/usr/bin/env bash
2
- #
3
- # Setup Worker Loop
4
- # Creates state file to enable the worker loop stop hook
5
- #
6
-
7
- set -euo pipefail
8
-
9
- AGENT="${1:-}"
10
- MAX_IDLE="${2:-10}"
11
- STATE_DIR="${CLAUDE_LOCAL_DIR:-$HOME/.claude}"
12
- STATE_FILE="$STATE_DIR/forge-worker-loop.json"
13
-
14
- if [[ "$AGENT" == "stop" ]]; then
15
- if [[ -f "$STATE_FILE" ]]; then
16
- rm -f "$STATE_FILE"
17
- echo "Worker loop stopped."
18
- else
19
- echo "No active worker loop."
20
- fi
21
- exit 0
22
- fi
23
-
24
- if [[ -z "$AGENT" ]]; then
25
- echo "Usage: setup-worker-loop.sh <agent> [max-idle-checks]"
26
- echo " setup-worker-loop.sh stop"
27
- exit 1
28
- fi
29
-
30
- # Ensure state directory exists
31
- mkdir -p "$STATE_DIR"
32
-
33
- # Create state file
34
- cat > "$STATE_FILE" << EOF
35
- {
36
- "agent": "$AGENT",
37
- "max_idle_checks": $MAX_IDLE,
38
- "idle_count": 0,
39
- "poll_interval": 5,
40
- "started_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
41
- }
42
- EOF
43
-
44
- echo "Worker loop started for $AGENT (max idle: $MAX_IDLE checks)"
45
- echo "State file: $STATE_FILE"
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Setup Worker Loop
4
+ # Creates state file to enable the worker loop stop hook
5
+ #
6
+
7
+ set -euo pipefail
8
+
9
+ AGENT="${1:-}"
10
+ MAX_IDLE="${2:-10}"
11
+ STATE_DIR="${CLAUDE_LOCAL_DIR:-$HOME/.claude}"
12
+ STATE_FILE="$STATE_DIR/forge-worker-loop.json"
13
+
14
+ if [[ "$AGENT" == "stop" ]]; then
15
+ if [[ -f "$STATE_FILE" ]]; then
16
+ rm -f "$STATE_FILE"
17
+ echo "Worker loop stopped."
18
+ else
19
+ echo "No active worker loop."
20
+ fi
21
+ exit 0
22
+ fi
23
+
24
+ if [[ -z "$AGENT" ]]; then
25
+ echo "Usage: setup-worker-loop.sh <agent> [max-idle-checks]"
26
+ echo " setup-worker-loop.sh stop"
27
+ exit 1
28
+ fi
29
+
30
+ # Ensure state directory exists
31
+ mkdir -p "$STATE_DIR"
32
+
33
+ # Create state file
34
+ cat > "$STATE_FILE" << EOF
35
+ {
36
+ "agent": "$AGENT",
37
+ "max_idle_checks": $MAX_IDLE,
38
+ "idle_count": 0,
39
+ "poll_interval": 5,
40
+ "started_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
41
+ }
42
+ EOF
43
+
44
+ echo "Worker loop started for $AGENT (max idle: $MAX_IDLE checks)"
45
+ echo "State file: $STATE_FILE"
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 sugar-crash-studios
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 sugar-crash-studios
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.