Skip to content

Commit 011800e

Browse files
Ellyse Cedenoellyxir
authored andcommitted
smoketest version of ralph, basic files
1 parent 7647d78 commit 011800e

File tree

4 files changed

+134
-34
lines changed

4 files changed

+134
-34
lines changed

tools/ralph/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ RUN npm install -g @anthropic-ai/claude-code && \
7676
# --no-sandbox is required because Docker containers restrict namespace creation
7777
RUN claude mcp add --scope user playwright npx "@playwright/mcp@latest" -- --headless --isolated --no-sandbox
7878

79-
# Start Common Tool servers in background and keep container alive
80-
# the sleep ensures that restarting the server doesnt cause the container to exit
81-
CMD ["/bin/sh", "-c", "/app/start-servers.sh & sleep infinity"]
79+
# Start servers in background, run smoketest, then exit
80+
# If you want to run ralph normally without the smoketest, then replace with:
81+
# CMD ["/bin/sh", "-c", "/app/start-servers.sh & sleep infinity"]
82+
CMD ["/bin/sh", "-c", "/app/start-servers.sh & /app/labs/tools/ralph/bin/ralph-smoketest.sh; sleep infinity"]

tools/ralph/SMOKETEST_PROMPT.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Smoketest Ralph General Prompt
2+
3+
Goal: implement the unchecked item from `./tools/ralph/TASKS.md` that matches
4+
your assigned RALPH_ID
5+
6+
1. Open `./tools/ralph/TASKS.md` and find the task numbered with your RALPH_ID.
7+
8+
2. If your assigned task is already checked `[x]`, exit with a message saying
9+
the task is already complete.
10+
11+
3. Use Claude Skills "recipe-dev" to work on the task that corresponds to your
12+
RALPH_ID number.
13+
14+
4. Format with `deno fmt` for the changed files.
15+
16+
5. Once all tests pass, check off the completed items in `TASKS.md`:
17+
18+
6. git stage and commit with a message
19+
20+
7. copy the files you created for the task to /app/smoketest/${RALPH_ID}/
21+
22+
8. create a summary of your work in the same directory called
23+
/app/smoketest/${RALPH_ID}/RESULTS.md
24+
25+
9. create a /app/smoketest/${RALPH_ID}/SCORE.txt which has one of the following
26+
values based on your results: SUCCESS, PARTIAL, FAILURE
27+
28+
10. Add feedback to documentation to `./tools/ralph/LEARNINGS.md`.
29+
30+
11. Exit
31+
32+
Please begin.

tools/ralph/TASKS.md

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,56 @@
11
# Ralph Task List
22

