Create polished, generic Agent Skills (SKILL.md + scripts + references) from use-case-specific scripts or code. Use when the user wants to turn a working script into a reusable skill, create a new skill from scratch, refactor an existing skill, or generate a SKILL.md following prompt engineering and Agent Skills specification best practices. Handles analysis of source scripts, generalization of hardcoded values into configuration, creation of directory structures, writing of SKILL.md with proper frontmatter, workflow sections, pre-flight checks, and supporting reference documents.
Turn use-case-specific scripts into polished, generic Agent Skills following the Agent Skills specification, prompt engineering best practices, and proven patterns.
Max capability, max simplicity. The overall guideline: prefer a simpler agent surface over simpler scripts. When logic can live in a script, it should — scripts are deterministic, testable, and debuggable, while agent steps are fragile decision points. This is a balance, not a dogma: don't write overly complex scripts to avoid trivial agent decisions. But when in doubt, push complexity into scripts and keep the agent workflow as a short, linear sequence of script calls.
Every additional agent step is a place to fall. Every script is a place to land.
Use this skill when the user wants to:
Run the preflight script before first use:
python3 <skill_dir>/scripts/sc_preflight.py
This checks Python version (3.10+), PyYAML availability, expected scripts, and reference docs in one pass. Each check prints [PASS], [FAIL], or [WARN]. Exit code 0 = all checks passed, 1 = at least one failed.
If PyYAML is missing, install it: pip install PyYAML>=6.0
Always follow this sequence. Never skip the analysis or plan steps.
Determine what the user is starting from:
Read and analyze the code to understand purpose, inputs, outputs, dependencies, hardcoded values, and external API calls.
For existing scripts, identify:
Keep a mental map of every function and data flow in the original script. You will need this in Step 5 to verify nothing was lost during generalization.
When the user describes what they want but has no existing code, gather enough detail to design the skill from scratch:
If the user's description is vague, ask clarifying questions. Do not proceed to Step 2 until you can answer all 6 questions above. Propose a concrete scope and get confirmation before designing.
Read the current SKILL.md and all supporting files. Identify gaps against the mandatory sections and best practices checklist in Step 3.
Plan the full skill directory structure. Follow this pattern (proven in production skills):
skill-name/
├── SKILL.md # Required — skill definition
├── scripts/ # Executable scripts the agent runs (Python, Bash, Node, etc.)
│ ├── setup_env.sh # Optional: Setup script (if needed)
│ ├── config_loader.py # Optional: Config handling (language-specific)
│ └── <operation>.<ext> # One script per operation
├── references/ # Detailed docs loaded on demand
│ ├── CONFIG.md # Config file schema
│ └── <domain-specific>.md # Format specs, field mappings, etc.
└── assets/ # Templates, default configs, schemas
└── default-config.yaml # Shipped defaults users can copy
Key design decisions to present to the user:
.tool-name.json)Wait for user approval before proceeding to implementation.
Follow the structure and rules in references/SKILL_SPEC.md and references/PROMPT_ENGINEERING.md. Use references/SKILL_TEMPLATE.md as the structural template.
---
name: skill-name # Must match directory name, lowercase + hyphens only
description: > # 1-1024 chars. Include BOTH what it does AND when to use it.
Verb-first action description. Include trigger keywords that help agents
identify when this skill is relevant.
license: MIT
metadata:
author: <author>
version: "1.0"
allowed-tools: > # Optional: List of pre-approved tools (experimental)
read_file run_command
compatibility: > # Only if specific requirements exist
Runtime requirements, API versions, OS constraints.
---
Before writing the body, determine the skill type:
| Type | Examples | Key traits |
|------|----------|------------|
| External-resource | Jira, Confluence, Bitbucket, Jenkins, EKS | Calls APIs; needs config, credentials, connectivity checks; mutations need approval gates and --dry-run |
| Local-only | Code analysis, review prompts, file transforms, linters | Operates on local files/repos; no credentials or API config; no approval gates needed for read-only operations |
All sections below apply to external-resource skills. For local-only skills, simplify:
CONFIG.md needed if there is nothing to configureEvery other section (title, when-to-use, operations, important rules, troubleshooting) applies to both types.
Write these sections in this exact order:
Title + one-liner — # Skill Name + single sentence summary
When to use this skill — bullet list of trigger scenarios with action verbs
Prerequisites — numbered list: config file, credentials, dependencies
Configuration — minimal config example + link to references/CONFIG.md
Pre-flight checks — a single script call that validates the environment before ANY operation. The script (not the agent) runs all checks and reports results:
The agent calls the preflight script once and reads the output — it does not run each check individually. This is a key example of the design philosophy: script absorbs the complexity, agent stays simple.
Workflow — numbered steps: validate → determine scope → build plan → get approval → execute → verify
Operations — one subsection per operation with exact CLI commands using <skill_dir> placeholder
Important rules — numbered list of invariants (approval gates, security, ordering)
Error handling — table with columns: Error | Cause | Fix
Troubleshooting — table with columns: Problem | Fix
Apply these prompt engineering principles (see references/PROMPT_ENGINEERING.md):
references/<skill_dir> for the skill's own directory pathreferences/CONFIG.md)Document the full schema of the config file:
For each complex operation, create a reference doc covering:
When creating scripts, follow these patterns:
argparse, minimist)print("ERROR: <what failed>", file=sys.stderr) followed by print(" Fix: <exact command or config change>", file=sys.stderr)--dry-run flag — for any destructive operation, support preview modeThis is the most critical step. Run ALL of the following verification checks before presenting the skill to the user. Do not skip any check. Report results as a checklist.
Review the generated SKILL.md against both the prompt engineering and Agent Skills best practices:
name matches directory name (lowercase, hyphens only)description is 1-1024 chars with action verbs and domain trigger keywordsreferences/<skill_dir> placeholder is used consistently for the skill's own directoryConfirm the generated skill properly guides the agent through environment setup:
references/CONFIG.md (every field: type, default, required/optional, description)Verify the skill gives the agent enough information to diagnose and fix problems:
--dry-run for safe previewVerify all generated code is valid and functional:
skills-ref validate <skill-dir> if availablepython3 -m py_compile <file>bash -n <file>node --check <file>[text](references/FILE.md) link in SKILL.md targets an existing fileif __name__ == "__main__": or equivalent)--help check on each script: <runtime> <script> --help should print usage without errorsPresent results as:
✓ skills-ref — Passed validation
✓ config_loader — compiles, imports resolve, --help OK
✓ create_item — compiles, imports resolve, --help OK
When the skill was created from existing scripts (Path A), perform a systematic review of every difference between the original and generated code:
| Change category | Example | Expected? |
|---|---|---|
| Generalization | Hardcoded URL → config field lookup | Yes — this is the core purpose |
| Refactoring | Monolithic function → smaller helpers | Yes — improves maintainability |
| Feature addition | New --dry-run flag, new output format | Yes — skill pattern requirement |
| Feature removal | Removed a function or capability | Needs justification |
| Bug fix | Fixed an error in original logic | Document what was fixed |
| Behavioral change | Different default, different order of operations | Needs justification |
Present results as:
Original: create_jira_tickets.py (823 lines, 1 file)
Generated: 12 scripts (config_loader.py, create_ticket.py, bulk_create.py, ...)
Preserved: ticket creation, subtask creation, description formatting, link rewriting
Added: config-driven fields, discovery, diff, delete, validation, dry-run, fetch
Changed: hardcoded epic/project → config lookup (generalization)
Removed: none
Scan all generated files for leaked specifics:
https://, http://)https://mycompany.atlassian.net)Ask the user where to install:
| Scope | Location | Availability |
|---|---|---|
| Workspace | .windsurf/skills/<name>/ or .agents/skills/<name>/ | Current project only |
| Global | ~/.codeium/windsurf/skills/<name>/ | All projects |
| Shared repo | ~/CascadeProjects/<shared-repo-name>/<name>/ | Portable, version-controlled |
For shared repo installs, also update the repo's README.md table.
When converting a specific script to a generic skill, apply these transformations:
| Hardcoded element | Generalization |
|---|---|
| API base URL | Config field ("base_url": "https://...") |
| Problem | Fix |
|---|---|
| <runtime>: command not found | Install the required runtime (Python, Node, Go, etc.) |
| Module/Package missing | Run the setup script or install dependencies manually |
| Config field not working | Run discovery script to auto-detect field IDs |
| File paths | CLI --path argument with sensible default (cwd) |
| Output format | CLI --output flag (terminal/json/markdown) |
| Hardcoded lists/mappings | Config arrays or reference files |
| Magic numbers | Named config fields with defaults |
references/ files.Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer