commit 70605c4d4055ca6ca6894558a2940a25ca837d78 Author: Zhongwei Li Date: Sun Nov 30 08:31:59 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..ad11867 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,11 @@ +{ + "name": "skill-builder", + "description": "Create production-ready Claude Code skills in minutes - fully generated, optimized, and well-tested skills without boilerplate", + "version": "1.0.0", + "author": { + "name": "kimcharli" + }, + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..69a1c67 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# skill-builder + +Create production-ready Claude Code skills in minutes - fully generated, optimized, and well-tested skills without boilerplate diff --git a/commands/skill-builder.md b/commands/skill-builder.md new file mode 100644 index 0000000..d46a213 --- /dev/null +++ b/commands/skill-builder.md @@ -0,0 +1,280 @@ +--- +description: Build production-ready Claude Code skills efficiently and quickly +allowed-tools: Read(*), Write(*), Edit(*), Bash(mkdir:*,cp:*,chmod:*), Glob(*), AskUserQuestion(*) +--- + +# Skill Builder + +Interactive skill creation system. Build production-ready Claude Code skills in minutes. + +--- + +## 🎯 Task + +**Create a new skill:** $ARGUMENTS + +--- + +## Phase 1: Gather Requirements + +Understanding what skill to build... + +Ask user: + +**Header:** "Skill Basics" +**Question:** "What type of skill do you want to create?" +**MultiSelect:** false +**Options:** +- **Transformation** - Convert data from one format to another (Markdownβ†’HTML, JSONβ†’YAML) +- **Analysis** - Analyze data and generate insights (code review, document analysis) +- **Generator** - Create new content (code templates, documentation, configs) +- **Validation** - Check and validate content (syntax, format, consistency) +- **Orchestration** - Coordinate multiple operations (multi-step workflows) + +Based on selection, determine template to use. + +--- + +## Phase 2: Skill Details + +Collect skill information: + +**Ask:** +1. **Skill Name** (kebab-case, e.g., "code-formatter") + - Validate: lowercase, hyphens only, no spaces + - Suggest: based on description + +2. **Description** (one sentence) + - Example: "Format code in Python, JavaScript, Go" + - Validate: < 100 chars + +3. **Key Features** (comma-separated) + - Examples: "Auto-detect language, Fast formatting, Syntax validation" + - Validate: 2-5 features + +4. **Primary Language Support** + - Choose: Python, JavaScript, Go, Rust, Java, Multi-language, Other + +--- + +## Phase 3: Generate Skill Structure + +1. βœ… Create directory structure + ``` + skills/[skill-name]/ + β”œβ”€β”€ commands/ + β”‚ β”œβ”€β”€ [skill-name].md + β”‚ β”œβ”€β”€ [skill-name]:quick.md + β”‚ └── [skill-name]:validate.md + β”œβ”€β”€ tools/ + β”‚ β”œβ”€β”€ executor.sh + β”‚ └── validator.sh + β”œβ”€β”€ templates/ + β”œβ”€β”€ tests/ + β”‚ └── test-basic.sh + └── docs/ + β”œβ”€β”€ README.md + └── GUIDE.md + ``` + +2. βœ… Generate command files from templates + - Main command with boilerplate + - Quick mode for fast execution + - Validation sub-command + +3. βœ… Generate bash scripts + - Executor with placeholder functions + - Validator with basic checks + - Cache management functions + +4. βœ… Generate documentation + - README with quick start + - GUIDE with complete documentation + - Example usage + +--- + +## Phase 4: Add Optimizations + +Automatically included: + +βœ… **Caching Layer** +- TTL-based result caching (1 hour default) +- Cache management commands +- 20-30% token savings on repeat operations + +βœ… **Quick Mode** +- Fast path for simple/known cases +- Skips analysis phase +- 50-70% token savings + +βœ… **Validation** +- Input validation +- Output validation +- Error handling + +βœ… **Tests** +- Basic functionality test +- Cache functionality test +- Validation test + +--- + +## Phase 5: Review & Confirm + +Show generated structure: + +``` +Created: skills/[skill-name]/ +β”œβ”€β”€ commands/ +β”‚ β”œβ”€β”€ [skill-name].md (350 lines) +β”‚ β”œβ”€β”€ [skill-name]:quick.md (180 lines) +β”‚ └── [skill-name]:validate.md (120 lines) +β”œβ”€β”€ tools/ +β”‚ β”œβ”€β”€ executor.sh (150 lines) +β”‚ └── validator.sh (80 lines) +β”œβ”€β”€ templates/ +β”œβ”€β”€ tests/ +β”‚ └── test-basic.sh (60 lines) +└── docs/ + β”œβ”€β”€ README.md (80 lines) + └── GUIDE.md (200 lines) + +Total: ~1,220 lines of generated code +Setup time: < 5 minutes +Ready to customize +``` + +Ask for confirmation: +- Modify anything? +- Review specific files? +- Generate additional templates? + +**Note:** To make this skill discoverable in a marketplace: +1. Add entry to marketplace `.claude-plugin/marketplace.json` (see docs/README.md) +2. Commit and push to GitHub remote +3. Update marketplace cache: `claude plugin marketplace update your-marketplace` +4. Install from marketplace: `claude plugin install [skill-name]@your-marketplace` + +--- + +## Phase 6: Generate & Write Files + +Create all files: + +1. Command files (with proper YAML frontmatter) +2. Bash scripts (executable, with error handling) +3. Documentation files (formatted markdown) +4. Test file (functional tests) +5. Git-ready structure (no .git in generated skill) + +--- + +## Phase 7: Final Steps + +Show completion: + +``` +βœ… Skill Created Successfully! + +Location: ./skills/[skill-name]/ + +Next Steps: +1. Customize executor.sh with your logic +2. Update validator.sh with validation rules +3. Add custom templates if needed +4. Run: bash tools/executor.sh "test input" +5. Run tests: bash tests/test-basic.sh + +Documentation: +- Quick start: docs/README.md +- Full guide: docs/GUIDE.md +- Framework: docs/SKILL-CREATION-FRAMEWORK.md +- Example: docs/SKILL-CREATION-EXAMPLE.md + +Use the skill: +- /ck:[skill-name] "your input" +- /ck:[skill-name]:quick "simple input" +- /ck:[skill-name]:validate "check output" +``` + +--- + +## Features + +✨ **Fully Generated** +- All files created and ready to use +- No manual file creation needed +- Proper directory structure + +✨ **Production Ready** +- Includes error handling +- Built-in caching layer +- Validation framework included +- Test suite included + +✨ **Optimized** +- Quick mode for fast execution +- Bash scripts for mechanical tasks +- Caching for 20-30% savings +- Lightweight framework < 2K tokens typical + +✨ **Well Documented** +- README with quick start +- GUIDE with full documentation +- Framework reference included +- Example code included + +--- + +## Sub-Commands + +```bash +/ck:skill-builder # Interactive creation (this command) +/ck:skill-builder:quick # Quick scaffolding with defaults +/ck:skill-builder:templates # Browse available templates +/ck:skill-builder:validate # Check existing skill +/ck:skill-builder:help # Help and examples +``` + +--- + +## Example Usage + +```bash +# Interactive creation +/ck:skill-builder "code formatter" + +# Quick creation with defaults +/ck:skill-builder:quick "my-tool" + +# List available templates +/ck:skill-builder:templates + +# Validate generated skill +/ck:skill-builder:validate "skills/my-skill" +``` + +--- + +## Token Cost + +- **First skill:** 1.5-2K tokens (interactive guidance) +- **Subsequent skills:** 400-600 tokens (cached templates, quick mode) +- **Validation:** < 200 tokens (bash-based) + +30-40% faster with each skill created due to caching. + +--- + +## What You Get + +Each generated skill includes: + +βœ… 3 command files (main + quick + validate) +βœ… 2 bash scripts (executor + validator) +βœ… 1 test suite (basic functionality tests) +βœ… 2 docs (README + GUIDE) +βœ… Caching layer built-in +βœ… Error handling built-in +βœ… Ready to customize and deploy diff --git a/commands/skill-builder:quick.md b/commands/skill-builder:quick.md new file mode 100644 index 0000000..f1f8d32 --- /dev/null +++ b/commands/skill-builder:quick.md @@ -0,0 +1,141 @@ +--- +description: Quick skill scaffolding - generate skill structure with defaults +allowed-tools: Bash(mkdir:*,cp:*), Write(*), Glob(*) +--- + +# Quick Skill Builder + +Rapid skill generation using default configuration and templates. + +--- + +## ⚑ Task + +**Quick create skill:** $ARGUMENTS + +**No questions asked - uses smart defaults** + +--- + +## Execution + +### Step 1: Parse Input + +Extract skill details from $ARGUMENTS: +- Detect skill type from keywords +- Extract skill name +- Infer features from context + +Example: "code formatter for python and javascript" +- Type: Transformation +- Name: code-formatter +- Languages: Python, JavaScript + +### Step 2: Generate Structure + +Create directory structure: +``` +skills/[skill-name]/ +β”œβ”€β”€ commands/ +β”‚ β”œβ”€β”€ [skill-name].md +β”‚ β”œβ”€β”€ [skill-name]:quick.md +β”‚ └── [skill-name]:validate.md +β”œβ”€β”€ tools/ +β”‚ β”œβ”€β”€ executor.sh +β”‚ β”œβ”€β”€ validator.sh +β”‚ └── cache.sh +β”œβ”€β”€ tests/ +β”‚ └── test-basic.sh +└── docs/ + β”œβ”€β”€ README.md + └── GUIDE.md +``` + +### Step 3: Generate Files + +Generate from cached templates: +- βœ… Command files (with proper frontmatter) +- βœ… Bash scripts (executable, ready to customize) +- βœ… Documentation (formatted, complete) +- βœ… Test file (functional, passes) + +All files generated in < 5 seconds using bash templates. + +### Step 4: Output Location + +Show generated skill location: + +``` +βœ… Skill Created: ./skills/[skill-name]/ + +Token cost: 400-600 +Time: < 30 seconds +Ready to use and customize +``` + +--- + +## Smart Defaults + +Automatically configured: + +| Setting | Default | +|---------|---------| +| Cache TTL | 3600 (1 hour) | +| Quick mode | Enabled | +| Validation | Enabled | +| Tests | Basic suite included | +| Documentation | Complete (README + GUIDE) | +| Caching | 20-30% savings built-in | +| Error handling | Comprehensive | + +--- + +## Next Steps + +```bash +# Edit executor.sh with your logic +nano skills/[skill-name]/tools/executor.sh + +# Run test suite +bash skills/[skill-name]/tests/test-basic.sh + +# Test the skill +/ck:[skill-name] "test input" +``` + +--- + +## Examples + +```bash +# Create code formatter +/ck:skill-builder:quick "code formatter" +β†’ Creates: skills/code-formatter/ + +# Create document converter +/ck:skill-builder:quick "markdown to html converter" +β†’ Creates: skills/markdown-to-html/ + +# Create validator +/ck:skill-builder:quick "json schema validator" +β†’ Creates: skills/json-schema-validator/ +``` + +--- + +## Token Cost + +- **Time:** < 30 seconds +- **Tokens:** 400-600 (first skill, 100-200 for cached templates) +- **Speed:** ~5 seconds file generation +- **Ready:** Yes, customize immediately + +--- + +## Features + +✨ **Fast** - Complete in 30 seconds +✨ **Smart** - Detects skill type and name +✨ **Ready** - All files generated and functional +✨ **Cacheable** - Uses template cache for speed diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..d959fe7 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,49 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:kimcharli/ck-skills:plugins/skill-builder", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "e5b4ec15abc733423b0b8b585ef405cc3e5b6c78", + "treeHash": "f1403b7e9f20d61812beba849b9d6fca94931d82bf482c413db02bc4544c43aa", + "generatedAt": "2025-11-28T10:19:32.074036Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "skill-builder", + "description": "Create production-ready Claude Code skills in minutes - fully generated, optimized, and well-tested skills without boilerplate", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "fe15f2a3cbfc288e4a92625e66e8a06010da018a3398b5fe17899ac63d202bd9" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "c374a333570052588a18849262aeacd717c48db805b85d4383e25ce970fe1d51" + }, + { + "path": "commands/skill-builder.md", + "sha256": "01e2061a8101213a3a87d5e832b0a964bee149567c61cf2a3cad4f8dae941315" + }, + { + "path": "commands/skill-builder:quick.md", + "sha256": "c628398bbd3e55bc9f8ae5f9bb201fe5050486e67ecbd42ac7492d26837248cf" + } + ], + "dirSha256": "f1403b7e9f20d61812beba849b9d6fca94931d82bf482c413db02bc4544c43aa" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file