Todoist

From htlin222/dotfiles · View interactive version

Todoist is an AI agent skill from the GitHub repository htlin222/dotfiles. Todoist CRUD via API v1 — tasks (due + deadline), projects, sections, labels, comments, reminders. Use when user mentions Todoist, their todo list, scheduling/completing a task, "加到待辦", "今天的 Todoist".

How to use this skill

Skill file

Todoist CRUD

Wraps the Todoist REST API v1 via a bundled Python script. Token: ${CLAUDE_SKILL_DIR}/.apikey (or TODOIST_API_TOKEN env var, takes precedence).

Path conventions

${CLAUDE_SKILL_DIR} = directory holding this SKILL.md. Resolve once per shell:

export CLAUDE_SKILL_DIR=<path reported by the Skill tool's "Base directory">

The script self-locates via __file__; the env var is only for shell invocations.

Invocation

python3 "${CLAUDE_SKILL_DIR}/scripts/todoist.py" <resource> <action> [args...]

Resources: tasks, projects, sections, labels, comments, reminders. Successful calls print JSON; errors print HTTP <code> to stderr and exit non-zero.

References (load on demand)

Common playbooks

Add a task

python3 "${CLAUDE_SKILL_DIR}/scripts/todoist.py" tasks add "買牛奶" --due "tomorrow 9am" --priority 2

Today's tasks

python3 "${CLAUDE_SKILL_DIR}/scripts/todoist.py" tasks list --filter "today"

Filter strings: overdue, 7 days, p1, @label, #Project. Combine with & |.

Complete / reschedule / edit

python3 "${CLAUDE_SKILL_DIR}/scripts/todoist.py" tasks close <id>
python3 "${CLAUDE_SKILL_DIR}/scripts/todoist.py" tasks update <id> --due "friday"
python3 "${CLAUDE_SKILL_DIR}/scripts/todoist.py" tasks update <id> --content "new title" --priority 3

reopen to un-complete, delete to remove. Update only flags you pass — omitted fields untouched.

Premium-only operations

--deadline-date (tasks) and reminders add/update return HTTP 403 PREMIUM_ONLY on Free. Don't call. Free-tier substitutes:

Full Premium-gate behavior + read-side ops (work on Free): see api-reference.md § Premium-only writes and references/reminders.md.

Project / label bookkeeping

python3 "${CLAUDE_SKILL_DIR}/scripts/todoist.py" projects list
python3 "${CLAUDE_SKILL_DIR}/scripts/todoist.py" projects add "Side project"
python3 "${CLAUDE_SKILL_DIR}/scripts/todoist.py" labels list
python3 "${CLAUDE_SKILL_DIR}/scripts/todoist.py" labels add "deep-work"

Workflow guidance

  1. Resolve names → IDs first. Todoist uses numeric IDs. list the resource, match by name/content, act on the id.
  2. close > delete for completed tasks (preserves history). Confirm before delete — irreversible.
  3. Soft-delete: DELETE flips is_deleted: true; subsequent GET returns 200 with tombstone. Script exits 2 with stderr warning. Treat exit 2 as "gone".
  4. Token errors (HTTP 401/403): regenerate at Todoist Settings → Integrations → Developer; write to ${CLAUDE_SKILL_DIR}/.apikey.
  5. Rate limit: ~450 req / 15 min. For bulk reads, prefer tasks list --ids "1,2,3" over loops of get.

Token file

${CLAUDE_SKILL_DIR}/.apikey, mode 600. Rotate:

printf '%s' "<new-token>" > "${CLAUDE_SKILL_DIR}/.apikey"
chmod 600 "${CLAUDE_SKILL_DIR}/.apikey"

Or export TODOIST_API_TOKEN=... to override without touching the file.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.