Generates end-user documentation from a live web app using Playwright to walk flows, capture screenshots, and produce flow guides with a linked index. Detects target directory type (Obsidian vault or repo docs/).
Ships in sdlc. 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.
Read when SKILL.md points to them; scripts run unread.
Генерує користувацьку (не dev) документацію з живого веб-застосунку: інвентаризація флоу →
детермінований прогін кожного флоу в браузері з журналом дій і скріншотами станів → окремий
clean-context агент пише один flow-документ строго з журналу → тонкий User Guide індекс з лінками
на всі флоу. Опційно — скринкасти через реплей журналу. Джерело правди для стилю —
./references/style-guide.md; для відтворюваності —
./references/determinism.md.
Браузерний канал — playwright-cli (канон плагіна, див. verify-ui): токен-ефективний CLI
для циклів. Playwright MCP у пайплайні — задокументований anti-pattern.
Owner: батько-оркестратор (цей skill) володіє манифестом, гейтом, індексом і когерентністю;
кожен флоу цілком (браузер + текст) належить одному агенту sdlc:doc-flow.
/sdlc:user-documentation <target-dir> [--flows a,b,c] [--video] [--base-url URL] [--embed wikilink|markdown]
<target-dir> — тека, куди лягають документи (vault-тека або docs/user-guide/ репо).--flows — явний список слагів; без нього список будується інвентаризацією (крок 4).--video — після доків згенерувати скринкасти реплеєм журналів.--base-url — адреса застосунку; без неї питаємо користувача на кроці 2.--embed — примусовий синтаксис вставок; без нього — автодетект (крок 1).Gate (hard refuse):
playwright-cli --version падає → відмова з інструкцією:
npm install -g @playwright/cli@latest, далі playwright-cli install-browser chrome, лише якщо
open каже Browser "chrome" is not installed.<base-url> → відмова: «підніми застосунок і повтори» (не
вигадуємо стан — прецедент verify-ui).Детект цілі й синтаксису. Walk-up від <target-dir> до кореня: знайшов .obsidian/ →
vault → embed_syntax: wikilink; інакше → markdown. --embed — override. Шляхи з
пробілами (iCloud vault) — завжди в лапках.
Gate (див. вище) + зафіксувати base_url і назву продукту.
Auth bootstrap (раз per роль, робить БАТЬКО): пройти логін за обраною стратегією →
playwright-cli -s=docgen-auth state-save → <target>/.docgen/auth-<role>.json → закрити
сесію. Субагенти тільки state-load — жоден агент не логіниться сам.
Інвентаризація флоу → протокол у ./references/flow-inventory.md:
merge трьох джерел (--flows / скан репо через sdlc:explorer, fallback Explore / живий
snapshot навігації); класифікація кожного флоу doc_type (task-flow / state-reference /
auth) і mutates (чи змінює дані). AskUserQuestion: підтвердити список + типи + scope.
Після підтвердження список заморожений.
Манифест <target>/.docgen/flows-manifest.json + створити теки screenshots/<slug>/:
{
"product_name": "Beer LMS",
"base_url": "http://localhost:5173",
"target_dir": "/abs/path/to/target",
"embed_syntax": "wikilink",
"viewport": { "capture": "1280x800", "publish_width": 780 },
"video": false,
"data_prefix": "Docgen:",
"flows": [
{
"slug": "create-session",
"title": "Create Mentorship Session",
"doc_type": "task-flow",
"mutates": true,
"start_url": "/mentorship",
"auth_state": ".docgen/auth-mentor.json",
"scope": "list → create dialog → toast; без edit/delete",
"out_file": "Flow - Create Mentorship Session.md",
"screenshots_dir": "screenshots/create-session",
"journal": ".docgen/journals/create-session.jsonl",
"session": "df-1",
"status": "pending"
}
]
}
Фан-аут sdlc:doc-flow (fallback: general-purpose з тим самим промптом). Батчування
за mutates, не за кількістю: read-only флоу паралельно батчами ≤3; мутуючі — СТРОГО
ПОСЛІДОВНО після read-only (конкурентні мутації спільної БД псують скріни сусідів: агент A
створює запис посеред прогону B — і список у B різний між його власними кроками). Промпт
кожному агенту інлайнить (clean context — агент не бачить цієї розмови):
base_url,
embed_syntax, data_prefix, product_name);${CLAUDE_PLUGIN_ROOT}/skills/user-documentation/templates/flow-doc.md, auth-state;.playwright-cli/ падають у cwd і не мають засмічувати ціль/vault);df-<n> за індексом флоу) — довші впираються в ліміт unix-socket
шляху (determinism.md §5).Очікуваний фінальний рядок — sentinel DOCFLOW_OK ... / DOCFLOW_FAIL .... На FAIL —
1 retry; знову FAIL → status: failed у манифесті, пайплайн продовжується.
User Guide індекс (батько): з H1 + лід-абзаца кожного готового дока + манифеста зібрати
тонкий <Product> - User Guide.md за
./templates/user-guide-index.md. Кожен флоу злінкований
(vault: [[Flow - X]]; repo: [Flow - X](<Flow - X.md>)). Індекс v1 без власних скрінів.
Опційний скринкаст (--video): для обраних флоу
"${CLAUDE_PLUGIN_ROOT}/skills/user-documentation/scripts/replay-screencast.sh" \
"<target>/.docgen/journals/<slug>.jsonl" "<target>/screencasts/<slug>.webm" \
"<target>/.docgen/auth-<role>.json" "<base-url>" "<start-url>"
→ секція ## Screencast з embed-ом одразу після ліда. Для мутуючих флоу попередити
користувача: реплей створить ще один Docgen:-запис.
Механічний гейт:
python3 "${CLAUDE_PLUGIN_ROOT}/skills/user-documentation/scripts/validate-docs.py" \
"<target-dir>" --embed <mode> [--video]
Червоне → точкові фікси (батько сам, без агентів) → re-run до зеленого.
Когерентність (батько; БЕЗ sdlc:critic — його проби зашиті під PRD/SAD, а батько тут
clean-context by construction): grep-звірка між доками — назва продукту однакова, ролі та
статуси називаються консистентно, терміни збігаються з UI.
Handoff. Git-репо → запропонувати commit docs: user documentation for <product>
(ТІЛЬКИ шляхи цілі); vault → без коміту (obsidian-git сам). Закрити СВОЇ сесії
(-s=<name> close, ніколи close-all). .docgen/ лишається — журнали = сировина для
майбутніх --video. Завершити stage-handoff блоком за
../_shared/handoff.md, utility-варіант: Run next = «resume
your backbone stage» або повторний виклик з --video.
video-start --size у playwright-cli 0.1.13 (у help не підтверджено). Якщо ні —
розмір відео = розмір в'юпорта (1280×800), що нас і так влаштовує.run-code контекст іменованої сесії так, як очікуємо, — перший живий реплей
скринкаста це підтвердить/спростує.PACE env у replay-screencast.sh) — підібрати на око.DOCFLOW_OK (≤1 retry) або чесний failed у манифесті й у
фінальному звіті — без тихих пропусків.validate-docs.py зелений (exit 0) на <target-dir>..docgen/ містить манифест + журнали всіх пройдених флоу.docflow-*/replay-*/docgen-auth сесії закриті.--video — .webm існує і вбудований у відповідний док.doc_type: auth,
явно позначений у ../../agents/doc-flow.md).verify-ui); MCP лише для
живого дебагу поза пайплайном.> [!note] — доки мають рендеритись на GitHub, лише > **Note:**.close-all/kill-all — паралельні агенти діляться машиною.playwright-cli install --skills ставить власний SKILL.md;
тут лише скіло-специфічні гочі (determinism.md §5)../templates/flow-doc.md — шаблон flow-документа (тип А + вставний
блок типу Б + хвостові таблиці)../templates/user-guide-index.md — тонкий індекс v1../references/style-guide.md — кодифікація еталонного стилю../references/determinism.md — data state, 780px, журнал,
інваріанти валідатора, CLI-гочі../references/flow-inventory.md — протокол інвентаризації.../verify-ui/SKILL.md — браузерний канал верифікації AC; той самий
CLI-канон, інша мета (вердикт, не документація)./sdlc:user-documentation "~/vault/Beer-LMS-docs" --flows create-session,authentication --video
Приклад диспатчу одного флоу (крок 6):
Task(subagent_type="sdlc:doc-flow", prompt="
Execute directly, do not spawn sub-agents, use tools directly, report results with absolute
file paths.
Document ONE flow of 'Beer LMS' (base_url http://localhost:5173, embed_syntax wikilink,
data_prefix 'Docgen:').
Flow entry: {"slug":"create-session", ... (повний JSON-entry, шляхи абсолютні)}.
Read first: <abs>/references/style-guide.md, <abs>/references/determinism.md,
template <abs>/templates/flow-doc.md. Auth: state-load <abs>/.docgen/auth-mentor.json.
Session: df-1. Sibling flows this run: Authentication, Session Lifecycle.
End with the DOCFLOW_OK/DOCFLOW_FAIL sentinel line.")
user-documentation → (utility, ad-hoc). Наприкінці друкується stage-handoff блок за
../_shared/handoff.md: What I did — скільки флоу OK/failed, шлях до індексу й доків, запропонований коміт (для git-цілі); Review — індекс + кожен flow-док + звіт валідатора; Run next — resume your backbone stage (напр./sdlc:ship-feature <slug>) або повторний виклик із--video/ рештою флоу./clearопційний (utility-варіант).
references/determinism.md (opens in a new tab)references/flow-inventory.md (opens in a new tab)references/style-guide.md (opens in a new tab)scripts/replay-screencast.sh (opens in a new tab)scripts/validate-docs.py (opens in a new tab)templates/flow-doc.md (opens in a new tab)templates/user-guide-index.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
sonnetmedium24 skills in this plugin
/api-forgeUse to derive the API contract for a feature — an OpenAPI 3.1 document at docs/features/{slug}/contracts/openapi.yaml plus a drift/sync report (api-sync-report.md with an explicit Verdict: PASS | PASS (with deferrals) | FAIL and a 5-point drift checklist), the right contract artifact per surface (events.md for async, cli.md for CLI, public-api.md for library/SDK), and — on the HTTP path, first run only — a baseline .claude/rules/openapi.md so later code follows the same API conventions. Triggers on "api for {slug}", "openapi for {slug}", "API contract for {slug}", "lock the interface for {slug}", "events for {slug}", "/sdlc:api-forge {slug}", "контракт API для {slug}", "OpenAPI для {slug}", "опиши ендпоінти". The contract is never hand-written: it is a derived function of data-model.md (typed fields + constraints), sad.md §6 sequence diagrams (error branches, async actors), and PRD.md acceptance criteria. Hard gate: docs/features/{slug}/PRD.md. data-model.md is recommended but optional — without it the skill runs in scenario B (PRD + sequences only) and fills unresolved_origins in the sync report. Renamed from define-api in v3.3.0; the legacy name is kept as a deprecation wrapper.
/architecture-designUse to produce a Software Architecture Document for a feature — Arc42 12 sections + C4 L1/L2 inline + ADRs spawned on a blast-radius gate — once PRD.md and CONTEXT.md exist. The feature's target surface(s) are chosen here (the first §4 decision → SAD frontmatter target_surfaces, read by every downstream stage). Drafts §1–§12 in-memory, batch-validates each section Socratically (4-state machine), spawns an ADR only when a decision crosses the blast-radius threshold (irreversible / multi-module / has legitimate alternatives), writes each resolved section + its ADRs atomically, then runs a clean-context critic before finalizing. Brownfield: reads docs/architecture-map.md (re-scans only if absent/stale). Triggers on "architecture for {slug}", "design architecture for {slug}", "SAD for {slug}", "arc42 for {slug}", "C4 context+container for {slug}", "/sdlc:architecture-design {slug}", "спроектуй архітектуру {slug}", "SAD для {slug}", "архітектурний документ {slug}". Hard-refuse if docs/features/{slug}/PRD.md is missing. Triggers: /sdlc:architecture-design {slug}. Output: docs/features/{slug}/sad.md + adr/NNNN-*.md./break-tasksUse to break a designed feature into atomic, ≤1-day tasks with a dependency graph, a per-task Definition of Done, and a machine-readable tasks.json that the implement-tasks engine consumes. Triggers on "task breakdown for {slug}", "break down tasks for {slug}", "tasks for {slug}", "plan the work for {slug}", "sprint plan for {feature}", "stage 13 for {slug}", "/sdlc:break-tasks {slug}". Reads PRD.md + sad.md + Accepted ADRs (+ data-model + openapi if present), writes docs/features/{slug}/tasks/{_epic,tracker,<task>}.md AND docs/features/{slug}/tasks/tasks.json. Tracker export to any issue tracker is optional and tool-neutral. Hard-refuses if PRD.md or sad.md or an Accepted ADR is missing. Stories LINK to upstream artefacts (PRD AC §, SAD §6, data-model, openapi), they do not duplicate them.
/clarify-prdUse to run an ambiguity sweep over a written PRD.md and close every under-specified point before glossary or architecture proceeds — so two engineers can't reasonably build different things from the same PRD. Triggers on "/sdlc:clarify-prd {slug}", "clarify {slug}", "find ambiguities in {slug}", "is the PRD ready", "sharpen the PRD", "прояснити PRD", "знайди неоднозначності {slug}", "чи готова специфікація". Re-reads the PRD, dispatches a clean-context devil's-advocate subagent to list where the PRD forks, then for each ambiguity runs AskUserQuestion to RESOLVE it (tighten §1/§5/§6 in place) or DEFER it (→ §8 Open questions with owner+due). Output: an updated docs/features/{slug}/PRD.md with every ambiguity resolved or deferred — none dangling. Hard-refuse if PRD.md is missing./classify-sizeUse to classify a feature into XS/S/M/L/XL and write docs/features/{slug}/.size so later skills know how much of each artifact to produce. Triggers on "classify size", "feature size", "is this XS or M for {slug}", "size {slug}", "/sdlc:classify-size {slug}", "класифікуй розмір {slug}", "який розмір фічі", "XS чи M". Asks four AskUserQuestion (PR count / time / new module-API-migration / breaking changes), maps to a size class via the shared size matrix, confirms with the user, and writes the one-line .size file. Syncs with PRD.md frontmatter feature_size: if present (warns on conflict). Output: docs/features/{slug}/.size + (opt.) PRD frontmatter update./complete-sequence-diagramsUse to add Mermaid sequenceDiagram blocks to the SAD's runtime view (sad.md §6) — one per critical flow, showing how a request moves between generic participants with happy + error paths. Triggers on "complete sequences for {slug}", "sequence diagram for {slug}", "draw the runtime flow", "add a sequence to the SAD", "/sdlc:complete-sequence-diagrams {slug}", "діаграми послідовності {slug}", "sequence для {slug}", "намалюй потік {slug}". Reads sad.md §5 for participants, drafts each flow from templates/seq-flow.md with generic participants, walks them Socratically one flow at a time, writes confirmed blocks into sad.md §6 — they inform data-model indexes downstream — and closes with the US/AC → flow coverage table written as the last block of §6 (`### Coverage: US/AC → flows`). Hard-refuse if sad.md is missing → run /sdlc:architecture-design first. Single-flow mode: /sdlc:complete-sequence-diagrams {slug} --flow {name}./sdlc:user-documentationfrom sdlc
npx claudepluginhub genkovich/sdlc --plugin sdlcOther plugins' skills for the same job