Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions flick.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/bin/bash
# flick.sh — Ralph cleanup utility
# Finds and deletes Ralph intermediary files (prd.json, progress.txt).
# Run this from your project directory after a successful Ralph run.
#
# Usage: bash /path/to/ralph/flick.sh [--nuke|--all]
# --nuke Skip confirmation prompts and delete all files immediately
# --all Alias for --nuke

nuke=false
project_dir="${PWD}"

[[ "$1" == "--nuke" || "$1" == "--all" ]] && nuke=true

search_dirs=(
"${project_dir}"
"${project_dir}/tasks"
"${project_dir}/ralph"
"${project_dir}/.agents/ralph"
"${project_dir}/.agents/skills/ralph"
"${project_dir}/.claude/ralph"
"${project_dir}/.claude/skills/ralph"
"${HOME}/.agents/ralph"
"${HOME}/.agents/skills/ralph"
"${HOME}/.claude/ralph"
"${HOME}/.claude/skills/ralph"
)

found_any=false

for dir in "${search_dirs[@]}"; do
dir_files=()
for fname in prd.json progress.txt; do
[[ -f "${dir}/${fname}" ]] && dir_files+=("${dir}/${fname}")
done

[[ ${#dir_files[@]} -eq 0 ]] && continue
found_any=true

echo ""
echo "════════════════════════════════════════"
echo "Location: ${dir}"

filenames=()
for f in "${dir_files[@]}"; do
filenames+=("$(basename "$f")")
done
echo "Files: $(IFS=', '; echo "${filenames[*]}")"

prd="${dir}/prd.json"
if [[ -f "$prd" ]]; then
echo ""
echo "── prd.json (first 15 lines) ──────────"
head -15 "$prd"
fi

echo ""

if $nuke; then
for f in "${dir_files[@]}"; do
rm "$f" && echo " Deleted: $f"
done
else
read -p "Delete these files? (y/n) " reply
echo ""
if [[ "$reply" =~ ^[Yy]$ ]]; then
for f in "${dir_files[@]}"; do
rm "$f" && echo " Deleted: $f"
done
else
echo " Skipped."
fi
fi
done

if ! $found_any; then
echo "No Ralph files found in any expected location."
else
echo ""
echo "════════════════════════════════════════"
echo "Done."
fi
4 changes: 4 additions & 0 deletions ralph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ for i in $(seq 1 $MAX_ITERATIONS); do
echo ""
echo "Ralph completed all tasks!"
echo "Completed at iteration $i of $MAX_ITERATIONS"
echo ""
echo "Tip: clean up Ralph's intermediary files when you're ready:"
echo " Via your AI coding tool : /flick"
echo " Via script (from project): path/to/ralph/flick.sh"
exit 0
fi

Expand Down
54 changes: 54 additions & 0 deletions skills/flick/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: flick
description: "Clean up Ralph intermediary files (prd.json, progress.txt) after a completed run. Triggers on: flick, flick booger, clean up ralph files, remove prd.json, delete progress.txt, ralph cleanup."
user-invocable: true
---

# Flick — Ralph Cleanup

Finds and removes `prd.json` and `progress.txt` left behind by a Ralph run.

---

## The Job

Search for Ralph intermediary files in the following locations (relative to the current project directory, and at the user level):

1. `{project_root}/`
2. `{project_root}/tasks/`
3. `{project_root}/ralph/`
4. `{project_root}/.agents/ralph/`
5. `{project_root}/.agents/skills/ralph/`
6. `{project_root}/.claude/ralph/`
7. `{project_root}/.claude/skills/ralph/`
8. `~/.agents/ralph/`
9. `~/.agents/skills/ralph/`
10. `~/.claude/ralph/`
11. `~/.claude/skills/ralph/`

Where `{project_root}` is the root of the current project (the working directory).

---

## Steps

1. **Find all instances** of `prd.json` and `progress.txt` across every location above.

2. **If nothing is found**, tell the user: no Ralph files found.

3. **For each location that has files:**
- Show the location path and which files were found there
- If a `prd.json` exists at that location, show its first 15 lines
- Ask the user: "Delete these files? (y/n)"
- If yes, delete them and confirm each deletion
- If no, skip and move to the next location

4. **When all locations are processed**, give a brief summary of what was deleted vs skipped.

---

## Notes

- Be precise about paths when reporting — show the full path of each file found and deleted.
- Do not delete any files without confirmation.
- If the user passes `--nuke`, `--all`, or says "nuke it" / "delete everything" / "delete all", skip the per-location prompts and delete all found files immediately.