Skip to content

Commit 13f449a

Browse files
Merge pull request #1401 from open-circle/prompts-to-agent-skills
Convert prompts folder to agent skills standard
2 parents abe3001 + d3b59e9 commit 13f449a

File tree

8 files changed

+51
-40
lines changed

8 files changed

+51
-40
lines changed
Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ pnpm -C website dev # Start docs site
3333
- **JSDoc required** on exported functions (first overload only for overload sets)
3434
- **`// @__NO_SIDE_EFFECTS__`** before pure factory functions for tree-shaking
3535

36+
## Other Rules
37+
38+
- **Source code is the single source of truth.** All documentation must match `/library/src/`.
39+
3640
## Library Architecture
3741

3842
Schemas, actions, and methods are plain objects with a `'~run'` method:
@@ -48,17 +52,8 @@ library/src/
4852

4953
Each has its own folder: `name.ts`, `name.test.ts`, `name.test-d.ts`, `index.ts`.
5054

51-
## Detailed Guides
52-
53-
**Before performing any task listed below, OPEN and READ the corresponding guide file.**
55+
## Agent Skills
5456

55-
| Task | Guide (read before starting) |
56-
| ----------------------------- | --------------------------------------------------------------------------------- |
57-
| Navigate repo, find files | [prompts/repository-structure.md](../prompts/repository-structure.md) |
58-
| Write JSDoc / inline comments | [prompts/document-source-code.md](../prompts/document-source-code.md) |
59-
| Review PRs and source changes | [prompts/review-source-code-changes.md](../prompts/review-source-code-changes.md) |
60-
| Add new API page to website | [prompts/add-new-api-to-website.md](../prompts/add-new-api-to-website.md) |
61-
| Update existing API docs | [prompts/update-api-on-website.md](../prompts/update-api-on-website.md) |
62-
| Add guide/tutorial to website | [prompts/add-new-guide-to-website.md](../prompts/add-new-guide-to-website.md) |
57+
This repository includes agent skills in `/skills/` following the [Agent Skills](https://agentskills.io) open standard.
6358

64-
**Source code is the single source of truth.** All documentation must match `/library/src/`.
59+
**Naming:** Skills prefixed with `repo-` are local repository skills

prompts/index.md

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
name: repo-source-code-document
3+
description: Write JSDoc comments and inline documentation for Valibot library source code in /library/src/. Use when documenting schemas, actions, methods, or utilities. Covers interface documentation, function overloads, purity annotations, inline comment patterns, and terminology consistency.
4+
---
5+
16
# Valibot Source Code Documentation
27

38
Documentation patterns for library source code in `/library/src/`.
@@ -82,10 +87,11 @@ Add hints after the main description, before `@param`:
8287

8388
Link to external resources when relevant using markdown format:
8489

85-
````typescript
90+
```typescript
8691
/**
8792
* Creates an [email](https://en.wikipedia.org/wiki/Email_address) validation action.
8893
*/
94+
```
8995

9096
### Implementation Function
9197

@@ -96,9 +102,11 @@ The implementation has **NO JSDoc** but uses `// @__NO_SIDE_EFFECTS__`:
96102
export function string(
97103
message?: ErrorMessage<StringIssue>
98104
): StringSchema<ErrorMessage<StringIssue> | undefined> {
99-
return { /* ... */ };
105+
return {
106+
/* ... */
107+
};
100108
}
101-
````
109+
```
102110

103111
**`// @__NO_SIDE_EFFECTS__` rules:**
104112

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
name: repo-source-code-review
3+
description: Review pull requests and source code changes in /library/src/. Use when reviewing PRs, validating implementation patterns, or checking code quality before merging. Covers code quality checks, type safety, documentation review, test coverage, and common issues to watch for.
4+
---
5+
16
# Reviewing Source Code Changes
27

38
Guide for reviewing PRs and source code changes in `/library/src/`.
@@ -91,7 +96,7 @@ export function minLength<
9196
| Unwrap methods | `Unwraps ...` |
9297
| Other methods | `Creates a ...`, `Returns ...`, `Forwards ...` |
9398

94-
See [document-source-code.md](./document-source-code.md) for full documentation rules.
99+
See `repo-source-code-document` skill for full documentation rules.
95100

96101
### Tests
97102

@@ -123,7 +128,7 @@ See [document-source-code.md](./document-source-code.md) for full documentation
123128
- [ ] Type tests in `.test-d.ts`
124129
- [ ] Naming conventions followed
125130

126-
## Related Guides
131+
## Related Skills
127132

128-
- [repository-structure.md](./repository-structure.md) — Navigate the codebase
129-
- [document-source-code.md](./document-source-code.md) — JSDoc requirements
133+
- `repo-structure-navigate` — Navigate the codebase
134+
- `repo-source-code-document` — JSDoc requirements
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
name: repo-structure-navigate
3+
description: Navigate the Valibot repository structure. Use when looking for files, understanding the codebase layout, finding schema/action/method implementations, locating tests, API docs, or guide pages. Covers monorepo layout, library architecture, file naming conventions, and quick lookups.
4+
---
5+
16
# Valibot Repository Structure
27

38
## Monorepo Layout
@@ -13,7 +18,8 @@ valibot/
1318
│ └── zod-to-valibot/ # Zod converter
1419
├── website/ # valibot.dev (Qwik + Vite)
1520
├── brand/ # Brand assets
16-
└── prompts/ # AI agent guides
21+
├── skills/ # Agent skills (this folder)
22+
└── prompts/ # Legacy AI agent guides
1723
```
1824

1925
## Core Library (`/library/src/`)
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
name: repo-website-api-create
3+
description: 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.
4+
---
5+
16
# Adding API Documentation to Website
27

38
Guide for creating new API reference pages at `website/src/routes/api/`.
@@ -256,7 +261,7 @@ Existing API pages have a `## Related` section with `<ApiList>` components. When
256261
**Rule:** An API is "related" if:
257262

258263
- It makes sense to use it as an argument of the other API, or vice versa
259-
- It make sense to use them together in the same `pipe` (e.g., `v.pipe(v.string(), v.email())``string` and `email` are related)
264+
- It makes sense to use them together in the same `pipe` (e.g., `v.pipe(v.string(), v.email())``string` and `email` are related)
260265

261266
Examples:
262267

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
---
2+
name: repo-website-api-update
3+
description: Update existing API documentation pages after source code changes. Use when syncing docs with library changes like new parameters, type constraint changes, interface updates, or function renames. Covers common change patterns and verification steps.
4+
---
5+
16
# Updating API Documentation
27

38
Guide for syncing API docs with source code changes.
49

5-
**Prerequisite:** Read [add-new-api-to-website.md](./add-new-api-to-website.md) for `properties.ts` and `index.mdx` patterns.
10+
**Prerequisite:** Read the `repo-website-api-create` skill for `properties.ts` and `index.mdx` patterns.
611

712
## When to Update
813

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
name: repo-website-guide-create
3+
description: Create conceptual documentation and tutorial pages for the Valibot website at website/src/routes/guides/. Use when adding guides about schemas, pipelines, async validation, migration, or other topics. Covers directory structure, MDX templates, frontmatter, and content guidelines.
4+
---
5+
16
# Adding Guides to Website
27

38
Guide for creating conceptual documentation at `website/src/routes/guides/`.

0 commit comments

Comments
 (0)