repo-website-api-create
Creates and updates API reference documentation files for the Valibot project website.
Install
mkdir -p .claude/skills/repo-website-api-create && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2627" && unzip -o skill.zip -d .claude/skills/repo-website-api-create && rm skill.zipInstalls to .claude/skills/repo-website-api-create
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Create new API reference pages for the Valibot website at website/src/routes/api/. Use when adding documentation for new schemas, actions, methods, or types. Covers reading source code, creating properties.ts and index.mdx files, updating menu.md, and cross-referencing related APIs.Key capabilities
- →Generate API reference pages for Valibot
- →Create properties.ts and index.mdx files
- →Update navigation menu and cross-references
- →Document schemas, actions, methods, and types
How it works
The skill parses source code to extract type definitions and JSDoc, then populates standardized MDX templates and updates site navigation.
Inputs & outputs
When to use repo-website-api-create
- →Create API docs for new schemas
- →Update documentation for modified methods
- →Document custom types and actions
- →Sync codebase exports with website docs
About this skill
Adding API Documentation to Website
Guide for creating new API reference pages at website/src/routes/api/.
Process Overview
- Read source code in
/library/src/ - Create folder in
/website/src/routes/api/(category)/[name]/ - Create
properties.tswith type definitions - Create
index.mdxwith documentation - Update
menu.md - Create type documentation if needed (Issue, Schema/Action interfaces)
File Structure
website/src/routes/api/
├── (schemas)/string/
│ ├── index.mdx # Documentation content
│ └── properties.ts # Type definitions for Property component
├── (actions)/email/
├── (methods)/parse/
├── (types)/StringSchema/
└── menu.md # Navigation (alphabetical order)
Categories: (schemas), (actions), (methods), (types), (utils), (async), (storages)
Reading Source Code
What to Extract
From /library/src/schemas/string/string.ts:
// 1. Issue interface → Document in (types)/StringIssue/
export interface StringIssue extends BaseIssue<unknown> { ... }
// 2. Schema interface → Document in (types)/StringSchema/
export interface StringSchema<TMessage extends ErrorMessage<StringIssue> | undefined>
extends BaseSchema<string, string, StringIssue> { ... }
// 3. Function overloads → Main documentation
export function string(): StringSchema<undefined>;
export function string<const TMessage>(message: TMessage): StringSchema<TMessage>;
// 4. JSDoc → Description, hints, parameter docs
/**
* Creates a string schema.
*
* Hint: This is an example hint.
*
* @param message The error message.
*
* @returns A string schema.
*/
JSDoc hints become blockquotes in the Explanation section:
> This is an example hint.
Extract for properties.ts
- Generic parameters and constraints (e.g.,
TMessage extends ErrorMessage<...> | undefined) - Function parameters and types
- Return type
properties.ts
Import and define properties matching source code:
import type { PropertyProps } from '~/components';
export const properties: Record<string, PropertyProps> = {
// Generics (use modifier: 'extends')
TMessage: {
modifier: 'extends',
type: {
type: 'union',
options: [
{
type: 'custom',
name: 'ErrorMessage',
href: '../ErrorMessage/',
generics: [
{ type: 'custom', name: 'StringIssue', href: '../StringIssue/' },
],
},
'undefined',
],
},
},
// Parameters (reference generic or direct type)
message: {
type: { type: 'custom', name: 'TMessage' },
},
// Return type
Schema: {
type: {
type: 'custom',
name: 'StringSchema',
href: '../StringSchema/',
generics: [{ type: 'custom', name: 'TMessage' }],
},
},
};
Optional Object Keys
For optional object keys from TypeScript source such as key?: string, do not append ? to the property name in properties.ts.
Use the plain key name and represent optionality in the value type with undefined as the last union option:
payload: {
type: {
type: 'object',
entries: [
{
key: 'key',
value: {
type: 'union',
options: ['string', 'undefined'],
},
},
],
},
},
DefinitionData Types
| Type | Syntax |
|---|---|
| Primitive | 'string', 'number', 'boolean', 'unknown', etc. |
| Literal string | { type: 'string', value: 'email' } |
| Literal number | { type: 'number', value: 5 } |
| Custom/Named | { type: 'custom', name: 'TypeName', href: '../TypeName/', generics: [...] } |
| Custom+modifier | { type: 'custom', modifier: 'typeof', name: 'string', href: '../string/' } |
| Union | { type: 'union', options: [type1, type2] } |
| Intersect | { type: 'intersect', options: [type1, type2] } |
| Array | { type: 'array', item: elementType } |
| Tuple | { type: 'tuple', items: [type1, type2] } |
| Object | { type: 'object', entries: [{ key: 'name', value: type }] } |
| Function | { type: 'function', params: [{ name: 'x', type: t }], return: retType } |
| Template | { type: 'template', parts: [{ type: 'string', value: '>=' }, otherType] } |
index.mdx Template
---
title: functionName
description: One-line description from JSDoc.
source: /schemas/string/string.ts
contributors:
- github-username
---
import { ApiList, Property } from '~/components';
import { properties } from './properties';
# functionName
Creates a string schema.
\`\`\`ts
const Schema = v.functionName<TMessage>(message);
\`\`\`
## Generics
- \`TMessage\` <Property {...properties.TMessage} />
## Parameters
- \`message\` <Property {...properties.message} />
### Explanation
With \`functionName\` you can validate... If the input does not match, you can use \`message\` to customize the error message.
## Returns
- \`Schema\` <Property {...properties.Schema} />
## Examples
The following examples show how \`functionName\` can be used.
### Email schema
Schema to validate an email.
\`\`\`ts
const EmailSchema = v.pipe(
v.string(),
v.nonEmpty('Please enter your email.'),
v.email('The email is badly formatted.')
);
\`\`\`
## Related
The following APIs can be combined with \`functionName\`.
### Schemas
<ApiList items={['array', 'object', 'string']} />
### Methods
<ApiList items={['parse', 'pipe', 'safeParse']} />
### Actions
<ApiList items={['email', 'minLength']} />
### Utils
<ApiList items={['isOfKind', 'isOfType']} />
Related section order: Schemas → Methods → Actions → Utils (omit empty sections)
Key Conventions
Naming
- Schema variables:
PascalCase+Schemasuffix:EmailSchema,UserSchema - Action variables:
PascalCase+Action:MinLengthAction - Parse output:
outputor descriptive name
Examples
- Always include error messages for validation actions
- Progress from simple to complex
- Use realistic, practical scenarios
- Start with
import * as v from 'valibot';pattern
Error Messages
Use friendly, actionable messages:
- ✅ "Your password is too short."
- ✅ "Please enter your email."
- ❌ "Invalid" or "Error"
Links
- Use
href: '../TypeName/'for type references (with trailing slash) - Use
<Link href="/api/parse/">\parse`</Link>in MDX prose (import from~/components`) - Link to related guides when relevant:
<Link href="/guides/objects/">object guide</Link>
Update Related Files
menu.md
Add alphabetically to /website/src/routes/api/menu.md:
## Schemas
- [any](/api/any/)
- [newSchema](/api/newSchema/) ← Add here
- [string](/api/string/)
Related Sections of Other API Docs
Existing API pages have a ## Related section with <ApiList> components. When adding a new API, update related APIs to include the new one.
Rule: An API is "related" if:
- It makes sense to use it as an argument of the other API, or vice versa
- It makes sense to use them together in the same
pipe(e.g.,v.pipe(v.string(), v.email())→stringandemailare related)
Examples:
stringschema listsemailaction because they work together in a pipeemailaction listsstringschema because it validates string inputpipemethod lists all schemas because any schema can be pipedminLengthaction listsstring,array,tuplebecause it validates their length
Process:
- Review a few existing API docs in the same category to understand the pattern
- Check
menu.mdto identify potentially related APIs - For each related API, edit its
index.mdxand add the new API to the appropriate<ApiList>
Shortcut: If your new API is very similar to an existing one (e.g., guard is similar to check), add it everywhere the similar API appears. This ensures consistent coverage across all related docs.
Concept Guides
Add the new API to the appropriate guide in /website/src/routes/guides/:
| API Category | Guide to Update |
|---|---|
| Schema | (main-concepts)/schemas/index.mdx |
| Action | (main-concepts)/pipelines/index.mdx |
| Method | (main-concepts)/methods/index.mdx |
Also update topic-specific guides if relevant (e.g., (schemas)/objects/, (schemas)/arrays/, (advanced)/async/).
Type Documentation
Create pages for new types in (types)/:
- Issue interfaces (e.g.,
StringIssue) - Schema/Action interfaces (e.g.,
StringSchema)
Type pages differ from function docs:
- No
sourcefield in frontmatter - No Examples or Related sections
- Use
## Definitioninstead of## Returns
Type page structure:
---
title: StringSchema
description: String schema interface.
contributors:
- github-username
---
import { Property } from '~/components';
import { properties } from './properties';
# StringSchema
String schema interface.
## Generics
- \`TMessage\` <Property {...properties.TMessage} />
## Definition
- \`StringSchema\` <Property {...properties.BaseSchema} />
- \`type\` <Property {...properties.type} />
- \`reference\` <Property {...properties.reference} />
- \`expects\` <Property {...properties.expects} />
- \`message\` <Property {...properties.message} />
Checklist
- Read source file completely
-
properties.tsmatches source types exactly -
index.mdxsignature matches source - All generics documented
Content truncated.
When not to use it
- →When the source code is not available in /library/src/
- →When the target category does not exist
Prerequisites
Limitations
- →Requires manual updates to related API lists
- →Must follow strict file naming and structure conventions
How it compares
It automates the synchronization of API documentation with source code changes instead of manually updating reference files.
Compared to similar skills
repo-website-api-create side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| repo-website-api-create (this skill) | 2 | 5mo | No flags | Intermediate |
| ml-paper-writing | 48 | 6mo | Review | Advanced |
| docs-review | 10 | 7mo | No flags | Beginner |
| claude-md-improver | 21 | 6mo | Review | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by open-circle
View all by open-circle →You might also like
ml-paper-writing
davila7
Write publication-ready ML/AI papers for NeurIPS, ICML, ICLR, ACL, AAAI, COLM. Use when drafting papers from research repos, structuring arguments, verifying citations, or preparing camera-ready submissions. Includes LaTeX templates, reviewer guidelines, and citation verification workflows.
docs-review
metabase
Review documentation changes for compliance with the Metabase writing style guide. Use when reviewing pull requests, files, or diffs containing documentation markdown files.
claude-md-improver
anthropics
Audit and improve CLAUDE.md files in repositories. Use when user asks to check, audit, update, improve, or fix CLAUDE.md files. Scans for all CLAUDE.md files, evaluates quality against templates, outputs quality report, then makes targeted updates. Also use when the user mentions "CLAUDE.md maintenance" or "project memory optimization".
write-docs
tldraw
Writing SDK documentation for tldraw. Use when creating new documentation articles, updating existing docs, or when documentation writing guidance is needed. Applies to docs in apps/docs/content/.
update-docs
vercel
This skill should be used when the user asks to "update documentation for my changes", "check docs for this PR", "what docs need updating", "sync docs with code", "scaffold docs for this feature", "document this feature", "review docs completeness", "add docs for this change", "what documentation is affected", "docs impact", or mentions "docs/", "docs/01-app", "docs/02-pages", "MDX", "documentation update", "API reference", ".mdx files". Provides guided workflow for updating Next.js documentation based on code changes.
wiki-architect
microsoft
Analyzes code repositories and generates hierarchical documentation structures with onboarding guides. Use when the user wants to create a wiki, generate documentation, map a codebase structure, or understand a project's architecture at a high level.