65 Commits

Author SHA1 Message Date
Allen 981b92e456 fix(plugins): clamp Codex timeout and filter paired output flags
When the codex-reviewer and ralph-reviewed Stop hooks invoke
`codex exec`, they pass `-o <outputFile>` so the verdict can be parsed
back from a known path, then append the user's `extra_args`. Two latent
bugs surfaced after the docs commit started promoting the shared
~/.claude/codex.json knobs to standalone users:

1. The previous filter dropped `-o` / `--output*` tokens individually
   but not the value that followed a bare flag. With
   extra_args: ["-o", "/tmp/other"], the filter left "/tmp/other" as a
   stray positional that Codex treated as an extra prompt argument.
   The new index-walk filter consumes both halves of paired flags
   (-o, --output, --output-last-message) and drops the inline
   --flag=value variants. Applied to both hooks.

2. ralph-reviewed honored `timeout_seconds` raw. A configured value at
   or above the 1800s Stop hook timeout let Claude kill the hook
   before it could parse Codex's output and surface a verdict. Now
   clamped to [60, 1680] (matching the existing codex-reviewer
   clamp), leaving a 120s buffer below the hook ceiling.

Bumps ralph-reviewed to 3.0.2 and codex-reviewer to 1.6.10 in
lockstep across each plugin.json and the root marketplace.json. The
ralph-reviewed troubleshooting README is updated to describe the new
clamp range rather than telling users to "increase to 1800".
2026-05-21 16:24:01 +00:00
Allen b8e665b622 refactor: move handoffs from ~/.claude/handoffs to ~/.handoffs
Claude Code has internal protection on ~/.claude that blocks writes even
with explicit permissions and additionalDirectories configured. Moving
handoffs outside the protected zone eliminates approval prompts.
2026-03-23 21:36:58 -05:00
Allen 8a243cd1fb feat: auto-install rl CLI from source on first use
ralph-loop.md now builds rl from github.com/0xbigboss/rl via
bun build --compile if not already on PATH. Zero manual setup
needed — just run /ralph-reviewed:ralph-loop.
2026-03-21 20:28:51 -05:00
Allen 064d345dda docs: update QA install instructions for GitHub Packages registry 2026-03-21 15:59:35 -05:00
Allen 19c641be24 fix: rl discovery, reject prompt, version bump
- Stop hook: find rl via PATH, then .rl/rl wrapper fallback
- Stop hook: reject prompt says ".rl/rl done" not "<promise>"
- ralph-loop.md: add bunx/npx/command to allowed-tools
- Bump plugin.json to v3.0.0
2026-03-21 15:51:57 -05:00
Allen 1d16fef6e4 feat: migrate to standalone rl CLI (@0xbigboss/rl)
Replace embedded scripts/rl with the standalone @0xbigboss/rl
package. Stop hook now delegates state, prompt, and log operations
to the rl CLI via spawnSync instead of reimplementing them.

- Delete scripts/rl (323 lines)
- Refactor stop hook: remove parseStateFile, serializeState,
  readPrompt, appendLog, LogEntry, LoopState (872 → 654 lines)
- Update ralph-loop.md: discover rl on PATH or via bunx
- Update cancel-ralph.md: use rl status --json
- Update QA.md: reference installed rl, add hook integration checks
- Bump to v3.0.0
2026-03-21 15:38:55 -05:00
Allen b584ecee1f test(ralph-reviewed): add QA checklist and automated test harness
QA.md covers full e2e verification: rl init, agent work, rl done,
Codex review gate, feedback cycle, edge cases. qa.sh resets the test
repo and launches claude interactively with the QA prompt.
2026-03-21 15:12:20 -05:00
Allen bb4e12c6e5 feat(ralph-reviewed)!: v2.0.0 — rl CLI, state migration, rl done completion
Major rewrite of the ralph-reviewed plugin:

State migration:
- State moved from .claude/ralph-loop.local.md (YAML) to .rl/state.json (JSON)
- Prompt stored separately in .rl/prompt.md
- Structured event log at .rl/log.jsonl
- .rl/ auto-added to .git/info/exclude on init

