docs-steward
npx skills add https://github.com/wyattowalsh/agents --skill docs-steward
Agent 安装分布
Skill 文档
Docs Steward
Maintain, enhance, and improve the docs site at agents.w4w.dev. The site
uses Astro + Starlight + starlight-theme-black. The wagents CLI generates
MDX content pages from repository assets (skills, agents, MCP servers). This
skill wraps that CLI and extends it with AI-powered enhancement, health
checks, and site improvement capabilities.
When to Invoke
Invoke this skill after any of these events:
- Creating or modifying any
skills/*/SKILL.md - Creating or modifying any
agents/*.md - Creating or modifying any
mcp/*/server.pyormcp/*/pyproject.toml - Running
wagents new skill,wagents new agent, orwagents new mcp - Installing new skills via
npx skills add
Auto-invocation is enabled by default (the disable-model-invocation field is absent, which defaults to false).
When invoked after asset changes, run in auto mode (default). No approval gates, no user prompts. Detect what changed, regenerate, enhance, verify.
Scope
In scope: Documentation site generation, MDX page enhancement, build verification, health checks, site configuration improvements, generation pipeline improvements, Astro component creation, CSS design system updates.
NOT for: Writing new skills (/skill-creator), creating agents (wagents new agent), building MCP servers (/mcp-creator), editing source SKILL.md or agent.md content, or managing the README (wagents readme).
Dispatch
| $ARGUMENTS | Mode | Description |
|---|---|---|
(empty) or auto |
Auto sync + enhance | Detect changes, regenerate, enhance new/changed pages |
sync |
Full sync | Force full regeneration + build verification |
sync installed |
Sync installed | Scan ~/.claude/skills/ for new/removed/changed installed skills, regenerate docs |
enhance |
Enhance all | Improve content quality across all generated pages |
enhance <path> |
Enhance one | Improve a specific page |
maintain |
Health check | Validate links, detect stale/orphans, check build |
improve |
Improve site | Research latest Starlight features, propose + implement improvements |
improve design |
Improve design system | Audit CSS tokens, identify gaps, propose design system upgrades |
improve ux |
Improve UX | Audit component slots, propose islands and interactive features |
improve cli |
Improve pipeline | Analyze and improve docs generation modules |
full |
Full run | Sync, then Maintain, then Enhance, then Improve (sequential) |
Auto Mode (Default)
This is the primary mode. Run it when auto-triggered or when $ARGUMENTS
is empty or auto.
Step 1: Detect Changes
Run these commands to identify changed asset files:
git diff --name-only HEAD
git status --porcelain
Filter results for asset files matching these patterns:
skills/*/SKILL.mdagents/*.mdmcp/*/server.pymcp/*/pyproject.toml
If no asset files changed, report “No asset changes detected” and exit.
Step 2: Regenerate Pages
Run the CLI to regenerate all content pages:
uv run wagents docs generate
This produces MDX files under docs/src/content/docs/ for skills, agents,
and MCP servers based on their source assets.
Step 3: Enhance Changed Pages
For each new or changed page, enhance it. Read the generated MDX and its source asset side by side, then improve:
- Descriptions: Expand truncated or generic descriptions into specific, compelling text that explains what the asset does and when to use it.
- Usage examples: Add clear invocation instructions if missing. For
skills: show the
/skill-namecommand and argument patterns. For agents: show how to spawn or reference them. For MCP servers: show connection config. - Visual elements: Add Starlight components where they improve
comprehension:
Asidecallouts for tips, warnings, and important notesStepsfor sequential instructionsTabsfor configuration variants (different agents, different modes)CardGridwithCardfor related items or feature overviews
- Cross-references: Link to related assets. A skill that uses MCP servers should link to them. An agent with preloaded skills should link to those skills.
- Section structure: Verify heading hierarchy (single h1, logical h2/h3 nesting). Reorganize if needed.
Consult references/quality-checklist.md for scoring criteria and
references/starlight-patterns.md for component usage patterns.
Scaling Strategy
| Pages to enhance | Strategy |
|---|---|
| 1-3 pages | Inline â enhance sequentially in current session |
| 4-12 pages | Subagent wave â 1 subagent per page, parallel |
| 13+ pages | Batched waves â 5 pages per subagent, 2-3 sequential waves |
Each subagent receives: the current MDX content, the source SKILL.md or agent.md, the quality checklist, and the Starlight patterns reference.
Step 4: Verify Build
Run the docs build to confirm nothing is broken:
cd docs && pnpm build
If the build fails, diagnose the error, fix it, and rebuild.
Step 5: Validate Assets
Run the wagents validator to confirm all assets are still valid:
uv run wagents validate
Fix any validation errors before finishing.
Sync Mode
Force a full regeneration and build verification, regardless of what changed.
- Run
uv run wagents docs generate - Run
cd docs && pnpm build - Report: number of pages generated, build status, any warnings
No enhancement in this mode. Use it to reset the generated pages to CLI baseline.
Sync Installed Mode
When $ARGUMENTS is sync installed:
Scan ~/.claude/skills/ for installed skills not already in the repo’s
skills/ directory. The wagents docs generate command handles this
automatically via --include-installed (enabled by default).
- Run
uv run wagents docs generate(includes installed skill scanning) - For installed skills with sparse descriptions (<50 tokens), spawn a subagent to read the full SKILL.md and write a richer description for the docs page
- Run
pnpm --dir docs buildto verify - Report: number of installed skills found, new/removed since last sync
Run this mode after installing new skills via npx skills add.
Enhance Mode
Enhance All
When $ARGUMENTS is enhance with no path:
- List all generated MDX files under
docs/src/content/docs/ - For each page, score it against all 9 dimensions in
references/quality-checklist.md - Spawn parallel subagents (Pattern A from orchestration guide), one per page or batch of 3-5 related pages
- Each subagent receives:
- The current MDX content
- The corresponding source asset (SKILL.md, agent.md, or MCP files)
- The quality checklist
- The Starlight patterns reference
- Each subagent enhances the page and writes the result
- After all subagents complete, run
cd docs && pnpm buildto verify - Run
uv run wagents validate
Enhance One
When $ARGUMENTS is enhance <path>:
- Read the specified MDX file
- Locate its source asset
- Score against all 9 dimensions in quality checklist
- Enhance in-place
- Verify build and validate
Maintain Mode
Run a comprehensive health check on the documentation site.
Step 1: Build Check
cd docs && pnpm build
Capture output. Look for broken link warnings, missing image errors, build failures.
Step 2: Staleness Detection
Compare generated MDX page modification times against source asset modification times. Flag pages that are older than their source (the CLI was not re-run after the asset changed).
# Example: compare skills
for skill_dir in skills/*/; do
skill_name=$(basename "$skill_dir")
source="$skill_dir/SKILL.md"
generated="docs/src/content/docs/skills/$skill_name.mdx"
# Compare mtimes
done
Step 3: Orphan Detection
Find generated pages whose source assets no longer exist. These are
orphans left behind when an asset was deleted but wagents docs generate
was not re-run.
Step 4: Validation
uv run wagents validate
uv run wagents readme --check
Step 5: Report
Present findings grouped by severity:
- Critical: Build failures, broken links to external resources
- Warning: Stale pages, orphaned pages, validation errors
- Info: README out of date, minor inconsistencies
Offer to fix each category. Apply fixes in parallel where possible.
Improve Mode
Improve Site
When $ARGUMENTS is improve:
- Research latest Starlight docs via Context7 or web search for new features, components, or best practices
- Audit the site configuration:
docs/astro.config.mjsâ plugins, integrations, sidebar configdocs/src/styles/custom.cssâ theming, visual polishdocs/src/content/docs/index.mdxâ landing page
- Propose improvements grouped by category:
- New pages: Missing content that should exist
- Navigation: Sidebar structure, grouping, ordering
- Visual: Theme enhancements, component usage, layout
- SEO: Meta descriptions, OpenGraph, structured data
- Performance: Image optimization, build config
- Ask the user before implementing â present proposals with effort estimates and let the user choose what to implement
- Implement approved improvements
Improve Design
When $ARGUMENTS is improve design:
- Read
docs/src/styles/custom.cssandreferences/site-architecture.md - Check design system maturity against the checklist in
references/advanced-patterns.md - Identify missing tokens (spacing, shadows, radius, motion, z-index)
- Propose additions with before/after visual impact
- Ask the user before implementing
Improve UX
When $ARGUMENTS is improve ux:
- Read component overrides in
docs/src/components/starlight/ - Check unused Starlight slots from
references/site-architecture.md - Evaluate which interactive islands would have highest impact
- Propose 3-5 improvements ranked by effort vs. impact
- Ask the user before implementing
Improve Pipeline
When $ARGUMENTS is improve cli:
- Read the documentation generation modules:
wagents/docs.pyâ index pages, sidebar, CLI page, docs subcommandswagents/rendering.pyâ MDX page renderers (skill, agent, MCP)wagents/parsing.pyâ frontmatter parsing, text transforms, MDX escapingwagents/catalog.pyâ asset collection, node/edge data model
- Identify gaps in the generation pipeline
- Ask the user before implementing
- Implement, regenerate, verify build
Full Mode
Execute all modes in sequence:
- Sync:
uv run wagents docs generate - Maintain: Full health check, fix critical issues
- Enhance: Score and improve all pages (parallel subagents)
- Improve: Research and propose site improvements (ask first)
Reference Files
| File | Content | When to Read |
|---|---|---|
| references/quality-checklist.md | 9-dimension page scoring rubric, enhancement patterns with before/after examples | Scoring or enhancing pages |
| references/starlight-patterns.md | 10+ Starlight component patterns with import conventions and escape rules | Adding components to MDX |
| references/site-architecture.md | Design system tokens, Astro component slots, plugin config, island patterns | Improve Site or Improve Design mode |
| references/advanced-patterns.md | Interactive islands, marketplace UX, content collections, performance optimization | Improve Site or Improve UX mode |
Read these before enhancement work. They define the quality bar and component patterns to follow.
Critical Rules
- Never delete pages generated by
wagents docs generateâ only enhance them - Always run
uv run wagents validateafter any changes to asset files - Always run
cd docs && pnpm buildto verify the build after changes - Never modify CLI-generated frontmatter (title, description) during enhancement
- Always import Starlight components at top of MDX files before use
- Never introduce raw JSX that breaks MDX parsing â escape
{,<,>in prose - Always read references before enhancement work
- Never assign the same file to multiple parallel subagents
- Always revert enhancements that break the build, then rebuild
- Never add fabricated or speculative content â enhance from source asset only
- Always call
wagents docs generateas foundation â never bypass the CLI - Never implement
improveorimprove clichanges without user approval
Canonical terms (use these exactly throughout):
- Modes: “Auto”, “Sync”, “Sync Installed”, “Enhance All”, “Enhance One”, “Maintain”, “Improve Site”, “Improve Design”, “Improve UX”, “Improve Pipeline”, “Full”
- Enhancement dimensions: “description”, “usage examples”, “visual elements”, “cross-references”, “structure”, “interactivity”, “external links”, “agent compatibility”
- Severity levels: “Critical”, “Warning”, “Info”
- Page types: “skill page”, “agent page”, “MCP page”, “index page”, “landing page”, “CLI page”, “guide page”
- Pipeline modules:
wagents/docs.py,wagents/rendering.py,wagents/parsing.py,wagents/catalog.py - Site layers: “generated content” (MDX pages), “design system” (CSS), “components” (Astro overrides), “islands” (interactive client-side), “plugins” (Starlight ecosystem)