afk-setup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AFK Setup

AFK 配置

Register a repo in the AFK board registry so
engineer
,
triage
, and
reviewer
can find its board. The registry is a single JSON file at
$CLAUDE_CONFIG_DIR/afk.json
(default
~/.claude/afk.json
) that maps an absolute repo path to that repo's board coordinates.
It is per-machine and NOT source-controlled. It keys on absolute paths, which differ between your laptop and the VPS, so each machine generates its own with the bundled script. That is why a freshly-cloned checkout (e.g. on the VPS) has no entry: you generate it there.
AFK看板注册表中注册仓库,以便
engineer
triage
reviewer
能够找到对应的看板。该注册表是位于
$CLAUDE_CONFIG_DIR/afk.json
(默认路径为
~/.claude/afk.json
)的单个JSON文件,用于将仓库绝对路径映射到该仓库的看板坐标。
**该配置是按机器存储的,不纳入版本控制。**它以绝对路径作为键,而你的笔记本电脑和VPS上的路径会有所不同,因此每台机器都需要通过内置脚本生成自己的配置文件。这就是为什么新克隆的代码仓库(例如在VPS上)没有条目:你需要在对应机器上生成它。

The schema

配置 schema

json
{
  "repos": {
    "/abs/path/to/repo": {
      "tracker": "linear",
      "linear": { "team": "Engineering", "project": "Docket phase 1: ingest, feed, reader" },
      "readyStatus": "Ready for Agent",
      "humanStatus": "Ready for Human",
      "shipMode": "pr"
    }
  }
}
  • tracker
    :
    linear
    ,
    github
    , or any future tracker.
  • Coordinates:
    linear: { team, project }
    , or
    github: { repo: "owner/name", project? }
    .
  • readyStatus
    /
    humanStatus
    : the board's two triage-output columns (canonical
    Ready for Agent
    /
    Ready for Human
    ). The other statuses (
    Triage
    ,
    In Review
    ,
    Changes Requested
    ,
    Done
    ) are matched by their canonical names verbatim.
  • shipMode
    :
    pr
    (branch and open a PR) is the default.
json
{
  "repos": {
    "/abs/path/to/repo": {
      "tracker": "linear",
      "linear": { "team": "Engineering", "project": "Docket phase 1: ingest, feed, reader" },
      "readyStatus": "Ready for Agent",
      "humanStatus": "Ready for Human",
      "shipMode": "pr"
    }
  }
}
  • tracker
    : 可选值为
    linear
    github
    或未来支持的其他跟踪器。
  • 坐标:
    linear: { team, project }
    ,或
    github: { repo: "owner/name", project? }
  • readyStatus
    /
    humanStatus
    : 看板的两个分类输出列(标准值为
    Ready for Agent
    /
    Ready for Human
    )。其他状态(
    Triage
    In Review
    Changes Requested
    Done
    )需与标准名称完全匹配。
  • shipMode
    : 默认值为
    pr
    (创建分支并发起PR)。

Generate the entry

生成配置条目

Run the bundled script from the repo root (it resolves the path itself):
bash
undefined
从仓库根目录运行内置脚本(脚本会自动解析路径):
bash
undefined

Linear board (the DEFAULT). Team defaults to "Engineering"; only the project

Linear看板(默认选项)。Team默认值为"Engineering";仅需指定project(无法自动推断):

is required (it cannot be inferred):

bash <path-to-this-skill>/scripts/init-afk.sh --linear-project "Skills"
bash <path-to-this-skill>/scripts/init-afk.sh --linear-project "Skills"

Linear with a non-default team:

非默认Team的Linear配置:

bash <path-to-this-skill>/scripts/init-afk.sh
--tracker linear --linear-team "Design"
--linear-project "Docket phase 1: ingest, feed, reader"
bash <path-to-this-skill>/scripts/init-afk.sh
--tracker linear --linear-team "Design"
--linear-project "Docket phase 1: ingest, feed, reader"

GitHub board (opt-in; owner/repo inferred from the origin remote):

GitHub看板(可选;owner/repo会从origin远程仓库自动推断):

bash <path-to-this-skill>/scripts/init-afk.sh --tracker github

Defaults: `--tracker linear`, `--linear-team "Engineering"`, `--ready "Ready for Agent"`, `--human "Ready for Human"`, `--ship pr`.
The script is **idempotent**: an existing entry is left untouched unless `--force`.
It edits the JSON with `node` (or `bun`), preserving every other repo's entry.
bash <path-to-this-skill>/scripts/init-afk.sh --tracker github

默认参数:`--tracker linear`、`--linear-team "Engineering"`、`--ready "Ready for Agent"`、`--human "Ready for Human"`、`--ship pr`。
该脚本具备**幂等性**:已存在的条目不会被修改,除非使用`--force`参数。它通过`node`(或`bun`)编辑JSON文件,保留其他所有仓库的条目。

Interactive use (/afk-setup)

交互式使用(/afk-setup)

When the maintainer runs
/afk-setup
, do the figuring-out, then call the script:
  1. Resolve the repo (
    git rev-parse --show-toplevel
    ). If it already has an entry, show it and stop unless they want to change it (
    --force
    ).
  2. Determine the tracker. Linear is the default (team defaults to
    Engineering
    ); use GitHub only when the maintainer explicitly wants GitHub issues/Projects. For Linear you still need a project (it cannot be inferred): list projects with the Linear MCP (
    list_projects
    for the team), then reuse an existing one or create a new project, and confirm with the maintainer. Do not guess a Linear project.
  3. Confirm the values (tracker, coordinates, statuses, ship mode), then run
    init-afk.sh
    with the resolved flags.
  4. Read the file back and show the maintainer the entry you wrote.
当维护者触发/afk-setup时,需按以下步骤操作后再调用脚本:
  1. 解析仓库路径(执行
    git rev-parse --show-toplevel
    )。如果该仓库已有配置条目,展示条目内容并停止操作,除非用户希望修改(使用
    --force
    参数)。
  2. 确定跟踪器类型。Linear为默认选项(Team默认值为
    Engineering
    );仅当维护者明确要求使用GitHub Issues/Projects时才选择GitHub。对于Linear,你仍需指定project(无法自动推断):通过Linear MCP列出该Team的项目(调用
    list_projects
    ),然后选择现有项目或创建新项目,并与维护者确认。请勿随意猜测Linear项目。
  3. 确认配置值(跟踪器、坐标、状态、发布模式),然后使用解析后的参数运行
    init-afk.sh
  4. 读取配置文件并向维护者展示你写入的条目。

Pairs with

关联功能

  • startup
    calls this in its meta layer, so a new repo is registered as it is created. The default is a Linear board (team
    Engineering
    ); since the Linear project cannot be inferred, startup does not auto-register it. Finish it by running
    /afk-setup
    (determine the project, reusing or creating one via the Linear MCP). GitHub is used only when explicitly chosen (
    --tracker github
    ).
  • engineer
    /
    triage
    /
    reviewer
    read the entry this writes; if they find none, they point the user here.
  • startup
    会在元层调用此功能,因此新仓库创建时会自动注册。默认使用Linear看板(Team为
    Engineering
    );由于Linear项目无法自动推断,startup不会完成自动注册,需通过运行/afk-setup来完成(确定项目,通过Linear MCP选择或创建项目)。仅当明确指定
    --tracker github
    时才会使用GitHub。
  • engineer
    /
    triage
    /
    reviewer
    会读取此功能写入的条目;如果未找到条目,会引导用户查看此文档。