Analyze any codebase and auto-generate AI agent skill files for Claude Code, Cursor, and other AI tools
Project description
skillgen
Teach AI assistants your codebase conventions — automatically.
One command. Your conventions. Every AI tool on your team.
The Problem
Every time an AI assistant touches your code, it guesses at your conventions. Wrong quote style. Wrong test patterns. Wrong import order. You fix it, it forgets, you fix it again.
skillgen reads your actual codebase and generates convention files that Claude Code, Cursor, and other AI tools understand natively. No hand-writing rules. No guessing. Every line is backed by evidence from your code.
Install in Claude Code
/plugin marketplace add mmoselhy/skillgen
/plugin install skillgen@skillgen-marketplace
That's it. Now you have two slash commands in every project:
/skillgen:skillgen Analyze codebase, generate .claude/skills/*.md
/skillgen:skillgen enrich Find community skills for your stack
No Python or pip required. The plugin runs entirely inside Claude Code — Claude reads your code and generates skill files directly. For even better results, also install the CLI (
pip install skillgen-ai) to enable hybrid mode (CLI stats + Claude semantics).
Install as CLI
pip install skillgen-ai
skillgen .
Generates .claude/skills/, .cursor/rules/, and AGENTS.md. Deterministic output, works offline, runs in CI.
Optional extras:
pip install skillgen-ai[tree-sitter] # AST-based analysis (more accurate)
pip install skillgen-ai[llm] # LLM-enhanced output (requires API key)
Requires Python 3.11+.
What It Produces
skillgen scans your code and generates 8 convention categories:
| Category | What It Captures |
|---|---|
| Naming | snake_case vs camelCase, class suffixes, file naming patterns |
| Error Handling | Exception hierarchy, try/except patterns, error propagation style |
| Testing | Framework, fixtures, assertion style, mocking patterns |
| Imports | Absolute vs relative, grouping order, key dependencies |
| Documentation | Docstring format, coverage %, type annotation usage |
| Architecture | Directory layout, layering, where new code goes |
| Code Style | Line length, quotes, trailing commas, formatter config |
| Logging | Library, logger init pattern, structured vs unstructured |
Every bullet includes prevalence stats ("82% of files use snake_case") and real examples from your code. No generic advice.
Demo
$ skillgen . --dry-run --format claude
Scanning files and detecting languages... 0:00
Analyzing patterns... 0:00
Synthesizing conventions... 0:00
Generating skills... 0:00
--- naming-conventions (dry run, not written) ---
# Naming Conventions
## Function Naming
- **82% Functions use snake_case** (14/17 files)
- Examples: `analyze_project`, `detect_project`, `validate_input`
## Class Naming
- **41% Classes/types use PascalCase** (7/17 files)
- Examples: `Language`, `PatternCategory`, `OutputFormat`
--- code-style (dry run, not written) ---
# Code Style
## Formatters & Linters
- **ruff** -- line-length: 100, select: E, F, W, I, N, UP, B, SIM, RUF
- **mypy** -- python_version: 3.11, strict: true
Done! 8 files would be generated.
CLI vs Plugin
| CLI | /skillgen Plugin |
|
|---|---|---|
| Install | pip install skillgen-ai |
/plugin install skillgen@skillgen-marketplace |
| How it works | Regex + tree-sitter AST | Claude reads your code |
| Output style | Statistical ("82% snake_case") | Semantic ("verb_noun pattern: get_user") |
| Formats | .claude/ + .cursor/ + AGENTS.md |
.claude/ only |
| Speed | < 1 second | 5-15 seconds |
| Deterministic | Yes | No (richer, but varies) |
| Context cost | Zero | ~1,700 lines (hybrid) / ~10K (standalone) |
| Best for | Teams, CI, multi-format | Individual devs, quick setup |
Hybrid mode: When both are installed, /skillgen uses CLI stats as the backbone and Claude adds semantic enrichment — best of both worlds.
Output Formats
Claude Code .claude/skills/*.md — one file per category:
<!-- Generated by skillgen v0.3.0. Do not edit manually. -->
# Code Style
## Quote Style
- **88% Prefers double quotes** (15/17 files)
## Formatters & Linters
- **ruff** -- line-length: 100, select: E, F, W, I, N, UP, B, SIM, RUF
- **mypy** -- python_version: 3.11, strict: true
Cursor .cursor/rules/*.mdc — same conventions, Cursor-native frontmatter.
AGENTS.md — single Markdown file at repo root. Uses <!-- skillgen:start/end --> markers so your handwritten sections are preserved.
Community Skills
After generating local conventions, pull in community-curated skills for your stack:
$ skillgen . --enrich
Found 3 community skills for Python + FastAPI:
# Skill Description
1 FastAPI Conventions Router patterns, DI, HTTPException
2 Pytest Best Practices Fixtures, parametrize, conftest
3 SQLAlchemy Patterns Session management, eager loading
Skipped (already covered locally): naming, code-style, imports
$ skillgen . --enrich --apply --pick 1,2
207 community skills across Python, TypeScript, JavaScript, Go, Rust, and Java — sourced from Anthropic, GitHub Copilot, and awesome-cursorrules with trust tiers (official, community, contributed).
Supported Languages
| Language | Frameworks Auto-Detected |
|---|---|
| Python | Django, FastAPI, Flask |
| TypeScript | Next.js, React, Angular, Vue |
| JavaScript | Express, React, Vue |
| Go | Gin, Cobra |
| Rust | Actix, Tokio |
| Java | Spring |
| C++ | — |
skillgen reads your tool configs (ruff, prettier, eslint, mypy, golangci-lint) and embeds the actual settings in generated skills.
How It Works
path ──> DETECT ──> ANALYZE ──> SYNTHESIZE ──> GENERATE ──> WRITE
| | | | |
languages patterns conventions skills files
frameworks evidence prevalence confidence .claude/
per-file config values meters .cursor/
- Detect — scan file tree, read manifests, identify languages + frameworks
- Analyze — sample up to 50 files/language, extract patterns across 8 categories
- Synthesize — deduplicate, compute prevalence, parse config files
- Generate — render evidence-only skills with confidence scoring
- Write — atomic writes, orphan cleanup,
--dry-runsupport
CLI Reference
skillgen <path> [flags]
Output:
--format, -f <claude|cursor|all> Target format (default: all)
--diff Show what AI learns vs blank slate
--dry-run Preview without writing files
--json Export analysis as JSON
--verbose, -v Detailed analysis output
--quiet, -q Errors only
Analysis:
--no-tree-sitter Disable AST parsing, use regex
--llm Enhance with Claude/GPT-4o
--llm-provider <anthropic|openai> Choose LLM provider
Community:
--enrich Find matching community skills
--enrich --apply Download and install them
--enrich --apply --pick 1,3 Cherry-pick by number
--trust <official|community|all> Filter by trust tier
--no-cache Force re-fetch of skill index
Contributing
See docs/CONTRIBUTING.md for development setup, testing, and PR guidelines.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file skillgen_ai-0.3.2.tar.gz.
File metadata
- Download URL: skillgen_ai-0.3.2.tar.gz
- Upload date:
- Size: 182.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e3943b3c2c05ea0ebebb4a02fcaa0b743f8477050447f7dc723b46466fca69e
|
|
| MD5 |
f9b7150ed2811db9f1c42b9f2d1a320d
|
|
| BLAKE2b-256 |
0ea40bc5097dcba674bfeccca1d9d7e5470639246ccb112fc94f64ab106871ad
|
File details
Details for the file skillgen_ai-0.3.2-py3-none-any.whl.
File metadata
- Download URL: skillgen_ai-0.3.2-py3-none-any.whl
- Upload date:
- Size: 54.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0dfd4bafba9beeba231f1e1fda5166b1718d414ec3c36ed48c77c5bb7c7bf1d3
|
|
| MD5 |
7361a7c84f9c3630281e62efa682e610
|
|
| BLAKE2b-256 |
8c4d29b7e2caf608f481df220dc0535bbc923ef1aa289fc99637e2334cb6f9e3
|