4todo
4to.do Eisenhower Matrix To‑Do List
Goal
- - Use
curl to call the 4todo API (https://4to.do/api/v0) to manage:
- workspaces
- todos
- recurring todos
- - Store the token in a way that is injectable but not leak-prone (prefer OpenClaw per-run env injection; do not paste secrets into prompts, logs, or repo files).
Required Environment Variable
- -
FOURTODO_API_TOKEN: your 4todo API token (Bearer token) - If missing, ask the user to set it via OpenClaw config (do not ask them to paste the token into chat).
Runtime Requirement
- -
curl must be available on PATH (and inside the sandbox container, if the agent is sandboxed).
User-facing output rules (important)
- - Be non-technical by default. Focus on outcomes, not implementation.
- Avoid mentioning: curl, endpoints, headers, API mechanics, JSON payloads, config patches.
- Mention technical details only when debugging or if the user explicitly asks “how does it work?”.
- - Do not print internal IDs by default:
- Do
not show
ws_...,
todo_...,
rec_todo_... unless the user asks.
- Refer to workspaces and tasks by
name.
- If disambiguation is needed (duplicate names), ask a clarifying question and present a short numbered list of names; only offer IDs if the user requests them.
- In chat, prefer plain language: “urgent & important”, “important (not urgent)”, “urgent (not important)”, “neither”.
- Use
IU | IN | NU | NN internally for API calls. Only show codes if the user uses codes first or explicitly asks.
Examples (preferred)
Workspaces:
CODEBLOCK0
Todos (summary):
CODEBLOCK1
Store / Inject the Token in OpenClaw (recommended)
OpenClaw can inject environment variables only for the duration of an agent run (then restores the original env), which helps keep secrets out of prompts.
Recommended (production): set FOURTODO_API_TOKEN in your Gateway process environment using your hosting provider’s secret store, and do not store tokens in chat logs.
Host runs (not sandboxed): use skills.entries
Edit ~/.openclaw/openclaw.json:
CODEBLOCK2
Notes:
- -
skills.entries.<skill>.env is injected only if the variable is not already set.
Sandboxed sessions: use agents.defaults.sandbox.docker.env
When a session is sandboxed, skill env injection does not propagate into the Docker container. Provide the token via Docker env:
CODEBLOCK3
Request Conventions
- - Every request must include
Authorization: Bearer <token>. - Requests with a JSON body must include
Content-Type: application/json. - INLINECODE16 requires a
workspace query parameter. - Quadrants:
IU | IN | NU | NN (internal).
Workflow (recommended order)
Copy this checklist and keep it updated while executing:
CODEBLOCK4
- 1.
GET /workspaces: pick a target ws_... (usually the default workspace). - INLINECODE21 : fetch todos (grouped by quadrant).
- Create:
POST /todos. - Complete:
POST /todos/:id/complete (idempotent). - Reorder / move quadrant:
POST /todos/reorder. - Recurring todos: use the
/recurring-todos endpoints.
HTTP Examples (curl)
This skill intentionally uses curl for maximum portability across OSes and environments.
Notes:
- - HTTPS only (
https://4to.do/api/v0). - Always pass the token via
FOURTODO_API_TOKEN (never paste tokens into chat).
CODEBLOCK5
Note: if moved_todo_id starts with rec_todo_, the API updates only the recurring todo quadrant and ignores previous_todo_id/next_todo_id.
Common Error Handling (agent guidance)
- -
401 token_expired / invalid_token: stop retrying; ask the user to create a new token in 4todo settings and update OpenClaw config. - INLINECODE33 : the workspace is read-only; do not retry mutations; switch workspace or prompt user to upgrade/unlock.
- INLINECODE34 : honor
Retry-After / X-RateLimit-* and back off before retry. - INLINECODE37 : ensure quadrant is one of
IU|IN|NU|NN.
Reference
- - Full API doc bundled with this skill: INLINECODE39
4todo
4to.do 艾森豪威尔矩阵待办清单
目标
- - 使用 curl 调用 4todo API(https://4to.do/api/v0)管理:
- 工作区
- 待办事项
- 重复待办事项
- - 以可注入但不易泄露的方式存储令牌(优先使用 OpenClaw 每次运行的环境变量注入;不要将密钥粘贴到提示词、日志或仓库文件中)。
必需的环境变量
- - FOURTODOAPITOKEN:你的 4todo API 令牌(Bearer 令牌)
- 如果缺失,要求用户通过 OpenClaw 配置进行设置(不要要求他们将令牌粘贴到聊天中)。
运行时要求
- - curl 必须位于 PATH 中(如果代理在沙箱中运行,则沙箱容器内也需可用)。
面向用户的输出规则(重要)
- - 默认使用非技术性语言。关注结果,而非实现细节。
- 避免提及:curl、端点、请求头、API 机制、JSON 负载、配置补丁。
- 仅在调试或用户明确询问它是如何工作的?时提及技术细节。
- 除非用户要求,否则
不要显示 ws
...、todo...、rec
todo...。
- 使用
名称来指代工作区和任务。
- 如果需要消除歧义(名称重复),提出澄清性问题并展示一个简短的编号名称列表;仅在用户要求时才提供 ID。
- 在聊天中,优先使用通俗语言:紧急且重要、重要(不紧急)、紧急(不重要)、两者都不。
- API 调用内部使用 IU | IN | NU | NN。仅当用户先使用代码或明确要求时才显示代码。
示例(推荐)
工作区:
你的工作区:
1) 好呀(默认)
2) 4todo
3) 回声公园
待办事项(摘要):
紧急且重要:
1) 英国公司注销
2) Hetzner 月度付款(重复,每月)
重要(不紧急):
1) 每周回顾(重复,每周五)
在 OpenClaw 中存储/注入令牌(推荐)
OpenClaw 可以在代理运行期间注入环境变量(然后恢复原始环境),这有助于将密钥排除在提示词之外。
推荐(生产环境):使用托管服务提供商的密钥存储,在网关进程环境中设置 FOURTODOAPITOKEN,不要在聊天日志中存储令牌。
主机运行(非沙箱):使用 skills.entries
编辑 ~/.openclaw/openclaw.json:
json5
{
skills: {
entries: {
4todo: {
enabled: true,
env: {
FOURTODOAPITOKEN: 你的4TODOAPI_令牌
}
}
}
}
}
注意:
- - 仅当变量尚未设置时,才会注入 skills.entries..env。
沙箱会话:使用 agents.defaults.sandbox.docker.env
当会话处于沙箱中时,技能环境变量注入不会传播到 Docker 容器中。通过 Docker 环境变量提供令牌:
json5
{
agents: {
defaults: {
sandbox: {
docker: {
env: {
FOURTODOAPITOKEN: 你的4TODOAPI_令牌
}
}
}
}
}
}
请求约定
- - 每个请求必须包含 Authorization: Bearer <令牌>。
- 带有 JSON 主体的请求必须包含 Content-Type: application/json。
- GET /todos 需要 workspace 查询参数。
- 象限:IU | IN | NU | NN(内部使用)。
工作流程(推荐顺序)
复制此清单并在执行过程中保持更新:
任务清单:
- - [ ] 列出工作区(选择 ws_...)
- [ ] 列出该工作区的待办事项
- [ ] 执行请求的变更(创建/完成/重新排序/重复)
- [ ] 重新获取以验证更改
- 1. GET /workspaces:选择一个目标 ws...(通常是默认工作区)。
- GET /todos?workspace=ws...:获取待办事项(按象限分组)。
- 创建:POST /todos。
- 完成:POST /todos/:id/complete(幂等)。
- 重新排序/移动象限:POST /todos/reorder。
- 重复待办事项:使用 /recurring-todos 端点。
HTTP 示例(curl)
本技能特意使用 curl 以实现跨操作系统和环境的最大可移植性。
注意:
- - 仅支持 HTTPS(https://4to.do/api/v0)。
- 始终通过 FOURTODOAPITOKEN 传递令牌(切勿将令牌粘贴到聊天中)。
bash
curl -sS -H Authorization: Bearer $FOURTODOAPITOKEN -H Accept: application/json https://4to.do/api/v0/workspaces
curl -sS -H Authorization: Bearer $FOURTODOAPITOKEN -H Accept: application/json https://4to.do/api/v0/todos?workspace=ws_...&show=all
curl -sS -X POST -H Authorization: Bearer $FOURTODOAPITOKEN -H Accept: application/json -H Content-Type: application/json --data-raw {name:...,quadrant:IU,workspaceid:ws...} https://4to.do/api/v0/todos
curl -sS -X POST -H Authorization: Bearer $FOURTODOAPITOKEN -H Accept: application/json https://4to.do/api/v0/todos/todo_.../complete
curl -sS -X POST -H Authorization: Bearer $FOURTODOAPITOKEN -H Accept: application/json -H Content-Type: application/json --data-raw {movedtodoid:todo...,previoustodoid:todo...,nexttodoid:null,quadrant:IN} https://4to.do/api/v0/todos/reorder
注意:如果 movedtodoid 以 rectodo 开头,API 仅更新重复待办事项的象限,并忽略 previoustodoid/nexttodoid。
常见错误处理(代理指南)
- - 401 tokenexpired / invalidtoken:停止重试;要求用户在 4todo 设置中创建新令牌并更新 OpenClaw 配置。
- 402 WORKSPACERESTRICTED:工作区为只读;不要重试变更操作;切换工作区或提示用户升级/解锁。
- 429 ratelimited:遵守 Retry-After / X-RateLimit-* 并在重试前退避。
- 400 Invalid quadrant type:确保象限为 IU|IN|NU|NN 之一。
参考
- - 本技能附带的完整 API 文档:{baseDir}/references/api_v0.md