Record terminal commands, teach them to Claude/Cursor
Skill Generator captures your workflows and turns them into AI agent skills. Record once, replay forever.
The easiest way to create skills: pick commands from your history, detect variables automatically, and generate.
skillgen interactiveWhat happens:
- 📜 Browse your recent shell history
- ✅ Select commands to include
- 🔍 Auto-detect dynamic variables (AI-powered or heuristics)
- ✏️ Review and customize variable names
- 🎯 Generate skill files for Claude Code and/or Cursor
$ 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
skillgen from-history 5 --name deployGrabs last N commands instantly (no TUI).
skillgen capture my-flow
skillgen add "npm run build"
skillgen add "npm test"
skillgen stop && skillgen generate my-flowFor precise control over each command.
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}}| 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-...npm install -g @ezulabs/skillgen-cliAfter installation, the skillgen and skillgen-mcp commands will be available globally.
git clone https://github.com/ezulabs/skillgenerator.git
cd skillgenerator
npm install && npm run build
npm link # Makes 'skillgen' available globally| 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 |
# 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---
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# 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 continuingRun 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.
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
- TypeScript - Ecosystem alignment with Claude Code
- Anthropic SDK - Direct Claude API integration
- Vercel AI SDK - Multi-provider support
- Inquirer - Interactive prompts
- Commander - CLI framework
- 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
MIT