@hivehub/rulebook 3.2.1 → 3.3.1
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/commands/rulebook-task-apply.md +2 -2
- package/.claude/commands/rulebook-task-archive.md +3 -3
- package/.claude/commands/rulebook-task-create.md +4 -4
- package/.claude/commands/rulebook-task-list.md +2 -2
- package/.claude/commands/rulebook-task-show.md +2 -2
- package/.claude/commands/rulebook-task-validate.md +2 -2
- package/.claude-plugin/marketplace.json +29 -29
- package/.claude-plugin/plugin.json +8 -8
- package/README.md +8 -8
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +328 -33
- package/dist/cli/commands.js.map +1 -1
- package/dist/core/config-manager.d.ts +10 -0
- package/dist/core/config-manager.d.ts.map +1 -1
- package/dist/core/config-manager.js +118 -0
- package/dist/core/config-manager.js.map +1 -1
- package/dist/core/generator.js +10 -10
- package/dist/core/generator.js.map +1 -1
- package/dist/core/migrator.d.ts.map +1 -1
- package/dist/core/migrator.js +3 -3
- package/dist/core/migrator.js.map +1 -1
- package/dist/core/openspec-manager.d.ts +2 -2
- package/dist/core/openspec-manager.d.ts.map +1 -1
- package/dist/core/openspec-manager.js +5 -14
- package/dist/core/openspec-manager.js.map +1 -1
- package/dist/core/openspec-migrator.d.ts.map +1 -1
- package/dist/core/openspec-migrator.js +3 -3
- package/dist/core/openspec-migrator.js.map +1 -1
- package/dist/core/prd-generator.d.ts.map +1 -1
- package/dist/core/prd-generator.js +2 -1
- package/dist/core/prd-generator.js.map +1 -1
- package/dist/core/ralph-manager.d.ts +9 -1
- package/dist/core/ralph-manager.d.ts.map +1 -1
- package/dist/core/ralph-manager.js +56 -2
- package/dist/core/ralph-manager.js.map +1 -1
- package/dist/core/task-manager.d.ts.map +1 -1
- package/dist/core/task-manager.js +2 -2
- package/dist/core/task-manager.js.map +1 -1
- package/dist/core/validator.js +6 -6
- package/dist/core/validator.js.map +1 -1
- package/dist/mcp/rulebook-server.d.ts.map +1 -1
- package/dist/mcp/rulebook-server.js +152 -20
- package/dist/mcp/rulebook-server.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/templates/commands/rulebook-task-apply.md +2 -2
- package/templates/commands/rulebook-task-archive.md +3 -3
- package/templates/commands/rulebook-task-create.md +4 -4
- package/templates/commands/rulebook-task-list.md +2 -2
- package/templates/commands/rulebook-task-show.md +2 -2
- package/templates/commands/rulebook-task-validate.md +2 -2
- package/templates/core/RALPH.md +2 -2
- package/templates/core/RULEBOOK.md +13 -13
- package/templates/git/CI_CD_PATTERNS.md +4 -4
- package/templates/git/GITHUB_ACTIONS.md +3 -3
- package/templates/git/GITLAB_CI.md +4 -4
- package/templates/git/SECRETS_MANAGEMENT.md +4 -4
- package/templates/hooks/COMMIT_MSG.md +4 -4
- package/templates/hooks/POST_CHECKOUT.md +3 -3
- package/templates/hooks/PREPARE_COMMIT_MSG.md +3 -3
- package/templates/hooks/PRE_COMMIT.md +4 -4
- package/templates/hooks/PRE_PUSH.md +4 -4
- package/templates/skills/cli/aider/SKILL.md +10 -10
- package/templates/skills/cli/amazon-q/SKILL.md +10 -10
- package/templates/skills/cli/auggie/SKILL.md +10 -10
- package/templates/skills/cli/claude/SKILL.md +10 -10
- package/templates/skills/cli/claude-code/SKILL.md +146 -146
- package/templates/skills/cli/cline/SKILL.md +10 -10
- package/templates/skills/cli/codebuddy/SKILL.md +10 -10
- package/templates/skills/cli/codeium/SKILL.md +10 -10
- package/templates/skills/cli/codex/SKILL.md +10 -10
- package/templates/skills/cli/continue/SKILL.md +10 -10
- package/templates/skills/cli/cursor-cli/SKILL.md +10 -10
- package/templates/skills/cli/factory/SKILL.md +10 -10
- package/templates/skills/cli/gemini/SKILL.md +10 -10
- package/templates/skills/cli/kilocode/SKILL.md +10 -10
- package/templates/skills/cli/opencode/SKILL.md +10 -10
- package/templates/skills/core/agent-automation/SKILL.md +10 -10
- package/templates/skills/core/dag/SKILL.md +10 -10
- package/templates/skills/core/documentation-rules/SKILL.md +10 -10
- package/templates/skills/core/quality-enforcement/SKILL.md +10 -10
- package/templates/skills/core/rulebook/SKILL.md +1 -1
- package/templates/skills/frameworks/angular/SKILL.md +10 -10
- package/templates/skills/frameworks/django/SKILL.md +10 -10
- package/templates/skills/frameworks/electron/SKILL.md +10 -10
- package/templates/skills/frameworks/flask/SKILL.md +10 -10
- package/templates/skills/frameworks/flutter/SKILL.md +10 -10
- package/templates/skills/frameworks/jquery/SKILL.md +10 -10
- package/templates/skills/frameworks/laravel/SKILL.md +10 -10
- package/templates/skills/frameworks/nestjs/SKILL.md +10 -10
- package/templates/skills/frameworks/nextjs/SKILL.md +10 -10
- package/templates/skills/frameworks/nuxt/SKILL.md +10 -10
- package/templates/skills/frameworks/rails/SKILL.md +10 -10
- package/templates/skills/frameworks/react/SKILL.md +10 -10
- package/templates/skills/frameworks/react-native/SKILL.md +10 -10
- package/templates/skills/frameworks/spring/SKILL.md +10 -10
- package/templates/skills/frameworks/symfony/SKILL.md +10 -10
- package/templates/skills/frameworks/vue/SKILL.md +10 -10
- package/templates/skills/frameworks/zend/SKILL.md +10 -10
- package/templates/skills/ides/copilot/SKILL.md +10 -10
- package/templates/skills/ides/cursor/SKILL.md +10 -10
- package/templates/skills/ides/jetbrains-ai/SKILL.md +10 -10
- package/templates/skills/ides/replit/SKILL.md +10 -10
- package/templates/skills/ides/tabnine/SKILL.md +10 -10
- package/templates/skills/ides/vscode/SKILL.md +10 -10
- package/templates/skills/ides/windsurf/SKILL.md +10 -10
- package/templates/skills/ides/zed/SKILL.md +10 -10
- package/templates/skills/languages/ada/SKILL.md +68 -68
- package/templates/skills/languages/c/SKILL.md +10 -10
- package/templates/skills/languages/cpp/SKILL.md +10 -10
- package/templates/skills/languages/csharp/SKILL.md +10 -10
- package/templates/skills/languages/dart/SKILL.md +342 -342
- package/templates/skills/languages/elixir/SKILL.md +10 -10
- package/templates/skills/languages/erlang/SKILL.md +10 -10
- package/templates/skills/languages/go/SKILL.md +10 -10
- package/templates/skills/languages/haskell/SKILL.md +10 -10
- package/templates/skills/languages/java/SKILL.md +10 -10
- package/templates/skills/languages/javascript/SKILL.md +10 -10
- package/templates/skills/languages/julia/SKILL.md +10 -10
- package/templates/skills/languages/kotlin/SKILL.md +10 -10
- package/templates/skills/languages/lisp/SKILL.md +10 -10
- package/templates/skills/languages/lua/SKILL.md +10 -10
- package/templates/skills/languages/objectivec/SKILL.md +10 -10
- package/templates/skills/languages/php/SKILL.md +10 -10
- package/templates/skills/languages/python/SKILL.md +10 -10
- package/templates/skills/languages/r/SKILL.md +360 -360
- package/templates/skills/languages/ruby/SKILL.md +10 -10
- package/templates/skills/languages/rust/SKILL.md +10 -10
- package/templates/skills/languages/sas/SKILL.md +10 -10
- package/templates/skills/languages/scala/SKILL.md +10 -10
- package/templates/skills/languages/solidity/SKILL.md +10 -10
- package/templates/skills/languages/sql/SKILL.md +10 -10
- package/templates/skills/languages/swift/SKILL.md +10 -10
- package/templates/skills/languages/zig/SKILL.md +10 -10
- package/templates/skills/modules/atlassian/SKILL.md +10 -10
- package/templates/skills/modules/context7/SKILL.md +10 -10
- package/templates/skills/modules/figma/SKILL.md +10 -10
- package/templates/skills/modules/github-mcp/SKILL.md +10 -10
- package/templates/skills/modules/grafana/SKILL.md +10 -10
- package/templates/skills/modules/memory/SKILL.md +10 -10
- package/templates/skills/modules/notion/SKILL.md +10 -10
- package/templates/skills/modules/playwright/SKILL.md +10 -10
- package/templates/skills/modules/rulebook-mcp/SKILL.md +10 -10
- package/templates/skills/modules/serena/SKILL.md +10 -10
- package/templates/skills/modules/supabase/SKILL.md +10 -10
- package/templates/skills/modules/synap/SKILL.md +10 -10
- package/templates/skills/modules/vectorizer/SKILL.md +10 -10
- package/templates/skills/services/azure-blob/SKILL.md +10 -10
- package/templates/skills/services/cassandra/SKILL.md +10 -10
- package/templates/skills/services/dynamodb/SKILL.md +10 -10
- package/templates/skills/services/elasticsearch/SKILL.md +10 -10
- package/templates/skills/services/gcs/SKILL.md +10 -10
- package/templates/skills/services/influxdb/SKILL.md +10 -10
- package/templates/skills/services/kafka/SKILL.md +10 -10
- package/templates/skills/services/mariadb/SKILL.md +10 -10
- package/templates/skills/services/memcached/SKILL.md +10 -10
- package/templates/skills/services/minio/SKILL.md +10 -10
- package/templates/skills/services/mongodb/SKILL.md +10 -10
- package/templates/skills/services/mysql/SKILL.md +10 -10
- package/templates/skills/services/neo4j/SKILL.md +10 -10
- package/templates/skills/services/oracle/SKILL.md +10 -10
- package/templates/skills/services/postgresql/SKILL.md +10 -10
- package/templates/skills/services/rabbitmq/SKILL.md +10 -10
- package/templates/skills/services/redis/SKILL.md +10 -10
- package/templates/skills/services/s3/SKILL.md +10 -10
- package/templates/skills/services/sqlite/SKILL.md +10 -10
- package/templates/skills/services/sqlserver/SKILL.md +10 -10
- package/templates/skills/workflows/ralph/SETUP.md +228 -228
- package/templates/skills/workflows/ralph/SKILL.md +1 -1
- package/templates/skills/workflows/ralph/install.sh +1 -1
|
@@ -1,228 +1,228 @@
|
|
|
1
|
-
# Ralph Autonomous Loop Setup Guide
|
|
2
|
-
|
|
3
|
-
## Installation
|
|
4
|
-
|
|
5
|
-
Ralph is installed as part of `@hivehub/rulebook`. To enable it as a Claude Code skill:
|
|
6
|
-
|
|
7
|
-
### Option 1: Automatic Installation (Recommended)
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
# During project initialization
|
|
11
|
-
rulebook init
|
|
12
|
-
# → Select "Ralph Autonomous Loop" when prompted for skills
|
|
13
|
-
|
|
14
|
-
# Or enable existing project
|
|
15
|
-
rulebook skill enable ralph-autonomous-loop
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### Option 2: Manual Installation
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
# 1. Install rulebook (if not already installed)
|
|
22
|
-
npm install -g @hivehub/rulebook
|
|
23
|
-
|
|
24
|
-
# 2. Run the Ralph skill setup
|
|
25
|
-
bash templates/skills/workflows/ralph/install.sh
|
|
26
|
-
|
|
27
|
-
# 3. Verify installation
|
|
28
|
-
cat .rulebook | grep -A 5 '"ralph"'
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Claude Code Integration
|
|
32
|
-
|
|
33
|
-
### Configuration in .cursorrules
|
|
34
|
-
|
|
35
|
-
Ralph skill automatically adds to `.cursorrules`:
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
## Ralph Autonomous Loop
|
|
39
|
-
|
|
40
|
-
When working with Ralph autonomous loop:
|
|
41
|
-
|
|
42
|
-
1. **Before each iteration**:
|
|
43
|
-
- Read .rulebook-ralph/prd.json for task specifications
|
|
44
|
-
- Read .rulebook-ralph/progress.txt for past learnings
|
|
45
|
-
- Reference recent git commits for architectural context
|
|
46
|
-
|
|
47
|
-
2. **During implementation**:
|
|
48
|
-
- Focus on ONE task from PRD
|
|
49
|
-
- Apply patterns from progress.txt
|
|
50
|
-
- Write tests first (95%+ coverage required)
|
|
51
|
-
|
|
52
|
-
3. **After implementation**:
|
|
53
|
-
- Run quality gates: type-check, lint, tests, coverage
|
|
54
|
-
- Commit with clear message including iteration number
|
|
55
|
-
- Ralph will update progress.txt with learnings
|
|
56
|
-
|
|
57
|
-
4. **Commands**:
|
|
58
|
-
- Check status: rulebook ralph status
|
|
59
|
-
- View history: rulebook ralph history
|
|
60
|
-
- Pause loop: rulebook ralph pause (Ctrl+C)
|
|
61
|
-
- Resume: rulebook ralph resume
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Enabling in Claude Code
|
|
65
|
-
|
|
66
|
-
When you run `npx init` or `rulebook init`, Claude Code will:
|
|
67
|
-
|
|
68
|
-
1. ✅ Detect Ralph skill in `.rulebook` configuration
|
|
69
|
-
2. ✅ Register Ralph commands and MCP tools
|
|
70
|
-
3. ✅ Load Ralph documentation into context
|
|
71
|
-
4. ✅ Enable Ralph-specific prompting
|
|
72
|
-
|
|
73
|
-
### Using Ralph in Claude Code
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
# After initialization, Ralph is available via:
|
|
77
|
-
rulebook ralph <command>
|
|
78
|
-
|
|
79
|
-
# Example workflow:
|
|
80
|
-
1. Create tasks
|
|
81
|
-
2. Initialize Ralph
|
|
82
|
-
3. Run autonomous loop
|
|
83
|
-
4. Monitor progress
|
|
84
|
-
5. Review and deploy
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Configuration
|
|
88
|
-
|
|
89
|
-
### .rulebook Configuration
|
|
90
|
-
|
|
91
|
-
```json
|
|
92
|
-
{
|
|
93
|
-
"ralph": {
|
|
94
|
-
"enabled": true,
|
|
95
|
-
"maxIterations": 10,
|
|
96
|
-
"tool": "claude",
|
|
97
|
-
"maxContextLoss": 3
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
**Options**:
|
|
103
|
-
- `enabled` (boolean): Enable Ralph autonomous loop
|
|
104
|
-
- `maxIterations` (number): Max iterations before stopping
|
|
105
|
-
- `tool` (string): AI CLI tool ("claude", "amp", "gemini")
|
|
106
|
-
- `maxContextLoss` (number): Tolerance for incomplete outputs
|
|
107
|
-
|
|
108
|
-
### Directory Structure
|
|
109
|
-
|
|
110
|
-
Ralph creates and uses:
|
|
111
|
-
|
|
112
|
-
```
|
|
113
|
-
.rulebook-ralph/
|
|
114
|
-
├── prd.json # Task specifications (auto-generated)
|
|
115
|
-
├── progress.txt # Append-only learning log
|
|
116
|
-
└── history/ # Per-iteration metadata
|
|
117
|
-
├── iteration-1.json
|
|
118
|
-
├── iteration-2.json
|
|
119
|
-
└── ...
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
## Quick Start
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
# 1. Create tasks (can be multiple)
|
|
126
|
-
rulebook task create implement-auth
|
|
127
|
-
rulebook task create add-api-endpoints
|
|
128
|
-
rulebook task create write-tests
|
|
129
|
-
|
|
130
|
-
# 2. Initialize Ralph
|
|
131
|
-
rulebook ralph init
|
|
132
|
-
# → Creates .rulebook-ralph/prd.json from tasks
|
|
133
|
-
# → Initializes progress.txt
|
|
134
|
-
|
|
135
|
-
# 3. Start autonomous loop
|
|
136
|
-
rulebook ralph run --max-iterations 10
|
|
137
|
-
# → Ralph picks first task
|
|
138
|
-
# → Runs Claude Code to implement
|
|
139
|
-
# → Runs quality checks
|
|
140
|
-
# → Updates task status and progress.txt
|
|
141
|
-
# → Repeats for next task
|
|
142
|
-
|
|
143
|
-
# 4. Monitor progress
|
|
144
|
-
rulebook ralph status # Current status
|
|
145
|
-
rulebook ralph history # Iteration history
|
|
146
|
-
rulebook ralph history --learnings # What was learned
|
|
147
|
-
|
|
148
|
-
# 5. Pause/resume if needed
|
|
149
|
-
rulebook ralph pause # Gracefully pause
|
|
150
|
-
rulebook ralph resume # Continue later
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
## MCP Server Integration
|
|
154
|
-
|
|
155
|
-
Ralph commands are available via MCP for programmatic use:
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
# Start MCP server
|
|
159
|
-
rulebook-mcp
|
|
160
|
-
|
|
161
|
-
# Available tools:
|
|
162
|
-
# - rulebook_ralph_init: Initialize Ralph
|
|
163
|
-
# - rulebook_ralph_run: Start autonomous loop
|
|
164
|
-
# - rulebook_ralph_status: Query loop status
|
|
165
|
-
# - rulebook_ralph_get_iteration_history: Fetch history
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
## Troubleshooting
|
|
169
|
-
|
|
170
|
-
### Ralph not found after installation
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
# Ensure @hivehub/rulebook is installed
|
|
174
|
-
npm list -g @hivehub/rulebook
|
|
175
|
-
|
|
176
|
-
# If not installed
|
|
177
|
-
npm install -g @hivehub/rulebook
|
|
178
|
-
|
|
179
|
-
# Verify Ralph skill is registered
|
|
180
|
-
rulebook skill list | grep ralph
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
### .rulebook configuration not created
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
# Run init if not already done
|
|
187
|
-
rulebook init
|
|
188
|
-
|
|
189
|
-
# Manually enable Ralph
|
|
190
|
-
rulebook skill enable ralph-autonomous-loop
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### Claude Code not recognizing Ralph commands
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
# Ensure .cursorrules is updated
|
|
197
|
-
cat .cursorrules | grep -i ralph
|
|
198
|
-
|
|
199
|
-
# Manually add Ralph section if missing
|
|
200
|
-
echo "
|
|
201
|
-
## Ralph Autonomous Loop
|
|
202
|
-
[See SKILL.md for full content]
|
|
203
|
-
" >> .cursorrules
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
## Next Steps
|
|
207
|
-
|
|
208
|
-
1. **Read SKILL.md** — Full documentation
|
|
209
|
-
2. **Review manifest.json** — Complete skill specification
|
|
210
|
-
3. **Run examples** — Try the quick start commands
|
|
211
|
-
4. **Monitor iterations** — Use `rulebook ralph history`
|
|
212
|
-
5. **Customize** — Adjust maxIterations, tool, etc. in .rulebook
|
|
213
|
-
|
|
214
|
-
## Documentation
|
|
215
|
-
|
|
216
|
-
- **SKILL.md** — Complete Ralph skill documentation
|
|
217
|
-
- **manifest.json** — Skill specification and metadata
|
|
218
|
-
- **install.sh** — Installation/setup script
|
|
219
|
-
- **SETUP.md** — This file
|
|
220
|
-
|
|
221
|
-
## Support
|
|
222
|
-
|
|
223
|
-
For issues or questions:
|
|
224
|
-
|
|
225
|
-
- Check `rulebook ralph --help`
|
|
226
|
-
- Review `rulebook ralph history` for error messages
|
|
227
|
-
- See [Ralph GitHub](https://github.com/snarktank/ralph) for pattern details
|
|
228
|
-
- Check [Rulebook docs](https://github.com/hivellm/rulebook) for CLI reference
|
|
1
|
+
# Ralph Autonomous Loop Setup Guide
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
Ralph is installed as part of `@hivehub/rulebook`. To enable it as a Claude Code skill:
|
|
6
|
+
|
|
7
|
+
### Option 1: Automatic Installation (Recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# During project initialization
|
|
11
|
+
rulebook init
|
|
12
|
+
# → Select "Ralph Autonomous Loop" when prompted for skills
|
|
13
|
+
|
|
14
|
+
# Or enable existing project
|
|
15
|
+
rulebook skill enable ralph-autonomous-loop
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Option 2: Manual Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# 1. Install rulebook (if not already installed)
|
|
22
|
+
npm install -g @hivehub/rulebook
|
|
23
|
+
|
|
24
|
+
# 2. Run the Ralph skill setup
|
|
25
|
+
bash templates/skills/workflows/ralph/install.sh
|
|
26
|
+
|
|
27
|
+
# 3. Verify installation
|
|
28
|
+
cat .rulebook | grep -A 5 '"ralph"'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Claude Code Integration
|
|
32
|
+
|
|
33
|
+
### Configuration in .cursorrules
|
|
34
|
+
|
|
35
|
+
Ralph skill automatically adds to `.cursorrules`:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
## Ralph Autonomous Loop
|
|
39
|
+
|
|
40
|
+
When working with Ralph autonomous loop:
|
|
41
|
+
|
|
42
|
+
1. **Before each iteration**:
|
|
43
|
+
- Read .rulebook-ralph/prd.json for task specifications
|
|
44
|
+
- Read .rulebook-ralph/progress.txt for past learnings
|
|
45
|
+
- Reference recent git commits for architectural context
|
|
46
|
+
|
|
47
|
+
2. **During implementation**:
|
|
48
|
+
- Focus on ONE task from PRD
|
|
49
|
+
- Apply patterns from progress.txt
|
|
50
|
+
- Write tests first (95%+ coverage required)
|
|
51
|
+
|
|
52
|
+
3. **After implementation**:
|
|
53
|
+
- Run quality gates: type-check, lint, tests, coverage
|
|
54
|
+
- Commit with clear message including iteration number
|
|
55
|
+
- Ralph will update progress.txt with learnings
|
|
56
|
+
|
|
57
|
+
4. **Commands**:
|
|
58
|
+
- Check status: rulebook ralph status
|
|
59
|
+
- View history: rulebook ralph history
|
|
60
|
+
- Pause loop: rulebook ralph pause (Ctrl+C)
|
|
61
|
+
- Resume: rulebook ralph resume
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Enabling in Claude Code
|
|
65
|
+
|
|
66
|
+
When you run `npx init` or `rulebook init`, Claude Code will:
|
|
67
|
+
|
|
68
|
+
1. ✅ Detect Ralph skill in `.rulebook` configuration
|
|
69
|
+
2. ✅ Register Ralph commands and MCP tools
|
|
70
|
+
3. ✅ Load Ralph documentation into context
|
|
71
|
+
4. ✅ Enable Ralph-specific prompting
|
|
72
|
+
|
|
73
|
+
### Using Ralph in Claude Code
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# After initialization, Ralph is available via:
|
|
77
|
+
rulebook ralph <command>
|
|
78
|
+
|
|
79
|
+
# Example workflow:
|
|
80
|
+
1. Create tasks
|
|
81
|
+
2. Initialize Ralph
|
|
82
|
+
3. Run autonomous loop
|
|
83
|
+
4. Monitor progress
|
|
84
|
+
5. Review and deploy
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Configuration
|
|
88
|
+
|
|
89
|
+
### .rulebook Configuration
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"ralph": {
|
|
94
|
+
"enabled": true,
|
|
95
|
+
"maxIterations": 10,
|
|
96
|
+
"tool": "claude",
|
|
97
|
+
"maxContextLoss": 3
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Options**:
|
|
103
|
+
- `enabled` (boolean): Enable Ralph autonomous loop
|
|
104
|
+
- `maxIterations` (number): Max iterations before stopping
|
|
105
|
+
- `tool` (string): AI CLI tool ("claude", "amp", "gemini")
|
|
106
|
+
- `maxContextLoss` (number): Tolerance for incomplete outputs
|
|
107
|
+
|
|
108
|
+
### Directory Structure
|
|
109
|
+
|
|
110
|
+
Ralph creates and uses:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
.rulebook-ralph/
|
|
114
|
+
├── prd.json # Task specifications (auto-generated)
|
|
115
|
+
├── progress.txt # Append-only learning log
|
|
116
|
+
└── history/ # Per-iteration metadata
|
|
117
|
+
├── iteration-1.json
|
|
118
|
+
├── iteration-2.json
|
|
119
|
+
└── ...
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Quick Start
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# 1. Create tasks (can be multiple)
|
|
126
|
+
rulebook task create implement-auth
|
|
127
|
+
rulebook task create add-api-endpoints
|
|
128
|
+
rulebook task create write-tests
|
|
129
|
+
|
|
130
|
+
# 2. Initialize Ralph
|
|
131
|
+
rulebook ralph init
|
|
132
|
+
# → Creates .rulebook-ralph/prd.json from tasks
|
|
133
|
+
# → Initializes progress.txt
|
|
134
|
+
|
|
135
|
+
# 3. Start autonomous loop
|
|
136
|
+
rulebook ralph run --max-iterations 10
|
|
137
|
+
# → Ralph picks first task
|
|
138
|
+
# → Runs Claude Code to implement
|
|
139
|
+
# → Runs quality checks
|
|
140
|
+
# → Updates task status and progress.txt
|
|
141
|
+
# → Repeats for next task
|
|
142
|
+
|
|
143
|
+
# 4. Monitor progress
|
|
144
|
+
rulebook ralph status # Current status
|
|
145
|
+
rulebook ralph history # Iteration history
|
|
146
|
+
rulebook ralph history --learnings # What was learned
|
|
147
|
+
|
|
148
|
+
# 5. Pause/resume if needed
|
|
149
|
+
rulebook ralph pause # Gracefully pause
|
|
150
|
+
rulebook ralph resume # Continue later
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## MCP Server Integration
|
|
154
|
+
|
|
155
|
+
Ralph commands are available via MCP for programmatic use:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Start MCP server
|
|
159
|
+
rulebook-mcp
|
|
160
|
+
|
|
161
|
+
# Available tools:
|
|
162
|
+
# - rulebook_ralph_init: Initialize Ralph
|
|
163
|
+
# - rulebook_ralph_run: Start autonomous loop
|
|
164
|
+
# - rulebook_ralph_status: Query loop status
|
|
165
|
+
# - rulebook_ralph_get_iteration_history: Fetch history
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Troubleshooting
|
|
169
|
+
|
|
170
|
+
### Ralph not found after installation
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# Ensure @hivehub/rulebook is installed
|
|
174
|
+
npm list -g @hivehub/rulebook
|
|
175
|
+
|
|
176
|
+
# If not installed
|
|
177
|
+
npm install -g @hivehub/rulebook
|
|
178
|
+
|
|
179
|
+
# Verify Ralph skill is registered
|
|
180
|
+
rulebook skill list | grep ralph
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### .rulebook configuration not created
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Run init if not already done
|
|
187
|
+
rulebook init
|
|
188
|
+
|
|
189
|
+
# Manually enable Ralph
|
|
190
|
+
rulebook skill enable ralph-autonomous-loop
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Claude Code not recognizing Ralph commands
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
# Ensure .cursorrules is updated
|
|
197
|
+
cat .cursorrules | grep -i ralph
|
|
198
|
+
|
|
199
|
+
# Manually add Ralph section if missing
|
|
200
|
+
echo "
|
|
201
|
+
## Ralph Autonomous Loop
|
|
202
|
+
[See SKILL.md for full content]
|
|
203
|
+
" >> .cursorrules
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Next Steps
|
|
207
|
+
|
|
208
|
+
1. **Read SKILL.md** — Full documentation
|
|
209
|
+
2. **Review manifest.json** — Complete skill specification
|
|
210
|
+
3. **Run examples** — Try the quick start commands
|
|
211
|
+
4. **Monitor iterations** — Use `rulebook ralph history`
|
|
212
|
+
5. **Customize** — Adjust maxIterations, tool, etc. in .rulebook
|
|
213
|
+
|
|
214
|
+
## Documentation
|
|
215
|
+
|
|
216
|
+
- **SKILL.md** — Complete Ralph skill documentation
|
|
217
|
+
- **manifest.json** — Skill specification and metadata
|
|
218
|
+
- **install.sh** — Installation/setup script
|
|
219
|
+
- **SETUP.md** — This file
|
|
220
|
+
|
|
221
|
+
## Support
|
|
222
|
+
|
|
223
|
+
For issues or questions:
|
|
224
|
+
|
|
225
|
+
- Check `rulebook ralph --help`
|
|
226
|
+
- Review `rulebook ralph history` for error messages
|
|
227
|
+
- See [Ralph GitHub](https://github.com/snarktank/ralph) for pattern details
|
|
228
|
+
- Check [Rulebook docs](https://github.com/hivellm/rulebook) for CLI reference
|
|
@@ -36,7 +36,7 @@ echo "📁 Creating Ralph directories..."
|
|
|
36
36
|
mkdir -p .rulebook-ralph/history
|
|
37
37
|
|
|
38
38
|
# Create initial PRD if tasks exist
|
|
39
|
-
if [ -d "rulebook/tasks" ] && [ "$(ls -A rulebook/tasks)" ]; then
|
|
39
|
+
if [ -d ".rulebook/tasks" ] && [ "$(ls -A .rulebook/tasks)" ]; then
|
|
40
40
|
echo "📋 Generating PRD from existing tasks..."
|
|
41
41
|
rulebook ralph init || echo "⚠️ Could not auto-generate PRD. Run: rulebook ralph init"
|
|
42
42
|
else
|