Single Handoff Management Rules
🎯 Core Principle
Only one active handoff file should exist at any time to prevent confusion and ensure clear responsibility.
📋 Handoff Lifecycle States
1. ACTIVE - Currently being worked on
- Location:
docs/kanban/handoffs/active-[feature-name].md - Status: Agent is actively working on this
- Rule: No other handoffs should be active
2. READY - Complete and ready for pickup
- Location:
docs/kanban/handoffs/ready-[feature-name].md - Status: Work is complete, next agent should pick up
- Rule: Should be converted to ACTIVE when picked up
3. ARCHIVED - Historical record
- Location:
docs/kanban/handoffs/archive/[date]-[feature-name].md - Status: Work completed, kept for reference
- Rule: Moved here after successful completion
🔄 Handoff State Transitions
Starting Work (No Existing Handoff)
- Check:
find docs/kanban/handoffs/ -name "*.md" -not -path "*/archive/*" - Verify: No active handoffs exist
- Create: New active handoff:
active-[feature-name].md
Starting Work (Existing Ready Handoff)
- Find:
docs/kanban/handoffs/ready-*.md - Rename:
ready-[feature-name].md→active-[feature-name].md - Update: Add your pickup timestamp and continuation notes
- Verify: Read and understand all previous context
Completing Work (Handing Off)
- Update: Current
active-[feature-name].mdwith completion status - Rename:
active-[feature-name].md→ready-[feature-name].md - Status: Mark as ready for next agent
- Communicate: Provide pickup instructions
Completing Work (Fully Done)
- Update: Final status in
active-[feature-name].md - Move: To
archive/[YYYY-MM-DD]-[feature-name].md - Clean: Remove from active handoffs directory
- Document: Success and lessons learned
🚨 Conflict Resolution Rules
Multiple Active Handoffs Found
# Check for conflicts
find docs/kanban/handoffs/ -name "active-*.md" | wc -l
# If > 1, resolve conflicts
Resolution Process:
- Identify: Which handoff is most recent/relevant
- Consolidate: Merge information if needed
- Archive: Non-active handoffs to archive/
- Continue: With single active handoff
Handoff Without Proper Naming
Rule: All handoffs must follow naming convention:
active-[feature-name].mdfor current workready-[feature-name].mdfor completed workarchive/[YYYY-MM-DD]-[feature-name].mdfor historical
🔧 Automation Functions
Check Handoff Status
# Function to check current handoff state
check_handoff_status() {
local active_count=$(find docs/kanban/handoffs/ -name "active-*.md" | wc -l)
local ready_count=$(find docs/kanban/handoffs/ -name "ready-*.md" | wc -l)
echo "Active handoffs: $active_count"
echo "Ready handoffs: $ready_count"
if [ $active_count -gt 1 ]; then
echo "⚠️ Multiple active handoffs detected!"
return 1
fi
if [ $active_count -eq 0 ] && [ $ready_count -eq 0 ]; then
echo "✅ No handoffs - fresh start"
return 0
fi
if [ $ready_count -gt 0 ]; then
echo "📋 Ready handoffs available for pickup"
ls docs/kanban/handoffs/ready-*.md
return 0
fi
echo "🔄 Active handoff in progress"
ls docs/kanban/handoffs/active-*.md
}
Pickup Ready Handoff
# Function to pickup a ready handoff
pickup_handoff() {
local ready_file=$(ls docs/kanban/handoffs/ready-*.md 2>/dev/null | head -1)
if [ -z "$ready_file" ]; then
echo "No ready handoffs to pickup"
return 1
fi
local active_file=$(echo "$ready_file" | sed 's/ready-/active-/')
echo "Picking up: $ready_file"
mv "$ready_file" "$active_file"
# Add pickup timestamp
echo -e "\n## 🔄 Pickup Log\n**Picked up by**: Agent at $(date)\n" >> "$active_file"
echo "✅ Handoff activated: $active_file"
}
Create New Handoff
# Function to create new handoff
create_handoff() {
local feature_name="$1"
local handoff_file="docs/kanban/handoffs/active-$feature_name.md"
# Check for existing active handoffs
if ls docs/kanban/handoffs/active-*.md >/dev/null 2>&1; then
echo "⚠️ Active handoff already exists!"
ls docs/kanban/handoffs/active-*.md
echo "Complete or archive existing handoff first"
return 1
fi
# Create new handoff from template
cp templates/handoff-template.md "$handoff_file"
# Update with current info
sed -i "s/{{feature-name}}/$feature_name/g" "$handoff_file"
sed -i "s/{{date}}/$(date)/g" "$handoff_file"
sed -i "s/{{branch}}/$(git branch --show-current)/g" "$handoff_file"
echo "✅ Created active handoff: $handoff_file"
}
📊 Integration with Agent Onboarding
Update scripts/agent-onboard.sh:
# Add to onboarding script
echo -e "\n${BLUE}4. Handoff Status Check${NC}"
check_handoff_status
# If ready handoffs exist, prompt for pickup
if ls docs/kanban/handoffs/ready-*.md >/dev/null 2>&1; then
echo -e "${YELLOW}🔄 Ready handoffs available for pickup${NC}"
echo -e "Run: ${GREEN}pickup_handoff${NC}"
fi
🎯 Best Practices
When Creating Handoffs
- Use descriptive names:
active-auth-system-refactor.md - Include branch name: Critical for continuation
- Document current state: What works, what doesn't
- Provide clear next steps: Specific actions needed
When Picking Up Handoffs
- Read completely: Understand all context
- Verify branch: Switch to correct branch
- Test current state: Confirm what's working
- Update with findings: Add your assessment
When Completing Handoffs
- Update status: Mark what's done
- Document decisions: Key choices made
- Provide closure: What was accomplished
- Archive properly: Keep for reference
Single handoff management ensures clear responsibility and prevents confusion in agent transitions.