KIWIPACE

Build Custom Fields for Kiwi Pace

If your AI assistant supports MCP connectors, add https://mcp.kiwipace.app/mcp for live schema validation, representative previews, Universal Links, and scannable QR codes.

On Claude or ChatGPT plans without custom MCP connectors, copy the starter prompt below to generate valid .kpfield.json and .kppage.json files directly.

Download Markdown Import Link Page

Copy-Paste Starter Prompt

You are designing declarative custom cycling data fields (.kpfield.json) or pages (.kppage.json) for the Kiwi Pace handlebar computer (Phase 1a).

Return ONLY valid JSON conforming strictly to these rules (no unknown properties, no JavaScript, no raw hex colours inside .kpfield.json):

1. SIZE & LIMITS
- Single .kpfield.json <= 4 KB; max 16 custom widgets per recipe.
- Max 3 expressions per field; each expression <= 256 chars, <= 32 AST nodes, depth <= 6, zero loops/recursion.
- Rolling window functions avg(var, secs) and delta(var, secs):
  - ONLY allowed on: sensor.power_w, sensor.hr_bpm, sensor.cadence_rpm, ride.speed_ms, ride.elevation_m, ride.grade_pct.
  - secs: integer 1..300 for avg(), 15..300 for delta().
  - Max 4 distinct (var, secs) rolling rings across the entire recipe (identical pairs share 1 ring).

2. ALLOWED OPERATORS & PURE FUNCTIONS
- Operators: + - * / % == != < <= > >= && || !
- Functions: div(a, b[, fallback]), clamp(x, min, max), min(a, b), max(a, b), abs(x), round(x[, dp 0..4]), if(cond, then, else), coalesce(a, b[, c, d]), avg(var, secs), delta(var, secs).
- Divide-by-zero and non-finite results evaluate safely to null (displayed as "--").

3. PHASE 1 VARIABLES (never invent unavailable variables like workout.* or weather_*)
- Local (live offline): time.clock_s, time.local_hm, time.date, time.weekday, time.day, time.month, battery.comp_pct
- Ride: ride.time_s, ride.speed_ms, ride.speed_avg_ms, ride.speed_max_ms, ride.distance_m, ride.elevation_m, ride.grade_pct, ride.lap_time_s, ride.total_ascent_m
- Sensors: sensor.power_w, sensor.power_3s_w, sensor.power_avg_w, sensor.lap_power_avg_w, sensor.power_np_w, sensor.power_max_w, sensor.hr_bpm, sensor.hr_avg_bpm, sensor.cadence_rpm, sensor.cadence_avg_rpm, sensor.power_zone, sensor.hr_zone, sensor.ambient_temp_c, sensor.radar_level, sensor.radar_dist_m, sensor.gear_front, sensor.gear_rear
- Map / Nav / Climb: map.lat_deg, map.lon_deg, map.heading_deg, nav.maneuver, nav.dist_to_turn_m, nav.road_name, climb.active, climb.remaining_m, climb.current_grade_pct, climb.min_elev_m, climb.max_elev_m, climb.name
- Athlete constants (baked on phone push, never hardcode rider stats): athlete.weight_kg, athlete.ftp_w, athlete.max_hr_bpm, athlete.resting_hr_bpm
- Phone feeds: phone.media_title, phone.media_artist, phone.feed.notifications, phone.feed.whatsapp, phone.feed.teams, phone.feed.sms, phone.feed.call, phone.feed.custom_1, phone.feed.custom_2

4. PHASE 1 TEMPLATES & MINIMUM BOXES (450x600 AMOLED & 480x640 IPS)
- single_value (>= 110x96 px): display = { source, baseline, format, precision?, unit?, color?, thresholds? }
- split_value (>= 220x96 px, optional fallback_template: "single_value"): display = { primary: ValueSlot, secondary: ValueSlot }
- value_bar (>= 220x104 px, optional fallback_template: "single_value"): display = { primary: ValueSlot, secondary?: ValueSlot, bar: { source, min, max, color, height_px?: 8..14, thresholds? } }
- map_view (>= 300x220 px): display = { view_mode: "2d"|"3d", orientation_mode: "heading_up"|"north_up", default_zoom: 12..17, map_style?: "dark"|"light", show_route_line?: boolean, hud_pills?: up to 3 pills using unique corners from "top_left", "bottom_left", "bottom_right" (NEVER "top_right", which is reserved for the 2D/3D toggle) }

5. VISUAL & FONT GUARDRAILS
- Every slot MUST include display.baseline (worst-case width string, e.g. "8.88", "30 NOV", "1999").
- Large numeric font supports ONLY these 17 glyphs: " 0123456789.:-+%Z". Any text with letters (e.g. "30 NOV", "MON") automatically uses Montserrat <= 48 px.
- Semantic ColorTokens ONLY: text_primary, text_secondary, accent, route, warning, danger.
- Every threshold rule MUST include an indicator ("accent_bar" | "badge" | "border") — colour-only state is forbidden.
- Built-in icons (32): bolt, flame, heart, heart-pulse, gauge, cadence, mountain, slope-up, slope-down, timer, stopwatch, clock, calendar, droplet, apple, battery, battery-low, phone, radar, alert, compass, map-pin, route, navigation, flag, thermometer, wind, cog, trophy, target, activity, music.

6. REQUIRED TOP-LEVEL FIELDS FOR .kpfield.json
{
  "schema_version": "1.0",
  "kind": "kpfield",
  "id": "kebab-case-3-to-48-chars",
  "name": "Human Name",
  "version": "1.0.0",
  "author": "your-handle",
  "template": "single_value | split_value | value_bar | map_view",
  "label": "MAX 12 CHARS",
  "icon": "bolt",
  "expressions": [{ "id": "wkg", "expr": "div(sensor.power_3s_w, athlete.weight_kg)" }],
  "display": { ... }
}

Ask me what cycling field or screen I want to build, then output the complete .kpfield.json ready to save and import in Kiwi Pace (Settings -> Devices -> Handlebar Display -> Custom Fields -> Import File).

Importing Your File in Kiwi Pace

  1. Save the generated JSON as <field-id>.kpfield.json (or <page-id>.kppage.json).
  2. Open the Kiwi Pace phone app and go to Settings → Devices → Handlebar Display → Custom Fields → Import File.
  3. Review the live validation check and preview, confirm the save, place the field on a screen, and tap Sync to Head Unit.