Skip to content

About

End-to-end Claude Code skill for writing, screenshotting, and publishing KB articles — for SaaS and WordPress plugin teams

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Claude Doc Writing Skill

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.


What it does

  1. Plans the screenshot list before writing a single line
  2. Captures real screenshots from your local/staging admin using Playwright
  3. Validates screenshot quality (detects blank/unrendered pages)
  4. Writes clean, structured HTML following strict doc conventions
  5. Publishes a draft to your KB platform via API
  6. Audits the whole backlog for broken structure, missing images, and placeholder content

No lorem ipsum. No fake screenshots. No publishing without human review.


Skills included

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

Requirements

  • 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)

Quick start

1. Install the skills

# 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.

2. Install Playwright

npm install playwright
npx playwright install chromium

3. Set up credentials (ThriveDesk)

cp examples/.env.local.example .env.local
# Edit .env.local with your ThriveDesk credentials

4. Set up your article backlog

mkdir -p research/site-docs
cp examples/00-doc-list.md research/site-docs/
# Edit 00-doc-list.md with your real article list

5. Start Claude Code and invoke the skill

Open 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.


Project structure

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/)

Configuring the screenshot script

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.js

SPA vs PHP pages

WordPress 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.


Publishing to ThriveDesk

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.py

The script creates a draft, uploads all screenshots, and updates the article with the final HTML. Status is always Draft — a human reviews and publishes.


Adapting to a different KB platform

The doc-write skill is platform-agnostic. The ThriveDesk-specific code lives only in docs-thrivedesk/ and scripts/publish.py. To support another platform:

  1. Create a new adapter skill in .claude/skills/docs-your-platform/
  2. Implement the same 3-step pattern: create → upload → update
  3. Reference your new adapter skill from doc-write Phase 4

Article HTML conventions

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.


Running the audit

run the doc audit

Claude loads doc-audit and checks every article for:

  • All backlog items have HTML files
  • No PLACEHOLDER_cdn_url remaining 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

License

MIT — see LICENSE.


Contributing

See CONTRIBUTING.md.

Issues and PRs welcome at github.com/themexpert/claude-doc-writing-skill.


Built by ThemeXpert

About

End-to-end Claude Code skill for writing, screenshotting, and publishing KB articles — for SaaS and WordPress plugin teams

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages