🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Neckr0ik Code Generator

by @neckr0ik

Generate boilerplate code for common patterns. Creates project scaffolds, CRUD operations, API clients, database models, tests. Use when you need to quickly...

Versionv1.1.0
Downloads634
TERMINAL
clawhub install neckr0ik-code-generator

πŸ“– About This Skill


name: neckr0ik-code-generator version: 1.0.0 description: Generate boilerplate code for common patterns. Creates project scaffolds, CRUD operations, API clients, database models, tests. Use when you need to quickly scaffold code.

Code Generator

Generate production-ready boilerplate code instantly.

What This Does

  • Project Scaffolds β€” Python, Node.js, Go, Rust project structure
  • CRUD Operations β€” Create, Read, Update, Delete boilerplate
  • API Clients β€” REST and GraphQL client generators
  • Database Models β€” SQLAlchemy, Prisma, TypeORM models
  • Test Templates β€” Unit tests, integration tests, mocks
  • Config Files β€” Docker, CI/CD, linting, formatting
  • Quick Start

    # Generate a new Python project
    neckr0ik-code-generator scaffold python my-project

    Generate CRUD operations for a model

    neckr0ik-code-generator crud User --fields "name,email,created_at"

    Generate an API client

    neckr0ik-code-generator api-client --spec https://api.example.com/openapi.json

    Generate tests

    neckr0ik-code-generator tests --source ./src --type unit

    Supported Languages

    | Language | Scaffold | CRUD | API | Models | Tests | |----------|----------|------|-----|--------|-------| | Python | βœ… | βœ… | βœ… | βœ… SQLAlchemy | βœ… pytest | | TypeScript | βœ… | βœ… | βœ… | βœ… Prisma/TypeORM | βœ… Jest | | Go | βœ… | βœ… | βœ… | βœ… GORM | βœ… testing | | Rust | βœ… | βœ… | βœ… | βœ… Diesel | βœ… cargo test | | Node.js | βœ… | βœ… | βœ… | βœ… Mongoose | βœ… Jest |

    Commands

    scaffold

    Create new project structure.

    neckr0ik-code-generator scaffold   [options]

    Options: --template Template variant (api, web, cli, library) --features Comma-separated features (auth, database, tests, ci) --output

    Output directory

    crud

    Generate CRUD operations.

    neckr0ik-code-generator crud  [options]

    Options: --fields Comma-separated field definitions (name:type) --language Target language (default: python) --database Database type (sql, mongodb, postgresql) --output

    Output directory

    api-client

    Generate API client from spec.

    neckr0ik-code-generator api-client [options]

    Options: --spec OpenAPI spec URL or file --language Target language (default: python) --output

    Output directory

    model

    Generate database model.

    neckr0ik-code-generator model  [options]

    Options: --fields Comma-separated field definitions --orm ORM (sqlalchemy, prisma, typeorm, gorm) --migrations Generate migration files --output

    Output directory

    test

    Generate test templates.

    neckr0ik-code-generator test [options]

    Options: --source

    Source directory to analyze --type Test type (unit, integration, e2e) --framework Test framework (pytest, jest, testing) --output Output directory

    config

    Generate configuration files.

    neckr0ik-code-generator config  [options]

    Types: docker Dockerfile and docker-compose ci CI/CD pipeline (GitHub Actions, GitLab CI) lint Linting config (eslint, ruff, golangci-lint) format Formatting config (prettier, black, gofmt)

    Options: --language Target language --output

    Output directory

    Generated Code Quality

  • Type-safe β€” Full type annotations where supported
  • Documented β€” Docstrings and comments
  • Tested β€” Example tests included
  • Modern β€” Latest patterns and best practices
  • Clean β€” Readable, maintainable code
  • Example: Python CRUD

    # Generated: user_crud.py

    from typing import List, Optional from sqlalchemy.orm import Session from models import User from schemas import UserCreate, UserUpdate

    class UserCRUD: """CRUD operations for User model."""

    def create(self, db: Session, user: UserCreate) -> User: """Create a new user.""" db_user = User( name=user.name, email=user.email, ) db.add(db_user) db.commit() db.refresh(db_user) return db_user

    def get(self, db: Session, user_id: int) -> Optional[User]: """Get a user by ID.""" return db.query(User).filter(User.id == user_id).first()

    def get_multi(self, db: Session, skip: int = 0, limit: int = 100) -> List[User]: """Get multiple users.""" return db.query(User).offset(skip).limit(limit).all()

    def update(self, db: Session, user_id: int, user: UserUpdate) -> Optional[User]: """Update a user.""" db_user = self.get(db, user_id) if db_user: for key, value in user.dict(exclude_unset=True).items(): setattr(db_user, key, value) db.commit() db.refresh(db_user) return db_user

    def delete(self, db: Session, user_id: int) -> bool: """Delete a user.""" db_user = self.get(db, user_id) if db_user: db.delete(db_user) db.commit() return True return False

    Use Cases

  • New Projects β€” Start with production-ready structure
  • Rapid Prototyping β€” Generate boilerplate, focus on logic
  • Code Reviews β€” Generate consistent code patterns
  • Learning β€” Study generated code for best practices
  • Templates

    Templates are stored in references/templates/:

  • python/api/ β€” Python FastAPI project
  • python/cli/ β€” Python CLI tool
  • typescript/api/ β€” Node.js Express API
  • typescript/web/ β€” React + TypeScript web app
  • go/api/ β€” Go REST API
  • rust/cli/ β€” Rust CLI tool
  • See Also

  • references/templates/ β€” Code templates
  • scripts/generator.py β€” Main generator
  • ⚑ When to Use

    TriggerAction
    - **Rapid Prototyping** β€” Generate boilerplate, focus on logic
    - **Code Reviews** β€” Generate consistent code patterns
    - **Learning** β€” Study generated code for best practices

    πŸ’‘ Examples

    # Generate a new Python project
    neckr0ik-code-generator scaffold python my-project

    Generate CRUD operations for a model

    neckr0ik-code-generator crud User --fields "name,email,created_at"

    Generate an API client

    neckr0ik-code-generator api-client --spec https://api.example.com/openapi.json

    Generate tests

    neckr0ik-code-generator tests --source ./src --type unit

    βš™οΈ Configuration

    Generate configuration files.

    neckr0ik-code-generator config  [options]

    Types: docker Dockerfile and docker-compose ci CI/CD pipeline (GitHub Actions, GitLab CI) lint Linting config (eslint, ruff, golangci-lint) format Formatting config (prettier, black, gofmt)

    Options: --language Target language --output

    Output directory