Skill Management
This skill handles the creation and updating of Agent Skills following the official specification from https://agentskills.io/specification.md.
Prerequisites
Before creating or updating any skill, you MUST:
- Fetch the latest specification from https://agentskills.io/specification.md
- If the URL is unreachable or returns an error, STOP the process immediately
- Validate all skill content against the fetched specification
Location Selection
When the user wants to create or update a skill, ask them to choose the target location:
Option 1: Global skills directory (default)
- Path:
~/.pi/agent/skills/ - Use for: Skills that should be available across all projects
Option 2: Project-local skills directory
- Path:
.agents/skills/(relative to current working directory) - Use for: Skills specific to the current project
If the user doesn't specify, default to Option 1 (global).
Creating a New Skill
Ask the user for:
- Skill name (must follow naming rules: lowercase, alphanumeric, hyphens only, no leading/trailing hyphens)
- Skill description
- Target location (Option 1 or 2)
Validate the skill name against the specification:
- 1-64 characters
- Only lowercase letters, numbers, and hyphens
- No leading or trailing hyphens
- No consecutive hyphens
Create the skill directory structure:
skill-name/ └── SKILL.mdGenerate SKILL.md with proper frontmatter:
--- name: skill-name description: Description of what this skill does ---Add skill instructions in the body section
Updating an Existing Skill
Ask the user for:
- Skill name to update
- Target location (Option 1 or 2)
- What specifically to update (frontmatter, body, or both)
Locate the skill directory and SKILL.md file
Read the current SKILL.md content
Apply the requested changes while maintaining valid frontmatter
Validate the updated content against the specification
Validation Rules
Always validate skills against the specification:
- name field: Required, 1-64 chars, lowercase alphanumeric and hyphens only, no leading/trailing/consecutive hyphens
- description field: Required, 1-1024 chars, non-empty
- license field: Optional, string
- compatibility field: Optional, 1-500 chars
- metadata field: Optional, key-value mapping
- allowed-tools field: Optional, space-delimited list
Error Handling
- If the specification URL is unreachable: STOP and inform the user
- If skill name is invalid: Ask the user to provide a valid name
- If target directory doesn't exist: Create it
- If SKILL.md already exists when creating: Ask if user wants to update instead
Examples
Creating a new skill
User: "Create a skill for processing JSON files"
- Fetch specification from https://agentskills.io/specification.md
- Ask user for location (default: ~/.pi/agent/skills/)
- Ask user for skill name (suggest: json-processing)
- Create directory: ~/.pi/agent/skills/json-processing/
- Create SKILL.md with frontmatter and instructions
Updating an existing skill
User: "Update my json-processing skill to add CSV support"
- Fetch specification from https://agentskills.io/specification.md
- Ask user for location
- Read existing ~/.pi/agent/skills/json-processing/SKILL.md
- Update description and body content
- Validate and save