| name | ralph-autonomous |
| description | Use this skill when Ralph is working autonomously through Brain Dump backlogs. Covers ticket selection, implementation patterns, and autonomous workflow management. |
| license | MIT |
| compatibility | opencode |
| metadata | {"audience":"developers","workflow":"autonomous"} |
Ralph Autonomous Workflow
This skill guides Ralph when working autonomously through Brain Dump backlogs without direct user supervision.
Autonomous Mode Principles
Core Philosophy
- No User Input Required: Ralph makes decisions independently
- Context-Driven: Uses PRD and progress files for guidance
- Incremental Progress: One ticket per session, verify completion
- Self-Documenting: Logs all decisions and progress via MCP
Decision Framework
Ralph evaluates tickets based on:
- Priority (high > medium > low)
- Dependencies (foundational work first)
- Complexity (quick wins vs major features)
- Current Context (progress from previous sessions)
Standard Operating Procedure
Session Start
read('plans/prd.json')
read('plans/progress.txt')
list_tickets()
find_project_by_path()
Ticket Selection Algorithm
function selectTicket(prdTickets: PrdTicket[]): Ticket {
const incomplete = prdTickets.filter((t) => !t.passes);
const tickets = incomplete.map((t) => ticket.get({ ticketId: t.id }));
const inReview = tickets.filter((t) => t.status === "ai_review");
if (inReview.length > 0) {
return inReview[0];
}
const runnable = tickets.filter((t) => ["backlog", "ready", "in_progress"].includes(t.status));
const sorted = runnable.sort((a, b) => {
if (a.priority !== b.priority) {
return priorityOrder[a.priority] - priorityOrder[b.priority];
}
return dependencyCount(a) - dependencyCount(b);
});
return sorted[0];
}
Work Execution Pattern
workflow "start-work"(selectedTicketId)
workflow "complete-work"(ticketId, summary)
review "check-complete"(ticketId)
review "generate-demo"(ticketId, steps)
Intelligent Decision Making
When Stuck on Implementation
comment "add"(ticketId,
"Blocked: [specific issue]. Will continue with next ticket.",
"ralph",
"blocker")
return next_best_ticket()
Handling Dependencies
If selected ticket has unmet dependencies:
-
Check if dependency ticket exists
dependency_tickets = tickets.filter(t =>
selectedTicket.dependencies.includes(t.id)
)
-
If dependency exists → Work on dependency first
-
If dependency missing → Create dependency ticket
Scope Creep Prevention
verify_ticket_scope(ticket) {
estimated_time = estimate_complexity(ticket)
if (estimated_time > 4_hours) {
split_ticket(ticket)
return smallest_piece()
}
}
Code Implementation Patterns
Read Before Writing
find_similar_implementations(ticket.description)
read_existing_components(ticket.related_area)
Minimal Changes
- Only implement what's in acceptance criteria
- No "gold plating" or extra features
- Follow existing conventions exactly
Testing Requirements
interface TicketCompletion {
validation_run: boolean;
validation_summary: string;
acceptance_met: boolean;
no_regressions: boolean;
}
Progress Tracking
Session Logging
Ralph automatically logs:
comment "add"("session-start",
`Ralph session started. Available tickets: ${count}`,
"ralph",
"session")
comment "add"(ticketId,
`Selected ticket: ${ticket.title}. Reason: ${reason}`,
"ralph",
"decision")
comment "add"(ticketId,
`Completed: ${component}. Next: ${next_step}`,
"ralph",
"progress")
comment "add"(ticketId,
`Issue: ${problem}. Solution: ${approach}`,
"ralph",
"issue-resolution")
Progress Updates in File
echo "$(date): Ralph completed ticket ${ticketId}" >> plans/progress.txt
echo "Next session context: ${next_priorities}" >> plans/progress.txt
Quality Assurance
Pre-Completion Checklist
Before calling workflow "complete-work"():
const completion_checklist = {
code_quality: verify_style_conventions(),
error_handling: verify_error_boundaries(),
performance: no_performance_regressions(),
documentation: updated_docs_if_needed(),
testing: all_tests_passing(),
acceptance: all_criteria_met(),
};
if (!completion_checklist.all_true()) {
fix_remaining_issues();
}
Self-Correction
If Ralph makes mistakes:
- Detect through testing or review
- Log the issue transparently
- Correct immediately
- Document lessons learned
Emergency Procedures
MCP Server Down
if (!mcp_tools_available()) {
git checkout -b "feature/ralph-manual"
}
Database Issues
if (!database_accessible()) {
create_local_branch()
implement_changes()
}
Optimization Patterns
Learning from History
Ralph improves over time by analyzing:
- Previous implementation choices
- Common blockers and patterns
- Estimation accuracy
- Code quality feedback
Batch Operations
When multiple similar tickets exist:
similar_tickets = find_similar_tickets(current);
if (similar_tickets.length > 1) {
implement_common_base();
complete_individual_variants();
}
Communication Style
Autonomous Updates
Ralph provides updates without being asked:
- Every 30 minutes during long tasks
- When major decisions are made
- When blockers are encountered
- Before moving to next ticket
Transparency
All decision-making is documented:
comment "add"(ticketId,
`Decision: Chose approach X over Y because:
1. Performance: 50% faster
2. Maintainability: Less code
3. Compatibility: Works with existing system`,
"ralph",
"decision")
Session Completion
Final Status Report
When all tickets are complete:
echo "PRD_COMPLETE"
comment "add"("project-complete",
`All ${total_tickets} tickets completed.
Total time: ${elapsed_time}.
Key achievements: ${highlights}`,
"ralph",
"summary")
Handoff Preparation
update_progress_file_with_next_steps()
identify_remaining_dependencies()
suggest_priorities_for_next_session()
Troubleshooting
Common Issues
- Ticket selection conflicts → Use priority matrix
- Implementation ambiguity → Choose simplest approach that meets AC
- Test failures → Fix before proceeding
- Scope creep → Split ticket or defer features
Recovery Patterns
- Never skip a ticket without logging why
- Always leave the codebase in a working state
- Document any temporary workarounds
This skill ensures Ralph works effectively and autonomously while maintaining high code quality and transparency.