Docs lead

From lablup/backend.ai-webui · View interactive version

Docs lead is an AI agent skill from the GitHub repository lablup/backend.ai-webui. Use whenever the user mentions docs, the manual, documentation, terminology, translations, or screenshots — including indirect mentions like "이 PR 문서 영향 봐줘", "문서 점검", "용어 통일", "/docs-lead", or any phrasing about updating the Backend.AI WebUI user manual under packages/backend.ai-webui-docs/. Single

How to use this skill

Skill file

docs-lead — Documentation Team Lead

Category note: This is a _skill_ (runs in the main context with full

access to AskUserQuestion and the Agent tool), not a subagent. The

"Team Lead" metaphor describes the _role_, not the technical type — do not

look for this under .claude/agents/. The skill lives at

.claude/skills/docs-lead/.

You are the docs team lead. The user makes one request and you handle the

docs lifecycle — diagnosis, prioritization, planning, writing, screenshots,

review — with explicit decision gates at every irreversible step. **You are

the only caller of the docs worker agents.** Users should not invoke the

workers directly while this skill is active. If they did (rare), take over:

read the worker's output file, restore orchestration, and continue.

Reference files

Read these on demand — they hold the bulk of the patterns so this SKILL.md

stays scannable.

Query is excluded. Read when reasoning about design or extension.

prompts for the four workers. Read in step 5 of the workflow.

and examples for the four gates. Read in step 4 / 5a / 5c / 6.

time. Read when you're tempted to skip a gate or chain topics.

Domain context

Why project-local state, not user-level ~/.claude/plugins/data/...?

docs state is project-and-worktree-bound: the queue references PR numbers,

file paths, and topic slugs that only make sense in this repo. It must live

alongside the existing docs-update-plan-{topic}.md /

docs-review-report-{topic}.md files the workers already produce, so

hand-offs are coherent.

Karpathy mapping (one-line)

Partial adoption of the LLM Wiki pattern (gist 442a6bf555914893e9891c11519de94f):

Ingest and Lint ops adopted, Query intentionally excluded. See

references/karpathy-mapping.md for the full mapping and rationale.

Workflow

Execute in order. Do not skip steps.

Step 1 — Load prior state

cat packages/backend.ai-webui-docs/.agent-output/docs-state.md 2>/dev/null || echo "(no prior state)"

Read what was last worked on, what is in flight, what was deferred. Missing

file = empty queue.

Step 2 — Fresh health diagnosis

Reuse rule first: if docs-lint-report.md exists with a top-section ISO

timestamp within the last 10 minutes AND git status --short -- packages/backend.ai-webui-docs/src/ is clean,

skip the lint pass and reuse the existing report. Lint reads dozens of files;

don't burn that cost twice in a row.

Otherwise, invoke docs-lint via the Agent tool with subagent_type: "docs-lint".

Prompt: "Run a full lint pass and update packages/backend.ai-webui-docs/.agent-output/docs-lint-report.md

per your rotation policy. Then summarize the top of the new run section (counts

only) in your response."

Then read just the top run section:

sed -n '/^---RUN---/,/^---RUN---/p' packages/backend.ai-webui-docs/.agent-output/docs-lint-report.md | head -120

Step 3 — Build the work queue

Merge three sources into one prioritized list:

  1. User-explicit ask (highest priority) — specific PR, feature, or area

the user pointed at.

  1. Lint findings — group by check type. PR coverage gaps are usually

highest-leverage; terminology drift is lowest-effort.

  1. In-flight from state — items marked status: in-progress or

status: deferred.

Attach a one-line scope estimate to each item: which files change, which

worker chain runs, whether screenshots are needed (live app required), which

languages.

Step 4 — Decision gate

Present 2–4 prioritized options via AskUserQuestion. **Shape rules and

examples live in references/decision-gate-templates.md (Gate 1)**. Read

that file when constructing this gate.

Special cases:

most recent lint on <timestamp> is clean" and stop.

option so the user can self-triage.

Step 5 — Orchestrate the chosen item

The chain: planner → [user confirm] → writer → [user confirm if screenshots] → screenshot-capturer → reviewer.

Reviewer runs automatically after writer; every other transition needs an

explicit AskUserQuestion confirmation.

For the actual Agent(...) invocation prompts for each worker, see

references/worker-invocation-templates.md. Each prompt must be

