Cartolage: map apps with good bones
Skeleton Crew entry. The full write-up, with a citation to the repo for every claim, is in docs/WRITEUP.md.
Inspiration
Maps are one of the best ways to understand a dataset, see how it interacts with others, and decide what to do about it. Most map apps follow the same loop, so I built the loop once as a skeleton and made two very different apps on top of it, each with its own data and scoring model.
What it does
Cartolage (@cartolage/skeleton) runs a five-step loop: pick an area → fetch data → score it → show it → act on it. Scores are explainable. Every score breaks down into each factor's raw value, normalized value, weight, and points, and a property test checks that the points always add up to the score.
Sunblock ranks Phoenix's 378 census tracts for tree planting or rooftop solar, using City of Phoenix Shade Study data on canopy, solar potential, income, and % people of color. Click a tract to see why it ranks where it does and what the recommendation is (plant trees, rooftop solar, both, protect canopy, or built shade). Drag a weight slider and the map recolors and re-ranks live. Then shortlist tracts into phases and export them as CSV.
Detours ranks restaurants and attractions around downtown Phoenix using live Tripadvisor ratings, adjusted with a Bayesian prior so a 5.0 from 3 reviewers counts for less than a 5.0 from hundreds. Add places to a day, or hit Auto-plan to fill 1–3 days inside a 9-to-6 schedule with drive time. Reorder by drag or entirely by keyboard. If the live API is unavailable, it falls back to OpenStreetMap places with clearly labeled demo ratings.
A boundary test keeps the skeleton honest: it fails if any skeleton file mentions tracts, canopy, solar, Tripadvisor, or itineraries. When an app needed something new, I added a generic option to the skeleton instead, such as a row-action slot, data labels, runtime area controls, or live-updating map values.
How I built it with Kiro
All of the app and skeleton code was written in Kiro.
- Steering: six files with one job each. Scope and the "do not build" list, stack rules, folder boundaries, product rules, design direction (loaded only for UI files), and the full brief (manual). Keeping steering current mattered. Twice, Kiro flagged a steering file that still described an outdated API plan before a run could follow it.
- Specs: four feature specs (skeleton, Sunblock, Detours, UI polish) with EARS requirements and correctness properties, run with "Run all tasks" between STOP points where I tested by hand. Design reviews changed requirements before any code existed. The biggest catch: Tripadvisor's legacy API had been retired, so Detours was re-targeted to the new Terra API.
- Bugfix specs: "map clicks do nothing" turned out to be six missing-feedback defects, not a broken handler. A second Bugfix spec found layers silently failing to mount in light mode. Both started from a failing reproduction test.
- Property-based testing: 64 property test files with fast-check. They found bugs I wouldn't have written tests for: a signed-zero legend label, a score of
100.00000000000001, prototype-key crashes, and a contrast ratio just under 4.5:1. - Hooks: two shell-only hooks that cost no credits. One runs typecheck and tests after every task, and one logs each task with a diff summary.
- Playwright: 15 end-to-end tests with a network guard that fails any test trying to reach Tripadvisor. Writing them found a keyboard-focus bug. Kiro also scripted the demo video as recorded Playwright scenes.
Challenges
Most of the hard problems only appeared against real services, after every mocked test had passed:
- The PVWatts API moved domains when NREL became NLR.
- The city's data layers don't share IDs: only 181 of 378 tracts matched, so the join had to be done spatially.
- Overpass rejected a large radius query, so it became a bounding-box query.
- Tripadvisor Terra turned out to have a 5-mile radius cap, a sort parameter that's ignored, a 1-per-second rate limit, names stored as objects, and some places geocoded to the city center.
Each was found by testing live, then fixed and covered by tests.
Accomplishments
- Two working apps on one skeleton, with no app vocabulary leaking into the skeleton.
- 1,596 unit and property tests and 15 end-to-end tests passing.
- Seven bugs found by property tests and fixed in code. None were fixed by weakening a test.
- Keyboard-accessible reordering in both apps, and a contrast check across every theme token pair.
- Honest data labels: Sunblock says it's a snapshot, and Detours says when ratings are demo data.
What I learned
Mocks can't find a wrong assumption about a real API. Spec reviews are cheap compared with rewrites. An outdated steering file is worse than none, because an autonomous run follows it. And Kiro is most useful when it stops and lays out options instead of guessing.
What's next
An openly licensed canopy source, a better ARIA pattern for row actions, live coverage beyond 3 miles in Detours, and a third app to prove the skeleton again.
Disclosure
The repo started inside the submission period, with a stock Vite react-ts scaffold I set up by hand. A handful of fixes were made by hand and are listed in the full write-up. I used Claude for research, planning, prompts, the video script, and editing; all other code was written by Kiro. Credits used: 2,317 of 4,000.
Data: City of Phoenix Shade Study, NLR PVWatts, Tripadvisor, © OpenStreetMap contributors, OpenFreeMap / OpenMapTiles.
Built With
- esri
- ffmpeg
- geojson
- kiro
- maplibre
- netlify
- node.js
- nrel-pvwatts
- openstreetmap
- playwright
- pnpm
- react
- tripadvisor
- typescript
- vite