todo-init

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

todo-init

todo-init

Set up the agent todos configuration for this project. Creates
.agent-todos.local.json
in the project root and initializes the todo store directory.
The default todo store is
docs/agent-todos/
inside the project. Users with Obsidian can point
todosRoot
to a vault path instead.
为当前项目设置agent待办事项配置,会在项目根目录创建
.agent-todos.local.json
文件,同时初始化待办存储目录。
默认待办存储路径为项目内的
docs/agent-todos/
,使用Obsidian的用户可以将
todosRoot
指向vault路径替代默认路径。

Workflow

工作流程

Step 1: Check for Existing Config

步骤1:检查现有配置

Read
.agent-todos.local.json
in the project root, if it exists.
If a config file is found, show the current settings and ask the user whether to reconfigure or abort.
Upgrade path — missing
projectName
:
If the existing config is kept (user chooses not to reconfigure) but
projectName
is absent, ask: "Would you like to add a
projectName
to your config? This value is included in the
projects:
frontmatter of every new todo (e.g.
[[my-project]]
)." If yes, ask for the value and write it to the config file.
Upgrade path — missing CLAUDE.md section: If the existing config is kept but no
## Agent Todos
section exists in
CLAUDE.md
, proceed to Step 6 to add it.
读取项目根目录下的
.agent-todos.local.json
(如果文件存在)。
如果找到配置文件,展示当前设置并询问用户要重新配置还是中止操作。
升级路径——缺少
projectName
如果保留现有配置(用户选择不重新配置)但配置中缺少
projectName
,询问用户:“你是否想要在配置中添加
projectName
?该值会被写入所有新建待办的
projects:
前置元数据中(例如
[[my-project]]
)。”如果用户同意,询问对应取值并写入配置文件。
升级路径——缺少CLAUDE.md段落: 如果保留现有配置但
CLAUDE.md
中不存在
## Agent Todos
段落,直接进入步骤6添加该段落。

Step 2: Determine Todo Store Path

步骤2:确定待办存储路径

Ask the user where to store todos:
  • Default
    docs/agent-todos/
    inside the project (works everywhere, no external tools needed)
  • Custom path — any absolute path, e.g. a path inside an Obsidian vault
Use
AskUserQuestion
to let the user choose.
询问用户待办事项的存储位置:
  • 默认路径 —— 项目内的
    docs/agent-todos/
    (全场景可用,无需额外工具)
  • 自定义路径 —— 任意绝对路径,例如Obsidian vault内的路径
使用
AskUserQuestion
让用户完成选择。

Step 2b: Determine Project Name (optional)

步骤2b:确定项目名称(可选)

After the todo store path is set, ask the user whether they want to associate todos with a project name:
Would you like to add a
projectName
to tag every new todo? This is included in the
projects:
frontmatter field (e.g.
[[my-project]]
for Obsidian task-notes integration). Leave blank to skip.
This field is optional. If the user provides a value, include it in the config.
设置完待办存储路径后,询问用户是否想要将待办与项目名称关联:
你是否想要添加
projectName
来标记所有新建待办?该值会被写入
projects:
前置元数据字段(用于Obsidian任务笔记集成时格式为
[[my-project]]
),留空可跳过该设置。
该字段为选填项,如果用户提供了取值,就写入配置中。

Step 3: Write Config File

步骤3:写入配置文件

Create
.agent-todos.local.json
in the project root:
json
{
  "todosRoot": "<todos_root>"
}
If the user provided a
projectName
, include it:
json
{
  "todosRoot": "<todos_root>",
  "projectName": "<project_name>"
}
All paths should use
~
for the home directory when applicable.
在项目根目录创建
.agent-todos.local.json
json
{
  "todosRoot": "<todos_root>"
}
如果用户提供了
projectName
,则添加对应字段:
json
{
  "todosRoot": "<todos_root>",
  "projectName": "<project_name>"
}
所有路径在适用场景下应使用
~
指代用户主目录。

Step 4: Create Todo Store Directory

步骤4:创建待办存储目录

Create the
todosRoot
directory if it does not already exist:
bash
mkdir -p "<todos_root>"
如果
todosRoot
目录不存在则创建该目录:
bash
mkdir -p "<todos_root>"

