Skip to content

Commit c45a41a

Browse files
author
Ellyse Cedeno
committed
smoketest version of ralph, basic files
1 parent 7647d78 commit c45a41a

File tree

4 files changed

+112
-34
lines changed

4 files changed

+112
-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 & ralph-smoketest.sh"]

tools/ralph/SMOKETEST_PROMPT.md

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

tools/ralph/TASKS.md

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
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+
- [ ] 1. Counter
4+
- Components: Count display + Increment/decrement buttons + Reset button
5+
- Data: Current count value
6+
- Features: Increment, decrement, reset to zero
7+
- [ ] 2. Shopping List with sort-by-category and budget tracking. These should
8+
be 3 different patterns (shopping list, category list, and budget tracker)
9+
and a final pattern that combines them together and acts as a launcher.
10+
- Components: Shopping list (item input + checkboxes + clear button) + Category list (category input + item assignment) + Budget tracker (price input + total display) + Launcher (tabs/buttons to switch between views)
11+
- Data: Shopping items with name, category, price, checked status; Categories with names
12+
- Features: Add/remove items, assign categories, track prices, sort by category, view budget totals, check off purchased items
13+
- [ ] 3. Calendar
14+
- Components: Month view with day cells + Event list displayed in calendar + Day editor (opens when clicking a day)
15+
- Data: Events with date, time, description
16+
- Features: View one month at a time, click day to edit its event list, events shown in calendar UI
17+
- [ ] 4. Fitness Workout Planner
18+
- Components: Exercise routine builder + Set/rep counter + Progress chart
19+
- Data: Exercises with sets, reps, weight
20+
- Features: Track personal records, show strength gains over time
21+
- [ ] 5. Lunch Voter
22+
- Components: Restaurant list + Voting buttons + Vote tally display + Add/remove restaurant form
23+
- Data: Restaurants with vote counts
24+
- Features: Add/remove restaurants, vote for favorites, see most popular choice
25+
- [ ] 6. Study Schedule with Focus Timer
26+
- Components: Study task list + Time block scheduler + Pomodoro timer + Break reminders
27+
- Data: Study topics, estimated duration, completion status
28+
- Features: Schedule study sessions, track time spent, enforce breaks
29+
- [ ] 7. Travel Itinerary with Budget Tracker
30+
- Components: Activity scheduler + Day-by-day timeline + Expense tracker + Budget dashboard
31+
- Data: Activities with time, location, cost
32+
- Features: Plan entire trip, track expenses by category, budget warnings
33+
- [ ] 8. Contact Manager with Birthday Reminders
34+
- Components: Contact list + Upcoming birthdays view + Gift idea notes + Calendar integration
35+
- Data: Contacts with birthdays, gift history
36+
- 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)