rl CLI (new):
- rl init: one-command setup (state, prompt, log, symlink)
- rl done / rl done --blocked: state-flag completion (replaces <promise> tags)
- rl log phase|commit|decision|summary: structured JSONL logging
- rl prompt / rl status / rl clean: state inspection and cleanup
- Creates .rl/rl symlink for short-path access after init
- Git root walks superprojects (matches stop hook behavior)

Stop hook:
- Completion detection via state.json flags (not transcript regex)
- Removed legacy <promise> tag parsing and transcript reading
- Review prompt simplified: correctness-focused, tells Codex to use rl
- Codex review outputs kept in .rl/ (not /tmp/)
- Codex cwd uses gitRoot for reliable .rl/ access
- Slimmed LoopState: removed completion_promise, original_prompt,
  pending_feedback, review_history (all derived from .rl/ files)
- Review feedback is plain text (no structured issue IDs/severity)
- Iteration headers hide denominators from agent

Behavioral improvements:
- Pacing, churn breaker, depth-before-breadth, skill loading, live
  verification sections in skill prompt
- Ralphoff "Done when" guidance: verify behavior not file existence

BREAKING CHANGE: State format changed from YAML frontmatter to JSON.
Completion mechanism changed from <promise> tags to rl done command.
2026-03-21 15:12:05 -05:00
Allen bbcf4c4ecf feat(codex-reviewer): increase default max review cycles from 20 to 30
Bump the default --max-cycles value by 50% to allow more review
iterations before auto-approve, matching real-world usage patterns.
2026-03-20 13:59:53 -05:00
Allen 06c9426bd1 feat(plugins): double default iteration and review cycle limits
Ralph and Codex reviewer plugins defaulted to too few cycles,
causing loops to hit caps before completing complex tasks.

