{"id":14299,"plugin_id":"plugin_asdk_app_6a68bab4bdcc8191bc64c15e238cf7ce","kind":"skill","collection_source":null,"comparison_source":null,"observed_at":"2026-09-30T23:09:14.594Z","digest":"3e1d54b160f877624e4075e7eae418eee53739ed8725a40950c785e06c1bacf0","against":null,"payload":{"name":"crisphive-emergency-dispatch","description":"Handle urgent field-service work with Crisphive — raise a job's priority, find emergency-capable technicians ranked by ETA, and preview then commit a cascade reschedule that safely pushes lower-priority appointments to make room. Use when the user reports an emergency, an urgent job, an SLA at risk, or asks to move or reshuffle scheduled jobs.","included_files":[],"skill_md_contents":"---\nname: crisphive-emergency-dispatch\ndescription: Handle urgent field-service work with Crisphive — raise a job's priority, find emergency-capable technicians ranked by ETA, and preview then commit a cascade reschedule that safely pushes lower-priority appointments to make room. Use when the user reports an emergency, an urgent job, an SLA at risk, or asks to move or reshuffle scheduled jobs.\n---\n\n# Emergency dispatch & rescheduling with Crisphive\n\nCrisphive schedules by a four-level priority model: `p0` (emergency,\ninterrupt-driven) > `p1` (top, may carry an SLA deadline) > `p2` (standard,\nthe default) > `p3` (deferrable). Only a `p0` may displace other jobs.\n\nAll `start_at` / `sla_deadline` values below are BUSINESS-LOCAL naive\ndatetimes (`2026-08-04T14:00:00`, no timezone offset) and must be in the\nfuture.\n\n## Environments: sandbox vs production\n\nThis skill works identically in BOTH environments — same tools, same fields,\nsame responses. The credential decides which one you are in:\n\n- **Sandbox** — API key `chsk_test_…`, or an OAuth connection authorized from\n  a sandbox dashboard session. Displacements here move only isolated test\n  data and notify nobody. Rehearse an emergency flow here first when\n  possible.\n- **Production** — API key `chsk_live_…`, or an OAuth connection authorized\n  from a live session. A committed cascade MOVES REAL customers'\n  appointments and the platform notifies them immediately.\n\nYou cannot switch environments with a parameter; reconnect with the other\ncredential. **In production, never call `commitEmergencyReschedule` or\n`commitJobRequestMove` without showing the user the full preview (every\ndisplaced job) and getting explicit approval.**\n\n## Raising priority\n\n- `updateJobPriority` with `priority` (required) and optional `note`.\n  Escalate to `p0` only for true emergencies (safety issue, no heat in\n  winter, active leak) — `p0` work is allowed to push other customers.\n- For urgent-but-not-emergency work use `p1`, optionally with `sla_deadline`\n  to arm automatic escalation as breach risk grows.\n\n## The emergency insert flow (ALWAYS preview before commit)\n\n1. **Candidates** — `listEmergencyCandidates` with `emergency_job_id`,\n   `mode`, and the desired `start_at`. `mode` is the cascade style the\n   preview assumes: `overtime` (displaced jobs stay same-day; the technician\n   works late) or `next_day` (overflow rolls to the next working day).\n   Returns technicians ranked by ETA with per-candidate feasibility.\n2. **Preview** — `previewEmergencyReschedule` with the SAME\n   `emergency_job_id`/`mode`/`start_at` plus the chosen `technician_id`.\n   Optional `displacement_mode`: `reschedule` (default — displaced jobs move\n   to new times) or `reassign` (displaced jobs keep their times on alternate\n   technicians when possible). **Nothing is persisted by a preview.** The\n   response lists exactly which jobs move and to when.\n3. **Approve** — show the user the emergency slot AND every displaced job.\n   Get explicit approval.\n4. **Commit** — `commitEmergencyReschedule` with the SAME\n   `emergency_job_id`/`mode`/`start_at`/`technician_id`/`displacement_mode`\n   as the preview, plus:\n   - `expected_move_ids`: echo the displaced job IDs the preview returned\n     (both `days[].moves[].job_id` and `reassignments[].job_id`) — the commit\n     fails safe if the schedule drifted since the preview.\n   - `emergency_expected_version`: the previewed job's version fence.\n   - An `idempotency_key`.\n   Displaced customers are notified automatically by the platform — do not\n   message them yourself.\n\n## Moving a single job (dispatch-board move)\n\n- `previewJobRequestMove` with the job `id`, `start_at`, `technician_id`\n  (the target technician — pass the current one for a time-only move) and\n  `mode` (`overtime` | `next_day`, for any jobs the move displaces). Read the\n  hard blocks and warnings it returns.\n- Then `commitJobRequestMove` with the same fields plus `expected_move_ids` /\n  `expected_version` from the preview and an `idempotency_key`. Never commit\n  a move that was not previewed.\n- Landing on an occupied slot or in the past is rejected — offer the\n  preview's alternatives instead.\n\n## Constraints the engine enforces (do not fight them)\n\n- Multi-day jobs and multi-person crew jobs are frozen anchors for the\n  emergency cascade — they are never pushed, and a crew job cannot itself be\n  the emergency insert (the API rejects it).\n- In-progress jobs (the technician already started) cannot be moved.\n- Version fences (`expected_version` / `emergency_expected_version` /\n  `expected_move_ids`) exist to catch concurrent edits: on a conflict,\n  re-read with `getJobRequest`, re-preview, and try again — never bypass by\n  omitting them after a conflict.\n\n## Reporting back\n\nAfter any commit, read `getJobRequestTimeline` for the emergency job and\nsummarize: who is coming, when, and which other appointments moved. In live\nmode remind the user that affected customers have been notified\nautomatically.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}