virtualian/pai-autodocs/developer
- community
Checking that the SKILL.md file is still in the repository.
Create a custom PAI skill from scratch with a workflow, and learn how skills get discovered and routed.
Install
npx vskill@latest install virtualian/pai-autodocs/developerSKILL.md
In this tutorial, you will build a complete PAI skill from scratch. You will create the required directory structure, write a SKILL.md with proper frontmatter, add a workflow, and test that PAI discovers and routes to your skill automatically. By the end, you will understand the full anatomy of a skill and how the pieces connect.
What you will learn
- The required directory structure for a PAI skill
- How to write a
SKILL.mdwith YAML frontmatter and workflow routing - The TitleCase naming convention and why it matters
- How to create a workflow file
- How PAI discovers and activates skills
- The distinction between skills, workflows, and tools
Prerequisites
Before starting this tutorial, you need:
- PAI installed and working -- you should be able to run
paiand see the Algorithm header - Completed the [getting started tutorial](/user/first-session/) -- you understand the Algorithm phases
- A text editor for creating files (or you can ask PAI to create them for you)
- Basic familiarity with Markdown syntax
What you will build
You will create a QuickNote skill -- a simple skill that captures quick notes and saves them to a file. This is intentionally minimal so you can focus on the skill structure rather than complex logic.
When finished, you will be able to say "take a quick note" in a PAI session and have it automatically route to your skill.
Step 1: Understand the skill directory structure
Every PAI skill follows a mandatory structure. Here is the skeleton:
Three things to note:
- `SKILL.md` is always uppercase. This is a convention -- it is the main entry point for every skill.
- `Tools/` must always exist, even if you have no tools yet. This is a structural requirement.
- `Workflows/` contains execution procedures -- step-by-step instructions for doing work.
Skills live in ~/.claude/skills/. Let's create the directory structure now.
Step 2: Create the skill directory
Open your terminal and create the QuickNote skill directories:
Verify the structure:
Expected output:
Why TitleCase?
Notice that the directory is QuickNote, not quick-note, quicknote, QUICK_NOTE, or quick_note. PAI uses TitleCase (PascalCase) for all naming:
| Component | Wrong | Correct | |
|---|---|---|---|
| Skill directory | quick-note, QUICK_NOTE | QuickNote | |
| Workflow files | capture-note.md, CAPTURE.md | CaptureNote.md | |
| Tool files | save-note.ts | SaveNote.ts | |
| YAML name field | name: quick-note | name: QuickNote |
The only exception is SKILL.md itself, which is always uppercase by convention.
Step 3: Write the SKILL.md file
The SKILL.md file has two parts: YAML frontmatter and a Markdown body. Create the file at ~/.claude/skills/QuickNote/SKILL.md with the following content:
User: "Take a quick note: remember to review the API rate limits before launch" -> Invokes Capture workflow -> Saves note with timestamp to ~/Notes/quick-notes.md -> Confirms note was saved
User: "Jot down that the design review is moved to Thursday" -> Invokes Capture workflow -> Appends timestamped note to file -> Confirms with note content
Breaking down the frontmatter
The YAML frontmatter is the most critical part. Let's examine each element:
`name` -- Must use TitleCase. Must match the directory name.
`description` -- This is a single line (not multi-line with |). It has a strict structure:
- What it does: "Capture and organize quick notes."
- `USE WHEN` keyword: This is mandatory. Claude Code parses this to determine when to activate the skill.
- Intent triggers: Natural language descriptions of when this skill should activate, connected with
OR.
The USE WHEN clause uses intent matching, not string matching. You do not need to list exact phrases in quotes. Instead, describe the intent: "user wants to take a note" covers "take a note", "I need to note something", "let me write that down", and many other phrasings.
:::caution The description has a hard limit of 1024 characters (Anthropic constraint). Keep it concise. :::
Breaking down the Markdown body
The body contains several key sections:
- Brief description -- One or two lines explaining the skill
- Customization block -- Standard block for user overrides (explained in Step 7)
- Workflow Routing -- Table mapping triggers to workflow files
- Examples -- 2-3 concrete usage patterns (required for every skill)
- Defaults -- Default configuration values
The Workflow Routing table has three columns:
| Column | Purpose | |
|---|---|---|
| Workflow | TitleCase name matching the file name | |
| Trigger | Human-readable description of when to use this workflow | |
| File | Path to the workflow file relative to the skill directory |
The Examples section is not optional decoration. Research shows that examples improve tool selection accuracy significantly. They show Claude the full input-to-behavior-to-output pattern, not just trigger keywords.
Step 4: Create the Capture workflow
Workflows are step-by-step execution procedures. They tell PAI exactly what to do when the workflow is triggered. Create the file at ~/.claude/skills/QuickNote/Workflows/Capture.md:
Saved note to ~/Notes/quick-notes.md:
- [2026-02-16 14:30] Your note content here
Workflows vs reference documentation
This is a critical distinction in PAI:
| Type | Purpose | Lives in | Named like | |
|---|---|---|---|---|
| Workflows | Step-by-step execution procedures (things you "run") | Workflows/ | TitleCase verbs: Capture.md, Create.md, SyncRepo.md | |
| Reference docs | Information to read (guides, specs, context) | Skill root | TitleCase descriptive: ApiReference.md, Examples.md |
Workflows are actions. Reference docs are context. Never put reference documentation inside the Workflows/ directory.
Step 5: Test the skill
Start a new PAI session to pick up the new skill:
When PAI starts, it scans the YAML frontmatter of every SKILL.md in ~/.claude/skills/. Your QuickNote skill's USE WHEN clause is now part of the routing table.
Try invoking it:
What you should observe
- The Algorithm runs -- you see the full OBSERVE through LEARN phases
- In the THINK phase, the Skill Check should show:
`` 🔍 SKILL CHECK (validate hook hints against ISC): │ Hook suggested: QuickNote │ ISC requires: note capture and file persistence │ Final skills: QuickNote:Capture ``
- In BUILD/EXECUTE, PAI follows your workflow steps:
- Creates
~/Notes/if it does not exist - Appends the timestamped note to
~/Notes/quick-notes.md
- In VERIFY, the ISC criteria are checked against actual results
After execution, verify the note was saved:
Expected output:
Step 6: Understand how skill discovery works
Now that your skill is working, let's understand the full discovery and routing pipeline:
Session startup
When PAI starts (pai command), it reads the YAML frontmatter from every SKILL.md file under ~/.claude/skills/. Only the frontmatter loads at startup -- the full Markdown body is not read until the skill is actually invoked. This keeps startup fast.
Skill activation (two passes)
When you type a prompt, skill activation uses a two-pass system:
Pass 1: Hook hints (before Algorithm starts)
Claude Code matches your raw prompt against skill descriptions and USE WHEN triggers to suggest which skills might be relevant. These are draft suggestions -- starting points, not final decisions.
Pass 2: THINK validation (after OBSERVE completes)
In the THINK phase, with the full context of reverse-engineering and ISC criteria, PAI validates the hook's suggestions. It can:
- Confirm a hook suggestion that matches the ISC
- Add skills the hook missed but the ISC requires
- Remove skills the hook suggested that do not serve the ISC
Pass 2 is authoritative. It overrides Pass 1 based on ISC evidence.
Skill invocation
Once a skill is selected, PAI:
- Reads the full
SKILL.mdbody (not just frontmatter) - Uses the Workflow Routing table to find the right workflow file
- Reads and follows the workflow file step-by-step
Step 7: Understand skill customization
The Customization section in your SKILL.md points to a user overrides directory. This separates skill logic from personal preferences.
PAI has two categories of skills:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdocs/developer/first-skill.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 24 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/virtualian/pai-autodocs/developer)