Skip to main content

Overview

The prompt command exports one or more skills in formats suitable for agent platforms and LLM prompts. It generates structured output containing skill metadata (name, description, location) in XML, Markdown, or JSON format.

Usage

sklab prompt [SKILL_PATHS...] [OPTIONS]

Arguments

SKILL_PATHS
Path[]
Paths to skill directories. Accepts multiple paths. Defaults to current directory if not specified.
sklab prompt ./skill-a ./skill-b ./skill-c

Options

--format
string
default:"xml"
Alias: -fOutput format for the exported prompt.Options:
  • xml - XML format (default)
  • markdown - Markdown format
  • json - JSON format
sklab prompt --format markdown

Examples

Export current directory (XML)

sklab prompt
Output:
<available_skills>
  <skill>
    <name>sentiment-analysis</name>
    <description>Analyze text for sentiment and emotional tone</description>
    <location>file:///path/to/sentiment-analysis</location>
  </skill>
</available_skills>

Export multiple skills

sklab prompt ./skill-a ./skill-b ./skill-c

Export as Markdown

sklab prompt --format markdown
Output:
# Available Skills

## sentiment-analysis
- **Description:** Analyze text for sentiment and emotional tone
- **Location:** file:///path/to/sentiment-analysis

## data-processor
- **Description:** Process and transform structured data
- **Location:** file:///path/to/data-processor

Export as JSON

sklab prompt --format json
Output:
[
  {
    "name": "sentiment-analysis",
    "description": "Analyze text for sentiment and emotional tone",
    "location": "file:///path/to/sentiment-analysis"
  },
  {
    "name": "data-processor",
    "description": "Process and transform structured data",
    "location": "file:///path/to/data-processor"
  }
]

Redirect to file

sklab prompt --format xml > skills.xml
sklab prompt --format json > skills.json

Output Formats

XML Format

Structured XML with <available_skills> root element and <skill> children:
<available_skills>
  <skill>
    <name>skill-name</name>
    <description>skill description</description>
    <location>file:///absolute/path/to/skill</location>
  </skill>
</available_skills>

Markdown Format

Human-readable Markdown with headers and bullet points:
# Available Skills

## skill-name
- **Description:** skill description
- **Location:** file:///absolute/path/to/skill

JSON Format

Machine-readable JSON array:
[
  {
    "name": "skill-name",
    "description": "skill description",
    "location": "file:///absolute/path/to/skill"
  }
]

Token Usage Summary

The command outputs a summary to stderr:
# 3 skill(s), ~245 discovery tokens
This shows:
  • Number of skills exported
  • Estimated total discovery tokens (name + description for all skills)
The summary is written to stderr, so it won’t interfere with piping or redirecting the main output.

Use Cases

Agent Platform Integration

Export skills for use in agent system prompts:
# Generate XML for Claude or similar LLMs
sklab prompt ./skills/* --format xml > system-prompt.xml

# Include in system prompt
cat base-prompt.txt system-prompt.xml > full-prompt.txt

Skill Discovery APIs

Generate JSON for skill discovery endpoints:
sklab prompt ./skills/* --format json > api/skills.json

Documentation Generation

Create skill catalogs in Markdown:
sklab prompt ./skills/* --format markdown > docs/skill-catalog.md

CI/CD Validation

Validate skill metadata during deployment:
# Ensure all skills can be exported
sklab prompt ./skills/* --format json > /dev/null
if [ $? -eq 0 ]; then
  echo "All skills have valid metadata"
fi

Exit Codes

  • 0: Export successful
  • 1: Error occurred (invalid path, missing SKILL.md, invalid format, etc.)

Notes

All skill paths must contain a valid SKILL.md file. The command will fail if any path is invalid.
The location field uses file:// URI scheme with absolute paths resolved from the provided input paths.
Token estimates in the summary use the same algorithm as sklab info and are approximate.

Build docs developers (and LLMs) love