Idempotent bootstrap for the AFK pipeline: creates .afk/ structure, detects test/lint/build commands, records forge info, and sets up git excludes. Safe to re-run.
Ships in afk-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Read AFK environment before resolving configuration, local state or bundled helper paths.
Prepare a repository so the afk pipeline works in it. Idempotent: safe to re-run;
it fills gaps and never overwrites a value a developer set by hand. The pipeline
skills run this same bootstrap automatically when .afk/ is absent, so it
rarely needs invoking by hand — /afk-init is for an explicit re-detect.
Confirm the repo. Require a git working tree with a remote; stop with a clear message if either is absent.
Create .afk/ (with runs/ inside) if missing, at the shared location from
environment.
Write .afk/config.md from the plugin's templates/afk-config.example.md
only when it does not already exist — never clobber an existing config.
Detect commands. Fill any blank test/lint/build line from the
project's own manifest or task runner. Leave a line blank and say so when
nothing is found — never guess a command.
Record the forge. Ask the shared resolver rather than reading the host yourself — the value written here outranks the remote at every later read, so a hand-derived one that disagrees with the adapter sends issue reads to the wrong tracker:
node "<plugin-root>/lib/forge.mjs" --remote "$(git remote get-url origin)"
It prints { forge, reason, azureOrganization, githubRepository }. Write
forge, and leave the line blank when it is null — a written-in guess
reads exactly like a detected value later. Report the reason either way.
Record or reconcile pluginRoot. Follow the first-dispatch procedure in
Bundled helper location.
Existing .afk/ state does not make a recorded cache path current. Preserve
a custom-root keep decision and report the helper's reason.
Ignore local AFK state and credentials. Append the missing entries from
the plugin's templates/gitignore-snippet.txt to info/exclude under
git rev-parse --path-format=absolute --git-common-dir. That file is shared
by every linked worktree and is not tracked, so one write covers .afk/
wherever it is read from without dirtying a checkout that another session may
have mid-work on another branch.
Surface the ordered-gate notice once. Run the shared implementation used by SessionStart and AFK kickoff:
node "<plugin-root>/scripts/gate-profile-notice.mjs" --afk-dir "<main-worktree>/.afk" --plugin-root "<plugin-root>"
Pass on any line it prints. It owns .afk/gate-profile-notice.json, including
the signature and atomic write, so no entry point reimplements that protocol.
AFK_GATE_PROFILE_NOTICE=off opts out.
Surface the update notice. Run
node "<plugin-root>/scripts/update-check.mjs" and pass on any line it
prints. It is silent when current, offline, or opted out, and never blocks —
a stale install is otherwise invisible to anyone who does not run the full
afk driver. Installing the update is the host's job and the operator's
call; never self-update from a skill.
Report each action as created / updated / already present.
.afk/config.md; keys stay in the environment or the
ignored local .env installed by the same bootstrap rule.config.md is valid — the pipeline resolves safe defaults.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
/afk-skills:afk-initfrom afk-skills
npx claudepluginhub alvinshenssw/afk --plugin afk-skills13 skills in this plugin
/afkafk: Part of the afk pipeline. Execute an operator-supplied, pre-reviewed issue/PR scope autonomously through the full pipeline. Requires explicit scope; never pick tracker work. Triggers include "/afk", "AFK mode", "go AFK on …"./afk-agent-relayafk-agent-relay: Part of the afk pipeline. Development-time context compression and raw-request scoping through external models. Triggers include "/afk-agent-relay", "compress context", "relay brief", "scope this"./afk-claude-reviewafk-claude-review: Part of the afk pipeline. Independent read-only Claude review, a fallback role when Claude did not implement the change. Triggers include "/afk-claude-review", "run claude review", "claude gate"./afk-codex-reviewafk-codex-review: Part of the afk pipeline. Independent read-only Codex review, the default outer role when eligible. Triggers include "/afk-codex-review", "run codex review", "codex gate"./afk-deepseek-reviewafk-deepseek-review: Part of the afk pipeline. Independent read-only DeepSeek review, an optional external role. Triggers include "/afk-deepseek-review", "run deepseek review", and "DeepSeek external gate"./afk-gemini-reviewafk-gemini-review: Part of the afk pipeline. Independent read-only Gemini review, an optional external role. Triggers include "/afk-gemini-review", "run gemini review", and "Gemini external gate".2 plugins ship this exact skill · first indexed Oct 7, 2026