create-hq 5.0.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/dist/deps.d.ts +4 -0
- package/dist/deps.d.ts.map +1 -0
- package/dist/deps.js +65 -0
- package/dist/deps.js.map +1 -0
- package/dist/git.d.ts +3 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +19 -0
- package/dist/git.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/scaffold.d.ts +8 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +130 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/ui.d.ts +7 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +36 -0
- package/dist/ui.js.map +1 -0
- package/package.json +41 -0
- package/template/.claude/CLAUDE.md +202 -0
- package/template/.claude/commands/checkpoint.md +127 -0
- package/template/.claude/commands/cleanup.md +307 -0
- package/template/.claude/commands/execute-task.md +440 -0
- package/template/.claude/commands/exit-plan.md +41 -0
- package/template/.claude/commands/handoff.md +97 -0
- package/template/.claude/commands/learn.md +218 -0
- package/template/.claude/commands/metrics.md +118 -0
- package/template/.claude/commands/newworker.md +162 -0
- package/template/.claude/commands/nexttask.md +67 -0
- package/template/.claude/commands/prd.md +238 -0
- package/template/.claude/commands/reanchor.md +51 -0
- package/template/.claude/commands/remember.md +126 -0
- package/template/.claude/commands/run-project.md +348 -0
- package/template/.claude/commands/run.md +110 -0
- package/template/.claude/commands/search-reindex.md +62 -0
- package/template/.claude/commands/search.md +100 -0
- package/template/.claude/commands/setup.md +381 -0
- package/template/.claude/scripts/pure-ralph-loop.ps1 +312 -0
- package/template/.claude/scripts/pure-ralph-loop.sh +859 -0
- package/template/CHANGELOG.md +220 -0
- package/template/LICENSE +21 -0
- package/template/MIGRATION.md +259 -0
- package/template/README.md +368 -0
- package/template/data/journal/.gitkeep +0 -0
- package/template/docs/images/ascii-banner-options.md +122 -0
- package/template/docs/images/hq-banner.svg +105 -0
- package/template/knowledge/Ralph/01-overview.md +71 -0
- package/template/knowledge/Ralph/02-core-concepts.md +114 -0
- package/template/knowledge/Ralph/03-how-ralph-works.md +184 -0
- package/template/knowledge/Ralph/04-back-pressure.md +222 -0
- package/template/knowledge/Ralph/05-specifications.md +210 -0
- package/template/knowledge/Ralph/06-agents-md.md +222 -0
- package/template/knowledge/Ralph/07-implementation.md +316 -0
- package/template/knowledge/Ralph/08-economics.md +182 -0
- package/template/knowledge/Ralph/09-resources.md +145 -0
- package/template/knowledge/Ralph/10-claude-code-workflow.md +212 -0
- package/template/knowledge/Ralph/11-team-training-guide.md +383 -0
- package/template/knowledge/Ralph/README.md +40 -0
- package/template/knowledge/ai-security-framework/CONTRIBUTING.md +139 -0
- package/template/knowledge/ai-security-framework/GLOSSARY.md +176 -0
- package/template/knowledge/ai-security-framework/LICENSE +21 -0
- package/template/knowledge/ai-security-framework/QUICK-START.md +172 -0
- package/template/knowledge/ai-security-framework/README.md +232 -0
- package/template/knowledge/ai-security-framework/checklists/browser-security.md +301 -0
- package/template/knowledge/ai-security-framework/checklists/credential-isolation.md +322 -0
- package/template/knowledge/ai-security-framework/checklists/incident-response.md +288 -0
- package/template/knowledge/ai-security-framework/checklists/pre-flight.md +249 -0
- package/template/knowledge/ai-security-framework/checklists/weekly-audit.md +159 -0
- package/template/knowledge/ai-security-framework/configs/audit-logging.md +372 -0
- package/template/knowledge/ai-security-framework/configs/kill-switches.md +354 -0
- package/template/knowledge/ai-security-framework/docs/01-core-principles.md +256 -0
- package/template/knowledge/ai-security-framework/docs/02-threat-landscape.md +326 -0
- package/template/knowledge/ai-security-framework/docs/03-security-posture.md +250 -0
- package/template/knowledge/ai-security-framework/templates/agents-security.md +233 -0
- package/template/knowledge/design-styles/README.md +42 -0
- package/template/knowledge/design-styles/american-industrial.md +136 -0
- package/template/knowledge/design-styles/ethereal-abstract.md +133 -0
- package/template/knowledge/design-styles/liminal-portal.md +111 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G-3m4YPW0AADdu2.jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G-JJlt5WwAABK3K.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G-JJmj5W0AEbJ-7.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G59fgNuXkAAKLJQ (1).jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G59fgNuXkAAKLJQ.jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G7fVkn3WEAAM-ST.jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G8ECO5JWEAIksyn.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G9-3GQSWoAA8eqZ.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G9xEOqrXkAEZRcs.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G_MVeJrXQAA8sx4.jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G_RSkmGXkAAgAVZ.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/README.md +31 -0
- package/template/knowledge/design-styles/swipes/american-industrial/qyqtg7Dq.png +0 -0
- package/template/knowledge/dev-team/README.md +35 -0
- package/template/knowledge/dev-team/patterns/README.md +34 -0
- package/template/knowledge/dev-team/patterns/frontend/react-best-practices.md +178 -0
- package/template/knowledge/dev-team/troubleshooting/README.md +31 -0
- package/template/knowledge/dev-team/workflows/README.md +49 -0
- package/template/knowledge/hq/checkpoint-schema.json +51 -0
- package/template/knowledge/hq/index-md-spec.md +74 -0
- package/template/knowledge/hq/thread-schema.md +153 -0
- package/template/knowledge/hq-core/checkpoint-schema.json +51 -0
- package/template/knowledge/hq-core/index-md-spec.md +74 -0
- package/template/knowledge/hq-core/thread-schema.md +153 -0
- package/template/knowledge/loom/README.md +51 -0
- package/template/knowledge/loom/architecture.md +125 -0
- package/template/knowledge/loom/code-style.md +169 -0
- package/template/knowledge/loom/llm-proxy.md +132 -0
- package/template/knowledge/loom/state-machine.md +131 -0
- package/template/knowledge/loom/thread-system.md +117 -0
- package/template/knowledge/loom/tools.md +94 -0
- package/template/knowledge/loom/weaver.md +96 -0
- package/template/knowledge/loom/web-frontend.md +131 -0
- package/template/knowledge/projects/README.md +72 -0
- package/template/knowledge/projects/templates/README.template.md +28 -0
- package/template/knowledge/workers/README.md +195 -0
- package/template/knowledge/workers/ralph-loop-pattern.md +157 -0
- package/template/knowledge/workers/skill-schema.md +182 -0
- package/template/knowledge/workers/state-machine.md +102 -0
- package/template/knowledge/workers/templates/base-worker.yaml +73 -0
- package/template/knowledge/workers/templates/code-worker.yaml +85 -0
- package/template/knowledge/workers/templates/skill.yaml +49 -0
- package/template/knowledge/workers/templates/social-worker.yaml +70 -0
- package/template/modules/examples/full-manifest.yaml +92 -0
- package/template/modules/examples/minimal.yaml +14 -0
- package/template/modules/modules.yaml +59 -0
- package/template/projects/.gitkeep +0 -0
- package/template/projects/incorporate-workers-into-pure-ralph/prd.json +88 -0
- package/template/projects/pure-ralph-branch-isolation/README.md +114 -0
- package/template/projects/pure-ralph-branch-isolation/prd.json +123 -0
- package/template/projects/purist-ralph-loop/README.md +148 -0
- package/template/projects/purist-ralph-loop/prd.json +135 -0
- package/template/projects/ralph-test/prd.json +50 -0
- package/template/prompts/pure-ralph-base.md +551 -0
- package/template/settings/.gitkeep +0 -0
- package/template/settings/pure-ralph.json +42 -0
- package/template/social-content/drafts/INDEX.md +21 -0
- package/template/social-content/drafts/linkedin/.gitkeep +1 -0
- package/template/social-content/drafts/x/.gitkeep +1 -0
- package/template/social-content/images/.gitkeep +1 -0
- package/template/starter-projects/code-worker/README.md +97 -0
- package/template/starter-projects/code-worker/prd.json +45 -0
- package/template/starter-projects/personal-assistant/README.md +42 -0
- package/template/starter-projects/personal-assistant/prd.json +43 -0
- package/template/starter-projects/social-media/README.md +60 -0
- package/template/starter-projects/social-media/prd.json +43 -0
- package/template/workers/content-brand/README.md +59 -0
- package/template/workers/content-brand/skills/messaging-alignment.md +91 -0
- package/template/workers/content-brand/skills/tone-check.md +76 -0
- package/template/workers/content-brand/skills/voice-analysis.md +68 -0
- package/template/workers/content-brand/worker.yaml +81 -0
- package/template/workers/content-legal/README.md +80 -0
- package/template/workers/content-legal/skills/claim-substantiation.md +150 -0
- package/template/workers/content-legal/skills/compliance-scan.md +123 -0
- package/template/workers/content-legal/skills/disclaimer-check.md +146 -0
- package/template/workers/content-legal/worker.yaml +118 -0
- package/template/workers/content-product/README.md +77 -0
- package/template/workers/content-product/skills/claim-verification.md +96 -0
- package/template/workers/content-product/skills/feature-accuracy.md +117 -0
- package/template/workers/content-product/skills/stats-check.md +128 -0
- package/template/workers/content-product/worker.yaml +97 -0
- package/template/workers/content-sales/README.md +70 -0
- package/template/workers/content-sales/skills/conversion-analysis.md +96 -0
- package/template/workers/content-sales/skills/cta-audit.md +107 -0
- package/template/workers/content-sales/skills/value-prop-check.md +114 -0
- package/template/workers/content-sales/worker.yaml +93 -0
- package/template/workers/content-shared/cli.ts +242 -0
- package/template/workers/content-shared/index.ts +234 -0
- package/template/workers/content-shared/lib/accuracy-analyzer.ts +661 -0
- package/template/workers/content-shared/lib/analyze.ts +370 -0
- package/template/workers/content-shared/lib/brand-analyzer.ts +526 -0
- package/template/workers/content-shared/lib/cms-integration.ts +446 -0
- package/template/workers/content-shared/lib/compliance-analyzer.ts +655 -0
- package/template/workers/content-shared/lib/conversion-analyzer.ts +555 -0
- package/template/workers/content-shared/lib/github-integration.ts +582 -0
- package/template/workers/content-shared/lib/output.ts +373 -0
- package/template/workers/content-shared/lib/parser.ts +771 -0
- package/template/workers/content-shared/lib/priority.ts +439 -0
- package/template/workers/content-shared/lib/recommendations.ts +512 -0
- package/template/workers/content-shared/lib/reporter.ts +749 -0
- package/template/workers/content-shared/lib/restructure.ts +664 -0
- package/template/workers/content-shared/lib/scorer.ts +140 -0
- package/template/workers/content-shared/lib/types.ts +227 -0
- package/template/workers/content-shared/lib/variants.ts +595 -0
- package/template/workers/content-shared/package.json +51 -0
- package/template/workers/content-shared/pnpm-lock.yaml +39 -0
- package/template/workers/content-shared/test/sample-page.json +115 -0
- package/template/workers/content-shared/tsconfig.json +20 -0
- package/template/workers/dev-team/README.md +166 -0
- package/template/workers/dev-team/_template.yaml +70 -0
- package/template/workers/dev-team/architect/package.json +27 -0
- package/template/workers/dev-team/architect/skills/api-design.md +89 -0
- package/template/workers/dev-team/architect/skills/refactor-plan.md +96 -0
- package/template/workers/dev-team/architect/skills/system-design.md +100 -0
- package/template/workers/dev-team/architect/src/index.ts +49 -0
- package/template/workers/dev-team/architect/src/mcp-server.ts +122 -0
- package/template/workers/dev-team/architect/src/skills/api-design.ts +316 -0
- package/template/workers/dev-team/architect/src/skills/refactor-plan.ts +264 -0
- package/template/workers/dev-team/architect/src/skills/system-design.ts +212 -0
- package/template/workers/dev-team/architect/tsconfig.json +19 -0
- package/template/workers/dev-team/architect/worker.yaml +128 -0
- package/template/workers/dev-team/backend-dev/package-lock.json +1252 -0
- package/template/workers/dev-team/backend-dev/package.json +27 -0
- package/template/workers/dev-team/backend-dev/skills/implement-endpoint.md +70 -0
- package/template/workers/dev-team/backend-dev/skills/implement-service.md +62 -0
- package/template/workers/dev-team/backend-dev/src/index.ts +51 -0
- package/template/workers/dev-team/backend-dev/src/mcp-server.ts +109 -0
- package/template/workers/dev-team/backend-dev/src/skills/implement-endpoint.ts +122 -0
- package/template/workers/dev-team/backend-dev/src/skills/implement-service.ts +126 -0
- package/template/workers/dev-team/backend-dev/tsconfig.json +19 -0
- package/template/workers/dev-team/backend-dev/worker.yaml +128 -0
- package/template/workers/dev-team/code-reviewer/package-lock.json +1080 -0
- package/template/workers/dev-team/code-reviewer/package.json +24 -0
- package/template/workers/dev-team/code-reviewer/skills/merge-to-production.md +61 -0
- package/template/workers/dev-team/code-reviewer/skills/merge-to-staging.md +54 -0
- package/template/workers/dev-team/code-reviewer/skills/request-changes.md +63 -0
- package/template/workers/dev-team/code-reviewer/skills/review-pr.md +77 -0
- package/template/workers/dev-team/code-reviewer/src/index.ts +56 -0
- package/template/workers/dev-team/code-reviewer/src/mcp-server.ts +101 -0
- package/template/workers/dev-team/code-reviewer/tsconfig.json +19 -0
- package/template/workers/dev-team/code-reviewer/worker.yaml +90 -0
- package/template/workers/dev-team/database-dev/package.json +22 -0
- package/template/workers/dev-team/database-dev/skills/create-schema.md +48 -0
- package/template/workers/dev-team/database-dev/src/index.ts +50 -0
- package/template/workers/dev-team/database-dev/src/mcp-server.ts +76 -0
- package/template/workers/dev-team/database-dev/tsconfig.json +18 -0
- package/template/workers/dev-team/database-dev/worker.yaml +90 -0
- package/template/workers/dev-team/frontend-dev/package.json +22 -0
- package/template/workers/dev-team/frontend-dev/skills/create-component.md +26 -0
- package/template/workers/dev-team/frontend-dev/src/index.ts +50 -0
- package/template/workers/dev-team/frontend-dev/src/mcp-server.ts +77 -0
- package/template/workers/dev-team/frontend-dev/tsconfig.json +18 -0
- package/template/workers/dev-team/frontend-dev/worker.yaml +132 -0
- package/template/workers/dev-team/infra-dev/package.json +24 -0
- package/template/workers/dev-team/infra-dev/skills/add-monitoring.md +73 -0
- package/template/workers/dev-team/infra-dev/skills/configure-deployment.md +80 -0
- package/template/workers/dev-team/infra-dev/skills/create-dockerfile.md +62 -0
- package/template/workers/dev-team/infra-dev/skills/setup-cicd.md +63 -0
- package/template/workers/dev-team/infra-dev/src/index.ts +55 -0
- package/template/workers/dev-team/infra-dev/src/mcp-server.ts +82 -0
- package/template/workers/dev-team/infra-dev/tsconfig.json +19 -0
- package/template/workers/dev-team/infra-dev/worker.yaml +92 -0
- package/template/workers/dev-team/knowledge-curator/package.json +24 -0
- package/template/workers/dev-team/knowledge-curator/skills/curate-troubleshooting.md +63 -0
- package/template/workers/dev-team/knowledge-curator/skills/process-learnings.md +61 -0
- package/template/workers/dev-team/knowledge-curator/skills/sync-documentation.md +76 -0
- package/template/workers/dev-team/knowledge-curator/skills/update-patterns.md +63 -0
- package/template/workers/dev-team/knowledge-curator/src/index.ts +53 -0
- package/template/workers/dev-team/knowledge-curator/src/mcp-server.ts +92 -0
- package/template/workers/dev-team/knowledge-curator/tsconfig.json +19 -0
- package/template/workers/dev-team/knowledge-curator/worker.yaml +80 -0
- package/template/workers/dev-team/motion-designer/package.json +22 -0
- package/template/workers/dev-team/motion-designer/skills/add-animation.md +25 -0
- package/template/workers/dev-team/motion-designer/skills/generate-image.md +36 -0
- package/template/workers/dev-team/motion-designer/src/index.ts +63 -0
- package/template/workers/dev-team/motion-designer/src/mcp-server.ts +79 -0
- package/template/workers/dev-team/motion-designer/tsconfig.json +18 -0
- package/template/workers/dev-team/motion-designer/worker.yaml +84 -0
- package/template/workers/dev-team/product-planner/queue.json +4 -0
- package/template/workers/dev-team/product-planner/worker.yaml +220 -0
- package/template/workers/dev-team/project-manager/package-lock.json +1252 -0
- package/template/workers/dev-team/project-manager/package.json +27 -0
- package/template/workers/dev-team/project-manager/skills/create-prd.md +66 -0
- package/template/workers/dev-team/project-manager/skills/next-issue.md +51 -0
- package/template/workers/dev-team/project-manager/skills/project-status.md +59 -0
- package/template/workers/dev-team/project-manager/skills/update-learnings.md +65 -0
- package/template/workers/dev-team/project-manager/src/index.ts +54 -0
- package/template/workers/dev-team/project-manager/src/mcp-server.ts +207 -0
- package/template/workers/dev-team/project-manager/src/skills/create-prd.ts +86 -0
- package/template/workers/dev-team/project-manager/src/skills/next-issue.ts +137 -0
- package/template/workers/dev-team/project-manager/src/skills/project-status.ts +131 -0
- package/template/workers/dev-team/project-manager/src/skills/update-learnings.ts +94 -0
- package/template/workers/dev-team/project-manager/tsconfig.json +19 -0
- package/template/workers/dev-team/project-manager/worker.yaml +96 -0
- package/template/workers/dev-team/qa-tester/package.json +24 -0
- package/template/workers/dev-team/qa-tester/skills/create-demo-account.md +36 -0
- package/template/workers/dev-team/qa-tester/skills/run-tests.md +36 -0
- package/template/workers/dev-team/qa-tester/skills/write-test.md +27 -0
- package/template/workers/dev-team/qa-tester/src/index.ts +61 -0
- package/template/workers/dev-team/qa-tester/src/mcp-server.ts +88 -0
- package/template/workers/dev-team/qa-tester/tsconfig.json +18 -0
- package/template/workers/dev-team/qa-tester/worker.yaml +116 -0
- package/template/workers/dev-team/task-executor/package-lock.json +1252 -0
- package/template/workers/dev-team/task-executor/package.json +27 -0
- package/template/workers/dev-team/task-executor/skills/analyze-issue.md +101 -0
- package/template/workers/dev-team/task-executor/skills/execute.md +133 -0
- package/template/workers/dev-team/task-executor/skills/report-learnings.md +106 -0
- package/template/workers/dev-team/task-executor/skills/validate-completion.md +121 -0
- package/template/workers/dev-team/task-executor/src/index.ts +54 -0
- package/template/workers/dev-team/task-executor/src/mcp-server.ts +139 -0
- package/template/workers/dev-team/task-executor/src/skills/analyze-issue.ts +219 -0
- package/template/workers/dev-team/task-executor/src/skills/execute.ts +132 -0
- package/template/workers/dev-team/task-executor/src/skills/report-learnings.ts +119 -0
- package/template/workers/dev-team/task-executor/src/skills/validate-completion.ts +142 -0
- package/template/workers/dev-team/task-executor/tsconfig.json +19 -0
- package/template/workers/dev-team/task-executor/worker.yaml +110 -0
- package/template/workers/registry.yaml +171 -0
- package/template/workers/security-scanner/README.md +73 -0
- package/template/workers/security-scanner/skills/pre-deploy-check.md +205 -0
- package/template/workers/security-scanner/worker.yaml +26 -0
- package/template/workspace/checkpoints/.gitkeep +0 -0
- package/template/workspace/content-ideas/inbox.jsonl +0 -0
- package/template/workspace/drafts/.gitkeep +0 -0
- package/template/workspace/learnings/.gitkeep +3 -0
- package/template/workspace/orchestrator/.gitkeep +0 -0
- package/template/workspace/ralph-test/COMPLETE.md +18 -0
- package/template/workspace/ralph-test/hello.txt +2 -0
- package/template/workspace/reports/.gitkeep +0 -0
- package/template/workspace/scratch/.gitkeep +0 -0
- package/template/workspace/threads/.gitkeep +3 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# Claude Code Workflow for Real Engineering
|
|
2
|
+
|
|
3
|
+
*Based on Matt Pocock's "How I use Claude Code for real engineering" video*
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This document covers Matt Pocock's practical workflow for using Claude Code on large, multi-phase coding projects. While not explicitly labeled as "Ralph," this workflow embodies Ralph principles: breaking work into phases, managing context windows, and using automated feedback loops.
|
|
8
|
+
|
|
9
|
+
**Video**: https://www.youtube.com/watch?v=kZ-zzHVUrO4
|
|
10
|
+
**Duration**: 10:11
|
|
11
|
+
**Published**: October 27, 2025
|
|
12
|
+
**Views**: 124K+
|
|
13
|
+
|
|
14
|
+
## Key Workflow Components
|
|
15
|
+
|
|
16
|
+
### 1. Starting with a Rough Dictated Prompt
|
|
17
|
+
|
|
18
|
+
> "The way I produced this was I just dictated into my microphone for a bit. I haven't really put too much thought into this."
|
|
19
|
+
|
|
20
|
+
Matt starts with a voice-dictated rough prompt describing what he wants to build. This is faster than typing and captures intent naturally.
|
|
21
|
+
|
|
22
|
+
### 2. Using Plan Mode
|
|
23
|
+
|
|
24
|
+
Claude Code's plan mode is essential for large projects:
|
|
25
|
+
|
|
26
|
+
> "This is actually a really good opportunity to show a complicated multi-phase plan with Claude Code."
|
|
27
|
+
|
|
28
|
+
**Plan Mode Benefits:**
|
|
29
|
+
- Explores the codebase before writing code
|
|
30
|
+
- Generates clarifying questions
|
|
31
|
+
- Breaks work into manageable phases
|
|
32
|
+
- Preserves context across resets
|
|
33
|
+
|
|
34
|
+
### 3. Multi-Phase Planning
|
|
35
|
+
|
|
36
|
+
For projects that exceed a single context window:
|
|
37
|
+
|
|
38
|
+
> "This is a pretty large feature that will go probably beyond a single context window."
|
|
39
|
+
|
|
40
|
+
**Approach:**
|
|
41
|
+
1. Create a comprehensive plan upfront
|
|
42
|
+
2. Break into numbered phases
|
|
43
|
+
3. Execute one phase at a time
|
|
44
|
+
4. Store plan in GitHub issues for persistence
|
|
45
|
+
|
|
46
|
+
### 4. Monitoring Context Usage
|
|
47
|
+
|
|
48
|
+
Matt emphasizes watching the context window:
|
|
49
|
+
|
|
50
|
+
> "So far we have 83.7% free space. That's feeling pretty good. We've only used about 33k tokens."
|
|
51
|
+
|
|
52
|
+
**Key Metrics:**
|
|
53
|
+
- Tokens used vs. available
|
|
54
|
+
- Free space percentage
|
|
55
|
+
- When to reset context
|
|
56
|
+
|
|
57
|
+
### 5. The Concision Rule
|
|
58
|
+
|
|
59
|
+
Matt's favorite custom rule:
|
|
60
|
+
|
|
61
|
+
> "Always be extremely concise. Sacrifice grammar for the sake of concision."
|
|
62
|
+
|
|
63
|
+
This keeps Claude's responses short, preserving context window space for actual work.
|
|
64
|
+
|
|
65
|
+
### 6. Auto-Accept Mode
|
|
66
|
+
|
|
67
|
+
For execution phases:
|
|
68
|
+
|
|
69
|
+
> "I'm going to swap to auto-accept and I'm going to say 'execute phase one.'"
|
|
70
|
+
|
|
71
|
+
**When to use:**
|
|
72
|
+
- During implementation (not planning)
|
|
73
|
+
- When you trust the plan
|
|
74
|
+
- For routine operations
|
|
75
|
+
|
|
76
|
+
**When NOT to use:**
|
|
77
|
+
- During exploration
|
|
78
|
+
- When making architectural decisions
|
|
79
|
+
- For critical/destructive operations
|
|
80
|
+
|
|
81
|
+
### 7. Custom Status Line
|
|
82
|
+
|
|
83
|
+
Matt customizes his terminal status to show:
|
|
84
|
+
- Current repo (relative to repos folder)
|
|
85
|
+
- Current branch
|
|
86
|
+
- Staged file count
|
|
87
|
+
- Unstaged file count
|
|
88
|
+
- New file count
|
|
89
|
+
|
|
90
|
+
This provides quick feedback without switching contexts.
|
|
91
|
+
|
|
92
|
+
### 8. Storing Plans as GitHub Issues
|
|
93
|
+
|
|
94
|
+
For large projects spanning multiple sessions:
|
|
95
|
+
|
|
96
|
+
> "My strategy of storing plans as GitHub issues to preserve them across context resets."
|
|
97
|
+
|
|
98
|
+
**Benefits:**
|
|
99
|
+
- Plans persist beyond context window
|
|
100
|
+
- Can reference in future sessions
|
|
101
|
+
- Creates documentation trail
|
|
102
|
+
- Allows collaboration
|
|
103
|
+
|
|
104
|
+
## The Complete Workflow
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
┌─────────────────────────────────────────┐
|
|
108
|
+
│ 1. DICTATE ROUGH REQUIREMENTS │
|
|
109
|
+
│ Voice → rough prompt text │
|
|
110
|
+
└────────────────┬────────────────────────┘
|
|
111
|
+
│
|
|
112
|
+
▼
|
|
113
|
+
┌─────────────────────────────────────────┐
|
|
114
|
+
│ 2. ENTER PLAN MODE │
|
|
115
|
+
│ /plan or plan mode command │
|
|
116
|
+
└────────────────┬────────────────────────┘
|
|
117
|
+
│
|
|
118
|
+
▼
|
|
119
|
+
┌─────────────────────────────────────────┐
|
|
120
|
+
│ 3. EXPLORATION PHASE │
|
|
121
|
+
│ - Claude reads codebase │
|
|
122
|
+
│ - Asks clarifying questions │
|
|
123
|
+
│ - Generates multi-phase plan │
|
|
124
|
+
└────────────────┬────────────────────────┘
|
|
125
|
+
│
|
|
126
|
+
▼
|
|
127
|
+
┌─────────────────────────────────────────┐
|
|
128
|
+
│ 4. STORE PLAN (Optional) │
|
|
129
|
+
│ Create GitHub issue with plan │
|
|
130
|
+
└────────────────┬────────────────────────┘
|
|
131
|
+
│
|
|
132
|
+
▼
|
|
133
|
+
┌─────────────────────────────────────────┐
|
|
134
|
+
│ 5. EXECUTE PHASES │
|
|
135
|
+
│ - Enable auto-accept │
|
|
136
|
+
│ - "Execute phase 1" │
|
|
137
|
+
│ - Monitor context usage │
|
|
138
|
+
│ - Reset if needed, load plan │
|
|
139
|
+
└────────────────┬────────────────────────┘
|
|
140
|
+
│
|
|
141
|
+
▼
|
|
142
|
+
┌─────────────────────────────────────────┐
|
|
143
|
+
│ 6. VERIFY & ITERATE │
|
|
144
|
+
│ - Run tests/build │
|
|
145
|
+
│ - Review changes │
|
|
146
|
+
│ - Continue to next phase │
|
|
147
|
+
└─────────────────────────────────────────┘
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Custom Rules Configuration
|
|
151
|
+
|
|
152
|
+
Matt uses custom rules in his Claude Code configuration:
|
|
153
|
+
|
|
154
|
+
```markdown
|
|
155
|
+
# Custom Rules
|
|
156
|
+
|
|
157
|
+
## Concision
|
|
158
|
+
Always be extremely concise. Sacrifice grammar for the sake of concision.
|
|
159
|
+
|
|
160
|
+
## Planning
|
|
161
|
+
When creating plans:
|
|
162
|
+
- Break into numbered phases
|
|
163
|
+
- Keep phases small enough for single context
|
|
164
|
+
- Include verification steps in each phase
|
|
165
|
+
- Add unresolved questions as separate items
|
|
166
|
+
|
|
167
|
+
## Context Management
|
|
168
|
+
- Monitor token usage regularly
|
|
169
|
+
- Warn when approaching 50% context used
|
|
170
|
+
- Suggest saving plan to issue when context getting full
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Relationship to Ralph
|
|
174
|
+
|
|
175
|
+
This workflow aligns with Ralph principles:
|
|
176
|
+
|
|
177
|
+
| Ralph Concept | Matt's Implementation |
|
|
178
|
+
|--------------|----------------------|
|
|
179
|
+
| Fresh context per task | Phase-by-phase execution with resets |
|
|
180
|
+
| Specifications | Multi-phase plan stored in GitHub |
|
|
181
|
+
| Back pressure | Build/test commands during execution |
|
|
182
|
+
| Small changes | Phases designed to fit context window |
|
|
183
|
+
| Automation | Auto-accept mode during implementation |
|
|
184
|
+
|
|
185
|
+
## Key Takeaways
|
|
186
|
+
|
|
187
|
+
1. **Plan before coding** - Exploration and planning phase is critical
|
|
188
|
+
2. **Monitor context** - Know when you're running out of space
|
|
189
|
+
3. **Persist plans** - GitHub issues survive context resets
|
|
190
|
+
4. **Be concise** - Every token matters
|
|
191
|
+
5. **Phase your work** - Big projects need multiple context windows
|
|
192
|
+
6. **Auto-accept wisely** - Trust but verify
|
|
193
|
+
|
|
194
|
+
## Practical Tips
|
|
195
|
+
|
|
196
|
+
### For Large Projects
|
|
197
|
+
- Always start in plan mode
|
|
198
|
+
- Create GitHub issue with full plan before starting
|
|
199
|
+
- Execute one phase at a time
|
|
200
|
+
- Reset context between phases if needed
|
|
201
|
+
|
|
202
|
+
### For Context Management
|
|
203
|
+
- Watch the token counter
|
|
204
|
+
- Use concise rules
|
|
205
|
+
- Don't let Claude write long explanations
|
|
206
|
+
- Save plan externally before context fills
|
|
207
|
+
|
|
208
|
+
### For Quality
|
|
209
|
+
- Keep build/test in auto-accept
|
|
210
|
+
- Review changes between phases
|
|
211
|
+
- Don't rush through verification
|
|
212
|
+
- Commit after each successful phase
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
# Ralph & Building AGI: Team Training Guide
|
|
2
|
+
|
|
3
|
+
*Synthesized from dev standups, Zoom sessions, and HQ Ralph Knowledge Base*
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Part 1: What Is Ralph?
|
|
8
|
+
|
|
9
|
+
A deceptively simple orchestrator pattern for autonomous AI coding created by Geoffrey Huntley. Instead of complex agent frameworks, use a **for loop** that picks tasks, generates code, runs automated checks (back pressure), commits on pass, and repeats. Fresh context per task prevents context rot.
|
|
10
|
+
|
|
11
|
+
Core insight: **simplicity beats complexity**.
|
|
12
|
+
|
|
13
|
+
### The Problems It Solves
|
|
14
|
+
- **Context rot** -- AI loses track of earlier context as the window fills up
|
|
15
|
+
- **Compaction** -- context gets filled with irrelevant information, leaving less room for actual work
|
|
16
|
+
- **Complexity** -- elaborate orchestrators add failure points
|
|
17
|
+
- **Human dependencies** -- manual intervention breaks autonomous flow
|
|
18
|
+
|
|
19
|
+
### The Vision
|
|
20
|
+
*"Wake up in the morning to working code that your coding agent has worked through your backlog and just spit out a whole bunch of code for you to review and it works."* -- Geoffrey Huntley
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Part 2: The Loop In Detail
|
|
25
|
+
|
|
26
|
+
### Flow Diagram
|
|
27
|
+
```
|
|
28
|
+
Load PRD + agents.md
|
|
29
|
+
|
|
|
30
|
+
Pick ONE task (passes: false)
|
|
31
|
+
|
|
|
32
|
+
Generate code
|
|
33
|
+
|
|
|
34
|
+
Run back pressure checks (tsc, eslint, jest, build)
|
|
35
|
+
|
|
|
36
|
+
Pass? --Yes--> Commit & Update PRD (passes: true) --> Next iteration
|
|
37
|
+
Pass? --No---> Retry/Fix --> Run checks again
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### The Script
|
|
41
|
+
```bash
|
|
42
|
+
#!/bin/bash
|
|
43
|
+
ITERATIONS=${1:-10}
|
|
44
|
+
|
|
45
|
+
for i in $(seq 1 $ITERATIONS); do
|
|
46
|
+
echo "=== Ralph Loop Iteration $i ==="
|
|
47
|
+
|
|
48
|
+
claude --print "Read plans/prd.json and find first feature where passes is false.
|
|
49
|
+
|
|
50
|
+
Implement ONLY that feature.
|
|
51
|
+
|
|
52
|
+
Then run:
|
|
53
|
+
1. npm test
|
|
54
|
+
2. npm run lint
|
|
55
|
+
3. npm run typecheck
|
|
56
|
+
4. npm run build
|
|
57
|
+
|
|
58
|
+
If ALL pass:
|
|
59
|
+
1. Commit the changes
|
|
60
|
+
2. Update plans/prd.json to set passes: true
|
|
61
|
+
3. Append progress to progress.txt
|
|
62
|
+
|
|
63
|
+
If ANY fail:
|
|
64
|
+
1. Fix the issues
|
|
65
|
+
2. Try again"
|
|
66
|
+
|
|
67
|
+
echo "Completed iteration $i"
|
|
68
|
+
sleep 2
|
|
69
|
+
done
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Running Overnight (AFK Coding)
|
|
73
|
+
```bash
|
|
74
|
+
# tmux
|
|
75
|
+
tmux new-session -d -s ralph && tmux send-keys -t ralph './ralph.sh 100' Enter
|
|
76
|
+
|
|
77
|
+
# nohup
|
|
78
|
+
nohup ./ralph.sh 100 > ralph.log 2>&1 &
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Goal: *"Get it where you can set up your computer overnight and let it just run."*
|
|
82
|
+
|
|
83
|
+
### Monitoring
|
|
84
|
+
```bash
|
|
85
|
+
cat progress.txt | tail -20
|
|
86
|
+
echo "Completed: $(grep -c '"passes": true' plans/prd.json)"
|
|
87
|
+
echo "Remaining: $(grep -c '"passes": false' plans/prd.json)"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Part 3: The Four Components
|
|
93
|
+
|
|
94
|
+
### 1. PRD (prd.json) -- The Specification + Test Harness
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"project": "my-project",
|
|
99
|
+
"version": "1.0",
|
|
100
|
+
"features": [
|
|
101
|
+
{
|
|
102
|
+
"id": "feature-001",
|
|
103
|
+
"title": "Authentication Flow",
|
|
104
|
+
"description": "User login with OAuth",
|
|
105
|
+
"user_story": "As a user, I want to log in securely...",
|
|
106
|
+
"acceptance_criteria": [
|
|
107
|
+
"OAuth flow completes successfully",
|
|
108
|
+
"Token stored securely",
|
|
109
|
+
"Error states handled gracefully"
|
|
110
|
+
],
|
|
111
|
+
"priority": "high",
|
|
112
|
+
"passes": false
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Good specs**: Specific, measurable, independently testable, small enough for one iteration, clear success criteria.
|
|
119
|
+
|
|
120
|
+
**Bad specs**: Too broad ("build the entire auth system"), vague ("it works well"), not independently testable.
|
|
121
|
+
|
|
122
|
+
The `passes` field is critical -- it tells the loop whether the feature has been verified. The PRD serves dual purpose: specification AND test harness.
|
|
123
|
+
|
|
124
|
+
### 2. Progress File (progress.txt) -- The Audit Trail
|
|
125
|
+
|
|
126
|
+
Running log with timestamps showing: which feature was started, tests passed/failed, git commit hashes, PRD updates. Provides audit trail for human review, context for subsequent runs, and handoff capability.
|
|
127
|
+
|
|
128
|
+
### 3. agents.md / CLAUDE.md -- The Brain
|
|
129
|
+
|
|
130
|
+
Minimal config file. Include only:
|
|
131
|
+
- Project overview (1-2 sentences)
|
|
132
|
+
- Tech stack
|
|
133
|
+
- Build/test commands
|
|
134
|
+
- Task loop protocol
|
|
135
|
+
- "Do NOT" rules
|
|
136
|
+
|
|
137
|
+
**Anti-patterns to avoid:**
|
|
138
|
+
- Everything in one file (context bloat)
|
|
139
|
+
- Contradictory instructions
|
|
140
|
+
- Outdated information
|
|
141
|
+
- Too verbose
|
|
142
|
+
- No verification steps
|
|
143
|
+
|
|
144
|
+
**Key concept: Mallocing vs Static Loading**
|
|
145
|
+
- **Static** (bad): Load agents.md once, use for entire session. Context rots.
|
|
146
|
+
- **Dynamic/Mallocing** (good): Start task -> load only relevant specs -> complete -> clear -> repeat. Fresh context per task.
|
|
147
|
+
|
|
148
|
+
### 4. Back Pressure -- The Verification Layer
|
|
149
|
+
|
|
150
|
+
What makes autonomous coding reliable. Without it, hallucinations compound, bugs accumulate, context rot makes everything worse.
|
|
151
|
+
|
|
152
|
+
| Type | Command | Speed | Purpose |
|
|
153
|
+
|------|---------|-------|---------|
|
|
154
|
+
| Type checking | `tsc --noEmit` | Very fast | Catch type errors |
|
|
155
|
+
| Linting | `eslint . --max-warnings 0` | Fast | Code style + patterns |
|
|
156
|
+
| Unit tests | `npm test` / `pytest` | Important | Logic verification |
|
|
157
|
+
| Integration tests | `npm run test:integration` | Comprehensive | System behavior |
|
|
158
|
+
| Build | `npm run build` | Essential | Final validation |
|
|
159
|
+
| Visual (frontend) | Playwright MCP / browser automation | For UI | Screenshot verification |
|
|
160
|
+
|
|
161
|
+
**Speed is critical**: TypeScript + ESLint + Jest = ~10 seconds. Rust compilation = 5-30 minutes (problematic for rapid iteration). Optimize for fast feedback.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Part 4: Practical Results
|
|
166
|
+
|
|
167
|
+
### Speed Results
|
|
168
|
+
|
|
169
|
+
| Task | Traditional | With Ralph | Speedup |
|
|
170
|
+
|------|------------|------------|---------|
|
|
171
|
+
| Auth implementation | 3-4 days | 1 day | 3-4x |
|
|
172
|
+
| Codebase cleanup (300+ files) | Multi-day | 1 hour | 10-20x |
|
|
173
|
+
| Website migration | Days | < 1 hour | 10x+ |
|
|
174
|
+
|
|
175
|
+
### Key Learnings from Team Adoption
|
|
176
|
+
|
|
177
|
+
1. **Auth flow implemented in 1 day vs 3-4 days** -- the breakthrough moment that validated the approach
|
|
178
|
+
2. **Ralph cleaned 300+ files in one hour** -- previously would have been a multi-day effort
|
|
179
|
+
3. **Clean codebase = 10x Ralph speed** -- messy code slows everything significantly
|
|
180
|
+
4. **Ralph for features, traditional for bugs** -- different tools for different work
|
|
181
|
+
5. **Start with a single feature per dev** -- pick one well-defined feature and build a Ralph pipeline just for it
|
|
182
|
+
6. **Use a sandbox to learn** -- safe place to experiment before applying to real work
|
|
183
|
+
7. **Single environment architecture** -- feature flags over staging environments, one set of keys, less infrastructure
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Part 5: Practical Playbook
|
|
188
|
+
|
|
189
|
+
### For New Team Members
|
|
190
|
+
|
|
191
|
+
**Phase 1: Learn (Day 1-2)**
|
|
192
|
+
1. Read HQ Ralph knowledge base: `knowledge/Ralph/` (10 chapters)
|
|
193
|
+
2. Set up a sandbox environment (safe place to experiment)
|
|
194
|
+
3. Watch Geoffrey Huntley's "Ralph Wiggum Loop from 1st principles" video
|
|
195
|
+
4. Get Claude Max account and set up HQ locally
|
|
196
|
+
|
|
197
|
+
**Phase 2: First Feature (Day 3-5)**
|
|
198
|
+
1. Pick ONE well-defined feature from your backlog
|
|
199
|
+
2. Write a PRD with specific, testable acceptance criteria
|
|
200
|
+
3. Ensure back pressure exists: type checking, linting, tests, build
|
|
201
|
+
4. Create minimal agents.md / CLAUDE.md
|
|
202
|
+
5. Run the loop for your single feature
|
|
203
|
+
6. Review results, iterate
|
|
204
|
+
|
|
205
|
+
**Phase 3: Integrate (Week 2+)**
|
|
206
|
+
1. Expand to multiple features in the PRD
|
|
207
|
+
2. Set up overnight runs via tmux
|
|
208
|
+
3. Create separate Ralph instances for bugs vs features
|
|
209
|
+
4. Consider Docker configuration for team standardization
|
|
210
|
+
5. Adopt HQ for project tracking
|
|
211
|
+
|
|
212
|
+
### What to Ralph vs What NOT to Ralph
|
|
213
|
+
|
|
214
|
+
| Ralph it | Don't Ralph it |
|
|
215
|
+
|----------|---------------|
|
|
216
|
+
| New feature implementation | Targeted bug fixes (use traditional) |
|
|
217
|
+
| Large-scale code cleanup (300+ files) | Exploratory debugging |
|
|
218
|
+
| Auth flows, CRUD operations | Security-critical manual review |
|
|
219
|
+
| Test suite creation | Architecture decisions |
|
|
220
|
+
| Codebase migration | API key/credential management |
|
|
221
|
+
|
|
222
|
+
### Writing Good PRD Specs
|
|
223
|
+
|
|
224
|
+
Each feature should be:
|
|
225
|
+
- **S**pecific -- clear what needs to be built
|
|
226
|
+
- **M**easurable -- acceptance criteria are binary pass/fail
|
|
227
|
+
- **I**ndependent -- can be implemented without other features
|
|
228
|
+
- **T**estable -- automated checks can verify it
|
|
229
|
+
- **S**mall -- completable in one iteration
|
|
230
|
+
|
|
231
|
+
### agents.md Template
|
|
232
|
+
|
|
233
|
+
```markdown
|
|
234
|
+
# Project: [Name]
|
|
235
|
+
|
|
236
|
+
## Overview
|
|
237
|
+
[1-2 sentences]
|
|
238
|
+
|
|
239
|
+
## Tech Stack
|
|
240
|
+
- Language: TypeScript
|
|
241
|
+
- Framework: [React/Next/Node]
|
|
242
|
+
- Testing: Jest + React Testing Library
|
|
243
|
+
|
|
244
|
+
## Commands
|
|
245
|
+
- `npm run dev` - Start dev server
|
|
246
|
+
- `npm run build` - Production build
|
|
247
|
+
- `npm test` - Run tests
|
|
248
|
+
- `npm run lint` - Run linter
|
|
249
|
+
|
|
250
|
+
## Task Loop
|
|
251
|
+
1. Read `plans/prd.json`
|
|
252
|
+
2. Find first item with `passes: false`
|
|
253
|
+
3. Implement ONLY that feature
|
|
254
|
+
4. Run: `npm test && npm run lint && npm run typecheck`
|
|
255
|
+
5. If all pass: commit and set `passes: true`
|
|
256
|
+
6. If any fail: fix and retry
|
|
257
|
+
|
|
258
|
+
## Do NOT
|
|
259
|
+
- Modify package.json without approval
|
|
260
|
+
- Delete existing tests
|
|
261
|
+
- Use `any` type
|
|
262
|
+
- Skip running all back pressure checks
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Part 6: Architecture Patterns
|
|
268
|
+
|
|
269
|
+
### Orchestrator + Sub-Agent Pattern (for multi-task projects)
|
|
270
|
+
|
|
271
|
+
**Orchestrator** (stays lean, ~10-20% context):
|
|
272
|
+
- Reads PRD, picks ONE task (passes: false)
|
|
273
|
+
- Spawns sub-agent with task spec
|
|
274
|
+
- Reads checkpoint when done
|
|
275
|
+
- Updates PRD (passes: true), repeats until all pass
|
|
276
|
+
|
|
277
|
+
**Sub-Agent** (fresh context per task, 100% available):
|
|
278
|
+
- Receives task spec + file paths
|
|
279
|
+
- Implements feature
|
|
280
|
+
- Runs back pressure
|
|
281
|
+
- Commits code, writes checkpoint, exits
|
|
282
|
+
|
|
283
|
+
Benefits:
|
|
284
|
+
1. Orchestrator stays fast (small context, quick responses)
|
|
285
|
+
2. Sub-agents get full context (fresh start per task)
|
|
286
|
+
3. Checkpoints preserve state across context resets
|
|
287
|
+
4. Parallel execution possible (spawn multiple sub-agents)
|
|
288
|
+
|
|
289
|
+
### Single Environment Architecture
|
|
290
|
+
|
|
291
|
+
Instead of managing staging/dev/prod:
|
|
292
|
+
- Single production environment
|
|
293
|
+
- Feature flags control rollout
|
|
294
|
+
- Alpha-beta release channels
|
|
295
|
+
- Single set of API keys
|
|
296
|
+
|
|
297
|
+
Why: Eliminate unnecessary intermediate environments to reduce key management complexity.
|
|
298
|
+
|
|
299
|
+
### Separate Ralph Instances
|
|
300
|
+
|
|
301
|
+
From team practice:
|
|
302
|
+
- **Feature Ralph** -- PRD-driven, new functionality
|
|
303
|
+
- **Bug Ralph** -- separate instance for fixes
|
|
304
|
+
- **Cleanup Ralph** -- codebase cleanup tasks (like the 300+ file session)
|
|
305
|
+
- **Test Ralph** -- end-to-end agent testing loops
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Part 7: Economics & Speed
|
|
310
|
+
|
|
311
|
+
### Development Cost Comparison
|
|
312
|
+
|
|
313
|
+
| Method | Cost/Hour |
|
|
314
|
+
|--------|-----------|
|
|
315
|
+
| AI (Ralph) | ~$10.50 |
|
|
316
|
+
| Junior Dev | $35-50 |
|
|
317
|
+
| Senior Dev | $75-150 |
|
|
318
|
+
| Staff Engineer | $150-250 |
|
|
319
|
+
|
|
320
|
+
Running 24/7: ~$250/day or ~$7,500/month
|
|
321
|
+
|
|
322
|
+
### Skills That Matter More Now
|
|
323
|
+
- System design and architecture
|
|
324
|
+
- Prompt engineering / AI orchestration
|
|
325
|
+
- Domain expertise and product sense
|
|
326
|
+
- Quality assurance and testing design
|
|
327
|
+
- Spec writing (PRDs, acceptance criteria)
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## Part 8: Key Principles (Distilled from Training)
|
|
332
|
+
|
|
333
|
+
1. **Start small, one feature at a time** -- Don't try to Ralph everything on day 1.
|
|
334
|
+
|
|
335
|
+
2. **Clean codebase = faster Ralph** -- Messy code slows everything 10x. Cleanup is investment, not waste.
|
|
336
|
+
|
|
337
|
+
3. **Use a sandbox to learn** -- Safe sandbox first to learn principles and set up personal workflow, then apply to real work.
|
|
338
|
+
|
|
339
|
+
4. **Back pressure is non-negotiable** -- Tests, linting, type checking must all pass. This is what prevents hallucination from compounding.
|
|
340
|
+
|
|
341
|
+
5. **Fresh context per task** -- Start clean each iteration. Context rot is the enemy. The loop naturally resets.
|
|
342
|
+
|
|
343
|
+
6. **Ralph for features, traditional for bugs** -- Different tools for different work. Sometimes human judgment is faster for targeted fixes.
|
|
344
|
+
|
|
345
|
+
7. **Speed matters everywhere** -- Fast tests, fast feedback, fast iteration. Optimize for 10-second back pressure cycles.
|
|
346
|
+
|
|
347
|
+
8. **Single environment simplifies** -- Feature flags over staging environments. One set of keys. Less infrastructure to manage.
|
|
348
|
+
|
|
349
|
+
9. **Hardware enables AFK coding** -- Goal is overnight runs. Upgrade hardware if needed. Use tmux/nohup.
|
|
350
|
+
|
|
351
|
+
10. **HQ centralizes everything** -- Project tracking, PRDs, checkpoints, progress files all in one system.
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## Part 9: Resources
|
|
356
|
+
|
|
357
|
+
### HQ Knowledge Base
|
|
358
|
+
`knowledge/Ralph/` -- 10 chapters covering:
|
|
359
|
+
1. Overview
|
|
360
|
+
2. Core Concepts (mallocing, context rot, compaction, back pressure)
|
|
361
|
+
3. How Ralph Works (the loop, components)
|
|
362
|
+
4. Back Pressure Engineering (types, speed, language recommendations)
|
|
363
|
+
5. Specifications (PRD format, quality, forward/reverse generation)
|
|
364
|
+
6. agents.md Configuration (structure, anti-patterns, mallocing vs static)
|
|
365
|
+
7. Implementation (scripts, file structure, monitoring)
|
|
366
|
+
8. Economics (cost comparison, disruption model, new moats)
|
|
367
|
+
9. Resources (Geoffrey Huntley videos, Matt Pocock workflows)
|
|
368
|
+
10. Claude Code Workflow (plan mode, multi-phase, concision rule)
|
|
369
|
+
|
|
370
|
+
### Videos
|
|
371
|
+
- Geoffrey Huntley: "The Ralph Wiggum Loop from 1st principles" (36 min)
|
|
372
|
+
- Geoffrey Huntley: "AI Giants Interview" (1 hr)
|
|
373
|
+
- Geoffrey Huntley: "Fundamental skills and knowledge for 2026 SWE" (39 min)
|
|
374
|
+
- Geoffrey Huntley: "The history of agents.md and what makes a good one" (22 min)
|
|
375
|
+
- Matt Pocock: "Ship working code while you sleep with Ralph Wiggum technique" (16 min)
|
|
376
|
+
- Matt Pocock: "How I use Claude Code for real engineering" (10 min)
|
|
377
|
+
|
|
378
|
+
### Tools
|
|
379
|
+
- Claude Code (Anthropic) -- primary agent
|
|
380
|
+
- HQ Starter Kit -- project management
|
|
381
|
+
- Playwright MCP -- browser automation/testing
|
|
382
|
+
- tmux / nohup -- overnight runs
|
|
383
|
+
- Docker -- team environment standardization
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Ralph Knowledge Repository
|
|
2
|
+
|
|
3
|
+
A comprehensive documentation of the Ralph Wiggum Loop - an autonomous AI coding methodology created by Geoffrey Huntley.
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
1. [Overview](./01-overview.md) - What is Ralph and why it matters
|
|
8
|
+
2. [Core Concepts](./02-core-concepts.md) - Fundamental principles and terminology
|
|
9
|
+
3. [How Ralph Works](./03-how-ralph-works.md) - Technical implementation details
|
|
10
|
+
4. [Back Pressure Engineering](./04-back-pressure.md) - The key to successful autonomous coding
|
|
11
|
+
5. [Specifications & PRDs](./05-specifications.md) - How to structure work for Ralph
|
|
12
|
+
6. [agents.md Guide](./06-agents-md.md) - History, problems, and best practices
|
|
13
|
+
7. [Practical Implementation](./07-implementation.md) - Setting up and running Ralph
|
|
14
|
+
8. [Economic Impact](./08-economics.md) - The changing economics of software development
|
|
15
|
+
9. [Resources](./09-resources.md) - Videos, articles, and further reading
|
|
16
|
+
10. [Claude Code Workflow](./10-claude-code-workflow.md) - Matt Pocock's practical multi-phase workflow
|
|
17
|
+
|
|
18
|
+
## Quick Summary
|
|
19
|
+
|
|
20
|
+
**Ralph** (also known as the "Ralph Wiggum Loop") is a deceptively simple approach to autonomous AI coding that uses a for loop instead of complex orchestration systems. It works by:
|
|
21
|
+
|
|
22
|
+
1. Breaking work into small, atomic tasks (via specifications/PRDs)
|
|
23
|
+
2. Running an AI coding agent in a loop
|
|
24
|
+
3. Using "back pressure" (tests, linting, type checking) to verify each change
|
|
25
|
+
4. Committing working code and moving to the next task
|
|
26
|
+
5. Repeating until all tasks are complete
|
|
27
|
+
|
|
28
|
+
The key insight is that **simplicity beats complexity** - a basic for loop outperforms elaborate agent swarms, meshes, and orchestrators.
|
|
29
|
+
|
|
30
|
+
## Creator
|
|
31
|
+
|
|
32
|
+
**Geoffrey Huntley** - Australian developer, former React Extensions maintainer, and goat farmer who discovered the Ralph methodology in early 2025 while experimenting with LLMs and the Z80 proof-of-concept.
|
|
33
|
+
|
|
34
|
+
## Origin of the Name
|
|
35
|
+
|
|
36
|
+
The name "Ralph Wiggum" comes from The Simpsons character, referencing the comedic simplicity of the approach - "I'm in danger!" but actually it works.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
*This repository was compiled from video transcripts and public talks by Geoffrey Huntley and Matt Pocock.*
|