Skip to content

Add ralph-loop skill for recurring prompt execution#1

Merged
flawlessstudio merged 4 commits into
mainfrom
claude/install-ralph-loop-plugin-OSdao
May 11, 2026
Merged

Add ralph-loop skill for recurring prompt execution#1
flawlessstudio merged 4 commits into
mainfrom
claude/install-ralph-loop-plugin-OSdao

Conversation

@flawlessstudio

@flawlessstudio flawlessstudio commented Apr 26, 2026

Copy link
Copy Markdown
Owner

Summary

Introduces the ralph-loop skill, a new capability that enables running prompts or slash commands on a recurring interval with automatic retry and failure recovery mechanisms.

Key Changes

  • New skill: ralph-loop - Executes a prompt or command repeatedly at user-specified intervals (seconds, minutes, hours, or days)
  • Automatic retry logic - Retries failed executions up to 3 times before backing off for 2x the interval duration
  • Flexible stopping mechanisms - Supports graceful shutdown via SIGTERM/SIGINT, stop file (/tmp/ralph-loop.stop), or STOP_LOOP signal in prompt output
  • State tracking - Emits JSON state after each iteration with iteration count, timestamps, and status
  • Interval validation - Enforces a 30-second minimum interval to prevent resource exhaustion
  • Comprehensive documentation - Includes usage examples, output format, and troubleshooting guidance

Implementation Details

  • Interval parsing - Supports flexible interval syntax: Ns, Nm, Nh, Nd (e.g., 5m, 2h, 1d)
  • Default interval - Falls back to 10 minutes if no interval is specified
  • Cross-platform date handling - Uses fallback date command syntax for macOS/BSD compatibility
  • Clean exit handling - Trap handler ensures stop file cleanup on exit
  • Consecutive failure tracking - Maintains counter to distinguish transient failures from persistent issues

This skill is useful for monitoring tasks, polling for status changes, recurring checks, and any scenario where a user wants to repeatedly execute a prompt at regular intervals.

https://claude.ai/code/session_01GvwWVvFRrmzeYS8qJovgsZ

Summary by Sourcery

Introduce a new ralph-loop skill for recurring execution of prompts or slash commands with interval handling, retry logic, and stoppable loops.

New Features:

  • Add ralph-loop bash script to run a prompt or command on a recurring interval with JSON state emission and automatic backoff on repeated failures.
  • Provide configurable stopping mechanisms via signals, a stop file, and an in-output STOP_LOOP marker to end the loop gracefully.
  • Support flexible human-readable interval syntax with a default 10-minute interval and minimum 30-second enforcement.

Documentation:

  • Document the ralph-loop skill usage, interval options, output format, stopping mechanisms, and troubleshooting guidance in SKILL.md.

Summary by cubic

Add the ralph-loop skill to emit a prompt on a recurring interval with JSON state and safe stop controls. Intervals accept Ns/Nm/Nh/Nd or plain seconds (default 10m, min 30s), and docs now clarify it schedules output only (no command execution or retries) and include the numeric-seconds format.

  • Bug Fixes
    • Validate interval input upfront and reject invalid formats (e.g. 5x) to prevent silent failures.
    • Emit JSON via jq with a safe fallback to correctly escape prompts and produce valid JSON.
    • Use a per-process stop file instead of a shared path to avoid interference between concurrent loops.

Written for commit b3e3c59. Summary will update on new commits.

Adds the ralph-loop skill with SKILL.md, loop.sh script, and zip package.
The skill runs any prompt or slash command on a recurring interval with
automatic retry, failure recovery, and stop-file/signal support.

https://claude.ai/code/session_01GvwWVvFRrmzeYS8qJovgsZ
@sourcery-ai

sourcery-ai Bot commented Apr 26, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a new ralph-loop skill that runs a provided prompt or slash command on a recurring interval with retry, backoff, stop controls, and JSON state output, along with documentation on usage and behavior.

Sequence diagram for ralph-loop recurring execution and stop controls

sequenceDiagram
  actor User
  participant RalphLoop as loop_sh
  participant Agent as PromptExecutor
  participant OS as OperatingSystem

  User->>RalphLoop: run loop_sh [interval] "prompt"
  RalphLoop->>RalphLoop: parse_interval_or_default()
  RalphLoop->>OS: set_trap_EXIT_cleanup()
  RalphLoop->>OS: remove_stop_file()

  loop Ralph_iteration
    RalphLoop->>OS: get_current_time()
    RalphLoop->>Agent: echo PROMPT (stdout to agent)
    Agent-->>RalphLoop: RUN_OUTPUT, RUN_STATUS

    RalphLoop->>RalphLoop: check RUN_OUTPUT for STOP_LOOP
    alt STOP_LOOP_found
      RalphLoop-->>User: final_JSON_state status=stopped
      RalphLoop->>OS: cleanup_stop_file()
      RalphLoop-->>User: stderr "Stop signal detected"
      RalphLoop-->>User: exit 0
    else no_stop_signal
      alt RUN_STATUS_nonzero
        RalphLoop->>RalphLoop: increment CONSECUTIVE_FAILURES
        alt CONSECUTIVE_FAILURES >= MAX_RETRIES
          RalphLoop->>RalphLoop: BACKOFF = INTERVAL_SECONDS * 2
          RalphLoop-->>User: stderr "Max retries reached. Backing off"
          RalphLoop->>OS: sleep BACKOFF
          RalphLoop->>RalphLoop: reset CONSECUTIVE_FAILURES
        else below_max_retries
          RalphLoop-->>User: stderr "Run failed (attempt n/3)"
        end
      else RUN_STATUS_zero
        RalphLoop->>RalphLoop: reset CONSECUTIVE_FAILURES
        RalphLoop-->>User: forward RUN_OUTPUT
      end

      RalphLoop->>OS: compute_NEXT_time()
      RalphLoop-->>User: JSON_state status=running

      RalphLoop->>OS: check_stop_file()
      alt stop_file_exists
        RalphLoop-->>User: stderr "Stop file detected"
        RalphLoop->>OS: cleanup_stop_file()
        RalphLoop-->>User: exit 0
      else no_stop_file
        RalphLoop-->>User: stderr "Sleeping INTERVAL_SECONDS"
        RalphLoop->>OS: sleep INTERVAL_SECONDS
        RalphLoop->>OS: check_stop_file_again()
        alt stop_file_exists_after_sleep
          RalphLoop-->>User: stderr "Stop file detected"
          RalphLoop->>OS: cleanup_stop_file()
          RalphLoop-->>User: exit 0
        else no_stop_file_after_sleep
          RalphLoop->>RalphLoop: continue next_iteration
        end
      end
    end
  end

  opt SIGINT_SIGTERM
    OS->>RalphLoop: send SIGINT or SIGTERM
    RalphLoop->>OS: trap_EXIT_cleanup_stop_file()
    RalphLoop-->>User: stderr "[ralph-loop] Stopped."
    RalphLoop-->>User: exit
  end
Loading

Flow diagram for ralph-loop control logic and retry/backoff

