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.14description: |5Scaffold new skills with valid frontmatter, directory layout, and a starter SKILL.md.67Use when building a new reusable workflow or wrapping a new API (e.g. create a kalshi skill, scaffold an API helper, start a charting skill).8metadata:9starchild:10emoji: "\U0001F6E0\uFE0F"11skillKey: skill-creator12user-invocable: true1314---1516## Core Principles17**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.1819**Progressive disclosure.** Skills load in three levels:201. **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.212. **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.223. **On demand** — scripts/, references/, and assets/ are only loaded when explicitly needed. Heavy content goes here, not in the body.2324This 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.2526**Degrees of freedom.** Match instruction specificity to task fragility:2728- **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."29- **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."30- **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.3132Default assumption: you are already smart. Only add context you don't already have.3334## Anatomy of a Skill35```36my-skill/37├── SKILL.md # Required: Frontmatter + instructions38├── scripts/ # Optional: Executable code (low freedom)39│ └── render.py # Run via bash, not loaded into context40├── references/ # Optional: Docs loaded on demand (medium freedom)41│ └── api-guide.md # Loaded via read_file when needed42└── assets/ # Optional: Templates, images, data files43└── template.json # NOT loaded into context, used in output44```4546**When to use each:**4748| Directory | Loaded into context? | Use for |49|-----------|---------------------|---------|50| SKILL.md body | On activation | Core workflow, decision trees, gotchas |51| `scripts/` | Never (executed) | Fragile operations, exact syntax, boilerplate |52| `references/` | On demand | Detailed API docs, long guides, lookup tables |53| `assets/` | Never | Templates, images, data files used in output |5455## Creating a Skill56### Step 1: Understand the Request5758Before scaffolding, understand what you're building:5960- **What capability?** API integration, workflow automation, knowledge domain?61- **What triggers it?** When should the agent activate this skill? (This becomes the description.)62- **What freedom level?** Can the agent improvise, or does it need exact scripts?63- **What dependencies?** API keys, binaries, Python packages?6465Examples:66- "I want to generate charts" → charting skill with scripts (low freedom rendering)67- "Help me think about trading strategies" → knowledge skill (high freedom, conversational)68- "Integrate with Binance API" → API skill with env requirements and reference docs6970### Step 2: Scaffold7172Use the init script:7374```bash75python skills/skill-creator/scripts/init_skill.py my-new-skill --path ./workspace/skills76```7778With resource directories:79```bash80python skills/skill-creator/scripts/init_skill.py api-helper --path ./workspace/skills --resources scripts,references81```8283With example files:84```bash85python skills/skill-creator/scripts/init_skill.py my-skill --path ./workspace/skills --resources scripts --examples86```8788### Step 3: Plan Reusable Contents8990Before writing, decide what goes where:9192- **SKILL.md body**: Core instructions the agent needs every time this skill activates. Decision trees, interpretation guides, "when to do X vs Y" logic.93- **scripts/**: Any code that must run exactly as written — API calls with specific auth, rendering with exact formats, data processing pipelines.94- **references/**: Detailed docs the agent might need occasionally — full API endpoint lists, schema definitions, troubleshooting guides.95- **assets/**: Output templates, images, config files that the agent copies/modifies for output.9697### Step 4: Write the SKILL.md9899Plan the content first — frontmatter trigger, body structure, freedom level. Then:1001011. **Frontmatter** — Update description (CRITICAL trigger), add requirements, set emoji1022. **Body** — Write for the agent, not the user. Short paragraphs over bullet walls. Opinions over hedging.103104Design patterns for the body:105106- **Workflow-based** — Step-by-step process (charting: fetch data → configure chart → render → serve)107- **Task-based** — Organized by what the user might ask (trading: "analyze a coin" / "compare strategies" / "check sentiment")108- **Reference/guidelines** — Rules and frameworks (strategy: core truths, conversation style, when to pull data)109- **Capabilities-based** — Organized by what the skill can do (market-data: price tools / derivatives tools / social tools)110111### Step 5: Create / Update via `skill_manage`112113**`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.114115**Creating a new skill:**116```python117skill_manage(action="create", name="my-skill", content="---\nname: my-skill\n...")118```119120**Patching an existing skill (preferred for targeted changes):**121```python122# Always read_file first to get exact whitespace/content123skill_manage(action="patch", name="my-skill", old_string="exact old text", new_string="new text")124```125126**Full rewrite of existing skill:**127```python128skill_manage(action="edit", name="my-skill", content="---\nname: my-skill\n...")129```130131⚠️ **Known gotchas:**132- `create` errors if skill already exists → use `edit` or `patch` instead.133- `edit`/`patch` errors if skill does NOT exist → use `create` first.134- `patch` requires exact `old_string` match (whitespace included) → always `read_file` before patching.135- `execute()` must accept `**kwargs` — if you see `unexpected keyword argument 'action'`, it's a bug in the tool implementation (fix: `def execute(self, **kwargs)`).136137**Fallback only** — if `skill_manage` is unavailable, use `write_file` + `skill_refresh()` manually.138139### Step 6: Validate140141```bash142python skills/skill-creator/scripts/validate_skill.py ./workspace/skills/my-new-skill143```144145After `skill_manage`, validate is optional (auto-reloaded), but run it to catch schema issues early.146147## Frontmatter Format148The frontmatter uses `metadata.starchild` for Star Child-specific fields:149150```yaml151---152name: skill-name153version: 1.0.0154description: "What this skill does. Use when [specific trigger scenarios]."155156metadata:157starchild:158emoji: "🔧"159skillKey: skill-name160requires:161env: [API_KEY_NAME]162bins: [python]163anyBins: [curl, wget]164install:165- kind: pip166package: pandas167- kind: apt168package: curl169bins: [curl]170171user-invocable: true172disable-model-invocation: false173---174```175176**Field reference:**177178| Field | Location | Required | Purpose |179|-------|----------|----------|---------|180| `name` | top-level | Yes | Skill identifier (lowercase hyphen-case) |181| `version` | top-level | Yes | Semantic version (e.g. `1.0.0`). Required for publishing. Always include. |182| `description` | top-level | Yes | Trigger text — when should the agent use this? |183| `emoji` | `metadata.starchild` | No | Display emoji |184| `skillKey` | `metadata.starchild` | No | Dedup key |185| `requires.env` | `metadata.starchild` | No | Required env vars |186| `requires.bins` | `metadata.starchild` | No | Required binaries (ALL must exist) |187| `requires.anyBins` | `metadata.starchild` | No | Required binaries (ANY one) |188| `install` | `metadata.starchild` | No | How to install deps (pip, apt, npm, etc.) |189| `user-invocable` | top-level | No | Can user trigger via /command (default: true) |190| `disable-model-invocation` | top-level | No | Hide from `<available_skills>` (default: false) |191192## On-Chain Skills — Wallet Policy Prerequisite193If 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:194195```markdown196197## Prerequisites — Wallet Policy198Before executing any [operation], the wallet policy must be active.199Load the **wallet-policy** skill and propose the standard wildcard200policy (deny key export + allow `*`). This covers all [skill-name]201operations across all chains.202```203204This ensures the agent proposes a wallet policy **before** attempting any transaction. Without it, the first transaction will fail with a policy violation.205206## What NOT to Include207- **README.md** — The SKILL.md IS the readme. Don't duplicate.208- **CHANGELOG.md** — Skills aren't versioned packages.209- **Docs the agent already has** — Don't repeat tool descriptions from the system prompt.210- **Step-by-step for simple tasks** — The agent can figure out "read a file then process it."211- **Generic programming advice** — "Use error handling" is noise. Specific gotchas are signal.212213## Best Practices2141. **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."2152162. **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."2172183. **Scripts execute without loading.** Good for large automation. The agent reads the script only when it needs to customize, keeping context clean.2192204. **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.2212225. **Request credentials last.** Design the skill first, then ask the user for API keys.2232246. **Always validate** before refreshing — run `validate_skill.py` to catch issues early.