/cog-second-brain:feature-docfrom cog-second-brain
Generates feature documentation end-to-end: reads source code, captures live screenshots and screen recordings, writes a Docusaurus/markdown article with how-to and use-case content, then verifies it with a read-only verifier.
Ships in cog-second-brain. 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.
Produces one evidence-backed feature article end to end. Capture needs no manual gesture: a bundled recorder grabs frames from the browser through the DevTools protocol. Publishing the docs PR stays a gate for you at CP-6.
Set these once (in a .env file or pass them as arguments). Nothing below is hardcoded.
| Setting | Meaning | Example |
|---|---|---|
APP_URL | Start page of the live app to drive | https://app.example.com/projects/1 |
ISSUE_REPO | Issue tracker holding the feature issues | your-org/your-product |
DOCS_REPO | Local path of the docs repo | ../your-docs |
DOCS_DIR | Folder inside the docs repo for the article | docs/features/ |
EVIDENCE_DIR | Where screenshots and video land | ./evidence/<feature>/ |
Keep the docs repo in a folder your tools can always read. Some operating systems block background reads of the Documents folder mid-session, which breaks the verifier.
Skip it for backend features with no user surface (write a short "no doc required" record instead).
CP-1 spec (issues/repo) -> CP-2 plan (AC-n) -> CP-3 build (capture + write)
-> CP-3v component verify (task-verifier, read-only) -> fix-agent (max 2)
-> CP-5 post-condition -> CP-6 ship gate (you review, then open the docs PR)
The writer never grades its own work. The verifier is a fresh-context, read-only subagent that gets paths and AC-n only, never the writer's narration. See the closed-loop skill for the checkpoint mechanics.
ISSUE_REPO, or a spec path.DOCS_REPO. One article per feature: a new feature gets a new article, a changed one updates the existing article.Read each seed issue (gh issue view <n> --repo $ISSUE_REPO --json title,body,state,labels,milestone, or your tracker's CLI) and any matching spec files. Establish the concrete user surface, the ship status per issue (an OPEN issue is not a shipped surface, so do not claim it), and the exact flow to demo. Never invent UI. Where a detail is unknown, mark it TODO and flag it.
Map the article's sections to AC-n (see Post-conditions). Grep the docs repo for existing coverage to decide between a new article and an update.
Drive the live flow and save real evidence into EVIDENCE_DIR.
Screenshots of each meaningful state, using your browser tool's screenshot call.
A real video of the end-to-end flow with the bundled recorder (no gesture, no ffmpeg needed for the capture):
SR_OUT=$EVIDENCE_DIR/<feature>-demo \
SR_URL=$APP_URL \
SR_FPS=8 \
SR_STEPS='[{"at":0.5,"do":"click_testid","testid":"..."},{"at":2.0,"do":"click_text","text":"..."}]' \
browser-harness < .claude/skills/feature-doc/tools/screenrec.py
screenrec.py runs inside a CDP-based Python harness that exposes the page (browser-harness is one such tool; adapt the launcher to Playwright or your own). It writes frames, <out>.manifest.json (fps, viewport, per-action events with cursor coordinates and captions) and a quick <out>.raw.mp4 preview. Step actions are click_xy|click_testid|click_text|type|key|scroll, each with at (seconds) and an optional caption.
The deliverable is a clean, complete recording of the real workflow: set up, configure, use, get the result. Finish it with tools/recompose.py, which places the real viewport in a simple browser window on a gradient background and speeds up long waits instead of cutting them. No captions, no intro or outro cards, no synthetic cursor.
RC_MANIFEST=<base>.manifest.json RC_OUT=<feature>-walkthrough.mp4 \
RC_SEGMENTS='[[0,9,1],[9,58,8],[58,70,1]]' # [from_s,to_s,speed]; ramp the waits \
RC_ADDR="app.example.com" python3 .claude/skills/feature-doc/tools/recompose.py
recompose.py needs ffmpeg and Pillow. Embed the result with a plain video tag:
<video controls preload="metadata" style="width:100%;border-radius:8px;"><source src="..." type="video/mp4" /></video>.
tools/videokit.py makes a branded, captioned teaser with intro and outro cards. Use it only for marketing teasers, never for walkthroughs.Optional polish: an interactive demo (Arcade or similar). Browsers require a trusted user gesture to start such recorders, so tools/arcade-record.py drives the flow while you press the start and stop shortcut yourself.
Look at every capture. Open the images and the video, name any UI discrepancy, fix the flow, and re-capture. Never pass on "the element exists".
If a flow is gated (a broken backend path, an unshipped surface), capture what works, file the blocker in your tracker, and mark the rest pending. Do not fake a working demo.
Mask any customer data or personal data visible in a capture before it leaves your machine.
Write the article as markdown (MDX-safe when the docs site is Docusaurus) with both layers:
 for images, a video tag for the recording). Cross-link to related articles.no-ai-slop skill before verification.Spawn a task-verifier with only the article path, the evidence directory and the AC-n list. It re-opens the files and media itself and returns one row per AC:
EVIDENCE AC-n | CP-3v | PASS|FAIL | <one line + path/observation>.
On FAIL:fixable, spawn fix-agent (max 2 attempts) with just the failed AC-n, then re-verify. After 2 attempts, escalate with the evidence.
Summarize the article path, the media (with accessible URLs once uploaded), the AC-n PASS table, and open TODOs or gated items. Opening the docs PR waits for the user.
DOCS_DIR with valid frontmatter for your docs site.TODO, not invented. Surfaces from OPEN issues are marked gated, not shipped.ffprobe) and the article embeds it, or (b) screenshots cover the working parts and the article notes the video is pending. A short decorated clip does not satisfy this.http://localhost:9222) and reload it. If the browser prompts for permission, the user clicks Allow.tools/screenrec.py: flow recorder (CDP frame-grab loop to frames, manifest and raw preview).tools/recompose.py: walkthrough finisher. Manifest to a clean 1920x1080 h264 mp4 with a browser window, gradient and speed ramps. Options: RC_FIT=1 fits a phone or tall capture, RC_CROP=x0,y0,x1,y1 crops the source, RC_NOBAR=1 drops the browser bar, RC_SPEED_BADGE=1 labels sped-up segments, RC_REDACT pixelates boxes such as a person's name.tools/videokit.py: branded teaser cut with captions and cards (teaser only).tools/arcade-record.py: hybrid interactive-demo recorder. Set APP_URL and add flows to its FLOWS table.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: skills: Invalid input, repository: Invalid input: expected string, received object
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
49 skills in this plugin
/auto-researchDeep strategic research engine — decomposes questions into parallel research threads, spawns multiple agents, and synthesizes into actionable strategic analysis/best-of-nSelector stage before a verification gate - generate N candidates in parallel, pick the best with a pivot tournament of pairwise judgements, then gate the winner. For high-variance, non-mutating deliverables only/blog-publishWrite and publish a post to your own static blog end to end: content checklist (embedded links, optional TL;DR), per-post ASCII art, an agent-readable markdown twin, deploy, and social distribution. Use when you say "write a blog post", "publish this to my blog", or "push this post to socials".
/braindumpQuick capture of raw thoughts with intelligent domain classification and competitive intelligence extraction/closed-loopRun one task through the V-model verification loop: CP-2 plan → CP-3 build → CP-3v component verify → CP-4 integration verify (full lane) → CP-5 acceptance. The worker never grades its own homework; evidence rows trace back to AC-n. Opt-in: invoke with /closed-loop or by asking for the closed loop, proper verification, or an evidence trail. Ordinary work does not run this.
/comprehensive-analysisDeep-dive 7-day analysis across all data sources for weekly reviews, board prep, and strategic planningOther plugins' skills for the same job