flowchart TD
  A_start[Start loop_sh] --> B_args_check{Args provided?}
  B_args_check -->|no| B1_print_usage[Print usage to stderr] --> B2_exit1[Exit 1]
  B_args_check -->|yes| C_detect_interval{First_arg_matches_interval}
  C_detect_interval -->|yes| C1_set_INTERVAL_RAW[Set INTERVAL_RAW from arg and shift]
  C_detect_interval -->|no| C2_INTERVAL_RAW_empty[INTERVAL_RAW empty]
  C1_set_INTERVAL_RAW --> D_collect_prompt[Collect remaining args as PROMPT]
  C2_INTERVAL_RAW_empty --> D_collect_prompt
  D_collect_prompt --> D1_prompt_empty{PROMPT empty?}
  D1_prompt_empty -->|yes| D2_error_no_prompt[Print error no prompt] --> B2_exit1
  D1_prompt_empty -->|no| E_resolve_interval{INTERVAL_RAW set?}
  E_resolve_interval -->|yes| E1_parse_interval[INTERVAL_SECONDS = parse_interval]
  E_resolve_interval -->|no| E2_default_interval[INTERVAL_SECONDS = 600, INTERVAL_RAW = 10m]
  E1_parse_interval --> F_enforce_min
  E2_default_interval --> F_enforce_min[Enforce minimum interval]
  F_enforce_min --> F1_clamp_check{INTERVAL_SECONDS < MIN_INTERVAL_SECONDS}
  F1_clamp_check -->|yes| F2_clamp_interval[Clamp to MIN_INTERVAL_SECONDS and log]
  F1_clamp_check -->|no| G_init_state
  F2_clamp_interval --> G_init_state[ITERATION=0, CONSECUTIVE_FAILURES=0]
  G_init_state --> H_setup_trap[Setup EXIT trap for cleanup]
  H_setup_trap --> I_remove_stop_file[Remove STOP_FILE]
  I_remove_stop_file --> J_loop_start[[Main loop]]

  J_loop_start --> K_iter_increment[Increment ITERATION]
  K_iter_increment --> L_now_next_time[Compute NOW and NEXT timestamps]
  L_now_next_time --> M_log_iteration[Log iteration start to stderr]
  M_log_iteration --> N_run_prompt[RUN_OUTPUT = echo PROMPT]
  N_run_prompt --> O_check_STOP_LOOP{RUN_OUTPUT contains STOP_LOOP?}

  O_check_STOP_LOOP -->|yes| O1_status_stopped[STATUS=stopped]
  O1_status_stopped --> O2_emit_final_json[Emit JSON with next_run=null and status=stopped]
  O2_emit_final_json --> O3_exit0[Exit 0]

  O_check_STOP_LOOP -->|no| P_status_check{RUN_STATUS != 0?}

  P_status_check -->|yes| P1_inc_failures[Increment CONSECUTIVE_FAILURES]
  P1_inc_failures --> P2_max_retries{CONSECUTIVE_FAILURES >= MAX_RETRIES}
  P2_max_retries -->|yes| P3_backoff[BACKOFF = INTERVAL_SECONDS * 2]
  P3_backoff --> P4_log_backoff[Log max retries and backoff to stderr]
  P4_log_backoff --> P5_reset_failures[Reset CONSECUTIVE_FAILURES]
  P5_reset_failures --> P6_sleep_backoff[Sleep BACKOFF]
  P6_sleep_backoff --> Q_emit_state

  P2_max_retries -->|no| P7_log_failure[Log failed attempt to stderr] --> Q_emit_state

  P_status_check -->|no| P8_reset_failures[Reset CONSECUTIVE_FAILURES]
  P8_reset_failures --> P9_output_prompt[Print RUN_OUTPUT to stdout]
  P9_output_prompt --> Q_emit_state[Emit JSON state status=running]

  Q_emit_state --> R_check_stop_file{STOP_FILE exists?}
  R_check_stop_file -->|yes| R1_log_stop_file[Log stop file detected] --> R2_exit0[Exit 0]
  R_check_stop_file -->|no| S_log_sleep[Log sleep duration and NEXT to stderr]
  S_log_sleep --> T_sleep_interval[Sleep INTERVAL_SECONDS]
  T_sleep_interval --> U_check_stop_file2{STOP_FILE exists?}
  U_check_stop_file2 -->|yes| U1_log_stop_file2[Log stop file detected] --> R2_exit0
  U_check_stop_file2 -->|no| J_loop_start

  subgraph EXIT_trap_cleanup
    V_exit_event[Exit or signal] --> W_trap_handler[Trap handler]
    W_trap_handler --> X_log_stopped[Print ralph-loop Stopped.]
    X_log_stopped --> Y_rm_stop_file[Remove STOP_FILE]
  end
Loading

File-Level Changes

Change Details Files
Introduce ralph-loop Bash script that parses an optional interval, enforces minimum timing, and loops execution of a prompt with JSON state output.
  • Parse optional first argument as an interval supporting numeric seconds or Ns/Nm/Nh/Nd forms, defaulting to 10 minutes when omitted.
  • Validate interval against a 30-second minimum and normalize to seconds for internal use.
  • Implement an infinite loop that timestamps each iteration, computes next run time with Linux/macOS-compatible date syntax, and increments an iteration counter.
  • Echo the prompt as the loop body, capture its output and status, and emit a JSON blob after each iteration with iteration, timestamps, interval, prompt, and status fields.
skills/ralph-loop/scripts/loop.sh
Add reliability features for retry, backoff, and multiple stop mechanisms to the loop script.
  • Track consecutive failures and retry up to a configurable MAX_RETRIES before applying a backoff delay of 2x the base interval.
  • Support multiple stop mechanisms: SIGINT/SIGTERM via EXIT trap, a configurable stop file path, and a STOP_LOOP marker in the prompt output.
  • Use a trap to ensure the stop file is removed and a stop message is logged on process exit.
  • Suppress stdout on failures while still logging to stderr and resuming the loop after backoff.
skills/ralph-loop/scripts/loop.sh
Document the ralph-loop skill usage, behavior, and troubleshooting in SKILL.md.
  • Describe the skill metadata, purpose, and when to use it, including examples of common recurring tasks.
  • Specify CLI usage, interval syntax, minimum interval behavior, and prompt argument semantics.
  • Provide sample log and JSON state output so reviewers understand how agents and users will consume loop results.
  • Document all supported stop mechanisms and common troubleshooting scenarios such as short intervals, repeated failures, and stop-file issues.
skills/ralph-loop/SKILL.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ecc-tools

ecc-tools Bot commented Apr 26, 2026

Copy link
Copy Markdown

Analyzing 200 commits...

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues, and left some high level feedback:

  • The JSON state output interpolates $PROMPT directly into a double-quoted JSON string without escaping, which will produce invalid JSON for prompts containing quotes, backslashes, or newlines—consider adding proper escaping (e.g., via jq -R or a small escape helper) before printing.
  • The global stop file is deleted on any loop’s exit (trap ... rm -f "$STOP_FILE" and rm -f "$STOP_FILE" at start), which can interfere with multiple concurrent loops using the same stop file; it may be safer to avoid removing a potentially shared stop file or to use a per-process stop path.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The JSON state output interpolates `$PROMPT` directly into a double-quoted JSON string without escaping, which will produce invalid JSON for prompts containing quotes, backslashes, or newlines—consider adding proper escaping (e.g., via `jq -R` or a small escape helper) before printing.
- The global stop file is deleted on any loop’s exit (`trap ... rm -f "$STOP_FILE"` and `rm -f "$STOP_FILE"` at start), which can interfere with multiple concurrent loops using the same stop file; it may be safer to avoid removing a potentially shared stop file or to use a per-process stop path.

## Individual Comments

### Comment 1
<location path="skills/ralph-loop/scripts/loop.sh" line_range="21-25" />
<code_context>
+  local unit="${raw: -1}"
+  local num="${raw:0:${#raw}-1}"
+
+  case "$unit" in
+    s) echo "$num" ;;
+    m) echo $((num * 60)) ;;
+    h) echo $((num * 3600)) ;;
+    d) echo $((num * 86400)) ;;
+    *)
+      # No unit — treat as seconds if purely numeric
</code_context>
<issue_to_address>
**issue (bug_risk):** Interval parsing with unit does not validate that `num` is numeric before arithmetic expansion.

For values like `abc` or `5x`, `num` ends up non-numeric and `$((num * ...))` will fail at runtime. You already guard purely numeric `raw` in the `*` clause, but there is no equivalent check when a unit is present. Please either validate `raw` upfront with something like `[[ $raw =~ ^[0-9]+[smhd]$ ]]` or check `[[ $num =~ ^[0-9]+$ ]]` before the arithmetic and send invalid inputs down the existing "Invalid interval" path.
</issue_to_address>

### Comment 2
<location path="skills/ralph-loop/scripts/loop.sh" line_range="101-102" />
<code_context>
+  if echo "$RUN_OUTPUT" | grep -q "STOP_LOOP"; then
+    echo "[ralph-loop] Stop signal detected in output. Exiting." >&2
+    STATUS="stopped"
+    printf '{"iteration":%d,"last_run":"%s","next_run":null,"interval_seconds":%d,"prompt":"%s","status":"%s"}\n' \
+      "$ITERATION" "$NOW" "$INTERVAL_SECONDS" "$PROMPT" "$STATUS"
+    exit 0
+  fi
</code_context>
<issue_to_address>
**issue (bug_risk):** Prompt is interpolated into JSON without escaping, which can produce invalid JSON for many inputs.

Since `PROMPT` is inserted as `%s` inside JSON quotes, any embedded quotes, backslashes, or control characters can invalidate the JSON. The same applies to the later `printf` for the running state. Please either JSON-escape these dynamic fields before `printf`, or construct the JSON with a tool like `jq -n --arg prompt "$PROMPT" '...'` so arbitrary prompt contents always produce valid JSON.
</issue_to_address>

Fix all in Cursor


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread skills/ralph-loop/scripts/loop.sh
Comment thread skills/ralph-loop/scripts/loop.sh Outdated
- parse_interval: validate raw input matches ^[0-9]+[smhd]$ before any
  arithmetic, preventing silent failures on inputs like "abcm" or "5x"
- JSON output: replace bare printf interpolation with emit_json helper
  that uses jq (with sed fallback) to safely escape $PROMPT, preventing
  invalid JSON for prompts containing quotes, backslashes, or newlines
- Stop file: switch from shared /tmp/ralph-loop.stop to per-process
  /tmp/ralph-loop-$PID.stop, eliminating interference between
  concurrent loop instances

https://claude.ai/code/session_01GvwWVvFRrmzeYS8qJovgsZ
@ecc-tools

ecc-tools Bot commented Apr 26, 2026

Copy link
Copy Markdown

Analysis Complete

Generated ECC bundle from 1 commits | Confidence: 50%

View Pull Request #2

Repository Profile
Attribute Value
Language TypeScript
Framework Not detected
Commit Convention freeform
Test Directory separate
Changed Files (3)
Metric Value
Files changed 3
Additions 238
Deletions 0

Top hotspots

Path Status +/-
skills/ralph-loop/scripts/loop.sh added +139 / -0
skills/ralph-loop/SKILL.md added +99 / -0
skills/ralph-loop.zip added +0 / -0

Top directories

Directory Files Total changes
skills/ralph-loop/scripts 1 139
skills/ralph-loop 1 99
skills 1 0
Review Activity (1 reviews, 2 inline comments, 2 unresolved threads)
Signal Count
Approvals 0
Change requests 0
Comment-only reviews 1
Dismissed reviews 0
Pending reviews 0
Review threads 2
Unresolved threads 2
Outdated threads 1
Latest review Commented
Latest submitted at 2026-04-26T00:38:15Z

Top unresolved thread files

Path Unresolved Outdated
skills/ralph-loop/scripts/loop.sh 2 1

Latest reviewer states

Reviewer State Submitted
@sourcery-ai[bot] Commented 2026-04-26T00:38:15Z
Generated Instincts (14)
Domain Count
git 2
code-style 9
testing 2
architecture 1

After merging, import with:

/instinct-import .claude/homunculus/instincts/inherited/agent-skills-instincts.yaml

Files

  • .claude/ecc-tools.json
  • .claude/skills/agent-skills/SKILL.md
  • .agents/skills/agent-skills/SKILL.md
  • .agents/skills/agent-skills/agents/openai.yaml
  • .claude/identity.json
  • .codex/config.toml
  • .codex/AGENTS.md
  • .codex/agents/explorer.toml
  • .codex/agents/reviewer.toml
  • .codex/agents/docs-researcher.toml
  • .claude/homunculus/instincts/inherited/agent-skills-instincts.yaml

ECC Tools | Everything Claude Code

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="skills/ralph-loop/SKILL.md">

<violation number="1" location="skills/ralph-loop/SKILL.md:18">
P1: The documentation claims automatic retry on task failure, but the loop script only echoes the prompt instead of executing it, so failure recovery and output-based stop behavior do not work as described.</violation>
</file>

<file name="skills/ralph-loop/scripts/loop.sh">

<violation number="1" location="skills/ralph-loop/scripts/loop.sh:122">
P1: Escape `PROMPT` before embedding it in JSON output; raw prompt text can produce invalid JSON state lines.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread skills/ralph-loop/SKILL.md Outdated
Comment thread skills/ralph-loop/scripts/loop.sh Outdated
fi