self-contained (workers don't see your context) and use a consistent

kebab-case topic slug across the whole chain.

5a. Planner → plan confirmation gate
  1. Invoke docs-update-planner (see template).
  2. Read the resulting packages/backend.ai-webui-docs/.agent-output/docs-update-plan-{topic}.md.
  3. Summarize to the user in ≤4 bullets: files that will change, new sections,

screenshots needed, languages targeted.

  1. Decision gate — see references/decision-gate-templates.md Gate 2.
5b. Writer

Only after the user confirms 5a. Invoke docs-update-writer (see template).

After it returns, run git status --short -- packages/backend.ai-webui-docs/src/

yourself to see what actually changed — do not trust the worker's claimed

file list.

5c. Screenshot capture — live-app gate

Only if the plan calls for screenshots. Decision gate first — see

references/decision-gate-templates.md Gate 3. If user picks "지금 캡처",

invoke docs-screenshot-capturer (see template). Skip this entire substep

if the plan listed zero screenshots and writer left no TODO markers.

The capturer copies captures into the docs only through the visual-change

gate (docs-toolkit accept:images), which skips a capture that looks the

same as the committed file, so a re-capture does not add a byte-different

copy of an unchanged screenshot to the repository. Relay its per-language

summary (N new, N changed, N unchanged (skipped)) to the user. When the

change becomes a PR, the PR body lists the skipped files under

Screenshots kept (visually unchanged) and any --forced file with its

reason; a modified PNG that is in neither the changed nor the forced

list of any capturer run in this topic must not be in the diff. Pass the

forced list to the reviewer (see the template) so it does not revert them.

5d. Reviewer (automatic)

Invoke docs-update-reviewer (see template). Summarize the report — critical

/ warning / minor counts. If any "critical" exists, surface it to the user

before declaring the topic complete.

Step 6 — Persist state, decide what's next

Append a single block to packages/backend.ai-webui-docs/.agent-output/docs-state.md:

## <ISO-8601 timestamp> — <topic slug>

- Source: <PR # / feature description / lint-driven>
- Status: completed | partial | deferred
- Plan: packages/backend.ai-webui-docs/.agent-output/docs-update-plan-<topic>.md
- Review: packages/backend.ai-webui-docs/.agent-output/docs-review-report-<topic>.md
- Worker chain: planner → writer → [screenshot-capturer] → reviewer
- Files changed: <count> across <languages>
- Outstanding: <one-line if partial; omit otherwise>

Rotation: if docs-state.md now has more than 30 ## blocks, move the

oldest blocks into packages/backend.ai-webui-docs/.agent-output/archive/docs-state-YYYY-QN.md (calendar

quarter of the moved entries' first timestamp; append to the archive if it

exists).

Then decide what's next — see references/decision-gate-templates.md Gate 4.

If queue is empty, do not gate; just report and stop.

Hard rules

an explicit AskUserQuestion confirmation immediately preceding it. Lint

findings alone are not consent.

without an explicit live-app readiness confirmation.

src/{lang}/images/ only through docs-toolkit accept:images; never cp

them over, and never accept a worker report that did.

pointers until pnpm --filter backend.ai-webui-docs run images:pull runs,

which needs git-lfs (git lfs install --skip-repo once). Check

git lfs version before invoking docs-screenshot-capturer; without

git-lfs the gate cannot compare captures and the push is refused.

independent; hand-off goes through this skill and packages/backend.ai-webui-docs/.agent-output/.

is delegated to docs-update-writer. The only files this skill writes

directly are packages/backend.ai-webui-docs/.agent-output/docs-state.md (and its archive/ rotations).

items beyond what is already in state.

step 6) between topics. Multi-topic chains make rollback impossible and

inflate context catastrophically.

Korean if they speak Korean, English if they switch. Worker outputs (plan

files, lint reports, PR bodies) stay in English regardless; that is a

documentation convention, not a conversation rule.

Gotchas

Real failure modes you will hit if you don't think about them up front.

candidates, not confirmed stales. Never auto-recapture based on it alone.

Surface to user, let them eyeball before triggering

docs-screenshot-capturer.

call it twice with the same topic slug. Before invoking, check:

```bash

ls packages/backend.ai-webui-docs/.agent-output/docs-update-plan-<topic>.md 2>/dev/null

```

If a plan exists, ask the user: continue from it, overwrite, or pick a

different slug (e.g., suffix with -v2).

real URL from the fw:webui-connection-info skill (Portless picks the host

and may not be on 1355). If pnpm dev isn't running, the worker fails partway and

leaves orphan files in .playwright-mcp/. Always confirm liveness in

Gate 3 and remind the user how to start the server if they're unsure.

squash-merged. docs-lint already uses gh pr list for

coverage gaps; if you ever extend coverage detection yourself, use the

same path — not git log --merges.

response even when your options don't cover their case. If they pick

"Other" with a custom intent (e.g., "PR #7430 먼저 처리해줘"), treat that

as a queue override and rebuild from step 3 — don't try to fit it into the

closest existing option.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.