| name | constituency-edit |
| description | Add, remove, or renumber constituencies in the master list. Use when: adding a missing constituency, fixing constituency counts, renumbering after insertions, correcting district mappings. |
Constituency Edit
When to Use
- A constituency is missing from
public/data/constituencies.json
- District constituency count is wrong in
public/data/districts.json
- Constituencies need renumbering after an insertion or deletion
- A constituency's
districtId mapping is incorrect
Files Affected
Every constituency edit touches multiple files:
public/data/constituencies.json — master constituency list
public/data/districts.json — constituencyCount per district
public/data/district-candidates/<district>.json — candidate rows for the constituency
Add a Constituency
- Read
constituencies.json — find the correct insertion point (constituencies are grouped by district)
- Determine the new ID: lowercase, hyphenated (e.g.
kunnamkulam, vengara)
- Insert the entry with a temporary
number value
- Renumber ALL constituencies sequentially 1 through N
- Update
constituencyCount in districts.json for the affected district
- Add a candidate row in the district's override JSON
- Run the data-validation skill
Renumbering
Constituency numbers must be sequential 1 through N with no gaps.
The app uses these numbers for sorting in DistrictPage.jsx and display in ConstituencyPage.jsx.
Use a script for renumbering — never renumber manually:
import json
with open('public/data/constituencies.json') as f:
data = json.load(f)
for i, c in enumerate(data):
c['number'] = i + 1
with open('public/data/constituencies.json', 'w') as f:
json.dump(data, f, indent=2)
Constituency Entry Format
{
"id": "<lowercase-hyphenated>",
"name": "<Display Name>",
"districtId": "<district-id>",
"number": <sequential>
}
Official Reference
CEO Kerala maintains the definitive list of 140 assembly constituencies.
Cross-check against official sources before adding or removing constituencies.
Constraints
- Never leave gaps in numbering
- Always update
constituencyCount in districts.json to match
- Every new constituency needs a candidate row in the district override