clockify-api
Clockify API Skill
Purpose
Use the [[Clockify]] API from the command line to:
- inspect what Michael has been working on recently
- find untidy or incomplete time entries
- update time entries so they line up with real work
- correlate Clockify entries with external work items such as [[Jira]] issues
This skill is intentionally lightweight. It does not require a generated client, custom code, or a local wrapper script. Use curl, jq, and the [[1Password]] CLI directly.
When To Use This Skill
Use this skill when the task involves any of the following:
- querying recent [[Clockify]] activity
- listing, inspecting, or updating time entries
- finding entries with missing project, task, tag, or description data
- producing summaries of work over a date range
- preparing a dry-run plan for tidying time entries
- associating entries with tasks or issue keys based on deterministic evidence
Do not use this skill when the user is asking for:
- project management decisions that do not require Clockify data
- arbitrary browsing of unrelated APIs
- speculative edits to time entries without enough evidence
Core Principles
- Prefer simple shell commands over custom tooling.
- Use the [[1Password]] CLI to retrieve secrets at execution time.
- Assume the agent may need a long-lived shell session so
opremains authenticated across multiple commands. - Keep operations transparent and reviewable.
- Prefer read-only inspection first, then propose edits, then apply changes.
- Default to dry-run thinking for bulk changes, even if the API call itself is straightforward.
Authentication Model
The [[Clockify]] API key is stored in [[1Password]] and should be read via op read.
Typical pattern:
- authenticate
oponce in a shell session - reuse that same shell session for subsequent Clockify commands
- avoid re-authenticating for every single API call
Because op read requires an authenticated [[1Password]] session, the agent should prefer working inside a persistent terminal session when doing multi-step work. This can be:
- an existing interactive shell
- a long-lived terminal multiplexer session such as
tmux - any other session mechanism that preserves
opauthentication state
Do not invent additional credential storage or copy secrets into files.
Required Tools
Assume the following command-line tools are available:
opcurljq
If jq is unavailable, raw JSON may be inspected directly, but jq is strongly preferred.
Execution Rules
1. Use a persistent session for multi-step tasks
If the task will require multiple API calls, work in a single persistent shell session so the [[1Password]] session remains valid.
Examples of situations where this matters:
- resolving user information, then listing workspaces, then listing recent entries
- finding untidy entries, then applying several updates
- correlating entries with external task IDs over several queries
2. Resolve identity and workspace context early
At the start of a Clockify task, resolve enough context to avoid guessing later. In practice this usually means:
- fetch the current user
- identify the relevant workspace ID
- reuse those IDs in later commands
Do not repeatedly call the same discovery endpoints unless needed.
3. Prefer explicit date ranges
When querying recent work, use explicit date ranges where possible.
Good:
- today
- yesterday
- last 7 days
- this week
- a concrete start and end date
Avoid vague ranges if a more precise one is easy to derive.
4. Read first, mutate second
Before changing any time entries:
- inspect the entries
- confirm which IDs will be changed
- show or reason through the intended before/after state
- only then perform the update
5. Be conservative with bulk edits
Bulk edits are useful, but they are also the easiest way to make a mess.
Before bulk changes:
- verify the filter matches the intended entries
- inspect a representative sample
- prefer deterministic criteria such as:
- exact description match
- exact issue key match
- exact date range
- exact project or task ID
Avoid fuzzy mass changes unless the user has explicitly asked for that and the reasoning is strong.
6. Never leak secrets
Do not:
- print the API key in output
- write the API key to a file
- echo expanded commands that expose the key
- persist credentials outside the authenticated
opsession
Default Workflow Pattern
For most tasks, follow this order:
- ensure the shell session is persistent enough for repeated
op readcalls - retrieve the API key via [[1Password]]
- call the Clockify endpoint with
curl - use
jqto extract only the relevant fields - inspect results before deciding on further actions
- if editing entries, identify exact entry IDs first
- apply the smallest safe change that satisfies the task
Preferred Command Style
Use straightforward shell commands.
General conventions:
- send the API key in the
X-Api-Keyheader - send
Accept: application/json - include
Content-Type: application/jsonfor mutating requests - pipe responses through
jqfor readability - keep commands readable rather than overly compressed
Typical Tasks
This skill is primarily for the following classes of work:
Recent work inspection
Examples:
- what have I been working on recently?
- show my entries from the last 7 days
- summarise work by day, project, or description
- find any currently running timer
Time-entry hygiene
Examples:
- find entries with no project
- find entries with no task
- find entries with blank or weak descriptions
- identify suspiciously short entries
- locate entries mentioning a specific issue key
Controlled updates
Examples:
- assign a specific entry to a project
- attach an entry to a task
- normalise descriptions for a known set of entries
- update a batch of entries matching exact criteria
Decision Rules For Correlating Entries With Tasks
When relating Clockify entries to real work items such as [[Jira]] issues, prefer deterministic evidence in this order:
- exact issue key present in the description
- exact issue key present in another trusted source provided for the task
- exact, repeated description already known to map to a task
- strong human-supplied instruction
Avoid guessing based on vague semantic similarity alone.
If the match is uncertain:
- present candidate mappings
- explain the evidence
- do not silently apply changes
Output Expectations
When reporting back after a query, prefer compact, decision-useful output:
- date/time
- entry ID
- description
- project
- task
- duration
- running/completed status where relevant
When reporting back before an edit, include:
- which entries will be changed
- what field will change
- the current value
- the new value
- why those entries were selected
Safety Rules
- Never delete time entries unless the user explicitly asks.
- Never change entries outside the intended date range.
- Never assume a workspace ID if it has not been resolved.
- Never apply a bulk update based on weak matching.
- Never expose the raw API key.
- Never introduce custom scripts or code unless the user explicitly asks for them.
Skill Boundaries
This skill is not a full Clockify SDK.
It should remain:
- simple
- shell-based
- inspectable
- easy for an agent to use without setup beyond an authenticated shell and installed CLI tools
Detailed API endpoints, example commands, and concrete workflows live under references/.
Reference Files
Consult the references/ directory for:
- endpoint summaries
- example
curlcommands - common workflows
- update patterns
- field notes on workspace, project, task, and time-entry handling
- any notes about correlating Clockify entries with external systems such as [[Jira]]
Only load the reference files needed for the task at hand.
More from michael-f-bryan/skills
long-running-agent-harness
Plans and structures large-scale work for AI agents across many sessions. Human and AI iterate to produce a design doc; run an Initializer sub-agent once to create feature list, runbook, and backlog in _working/; then repeatedly run a Coding sub-agent until all features pass. At milestones (e.g. end of a work-unit group), pause for human check-in, re-run Initializer, then continue. Prompts are passed to sub-agents when spawning (no copying into .cursor/rules). Use when planning multi-session agent work, long-horizon coding from a design, or handoff between coding sessions.
31doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.
23working-docs
Use when handling multi-step tasks, investigations, or long sessions where working notes, interim findings, and scratch planning are needed to keep context and handoffs clear.
22test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
19commit-messages
When suggesting or writing commit messages for this repo, follow these rules.
17code-like-michael
Write, refactor, and review code in Michael's style; explicit contracts, thin entrypoints, practical boundaries, anti-ceremony abstractions, deterministic tooling, and architecture that scales from function internals to repository shape.
14