name: debtmap-parallel-elimination
mode: mapreduce
setup:
timeout: 900 commands:
- shell: "just coverage-lcov"
- shell: "debtmap analyze src --lcov target/coverage/lcov.info --output .prodigy/debtmap-before.json --format json"
map:
input: .prodigy/debtmap-before.json
json_path: "$.items[*]"
agent_template:
- claude: "/prodigy-debtmap-plan --item '${item}' --output .prodigy/plan-${item_id}.md"
capture_output: true
validate:
commands:
- claude: "/prodigy-validate-debtmap-plan --item '${item}' --plan .prodigy/plan-${item_id}.md --output .prodigy/validation-${item_id}.json"
result_file: ".prodigy/validation-${item_id}.json"
threshold: 75
on_incomplete:
commands:
- claude: "/prodigy-revise-debtmap-plan --gaps ${validation.gaps} --plan .prodigy/plan-${item_id}.md"
max_attempts: 3
fail_workflow: false
- claude: "/prodigy-debtmap-implement --plan .prodigy/plan-${item_id}.md"
commit_required: true
validate:
commands:
- shell: "just coverage-lcov"
- shell: "debtmap analyze src --lcov target/coverage/lcov.info --output .prodigy/debtmap-after-${item_id}.json --format json"
- shell: "debtmap compare --before .prodigy/debtmap-before.json --after .prodigy/debtmap-after-${item_id}.json --plan .prodigy/plan-${item_id}.md --output .prodigy/comparison-${item_id}.json --format json"
- claude: "/prodigy-validate-debtmap-improvement --comparison .prodigy/comparison-${item_id}.json --previous-validation .prodigy/debtmap-validation-${item_id}.json --output .prodigy/debtmap-validation-${item_id}.json"
result_file: ".prodigy/debtmap-validation-${item_id}.json"
threshold: 75
on_incomplete:
commands:
- claude: "/prodigy-complete-debtmap-fix --plan .prodigy/plan-${item_id}.md --validation .prodigy/debtmap-validation-${item_id}.json --attempt ${validation.attempt_number}"
commit_required: true
- shell: "just coverage-lcov"
- shell: "debtmap analyze src --lcov target/coverage/lcov.info --output .prodigy/debtmap-after-${item_id}.json --format json"
- shell: "debtmap compare --before .prodigy/debtmap-before.json --after .prodigy/debtmap-after-${item_id}.json --plan .prodigy/plan-${item_id}.md --output .prodigy/comparison-${item_id}.json --format json"
max_attempts: 5
fail_workflow: true
- shell: "just test"
on_failure:
claude: "/prodigy-debug-test-failure --output ${shell.output}"
max_attempts: 5
fail_workflow: true
- shell: "just fmt-check && just lint"
on_failure:
claude: "/prodigy-lint ${shell.output}"
max_attempts: 5
fail_workflow: true
max_parallel: 5
filter: "File.score >= 10 OR Function.unified_score.final_score >= 10"
sort_by: "File.score DESC NULLS LAST, Function.unified_score.final_score DESC NULLS LAST" max_items: 10
reduce:
- shell: "just test"
on_failure:
claude: "/prodigy-debug-test-failure --output ${shell.output}"
max_attempts: 5
fail_workflow: true
- shell: "just fmt-check && just lint"
on_failure:
claude: "/prodigy-lint ${shell.output}"
max_attempts: 5
fail_workflow: true
- shell: "just coverage-lcov"
- shell: "debtmap analyze src --lcov target/coverage/lcov.info --output .prodigy/debtmap-after.json --format json"
- write_file:
path: ".prodigy/map-results.json"
content: "${map.results}"
format: json
create_dirs: true
- claude: |
/prodigy-compare-debt-results \
--before .prodigy/debtmap-before.json \
--after .prodigy/debtmap-after.json \
--map-results-file .prodigy/map-results.json \
--successful ${map.successful} \
--failed ${map.failed} \
--total ${map.total}
commit_required: true