The @uberskills/skill-engine package handles all SKILL.md processing. It is the core business logic package with no UI dependencies.
Source: packages/skill-engine/src/
File: parser.ts
Parses a raw SKILL.md string into structured data.
Input: Raw SKILL.md content (string)
Output: { frontmatter: SkillFrontmatter, content: string }
Steps:
- Extract YAML frontmatter between
---delimiters. - Parse YAML into a
SkillFrontmatterobject. - Extract remaining markdown as
content.
File: validator.ts
Validates a parsed skill against the Claude Code skill specification.
Rules:
| Field | Requirement |
|---|---|
name |
Required, non-empty, max 100 characters |
description |
Required, non-empty, max 500 characters |
trigger |
Required, non-empty |
model_pattern |
If present, must be a valid regex |
content |
Required, non-empty |
| File paths | No duplicates in associated skill files |
Output: { valid: boolean, errors: ValidationError[] }
interface ValidationError {
field: string;
message: string;
severity: "error" | "warning";
}File: generator.ts
Generates a SKILL.md string from structured data.
Input: { frontmatter: SkillFrontmatter, content: string }
Output: Complete SKILL.md string
Steps:
- Serialize
SkillFrontmatterto YAML. - Wrap in
---delimiters. - Append content after a blank line.
- Ensure trailing newline.
Example output:
---
name: PR Reviewer
description: Reviews pull requests and provides feedback
trigger: When user asks to review a PR
---
## Instructions
When reviewing a pull request...File: substitutions.ts
Handles argument placeholder replacement for skill testing.
Placeholder patterns:
$ARGUMENTS-- replaced with the full user-provided arguments string$VARIABLE_NAME-- named placeholders detected via regex/\$([A-Z_]+)/g
Functions:
detectPlaceholders(content: string): string[]-- returns placeholder names found in content.substitute(content: string, values: Record<string, string>): string-- replaces placeholders with values.
File: exporter.ts
- Creates directory structure:
<slug>/SKILL.md,<slug>/prompts/*,<slug>/resources/*. - Generates SKILL.md via the generator.
- Includes skill files in appropriate subdirectories.
- Compresses to
.zipand returns as buffer.
- Resolves target:
~/.claude/skills/<slug>/. - Creates directory if it doesn't exist.
- Writes SKILL.md via the generator.
- Copies skill files to appropriate subdirectories.
- Returns the deployed path.
File: importer.ts
- Recursively scans the given path for directories containing
SKILL.md. - Parses each
SKILL.mdvia the parser. - Detects additional files in
prompts/andresources/subdirectories. - Returns an array of parsed skills with validation results.
- Extracts zip to a temporary directory.
- Delegates to directory scan logic.
- Cleans up temporary files.
- All paths are resolved to absolute paths and canonicalized.
- Symlinks are not followed outside the source directory.
- Only
.mdand known text file extensions are read.