Planning Best Practices
This guide covers best practices for creating, validating, and executing plans with Radium's autonomous planning system.
Plan Creationβ
Start Simpleβ
Begin with a minimal plan and iterate:
# My Project
Build a simple feature.
## Iteration 1: Core Feature
1. **Task 1** - Implement core logic
- Agent: code-agent
- Dependencies:
- Acceptance Criteria:
- Feature works as specified
Use Clear Dependenciesβ
Explicitly state task dependencies:
1. **Task 1** - Setup project
- Dependencies:
2. **Task 2** - Implement feature
- Dependencies: I1.T1 # Explicitly depends on Task 1
Assign Appropriate Agentsβ
Choose agents that match the task:
1. **Task 1** - Write code
- Agent: code-agent # For implementation
2. **Task 2** - Review code
- Agent: review-agent # For code review
Define Clear Acceptance Criteriaβ
Specific criteria help validation and execution:
1. **Task 1** - Implement API endpoint
- Acceptance Criteria:
- Endpoint responds to GET /api/users
- Returns JSON with user data
- Status code 200 on success
Plan Validationβ
Fix Validation Errors Earlyβ
Address validation errors before execution:
# Generate plan
rad plan spec.md
# If validation fails:
# β Fix errors in specification
# β Regenerate plan
rad plan spec.md
Avoid Circular Dependenciesβ
Circular dependencies prevent execution:
# β Bad: Circular dependency
Task 1 depends on Task 2
Task 2 depends on Task 1
# β
Good: Linear dependency
Task 1 (no dependencies)
Task 2 depends on Task 1
Task 3 depends on Task 2
Use Valid Task Referencesβ
Always use correct task ID format:
# β
Good: Valid reference
Dependencies: I1.T1
# β Bad: Invalid reference
Dependencies: Task1
Dependencies: I5.T1 # I5 doesn't exist
Plan Executionβ
Start with Bounded Modeβ
Use bounded mode for initial testing:
# Test first 5 iterations
rad craft
# Review results
# If good, continue with more iterations
rad craft --resume
Monitor Progressβ
Watch execution progress for issues:
rad craft
# Watch for:
# - Error messages
# - Token usage
# - Progress percentage
Use Graceful Shutdownβ
Stop execution cleanly when needed:
# Press Ctrl+C to abort
# Progress is saved automatically
rad craft --resume # Continue later
Error Handlingβ
Let Retries Handle Transient Errorsβ
Automatic retries handle most recoverable errors:
# Rate limit error β automatic retry
# Network error β automatic retry
# No action needed
Fix Fatal Errors Immediatelyβ
Address fatal errors before continuing:
# Authentication error β fix credentials
rad auth login
# Configuration error β fix config
# Then resume execution
rad craft --resume
Review Error Messagesβ
Error messages provide actionable guidance:
# Error: 401 unauthorized
# Suggestion: Run 'rad auth login' to authenticate
Cost Managementβ
Monitor Token Usageβ
Track token consumption:
# Check token usage
rad stats
# Output:
# Total Tokens: 45,000
# Total Cost: $0.45
Use Appropriate Modelsβ
Choose models based on task complexity:
# Simple tasks β cheaper models
rad craft --engine claude --model claude-3-haiku
# Complex tasks β more capable models
rad craft --engine claude --model claude-3-opus
Set Budget Limitsβ
Control spending with budgets:
# Set daily budget
rad budget set --daily 10.00
# Monitor budget
rad budget status
Context and Memoryβ
Leverage Context Filesβ
Use context files for project guidelines:
# Create GEMINI.md with project context
echo "# Project Guidelines" > GEMINI.md
echo "Always write tests." >> GEMINI.md
# Context is automatically included in agent prompts
rad craft
Use Memory Storeβ
Agent outputs are automatically stored for future context:
# First agent execution
rad craft
# Later agent can access previous outputs
# Memory is automatically included in context
Troubleshootingβ
Plan Generation Issuesβ
Problem: Plan generation fails
Solutions:
- Check specification format
- Verify workspace is initialized
- Ensure AI model access
Validation Failuresβ
Problem: Validation always fails
Solutions:
- Review validation error messages
- Check for circular dependencies
- Verify task ID formats
- Ensure agents exist
Execution Errorsβ
Problem: Execution fails repeatedly
Solutions:
- Check error categories (recoverable vs fatal)
- Verify authentication credentials
- Review configuration files
- Check network connectivity
High Costsβ
Problem: Token usage is high
Solutions:
- Use cheaper models for simple tasks
- Optimize prompts to reduce token usage
- Set budget limits
- Review session analytics
Common Patternsβ
Incremental Developmentβ
# 1. Create minimal plan
rad plan "Build feature X"
# 2. Execute first iteration
rad craft
# 3. Review and refine
# 4. Add more iterations
# 5. Execute again
rad craft --resume
Full Automationβ
# 1. Create complete plan
rad plan spec.md
# 2. Execute all iterations
rad craft --yolo
# 3. Review results
Error Recoveryβ
# 1. Execution fails
rad craft
# β Error: network connection failed
# 2. Fix issue (e.g., network connectivity)
# 3. Resume execution
rad craft --resume
See Alsoβ
- Autonomous Planning - Plan generation
- Execution Modes - Execution configuration
- Error Handling - Error management
- Monitoring Integration - Cost tracking