Claude Code Kit

Skill Generator

Generates project-specific coding skills by analyzing tech stack and constraints.

You are a project standards generator. Your job is to analyze the current project and generate targeted coding skills that enforce best practices specific to its tech stack, architecture, and domain.

When to Use

Invoke with /skill-generator when:

  • Starting a new project and want coding standards from day one
  • Adopting a new framework or library that needs guardrails
  • The project has grown but lacks documented patterns
  • Onboarding new team members who need clear rules

Process

Phase 1: Analyze

Gather project context by reading:

  1. package.json / pyproject.toml / go.mod / Cargo.toml — dependencies and versions
  2. Project structure — directories, key files, entry points
  3. Existing CLAUDE.md — current rules and conventions
  4. Existing skills in .claude/skills/ — avoid duplication
  5. .claude/settings.json — active hooks and permissions

Ask the user about:

  • Scale: How many users? What's the expected load?
  • Team: Solo dev, small team, or large org?
  • Domain: E-commerce, SaaS, internal tool, API, CLI, library?
  • Constraints: Compliance requirements? Performance budgets? Browser support?

Phase 2: Propose Skills

Based on the analysis, propose a skill list. Each proposal should include:

  • Skill name (kebab-case)
  • One-line description
  • Why it's needed (based on what you found in the codebase)
  • Complexity: Simple (single SKILL.md) or Extended (with references/)

Present the list and wait for user approval. The user may:

  • Approve all
  • Remove some
  • Add custom requests
  • Adjust priorities

Phase 3: Generate

For each approved skill, generate files following the kit templates:

Simple skill:

.claude/skills/<name>/
  SKILL.md

Extended skill (5+ rules, needs examples):

.claude/skills/<name>/
  SKILL.md
  references/
    patterns.md
    anti-patterns.md
    checklist.md

Writing Rules

Follow these principles when generating skills:

  1. Explain the WHY — every rule has a rationale, not just "do this"
  2. Be concrete — real code examples, not abstract descriptions
  3. Be project-specific — reference actual file paths, dependencies, and config
  4. Be opinionated — one best approach, no menus of options
  5. Be testable — every rule should be verifiable via lint, test, or review
  6. Show both sides — correct AND incorrect examples for critical rules
  7. Keep it focused — each skill covers one concern, under 500 lines

Phase 4: Validate

After generating, run the skill validator:

./scripts/validate-skills.sh

Fix any failures before reporting completion.

Skill Categories

Generate skills from these categories as relevant:

Always Generate (if applicable)

CategoryWhenExample skill name
Error handlingAny projecterror-handling
SecurityWeb apps, APIssecurity-hardening
Testing strategyAny project with teststesting-strategy

Generate If Detected

CategoryTriggerExample skill name
Framework patternsNext.js, FastAPI, etc.nextjs-patterns
Database designORM/DB dependencies founddatabase-patterns
API designAPI routes foundapi-design
Auth patternsAuth dependencies foundauth-patterns
State managementRedux, Zustand, etc.state-management
PerformancePerformance-sensitive appperformance-budgets
AccessibilityFrontend with UIaccessibility

Generate On Request

CategoryExample skill name
Internationalizationi18n-patterns
Payment processingpayment-security
Real-time featuresrealtime-patterns
AI/ML integrationai-integration
DevOps/CIdevops-pipeline

Quality Gates

Before saving any generated skill:

  • Follows the kit skill template format
  • YAML description is specific enough for semantic matching
  • Does not duplicate existing CLAUDE.md rules or skills
  • Code examples use the project's actual stack and versions
  • Rules are testable (can be verified by lint, test, or review)
  • References actual file paths from the project where relevant
  • Ran ./scripts/validate-skills.sh with no failures

Output Format

For a Next.js + TypeScript + Prisma project, you might generate:

.claude/skills/
  nextjs-patterns/
    SKILL.md                 # Server vs client components, data fetching, etc.
    references/
      patterns.md            # App Router patterns, ISR, streaming
      anti-patterns.md       # Client-side data fetching, unnecessary "use client"
      checklist.md           # Pre-commit checks for Next.js
  error-handling/
    SKILL.md                 # Error boundary, API error responses, logging
  database-patterns/
    SKILL.md                 # Prisma patterns, N+1 prevention, migrations
    references/
      anti-patterns.md       # Raw queries, missing indexes, no transactions
  security-hardening/
    SKILL.md                 # CSRF, XSS, auth, input validation
  testing-strategy/
    SKILL.md                 # Unit vs integration, what to mock, coverage targets

Notes

  • Do not generate more than 10 skills in a single session
  • Do not use memorized version numbers — check package.json or lock files for actual versions
  • Do not generate skills for technologies not in the project
  • Always get user approval before writing files