- ralph command: 15→30 max-iterations, 10→20 max-reviews
- ralph-loop plugin: 50→30 max-iterations (aligned with ralph command)
- codex-reviewer plugin: 10→20 max-cycles (command + hook fallback)
2026-03-17 15:38:08 -05:00
Big Boss b7813c4cdd refactor(ralph-reviewed): trim help.md from 93 to 62 lines
Remove Best Practices (duplicates ralphoff.md), Example Task Structure
(shows <promise> tags users don't write), and Review Gate section
(duplicates How It Works).
2026-03-01 14:05:45 -06:00
Big Boss f7c1805f52 fix(ralph-reviewed): clean up /tmp codex output files, remove dead state body
- Delete /tmp/codex-review-output-*.txt after reading (was leaking)
- Remove human-readable markdown body from serializeState (never read)
- Fix debug log path in ralph-loop.md to match actual location
  (~/.claude/ralphs/{session_id}/debug.log, not /tmp/)
2026-03-01 14:05:20 -06:00
Big Boss c474a6ed7c refactor(ralph-reviewed): trim ralph-loop.md from 130 to 95 lines
- Remove human-readable body from state file template (only YAML
  frontmatter is read by the stop hook)
- Collapse 8-line Completion Promise Requirement + 19-line BLOCKED
  Escape Condition into 2-line "Completion and Escape" section
- Keep all setup mechanics and confirmation output template intact
2026-03-01 14:03:56 -06:00
Allen 759d722bb7 feat: standardize runtime settings and skill sync 2026-02-09 11:40:13 +00:00
Big Boss d554790a1a chore: remove codex-handoff plugin
Replaced by the /codex skill which provides the same functionality.
2026-01-27 21:51:28 -06:00
Allen cb58801bed refactor: centralize Codex CLI configuration for plugins
- Add codex.json symlink to install.sh for shared plugin config
- Update codex-handoff, codex-reviewer, ralph-reviewed hooks to use
  centralized configuration instead of inline defaults
2026-01-26 00:11:22 +00:00
Allen ad8f95f0cc feat(plugins): add codex-handoff plugin
One-shot handoff gate that triggers Codex CLI on exit:
- Generates handoff context via /handoff skill
- Calls Codex to process handoff on session exit
- Feeds Codex output back to Claude as blocked feedback
- Session resumes with Codex context

Unlike codex-reviewer, this is a single-cycle gate (no review loops).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 05:23:11 +00:00
Allen 5247b194cc fix(plugins): remove explicit hooks field to fix duplicate hooks error
Claude Code now auto-loads hooks/hooks.json from plugin directories,
so explicit declaration causes duplicate loading. Also adds enabledPlugins
to settings template.

- ralph-reviewed: 1.8.7 → 1.8.8
- codex-reviewer: 1.6.8 → 1.6.9

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 05:04:12 +00:00
Big Boss 4c38d9347d fix(plugins): harden stop hooks and avoid dedupe 2026-01-08 15:56:39 -06:00
Allen 1fff4fc342 fix(plugins): move hooks to separate hooks.json files
Claude Code auto-loads hooks/hooks.json by convention. Inline hooks
in plugin.json were not being loaded, causing Stop hooks to never
trigger.

- codex-reviewer: 1.6.5 → 1.6.6
- ralph-reviewed: 1.8.4 → 1.8.5

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 20:26:12 +00:00
Big Boss 57f87f638b fix(plugins): stop outputting approve when no active gate
When codex-reviewer has no active review gate, it was outputting
{"decision": "approve"} which could override other plugin hooks'
block decisions. Now it exits silently (no output) to let other
hooks like ralph-reviewed make the decision.

Also bumps versions: codex-reviewer to 1.6.5, ralph-reviewed to 1.8.4
2026-01-07 23:05:52 -06:00
Big Boss 09ffd9c47e fix(plugins): update hooks format for Claude Code 2.1.1
Claude Code 2.1.1 changed the hook schema to require nested structure:
- Stop hooks now need `"hooks": [{ "hooks": [...] }]` wrapper
- Bump versions: codex-reviewer 1.6.3, ralph-reviewed 1.8.2
2026-01-07 20:47:41 -06:00
Big Boss bf18318f00 fix(plugins): add commands field to plugin.json for command discovery
Both codex-reviewer and ralph-reviewed plugins were missing the
"commands" field, preventing their slash commands from appearing
in the /plugin:command format.
2026-01-07 20:45:53 -06:00
Big Boss de33fe1c25 fix(plugins): consolidate marketplace structure and fix hooks nesting
- Delete nested plugins/.claude-plugin/marketplace.json (was causing load failures)
- Add codex-reviewer to root marketplace.json
- Sync plugin versions in marketplace
- Fix codex-reviewer double-nested hooks structure (same fix as ralph-reviewed)
2026-01-07 17:30:31 -06:00
Big Boss 56164742f6 fix(ralph-reviewed): remove double-nested hooks structure in plugin.json
The hooks configuration had an extra wrapper object causing Claude Code
to silently ignore the stop hook registration. This prevented the v1.8.0
hook from running entirely.
2026-01-07 17:09:52 -06:00
Big Boss 74c9cb417c fix(commands,codex-reviewer): ensure multi-step skills complete all steps
- Remove clipboard copy from handoff/ralphoff (hooks automate prompt passing)
- Add MANDATORY step markers with CRITICAL warnings for continuation
- Fix stop-hook to find state files in submodules by walking git hierarchy
- Check ACTIVE status when walking ancestors (inactive files don't mask parents)
- Update Step 0 to detect active gates in any ancestor repo
- Add head/grep to allowed-tools for verification commands

Fixes issue where Claude stops after first skill invocation in composite
commands like /ralph and /codex-reviewer:review.
2026-01-07 13:07:31 -06:00
Big Boss 60f5ff0c3b fix(statusline,codex-reviewer): update max_review_cycles default to 10
Align all default values with the new 10-cycle default set in the
codex-reviewer command. Updates struct defaults, test assertions,
documentation examples, and fallback values.
2026-01-06 12:18:03 -06:00
Big Boss bc9aca8986 fix(codex-reviewer): increase default max-cycles from 5 to 10
Allow more review iterations by default to catch issues that may
require multiple passes to resolve.
2026-01-06 11:59:08 -06:00
Big Boss eb01ad2534 fix(plugins): handle git submodules in state file lookup
getGitRoot() now walks up through submodule hierarchy using
git rev-parse --show-superproject-working-tree to find the true
root repo. Fixes issue where state files were not found when
Claude cd'd into a submodule.

- ralph-reviewed: v1.7.0 → v1.8.0
- codex-reviewer: v1.5.0 → v1.6.0
2026-01-05 12:18:32 -06:00
Big Boss 7235762c61 feat(codex-reviewer): add --max-cycles argument for review command
Add support for customizing max review cycles via command argument:
- `/codex-reviewer:review "focus" --max-cycles N`
- Defaults to 5 if not specified
- Matches ralph-loop argument style (description first, flags after)

Also fixes null task_description handling in stop-hook parser.
2026-01-03 08:23:18 -06:00
Big Boss 1ae264e485 feat(codex-reviewer): read handoff file at review time instead of embedding content
- Hook now reads from handoff_path at review time (latest content)
- Falls back to embedded task_description for backwards compatibility
- State file stores handoff path instead of full content
- Claude can update handoff between review cycles without touching state
- Added ALLOWED/FORBIDDEN sections clarifying what Claude can modify
2026-01-02 23:34:50 -06:00
Big Boss 158302a49e fix(codex-reviewer): add strict output requirements to prevent malformed responses
Codex sometimes outputs partial responses like "Checked working directory"
instead of the required <review>APPROVE/REJECT</review> verdict tags.

Changes:
- Add CRITICAL output requirement section at top of prompt
- Include explicit anti-pattern warning for status messages
- Change shell commands from inline templates to instructions
- Add repeated reminder at end of prompt
- Update SKILL.md with new prompt structure and rationale

Bump version to v1.5.0.
2026-01-02 22:32:09 -06:00
Big Boss d90637e714 feat(hooks): add systemMessage output on review gate approval
When Codex approves, stop hooks now output a systemMessage that Claude
Code displays to the user. This provides visibility into what happened
(approval status, reviewer notes, iteration counts) instead of silent exit.

Changes:
- codex-reviewer: Show approval summary with review cycle and files
- ralph-reviewed: Show status for APPROVE, BLOCKED, max iterations,
  and max review cycles scenarios
- Added JSDoc with reference to official hooks documentation
- Bumped plugin versions (codex-reviewer 1.4.0, ralph-reviewed 1.6.0)
2026-01-02 14:48:33 -06:00
Big Boss 91d51ccbcd feat(codex-reviewer): add custom review focus support
/codex-reviewer:review "focus on security" now passes custom focus
to the handoff generation instead of using the default.
2026-01-02 10:38:55 -06:00
Big Boss a86067d881 fix(codex-reviewer): prevent review count reset on re-invocation
- Add Step 0 guard in review.md to check for existing active gate
- If gate already active, tell Claude to just exit instead of recreating
- Update stop-hook feedback to explicitly warn against calling skill again
- Bump version to 1.3.0
2026-01-02 09:58:18 -06:00
Big Boss 7aaaa33953 fix: require git repo for Codex review with clear error message
Both codex-reviewer and ralph-reviewed now check for git repo before
calling Codex and provide actionable error messages instead of the
cryptic "Codex exited with status 1" from untrusted directory errors.
2026-01-01 22:58:24 -06:00
Big Boss fc606ca727 fix: increase review hook buffer and bump versions 2026-01-01 22:16:43 -06:00
Big Boss f0fcef659f chore(plugins): bump codex-reviewer to 1.2.0 in marketplace 2026-01-01 21:28:23 -06:00
Big Boss 94eaccc46f feat(codex-reviewer): use /handoff for rich review context
The review command now invokes /handoff before creating the state file,
giving Codex rich context about the work instead of a basic summary.

Changes:
- Restructure review.md into 3 steps: generate handoff, create state, exit
- Add YAML frontmatter with description and allowed-tools
- State file task_description now contains full handoff with XML sections:
  <role>, <context>, <current_state>, <key_files>, <next_steps>
- Bump version to 1.2.0

Before: task_description was "Updated file X to do Y"
After: task_description includes reviewer framing, approach context,
       what was done, key files with descriptions, verification steps
2026-01-01 21:26:59 -06:00
Big Boss ed886dae5c chore(plugins): bump codex-reviewer to 1.1.1 in marketplace 2026-01-01 11:39:55 -06:00
Big Boss 7d2e7826e7 chore(codex-reviewer): bump version to 1.1.1 2026-01-01 11:37:52 -06:00
Big Boss 628486925a feat(statusline): add Codex review cycle tracking
Display Codex review gate status in statusline alongside Ralph loop.

Changes:
- Add CodexReviewState struct to parse .claude/codex-review.local.md
- Display review cycle as 🔎 N/M (distinct from Ralph's 🔍)
- Move progressColor() to shared function for both Ralph and Codex
- Add 9 unit tests for CodexReviewState parsing and formatting
- Document state file locations and lookup commands in CLAUDE.md
- Fix codex-reviewer command to be explicit about git root path
2026-01-01 11:33:22 -06:00
Big Boss f5fe1e19ec chore(plugins): bump ralph-reviewed to 1.5.0 in marketplace 2026-01-01 09:09:52 -06:00
Big Boss 953ba004c5 chore(ralph-reviewed): bump version to 1.5.0 2026-01-01 09:05:52 -06:00
Big Boss 0c79169681 feat(ralph-reviewed): default --max-reviews to --max-iterations
Simplify configuration by having --max-reviews default to the
--max-iterations value when not explicitly specified, rather than
a hardcoded value of 5.
2026-01-01 08:11:36 -06:00
Big Boss 4fb214d41e feat(plugins): add hook configs and author metadata to marketplace
Enhance local marketplace manifest with complete plugin metadata:
- Add marketplace-level description in metadata section
- Include author name and email for each plugin
- Configure Stop hooks with command handlers and timeout settings
- Reorganize fields for consistent structure across plugins
2025-12-31 22:37:13 -06:00
Big Boss 1dfd2d83cf feat(plugins): add local marketplace manifest for 0xbigboss plugins
Add marketplace.json enabling local plugin installation via:
  /plugin marketplace add ./plugins
  /plugin install codex-reviewer@0xbigboss-plugins

Includes ralph-reviewed (1.4.0) and codex-reviewer (1.1.0) plugins.
2025-12-31 22:20:03 -06:00
Big Boss c103c08a3b feat(plugins): add codex-reviewer strict code review gate
Implement Codex-powered review gate plugin with fail-closed behavior:
- Stop hook with 1800s timeout to bypass Bash tool limits
- Strict gate: all errors block, requires explicit /cancel to escape
- Timeout clamping to [60s, 1680s] for safe hook execution
- State persistence before max-cycle check
- Execution error handling (spawn, signal, non-zero exit)
- Review history tracking with issue IDs across cycles
- Commands: review (start gate), cancel (escape gate)

Config stored at ~/.claude/codex/config.json separate from other tools.
2025-12-31 22:19:58 -06:00
Big Boss 51e9f1505e chore(ralph-reviewed): bump version to 1.4.0
Release includes:
- BLOCKED escape signal for early termination without Codex review
2025-12-29 17:55:36 -06:00
Big Boss 5440e8cf90 feat(ralph-reviewed): add BLOCKED escape signal for early termination
Add built-in support for <promise>BLOCKED</promise> as a special
termination signal that exits the loop without triggering Codex review.

Use case: when Claude is genuinely blocked by external issues (missing
deps, pre-existing bugs, infra problems), it can cleanly exit without
wasting a review cycle on incomplete work.

- Add BLOCKED pattern detection in stop-hook.ts before completion check
- Add "Escape Condition: BLOCKED" section to ralph-loop.md
- Update README with BLOCKED documentation and feature comparison
- Bump version to v1.4.0
2025-12-29 17:06:23 -06:00