Skill Define
Validate and register new Claude Code Skill manifests (.skill.yaml) to ensure structure, inputs/outputs, and dependencies are correct.
What this skill does
# skill.define
## Overview
**skill.define** is the compiler and registrar for Betty Framework skills. It ensures each `skill.yaml` conforms to schema and governance rules before registration.
## Purpose
Acts as the quality gate for all skills in the Betty ecosystem:
- **Schema Validation**: Ensures all required fields are present
- **Manifest Parsing**: Validates YAML structure and syntax
- **Registry Integration**: Delegates to `registry.update` for registration
- **Error Reporting**: Provides detailed validation errors for troubleshooting
## Usage
### Basic Usage
```bash
python skills/skill.define/skill_define.py <path_to_skill.yaml>
```
### Arguments
| Argument | Type | Required | Description |
|----------|------|----------|-------------|
| manifest_path | string | Yes | Path to the skill manifest file (skill.yaml) |
## Required Skill Manifest Fields
A valid skill manifest must include:
| Field | Type | Description | Example |
|-------|------|-------------|---------|
| `name` | string | Unique skill identifier | `api.validate` |
| `version` | string | Semantic version | `0.1.0` |
| `description` | string | What the skill does | `Validates API specifications` |
| `inputs` | array | Input parameters | `["spec_path", "guideline_set"]` |
| `outputs` | array | Output artifacts | `["validation_report"]` |
| `dependencies` | array | Required skills/deps | `["context.schema"]` |
| `status` | string | Skill status | `active` or `draft` |
### Optional Fields
- **entrypoints**: CLI command definitions
- **tags**: Categorization tags
- **permissions**: Required filesystem/network permissions
## Behavior
1. **Load Manifest**: Reads and parses the YAML file
2. **Validate Structure**: Checks for all required fields
3. **Validate Format**: Ensures field types and values are correct
4. **Delegate Registration**: Calls `registry.update` to add skill to registry
5. **Return Results**: Provides JSON response with validation status
## Outputs
### Success Response
```json
{
"ok": true,
"status": "registered",
"errors": [],
"path": "skills/workflow.validate/skill.yaml",
"details": {
"valid": true,
"missing": [],
"path": "skills/workflow.validate/skill.yaml",
"manifest": {
"name": "workflow.validate",
"version": "0.1.0",
"description": "Validates workflow YAML definitions",
"inputs": ["workflow.yaml"],
"outputs": ["validation_result.json"],
"dependencies": ["context.schema"],
"status": "active"
},
"status": "registered",
"registry_updated": true
}
}
```
### Failure Response (Missing Fields)
```json
{
"ok": false,
"status": "failed",
"errors": [
"Missing required fields: version, outputs"
],
"path": "skills/my-skill/skill.yaml",
"details": {
"valid": false,
"missing": ["version", "outputs"],
"path": "skills/my-skill/skill.yaml"
}
}
```
### Failure Response (Invalid YAML)
```json
{
"ok": false,
"status": "failed",
"errors": [
"Failed to parse YAML: mapping values are not allowed here"
],
"path": "skills/broken/skill.yaml",
"details": {
"valid": false,
"error": "Failed to parse YAML: mapping values are not allowed here",
"path": "skills/broken/skill.yaml"
}
}
```
## Examples
### Example 1: Validate a Complete Skill
**Skill Manifest** (`skills/api.validate/skill.yaml`):
```yaml
name: api.validate
version: 0.1.0
description: "Validate OpenAPI and AsyncAPI specifications against enterprise guidelines"
inputs:
- name: spec_path
type: string
required: true
description: "Path to the API specification file"
- name: guideline_set
type: string
required: false
default: zalando
description: "Which API guidelines to validate against"
outputs:
- name: validation_report
type: object
description: "Detailed validation results"
- name: valid
type: boolean
description: "Whether the spec is valid"
dependencies:
- context.schema
status: active
tags: [api, validation, openapi]
```
**Validation Command**:
```bash
$ python skills/skill.define/skill_define.py skills/api.validate/skill.yaml
{
"ok": true,
"status": "registered",
"errors": [],
"path": "skills/api.validate/skill.yaml",
"details": {
"valid": true,
"status": "registered",
"registry_updated": true
}
}
```
### Example 2: Detect Missing Fields
**Incomplete Manifest** (`skills/incomplete/skill.yaml`):
```yaml
name: incomplete.skill
description: "This skill is missing required fields"
inputs: []
```
**Validation Result**:
```bash
$ python skills/skill.define/skill_define.py skills/incomplete/skill.yaml
{
"ok": false,
"status": "failed",
"errors": [
"Missing required fields: version, outputs, dependencies, status"
],
"path": "skills/incomplete/skill.yaml",
"details": {
"valid": false,
"missing": ["version", "outputs", "dependencies", "status"],
"path": "skills/incomplete/skill.yaml"
}
}
```
## Integration
### With skill.create
The `skill.create` skill automatically generates a valid manifest and runs `skill.define` to validate it:
```bash
python skills/skill.create/skill_create.py \
my.skill \
"Does something useful" \
--inputs input1,input2 \
--outputs output1
# Internally runs skill.define on the generated manifest
```
### With Workflows
Skills can be validated as part of a workflow:
```yaml
# workflows/create_and_register.yaml
steps:
- skill: skill.create
args: ["workflow.validate", "Validates workflow definitions"]
- skill: skill.define
args: ["skills/workflow.validate/skill.yaml"]
required: true
- skill: registry.update
args: ["skills/workflow.validate/skill.yaml"]
```
### With Hooks
Automatically validate skill manifests when they're edited:
```bash
# Create a hook to validate on save
python skills/hook.define/hook_define.py \
--event on_file_save \
--pattern "skills/*/skill.yaml" \
--command "python skills/skill.define/skill_define.py {file_path}" \
--blocking true
```
## Common Errors
| Error | Cause | Solution |
|-------|-------|----------|
| "Manifest file not found" | File path is incorrect | Check the path and ensure file exists |
| "Failed to parse YAML" | Invalid YAML syntax | Fix YAML syntax errors (indentation, quotes, etc.) |
| "Missing required fields: X" | Manifest missing required field(s) | Add the missing field(s) to the manifest |
| "registry.update skill not found" | Registry updater not available | Ensure `registry.update` skill exists in `skills/` directory |
## Relationship with registry.update
`skill.define` **validates** manifests but **delegates registration** to `registry.update`:
1. **skill.define**: Validates the manifest structure
2. **registry.update**: Updates `/registry/skills.json` with the validated skill
This separation of concerns follows Betty's single-responsibility principle.
## Files Read
- **Input**: Skill manifest at specified path (e.g., `skills/my.skill/skill.yaml`)
- **Registry**: May read existing `/registry/skills.json` via delegation to `registry.update`
## Files Modified
- **None directly** โ Registry updates are delegated to `registry.update` skill
- **Indirectly**: `/registry/skills.json` updated via `registry.update`
## Exit Codes
- **0**: Success (manifest valid, registration attempted)
- **1**: Failure (validation errors or file not found)
## Logging
Logs validation steps using Betty's logging infrastructure:
```
INFO: Validating manifest: skills/api.validate/skill.yaml
INFO: โ
Manifest validation passed
INFO: ๐ Delegating registry update to registry.update skill...
INFO: Registry update succeeded
```
## Best Practices
1. **Run Before Commit**: Validate skill manifests before committing changes
2. **Use with skill.create**: Let `skill.create` generate manifests to ensure correct structure
3. **Check Dependencies**: Ensure any skills listed in `dependencies` exist in the registry
4. **Version Properly**: Follow semantic versioning foRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts โ single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score โฅ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.