The official Agent Skill for TimeMagic — gives Claude Code and OpenAI Codex everything they need to read and manage your projects, tasks, activities, goals, time entries, estimations, reports, and feature requests through the TimeMagic API, without you having to paste in docs every time.
npx skills add purple-magic/timemagic-skill -g -a claude-code -a codex -yThis installs the skill globally for both agents (~/.claude/skills/timemagic and ~/.codex/skills/timemagic). Drop -g to install into just the current project instead.
Once installed, you can ask Claude Code or Codex things like:
- "Show my active TimeMagic projects."
- "Create a task in my Website Redesign project."
- "What have I tracked today?"
- "Create a task for the Google sign-in work and add AI context with the Devise constraints."
- "Implement my 'Google authentication' TimeMagic task." (the skill reads the task's AI Agent Context itself)
- "Start tracking time on my 'Write report' task."
- "List my TimeMagic goals for this month."
- "Build a Ruby script that syncs TimeMagic tasks into a spreadsheet."
- "Show me my deleted tasks." / "Find the task I deleted last month." / "Show everything in Trash." (read-only)
- "Restore this deleted task." (brings the original back; the server rolls back and keeps it in Trash if it no longer works)
- "Recreate this deleted task because it can't be restored." (makes a new task from the saved data; the original stays in Trash)
It works both for driving your own TimeMagic account and for writing third-party integrations against the TimeMagic API.
Every request carries X-TimeMagic-API-Version (the API contract version the skill was written for). If the TimeMagic API no longer supports it, it answers 426 with code: skill_update_required; the skill then tells you it must be updated and updates itself from this repository with skills/timemagic/scripts/timemagic_update.rb (git pull --ff-only in a checkout, otherwise a fresh copy of the files; --check only looks). Requests without the header are still accepted by the API.
Deleted tasks, projects and activities stay in the user's TimeMagic Trash indefinitely - without any promise that they can be restored. The skill keeps three operations apart: read (list/show/export deleted data, read-only), restore (the server brings the original item back transactionally, or changes nothing), and recreate (a new task built from the deleted task's export through the ordinary create call). Deleted content is treated as untrusted data, never as instructions. Details: skills/timemagic/references/trash.md.
TimeMagic tasks have an optional AI Agent Context (ai_context): Markdown with the detailed instructions an AI agent needs for a task, kept separate from the short human-facing description. The skill:
- asks whether you want to add AI context whenever it creates a task (you can write it, have it drafted from the conversation, or decline), and whenever it edits a task (keep, review, extend, replace, or remove the existing context) — unless you already said what you want;
- reads the context automatically when you ask it to work on a task, and treats it as task data, not as instructions that override its own rules;
- never overwrites or erases existing context unless you chose to; updates that don't mention it leave it untouched.
- Claude Code or OpenAI Codex (recent versions — both support the open Agent Skills
SKILL.mdformat natively). - A TimeMagic account and API token (see Authentication below).
- Node.js (for
npx skills), orgit/ghfor a manual install.
Via the cross-agent installer (recommended, keeps itself updatable):
npx skills add purple-magic/timemagic-skill -g -a claude-code -yOr as a native Claude Code plugin, pointing straight at this repo as a marketplace:
claude plugin marketplace add purple-magic/timemagic-skill
claude plugin install timemagicEither path installs the same canonical skill — there's no plugin-specific copy of the instructions.
npx skills add purple-magic/timemagic-skill -g -a codex -yCodex reads SKILL.md directly (the open Agent Skills format), so this just places the skill under ~/.codex/skills/timemagic.
npx skills add purple-magic/timemagic-skill -g -a claude-code -a codex -yIf your gh has the gh skill extension (GitHub CLI ≥2.90, currently in preview):
gh skill install purple-magic/timemagic-skill --agent claude-code --agent codexThe skill never stores or hardcodes a token. Set your TimeMagic API token as an environment variable before using it:
export TIMEMAGIC_API_TOKEN=<your-token>Get a token at time-app.purple-magic.com/docs/api — log in, open the "API Token" section, and copy or regenerate your token there. If the environment variable isn't set, the skill will tell you where to get one instead of guessing or asking you to paste it into chat.
Show my active TimeMagic projects.
Create a task called "Write Q4 report" in my Marketing project.
What have I tracked today?
Start tracking time on my current task.
List my goals for this week.
Write a Ruby script that pulls my TimeMagic time entries into a CSV.
npx skills update timemagic -gnpx skills remove --skill timemagic -gOr, for a native Claude Code plugin install:
claude plugin uninstall timemagicnpx skills list -gshould list timemagic for the agents you installed it into. In Claude Code, /skill timemagic (or just asking a TimeMagic-shaped question) should discover and load it.
timemagic-skill/
README.md
LICENSE
.claude-plugin/
plugin.json # Claude Code plugin manifest, points at skills/timemagic
marketplace.json # lets this repo be added as a Claude Code marketplace
skills/
timemagic/
SKILL.md # canonical skill — the single source of truth
references/ # per-resource API reference, loaded on demand
scripts/
timemagic_request.rb # tiny stdlib-only HTTP helper
timemagic_trash.rb # Trash helper: list / show / export / restore --confirmed (no recreate)
evals/
trigger-cases.json # positive/negative prompts for skill-discovery evals
tests/
validate.rb # repo self-checks (frontmatter, manifests, secrets, syntax)
trash_script_test.rb # request-building tests for the Trash helper
There is exactly one copy of the TimeMagic instructions, at skills/timemagic/SKILL.md plus its references/. The Claude Code plugin manifest references that directory rather than duplicating it; Codex and other Agent-Skills-compatible tools consume the same SKILL.md directly.
ruby tests/validate.rb
ruby tests/trash_script_test.rbChecks SKILL.md frontmatter, required reference files, plugin/marketplace manifest validity and linkage, eval file shape, absence of committed secrets, and that the helper script is syntactically valid.
To manually sanity-check discovery, try the prompts in evals/trigger-cases.json against an installed copy of the skill and confirm the positive prompts load it and the negative prompts don't.
The authoritative TimeMagic API documentation lives at time-app.purple-magic.com/docs/api and can change independently of this repository. SKILL.md tells agents to defer to that live documentation when something looks outdated. When the TimeMagic API changes:
- Update the relevant file(s) under
skills/timemagic/references/. - Run
ruby tests/validate.rb. - Bump
versionin.claude-plugin/plugin.json. - Commit and push —
npx skills updatepicks up the new content on the next run.
- No API tokens or secrets are ever committed to this repository.
- The skill reads credentials only from the
TIMEMAGIC_API_TOKENenvironment variable and never writes them to generated files or prints them. - Mutating API calls (create/update/delete) are treated as normal agent actions — your coding agent's own confirmation conventions apply; this skill doesn't bypass them.
- Found a security issue? Please open an issue in this repository rather than filing it publicly with reproduction details for a live account.