name: documentation-drift-parallel
mode: mapreduce
setup:
- shell: |
cat > .prodigy/doc-areas.json << 'EOF'
{
"areas": [
{"name": "README", "pattern": "README.md,**/README.md", "priority": "high"},
{"name": "CLAUDE", "pattern": "CLAUDE.md,.claude/**/*.md", "priority": "high"},
{"name": "commands", "pattern": ".claude/commands/*.md", "priority": "medium"},
{"name": "workflows", "pattern": "workflows/*.yml,workflows/*.md", "priority": "medium"},
{"name": "api_docs", "pattern": "src/**/*.rs", "priority": "high"},
{"name": "examples", "pattern": "examples/**/*", "priority": "low"},
{"name": "config", "pattern": "*.toml,*.yaml,*.yml", "priority": "medium"},
{"name": "tests", "pattern": "tests/**/*.rs", "priority": "low"}
]
}
EOF
echo "Created documentation areas configuration"
capture_output: true
- claude: "/prodigy-docs-drift-analyze"
commit_required: false
- shell: |
if [ -f .prodigy/documentation-drift.json ]; then
cp .prodigy/documentation-drift.json .prodigy/drift-baseline.json
echo "Baseline drift analysis saved"
fi
map:
input: .prodigy/doc-areas.json
json_path: "$.areas[*]"
agent_template:
- claude: "/prodigy-docs-drift-analyze --area '${item.name}' --pattern '${item.pattern}'"
commit_required: false
timeout: 300
- claude: "/prodigy-docs-drift-update critical --area '${item.name}'"
commit_required: true
timeout: 300
- claude: "/prodigy-docs-drift-update major --area '${item.name}'"
commit_required: true
timeout: 300
- shell: |
if [ -f .prodigy/documentation-drift.json ]; then
jq --arg area "${item.name}" '{
area: $area,
priority: "${item.priority}",
remaining_issues: .summary.total_issues,
fixed_critical: .summary.fixed_critical // 0,
fixed_major: .summary.fixed_major // 0
}' .prodigy/documentation-drift.json > .prodigy/drift-${item.name}-result.json
else
echo '{"area": "${item.name}", "remaining_issues": 0}' > .prodigy/drift-${item.name}-result.json
fi
capture_output: true
max_parallel: 4
reduce:
- claude: "/prodigy-docs-drift-update minor"
commit_required: true
timeout: 300
- claude: "/prodigy-docs-drift-analyze"
commit_required: false
- shell: |
echo "=== Documentation Drift Resolution Summary ==="
echo "Parallel agents processed: ${map.total}"
echo "Successful: ${map.successful}"
echo "Failed: ${map.failed}"
echo ""
if [ -f .prodigy/drift-baseline.json ] && [ -f .prodigy/documentation-drift.json ]; then
baseline_total=$(jq '.summary.total_issues // 0' .prodigy/drift-baseline.json)
final_total=$(jq '.summary.total_issues // 0' .prodigy/documentation-drift.json)
fixed=$((baseline_total - final_total))
echo "Baseline issues: $baseline_total"
echo "Remaining issues: $final_total"
echo "Issues fixed: $fixed"
if [ "$final_total" -eq 0 ]; then
echo "✅ All documentation drift has been resolved!"
elif [ "$fixed" -gt 0 ]; then
echo "✅ Fixed $fixed documentation issues"
else
echo "⚠️ Some documentation issues could not be fixed automatically"
fi
fi
capture_output: true
- claude: "/prodigy-lint"
commit_required: true
- shell: "cargo test --doc 2>/dev/null || echo 'Note: Some doctests may need manual review'"