diff --git a/.pi/skills/ralph-work-loop/README.md b/.pi/skills/ralph-work-loop/README.md new file mode 100644 index 0000000..5411ea4 --- /dev/null +++ b/.pi/skills/ralph-work-loop/README.md @@ -0,0 +1,15 @@ +# Ralph Work Loop Skill + +Runs the Ralph Wiggum loop on an existing Work document. + +## Usage + +``` +/ralph start docs/work/.md +``` + +If you don't know the work doc, run: + +```bash +./.pi/skills/ralph-work-loop/scripts/find-latest-work.sh +``` diff --git a/.pi/skills/ralph-work-loop/SKILL.md b/.pi/skills/ralph-work-loop/SKILL.md new file mode 100644 index 0000000..3031f9e --- /dev/null +++ b/.pi/skills/ralph-work-loop/SKILL.md @@ -0,0 +1,51 @@ +--- +name: ralph-work-loop +description: Start or resume a Ralph Wiggum loop on an existing Work document (docs/work/*.md). Use when the user asks to "use ralph" on a Work doc or to run iterative Work-phase execution. +--- + +# Ralph Work Loop + +Use this skill to run the Ralph Wiggum loop **after** a Work document exists. + +## Requirements + +- Ralph extension installed: `.pi/extensions/ralph-wiggum/index.ts` +- Work document already created in `docs/work/` + +## Process + +1. **Validate the Work doc**: + - Check required sections: Intent link, Approach link, Checklist, Verification commands, Evidence section + - Each checklist item needs a verification command + - See the `work` skill for full validation checklist + - Fix any issues before starting the loop + +2. **Locate the Work doc**: + - If user provides a path, use it. + - Otherwise run: + ```bash + ./.pi/skills/ralph-work-loop/scripts/find-latest-work.sh + ``` + - If multiple candidates are relevant, list them and ask the user to choose. + +3. **Start the loop**: + ``` + /ralph start + ``` + Optional flags (ask user if they care): + - `--items-per-iteration N` + - `--reflect-every N` + - `--max-iterations N` + +4. **Monitor or resume**: + - ` /ralph status` to show active loops + - ` /ralph resume ` to continue paused loop + +5. **Stop**: + - Press `ESC` to pause + - ` /ralph-stop` when idle to end the loop + +## Notes + +- The loop enforces the **Intent → Approach → Work** dialect and requires verification evidence for completed items. +- Use `/ralph start ` to point directly to an existing Work doc. diff --git a/.pi/skills/ralph-work-loop/scripts/find-latest-work.sh b/.pi/skills/ralph-work-loop/scripts/find-latest-work.sh new file mode 100755 index 0000000..061e3cc --- /dev/null +++ b/.pi/skills/ralph-work-loop/scripts/find-latest-work.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +skill_dir="$(cd "${script_dir}/.." && pwd)" +root_dir="$(cd "${skill_dir}/../../.." && pwd)" + +work_dir="${root_dir}/docs/work" +if [[ ! -d "${work_dir}" ]]; then + echo "Error: docs/work not found at ${work_dir}" >&2 + exit 1 +fi + +latest_file="" +if compgen -G "${work_dir}/*.md" > /dev/null; then + latest_file="$(ls -t "${work_dir}"/*.md | head -n 1)" +fi + +if [[ -z "${latest_file}" ]]; then + echo "Error: no Work docs found in ${work_dir}" >&2 + exit 1 +fi + +relative_path="${latest_file#"${root_dir}/"}" +echo "${relative_path}"