End-to-end Claude Code skill for writing, screenshotting, and publishing KB articles — built for SaaS and WordPress plugin teams.
A set of Claude Code skills that give Claude a complete documentation pipeline: plan article structure → capture real screenshots with Playwright → write production-ready HTML → publish as a draft to your knowledge base.
Built by ThemeXpert.
- Plans the screenshot list before writing a single line
- Captures real screenshots from your local/staging admin using Playwright
- Validates screenshot quality (detects blank/unrendered pages)
- Writes clean, structured HTML following strict doc conventions
- Publishes a draft to your KB platform via API
- Audits the whole backlog for broken structure, missing images, and placeholder content
No lorem ipsum. No fake screenshots. No publishing without human review.
| Skill | What it does | When to invoke |
|---|---|---|
doc-write |
Full pipeline: plan → screenshot → write → publish | Writing a new article |
docs-thrivedesk |
ThriveDesk Docs platform adapter (auth, upload, create, update) | Publishing to ThriveDesk |
doc-audit |
Quality gate: checks all articles for structure, image size, alt text, placeholders | Pre-publish review |
- Claude Code (CLI or IDE extension)
- Node.js 18+ and npm (for Playwright screenshots)
- Python 3 (stdlib only — for the publish script)
- A local or staging WordPress/SaaS admin to screenshot
- A KB platform account (ThriveDesk, or adapt to your platform)
# Copy to your global Claude skills directory
cp -r .claude/skills/doc-write ~/.claude/skills/
cp -r .claude/skills/docs-thrivedesk ~/.claude/skills/
cp -r .claude/skills/doc-audit ~/.claude/skills/Or copy only the skills you need.
npm install playwright
npx playwright install chromiumcp examples/.env.local.example .env.local
# Edit .env.local with your ThriveDesk credentialsmkdir -p research/site-docs
cp examples/00-doc-list.md research/site-docs/
# Edit 00-doc-list.md with your real article listOpen Claude Code in your project and say:
write a doc for the payment settings screen
Claude will load the doc-write skill and walk you through the full pipeline.
After setup, your project will have:
.env.local ← credentials (never commit)
research/
site-docs/
00-doc-list.md ← article backlog
docs/
articles/
{slug}.html ← article source HTML
screenshots/
{slug}/
01-dashboard.png
02-settings.png
scripts/
take-screenshots.js ← Playwright capture script (from scripts/)
publish.py ← ThriveDesk publish script (from scripts/)
Edit scripts/take-screenshots.js and set:
const ADMIN_URL = 'http://your-site.test';
const ADMIN_USER = 'admin';
const ADMIN_PASS = 'your-dev-password';
const ARTICLE_SLUG = 'your-article-slug';Then add your screens to the SCREENS array:
const SCREENS = [
{
file: '01-dashboard.png',
url: `${ADMIN_URL}/wp-admin/admin.php?page=your-plugin`,
type: 'spa', // 'spa' or 'php'
selector: '.your-app-selector',
},
{
file: '02-settings.png',
url: `${ADMIN_URL}/wp-admin/admin.php?page=your-plugin-settings&tab=general`,
type: 'php',
},
];Run it:
node scripts/take-screenshots.jsWordPress plugin admin pages come in two types. The script handles both:
| Type | How to spot it | Wait strategy |
|---|---|---|
| React SPA | page=your-plugin — JS-rendered, blank until hydrated |
waitForSelector('.your-selector', { timeout: 15000 }) |
| Classic PHP | page=plugin-settings&tab=X — renders synchronously |
waitForTimeout(1500) |
Screenshot size check: >100KB = good. ~22KB = SPA didn't mount — increase wait time or use a more specific selector.
Configure scripts/publish.py:
USER_ID = 'your-user-uuid' # from your ThriveDesk profile URL
CATEGORY_ID = 'your-category-uuid' # from the category admin URL
ARTICLE_TITLE = 'Your Article Title'
ARTICLE_SLUG = 'your-article-slug'Run:
python3 scripts/publish.pyThe script creates a draft, uploads all screenshots, and updates the article with the final HTML. Status is always Draft — a human reviews and publishes.
The doc-write skill is platform-agnostic. The ThriveDesk-specific code lives only in docs-thrivedesk/ and scripts/publish.py. To support another platform:
- Create a new adapter skill in
.claude/skills/docs-your-platform/ - Implement the same 3-step pattern: create → upload → update
- Reference your new adapter skill from
doc-writePhase 4
Articles are HTML fragments (no <html>/<head>/<body> wrapper):
<h1>Article Title</h1>
<p>What the reader will accomplish.</p>
<h2>Step 1 — Do Something</h2>
<p>Navigate to <strong>Settings → General</strong>.</p>
<figure style="margin:1.5em 0">
<img src="https://cdn.example.com/screenshot.png"
alt="Screenshot showing the Settings page"
style="max-width:100%;border-radius:6px;border:1px solid #e5e7eb;">
<figcaption style="font-size:.875em;color:#6b7280;margin-top:.5em">
Caption describing the screenshot.
</figcaption>
</figure>See doc-write/templates/article-template.html for the full template.
run the doc audit
Claude loads doc-audit and checks every article for:
- All backlog items have HTML files
- No
PLACEHOLDER_cdn_urlremaining in drafted articles - Screenshot files are >100KB (real renders, not blank pages)
- Every
<img>has alt text - Each article has exactly one
<h1> - No inline credentials or lorem ipsum
MIT — see LICENSE.
See CONTRIBUTING.md.
Issues and PRs welcome at github.com/themexpert/claude-doc-writing-skill.
Built by ThemeXpert