Skip to content

About

TUI-based command history → AI skill generator. Turn your terminal workflows into Claude Code & Cursor skills with interactive variable detection. By @vibecoded

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Skill Generator

Record terminal commands, teach them to Claude/Cursor

Skill Generator captures your workflows and turns them into AI agent skills. Record once, replay forever.

TypeScript MCP License: MIT

🎨 Interactive Mode (Recommended)

The easiest way to create skills: pick commands from your history, detect variables automatically, and generate.

skillgen interactive

What happens:

  1. 📜 Browse your recent shell history
  2. ✅ Select commands to include
  3. 🔍 Auto-detect dynamic variables (AI-powered or heuristics)
  4. ✏️ Review and customize variable names
  5. 🎯 Generate skill files for Claude Code and/or Cursor

Example: Creating a Deploy Workflow

$ skillgen interactive

📜 Select commands from history:
  [ ] git checkout -b feature/user-auth
  [x] npm run build
  [x] npm test
  [x] git add .
  [x] git commit -m "feat: add user authentication"
  [x] git push origin feature/user-auth
  [x] gh pr create --title "Add user auth" --body "Implements login flow"

🔍 Detected variables:
  ● "feature/user-auth" → {{branch_name}} (After flag: -b)
  ● "feat: add user authentication" → {{commit_message}} (Quoted string)
  ● "Add user auth" → {{pr_title}} (After flag: --title)

✨ Generated:
  ✓ .claude/skills/deploy-flow/SKILL.md
  ✓ .cursorrules

🎉 Your AI agents now know this workflow!

Variable Detection:

  • 🤖 AI-powered (Claude/GPT) - Best accuracy, requires API key
  • ⚡ Heuristics - Works offline, detects flags, quotes, versions, paths
  • 🔀 Both - Combines AI + heuristics for maximum coverage

Other Capture Methods

⚡ Quick Mode

skillgen from-history 5 --name deploy

Grabs last N commands instantly (no TUI).

📝 Manual Mode

skillgen capture my-flow
skillgen add "npm run build"
skillgen add "npm test"
skillgen stop && skillgen generate my-flow

For precise control over each command.

Smart Variable Detection

Skill Generator automatically detects and parameterizes dynamic values in your commands:

# Your actual commands:
git checkout -b feature/login
npm install react@18.2.0
git commit -m "feat: add login page"
docker run -p 8080:80 --name myapp nginx:latest

# Generated skill (with variables):
git checkout -b {{branch_name}}
npm install react@{{version}}
git commit -m "{{commit_message}}"
docker run -p {{port}} --name {{container_name}} nginx:{{version}}

Detection Methods

Method Speed Accuracy Requires
🤖 AI (Claude/GPT) ~1s Excellent API key
⚡ Heuristics Instant Good Nothing
🔀 Both ~1s Best API key

What gets detected:

  • Values after flags (--name myapp → {{name}})
  • Quoted strings (-m "message" → {{commit_message}})
  • Version numbers (18.2.0 → {{version}})
  • File paths (src/app.ts → {{file_path}})
  • Port numbers, branch names, and more

Set your API key for AI detection:

export ANTHROPIC_API_KEY=sk-ant-...  # Recommended
# or
export OPENAI_API_KEY=sk-...

Installation

Via npm (Recommended)

npm install -g @ezulabs/skillgen-cli

After installation, the skillgen and skillgen-mcp commands will be available globally.

From source

git clone https://github.com/ezulabs/skillgenerator.git
cd skillgenerator
npm install && npm run build
npm link  # Makes 'skillgen' available globally

Commands

Command Description
skillgen interactive Interactive TUI - Pick commands, detect variables, generate
skillgen from-history <n> Quick capture from last N commands
skillgen capture <name> Start manual recording session
skillgen add "<cmd>" Add command to active session
skillgen stop Stop recording session
skillgen generate <name> Generate skill files from saved session
skillgen list List all saved sessions

Options

# Target specific platform
skillgen generate my-flow --target claude
skillgen generate my-flow --target cursor
skillgen generate my-flow --target both  # default

# Install to global Claude skills
skillgen generate my-flow --global

Output

Claude Code → .claude/skills/<name>/SKILL.md

---
name: deploy-flow
description: Deploy workflow for production releases
---

## Instructions

### Build Test
1. Run: `npm run build`
   - 📝 *Adapt: none*
2. Run: `npm test`
   - 📝 *Adapt: none*

### Git Workflow
3. Run: `git add .`
4. Run: `git commit -m "{{commit_message}}"`
   - 📝 *Adapt: {{commit_message}}*
5. Run: `git push origin {{branch_name}}`
   - 📝 *Adapt: {{branch_name}}*

## Dynamic Variables
- `{{commit_message}}` - Descriptive commit message following project conventions
- `{{branch_name}}` - Git branch name (e.g., feature/login, fix/bug-123)

## Best Practices
- **Adapt dynamic values** to match the current task context
- Always check command exit codes before proceeding
- Review any output for errors or warnings

Cursor → .cursorrules

# Deploy Flow

## Dynamic Values

Adapt these based on context:
- `<branch_name>` - Determine from user request
- `<commit_message>` - Determine from user request

## Instructions

When working on this project, follow these workflows:

### Build Test
- `npm run build`
- `npm test`

### Git Workflow
- `git add .`
- `git commit -m "<commit_message>"`
- `git push origin <branch_name>`

## Tips
- **Adapt placeholders** like `<branch_name>` to actual values
- Check exit codes after each command
- Review output for errors before continuing

MCP Server (Optional)

Run as an MCP Server for direct Claude Code integration:

// ~/.claude/config.json
{
  "mcpServers": {
    "skill-generator": {
      "command": "node",
      "args": ["/path/to/skillgenerator/dist/mcp-server.js"]
    }
  }
}

Then in Claude: "Start capturing a deploy workflow" → Tools available automatically.

Architecture

src/
├── cli.ts              # CLI commands
├── capture/            # Session recording
├── generator/          # SKILL.md & .cursorrules
├── tui/
│   ├── interactive.ts  # TUI flow
│   ├── variable-detector.ts  # Heuristic detection
│   └── llm-detector.ts # AI-powered detection
└── mcp-server.ts       # MCP integration

Tech Stack

  • TypeScript - Ecosystem alignment with Claude Code
  • Anthropic SDK - Direct Claude API integration
  • Vercel AI SDK - Multi-provider support
  • Inquirer - Interactive prompts
  • Commander - CLI framework

Roadmap

  • CLI with capture mode
  • SKILL.md generation (Claude Code)
  • .cursorrules generation (Cursor)
  • Interactive TUI
  • Smart variable detection (heuristics)
  • AI-powered variable detection (Claude/GPT)
  • MCP Server integration
  • npm publish

License

MIT

About

TUI-based command history → AI skill generator. Turn your terminal workflows into Claude Code & Cursor skills with interactive variable detection. By @vibecoded

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages