fix-solution
Skill288 starsChanged 11 months agoMITView on GitHub
Continually test and repair solutions to benchmark problems until they pass. Use when a solution has failing tests. Invoke with /fix-solution <snapshot_path> <problem_name> <checkpoint_index>.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- audit-specSkill
- edge-casesSkill
- reclassify-testsSkill
- run-testsSkill
- test-ambiguity-detectorSkill
- validate-runSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 10 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Run the eval-snapshot command to see current test status:
- Very specific: line 49
Read the spec: - Verify the test aligns with requirements (problems/{problem}/checkpoint_{N}.md)
- Distinctive: line 54
Stop and ask the user before proceeding
- Distinctive: line 56
Wait for user guidance before continuing
- Distinctive: line 65
Only change what's necessary to pass the test
- Distinctive: line 66
Don't refactor or "improve" unrelated code
- Distinctive: line 73
After making fixes, run the evaluation again:
- Distinctive: line 90
If the fix needs to be applied to later checkpoints (checkpoint_3, checkpoint_4, etc.):
- Distinctive: line 188
Ask about suspicious tests: - Don't silently decide tests are wrong
- Distinctive: line 190
Always re-verify: - Run evaluation after every fix
- Distinctive: line 192
Track your changes: - Use git diff or similar to review what changed
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Fix Solution
Iteratively test and repair a solution until all tests pass.
Usage: /fix-solution /path/to/snapshot problem_name checkpoint_N
Example: /fix-solution outputs/run_001/submissions/file_backup/checkpoint_2/snapshot file_backup checkpoint_2
Core Principle
Solutions are likely wrong - focus on fixing the solution code, not the tests.
Tests should generally be trusted. However, the MOMENT there is any doubt whether the tests themselves are correct (not the solution), immediately bring this up to the user for clarification. Do not silently assume tests are wrong.
Step 1: Run Initial Evaluation
Run the eval-snapshot command to see current test status:
slop-code --quiet eval-snapshot {snapshot_path} \
-p {problem_name} \
-c {checkpoint_index} \
-e configs/environments/docker-python3.12-uv.yaml \
-o /tmp/eval-output \
--jsonParse the JSON output to identify:
- Total tests passed/failed
- Which specific tests are failing
- Error messages and stack traces
Step 2: Analyze Failures
For each failing test:
- Read the test code - Understand what behavior is expected
- Read the spec - Verify the test aligns with requirements (
problems/{problem}/checkpoint_{N}.md) - Read the solution code - Find the bug causing the failure
- Identify the fix - Determine what change will make the test pass
If a test seems incorrect:
- Stop and ask the user before proceeding
- Explain why you think the test might be wrong
- Wait for user guidance before continuing
Step 3: Fix the Solution
Edit the solution files in the snapshot directory to fix the failing tests.
Keep fixes minimal:
- Only change what's necessary to pass the test
- Don't refactor or "improve" unrelated code
- Preserve existing working functionality
Step 4: Re-run Evaluation
After making fixes, run the evaluation again:
slop-code --quiet eval-snapshot {snapshot_path} \
-p {problem_name} \
-c {checkpoint_index} \
-e configs/environments/docker-python3.12-uv.yaml \
-o /tmp/eval-output \
--jsonLoop until all tests pass or you determine a test is genuinely incorrect.
Step 5: Propagate to Future Checkpoints
If the fix needs to be applied to later checkpoints (checkpoint_3, checkpoint_4, etc.):
- Identify which files were changed in the current checkpoint
- Check if those files exist in future checkpoint snapshots
- Apply the same fix to each future checkpoint
- Re-run evaluation on each updated checkpoint to verify
# Example: Fix was in main.py, propagate to checkpoint_3
# First, check if checkpoint_3 has the same issue
slop-code --quiet eval-snapshot {base_path}/checkpoint_3/snapshot \
-p {problem_name} \
-c checkpoint_3 \
-e configs/environments/docker-python3.12-uv.yaml \
-o /tmp/eval-output \
--json
# If same test fails, apply the fix there tooOnly propagate fixes that are relevant - later checkpoints may have different implementations.
Iteration Flow
┌─────────────────────────┐
│ Run Evaluation │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ All Tests Pass? │──── Yes ───► Done!
└───────────┬─────────────┘
│ No
▼
┌─────────────────────────┐
│ Analyze Failures │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ Test Seems Wrong? │──── Yes ───► Ask User
└───────────┬─────────────┘
│ No
▼
┌─────────────────────────┐
│ Fix Solution Code │
└───────────┬─────────────┘
│
▼
┌─────────────────────────┐
│ Propagate to Future │
│ Checkpoints │
└───────────┬─────────────┘
│
└──────────────────► (loop back to Run Evaluation)Common Fix Patterns
Missing Error Handling
# Solution missing try/except that spec requires
try:
result = process(data)
except ValueError as e:
return {"error": str(e)}Wrong Return Format
# Test expects list, solution returns dict
# Fix: Return the correct format
return [item for item in results] # not {"items": results}Off-by-One Errors
# Test expects 0-indexed, solution uses 1-indexed
return index # not index + 1Missing Edge Case Handling
# Test passes empty input, solution crashes
if not data:
return []Important Notes
- Trust the tests first - Assume solution bugs until proven otherwise
- Ask about suspicious tests - Don't silently decide tests are wrong
- Keep fixes minimal - Change only what's needed to pass
- Always re-verify - Run evaluation after every fix
- Propagate consistently - Apply fixes to all affected checkpoints
- Track your changes - Use git diff or similar to review what changed
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

