---
name: log-time
description: >
  This skill should be used whenever the user wants to log time after the fact
  in Lucen Track — phrases like "log 2h on X", "I worked 90 minutes on the
  billing refactor yesterday", "track an hour against PROJ-123", "add a time
  entry for Monday". Use this skill for backfilling entries; use track-timer
  for real-time tracking instead.
metadata:
  version: "0.1.0"
---

# Log time in Lucen Track

Use this skill to write a new time entry against a project (and optional phase,
todo, and tags). For real-time tracking, use the `track-timer` skill instead.

## Workflow

1. **Resolve the project + phase.**
   - If the user mentioned a ticket / issue / branch identifier (e.g.
     `PROJ-123`, `feature/login-bug`, a Linear or Jira key), call `search-todos`
     with that reference. A match returns the project and phase, so skip the
     next step.
   - Otherwise call `get-projects` and pick the project + phase that matches
     the user's description. If multiple plausible matches exist, ask the user
     which one to use before writing.

2. **Resolve any tags.** If the user mentioned a tag (e.g. "tag it as #review",
   "billable"), call `search-tags` to resolve each tag name to a tag id.

3. **Write the entry.** Call `create-time-entry` with the resolved project,
   phase, optional todo, optional tag ids, date, duration, and any note the
   user provided.

## Rules

- Never fabricate project, phase, todo, or tag IDs. Always resolve via
  `search-todos`, `get-projects`, or `search-tags` first.
- If the user is vague about which project ("log an hour on the website
  thing"), list candidates from `get-projects` and ask before writing.
- Durations are in minutes unless the tool documents otherwise. If the user
  says something ambiguous like "a couple of hours," confirm before writing.
- If a tool returns an authentication error, tell the user they may need to
  re-authorize the Lucen Track connector — do not retry repeatedly.

## Do not

- Do not call `start-timer` from this skill. If the user actually wants a
  running timer, ask them to use `/track-timer` instead.
- Do not duplicate an existing entry. If the user is correcting an entry they
  already created, route them to `/fix-entry`.
