{
  "schemaVersion": "1.0",
  "item": {
    "slug": "ralph-loop-writer",
    "name": "Writes ralph loops for you that you can copy and paste",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/Walkamolee/ralph-loop-writer",
    "canonicalUrl": "https://clawhub.ai/Walkamolee/ralph-loop-writer",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/ralph-loop-writer",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=ralph-loop-writer",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/ralph-loop-writer"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/ralph-loop-writer",
    "agentPageUrl": "https://openagent3.xyz/skills/ralph-loop-writer/agent",
    "manifestUrl": "https://openagent3.xyz/skills/ralph-loop-writer/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/ralph-loop-writer/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Ralph Command Generator",
        "body": "Generate optimized loop commands for automating Claude Code, Gemini CLI, or Grok CLI with PROMPT.md."
      },
      {
        "title": "Step 1: Choose AI Tool",
        "body": "Use AskUserQuestion:\n\nQuestion: \"Which AI CLI tool do you want to use?\"\nHeader: \"AI Tool\"\nOptions:\n\n\"Claude Code (Recommended)\" - \"Claude AI assistant CLI\"\n\"Gemini CLI\" - \"Google Gemini AI assistant\"\n\"Grok CLI\" - \"xAI Grok AI assistant with agentic coding\"\n\nStore the choice for later."
      },
      {
        "title": "Step 2: Choose Model",
        "body": "Use AskUserQuestion based on AI tool choice:\n\nIf Claude Code selected:\n\nQuestion: \"Which Claude model do you want to use?\"\nHeader: \"Model\"\nOptions:\n\n\"Default (Recommended)\" - \"Use default model (currently Sonnet 4.5)\"\n\"Haiku\" - \"Fastest and most cost-effective\"\n\"Sonnet\" - \"Balanced performance and cost\"\n\"Opus\" - \"Most capable, higher cost\"\n\nIf Gemini CLI selected:\n\nQuestion: \"Which Gemini model do you want to use?\"\nHeader: \"Model\"\nOptions:\n\n\"Default (Recommended)\" - \"Use default model\"\n\"gemini-3-flash\" - \"Latest Gemini 3, fastest and most cost-effective\"\n\"gemini-3-pro\" - \"Latest Gemini 3, most capable for complex tasks\"\n\"gemini-2.5-flash\" - \"Stable production model, fast\"\n\"gemini-2.5-pro\" - \"Stable production model, more capable\"\n\nIf Grok CLI selected:\n\nQuestion: \"Which Grok model do you want to use?\"\nHeader: \"Model\"\nOptions:\n\n\"Default (Recommended)\" - \"Use grok-code-fast-1, optimized for fast code generation and agentic loops\"\n\"grok-4-latest\" - \"Latest Grok 4, most capable for complex reasoning\"\n\"grok-beta\" - \"Preview of upcoming features\"\n\nStore the choice for later."
      },
      {
        "title": "Step 3: Choose Operating System",
        "body": "Use AskUserQuestion:\n\nQuestion: \"Which shell environment are you using?\"\nHeader: \"Shell\"\nOptions:\n\n\"PowerShell (Recommended)\" - \"Windows PowerShell\"\n\"Windows CMD\" - \"Command Prompt (cmd.exe)\"\n\"Bash/Linux\" - \"Linux, Mac, or WSL\"\n\nStore the choice for later."
      },
      {
        "title": "Step 4: Choose Complexity Level",
        "body": "Use AskUserQuestion:\n\nQuestion: \"What level of control do you need?\"\nHeader: \"Complexity\"\nOptions:\n\n\"Simple (Recommended)\" - \"Basic loop with minimal options\"\n\"Intermediate\" - \"Combine 2 control mechanisms\"\n\"Advanced\" - \"Full control with multiple safeguards\""
      },
      {
        "title": "If Simple:",
        "body": "Use AskUserQuestion:\n\nQuestion: \"What type of loop?\"\nHeader: \"Loop Type\"\nOptions:\n\n\"Fixed count (Recommended)\" - \"Run exactly N times\"\n\"Infinite with delay\" - \"Run forever with pauses\"\n\"Stop file trigger\" - \"Run until STOP.txt exists\""
      },
      {
        "title": "If Intermediate:",
        "body": "Use AskUserQuestion:\n\nQuestion: \"What combination do you need?\"\nHeader: \"Features\"\nmultiSelect: true\nOptions:\n\n\"Fixed iterations\" - \"Run max N times\"\n\"Time limit\" - \"Run for max X minutes\"\n\"Stop file\" - \"Stop when STOP.txt appears\"\n\"Delay between runs\" - \"Pause X seconds\"\n\"Show counter\" - \"Display run number\"\n\"File monitoring\" - \"Stop at file size/lines\""
      },
      {
        "title": "If Advanced:",
        "body": "Use AskUserQuestion:\n\nQuestion: \"What features do you want?\"\nHeader: \"Features\"\nmultiSelect: true\nOptions:\n\n\"Max iterations (Recommended)\" - \"Limit runs\"\n\"Time limit (Recommended)\" - \"Max duration\"\n\"Stop file (Recommended)\" - \"Manual stop\"\n\"Delay between runs\" - \"Pause X seconds\"\n\"Timestamp logging\" - \"Show time of each run\"\n\"Counter display\" - \"Show run number\""
      },
      {
        "title": "Step 6: Gather Parameters",
        "body": "Based on selected features, ask for values:\n\nIf fixed iterations selected:\n\nQuestion: \"How many iterations?\"\nOptions: \"5 (Recommended)\", \"10\", \"20\", \"50\", \"100\", \"Custom\"\n\nIf time limit selected:\n\nQuestion: \"Maximum duration?\"\nOptions: \"10 minutes (Recommended)\", \"30 minutes\", \"1 hour\", \"Custom\"\n\nIf delay selected:\n\nQuestion: \"Delay between runs?\"\nOptions: \"5 seconds (Recommended)\", \"10 seconds\", \"30 seconds\", \"Custom\"\n\nIf file monitoring selected:\n\nQuestion: \"Monitor by?\"\nOptions: \"File size (e.g., 5KB)\", \"Line count (e.g., 50 lines)\", \"Content (e.g., 'THE END')\""
      },
      {
        "title": "Step 7: Generate Command",
        "body": "Build the appropriate command based on:\n\nAI tool choice (Claude or Gemini)\nModel choice\nShell choice (PowerShell, CMD, Bash)\nComplexity level\nSelected features\nParameter values\n\nIMPORTANT - Command Syntax:\n\nFor Claude Code (PowerShell/Bash):\nUse claude-code (NOT claude -p) to accept piped input. The -p flag requires an argument, not pipe.\n\nDefault: Get-Content PROMPT.md -Raw | claude-code --dangerously-skip-permissions\nHaiku: Get-Content PROMPT.md -Raw | claude-code --model haiku --dangerously-skip-permissions\nSonnet: Get-Content PROMPT.md -Raw | claude-code --model sonnet --dangerously-skip-permissions\nOpus: Get-Content PROMPT.md -Raw | claude-code --model opus --dangerously-skip-permissions\n\nFor Claude Code (Bash):\n\nDefault: cat PROMPT.md | claude-code --dangerously-skip-permissions\nWith model: cat PROMPT.md | claude-code --model haiku --dangerously-skip-permissions\n\nFor Gemini CLI (PowerShell):\nGemini CLI accepts stdin piping.\n\nDefault: Get-Content PROMPT.md -Raw | gemini --yolo\ngemini-3-flash: Get-Content PROMPT.md -Raw | gemini --model gemini-3-flash --yolo\ngemini-3-pro: Get-Content PROMPT.md -Raw | gemini --model gemini-3-pro --yolo\ngemini-2.5-flash: Get-Content PROMPT.md -Raw | gemini --model gemini-2.5-flash --yolo\ngemini-2.5-pro: Get-Content PROMPT.md -Raw | gemini --model gemini-2.5-pro --yolo\n\nFor Grok CLI (PowerShell):\n\nDefault: Get-Content PROMPT.md -Raw | grok-auto (uses default model from GROK_MODEL env var, auto-approves permissions)\ngrok-code-fast-1: Get-Content PROMPT.md -Raw | grok-auto -m grok-code-fast-1\ngrok-4-latest: Get-Content PROMPT.md -Raw | grok-auto -m grok-4-latest\ngrok-beta: Get-Content PROMPT.md -Raw | grok-auto -m grok-beta"
      },
      {
        "title": "Command Templates",
        "body": "IMPORTANT - Placeholder Replacement:\n\nFor Claude Code: Replace [AI_COMMAND_WITH_PROMPT] with the FULL command including the prompt argument:\n\nDefault: claude -p (Get-Content PROMPT.md -Raw) --dangerously-skip-permissions\nWith model: claude -p (Get-Content PROMPT.md -Raw) --model haiku --dangerously-skip-permissions\n\nFor Gemini CLI: Replace [AI_COMMAND_WITH_PROMPT] with piped command:\n\nDefault: Get-Content PROMPT.md -Raw | gemini --yolo\nWith model: Get-Content PROMPT.md -Raw | gemini --model gemini-3-flash --yolo\n\nFor Grok CLI: Replace [AI_COMMAND_WITH_PROMPT] with piped command:\n\nDefault: Get-Content PROMPT.md -Raw | grok-auto\nWith model: Get-Content PROMPT.md -Raw | grok-auto -m grok-4-latest\n\nCRITICAL: Claude Code requires the prompt as a command-line argument. Piping does NOT work with claude -p.\n\nPowerShell - Simple Fixed:\n\nfor ($i=1; $i -le N; $i++) { $start = Get-Date; Write-Host \"`n=== Run $i/N ===\" -ForegroundColor Cyan; [AI_COMMAND_WITH_PROMPT]; $duration = ((Get-Date) - $start).TotalSeconds; Write-Host \"⏱️  Time: $([math]::Round($duration, 2))s\" -ForegroundColor Magenta }\n\nPowerShell - Simple Fixed + Delay:\n\nfor ($i=1; $i -le N; $i++) { $start = Get-Date; Write-Host \"`n=== Run $i/N ===\" -ForegroundColor Cyan; [AI_COMMAND_WITH_PROMPT]; $duration = ((Get-Date) - $start).TotalSeconds; Write-Host \"⏱️  Time: $([math]::Round($duration, 2))s\" -ForegroundColor Magenta; if ($i -lt N) { Write-Host \"⏸️  Waiting X seconds...\" -ForegroundColor Yellow; Start-Sleep -Seconds X } }\n\nPowerShell - Simple Infinite + Delay:\n\n$i=1; while ($true) { $start = Get-Date; Write-Host \"`n=== Run $i ===\" -ForegroundColor Cyan; [AI_COMMAND_WITH_PROMPT]; $duration = ((Get-Date) - $start).TotalSeconds; Write-Host \"⏱️  Time: $([math]::Round($duration, 2))s\" -ForegroundColor Magenta; Write-Host \"⏸️  Waiting X seconds...\" -ForegroundColor Yellow; Start-Sleep -Seconds X; $i++ }\n\nPowerShell - Advanced Full Control:\n\n$end = (Get-Date).AddMinutes(M); for ($i=1; $i -le N -and (Get-Date) -lt $end -and -not (Test-Path STOP.txt); $i++) { $start = Get-Date; Write-Host \"`n[$(Get-Date -Format 'HH:mm:ss')] Run $i\" -ForegroundColor Cyan; [AI_COMMAND_WITH_PROMPT]; $duration = ((Get-Date) - $start).TotalSeconds; Write-Host \"⏱️  Time: $([math]::Round($duration, 2))s\" -ForegroundColor Magenta; if ($i -lt N) { Write-Host \"⏸️  Waiting X seconds...\" -ForegroundColor Yellow; Start-Sleep -Seconds X } }; Write-Host \"`n✅ Complete!\" -ForegroundColor Green\n\nCMD - Simple Fixed:\n\nfor /L %i in (1,1,N) do @(echo. & echo === Run %i === & type PROMPT.md | [AI_COMMAND])\n\nNote: CMD has limited capabilities. For time tracking, recommend PowerShell.\n\nCMD - Simple Infinite + Delay:\n\nfor /L %i in (1,0,2) do @(echo. & echo === Run %i === & type PROMPT.md | [AI_COMMAND] & timeout /t X /nobreak > nul)\n\nCMD - Advanced:\n\nfor /L %i in (1,1,N) do @(if exist STOP.txt exit & echo. & echo [%time%] Run %i & type PROMPT.md | [AI_COMMAND] & timeout /t X /nobreak > nul)\n\nNote: For time tracking, use PowerShell (see RalphPowerShellComands.md).\n\nBash - Simple Fixed:\n\nfor i in {1..N}; do echo -e \"\\n=== Run $i/N ===\"; start=$(date +%s); cat PROMPT.md | [AI_COMMAND]; dur=$(($(date +%s) - start)); echo \"⏱️  Time: ${dur}s\"; done\n\nBash - Simple Fixed + Delay:\n\nfor i in {1..N}; do echo -e \"\\n=== Run $i/N ===\"; start=$(date +%s); cat PROMPT.md | [AI_COMMAND]; dur=$(($(date +%s) - start)); echo \"⏱️  Time: ${dur}s\"; [ $i -lt N ] && { echo \"⏸️  Waiting X seconds...\"; sleep X; }; done\n\nBash - Simple Infinite + Delay:\n\ni=1; while :; do echo -e \"\\n=== Run $i ===\"; start=$(date +%s); cat PROMPT.md | [AI_COMMAND]; dur=$(($(date +%s) - start)); echo \"⏱️  Time: ${dur}s\"; echo \"⏸️  Waiting X seconds...\"; sleep X; ((i++)); done\n\nBash - Advanced:\n\nend=$(($(date +%s) + M*60)); for i in {1..N}; do [ $(date +%s) -ge $end ] && break; [ -f STOP.txt ] && break; echo -e \"\\n[$(date +%H:%M:%S)] Run $i\"; start=$(date +%s); cat PROMPT.md | [AI_COMMAND]; dur=$(($(date +%s) - start)); echo \"⏱️  Time: ${dur}s\"; [ $i -lt N ] && { echo \"⏸️  Waiting X seconds...\"; sleep X; }; done; echo -e \"\\n✅ Complete!\""
      },
      {
        "title": "Step 8: Create Command File",
        "body": "Create a timestamped filename in the format: ralphcommand-YYYY-MM-DD-HHMMSS.md\n\nExample: ralphcommand-2026-01-14-233045.md\n\nUse the Write tool to create this file in the current directory with:\n\nFile structure:\n\n# Ralph Command\n\nGenerated: [timestamp]\nShell: [PowerShell/CMD/Bash]\n\n## Command\n\n```[shell-type]\n[THE ACTUAL COMMAND]"
      },
      {
        "title": "How to run",
        "body": "Make sure you have a PROMPT.md file in this directory\nCopy the command above\nPaste into your [PowerShell/CMD/Bash] terminal\nPress Enter"
      },
      {
        "title": "How to stop",
        "body": "Press Ctrl+C at any time\n[- OR create STOP.txt: echo $null > STOP.txt / touch STOP.txt] (if stop file enabled)"
      },
      {
        "title": "What it does",
        "body": "Runs [claude/gemini/grok] with PROMPT.md as input [N times / for M minutes / until stopped].\n[Pauses X seconds between runs.]\n[Shows timestamp and run number.]\n[Displays execution time for each run.]\n\n## Step 9: Notify User\n\nAfter creating the file, tell the user the exact filename created:\n\n✅ Created ralphcommand-YYYY-MM-DD-HHMMSS.md in your current directory!\n\nThe file contains your command ready to run. Just open it and copy the command.\n\nFor more variations and explanations, see:\n\nRalphPowerShellComands.md - Full PowerShell reference\nRalphWindowsCommands.md - Full CMD reference\nRalphLinuxCommands.md - Full Bash reference\nRalphGemini.md - Full Gemini CLI guide\nRalphGrok.md - Full Grok CLI guide\n\n## Notes\n\n- **CRITICAL FOR CLAUDE CODE**: The prompt MUST be passed as a command-line argument, NOT via stdin pipe. Use `claude -p (Get-Content PROMPT.md -Raw) --dangerously-skip-permissions`. Piping does NOT work with `claude -p`.\n- **For Gemini and Grok**: Stdin piping works fine. Use `Get-Content PROMPT.md -Raw | gemini --yolo` or `Get-Content PROMPT.md -Raw | grok-auto`.\n- **Model Selection is Optional**: Always ask which model, but \"Default\" option omits the `--model` flag\n- **For Claude Code (PowerShell)**:\n  - Default format: `claude -p (Get-Content PROMPT.md -Raw) --dangerously-skip-permissions`\n  - With model: `claude -p (Get-Content PROMPT.md -Raw) --model <model> --dangerously-skip-permissions`\n  - Models: `haiku`, `sonnet`, `opus`\n- **For Gemini CLI**:\n  - Default format: `Get-Content PROMPT.md -Raw | gemini --yolo`\n  - With model: `Get-Content PROMPT.md -Raw | gemini --model <model> --yolo`\n  - Models: `gemini-3-flash`, `gemini-3-pro`, `gemini-2.5-flash`, `gemini-2.5-pro`\n  - Note: `-p` flag is deprecated in Gemini\n- **For Grok CLI**:\n  - Use `grok-auto` PowerShell function which calls xAI API directly (perfect for automation)\n  - Default format: `Get-Content PROMPT.md -Raw | grok-auto` (no -m flag, uses GROK_MODEL env var if set)\n  - With model: `Get-Content PROMPT.md -Raw | grok-auto -m <model>`\n  - Models: `grok-code-fast-1`, `grok-4-latest`, `grok-beta`, `grok-4`\n  - Note: `grok-auto` is a PowerShell function that calls the xAI API directly (no CLI needed)\n  - Default model (grok-code-fast-1 via GROK_MODEL env var) is recommended for automation loops (fastest responses)\n- Default to \"Recommended\" options when user is unsure\n- Keep commands on one line when possible for easy copy-paste\n- **Always include time tracking** - Show how long each run takes using `Get-Date` (PowerShell) or `date +%s` (Bash)\n- **Always create timestamped file** - Format: `ralphcommand-YYYY-MM-DD-HHMMSS.md`\n- **DO NOT include cost tracking** - No Get-LastCallCost function, no cost calculations, only time tracking\n- For cost tracking with Claude, tell users to check https://console.anthropic.com for actual API usage\n- When generating the final command for PowerShell:\n  - For Claude: Replace `[AI_COMMAND_WITH_PROMPT]` with the full claude command including prompt argument\n  - For Gemini/Grok: The piping is included in the template, just replace `[AI_COMMAND]` with the command after the pipe"
      }
    ],
    "body": "name: ralph description: \"Generate Claude Code, Gemini CLI, or Grok CLI automation loop commands. Asks questions about your requirements and outputs a ready-to-run command for PowerShell, Windows CMD, or Bash/Linux.\" allowed-tools:\n\nAskUserQuestion\nWrite\nRead\nRalph Command Generator\n\nGenerate optimized loop commands for automating Claude Code, Gemini CLI, or Grok CLI with PROMPT.md.\n\nStep 1: Choose AI Tool\n\nUse AskUserQuestion:\n\nQuestion: \"Which AI CLI tool do you want to use?\"\nHeader: \"AI Tool\"\nOptions:\n\"Claude Code (Recommended)\" - \"Claude AI assistant CLI\"\n\"Gemini CLI\" - \"Google Gemini AI assistant\"\n\"Grok CLI\" - \"xAI Grok AI assistant with agentic coding\"\n\nStore the choice for later.\n\nStep 2: Choose Model\n\nUse AskUserQuestion based on AI tool choice:\n\nIf Claude Code selected:\n\nQuestion: \"Which Claude model do you want to use?\"\nHeader: \"Model\"\nOptions:\n\"Default (Recommended)\" - \"Use default model (currently Sonnet 4.5)\"\n\"Haiku\" - \"Fastest and most cost-effective\"\n\"Sonnet\" - \"Balanced performance and cost\"\n\"Opus\" - \"Most capable, higher cost\"\n\nIf Gemini CLI selected:\n\nQuestion: \"Which Gemini model do you want to use?\"\nHeader: \"Model\"\nOptions:\n\"Default (Recommended)\" - \"Use default model\"\n\"gemini-3-flash\" - \"Latest Gemini 3, fastest and most cost-effective\"\n\"gemini-3-pro\" - \"Latest Gemini 3, most capable for complex tasks\"\n\"gemini-2.5-flash\" - \"Stable production model, fast\"\n\"gemini-2.5-pro\" - \"Stable production model, more capable\"\n\nIf Grok CLI selected:\n\nQuestion: \"Which Grok model do you want to use?\"\nHeader: \"Model\"\nOptions:\n\"Default (Recommended)\" - \"Use grok-code-fast-1, optimized for fast code generation and agentic loops\"\n\"grok-4-latest\" - \"Latest Grok 4, most capable for complex reasoning\"\n\"grok-beta\" - \"Preview of upcoming features\"\n\nStore the choice for later.\n\nStep 3: Choose Operating System\n\nUse AskUserQuestion:\n\nQuestion: \"Which shell environment are you using?\"\nHeader: \"Shell\"\nOptions:\n\"PowerShell (Recommended)\" - \"Windows PowerShell\"\n\"Windows CMD\" - \"Command Prompt (cmd.exe)\"\n\"Bash/Linux\" - \"Linux, Mac, or WSL\"\n\nStore the choice for later.\n\nStep 4: Choose Complexity Level\n\nUse AskUserQuestion:\n\nQuestion: \"What level of control do you need?\"\nHeader: \"Complexity\"\nOptions:\n\"Simple (Recommended)\" - \"Basic loop with minimal options\"\n\"Intermediate\" - \"Combine 2 control mechanisms\"\n\"Advanced\" - \"Full control with multiple safeguards\"\nStep 5: Choose Loop Type (Based on Complexity)\nIf Simple:\n\nUse AskUserQuestion:\n\nQuestion: \"What type of loop?\"\nHeader: \"Loop Type\"\nOptions:\n\"Fixed count (Recommended)\" - \"Run exactly N times\"\n\"Infinite with delay\" - \"Run forever with pauses\"\n\"Stop file trigger\" - \"Run until STOP.txt exists\"\nIf Intermediate:\n\nUse AskUserQuestion:\n\nQuestion: \"What combination do you need?\"\nHeader: \"Features\"\nmultiSelect: true\nOptions:\n\"Fixed iterations\" - \"Run max N times\"\n\"Time limit\" - \"Run for max X minutes\"\n\"Stop file\" - \"Stop when STOP.txt appears\"\n\"Delay between runs\" - \"Pause X seconds\"\n\"Show counter\" - \"Display run number\"\n\"File monitoring\" - \"Stop at file size/lines\"\nIf Advanced:\n\nUse AskUserQuestion:\n\nQuestion: \"What features do you want?\"\nHeader: \"Features\"\nmultiSelect: true\nOptions:\n\"Max iterations (Recommended)\" - \"Limit runs\"\n\"Time limit (Recommended)\" - \"Max duration\"\n\"Stop file (Recommended)\" - \"Manual stop\"\n\"Delay between runs\" - \"Pause X seconds\"\n\"Timestamp logging\" - \"Show time of each run\"\n\"Counter display\" - \"Show run number\"\nStep 6: Gather Parameters\n\nBased on selected features, ask for values:\n\nIf fixed iterations selected:\n\nQuestion: \"How many iterations?\"\nOptions: \"5 (Recommended)\", \"10\", \"20\", \"50\", \"100\", \"Custom\"\n\nIf time limit selected:\n\nQuestion: \"Maximum duration?\"\nOptions: \"10 minutes (Recommended)\", \"30 minutes\", \"1 hour\", \"Custom\"\n\nIf delay selected:\n\nQuestion: \"Delay between runs?\"\nOptions: \"5 seconds (Recommended)\", \"10 seconds\", \"30 seconds\", \"Custom\"\n\nIf file monitoring selected:\n\nQuestion: \"Monitor by?\"\nOptions: \"File size (e.g., 5KB)\", \"Line count (e.g., 50 lines)\", \"Content (e.g., 'THE END')\"\nStep 7: Generate Command\n\nBuild the appropriate command based on:\n\nAI tool choice (Claude or Gemini)\nModel choice\nShell choice (PowerShell, CMD, Bash)\nComplexity level\nSelected features\nParameter values\n\nIMPORTANT - Command Syntax:\n\nFor Claude Code (PowerShell/Bash): Use claude-code (NOT claude -p) to accept piped input. The -p flag requires an argument, not pipe.\n\nDefault: Get-Content PROMPT.md -Raw | claude-code --dangerously-skip-permissions\nHaiku: Get-Content PROMPT.md -Raw | claude-code --model haiku --dangerously-skip-permissions\nSonnet: Get-Content PROMPT.md -Raw | claude-code --model sonnet --dangerously-skip-permissions\nOpus: Get-Content PROMPT.md -Raw | claude-code --model opus --dangerously-skip-permissions\n\nFor Claude Code (Bash):\n\nDefault: cat PROMPT.md | claude-code --dangerously-skip-permissions\nWith model: cat PROMPT.md | claude-code --model haiku --dangerously-skip-permissions\n\nFor Gemini CLI (PowerShell): Gemini CLI accepts stdin piping.\n\nDefault: Get-Content PROMPT.md -Raw | gemini --yolo\ngemini-3-flash: Get-Content PROMPT.md -Raw | gemini --model gemini-3-flash --yolo\ngemini-3-pro: Get-Content PROMPT.md -Raw | gemini --model gemini-3-pro --yolo\ngemini-2.5-flash: Get-Content PROMPT.md -Raw | gemini --model gemini-2.5-flash --yolo\ngemini-2.5-pro: Get-Content PROMPT.md -Raw | gemini --model gemini-2.5-pro --yolo\n\nFor Grok CLI (PowerShell):\n\nDefault: Get-Content PROMPT.md -Raw | grok-auto (uses default model from GROK_MODEL env var, auto-approves permissions)\ngrok-code-fast-1: Get-Content PROMPT.md -Raw | grok-auto -m grok-code-fast-1\ngrok-4-latest: Get-Content PROMPT.md -Raw | grok-auto -m grok-4-latest\ngrok-beta: Get-Content PROMPT.md -Raw | grok-auto -m grok-beta\nCommand Templates\n\nIMPORTANT - Placeholder Replacement:\n\nFor Claude Code: Replace [AI_COMMAND_WITH_PROMPT] with the FULL command including the prompt argument:\n\nDefault: claude -p (Get-Content PROMPT.md -Raw) --dangerously-skip-permissions\nWith model: claude -p (Get-Content PROMPT.md -Raw) --model haiku --dangerously-skip-permissions\n\nFor Gemini CLI: Replace [AI_COMMAND_WITH_PROMPT] with piped command:\n\nDefault: Get-Content PROMPT.md -Raw | gemini --yolo\nWith model: Get-Content PROMPT.md -Raw | gemini --model gemini-3-flash --yolo\n\nFor Grok CLI: Replace [AI_COMMAND_WITH_PROMPT] with piped command:\n\nDefault: Get-Content PROMPT.md -Raw | grok-auto\nWith model: Get-Content PROMPT.md -Raw | grok-auto -m grok-4-latest\n\nCRITICAL: Claude Code requires the prompt as a command-line argument. Piping does NOT work with claude -p.\n\nPowerShell - Simple Fixed:\n\nfor ($i=1; $i -le N; $i++) { $start = Get-Date; Write-Host \"`n=== Run $i/N ===\" -ForegroundColor Cyan; [AI_COMMAND_WITH_PROMPT]; $duration = ((Get-Date) - $start).TotalSeconds; Write-Host \"⏱️  Time: $([math]::Round($duration, 2))s\" -ForegroundColor Magenta }\n\n\nPowerShell - Simple Fixed + Delay:\n\nfor ($i=1; $i -le N; $i++) { $start = Get-Date; Write-Host \"`n=== Run $i/N ===\" -ForegroundColor Cyan; [AI_COMMAND_WITH_PROMPT]; $duration = ((Get-Date) - $start).TotalSeconds; Write-Host \"⏱️  Time: $([math]::Round($duration, 2))s\" -ForegroundColor Magenta; if ($i -lt N) { Write-Host \"⏸️  Waiting X seconds...\" -ForegroundColor Yellow; Start-Sleep -Seconds X } }\n\n\nPowerShell - Simple Infinite + Delay:\n\n$i=1; while ($true) { $start = Get-Date; Write-Host \"`n=== Run $i ===\" -ForegroundColor Cyan; [AI_COMMAND_WITH_PROMPT]; $duration = ((Get-Date) - $start).TotalSeconds; Write-Host \"⏱️  Time: $([math]::Round($duration, 2))s\" -ForegroundColor Magenta; Write-Host \"⏸️  Waiting X seconds...\" -ForegroundColor Yellow; Start-Sleep -Seconds X; $i++ }\n\n\nPowerShell - Advanced Full Control:\n\n$end = (Get-Date).AddMinutes(M); for ($i=1; $i -le N -and (Get-Date) -lt $end -and -not (Test-Path STOP.txt); $i++) { $start = Get-Date; Write-Host \"`n[$(Get-Date -Format 'HH:mm:ss')] Run $i\" -ForegroundColor Cyan; [AI_COMMAND_WITH_PROMPT]; $duration = ((Get-Date) - $start).TotalSeconds; Write-Host \"⏱️  Time: $([math]::Round($duration, 2))s\" -ForegroundColor Magenta; if ($i -lt N) { Write-Host \"⏸️  Waiting X seconds...\" -ForegroundColor Yellow; Start-Sleep -Seconds X } }; Write-Host \"`n✅ Complete!\" -ForegroundColor Green\n\n\nCMD - Simple Fixed:\n\nfor /L %i in (1,1,N) do @(echo. & echo === Run %i === & type PROMPT.md | [AI_COMMAND])\n\n\nNote: CMD has limited capabilities. For time tracking, recommend PowerShell.\n\nCMD - Simple Infinite + Delay:\n\nfor /L %i in (1,0,2) do @(echo. & echo === Run %i === & type PROMPT.md | [AI_COMMAND] & timeout /t X /nobreak > nul)\n\n\nCMD - Advanced:\n\nfor /L %i in (1,1,N) do @(if exist STOP.txt exit & echo. & echo [%time%] Run %i & type PROMPT.md | [AI_COMMAND] & timeout /t X /nobreak > nul)\n\n\nNote: For time tracking, use PowerShell (see RalphPowerShellComands.md).\n\nBash - Simple Fixed:\n\nfor i in {1..N}; do echo -e \"\\n=== Run $i/N ===\"; start=$(date +%s); cat PROMPT.md | [AI_COMMAND]; dur=$(($(date +%s) - start)); echo \"⏱️  Time: ${dur}s\"; done\n\n\nBash - Simple Fixed + Delay:\n\nfor i in {1..N}; do echo -e \"\\n=== Run $i/N ===\"; start=$(date +%s); cat PROMPT.md | [AI_COMMAND]; dur=$(($(date +%s) - start)); echo \"⏱️  Time: ${dur}s\"; [ $i -lt N ] && { echo \"⏸️  Waiting X seconds...\"; sleep X; }; done\n\n\nBash - Simple Infinite + Delay:\n\ni=1; while :; do echo -e \"\\n=== Run $i ===\"; start=$(date +%s); cat PROMPT.md | [AI_COMMAND]; dur=$(($(date +%s) - start)); echo \"⏱️  Time: ${dur}s\"; echo \"⏸️  Waiting X seconds...\"; sleep X; ((i++)); done\n\n\nBash - Advanced:\n\nend=$(($(date +%s) + M*60)); for i in {1..N}; do [ $(date +%s) -ge $end ] && break; [ -f STOP.txt ] && break; echo -e \"\\n[$(date +%H:%M:%S)] Run $i\"; start=$(date +%s); cat PROMPT.md | [AI_COMMAND]; dur=$(($(date +%s) - start)); echo \"⏱️  Time: ${dur}s\"; [ $i -lt N ] && { echo \"⏸️  Waiting X seconds...\"; sleep X; }; done; echo -e \"\\n✅ Complete!\"\n\nStep 8: Create Command File\n\nCreate a timestamped filename in the format: ralphcommand-YYYY-MM-DD-HHMMSS.md\n\nExample: ralphcommand-2026-01-14-233045.md\n\nUse the Write tool to create this file in the current directory with:\n\nFile structure:\n\n# Ralph Command\n\nGenerated: [timestamp]\nShell: [PowerShell/CMD/Bash]\n\n## Command\n\n```[shell-type]\n[THE ACTUAL COMMAND]\n\nHow to run\nMake sure you have a PROMPT.md file in this directory\nCopy the command above\nPaste into your [PowerShell/CMD/Bash] terminal\nPress Enter\nHow to stop\nPress Ctrl+C at any time [- OR create STOP.txt: echo $null > STOP.txt / touch STOP.txt] (if stop file enabled)\nWhat it does\n\nRuns [claude/gemini/grok] with PROMPT.md as input [N times / for M minutes / until stopped]. [Pauses X seconds between runs.] [Shows timestamp and run number.] [Displays execution time for each run.]\n\n\n## Step 9: Notify User\n\nAfter creating the file, tell the user the exact filename created:\n\n\n✅ Created ralphcommand-YYYY-MM-DD-HHMMSS.md in your current directory!\n\nThe file contains your command ready to run. Just open it and copy the command.\n\nFor more variations and explanations, see:\n\nRalphPowerShellComands.md - Full PowerShell reference\nRalphWindowsCommands.md - Full CMD reference\nRalphLinuxCommands.md - Full Bash reference\nRalphGemini.md - Full Gemini CLI guide\nRalphGrok.md - Full Grok CLI guide\n\n## Notes\n\n- **CRITICAL FOR CLAUDE CODE**: The prompt MUST be passed as a command-line argument, NOT via stdin pipe. Use `claude -p (Get-Content PROMPT.md -Raw) --dangerously-skip-permissions`. Piping does NOT work with `claude -p`.\n- **For Gemini and Grok**: Stdin piping works fine. Use `Get-Content PROMPT.md -Raw | gemini --yolo` or `Get-Content PROMPT.md -Raw | grok-auto`.\n- **Model Selection is Optional**: Always ask which model, but \"Default\" option omits the `--model` flag\n- **For Claude Code (PowerShell)**:\n  - Default format: `claude -p (Get-Content PROMPT.md -Raw) --dangerously-skip-permissions`\n  - With model: `claude -p (Get-Content PROMPT.md -Raw) --model <model> --dangerously-skip-permissions`\n  - Models: `haiku`, `sonnet`, `opus`\n- **For Gemini CLI**:\n  - Default format: `Get-Content PROMPT.md -Raw | gemini --yolo`\n  - With model: `Get-Content PROMPT.md -Raw | gemini --model <model> --yolo`\n  - Models: `gemini-3-flash`, `gemini-3-pro`, `gemini-2.5-flash`, `gemini-2.5-pro`\n  - Note: `-p` flag is deprecated in Gemini\n- **For Grok CLI**:\n  - Use `grok-auto` PowerShell function which calls xAI API directly (perfect for automation)\n  - Default format: `Get-Content PROMPT.md -Raw | grok-auto` (no -m flag, uses GROK_MODEL env var if set)\n  - With model: `Get-Content PROMPT.md -Raw | grok-auto -m <model>`\n  - Models: `grok-code-fast-1`, `grok-4-latest`, `grok-beta`, `grok-4`\n  - Note: `grok-auto` is a PowerShell function that calls the xAI API directly (no CLI needed)\n  - Default model (grok-code-fast-1 via GROK_MODEL env var) is recommended for automation loops (fastest responses)\n- Default to \"Recommended\" options when user is unsure\n- Keep commands on one line when possible for easy copy-paste\n- **Always include time tracking** - Show how long each run takes using `Get-Date` (PowerShell) or `date +%s` (Bash)\n- **Always create timestamped file** - Format: `ralphcommand-YYYY-MM-DD-HHMMSS.md`\n- **DO NOT include cost tracking** - No Get-LastCallCost function, no cost calculations, only time tracking\n- For cost tracking with Claude, tell users to check https://console.anthropic.com for actual API usage\n- When generating the final command for PowerShell:\n  - For Claude: Replace `[AI_COMMAND_WITH_PROMPT]` with the full claude command including prompt argument\n  - For Gemini/Grok: The piping is included in the template, just replace `[AI_COMMAND]` with the command after the pipe"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/Walkamolee/ralph-loop-writer",
    "publisherUrl": "https://clawhub.ai/Walkamolee/ralph-loop-writer",
    "owner": "Walkamolee",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/ralph-loop-writer",
    "downloadUrl": "https://openagent3.xyz/downloads/ralph-loop-writer",
    "agentUrl": "https://openagent3.xyz/skills/ralph-loop-writer/agent",
    "manifestUrl": "https://openagent3.xyz/skills/ralph-loop-writer/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/ralph-loop-writer/agent.md"
  }
}