3-
A running checklist of tasks. New items include brief implementation notes for a
4-
future Ralph pass.
5-
6-
Tasks marked with [UI] mean they should add/remove/modify the UI of the pattern.
7-
UI tasks should wire up the functionality and call the appropriate handlers.
8-
9-
- [] Create a counter
10-
- [] Add [UI] buttons for incrementing counter
11-
- **Test with Playwright**: click increment 3 times, verify counter shows 3,
12-
click decrement once, verify counter shows 2
13-
- **State**: The displayed count matches the pattern's `count` output field
14-
- [] Create multiple counters
15-
- [] Add [UI] buttons to create multiple counters
16-
- **Test with Playwright**: create 3 counters, test each one
17-
- **State**: Each counter maintains its own value in the pattern's
18-
`counters` array
19-
- [] Create a shopping list
20-
- [] Create [UI] for shopping list
21-
- **Test with Playwright**: add "milk" and "bread", make sure you see both,
22-
remove "bread", verify only "milk" remains
23-
- **State**: The list shows all items from pattern's `items` array with
24-
correct `completed` status
25-
- [] Lunch voter - list of destinations (just a string) (dedup)
26-
- [] [UI] for adding list of destination (just a string) and displaying it
27-
- **UI must**: Show an editable list with add/remove buttons for
28-
destinations
29-
- **Test with Playwright**: Deploy pattern, add at least 2 destinations via
30-
UI, verify they appear in the list, remove one destination, verify it's
31-
removed from both UI and charm output
32-
- **State**: The displayed list matches the pattern's `destinations` output
33-
field
3+
-
4+
1. [ ] Counter
5+
- Components: Count display + Increment/decrement buttons + Reset button
6+
- Data: Current count value
7+
- Features: Increment, decrement, reset to zero
8+
-
9+
2. [ ] Shopping List with sort-by-category and budget tracking. These should
10+
be 3 different patterns (shopping list, category list, and budget
11+
tracker) and a final pattern that combines them together and acts as a
12+
launcher.
13+
- Components: Shopping list (item input + checkboxes + clear button) +
14+
Category list (category input + item assignment) + Budget tracker (price
15+
input + total display) + Launcher (tabs/buttons to switch between views)
16+
- Data: Shopping items with name, category, price, checked status; Categories
17+
with names
18+
- Features: Add/remove items, assign categories, track prices, sort by
19+
category, view budget totals, check off purchased items
20+
-
21+
3. [ ] Calendar
22+
- Components: Month view with day cells + Event list displayed in calendar +
23+
Day editor (opens when clicking a day)
24+
- Data: Events with date, time, description
25+
- Features: View one month at a time, click day to edit its event list, events
26+
shown in calendar UI
27+
-
28+
4. [ ] Fitness Workout Planner
29+
- Components: Exercise routine builder + Set/rep counter + Progress chart
30+
- Data: Exercises with sets, reps, weight
31+
- Features: Track personal records, show strength gains over time
32+
-
33+
5. [ ] Lunch Voter
34+
- Components: Restaurant list + Voting buttons + Vote tally display +
35+
Add/remove restaurant form
36+
- Data: Restaurants with vote counts
37+
- Features: Add/remove restaurants, vote for favorites, see most popular
38+
choice
39+
-
40+
6. [ ] Study Schedule with Focus Timer
41+
- Components: Study task list + Time block scheduler + Pomodoro timer + Break
42+
reminders
43+
- Data: Study topics, estimated duration, completion status
44+
- Features: Schedule study sessions, track time spent, enforce breaks
45+
-
46+
7. [ ] Travel Itinerary with Budget Tracker
47+
- Components: Activity scheduler + Day-by-day timeline + Expense tracker +
48+
Budget dashboard
49+
- Data: Activities with time, location, cost
50+
- Features: Plan entire trip, track expenses by category, budget warnings
51+
-
52+
8. [ ] Contact Manager with Birthday Reminders
53+
- Components: Contact list + Upcoming birthdays view + Gift idea notes +
54+
Calendar integration
55+
- Data: Contacts with birthdays, gift history
56+
- Features: Birthday notifications, gift suggestions, relationship notes

tools/ralph/bin/ralph-smoketest.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
3+
# Get the directory where this script is located
4+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5+
# Get the ralph directory (parent of bin)
6+
RALPH_DIR="$(dirname "$SCRIPT_DIR")"
7+
# Get the labs directory (two levels up from bin)
8+
LABS_DIR="$(dirname "$(dirname "$RALPH_DIR")")"
9+
10+
# Change to labs directory for relative paths to work
11+
cd "$LABS_DIR"
12+
13+
# Check RALPH_ID is set
14+
if [ -z "$RALPH_ID" ]; then
15+
echo "Error: RALPH_ID environment variable is not set"
16+
exit 1
17+
fi
18+
19+
# Ensure logs directory exists
20+
mkdir -p ./tools/ralph/logs
21+
22+
# Rotate logs keeping last 5
23+
for i in 4 3 2 1; do
24+
[ -f ./tools/ralph/logs/ralph-claude.log.$i ] && mv ./tools/ralph/logs/ralph-claude.log.$i ./tools/ralph/logs/ralph-claude.log.$((i+1))
25+
done
26+
[ -f ./tools/ralph/logs/ralph-claude.log ] && mv ./tools/ralph/logs/ralph-claude.log ./tools/ralph/logs/ralph-claude.log.1
27+
28+
# llm command to summarize changes
29+
LLM="./tools/ralph/bin/llm.sh"
30+
31+
{ printf "Your RALPH_ID is %s.\n\n" "$RALPH_ID"; cat ./tools/ralph/SMOKETEST_PROMPT.md; } | \
32+
claude --print --dangerously-skip-permissions \
33+
--verbose --output-format=stream-json 2>&1 | \
34+
tee -a ./tools/ralph/logs/ralph-claude.log
35+
36+
# Auto-stash changes if any exist
37+
if [[ -n "$(git status --porcelain)" ]]; then
38+
git add -A
39+
40+
# Generate commit message from staged changes
41+
commit_msg=$(git diff --staged | $LLM "Summarize these changes into a short one-line description, output just that one line")
42+
43+
git stash push -m "$commit_msg"
44+
fi

0 commit comments

Comments
 (0)