Files
myagents/.claude/todo
Zhengshou Lai b98d35c387 feat: add mybot CLI with update, chat, and Claude project config
- Click entrypoint: mybot update (make install / pip -e), mybot chat (claude in repo)
- Optional --dangerously-skip-permissions for Claude Code
- Makefile install; hatchling package layout
- .gitignore: venv, build artifacts, workspace (local symlinks)

Made-with: Cursor
2026-04-06 13:11:10 +08:00
..

Todo Agent 使用指南

基于文件通信的异步任务管理系统。

快速开始

1. 启动 Todo Agent(后台循环)

# 方式1: 使用 loop 技能
/loop 30s /todo-agent

# 方式2: 使用 CLI
uv run python -m src.interfaces.cli.main todo agent

# 方式3: 后台守护模式
uv run python -m src.interfaces.cli.main todo agent --daemon

2. 主会话交互

# 在 Python 中
from src.application.services.todo.client import todo

# 添加任务
todo.add("完成任务A", priority=1, wait=True)

# 列出任务
result = todo.list()
print(result.get("formatted"))

# 完成任务
todo.done("abc123", wait=True)

3. 命令行操作

# 添加任务
uv run python -m src.interfaces.cli.main todo add "任务标题" -p 1 -t bug

# 列出任务
uv run python -m src.interfaces.cli.main todo list

# 完成任务
uv run python -m src.interfaces.cli.main todo done <task_id>

# 查看状态
uv run python -m src.interfaces.cli.main todo status

# 停止 Agent
uv run python -m src.interfaces.cli.main todo stop

通信协议

文件目录结构:

.claude/todo/
├── inbox/          # 主会话写入的指令
│   └── cmd_<ts>.json
├── outbox/         # Agent 返回的结果
│   └── rsp_<ts>.json
├── state/          # 共享状态
│   ├── tasks.json      # 任务列表
│   ├── agent.log       # 执行日志
│   └── heartbeat.json  # Agent 心跳
└── archive/        # 归档的指令

指令格式:

{
  "cmd_type": "add",
  "task_id": null,
  "payload": {"title": "任务", "priority": 3},
  "sender": "main",
  "timestamp": "2024-01-15T10:00:00",
  "id": "20240115_100000_123456"
}

响应格式:

{
  "success": true,
  "cmd_id": "20240115_100000_123456",
  "data": {"task": {...}, "message": "已创建"},
  "error": null,
  "timestamp": "2024-01-15T10:00:01",
  "id": "20240115_100001_789012"
}

指令类型

指令 说明 payload
add 添加任务 title, description, priority, tags
list 列出任务 status, tag, priority
done 完成任务 task_id
delete 删除任务 task_id
update 更新任务 task_id + 字段
get 获取任务 task_id
clear 清空已完成 -
ping 心跳检测 -
stop 停止 Agent -