@graypark/loophaus 3.8.1 → 3.9.0
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/README.ko.md +145 -220
- package/README.md +93 -86
- package/dist/README.ko.md +145 -220
- package/dist/README.md +93 -86
- package/dist/bin/loophaus.js +93 -1
- package/dist/package.json +14 -7
- package/package.json +14 -7
package/README.md
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
<a href="https://github.com/vcz-Gray/loophaus/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="license" /></a>
|
|
11
11
|
<img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg?style=flat-square" alt="node version" />
|
|
12
12
|
<img src="https://img.shields.io/badge/platform-Claude%20Code%20%7C%20Codex%20CLI%20%7C%20Kiro%20CLI-purple.svg?style=flat-square" alt="platform" />
|
|
13
|
-
<img src="https://img.shields.io/badge/tests-
|
|
13
|
+
<img src="https://img.shields.io/badge/tests-359%20passing-brightgreen.svg?style=flat-square" alt="tests" />
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
|
-
<h3 align="center">
|
|
16
|
+
<h3 align="center">Run AI coding agents in autonomous loops — fresh context each iteration, PRD-tracked progress, automatic quality gates.</h3>
|
|
17
17
|
|
|
18
18
|
<p align="center">
|
|
19
19
|
<sub>Based on <a href="https://ghuntley.com/ralph/">Geoffrey Huntley's Ralph Wiggum technique</a></sub>
|
|
@@ -21,26 +21,55 @@
|
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## The Problem
|
|
25
25
|
|
|
26
|
-
AI coding agents struggle with
|
|
26
|
+
AI coding agents struggle with long tasks:
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- **Fresh context per iteration** — Each cycle reads PRD + progress from disk, zero degradation
|
|
39
|
-
- **Git-enforced safety** — Atomic commits per story, rollback at any point
|
|
40
|
-
- **Append-only learnings** — `progress.txt` accumulates knowledge across iterations
|
|
41
|
-
- **Test-verified completion** — Agent can only exit when `<promise>COMPLETE</promise>` is genuinely true
|
|
28
|
+
- **Context rot** — agent gets confused after 10+ iterations
|
|
29
|
+
- **Goal drift** — agent forgets the spec and solves the wrong problem
|
|
30
|
+
- **No quality signal** — agent says "done" but tests still fail
|
|
31
|
+
- **Token waste** — you re-explain the same context every time
|
|
32
|
+
|
|
33
|
+
## The Solution
|
|
34
|
+
|
|
35
|
+
- **Fresh context per iteration** — Each cycle reads PRD + progress from disk, zero degradation even after 20+ iterations
|
|
36
|
+
- **PRD-linked progress tracking** — Stories are tracked in `prd.json` with pass/fail state, not "I think I'm done"
|
|
37
|
+
- **Quality scoring with keep/discard** — Autoresearch-inspired refinement loop measures quality (0-100) and reverts regressions
|
|
42
38
|
- **Universal stop hook** — One Node.js hook works across Claude Code, Codex CLI, and Kiro CLI
|
|
43
39
|
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install -g @graypark/loophaus
|
|
44
|
+
loophaus install
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
> **Note:** `npx @graypark/loophaus install` may fail on some npm versions due to a bin resolution cache bug. Use the global install above for reliable setup.
|
|
48
|
+
|
|
49
|
+
The installer auto-detects your host (Claude Code, Codex CLI, or Kiro CLI) and sets up everything — stop hook, commands, and skills.
|
|
50
|
+
|
|
51
|
+
Then in your AI coding session:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
/loop-plan Add user authentication with JWT, bcrypt, and login UI
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
That's it. The interview generates a PRD, activates the loop, and starts implementing story by story.
|
|
58
|
+
|
|
59
|
+
## Safety
|
|
60
|
+
|
|
61
|
+
- Every iteration creates a **git checkpoint** — atomic revert anytime
|
|
62
|
+
- **Max iterations limit** (default 20, configurable)
|
|
63
|
+
- **Quality threshold = circuit breaker** — score < 80 triggers refine or stop
|
|
64
|
+
- **Cost tracking** with policy enforcement (max $5, max 30 min)
|
|
65
|
+
- `loophaus clean` for data lifecycle management
|
|
66
|
+
|
|
67
|
+
## Why not just script this?
|
|
68
|
+
|
|
69
|
+
1. **Fresh context isolation** — no degradation after 20 iterations; each cycle starts from disk, not from a decaying conversation
|
|
70
|
+
2. **PRD-linked progress tracking** — structured `prd.json` with pass/fail per story, not "I think I'm done"
|
|
71
|
+
3. **Quality scoring with keep/discard** — autoresearch pattern: measure, keep improvements, revert regressions
|
|
72
|
+
|
|
44
73
|
## How it works
|
|
45
74
|
|
|
46
75
|
An AI agent works on a task in a continuous loop. Each iteration starts with fresh context — reading the PRD and progress files to decide what to do next. The agent implements one story, commits, updates progress, and exits. The stop hook intercepts the exit and re-injects the prompt. Repeat until all stories pass.
|
|
@@ -80,33 +109,53 @@ An AI agent works on a task in a continuous loop. Each iteration starts with fre
|
|
|
80
109
|
└─────────────────────────────────┘
|
|
81
110
|
```
|
|
82
111
|
|
|
83
|
-
##
|
|
112
|
+
## Commands
|
|
84
113
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
114
|
+
| Command | Description |
|
|
115
|
+
|---------|-------------|
|
|
116
|
+
| `/loop-plan` | Interactive interview — asks targeted questions, generates PRD, activates loop |
|
|
117
|
+
| `/loop` | Start iterative dev loop directly (when you already have a PRD or custom prompt) |
|
|
118
|
+
| `/loop-stop` | Stop the active loop immediately |
|
|
119
|
+
| `/loop-pulse` | Check current loop status, iteration count, and progress |
|
|
89
120
|
|
|
90
|
-
|
|
121
|
+
## Quality Loop (v3.4.0+)
|
|
91
122
|
|
|
92
|
-
|
|
123
|
+
loophaus v3.4.0 introduces the **Quality Loop** — inspired by [karpathy/autoresearch](https://github.com/karpathy/autoresearch)'s experiment-measure-keep/discard pattern.
|
|
93
124
|
|
|
94
|
-
|
|
125
|
+
Instead of simply marking a story as "done" when tests pass, `/loop-plan` now **measures quality** (0-100) and **iteratively refines** until the score meets the threshold.
|
|
95
126
|
|
|
96
127
|
```
|
|
97
|
-
|
|
128
|
+
Phase 4: Implement
|
|
129
|
+
↓
|
|
130
|
+
Phase 5: Evaluate (score 0-100)
|
|
131
|
+
↓ ↑
|
|
132
|
+
Phase 6: Refine Loop
|
|
133
|
+
score improved? → keep (commit)
|
|
134
|
+
score declined? → discard (git reset)
|
|
135
|
+
max attempts reached? → move on
|
|
136
|
+
↓
|
|
137
|
+
Phase 7: Report (with quality scores)
|
|
98
138
|
```
|
|
99
139
|
|
|
100
|
-
|
|
140
|
+
| autoresearch | loophaus |
|
|
141
|
+
|-------------|----------|
|
|
142
|
+
| `val_bpb` | quality score (weighted: tests, typecheck, lint, verify, diff, custom) |
|
|
143
|
+
| `results.tsv` | `.loophaus/results.tsv` |
|
|
144
|
+
| keep → advance | score improved → commit |
|
|
145
|
+
| discard → revert | score declined → `git reset --hard` |
|
|
146
|
+
| NEVER STOP | max 3 attempts per story (configurable) |
|
|
101
147
|
|
|
102
|
-
|
|
148
|
+
### Configuration
|
|
103
149
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"qualityThreshold": 80,
|
|
153
|
+
"maxRefineAttempts": 3,
|
|
154
|
+
"qualityConfig": {
|
|
155
|
+
"weights": { "tests": 30, "typecheck": 25, "lint": 15, "verify": 15, "diff": 10, "custom": 5 }
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
110
159
|
|
|
111
160
|
## Platform Support
|
|
112
161
|
|
|
@@ -165,55 +214,13 @@ loophaus install # Install to detected host
|
|
|
165
214
|
loophaus status # Show current loop state and active host
|
|
166
215
|
loophaus stats # Iteration history and completion metrics
|
|
167
216
|
loophaus quality # Run quality scoring on current stories
|
|
217
|
+
loophaus demo # Run interactive demo
|
|
218
|
+
loophaus config # Show/edit configuration
|
|
219
|
+
loophaus update-check # Check for new versions
|
|
220
|
+
loophaus upgrade # Upgrade to latest version
|
|
168
221
|
loophaus uninstall # Clean removal from all hosts
|
|
169
222
|
```
|
|
170
223
|
|
|
171
|
-
## Quality Loop (v3.4.0+)
|
|
172
|
-
|
|
173
|
-
loophaus v3.4.0 introduces the **Quality Loop** — inspired by [karpathy/autoresearch](https://github.com/karpathy/autoresearch)'s experiment→measure→keep/discard pattern.
|
|
174
|
-
|
|
175
|
-
Instead of simply marking a story as "done" when tests pass, `/loop-plan` now **measures quality** (0-100) and **iteratively refines** until the score meets the threshold.
|
|
176
|
-
|
|
177
|
-
```
|
|
178
|
-
Phase 4: Implement
|
|
179
|
-
↓
|
|
180
|
-
Phase 5: Evaluate (score 0-100)
|
|
181
|
-
↓ ↑
|
|
182
|
-
Phase 6: Refine Loop
|
|
183
|
-
score improved? → keep (commit)
|
|
184
|
-
score declined? → discard (git reset)
|
|
185
|
-
max attempts reached? → move on
|
|
186
|
-
↓
|
|
187
|
-
Phase 7: Report (with quality scores)
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
| autoresearch | loophaus |
|
|
191
|
-
|-------------|----------|
|
|
192
|
-
| `val_bpb` | quality score (weighted: tests, typecheck, lint, verify, diff, custom) |
|
|
193
|
-
| `results.tsv` | `.loophaus/results.tsv` |
|
|
194
|
-
| keep → advance | score improved → commit |
|
|
195
|
-
| discard → revert | score declined → `git reset --hard` |
|
|
196
|
-
| NEVER STOP | max 3 attempts per story (configurable) |
|
|
197
|
-
|
|
198
|
-
### Configuration
|
|
199
|
-
|
|
200
|
-
```json
|
|
201
|
-
{
|
|
202
|
-
"qualityThreshold": 80,
|
|
203
|
-
"maxRefineAttempts": 3,
|
|
204
|
-
"qualityConfig": {
|
|
205
|
-
"weights": { "tests": 30, "typecheck": 25, "lint": 15, "verify": 15, "diff": 10, "custom": 5 }
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### CLI
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
loophaus quality # Score all stories
|
|
214
|
-
loophaus quality --story US-001 # Score a specific story
|
|
215
|
-
```
|
|
216
|
-
|
|
217
224
|
## Architecture
|
|
218
225
|
|
|
219
226
|
```
|
|
@@ -253,7 +260,7 @@ loophaus/
|
|
|
253
260
|
├── .claude-plugin/
|
|
254
261
|
│ └── plugin.json # Claude Code marketplace manifest
|
|
255
262
|
├── dist/ # Compiled output (tsc)
|
|
256
|
-
└── tests/ #
|
|
263
|
+
└── tests/ # 359 test cases (vitest)
|
|
257
264
|
```
|
|
258
265
|
|
|
259
266
|
## PRD Format
|
|
@@ -311,10 +318,10 @@ npm uninstall -g @graypark/loophaus
|
|
|
311
318
|
git clone https://github.com/vcz-Gray/loophaus.git
|
|
312
319
|
cd loophaus
|
|
313
320
|
npm install
|
|
314
|
-
npm test
|
|
315
|
-
npm run typecheck
|
|
316
|
-
npm run build
|
|
317
|
-
npx vitest
|
|
321
|
+
npm test # 359 tests
|
|
322
|
+
npm run typecheck # TypeScript strict mode
|
|
323
|
+
npm run build # Compile to dist/
|
|
324
|
+
npx vitest # watch mode
|
|
318
325
|
```
|
|
319
326
|
|
|
320
327
|
## License
|