Skip to content

A comprehensive extension for Gemini CLI that enables project-specific skill development via a slash command interface.

Notifications You must be signed in to change notification settings

involvex/gemini-cli-skill-creator

Repository files navigation

Gemini CLI Skill Creator Extension

A comprehensive extension for Gemini CLI that enables project-specific skill development via a slash command interface.

Features

  • Slash Command System: Robust /create-skill and other commands for skill management
  • Modular Templates: Customizable skill templates with parameters for different languages and frameworks
  • Seamless Integration: Works with existing Gemini CLI workflows and dependency resolution
  • Error Handling: Comprehensive validation and user-friendly error messages
  • Performance Optimized: Lazy-loading and caching for frequently used templates
  • Interactive & Headless Modes: Supports both guided creation and CI/CD automation
  • Plugin System: Extensible architecture for third-party skill contributions
  • Cross-Platform: Compatible with Linux, macOS, and Windows

Installation

Prerequisites

  • Node.js 16.0.0 or higher
  • Gemini CLI installed

Install the Extension

# Clone the repository
git clone https://github.com/involvex/gemini-cli-skill-creator
cd gemini-cli-skill-creator

# Install dependencies
npm install

# Build the extension
npm run build

# Install the extension to Gemini CLI
npm run install-ext

One-Click Installation Script

For automated installation and verification:

# Run the installation script
npm run verify

This will build the project, run tests, and verify the installation.

Usage

Basic Commands

Create a Skill

# Interactive mode (recommended for first-time users)
skill-creator create my-skill

# With options
skill-creator create my-skill --template basic --description "A custom skill" --author "Your Name"

List Available Templates

skill-creator list-templates

Validate a Skill

skill-creator validate my-skill

Slash Commands in Gemini CLI

Once installed, you can use slash commands directly in Gemini CLI:

/create-skill my-skill
/list-templates
/validate-skill my-skill

Advanced Usage

Custom Templates

Create your own skill templates by adding them to the templates/ directory:

templates/
├── my-template/
│   ├── template.json    # Template configuration
│   ├── SKILL.md         # Template for SKILL.md file
│   ├── scripts/         # Scripts directory
│   ├── references/      # Documentation
│   └── assets/          # Additional resources

Example template.json:

{
  "description": "My custom skill template",
  "parameters": [
    {
      "name": "framework",
      "type": "choice",
      "description": "Target framework",
      "required": true,
      "choices": ["react", "vue", "angular"]
    }
  ]
}

Plugin Development

Extend the extension with custom plugins. Create a plugin in the plugins/ directory:

// plugins/my-plugin/index.js
class MyPlugin {
  async activate(context) {
    // Register custom commands
    context.registerCommand("my-command", async args => {
      return "Custom command executed!";
    });
  }

  async deactivate() {
    // Cleanup
  }
}

module.exports = MyPlugin;

Skill Structure

Skills created by this extension follow the standard Gemini CLI skill format:

my-skill/
├── SKILL.md         # Skill metadata and instructions (required)
├── scripts/         # Executable scripts and tools
├── references/      # Documentation and examples
└── assets/          # Templates and binary resources

SKILL.md Format

---
name: my-skill
description: What this skill does and when to use it
author: Your Name
language: javascript
---

# My Skill

Detailed instructions for using this skill...

## Usage

1. When to activate this skill
2. Required inputs
3. Expected outputs
4. Examples

Configuration

The extension can be configured via environment variables:

  • LOG_LEVEL: Set logging level (error, warn, info, debug)
  • NODE_ENV: Set to 'production' to disable console logging
  • SKILL_TEMPLATES_DIR: Custom templates directory
  • SKILL_CACHE_DIR: Custom cache directory

Development

Building

npm run build

Testing

npm test

Linting

npm run lint

Project Structure

├── src/
│   ├── index.ts                    # Main entry point
│   ├── SkillCreatorExtension.ts    # Core extension class
│   ├── commands/
│   │   └── CommandRegistry.ts      # Command management
│   ├── templates/
│   │   └── SkillTemplateManager.ts # Template handling
│   ├── plugins/
│   │   └── PluginManager.ts        # Plugin system
│   └── utils/
│       ├── Logger.ts               # Logging utility
│       └── ErrorHandler.ts         # Error handling
├── templates/                      # Built-in templates
├── plugins/                        # Extension plugins
├── bin/
│   └── skill-creator.js            # CLI interface
├── dist/                           # Compiled output
├── package.json
├── tsconfig.json
└── README.md

API Reference

SkillCreatorExtension

Main class for the extension.

const extension = new SkillCreatorExtension(config);

// Execute commands
const result = await extension.executeCommand("create-skill", ["my-skill"]);

// Shutdown
await extension.shutdown();

Template Parameters

Templates support the following parameter types:

  • string: Text input
  • number: Numeric input
  • boolean: True/false values
  • choice: Selection from predefined options

Troubleshooting

Common Issues

  1. Template not found: Ensure the template name is correct and exists in templates/
  2. Permission errors: Check file permissions and ensure write access to skill directories
  3. Build failures: Ensure all dependencies are installed with npm install
  4. Command not recognized: Verify the extension is properly installed in Gemini CLI

Error Codes

  • TEMPLATE_NOT_FOUND: Specified template doesn't exist
  • MISSING_REQUIRED_PARAMETERS: Required parameters not provided
  • SKILL_ALREADY_EXISTS: Skill with that name already exists
  • INVALID_PARAMETER_TYPE: Parameter value doesn't match expected type
  • FILESYSTEM_ERROR: File system operation failed
  • VALIDATION_ERROR: Skill configuration validation failed

Getting Help

  • Check the logs in logs/combined.log
  • Run skill-creator --help for command usage
  • Use /help in Gemini CLI for available slash commands

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

Development Guidelines

  • Follow TypeScript best practices
  • Add comprehensive tests for new features
  • Update documentation for API changes
  • Ensure cross-platform compatibility
  • Use semantic commit messages

License

MIT License - see LICENSE file for details.

Changelog

v0.0.1

  • Initial release
  • Basic skill creation functionality
  • Template system
  • Plugin architecture
  • CLI interface
  • Cross-platform support

About

A comprehensive extension for Gemini CLI that enables project-specific skill development via a slash command interface.

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published