Swap

作者 Rootly-AI-Labs65832aa6ff7a無授權條款收錄於 2026年10月8日更新於 2026年10月8日

Request someone to cover one of your upcoming on-call shifts. Lists your shifts, helps identify a candidate based on availability, and creates an override after explicit confirmation. Write action - never executes without confirming.

AI 產生的概覽

協助值班工程師為即將到來的班次尋找代班人,並在明確確認後建立 Rootly 代班。

功能
此技能引導完成值班換班流程:辨識目前使用者、列出其未來 14 天的班次,並依參數、日期或提示協助選定目標班次。接著透過 Rootly 的推薦或可用性工具尋找候選代班人,並最多列出三位候選人與理由。在使用者明確確認後,它會建立代班並回報代班 ID、代班人與時間範圍,同時提供後續通知建議。
適用情境
當你需要他人代為承擔某個即將到來的值班班次,並希望獲得選擇班次與合適代班人的協助時使用。它適合使用 Rootly 進行值班排班的團隊,想要有確認機制的引導式換班。
執行需求
需要存取 Rootly MCP 工具(mcprootly*),包括 getCurrentUser、listShifts、可用性或代班推薦工具以及 createOverrideShift。需要連線至 Rootly 的網路存取。此技能不含指令碼,僅為說明文件。

Shift Swap Request

You are helping the user offload one of their on-call shifts to someone else. This is a write action: you must show the proposed change and get explicit user confirmation before calling mcp__rootly__createOverrideShift.

Workflow

1. Identify the user

Call mcp__rootly__getCurrentUser. Capture user_id.

2. List the user's shifts

Call mcp__rootly__listShifts (or list_shifts) scoped to:

  • The current user
  • Next 14 days

If the MCP doesn't expose user-level filtering, call the broader listShifts and filter client-side by user_id.

3. Pick the target shift

  • If $ARGUMENTS is empty: show the next 5 shifts and ask "Which shift do you want covered?"
  • If $ARGUMENTS is next: pick the soonest upcoming shift.
  • If $ARGUMENTS is a date or shift identifier: try to match.

If no match, list options and ask.

4. Find candidate coverers

For the shift's schedule and time window:

  1. Call mcp__rootly__create_override_recommendation if it accepts the shift parameters — this is the cleanest path; it returns suggested coverers.
  2. Otherwise, fall back to mcp__rootly__check_responder_availability against the relevant team/schedule and propose users with available=true and no conflicting shifts.
  3. Present up to 3 candidates with reasoning (workload, recent shifts, conflicts).

If no candidates are available, surface that and stop.

5. Show the proposal

**Proposed shift swap:**- **Shift**: [Schedule name] [start] → [end] ([duration])- **Currently assigned**: you ([your name])- **Proposed coverer**: [candidate name]- **Why**: [reason — e.g. "no shifts this week, on team rotation"]
**Alternatives**:- [other candidate] — [reason]- [other candidate] — [reason]
Confirm to create the override? (yes / no / pick another)

6. Wait for confirmation

  • yes → call mcp__rootly__createOverrideShift with this shape:
json
{  "schedule_id": "[schedule_id]",  "data": {    "type": "shifts",    "attributes": {      "starts_at": "[shift start ISO8601]",      "ends_at": "[shift end ISO8601]",      "user_id": [coverer user id]    }  }}

Echo the resulting override ID and a confirmation line.

  • pick another or naming a different candidate → revise the proposal and re-confirm. Do not execute on the first reply if the user is changing the candidate.
  • no or any other answer → acknowledge and stop. Do not call the create tool.

7. After the override is created

Output:

✅ Override created.- ID: [uuid]- Coverer: [name]- Window: [start] → [end]
Recommended next steps:- Notify the coverer in Slack / your team channel.- The original on-call schedule will route alerts to the coverer for this window.

8. Guidelines

  • Never call createOverrideShift without confirmation. The "yes" must come from the user, not be inferred.
  • If create_override_recommendation is unavailable, lean on check_responder_availability rather than guessing. Don't propose a coverer you can't verify is available.
  • If the user's shift is in the past or already started, refuse with a helpful message — overrides for the present moment are usually a different operation.
  • Show timezone explicitly in the proposal. Ambiguous times cause mistakes.

來源與署名

來源:Rootly-AI-Labs/rootly-claude-plugin位於skills/swap提交65832aa

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架