# Emit JSON state to stdout
printf '{"iteration":%d,"last_run":"%s","next_run":"%s","interval_seconds":%d,"prompt":"%s","status":"running"}\n' \

@cubic-dev-ai cubic-dev-ai Bot Apr 26, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Escape PROMPT before embedding it in JSON output; raw prompt text can produce invalid JSON state lines.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At skills/ralph-loop/scripts/loop.sh, line 122:

<comment>Escape `PROMPT` before embedding it in JSON output; raw prompt text can produce invalid JSON state lines.</comment>

<file context>
@@ -0,0 +1,139 @@
+  fi
+
+  # Emit JSON state to stdout
+  printf '{"iteration":%d,"last_run":"%s","next_run":"%s","interval_seconds":%d,"prompt":"%s","status":"running"}\n' \
+    "$ITERATION" "$NOW" "$NEXT" "$INTERVAL_SECONDS" "$PROMPT"
+
</file context>
Fix with Cubic

SKILL.md claimed automatic retry and failure recovery, but the script
is a scheduling harness that emits prompt text for the agent to act on —
it does not execute commands itself and cannot detect execution failures.

Updated docs to accurately describe the script's role: it manages
interval timing, emits the prompt text + JSON state each iteration,
and handles stop conditions. Removed retry/failure claims, fixed the
stop file path reference, and added interval validation to troubleshooting.

https://claude.ai/code/session_01GvwWVvFRrmzeYS8qJovgsZ

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="skills/ralph-loop/SKILL.md">

<violation number="1" location="skills/ralph-loop/SKILL.md:87">
P2: The new per-process stop-file documentation conflicts with the existing troubleshooting section that still references `/tmp/ralph-loop.stop`, leaving users with contradictory stop instructions.</violation>
</file>

<file name="skills/ralph-loop/scripts/loop.sh">

<violation number="1" location="skills/ralph-loop/scripts/loop.sh:9">
P2: Defaulting to a PID-specific stop file breaks the documented `/tmp/ralph-loop.stop` stop mechanism and makes external stop commands unreliable.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread skills/ralph-loop/SKILL.md Outdated
set -e

# Per-process stop file avoids interference between concurrent loops
STOP_FILE="${RALPH_LOOP_STOP_FILE:-/tmp/ralph-loop-$$.stop}"

@cubic-dev-ai cubic-dev-ai Bot Apr 26, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Defaulting to a PID-specific stop file breaks the documented /tmp/ralph-loop.stop stop mechanism and makes external stop commands unreliable.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At skills/ralph-loop/scripts/loop.sh, line 9:

<comment>Defaulting to a PID-specific stop file breaks the documented `/tmp/ralph-loop.stop` stop mechanism and makes external stop commands unreliable.</comment>

<file context>
@@ -5,36 +5,59 @@
 
-STOP_FILE="${RALPH_LOOP_STOP_FILE:-/tmp/ralph-loop.stop}"
+# Per-process stop file avoids interference between concurrent loops
+STOP_FILE="${RALPH_LOOP_STOP_FILE:-/tmp/ralph-loop-$$.stop}"
 MAX_RETRIES=3
 MIN_INTERVAL_SECONDS=30
</file context>
Suggested change
STOP_FILE="${RALPH_LOOP_STOP_FILE:-/tmp/ralph-loop-$$.stop}"
STOP_FILE="${RALPH_LOOP_STOP_FILE:-/tmp/ralph-loop.stop}"
Fix with Cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="skills/ralph-loop/SKILL.md">

<violation number="1" location="skills/ralph-loop/SKILL.md:93">
P3: The interval validation docs are too strict and incorrectly exclude numeric-second inputs (e.g. `300`), which the script supports.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread skills/ralph-loop/SKILL.md Outdated
The script accepts both ^[0-9]+[smhd]$ and ^[0-9]+$ (treated as seconds),
but the troubleshooting section only documented the unit form. Updated to
reflect that plain numbers like 300 are valid intervals.

https://claude.ai/code/session_01GvwWVvFRrmzeYS8qJovgsZ

@flawlessstudio flawlessstudio left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve

@flawlessstudio flawlessstudio merged commit 6cda50a into main May 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants