agentleFS
BorjablmBorjablm/claude-skills/wordpress-publish/SKILL.md

wordpress-publish

Skill2 starsChanged 6 months agoMITView on GitHub

Publish articles to a WordPress site via the REST API. Multi-site (azvai, quecafe, ecomm, ai-tutor, notegpt). Creates posts as drafts or published, uploads featured images, sets categories/tags. Use when the user asks to publish, push, upload, or send an article to WordPress. Natural follow-up to research-writing-assistant Stage 5.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 1 is distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run python scripts/publish.py list-sites to see what's set up.

    line 17
  2. Very specific:

    Ask if any of these are missing: target site (slug), title, status (draft or publish, default draft), featured image (optional path), …

    line 28
  3. Very specific:

    If the working dir is from research-writing-assistant, infer the site from brief.json.brand_profile (which equals the brand slug, which …

    line 30
  4. Very specific:

    Resolve site: Run scripts/publish.py list-sites if unclear.

    line 34
  5. Very specific:

    Resolve source: If directory: read article.html as content, pick title from titles.md (the one marked recommended — ask if ambiguous), read …

    line 35
  6. Very specific:

    Create post: Run scripts/publish.py --site <slug> create with the resolved inputs.

    line 39
  7. Very specific:

    If the user asks to update a post they previously published, use scripts/publish.py --site <slug> update --id <post_id> with whichever …

    line 44
  8. Very specific:

    Default to draft: Only --status publish when the user explicitly says "publish live" / "publish it" / "go live".

    line 49
  9. Very specific:

    Strip <html>/<head>/<body> wrappers: if present before sending — WP expects a content fragment (see …

    line 51
  10. Very specific:

    Preserve the <style> block: if the article uses per-article CSS mode.

    line 52
  11. Very specific:

    All commands below read credentials from the project .env file.

    line 56
  12. Distinctive:

    All commands exit non-zero on API error and print the WP error body to stderr.

    line 83
  13. Very specific:

    Add three lines to .env:

    line 88

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

WordPress Publish

You publish articles to a configured WordPress site using the REST API. Multi-site setup — pick the target site with --site <slug> on every call.

Configured sites

Run python scripts/publish.py list-sites to see what's set up. Each site is identified by a lowercase slug (e.g. azvai, quecafe, ecomm). Slug is derived from the env vars WP_<UPPERCASE_SLUG>_URL, _USER, _APP_PASSWORD.

The research-writing-assistant brand profile slug should match the site slug (so azvai brand → --site azvai). For ecomm.design the convention is ecomm.

Inputs

The user points you at an article. Typically one of:

  • A directory from research-writing-assistant containing article.html + meta.json + titles.md
  • A single HTML or Markdown file
  • An explicit title + body

Ask if any of these are missing: target site (slug), title, status (draft or publish, default draft), featured image (optional path), categories/tags (optional names).

If the working dir is from research-writing-assistant, infer the site from brief.json.brand_profile (which equals the brand slug, which equals the site slug). Confirm with the user before publishing.

Workflow

  1. Resolve site. Run scripts/publish.py list-sites if unclear. Confirm slug with user.
  2. Resolve source. If directory: read article.html as content, pick title from titles.md (the one marked recommended — ask if ambiguous), read meta description from meta.json.
  3. Confirm. Show the user: site URL, title, status, featured image (if any), categories, tags. Wait for approval.
  4. Upload featured image (if provided): run scripts/publish.py --site <slug> upload-media --file <path>. Capture the returned media ID.
  5. Resolve taxonomy IDs (if category/tag names given): run scripts/publish.py --site <slug> resolve-terms --categories "A,B" --tags "X,Y". Script creates any missing terms.
  6. Create post. Run scripts/publish.py --site <slug> create with the resolved inputs. Script writes the response to stdout as JSON.
  7. Report back. Show the user the post ID, edit URL ({site_url}/wp-admin/post.php?post=<id>&action=edit) and preview URL.

Updating an existing post

If the user asks to update a post they previously published, use scripts/publish.py --site <slug> update --id <post_id> with whichever fields changed. Do not re-upload media unless the image itself changed.

Rules

  • Always pass --site. The legacy single-site fallback (WP_URL/WP_USER/WP_APP_PASSWORD without prefix) still works for backwards compat, but for multi-site setups always pass an explicit slug to avoid publishing to the wrong site.
  • Default to draft. Only --status publish when the user explicitly says "publish live" / "publish it" / "go live".
  • Never publish without showing the user the final title + meta description first.
  • Strip <html>/<head>/<body> wrappers if present before sending — WP expects a content fragment (see research-writing-assistant/references/wordpress-output.md).
  • Preserve the <style> block if the article uses per-article CSS mode.

Script reference

All commands below read credentials from the project .env file. The --site flag goes BEFORE the subcommand.

# Discover what's configured
python scripts/publish.py list-sites

# Per-site operations
python scripts/publish.py --site azvai create \
  --title "Post title" \
  --content-file path/to/article.html \
  --status draft \
  --excerpt "Meta description here" \
  --slug "post-slug" \
  --featured-media 123 \
  --categories 5,12 \
  --tags 7,8

python scripts/publish.py --site ecomm update --id 456 --status publish

python scripts/publish.py --site quecafe upload-media --file path/to/image.jpg --alt "Alt text"

python scripts/publish.py --site azvai resolve-terms --categories "SEO,Guides" --tags "beginner"

python scripts/publish.py --site ecomm list --per-page 10
python scripts/publish.py --site azvai get --id 456

All commands exit non-zero on API error and print the WP error body to stderr.

Adding a new site

  1. Generate a WordPress Application Password: Users → Profile → Application Passwords on the WP admin
  2. Add three lines to .env:
    WP_<SLUG>_URL=https://example.com
    WP_<SLUG>_USER=username
    WP_<SLUG>_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx
  3. Confirm with python scripts/publish.py list-sites
  4. (If the article-images skill needs it) create a matching brand profile in .claude/skills/article-images/brands/<slug>.json

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.