Generate a new Claude Code skill directory with SKILL.md, plugin.json, and optional scripts/. Use when creating a new skill from scratch.
Create a new skill directory with all required files following the project's skill conventions.
Check $ARGUMENTS:
/skill-scaffold <skill-name> [--with-python] [--with-scripts]" and STOP.Extract from $ARGUMENTS:
SKILL_NAME — first positional argument (e.g., my-new-skill)--with-python flag → create scripts/ dir with a Python stub + requirements.txt--with-scripts flag → create scripts/ dir with a bash stubDetermine output directory: Use skills/ relative to the current project root (where this skill is installed)
Create directory structure:
skills/<SKILL_NAME>/
├── SKILL.md
├── .claude-plugin/
│ └── plugin.json
└── README.md
If --with-python:
└── scripts/
├── <skill_name>.py (snake_case version)
└── requirements.txt
If --with-scripts:
└── scripts/
└── run.sh
SKILL.md template — generate with:
---
name: <SKILL_NAME>
description: "<Ask user or use placeholder>"
argument-hint: '<SKILL_NAME> <args>'
allowed-tools: Bash, Read, Write, Edit
---
# <SKILL_NAME>
## Execution Logic
Check `$ARGUMENTS`:
- If **empty** → respond with usage and STOP.
- If **has arguments** → parse and execute.
## Task Execution
[TODO: Define skill logic here]
plugin.json template:
{
"name": "<SKILL_NAME>",
"description": "<same as SKILL.md description>",
"version": "1.0.0",
"author": { "name": "gp" },
"repository": "https://github.com/gp/dev-environment-setup",
"license": "MIT",
"skills": ["./"]
}
Python stub (if --with-python):
#!/usr/bin/env python3
"""<SKILL_NAME> — [description]"""
import sys
def main():
if len(sys.argv) < 2:
print("Usage: <skill_name>.py <args>", file=sys.stderr)
sys.exit(1)
# TODO: implement
print(f"Running {sys.argv[0]} with args: {sys.argv[1:]}")
if __name__ == "__main__":
main()
README.md:
# <SKILL_NAME>
> [description]
## Usage
`/<skill-name> <args>`
## Installation
`npx skills i gp/dev-environment-setup --skill <skill-name>`
After creation, output:
✅ Skill "<SKILL_NAME>" created at skills/<SKILL_NAME>/
Files:
- SKILL.md (edit to define skill logic)
- .claude-plugin/plugin.json
- README.md
[- scripts/<file> (if --with-python or --with-scripts)]
Next: Edit SKILL.md to define your skill's behavior.