// This skill provides guidance for tasks involving merging git branches that contain different implementations of ARC-AGI pattern recognition algorithms, and then implementing a working solution that generalizes across examples. Use this skill when the task involves (1) merging git branches with conflicting code, (2) analyzing ARC-AGI style input/output grid transformations, or (3) implementing pattern recognition algorithms that must generalize to unseen test cases.
| name | merge-diff-arc-agi-task |
| description | This skill provides guidance for tasks involving merging git branches that contain different implementations of ARC-AGI pattern recognition algorithms, and then implementing a working solution that generalizes across examples. Use this skill when the task involves (1) merging git branches with conflicting code, (2) analyzing ARC-AGI style input/output grid transformations, or (3) implementing pattern recognition algorithms that must generalize to unseen test cases. |
This skill addresses tasks that combine git branch merging with ARC-AGI pattern recognition challenges. These tasks typically involve:
map function that generalizes to hidden test casesBefore starting any git operations, complete these setup steps to avoid interruptions:
Configure git identity (prevents merge commit failures):
git config user.email "agent@example.com"
git config user.name "Agent"
Verify working directory is clean or stash changes
Identify the base branch to work from
Extract branches from bundle files:
git bundle unbundle <bundle-file>
Create local branches from the extracted refs:
git checkout -b <branch-name> <ref>
Before merging, examine each branch's implementation:
When merge conflicts occur:
Apply this structured approach to avoid jumping between hypotheses:
Inventory the data:
Compare input to output:
Formulate a single hypothesis and test against ALL examples before moving on
Document findings in a structured format:
Example N:
- Input: [dimensions, unique values, positions]
- Output: [dimensions, patterns observed]
- Hypothesis test: [pass/fail with explanation]
i+j, i-j, or similar(i+j) % n or similar cyclic patternsBefore finalizing an algorithm:
Start with clear documentation:
def map(grid: list[list[int]]) -> list[list[int]]:
"""
Transform input grid to output grid.
Algorithm:
1. [Step 1 explanation]
2. [Step 2 explanation]
Edge cases handled:
- [Case 1]
- [Case 2]
"""
Handle edge cases explicitly:
if not grid or not grid[0]:
return grid
unique_values = [v for v in set(flatten(grid)) if v != 0]
if len(unique_values) == 0:
return [[0] * len(grid[0]) for _ in range(len(grid))]
Avoid collision bugs: When mapping values to positions based on formulas, verify that no two values map to the same position, or handle the collision explicitly
Create a reusable test function early:
def test_map_function(examples_path: str) -> bool:
"""Test map function against all examples."""
import json
with open(examples_path) as f:
examples = json.load(f)
all_passed = True
for i, ex in enumerate(examples):
result = map(ex['input'])
expected = ex['output']
if result != expected:
print(f"Example {i} FAILED")
print(f" Expected: {expected}")
print(f" Got: {result}")
all_passed = False
else:
print(f"Example {i} PASSED")
return all_passed
Run this after every algorithm change rather than writing ad-hoc test scripts.
Before declaring the task complete:
Rate confidence that the solution will pass hidden tests:
If confidence is medium or low, revisit the pattern analysis phase.
| Pitfall | Prevention |
|---|---|
| Git config not set before merge | Run git config commands at start |
| Jumping between hypotheses | Test each hypothesis against ALL examples before abandoning |
| Ignoring one branch's implementation | Read and understand both implementations first |
| No edge case handling | Explicitly list and handle edge cases in code |
| Empirical fitting without justification | Document why the formula works, not just that it works |
| Testing with ad-hoc scripts | Create reusable test function early |
| Missing collision handling | Verify no two values map to same position |
The references/ directory contains detailed guidance:
pattern_analysis_template.md - Structured template for documenting pattern analysisgit_merge_checklist.md - Step-by-step git operations checklist