---
name: carrick87/ot-leave-claim
source: https://app.decimal.ai/s/carrick87-ot-leave-claim@1/SKILL.md
source_sha256: 7d6fe0f8378e
---

# OT leave claim

## Goal

Produce a **leave-replacement claim summary** for time worked **outside office hours**, using:

1. User-supplied **start time** (required)
2. **OT reason** — why the outside-hours work was needed (required for final claim)
3. **Git commit** timestamps in the active repo
4. **Cursor agent** transcript activity for the current workspace

Never emit the final claim until the user **confirms** (or adjusts) the proposed hours.

## Office hours (defaults)

| Setting | Value |
|---------|--------|
| Timezone | `Asia/Singapore` (UTC+8) |
| Weekdays | Mon–Fri **08:00–16:45** = normal hours |
| Outside hours | Before 08:00, after 16:45, or **all day Sat/Sun** |
| Public holidays | Treat as outside hours **only if the user says so** |

Override timezone only when the user says otherwise.

## Triggers

Apply when the user says any of:

- OT / overtime / OT hours / overtime summary
- leave replacement / claim OT / claim leave replacement
- work outside office hours / outside working time
- OT from Cursor / GitHub activity

## Workflow

```mermaid
flowchart TD
  trigger[User runs OT leave claim]
  askStart{Start time given?}
  promptStart[Ask for start time]
  gather[Gather git commits and Cursor transcripts]
  clip[Clip to outside office hours]
  propose[Propose OT ranges and hours]
  confirm[User confirms or adjusts]
  tasks[Task description per OT range]
  summary[Final leave-replacement claim]
  trigger --> askStart
  askStart -->|no| promptStart --> gather
  askStart -->|yes| gather --> clip --> propose --> confirm --> tasks --> summary
```

Copy this checklist and track progress:

```
OT claim progress:
- [ ] Step 1: Start time confirmed
- [ ] Step 2: Evidence gathered
- [ ] Step 3: Proposal shown (not final)
- [ ] Step 4: Hours confirmed by user
- [ ] Step 5: Task descriptions per range
- [ ] Step 6: OT reason confirmed (rephrase if needed)
- [ ] Step 7: Final claim summary output
```

### Step 1 — Start time (required)

If the user did **not** specify a start time, stop and ask:

> What is the start time for this OT claim? (e.g. `2026-07-18 18:00` or `today 6pm`)

Do **not** gather evidence until start time is known.

Parse relative forms (`today 6pm`, `yesterday 19:30`) in `Asia/Singapore` unless told otherwise.

**End time** default: latest evidence at or after start (see Step 3). User may override when confirming.

**OT reason** (overall why for the leave-replacement request):

- If the user already gave a reason, **rephrase** it into clear, professional claim wording (fix grammar; keep their meaning).
- If missing by confirmation time, ask:

  > What is the OT / leave-replacement reason? (e.g. urgent post-rollout bug fixes after Friday training)

- One overall **OT reason** for the claim (not per range). Task descriptions stay per range.

### Step 2 — Gather evidence

From the **active git repo** (cwd / workspace root):

**Commits** (author = current user):

```bash
git log --since="<START_ISO>" --until="<END_OR_NOW>" \
  --author="$(git config user.email)" \
  --pretty=format:"%h|%ad|%s" --date=iso
```

If `user.email` is empty, try `--author="$(git config user.name)"`. If still empty, use unfiltered local log and note that in the justification.

**Cursor activity:**

1. Resolve the workspace’s agent-transcripts folder under `~/.cursor/projects/<project-slug>/agent-transcripts/` (match the current workspace path).
2. Prefer transcripts with activity at or after start (file mtime and/or `<timestamp>...` lines inside `.jsonl`).
3. From user queries / assistant work, draft short notes for task descriptions later.

Also note the repo name / path in the claim (which app was worked on).

### Step 3 — Propose OT (not final)

Default calculation:

1. Build a timeline of evidence from start → now (or user-given end).
2. **Suggested end** = last evidence timestamp at or after start.
3. **Suggested OT** = intersection of `[start, end]` with **outside** office hours only.
   - Fri 18:00 → last commit 22:00 → propose **4.0h** (all outside).
   - Fri 16:00 → last commit 19:00 → propose **2.25h** (16:45–19:00 only; drop 16:00–16:45).
4. If gaps look large, still propose the simple span, but **call out the gap** so the user can trim.
5. Round each range to nearest **0.25h** (15 min) unless the user specifies otherwise when confirming.

If the window crosses midnight or multiple days, split into **one range per calendar day** (or per discontinuous block) so each can get its own task description.

Present a **Proposal** block only:

```markdown
## OT proposal (awaiting confirmation)

**Claim window start:** <start>
**Suggested end:** <end> (last evidence: <source>)
**Timezone:** Asia/Singapore (UTC+8)

### Proposed ranges
| # | Date | Start | End | Hours |
|---|------|-------|-----|-------|
| 1 | ... | ... | ... | ... |

**Proposed total:** Xh

### Evidence
- Commits: ...
- Cursor sessions: ...

### Draft OT reason
<rephrased reason if user already gave one; otherwise “pending”>

### Justification
...

Confirm these hours, or tell me the adjusted total / ranges.
```

**Hard stop:** do not print the final claim template until the user confirms or adjusts.

### Step 4 — Confirm hours + task descriptions + OT reason

1. Apply the user’s confirmation or adjustments (totals and/or per-range times).
2. For **each** confirmed OT range, require a **task description**.
   - Draft from commits + Cursor transcripts.
   - Ask the user to approve or edit if draft is unclear.
3. Confirm **OT reason**:
   - Rephrase the user’s wording into a short professional sentence (or 2).
   - Show the rephrased reason and use it unless they edit it.
4. Do not finalize with empty task descriptions or a missing OT reason.

### Step 5 — Final claim summary

Output this copy-paste friendly report:

```markdown
# Leave Replacement Claim — Outside Working Hours

**Timezone:** Asia/Singapore (UTC+8)
**Office hours:** Mon–Fri 08:00–16:45
**Claim window start:** <user start>
**Generated:** <now>
**Repo / app:** <name>

## Summary
- Total OT claimed: **Xh**
- Leave replacement days: **Zd** (`Xh ÷ 8.75`)
- Confirmed by user: yes

## OT reason
<professional rephrased reason for this leave-replacement request>

## Leave replacement days
- Standard working day: **8.75h** (Mon–Fri 08:00–16:45)
- Calculation: `Xh ÷ 8.75 = Y` → claim **Zd** leave replacement
- Round to nearest **0.5 day** unless the user specifies otherwise

## OT ranges
| # | Date | Start | End | Hours | Task description |
|---|------|-------|-----|-------|------------------|
| 1 | ... | ... | ... | ... | ... |

## Evidence (supporting)
- Commits: ...
- Cursor sessions: ...

## Justification
...
```

Always include **OT reason** and the leave-day conversion in the final summary. Formula: **OT hours ÷ 8.75**, round to nearest **0.5 day**.

Saving to disk is optional: only if the user asks, write `~/Desktop/ot-claims/YYYY-MM-DD.md` (create the folder if needed). Default is chat-only.

## Rules of thumb

- Never invent commits or Cursor sessions; if evidence is thin, say so and let the user set hours.
- Normal office hours never count toward the claim.
- Propose first, confirm second, claim last.
- Always include a clear **OT reason**; rephrase user notes into professional claim language.
- Convert confirmed OT hours to leave-replacement days: hours ÷ 8.75, nearest 0.5 day.
- Keep task descriptions concrete (feature/bug/repo work), not vague (“worked on app”).

## Examples

See [examples.md](examples.md) for weekday evening and weekend sample flows.