Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Scaffold new Starchild skills with correct frontmatter, directory structure, and progressive-disclosure design principles.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: skill-creator3version: 1.2.04description: Create and scaffold new skills with proper frontmatter, directory structure,5and validation. Use when the user asks to build a new capability, integrate a new6API, or extend the system with a repeatable workflow.7metadata:8starchild:9emoji: "\U0001F6E0\uFE0F"10skillKey: skill-creator11user-invocable: true12---1314## Core Principles15**Concise is key.** The context window is a shared resource between the system prompt, skills, conversation history, and your reasoning. Every line in a SKILL.md competes with everything else. Only add what you don't already know — don't document tool parameters visible in the system prompt, don't prescribe step-by-step workflows for things you can figure out. Focus on domain knowledge, interpretation guides, decision frameworks, and gotchas.1617**Progressive disclosure.** Skills load in three levels:181. **Always in context** — name, emoji, and description appear in `<available_skills>` in every conversation. This is how you decide which skill to activate. The description must be a strong trigger.192. **On activation** — the full SKILL.md body is loaded via `read_file` when you decide the skill is relevant. This is where workflow, guidelines, and decision trees live.203. **On demand** — scripts/, references/, and assets/ are only loaded when explicitly needed. Heavy content goes here, not in the body.2122This means: keep the SKILL.md body lean (< 500 lines). Put detailed API docs in `references/`. Put automation in `scripts/`. The body should be what you need to *start working*, not an encyclopedia.2324**Degrees of freedom.** Match instruction specificity to task fragility:2526- **High freedom** (text guidance) — When multiple approaches are valid. Write natural language explaining WHAT and WHY, not step-by-step HOW. Example: "Check funding rates and social sentiment to gauge market mood."27- **Medium freedom** (pseudocode + params) — When a preferred pattern exists but details can vary. Describe the approach with key parameters. Example: "Use RSI with period 14, buy below 30, sell above 70."28- **Low freedom** (scripts in `scripts/`) — When operations are fragile, require exact syntax, or are repetitive boilerplate. Put the code in standalone scripts that get executed, not loaded into context. Example: Chart rendering with exact color codes and API calls.2930Default assumption: you are already smart. Only add context you don't already have.3132## Anatomy of a Skill33```34my-skill/35├── SKILL.md # Required: Frontmatter + instructions36├── scripts/ # Optional: Executable code (low freedom)37│ └── render.py # Run via bash, not loaded into context38├── references/ # Optional: Docs loaded on demand (medium freedom)39│ └── api-guide.md # Loaded via read_file when needed40└── assets/ # Optional: Templates, images, data files41└── template.json # NOT loaded into context, used in output42```4344**When to use each:**4546| Directory | Loaded into context? | Use for |47|-----------|---------------------|---------|48| SKILL.md body | On activation | Core workflow, decision trees, gotchas |49| `scripts/` | Never (executed) | Fragile operations, exact syntax, boilerplate |50| `references/` | On demand | Detailed API docs, long guides, lookup tables |51| `assets/` | Never | Templates, images, data files used in output |5253## Creating a Skill54### Step 1: Understand the Request5556Before scaffolding, understand what you're building:5758- **What capability?** API integration, workflow automation, knowledge domain?59- **What triggers it?** When should the agent activate this skill? (This becomes the description.)60- **What freedom level?** Can the agent improvise, or does it need exact scripts?61- **What dependencies?** API keys, binaries, Python packages?6263Examples:64- "I want to generate charts" → charting skill with scripts (low freedom rendering)65- "Help me think about trading strategies" → knowledge skill (high freedom, conversational)66- "Integrate with Binance API" → API skill with env requirements and reference docs6768### Step 2: Scaffold6970Use the init script:7172```bash73python skills/skill-creator/scripts/init_skill.py my-new-skill --path ./workspace/skills74```7576With resource directories:77```bash78python skills/skill-creator/scripts/init_skill.py api-helper --path ./workspace/skills --resources scripts,references79```8081With example files:82```bash83python skills/skill-creator/scripts/init_skill.py my-skill --path ./workspace/skills --resources scripts --examples84```8586### Step 3: Plan Reusable Contents8788Before writing, decide what goes where:8990- **SKILL.md body**: Core instructions the agent needs every time this skill activates. Decision trees, interpretation guides, "when to do X vs Y" logic.91- **scripts/**: Any code that must run exactly as written — API calls with specific auth, rendering with exact formats, data processing pipelines.92- **references/**: Detailed docs the agent might need occasionally — full API endpoint lists, schema definitions, troubleshooting guides.93- **assets/**: Output templates, images, config files that the agent copies/modifies for output.9495### Step 4: Write the SKILL.md9697Plan the content first — frontmatter trigger, body structure, freedom level. Then:98991. **Frontmatter** — Update description (CRITICAL trigger), add requirements, set emoji1002. **Body** — Write for the agent, not the user. Short paragraphs over bullet walls. Opinions over hedging.101102Design patterns for the body:103104- **Workflow-based** — Step-by-step process (charting: fetch data → configure chart → render → serve)105- **Task-based** — Organized by what the user might ask (trading: "analyze a coin" / "compare strategies" / "check sentiment")106- **Reference/guidelines** — Rules and frameworks (strategy: core truths, conversation style, when to pull data)107- **Capabilities-based** — Organized by what the skill can do (market-data: price tools / derivatives tools / social tools)108109### Step 5: Create / Update via `skill_manage`110111**`skill_manage` is the primary workflow** — it validates frontmatter, runs a security scan, and auto-reloads the cache. Do NOT use `write_file` as the main path.112113**Creating a new skill:**114```python115skill_manage(action="create", name="my-skill", content="---\nname: my-skill\n...")116```117118**Patching an existing skill (preferred for targeted changes):**119```python120# Always read_file first to get exact whitespace/content121skill_manage(action="patch", name="my-skill", old_string="exact old text", new_string="new text")122```123124**Full rewrite of existing skill:**125```python126skill_manage(action="edit", name="my-skill", content="---\nname: my-skill\n...")127```128129⚠️ **Known gotchas:**130- `create` errors if skill already exists → use `edit` or `patch` instead.131- `edit`/`patch` errors if skill does NOT exist → use `create` first.132- `patch` requires exact `old_string` match (whitespace included) → always `read_file` before patching.133- `execute()` must accept `**kwargs` — if you see `unexpected keyword argument 'action'`, it's a bug in the tool implementation (fix: `def execute(self, **kwargs)`).134135**Fallback only** — if `skill_manage` is unavailable, use `write_file` + `skill_refresh()` manually.136137### Step 6: Validate138139```bash140python skills/skill-creator/scripts/validate_skill.py ./workspace/skills/my-new-skill141```142143After `skill_manage`, validate is optional (auto-reloaded), but run it to catch schema issues early.144145## Frontmatter Format146The frontmatter uses `metadata.starchild` for Star Child-specific fields:147148```yaml149---150name: skill-name151version: 1.0.0152description: "What this skill does. Use when [specific trigger scenarios]."153154metadata:155starchild:156emoji: "🔧"157skillKey: skill-name158requires:159env: [API_KEY_NAME]160bins: [python]161anyBins: [curl, wget]162install:163- kind: pip164package: pandas165- kind: apt166package: curl167bins: [curl]168169user-invocable: true170disable-model-invocation: false171---172```173174**Field reference:**175176| Field | Location | Required | Purpose |177|-------|----------|----------|---------|178| `name` | top-level | Yes | Skill identifier (lowercase hyphen-case) |179| `version` | top-level | Yes | Semantic version (e.g. `1.0.0`). Required for publishing. Always include. |180| `description` | top-level | Yes | Trigger text — when should the agent use this? |181| `emoji` | `metadata.starchild` | No | Display emoji |182| `skillKey` | `metadata.starchild` | No | Dedup key |183| `requires.env` | `metadata.starchild` | No | Required env vars |184| `requires.bins` | `metadata.starchild` | No | Required binaries (ALL must exist) |185| `requires.anyBins` | `metadata.starchild` | No | Required binaries (ANY one) |186| `install` | `metadata.starchild` | No | How to install deps (pip, apt, npm, etc.) |187| `user-invocable` | top-level | No | Can user trigger via /command (default: true) |188| `disable-model-invocation` | top-level | No | Hide from `<available_skills>` (default: false) |189190## On-Chain Skills — Wallet Policy Prerequisite191If the skill involves **any on-chain operations** (sending transactions, token approvals, swaps, bridging, signing, deposits, withdrawals, smart contract interactions), add a Prerequisites section near the top of the SKILL.md:192193```markdown194195## Prerequisites — Wallet Policy196Before executing any [operation], the wallet policy must be active.197Load the **wallet-policy** skill and propose the standard wildcard198policy (deny key export + allow `*`). This covers all [skill-name]199operations across all chains.200```201202This ensures the agent proposes a wallet policy **before** attempting any transaction. Without it, the first transaction will fail with a policy violation.203204## What NOT to Include205- **README.md** — The SKILL.md IS the readme. Don't duplicate.206- **CHANGELOG.md** — Skills aren't versioned packages.207- **Docs the agent already has** — Don't repeat tool descriptions from the system prompt.208- **Step-by-step for simple tasks** — The agent can figure out "read a file then process it."209- **Generic programming advice** — "Use error handling" is noise. Specific gotchas are signal.210211## Best Practices2121. **Description is the trigger.** This is how the agent decides to activate your skill. Include "Use when..." with specific scenarios. Bad: "Trading utilities." Good: "Test trading strategies against real historical data. Use when a strategy needs validation or before committing to a trade approach."2132142. **Write for the agent, not the user.** The skill is instructions for the AI. Use direct language: "You generate charts" not "This skill can be used to generate charts."2152163. **Scripts execute without loading.** Good for large automation. The agent reads the script only when it needs to customize, keeping context clean.2172184. **Don't duplicate the system prompt.** The agent already sees tool names and descriptions. Focus on knowledge it doesn't have: interpretation guides, decision trees, domain-specific gotchas.2192205. **Request credentials last.** Design the skill first, then ask the user for API keys.2212226. **Always validate** before refreshing — run `validate_skill.py` to catch issues early.