VitePress Documentation Skill (Hard Policy)
Purpose
Use this skill when editing VitePress docs in this repository.
This skill is not optional guidance. It defines required workflow, required page templates, and completion gates.
Trigger conditions
Use this skill when the user asks to:
- rewrite docs
- add/update API docs
- improve docs structure or navigation
- review docs quality/consistency
- update VitePress config or docs build behavior
Source-of-truth files
Always inspect these first:
.vitepress/config.mtsdocs/README.mdsrc/Result.phpsrc/Support/(for behavior details not obvious at API surface)package.json(docs scripts)
Mandatory workflow
Follow all steps in order.
- Discovery pass
- Inventory all docs pages and current nav/sidebar.
- Inventory all public API methods from
src/Result.php. - Identify broken/inconsistent naming between docs and API.
- IA impact check
- Determine whether request is content-only, nav-only, or full IA rewrite.
- If IA changes, produce explicit old->new page mapping in notes.
- Contract extraction
- For every public method, extract:
- callback contract
- success behavior
- failure behavior
- exception behavior
- metadata behavior
- Draft/rewrite with required templates
- Use the required templates in this skill (below).
- Keep examples minimal, executable, and type-safe.
- Use plain PHP examples first; framework examples second.
- Cross-linking pass
- Add related links between guide pages and API sections.
- Ensure each major guide links to API and at least one example.
- Consistency pass
- Normalize method naming, headings, and terminology.
- Verify decision tables use same method names as API.
- Validation gates
- Run docs build.
- Resolve broken links and missing pages.
- Verify coverage map for public methods.
Required templates
Guide page template
Each guide page must include:
What this page is forWhen to use this- Core concepts with at least one code example
Choose X vs Ytable if methods are easily confusedRelated pages
API method template
Each method section must include:
- Method name/signature line
- Contract
- Behavior details (success/failure/exception/metadata as applicable)
- At least one concise example
- Link to one guide page
Example page template
Each example page must include:
- Context/problem statement
- Complete snippet
- Expected result shape or branch outcome
- Link to relevant API and guide pages
Hard completion gates
Do not mark docs work complete unless all are true:
- No broken local links in VitePress build output.
- Every public method from
src/Result.phpis documented in API reference. - Core guide pages include required decision tables.
- Plain PHP examples exist for major method groups.
.vitepress/config.mtsnav/sidebar reflects actual page set.README.mddocs links align with current IA.
Reporting format
When finished, report:
- Changed files list
- API coverage map:
method -> doc section - Validation results (
docs:build, plus any relevant checks) - Remaining risks or intentional tradeoffs
Command policy
Allowed without extra approval:
- file reads/searches
pnpm run docs:build
Ask before running:
pnpm installpnpm run docs:dev
Style policy
- Prefer short paragraphs and explicit bullet behavior rules.
- Avoid ambiguous terms like "handles it" without branch details.
- Keep examples deterministic and environment-light.
- Preserve ASCII unless file already requires Unicode.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.