aidevops 2.52.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/.agent/AGENTS.md +614 -0
- package/.agent/accounts.md +65 -0
- package/.agent/aidevops/add-new-mcp-to-aidevops.md +456 -0
- package/.agent/aidevops/api-integrations.md +335 -0
- package/.agent/aidevops/architecture.md +510 -0
- package/.agent/aidevops/configs.md +274 -0
- package/.agent/aidevops/docs.md +244 -0
- package/.agent/aidevops/extension.md +311 -0
- package/.agent/aidevops/mcp-integrations.md +340 -0
- package/.agent/aidevops/mcp-troubleshooting.md +162 -0
- package/.agent/aidevops/memory-patterns.md +172 -0
- package/.agent/aidevops/providers.md +217 -0
- package/.agent/aidevops/recommendations.md +321 -0
- package/.agent/aidevops/requirements.md +301 -0
- package/.agent/aidevops/resources.md +214 -0
- package/.agent/aidevops/security-requirements.md +174 -0
- package/.agent/aidevops/security.md +350 -0
- package/.agent/aidevops/service-links.md +400 -0
- package/.agent/aidevops/services.md +357 -0
- package/.agent/aidevops/setup.md +153 -0
- package/.agent/aidevops/troubleshooting.md +389 -0
- package/.agent/aidevops.md +124 -0
- package/.agent/build-plus.md +244 -0
- package/.agent/content/guidelines.md +109 -0
- package/.agent/content.md +87 -0
- package/.agent/health.md +59 -0
- package/.agent/legal.md +59 -0
- package/.agent/loop-state/full-loop.local.md +16 -0
- package/.agent/loop-state/ralph-loop.local.md +10 -0
- package/.agent/marketing.md +440 -0
- package/.agent/memory/README.md +260 -0
- package/.agent/onboarding.md +796 -0
- package/.agent/plan-plus.md +245 -0
- package/.agent/research.md +100 -0
- package/.agent/sales.md +333 -0
- package/.agent/scripts/101domains-helper.sh +701 -0
- package/.agent/scripts/add-missing-returns.sh +140 -0
- package/.agent/scripts/agent-browser-helper.sh +311 -0
- package/.agent/scripts/agno-setup.sh +712 -0
- package/.agent/scripts/ahrefs-mcp-wrapper.js +168 -0
- package/.agent/scripts/aidevops-update-check.sh +71 -0
- package/.agent/scripts/ampcode-cli.sh +522 -0
- package/.agent/scripts/auto-version-bump.sh +156 -0
- package/.agent/scripts/autogen-helper.sh +512 -0
- package/.agent/scripts/beads-sync-helper.sh +596 -0
- package/.agent/scripts/closte-helper.sh +5 -0
- package/.agent/scripts/cloudron-helper.sh +321 -0
- package/.agent/scripts/codacy-cli-chunked.sh +581 -0
- package/.agent/scripts/codacy-cli.sh +442 -0
- package/.agent/scripts/code-audit-helper.sh +5 -0
- package/.agent/scripts/coderabbit-cli.sh +417 -0
- package/.agent/scripts/coderabbit-pro-analysis.sh +238 -0
- package/.agent/scripts/commands/code-simplifier.md +86 -0
- package/.agent/scripts/commands/full-loop.md +246 -0
- package/.agent/scripts/commands/postflight-loop.md +103 -0
- package/.agent/scripts/commands/recall.md +182 -0
- package/.agent/scripts/commands/remember.md +132 -0
- package/.agent/scripts/commands/save-todo.md +175 -0
- package/.agent/scripts/commands/session-review.md +154 -0
- package/.agent/scripts/comprehensive-quality-fix.sh +106 -0
- package/.agent/scripts/context-builder-helper.sh +522 -0
- package/.agent/scripts/coolify-cli-helper.sh +674 -0
- package/.agent/scripts/coolify-helper.sh +380 -0
- package/.agent/scripts/crawl4ai-examples.sh +401 -0
- package/.agent/scripts/crawl4ai-helper.sh +1078 -0
- package/.agent/scripts/crewai-helper.sh +681 -0
- package/.agent/scripts/dev-browser-helper.sh +513 -0
- package/.agent/scripts/dns-helper.sh +396 -0
- package/.agent/scripts/domain-research-helper.sh +917 -0
- package/.agent/scripts/dspy-helper.sh +285 -0
- package/.agent/scripts/dspyground-helper.sh +291 -0
- package/.agent/scripts/eeat-score-helper.sh +1242 -0
- package/.agent/scripts/efficient-return-fix.sh +92 -0
- package/.agent/scripts/extract-opencode-prompts.sh +128 -0
- package/.agent/scripts/find-missing-returns.sh +113 -0
- package/.agent/scripts/fix-auth-headers.sh +104 -0
- package/.agent/scripts/fix-common-strings.sh +254 -0
- package/.agent/scripts/fix-content-type.sh +100 -0
- package/.agent/scripts/fix-error-messages.sh +130 -0
- package/.agent/scripts/fix-misplaced-returns.sh +74 -0
- package/.agent/scripts/fix-remaining-literals.sh +152 -0
- package/.agent/scripts/fix-return-statements.sh +41 -0
- package/.agent/scripts/fix-s131-default-cases.sh +249 -0
- package/.agent/scripts/fix-sc2155-simple.sh +102 -0
- package/.agent/scripts/fix-shellcheck-critical.sh +187 -0
- package/.agent/scripts/fix-string-literals.sh +273 -0
- package/.agent/scripts/full-loop-helper.sh +773 -0
- package/.agent/scripts/generate-opencode-agents.sh +497 -0
- package/.agent/scripts/generate-opencode-commands.sh +1629 -0
- package/.agent/scripts/generate-skills.sh +366 -0
- package/.agent/scripts/git-platforms-helper.sh +640 -0
- package/.agent/scripts/gitea-cli-helper.sh +743 -0
- package/.agent/scripts/github-cli-helper.sh +702 -0
- package/.agent/scripts/gitlab-cli-helper.sh +682 -0
- package/.agent/scripts/gsc-add-user-helper.sh +325 -0
- package/.agent/scripts/gsc-sitemap-helper.sh +678 -0
- package/.agent/scripts/hetzner-helper.sh +485 -0
- package/.agent/scripts/hostinger-helper.sh +229 -0
- package/.agent/scripts/keyword-research-helper.sh +1815 -0
- package/.agent/scripts/langflow-helper.sh +544 -0
- package/.agent/scripts/linkedin-automation.py +241 -0
- package/.agent/scripts/linter-manager.sh +599 -0
- package/.agent/scripts/linters-local.sh +434 -0
- package/.agent/scripts/list-keys-helper.sh +488 -0
- package/.agent/scripts/local-browser-automation.py +339 -0
- package/.agent/scripts/localhost-helper.sh +744 -0
- package/.agent/scripts/loop-common.sh +806 -0
- package/.agent/scripts/mainwp-helper.sh +728 -0
- package/.agent/scripts/markdown-formatter.sh +338 -0
- package/.agent/scripts/markdown-lint-fix.sh +311 -0
- package/.agent/scripts/mass-fix-returns.sh +58 -0
- package/.agent/scripts/mcp-diagnose.sh +167 -0
- package/.agent/scripts/mcp-inspector-helper.sh +449 -0
- package/.agent/scripts/memory-helper.sh +650 -0
- package/.agent/scripts/monitor-code-review.sh +255 -0
- package/.agent/scripts/onboarding-helper.sh +706 -0
- package/.agent/scripts/opencode-github-setup-helper.sh +797 -0
- package/.agent/scripts/opencode-test-helper.sh +213 -0
- package/.agent/scripts/pagespeed-helper.sh +464 -0
- package/.agent/scripts/pandoc-helper.sh +362 -0
- package/.agent/scripts/postflight-check.sh +555 -0
- package/.agent/scripts/pre-commit-hook.sh +259 -0
- package/.agent/scripts/pre-edit-check.sh +169 -0
- package/.agent/scripts/qlty-cli.sh +356 -0
- package/.agent/scripts/quality-cli-manager.sh +525 -0
- package/.agent/scripts/quality-feedback-helper.sh +462 -0
- package/.agent/scripts/quality-fix.sh +263 -0
- package/.agent/scripts/quality-loop-helper.sh +1108 -0
- package/.agent/scripts/ralph-loop-helper.sh +836 -0
- package/.agent/scripts/ralph-upstream-check.sh +341 -0
- package/.agent/scripts/secretlint-helper.sh +847 -0
- package/.agent/scripts/servers-helper.sh +241 -0
- package/.agent/scripts/ses-helper.sh +619 -0
- package/.agent/scripts/session-review-helper.sh +404 -0
- package/.agent/scripts/setup-linters-wizard.sh +379 -0
- package/.agent/scripts/setup-local-api-keys.sh +330 -0
- package/.agent/scripts/setup-mcp-integrations.sh +472 -0
- package/.agent/scripts/shared-constants.sh +246 -0
- package/.agent/scripts/site-crawler-helper.sh +1487 -0
- package/.agent/scripts/snyk-helper.sh +940 -0
- package/.agent/scripts/sonarcloud-autofix.sh +193 -0
- package/.agent/scripts/sonarcloud-cli.sh +191 -0
- package/.agent/scripts/sonarscanner-cli.sh +455 -0
- package/.agent/scripts/spaceship-helper.sh +747 -0
- package/.agent/scripts/stagehand-helper.sh +321 -0
- package/.agent/scripts/stagehand-python-helper.sh +321 -0
- package/.agent/scripts/stagehand-python-setup.sh +441 -0
- package/.agent/scripts/stagehand-setup.sh +439 -0
- package/.agent/scripts/system-cleanup.sh +340 -0
- package/.agent/scripts/terminal-title-helper.sh +388 -0
- package/.agent/scripts/terminal-title-setup.sh +549 -0
- package/.agent/scripts/test-stagehand-both-integration.sh +317 -0
- package/.agent/scripts/test-stagehand-integration.sh +309 -0
- package/.agent/scripts/test-stagehand-python-integration.sh +341 -0
- package/.agent/scripts/todo-ready.sh +263 -0
- package/.agent/scripts/tool-version-check.sh +362 -0
- package/.agent/scripts/toon-helper.sh +469 -0
- package/.agent/scripts/twilio-helper.sh +917 -0
- package/.agent/scripts/updown-helper.sh +279 -0
- package/.agent/scripts/validate-mcp-integrations.sh +250 -0
- package/.agent/scripts/validate-version-consistency.sh +131 -0
- package/.agent/scripts/vaultwarden-helper.sh +597 -0
- package/.agent/scripts/vercel-cli-helper.sh +816 -0
- package/.agent/scripts/verify-mirrors.sh +169 -0
- package/.agent/scripts/version-manager.sh +831 -0
- package/.agent/scripts/webhosting-helper.sh +471 -0
- package/.agent/scripts/webhosting-verify.sh +238 -0
- package/.agent/scripts/wordpress-mcp-helper.sh +508 -0
- package/.agent/scripts/worktree-helper.sh +595 -0
- package/.agent/scripts/worktree-sessions.sh +577 -0
- package/.agent/seo/dataforseo.md +215 -0
- package/.agent/seo/domain-research.md +532 -0
- package/.agent/seo/eeat-score.md +659 -0
- package/.agent/seo/google-search-console.md +366 -0
- package/.agent/seo/gsc-sitemaps.md +282 -0
- package/.agent/seo/keyword-research.md +521 -0
- package/.agent/seo/serper.md +278 -0
- package/.agent/seo/site-crawler.md +387 -0
- package/.agent/seo.md +236 -0
- package/.agent/services/accounting/quickfile.md +159 -0
- package/.agent/services/communications/telfon.md +470 -0
- package/.agent/services/communications/twilio.md +569 -0
- package/.agent/services/crm/fluentcrm.md +449 -0
- package/.agent/services/email/ses.md +399 -0
- package/.agent/services/hosting/101domains.md +378 -0
- package/.agent/services/hosting/closte.md +177 -0
- package/.agent/services/hosting/cloudflare.md +251 -0
- package/.agent/services/hosting/cloudron.md +478 -0
- package/.agent/services/hosting/dns-providers.md +335 -0
- package/.agent/services/hosting/domain-purchasing.md +344 -0
- package/.agent/services/hosting/hetzner.md +327 -0
- package/.agent/services/hosting/hostinger.md +287 -0
- package/.agent/services/hosting/localhost.md +419 -0
- package/.agent/services/hosting/spaceship.md +353 -0
- package/.agent/services/hosting/webhosting.md +330 -0
- package/.agent/social-media.md +69 -0
- package/.agent/templates/plans-template.md +114 -0
- package/.agent/templates/prd-template.md +129 -0
- package/.agent/templates/tasks-template.md +108 -0
- package/.agent/templates/todo-template.md +89 -0
- package/.agent/tools/ai-assistants/agno.md +471 -0
- package/.agent/tools/ai-assistants/capsolver.md +326 -0
- package/.agent/tools/ai-assistants/configuration.md +221 -0
- package/.agent/tools/ai-assistants/overview.md +209 -0
- package/.agent/tools/ai-assistants/status.md +171 -0
- package/.agent/tools/ai-assistants/windsurf.md +193 -0
- package/.agent/tools/ai-orchestration/autogen.md +406 -0
- package/.agent/tools/ai-orchestration/crewai.md +445 -0
- package/.agent/tools/ai-orchestration/langflow.md +405 -0
- package/.agent/tools/ai-orchestration/openprose.md +487 -0
- package/.agent/tools/ai-orchestration/overview.md +362 -0
- package/.agent/tools/ai-orchestration/packaging.md +647 -0
- package/.agent/tools/browser/agent-browser.md +464 -0
- package/.agent/tools/browser/browser-automation.md +400 -0
- package/.agent/tools/browser/chrome-devtools.md +282 -0
- package/.agent/tools/browser/crawl4ai-integration.md +422 -0
- package/.agent/tools/browser/crawl4ai-resources.md +277 -0
- package/.agent/tools/browser/crawl4ai-usage.md +416 -0
- package/.agent/tools/browser/crawl4ai.md +585 -0
- package/.agent/tools/browser/dev-browser.md +341 -0
- package/.agent/tools/browser/pagespeed.md +260 -0
- package/.agent/tools/browser/playwright.md +266 -0
- package/.agent/tools/browser/playwriter.md +310 -0
- package/.agent/tools/browser/stagehand-examples.md +456 -0
- package/.agent/tools/browser/stagehand-python.md +483 -0
- package/.agent/tools/browser/stagehand.md +421 -0
- package/.agent/tools/build-agent/agent-review.md +224 -0
- package/.agent/tools/build-agent/build-agent.md +784 -0
- package/.agent/tools/build-mcp/aidevops-plugin.md +476 -0
- package/.agent/tools/build-mcp/api-wrapper.md +445 -0
- package/.agent/tools/build-mcp/build-mcp.md +240 -0
- package/.agent/tools/build-mcp/deployment.md +401 -0
- package/.agent/tools/build-mcp/server-patterns.md +632 -0
- package/.agent/tools/build-mcp/transports.md +366 -0
- package/.agent/tools/code-review/auditing.md +383 -0
- package/.agent/tools/code-review/automation.md +219 -0
- package/.agent/tools/code-review/best-practices.md +203 -0
- package/.agent/tools/code-review/codacy.md +151 -0
- package/.agent/tools/code-review/code-simplifier.md +174 -0
- package/.agent/tools/code-review/code-standards.md +309 -0
- package/.agent/tools/code-review/coderabbit.md +101 -0
- package/.agent/tools/code-review/management.md +155 -0
- package/.agent/tools/code-review/qlty.md +248 -0
- package/.agent/tools/code-review/secretlint.md +565 -0
- package/.agent/tools/code-review/setup.md +250 -0
- package/.agent/tools/code-review/snyk.md +563 -0
- package/.agent/tools/code-review/tools.md +230 -0
- package/.agent/tools/content/summarize.md +353 -0
- package/.agent/tools/context/augment-context-engine.md +468 -0
- package/.agent/tools/context/context-builder-agent.md +76 -0
- package/.agent/tools/context/context-builder.md +375 -0
- package/.agent/tools/context/context7.md +371 -0
- package/.agent/tools/context/dspy.md +302 -0
- package/.agent/tools/context/dspyground.md +374 -0
- package/.agent/tools/context/llm-tldr.md +219 -0
- package/.agent/tools/context/osgrep.md +488 -0
- package/.agent/tools/context/prompt-optimization.md +338 -0
- package/.agent/tools/context/toon.md +292 -0
- package/.agent/tools/conversion/pandoc.md +304 -0
- package/.agent/tools/credentials/api-key-management.md +154 -0
- package/.agent/tools/credentials/api-key-setup.md +224 -0
- package/.agent/tools/credentials/environment-variables.md +180 -0
- package/.agent/tools/credentials/vaultwarden.md +382 -0
- package/.agent/tools/data-extraction/outscraper.md +974 -0
- package/.agent/tools/deployment/coolify-cli.md +388 -0
- package/.agent/tools/deployment/coolify-setup.md +353 -0
- package/.agent/tools/deployment/coolify.md +345 -0
- package/.agent/tools/deployment/vercel.md +390 -0
- package/.agent/tools/git/authentication.md +132 -0
- package/.agent/tools/git/gitea-cli.md +193 -0
- package/.agent/tools/git/github-actions.md +207 -0
- package/.agent/tools/git/github-cli.md +223 -0
- package/.agent/tools/git/gitlab-cli.md +190 -0
- package/.agent/tools/git/opencode-github-security.md +350 -0
- package/.agent/tools/git/opencode-github.md +328 -0
- package/.agent/tools/git/opencode-gitlab.md +252 -0
- package/.agent/tools/git/security.md +196 -0
- package/.agent/tools/git.md +207 -0
- package/.agent/tools/opencode/oh-my-opencode.md +375 -0
- package/.agent/tools/opencode/opencode-anthropic-auth.md +446 -0
- package/.agent/tools/opencode/opencode.md +651 -0
- package/.agent/tools/social-media/bird.md +437 -0
- package/.agent/tools/task-management/beads.md +336 -0
- package/.agent/tools/terminal/terminal-title.md +251 -0
- package/.agent/tools/ui/shadcn.md +196 -0
- package/.agent/tools/ui/ui-skills.md +115 -0
- package/.agent/tools/wordpress/localwp.md +311 -0
- package/.agent/tools/wordpress/mainwp.md +391 -0
- package/.agent/tools/wordpress/scf.md +527 -0
- package/.agent/tools/wordpress/wp-admin.md +729 -0
- package/.agent/tools/wordpress/wp-dev.md +940 -0
- package/.agent/tools/wordpress/wp-preferred.md +398 -0
- package/.agent/tools/wordpress.md +95 -0
- package/.agent/workflows/branch/bugfix.md +63 -0
- package/.agent/workflows/branch/chore.md +95 -0
- package/.agent/workflows/branch/experiment.md +115 -0
- package/.agent/workflows/branch/feature.md +59 -0
- package/.agent/workflows/branch/hotfix.md +98 -0
- package/.agent/workflows/branch/refactor.md +92 -0
- package/.agent/workflows/branch/release.md +96 -0
- package/.agent/workflows/branch.md +347 -0
- package/.agent/workflows/bug-fixing.md +267 -0
- package/.agent/workflows/changelog.md +129 -0
- package/.agent/workflows/code-audit-remote.md +279 -0
- package/.agent/workflows/conversation-starter.md +69 -0
- package/.agent/workflows/error-feedback.md +578 -0
- package/.agent/workflows/feature-development.md +355 -0
- package/.agent/workflows/git-workflow.md +702 -0
- package/.agent/workflows/multi-repo-workspace.md +268 -0
- package/.agent/workflows/plans.md +709 -0
- package/.agent/workflows/postflight.md +604 -0
- package/.agent/workflows/pr.md +571 -0
- package/.agent/workflows/preflight.md +278 -0
- package/.agent/workflows/ralph-loop.md +773 -0
- package/.agent/workflows/release.md +498 -0
- package/.agent/workflows/session-manager.md +254 -0
- package/.agent/workflows/session-review.md +311 -0
- package/.agent/workflows/sql-migrations.md +631 -0
- package/.agent/workflows/version-bump.md +283 -0
- package/.agent/workflows/wiki-update.md +333 -0
- package/.agent/workflows/worktree.md +477 -0
- package/LICENSE +21 -0
- package/README.md +1446 -0
- package/VERSION +1 -0
- package/aidevops.sh +1746 -0
- package/bin/aidevops +21 -0
- package/package.json +75 -0
- package/scripts/npm-postinstall.js +60 -0
- package/setup.sh +2366 -0
|
@@ -0,0 +1,773 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Ralph Wiggum iterative development loops for autonomous AI coding
|
|
3
|
+
mode: subagent
|
|
4
|
+
tools:
|
|
5
|
+
read: true
|
|
6
|
+
write: true
|
|
7
|
+
edit: true
|
|
8
|
+
bash: true
|
|
9
|
+
glob: true
|
|
10
|
+
grep: true
|
|
11
|
+
task: true
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Ralph Loop v2 - Iterative AI Development
|
|
15
|
+
|
|
16
|
+
Implementation of the Ralph Wiggum technique for iterative, self-referential AI development loops.
|
|
17
|
+
|
|
18
|
+
Based on [Geoffrey Huntley's Ralph technique](https://ghuntley.com/ralph/), enhanced with [flow-next architecture](https://github.com/gmickel/gmickel-claude-marketplace/tree/main/plugins/flow-next) for fresh context per iteration.
|
|
19
|
+
|
|
20
|
+
## v2 Architecture
|
|
21
|
+
|
|
22
|
+
The v2 implementation addresses context drift by using:
|
|
23
|
+
|
|
24
|
+
- **Fresh context per iteration** - External bash loop spawns new AI sessions
|
|
25
|
+
- **File I/O as state** - JSON state files, not conversation transcript
|
|
26
|
+
- **Re-anchor every iteration** - Re-read TODO.md, git state, memories
|
|
27
|
+
- **Receipt-based verification** - Proof of work for each iteration
|
|
28
|
+
- **Memory integration** - SQLite FTS5 for cross-session learning
|
|
29
|
+
|
|
30
|
+
This follows Anthropic's own guidance: "agents must re-anchor from sources of truth to prevent drift."
|
|
31
|
+
|
|
32
|
+
## What is Ralph?
|
|
33
|
+
|
|
34
|
+
Ralph is a development methodology based on continuous AI agent loops. The core concept:
|
|
35
|
+
|
|
36
|
+
> "Ralph is a Bash loop" - a simple `while true` that repeatedly feeds an AI agent a prompt, allowing it to iteratively improve its work until completion.
|
|
37
|
+
|
|
38
|
+
The technique is named after Ralph Wiggum from The Simpsons, embodying the philosophy of persistent iteration despite setbacks.
|
|
39
|
+
|
|
40
|
+
## How It Works
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
1. User starts loop with prompt and completion criteria
|
|
44
|
+
2. AI works on the task
|
|
45
|
+
3. AI tries to exit/complete
|
|
46
|
+
4. Loop checks for completion promise
|
|
47
|
+
5. If not complete: feed SAME prompt back
|
|
48
|
+
6. AI sees previous work in files/git
|
|
49
|
+
7. Repeat until completion or max iterations
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The loop creates a **self-referential feedback loop** where:
|
|
53
|
+
|
|
54
|
+
- The prompt never changes between iterations
|
|
55
|
+
- Claude's previous work persists in files
|
|
56
|
+
- Each iteration sees modified files and git history
|
|
57
|
+
- Claude autonomously improves by reading its own past work
|
|
58
|
+
|
|
59
|
+
## Quick Start
|
|
60
|
+
|
|
61
|
+
### v2: Fresh Sessions (Recommended)
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# External loop with fresh sessions per iteration
|
|
65
|
+
~/.aidevops/agents/scripts/ralph-loop-helper.sh run \
|
|
66
|
+
"Build a REST API for todos" \
|
|
67
|
+
--tool opencode \
|
|
68
|
+
--max-iterations 20 \
|
|
69
|
+
--completion-promise "TASK_COMPLETE"
|
|
70
|
+
|
|
71
|
+
# Check status
|
|
72
|
+
~/.aidevops/agents/scripts/ralph-loop-helper.sh status
|
|
73
|
+
|
|
74
|
+
# Cancel
|
|
75
|
+
~/.aidevops/agents/scripts/ralph-loop-helper.sh cancel
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Auto-Branch Handling (Loop Mode)
|
|
79
|
+
|
|
80
|
+
When running in loop mode on main/master, Ralph automatically handles branch decisions:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# The helper script checks branch and auto-decides
|
|
84
|
+
~/.aidevops/agents/scripts/pre-edit-check.sh --loop-mode --task "Build a REST API for todos"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Auto-decision rules:**
|
|
88
|
+
|
|
89
|
+
| Task Type | Detection Keywords | Action |
|
|
90
|
+
|-----------|-------------------|--------|
|
|
91
|
+
| Docs-only | readme, changelog, docs/, documentation, typo, spelling | Stay on main (exit 0) |
|
|
92
|
+
| Code | feature, fix, bug, implement, refactor, add, update, enhance | Create worktree (exit 2) |
|
|
93
|
+
|
|
94
|
+
**Exit codes:**
|
|
95
|
+
- `0` - Proceed (on feature branch or docs-only on main)
|
|
96
|
+
- `2` - Create worktree (code task detected on main)
|
|
97
|
+
- `1` - Error (shouldn't occur in loop mode)
|
|
98
|
+
|
|
99
|
+
This eliminates the interactive prompt that previously stalled loop agents.
|
|
100
|
+
|
|
101
|
+
### Legacy: Same Session
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# For tools with hook support (Claude Code)
|
|
105
|
+
/ralph-loop "Build a REST API" --max-iterations 50 --completion-promise "COMPLETE"
|
|
106
|
+
|
|
107
|
+
# Cancel
|
|
108
|
+
/cancel-ralph
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Commands
|
|
112
|
+
|
|
113
|
+
### ralph-loop-helper.sh run (v2)
|
|
114
|
+
|
|
115
|
+
Run external loop with fresh AI sessions per iteration.
|
|
116
|
+
|
|
117
|
+
**Usage:**
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
ralph-loop-helper.sh run "<prompt>" --tool <tool> [options]
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Options:**
|
|
124
|
+
|
|
125
|
+
| Option | Description | Default |
|
|
126
|
+
|--------|-------------|---------|
|
|
127
|
+
| `--tool <name>` | AI CLI tool (opencode, claude, aider) | opencode |
|
|
128
|
+
| `--max-iterations <n>` | Stop after N iterations | 50 |
|
|
129
|
+
| `--completion-promise <text>` | Phrase that signals completion | TASK_COMPLETE |
|
|
130
|
+
| `--max-attempts <n>` | Block task after N failures | 5 |
|
|
131
|
+
| `--task-id <id>` | Task ID for tracking | auto-generated |
|
|
132
|
+
|
|
133
|
+
### /ralph-loop (Legacy)
|
|
134
|
+
|
|
135
|
+
Start a Ralph loop in same session (for tools with hook support).
|
|
136
|
+
|
|
137
|
+
**Usage:**
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
/ralph-loop "<prompt>" [--max-iterations <n>] [--completion-promise "<text>"]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Options:**
|
|
144
|
+
|
|
145
|
+
| Option | Description | Default |
|
|
146
|
+
|--------|-------------|---------|
|
|
147
|
+
| `--max-iterations <n>` | Stop after N iterations | unlimited |
|
|
148
|
+
| `--completion-promise <text>` | Phrase that signals completion | none |
|
|
149
|
+
|
|
150
|
+
### /cancel-ralph
|
|
151
|
+
|
|
152
|
+
Cancel the active Ralph loop.
|
|
153
|
+
|
|
154
|
+
**Usage:**
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
/cancel-ralph
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## State File
|
|
161
|
+
|
|
162
|
+
Ralph stores its state in `.agent/loop-state/ralph-loop.local.md` (gitignored):
|
|
163
|
+
|
|
164
|
+
```yaml
|
|
165
|
+
---
|
|
166
|
+
active: true
|
|
167
|
+
iteration: 5
|
|
168
|
+
max_iterations: 50
|
|
169
|
+
completion_promise: "COMPLETE"
|
|
170
|
+
started_at: "2025-01-08T10:30:00Z"
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
Your original prompt here...
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Completion Promise
|
|
177
|
+
|
|
178
|
+
To signal completion, output the exact text in `<promise>` tags:
|
|
179
|
+
|
|
180
|
+
```text
|
|
181
|
+
<promise>COMPLETE</promise>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Critical Rules:**
|
|
185
|
+
|
|
186
|
+
- Use `<promise>` XML tags exactly as shown
|
|
187
|
+
- The statement MUST be completely and unequivocally TRUE
|
|
188
|
+
- Do NOT output false statements to exit the loop
|
|
189
|
+
- Do NOT lie even if you think you should exit
|
|
190
|
+
|
|
191
|
+
## Prompt Writing Best Practices
|
|
192
|
+
|
|
193
|
+
### 1. Clear Completion Criteria
|
|
194
|
+
|
|
195
|
+
**Bad:**
|
|
196
|
+
|
|
197
|
+
```text
|
|
198
|
+
Build a todo API and make it good.
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Good:**
|
|
202
|
+
|
|
203
|
+
```text
|
|
204
|
+
Build a REST API for todos.
|
|
205
|
+
|
|
206
|
+
When complete:
|
|
207
|
+
- All CRUD endpoints working
|
|
208
|
+
- Input validation in place
|
|
209
|
+
- Tests passing (coverage > 80%)
|
|
210
|
+
- README with API docs
|
|
211
|
+
- Output: <promise>COMPLETE</promise>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### 2. Incremental Goals
|
|
215
|
+
|
|
216
|
+
**Bad:**
|
|
217
|
+
|
|
218
|
+
```text
|
|
219
|
+
Create a complete e-commerce platform.
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**Good:**
|
|
223
|
+
|
|
224
|
+
```text
|
|
225
|
+
Phase 1: User authentication (JWT, tests)
|
|
226
|
+
Phase 2: Product catalog (list/search, tests)
|
|
227
|
+
Phase 3: Shopping cart (add/remove, tests)
|
|
228
|
+
|
|
229
|
+
Output <promise>COMPLETE</promise> when all phases done.
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### 3. Self-Correction
|
|
233
|
+
|
|
234
|
+
**Bad:**
|
|
235
|
+
|
|
236
|
+
```text
|
|
237
|
+
Write code for feature X.
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**Good:**
|
|
241
|
+
|
|
242
|
+
```text
|
|
243
|
+
Implement feature X following TDD:
|
|
244
|
+
1. Write failing tests
|
|
245
|
+
2. Implement feature
|
|
246
|
+
3. Run tests
|
|
247
|
+
4. If any fail, debug and fix
|
|
248
|
+
5. Refactor if needed
|
|
249
|
+
6. Repeat until all green
|
|
250
|
+
7. Output: <promise>COMPLETE</promise>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### 4. Documentation Updates
|
|
254
|
+
|
|
255
|
+
Include documentation requirements in your completion criteria:
|
|
256
|
+
|
|
257
|
+
**README updates** - When adding features, APIs, or changing behavior:
|
|
258
|
+
|
|
259
|
+
```text
|
|
260
|
+
Implement feature X.
|
|
261
|
+
|
|
262
|
+
When complete:
|
|
263
|
+
- Feature working with tests
|
|
264
|
+
- README.md updated with usage examples
|
|
265
|
+
- Output: <promise>COMPLETE</promise>
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
**Changelog via commits** - Use conventional commit messages for auto-generated changelogs:
|
|
269
|
+
|
|
270
|
+
```text
|
|
271
|
+
# Good commit messages (auto-included in changelog)
|
|
272
|
+
feat: add user authentication
|
|
273
|
+
fix: resolve memory leak in connection pool
|
|
274
|
+
docs: update API documentation
|
|
275
|
+
|
|
276
|
+
# Excluded from changelog
|
|
277
|
+
chore: update dependencies
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
The release workflow auto-generates CHANGELOG.md from conventional commits. See `workflows/changelog.md`.
|
|
281
|
+
|
|
282
|
+
### 5. Escape Hatches
|
|
283
|
+
|
|
284
|
+
Always use `--max-iterations` as a safety net:
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
# Recommended: Always set a reasonable iteration limit
|
|
288
|
+
/ralph-loop "Try to implement feature X" --max-iterations 20
|
|
289
|
+
|
|
290
|
+
# In your prompt, include what to do if stuck:
|
|
291
|
+
# "After 15 iterations, if not complete:
|
|
292
|
+
# - Document what's blocking progress
|
|
293
|
+
# - List what was attempted
|
|
294
|
+
# - Suggest alternative approaches"
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
## When to Use Ralph
|
|
298
|
+
|
|
299
|
+
**Good for:**
|
|
300
|
+
|
|
301
|
+
- Well-defined tasks with clear success criteria
|
|
302
|
+
- Tasks requiring iteration and refinement (e.g., getting tests to pass)
|
|
303
|
+
- Greenfield projects where you can walk away
|
|
304
|
+
- Tasks with automatic verification (tests, linters)
|
|
305
|
+
|
|
306
|
+
**Not good for:**
|
|
307
|
+
|
|
308
|
+
- Tasks requiring human judgment or design decisions
|
|
309
|
+
- One-shot operations
|
|
310
|
+
- Tasks with unclear success criteria
|
|
311
|
+
- Production debugging (use targeted debugging instead)
|
|
312
|
+
|
|
313
|
+
## Philosophy
|
|
314
|
+
|
|
315
|
+
### 1. Context Pollution Prevention
|
|
316
|
+
|
|
317
|
+
Every AI session has a context window (working memory). As you work:
|
|
318
|
+
- Files read, commands run, outputs produced all accumulate
|
|
319
|
+
- Wrong turns and half-baked plans stay in context
|
|
320
|
+
- **You can keep adding, but you can't delete**
|
|
321
|
+
|
|
322
|
+
Eventually you hit the familiar symptom cluster:
|
|
323
|
+
- Repeating itself
|
|
324
|
+
- "Fixing" the same bug in slightly different ways
|
|
325
|
+
- Confidently undoing its own previous fix
|
|
326
|
+
- Circular reasoning
|
|
327
|
+
|
|
328
|
+
That's **context pollution**. Once you're there, "try harder" doesn't work.
|
|
329
|
+
|
|
330
|
+
Ralph doesn't try to clean the memory. It throws it away and starts fresh.
|
|
331
|
+
|
|
332
|
+
### 2. Progress Persists, Failures Don't
|
|
333
|
+
|
|
334
|
+
The trick is simple: **externalize state**.
|
|
335
|
+
|
|
336
|
+
| Context (bad for state) | Files + Git (good for state) |
|
|
337
|
+
|------------------------|------------------------------|
|
|
338
|
+
| Dies with the conversation | Only what you choose to write |
|
|
339
|
+
| Persists forever in session | Can be patched / rolled back |
|
|
340
|
+
| Polluted by dead ends | Git doesn't hallucinate |
|
|
341
|
+
|
|
342
|
+
Each fresh agent starts clean, then reconstructs reality from files.
|
|
343
|
+
|
|
344
|
+
### 3. Guardrails: Same Mistake Never Happens Twice
|
|
345
|
+
|
|
346
|
+
Ralph will do something stupid. The win condition is not "no mistakes."
|
|
347
|
+
|
|
348
|
+
**The win condition is the same mistake never happens twice.**
|
|
349
|
+
|
|
350
|
+
When something breaks, the loop stores it as a guardrail (sign):
|
|
351
|
+
|
|
352
|
+
```markdown
|
|
353
|
+
### Sign: check imports before adding
|
|
354
|
+
- trigger: adding a new import statement
|
|
355
|
+
- instruction: check if import already exists
|
|
356
|
+
- added after: iteration 3 (duplicate import broke build)
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
Guardrails are append-only. Mistakes evaporate from context. Lessons accumulate in files.
|
|
360
|
+
|
|
361
|
+
Next iteration reads guardrails first. Cheap. Brutal. Effective.
|
|
362
|
+
|
|
363
|
+
### 4. Iteration > Perfection
|
|
364
|
+
|
|
365
|
+
Don't aim for perfect on first try. Let the loop refine the work.
|
|
366
|
+
|
|
367
|
+
### 5. Failures Are Data
|
|
368
|
+
|
|
369
|
+
"Deterministically bad" means failures are predictable and informative. Use them to tune prompts.
|
|
370
|
+
|
|
371
|
+
### 6. Operator Skill Matters
|
|
372
|
+
|
|
373
|
+
Success depends on writing good prompts, not just having a good model.
|
|
374
|
+
|
|
375
|
+
### 7. Persistence Wins
|
|
376
|
+
|
|
377
|
+
Keep trying until success. The loop handles retry logic automatically.
|
|
378
|
+
|
|
379
|
+
## Cross-Tool Compatibility
|
|
380
|
+
|
|
381
|
+
This implementation works with:
|
|
382
|
+
|
|
383
|
+
| Tool | Method |
|
|
384
|
+
|------|--------|
|
|
385
|
+
| Claude Code | Native plugin (ralph-wiggum) |
|
|
386
|
+
| OpenCode | `/ralph-loop` command + helper script |
|
|
387
|
+
| Other AI CLIs | Helper script with manual loop |
|
|
388
|
+
|
|
389
|
+
### For Tools Without Hook Support
|
|
390
|
+
|
|
391
|
+
If your AI CLI doesn't support stop hooks, use the external loop:
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
# External bash loop (for tools without hook support)
|
|
395
|
+
~/.aidevops/agents/scripts/ralph-loop-helper.sh external \
|
|
396
|
+
"Your prompt here" \
|
|
397
|
+
--max-iterations 20 \
|
|
398
|
+
--completion-promise "DONE" \
|
|
399
|
+
--tool opencode
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
## Monitoring
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
# View current iteration
|
|
406
|
+
grep '^iteration:' .agent/loop-state/ralph-loop.local.md
|
|
407
|
+
|
|
408
|
+
# View full state
|
|
409
|
+
head -10 .agent/loop-state/ralph-loop.local.md
|
|
410
|
+
|
|
411
|
+
# Check if loop is active
|
|
412
|
+
test -f .agent/loop-state/ralph-loop.local.md && echo "Active" || echo "Not active"
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
## Multi-Worktree Awareness
|
|
416
|
+
|
|
417
|
+
When working with git worktrees, Ralph loops are aware of parallel sessions.
|
|
418
|
+
|
|
419
|
+
### Check All Worktrees
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
# Show loops across all worktrees
|
|
423
|
+
~/.aidevops/agents/scripts/ralph-loop-helper.sh status --all
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
Output shows:
|
|
427
|
+
- Branch name for each active loop
|
|
428
|
+
- Current iteration and max
|
|
429
|
+
- Which worktree is current
|
|
430
|
+
|
|
431
|
+
### Parallel Loop Warnings
|
|
432
|
+
|
|
433
|
+
When starting a new loop, the helper automatically checks for other active loops:
|
|
434
|
+
|
|
435
|
+
```text
|
|
436
|
+
Other active Ralph loops detected:
|
|
437
|
+
- feature/other-task (iteration 5)
|
|
438
|
+
|
|
439
|
+
Use 'ralph-loop-helper.sh status --all' to see details
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
This helps prevent confusion when multiple AI sessions are running in parallel.
|
|
443
|
+
|
|
444
|
+
### Integration with worktree-sessions.sh
|
|
445
|
+
|
|
446
|
+
The worktree session mapper shows Ralph loop status:
|
|
447
|
+
|
|
448
|
+
```bash
|
|
449
|
+
# List all worktrees with their sessions and loop status
|
|
450
|
+
~/.aidevops/agents/scripts/worktree-sessions.sh list
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
Output includes a "Ralph loop: iteration X/Y" line for worktrees with active loops.
|
|
454
|
+
|
|
455
|
+
## CI/CD Wait Time Optimization
|
|
456
|
+
|
|
457
|
+
When using Ralph loops with PR review workflows, the loop uses adaptive timing based on observed CI/CD service completion times.
|
|
458
|
+
|
|
459
|
+
### Evidence-Based Timing (from PR #19 analysis)
|
|
460
|
+
|
|
461
|
+
| Service Category | Services | Typical Time | Initial Wait | Poll Interval |
|
|
462
|
+
|------------------|----------|--------------|--------------|---------------|
|
|
463
|
+
| **Fast** | CodeFactor, Version, Framework | 1-5s | 10s | 5s |
|
|
464
|
+
| **Medium** | SonarCloud, Codacy, Qlty | 43-62s | 60s | 15s |
|
|
465
|
+
| **Slow** | CodeRabbit | 120-180s | 120s | 30s |
|
|
466
|
+
|
|
467
|
+
### Adaptive Waiting Strategy
|
|
468
|
+
|
|
469
|
+
The `quality-loop-helper.sh` uses three strategies:
|
|
470
|
+
|
|
471
|
+
1. **Service-aware initial wait**: Waits based on the slowest pending check
|
|
472
|
+
2. **Exponential backoff**: Increases wait time between iterations (15s → 30s → 60s → 120s max)
|
|
473
|
+
3. **Hybrid approach**: Uses the larger of backoff or adaptive wait
|
|
474
|
+
|
|
475
|
+
### Customizing Timing
|
|
476
|
+
|
|
477
|
+
Edit `.agent/scripts/shared-constants.sh` to adjust timing constants:
|
|
478
|
+
|
|
479
|
+
```bash
|
|
480
|
+
# Fast checks
|
|
481
|
+
readonly CI_WAIT_FAST=10
|
|
482
|
+
readonly CI_POLL_FAST=5
|
|
483
|
+
|
|
484
|
+
# Medium checks
|
|
485
|
+
readonly CI_WAIT_MEDIUM=60
|
|
486
|
+
readonly CI_POLL_MEDIUM=15
|
|
487
|
+
|
|
488
|
+
# Slow checks (CodeRabbit)
|
|
489
|
+
readonly CI_WAIT_SLOW=120
|
|
490
|
+
readonly CI_POLL_SLOW=30
|
|
491
|
+
|
|
492
|
+
# Backoff settings
|
|
493
|
+
readonly CI_BACKOFF_BASE=15
|
|
494
|
+
readonly CI_BACKOFF_MAX=120
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
### Gathering Your Own Timing Data
|
|
498
|
+
|
|
499
|
+
To optimize for your specific CI/CD setup:
|
|
500
|
+
|
|
501
|
+
1. Run `gh run list --limit 10 --json name,updatedAt,createdAt` to see workflow durations
|
|
502
|
+
2. Check PR check completion times in GitHub UI
|
|
503
|
+
3. Update constants in `shared-constants.sh` based on your observations
|
|
504
|
+
|
|
505
|
+
## Real-World Results
|
|
506
|
+
|
|
507
|
+
From the original Ralph technique:
|
|
508
|
+
|
|
509
|
+
- Successfully generated 6 repositories overnight in Y Combinator hackathon testing
|
|
510
|
+
- One $50k contract completed for $297 in API costs
|
|
511
|
+
- Created entire programming language ("cursed") over 3 months using this approach
|
|
512
|
+
|
|
513
|
+
## Upstream Sync
|
|
514
|
+
|
|
515
|
+
This is an **independent implementation** inspired by the Claude Code ralph-wiggum plugin, not a mirror. We maintain our own codebase for cross-tool compatibility.
|
|
516
|
+
|
|
517
|
+
**Check for upstream changes:**
|
|
518
|
+
|
|
519
|
+
```bash
|
|
520
|
+
~/.aidevops/agents/scripts/ralph-upstream-check.sh
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
This compares our implementation against the Claude plugin and reports any significant differences or new features we might want to incorporate.
|
|
524
|
+
|
|
525
|
+
The check runs automatically when starting an OpenCode session in the aidevops repository.
|
|
526
|
+
|
|
527
|
+
## Session Completion & Spawning
|
|
528
|
+
|
|
529
|
+
Loop agents should detect completion and suggest next steps.
|
|
530
|
+
|
|
531
|
+
### Loop Completion Detection
|
|
532
|
+
|
|
533
|
+
When a loop completes successfully (promise fulfilled), suggest:
|
|
534
|
+
|
|
535
|
+
```text
|
|
536
|
+
<promise>PR_MERGED</promise>
|
|
537
|
+
|
|
538
|
+
---
|
|
539
|
+
Loop complete. PR #123 merged successfully.
|
|
540
|
+
|
|
541
|
+
Suggestions:
|
|
542
|
+
1. Run @agent-review to capture learnings
|
|
543
|
+
2. Start new session for next task
|
|
544
|
+
3. Spawn parallel session for related work
|
|
545
|
+
---
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
### Spawning New Sessions from Loops
|
|
549
|
+
|
|
550
|
+
Loops can spawn new OpenCode sessions for parallel work. See `workflows/session-manager.md` for full spawning patterns (background sessions, terminal tabs, worktrees).
|
|
551
|
+
|
|
552
|
+
**Quick reference:**
|
|
553
|
+
|
|
554
|
+
```bash
|
|
555
|
+
# Background session
|
|
556
|
+
opencode run "Continue with next task" --agent Build+ &
|
|
557
|
+
|
|
558
|
+
# With worktree (recommended for parallel branches)
|
|
559
|
+
~/.aidevops/agents/scripts/worktree-helper.sh add feature/parallel-task
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
### Integration with quality-loop-helper.sh
|
|
563
|
+
|
|
564
|
+
The `quality-loop-helper.sh` script can spawn new sessions on loop completion:
|
|
565
|
+
|
|
566
|
+
```bash
|
|
567
|
+
# After successful loop, offer to spawn next task
|
|
568
|
+
~/.aidevops/agents/scripts/quality-loop-helper.sh preflight --on-complete spawn
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
## Full Development Loop
|
|
572
|
+
|
|
573
|
+
For end-to-end automation from task conception to deployment, use the Full Development Loop orchestrator. This chains all phases together for maximum AI utility.
|
|
574
|
+
|
|
575
|
+
### Quick Start
|
|
576
|
+
|
|
577
|
+
```bash
|
|
578
|
+
# Start full loop
|
|
579
|
+
~/.aidevops/agents/scripts/full-loop-helper.sh start "Implement feature X with tests"
|
|
580
|
+
|
|
581
|
+
# Check status
|
|
582
|
+
~/.aidevops/agents/scripts/full-loop-helper.sh status
|
|
583
|
+
|
|
584
|
+
# Resume after manual intervention
|
|
585
|
+
~/.aidevops/agents/scripts/full-loop-helper.sh resume
|
|
586
|
+
|
|
587
|
+
# Cancel if needed
|
|
588
|
+
~/.aidevops/agents/scripts/full-loop-helper.sh cancel
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
### Loop Phases
|
|
592
|
+
|
|
593
|
+
```text
|
|
594
|
+
┌─────────────────┐
|
|
595
|
+
│ 1. TASK LOOP │ Ralph loop for implementation
|
|
596
|
+
│ (Development) │ Promise: TASK_COMPLETE
|
|
597
|
+
└────────┬────────┘
|
|
598
|
+
│ auto
|
|
599
|
+
▼
|
|
600
|
+
┌─────────────────┐
|
|
601
|
+
│ 2. PREFLIGHT │ Quality checks before commit
|
|
602
|
+
│ (Quality Gate) │ Promise: PREFLIGHT_PASS
|
|
603
|
+
└────────┬────────┘
|
|
604
|
+
│ auto
|
|
605
|
+
▼
|
|
606
|
+
┌─────────────────┐
|
|
607
|
+
│ 3. PR CREATE │ Auto-create pull request
|
|
608
|
+
│ (Auto-create) │ Output: PR URL
|
|
609
|
+
└────────┬────────┘
|
|
610
|
+
│ auto
|
|
611
|
+
▼
|
|
612
|
+
┌─────────────────┐
|
|
613
|
+
│ 4. PR LOOP │ Monitor CI and approval
|
|
614
|
+
│ (Review/CI) │ Promise: PR_MERGED
|
|
615
|
+
└────────┬────────┘
|
|
616
|
+
│ auto
|
|
617
|
+
▼
|
|
618
|
+
┌─────────────────┐
|
|
619
|
+
│ 5. POSTFLIGHT │ Verify release health
|
|
620
|
+
│ (Verify) │ Promise: RELEASE_HEALTHY
|
|
621
|
+
└────────┬────────┘
|
|
622
|
+
│ conditional (aidevops repo only)
|
|
623
|
+
▼
|
|
624
|
+
┌─────────────────┐
|
|
625
|
+
│ 6. DEPLOY │ Run setup.sh
|
|
626
|
+
│ (Local Setup) │ Promise: DEPLOYED
|
|
627
|
+
└─────────────────┘
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
| Phase | Script | Promise | Auto-Trigger |
|
|
631
|
+
|-------|--------|---------|--------------|
|
|
632
|
+
| Task Development | `ralph-loop-helper.sh` | `TASK_COMPLETE` | Manual start |
|
|
633
|
+
| Preflight | `quality-loop-helper.sh preflight` | `PREFLIGHT_PASS` | After task |
|
|
634
|
+
| PR Creation | `gh pr create` | (PR URL) | After preflight |
|
|
635
|
+
| PR Review | `quality-loop-helper.sh pr-review` | `PR_MERGED` | After PR create |
|
|
636
|
+
| Postflight | `quality-loop-helper.sh postflight` | `RELEASE_HEALTHY` | After merge |
|
|
637
|
+
| Deploy | `./setup.sh` (aidevops only) | `DEPLOYED` | After postflight |
|
|
638
|
+
|
|
639
|
+
### Human Decision Points
|
|
640
|
+
|
|
641
|
+
The loop is designed for maximum AI autonomy while preserving human control at strategic points:
|
|
642
|
+
|
|
643
|
+
| Phase | AI Autonomous | Human Required |
|
|
644
|
+
|-------|---------------|----------------|
|
|
645
|
+
| Task Development | Code changes, iterations, fixes, README updates | Initial task definition, scope decisions |
|
|
646
|
+
| Preflight | Auto-fix, re-run checks | Override to skip (emergency only) |
|
|
647
|
+
| PR Creation | Auto-create with `--fill` | Custom title/description if needed |
|
|
648
|
+
| PR Review | Address feedback, push fixes | Approve/merge (if required by repo) |
|
|
649
|
+
| Postflight | Monitor, report issues | Rollback decision if issues found |
|
|
650
|
+
| Deploy | Run `setup.sh` | None (fully autonomous) |
|
|
651
|
+
|
|
652
|
+
### Documentation in Loops
|
|
653
|
+
|
|
654
|
+
**README updates**: Include in task development phase when adding features/APIs.
|
|
655
|
+
|
|
656
|
+
**Changelog**: Auto-generated from conventional commits during release. Use proper prefixes:
|
|
657
|
+
- `feat:` → Added section
|
|
658
|
+
- `fix:` → Fixed section
|
|
659
|
+
- `docs:` → Changed section
|
|
660
|
+
- `chore:` → Excluded from changelog
|
|
661
|
+
|
|
662
|
+
See `workflows/changelog.md` for details.
|
|
663
|
+
|
|
664
|
+
### Options
|
|
665
|
+
|
|
666
|
+
```bash
|
|
667
|
+
full-loop-helper.sh start "<prompt>" [options]
|
|
668
|
+
|
|
669
|
+
Options:
|
|
670
|
+
--max-task-iterations N Max iterations for task (default: 50)
|
|
671
|
+
--max-preflight-iterations N Max iterations for preflight (default: 5)
|
|
672
|
+
--max-pr-iterations N Max iterations for PR review (default: 20)
|
|
673
|
+
--skip-preflight Skip preflight checks (not recommended)
|
|
674
|
+
--skip-postflight Skip postflight monitoring
|
|
675
|
+
--no-auto-pr Don't auto-create PR, pause for human
|
|
676
|
+
--no-auto-deploy Don't auto-run setup.sh (aidevops only)
|
|
677
|
+
--dry-run Show what would happen without executing
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
### aidevops-Specific Behavior
|
|
681
|
+
|
|
682
|
+
When working in the aidevops repository (detected by repo name or `.aidevops-repo` marker), the full loop automatically runs `setup.sh` after successful postflight to deploy changes locally.
|
|
683
|
+
|
|
684
|
+
```bash
|
|
685
|
+
# In aidevops repo, this will auto-deploy
|
|
686
|
+
full-loop-helper.sh start "Add new helper script"
|
|
687
|
+
|
|
688
|
+
# Disable auto-deploy if needed
|
|
689
|
+
full-loop-helper.sh start "Add new helper script" --no-auto-deploy
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
### State Management
|
|
693
|
+
|
|
694
|
+
The full loop maintains state in `.agent/loop-state/full-loop.local.md` (gitignored), allowing:
|
|
695
|
+
|
|
696
|
+
- Resume after interruption
|
|
697
|
+
- Track current phase
|
|
698
|
+
- Preserve PR number across phases
|
|
699
|
+
|
|
700
|
+
```bash
|
|
701
|
+
# Check current state
|
|
702
|
+
cat .agent/loop-state/full-loop.local.md
|
|
703
|
+
|
|
704
|
+
# Resume from where you left off
|
|
705
|
+
full-loop-helper.sh resume
|
|
706
|
+
```
|
|
707
|
+
|
|
708
|
+
## OpenProse Integration
|
|
709
|
+
|
|
710
|
+
For complex multi-agent orchestration within Ralph loops, consider using OpenProse DSL patterns. OpenProse provides explicit control flow that complements Ralph's iterative approach.
|
|
711
|
+
|
|
712
|
+
### Parallel Reviews Pattern
|
|
713
|
+
|
|
714
|
+
Instead of sequential reviews, use OpenProse-style parallel blocks:
|
|
715
|
+
|
|
716
|
+
```prose
|
|
717
|
+
# Traditional sequential
|
|
718
|
+
session "Security review"
|
|
719
|
+
session "Performance review"
|
|
720
|
+
session "Style review"
|
|
721
|
+
session "Synthesize"
|
|
722
|
+
|
|
723
|
+
# OpenProse parallel pattern
|
|
724
|
+
parallel:
|
|
725
|
+
security = session "Security review"
|
|
726
|
+
perf = session "Performance review"
|
|
727
|
+
style = session "Style review"
|
|
728
|
+
|
|
729
|
+
session "Synthesize all reviews"
|
|
730
|
+
context: { security, perf, style }
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
### AI-Evaluated Conditions
|
|
734
|
+
|
|
735
|
+
OpenProse's discretion markers (`**...**`) provide cleaner condition syntax:
|
|
736
|
+
|
|
737
|
+
```prose
|
|
738
|
+
loop until **all tests pass and code coverage exceeds 80%** (max: 20):
|
|
739
|
+
session "Run tests, analyze failures, fix bugs"
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
### Error Recovery
|
|
743
|
+
|
|
744
|
+
OpenProse's `try/catch/retry` semantics for resilient loops:
|
|
745
|
+
|
|
746
|
+
```prose
|
|
747
|
+
loop until **task complete** (max: 50):
|
|
748
|
+
try:
|
|
749
|
+
session "Attempt implementation"
|
|
750
|
+
retry: 3
|
|
751
|
+
backoff: "exponential"
|
|
752
|
+
catch as err:
|
|
753
|
+
session "Analyze failure and adjust approach"
|
|
754
|
+
context: err
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
### When to Use OpenProse vs Native Ralph
|
|
758
|
+
|
|
759
|
+
| Scenario | Recommendation |
|
|
760
|
+
|----------|----------------|
|
|
761
|
+
| Simple iterative task | Native Ralph loop |
|
|
762
|
+
| Multi-agent parallel work | OpenProse `parallel:` blocks |
|
|
763
|
+
| Complex conditional logic | OpenProse `if`/`choice` blocks |
|
|
764
|
+
| Error recovery workflows | OpenProse `try/catch/retry` |
|
|
765
|
+
|
|
766
|
+
See `tools/ai-orchestration/openprose.md` for full OpenProse documentation.
|
|
767
|
+
|
|
768
|
+
## Learn More
|
|
769
|
+
|
|
770
|
+
- Original technique: <https://ghuntley.com/ralph/>
|
|
771
|
+
- Ralph Orchestrator: <https://github.com/mikeyobrien/ralph-orchestrator>
|
|
772
|
+
- Claude Code plugin: <https://github.com/anthropics/claude-code/tree/main/plugins/ralph-wiggum>
|
|
773
|
+
- OpenProse DSL: <https://github.com/openprose/prose>
|