Standalone Claude Code skill that ties a ralph loop to a workplan file. Retires automatically when all tasks are done — no external dependencies. - plugin/ralph-workplan.md skill entrypoint - plugin/scripts/check-done.sh pre-start guard (reads workplan status) - plugin/scripts/setup.sh writes ralph state file with workplan-aware prompt - install.sh copies plugin files to ~/.claude/plugins/ - workplan-spec.md workplan file format reference - README.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
34 lines
763 B
Bash
Executable File
34 lines
763 B
Bash
Executable File
#!/bin/bash
|
|
# check-done.sh
|
|
# Exit 0 if the workplan is done, 1 if not.
|
|
# Used as the pre-start guard in the ralph-workplan skill.
|
|
#
|
|
# Usage: check-done.sh <workplan_file>
|
|
|
|
set -euo pipefail
|
|
|
|
WORKPLAN_FILE="${1:?workplan_file required}"
|
|
|
|
if [[ ! -f "$WORKPLAN_FILE" ]]; then
|
|
echo "❌ Workplan file not found: $WORKPLAN_FILE" >&2
|
|
exit 2
|
|
fi
|
|
|
|
# Extract status from YAML frontmatter (first occurrence between --- markers)
|
|
STATUS=$(sed -n '/^---$/,/^---$/{ /^---$/d; p; }' "$WORKPLAN_FILE" \
|
|
| grep '^status:' \
|
|
| head -1 \
|
|
| sed 's/status:[[:space:]]*//' \
|
|
| tr -d '"'"'" )
|
|
|
|
if [[ -z "$STATUS" ]]; then
|
|
echo "⚠️ No status field found in frontmatter of: $WORKPLAN_FILE" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "$STATUS" == "done" ]]; then
|
|
exit 0
|
|
else
|
|
exit 1
|
|
fi
|