Fix common issues in geographic data contributions to the CSC database. Use this skill whenever you need to fix, correct, repair, patch, or resolve issues in a data contribution or PR. Trigger on: "@copilot fix this", "auto-fix" label on issues, "can you fix", "please correct", "help me fix", "what's wrong with my PR", removing auto-managed fields, correcting country codes, fixing mismatched foreign keys, or formatting JSON. Also use when a PR has validation errors and you need to commit fixes directly. Read common-fixes.md in this directory for fix patterns and examples.
auto-fix or copilot labelBefore starting, read common-fixes.md in this skill's directory for detailed fix patterns with before/after examples.
Read the validation report comment on the PR (posted by the PR Validator workflow). It will list specific errors and warnings categorised as:
For cities missing fields, look up the correct values:
state_id / state_code: Search states.json by state name and countrycountry_id / country_code: Search countries.json by country namelatitude / longitude: If missing, leave a comment asking the contributor rather than guessingcountry_code not 2 chars: Look up the correct ISO2 code from countries.jsonRemove these fields from the contribution:
idcreated_atupdated_atflagcountry_code does not match country_id: Look up the correct code from countries.jsonstate_code does not match state_id: Look up the correct code from states.jsonstate_id belongs to a different country: Flag for contributor clarificationIf you have write access to the contributor's branch:
fix: correct [description] in [filename]If you do NOT have write access:
fix: corrections for PR #[number]Always comment on the PR explaining:
1. Read the country_id from the record
2. Find the country in countries.json by id
3. Use its iso2 field as the correct country_code
1. Read the state_id from the record
2. Find the state in states.json by id
3. Use its state_code or iso2 field as the correct state_code
4. Verify the state's country_id matches the record's country_id
For each record in the contribution:
Remove: id, created_at, updated_at, flag
Keep everything else unchanged
name field without contributor confirmation