Step 5: Ask for Initial Categories

步骤5:询问初始分类

Ask the user which category subdirectories to create (multi-select). Suggest common ones:
  • misc/
    — Miscellaneous tasks
  • data/
    — Data-related tasks
  • content/
    — Content creation and editing tasks
Create the selected subdirectories inside
todosRoot
.
询问用户要创建哪些分类子目录(支持多选),提供常用分类建议:
  • misc/
    —— 杂项任务
  • data/
    —— 数据相关任务
  • content/
    —— 内容创作与编辑任务
todosRoot
内创建用户选中的子目录。

Step 6: Add Agent Todos Section to CLAUDE.md

步骤6:在CLAUDE.md中添加Agent待办段落

Check whether a
CLAUDE.md
file exists in the project root and whether it already contains an
## Agent Todos
section:
bash
grep -q "## Agent Todos" CLAUDE.md 2>/dev/null && echo "exists" || echo "missing"
If the section is missing, append the following reference block to
CLAUDE.md
. Replace
<todosRoot>
with the actual configured path:
markdown
undefined
检查项目根目录是否存在
CLAUDE.md
文件,以及文件中是否已有
## Agent Todos
段落:
bash
grep -q "## Agent Todos" CLAUDE.md 2>/dev/null && echo "exists" || echo "missing"
如果该段落不存在,将以下参考块追加到
CLAUDE.md
末尾,将
<todosRoot>
替换为实际配置的路径:
markdown
undefined

Agent Todos

Agent Todos

This project uses the agent-todos plugin to manage tasks as structured Markdown files.
IMPORTANT: Always read
.agent-todos.local.json
before any todo operation. It defines
todosRoot
— the actual directory where todo files are stored. Do not fall back to
docs/agent-todos/
when this file is present.
Current todo store:
<todosRoot>
Skills:
  • /todo-creation [category] [title]
    — create a new todo file
  • /todo-processing [category/number]
    — pick up and work on a todo
  • /todo-gh-issue-import [category]
    — import GitHub issues as todos
  • /todo-moving
    — renumber or move todos between categories

If `CLAUDE.md` does not exist, create it with only this section.

If the section already exists, skip this step.
This project uses the agent-todos plugin to manage tasks as structured Markdown files.
IMPORTANT: Always read
.agent-todos.local.json
before any todo operation. It defines
todosRoot
— the actual directory where todo files are stored. Do not fall back to
docs/agent-todos/
when this file is present.
Current todo store:
<todosRoot>
Skills:
  • /todo-creation [category] [title]
    — create a new todo file
  • /todo-processing [category/number]
    — pick up and work on a todo
  • /todo-gh-issue-import [category]
    — import GitHub issues as todos
  • /todo-moving
    — renumber or move todos between categories

如果`CLAUDE.md`不存在,则创建文件并仅写入上述段落。

如果该段落已存在,跳过本步骤。

Notes

注意事项

  • .agent-todos.local.json
    is project-specific and should be added to
    .gitignore
    when
    todosRoot
    points outside the project
  • If
    todosRoot
    is inside the project (e.g.
    docs/agent-todos
    ), it can be checked in
  • All todo skills (
    /todo-creation
    ,
    /todo-processing
    , etc.) read this config automatically
  • To use a different store later, re-run
    /todo-init
    or edit
    .agent-todos.local.json
    directly
  • Without
    .agent-todos.local.json
    , all skills fall back to
    docs/agent-todos/
    in the project root
  • .agent-todos.local.json
    是项目专属配置,当
    todosRoot
    指向项目外路径时,应将该文件添加到
    .gitignore
  • 如果
    todosRoot
    在项目目录内(例如
    docs/agent-todos
    ),可以提交到代码仓库
  • 所有待办相关skill(
    /todo-creation
    /todo-processing
    等)会自动读取该配置
  • 如果后续需要使用不同的存储路径,重新运行
    /todo-init
    或者直接编辑
    .agent-todos.local.json
    即可
  • 没有
    .agent-todos.local.json
    时,所有skill会默认使用项目根目录下的
    docs/agent-todos/
    路径