code-generator

Generates production-ready code scaffolds, functions, classes, and project structures across Python, TypeScript, Java, and Go. Use when the user asks to generate code from templates, scaffold a new project, create boilerplate classes or modules, or automate repetitive code creation tasks.

261 stars

Best use case

code-generator is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Generates production-ready code scaffolds, functions, classes, and project structures across Python, TypeScript, Java, and Go. Use when the user asks to generate code from templates, scaffold a new project, create boilerplate classes or modules, or automate repetitive code creation tasks.

Generates production-ready code scaffolds, functions, classes, and project structures across Python, TypeScript, Java, and Go. Use when the user asks to generate code from templates, scaffold a new project, create boilerplate classes or modules, or automate repetitive code creation tasks.

Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.

Practical example

Example input

Use the "code-generator" skill to help with this workflow task. Context: Generates production-ready code scaffolds, functions, classes, and project structures across Python, TypeScript, Java, and Go. Use when the user asks to generate code from templates, scaffold a new project, create boilerplate classes or modules, or automate repetitive code creation tasks.

Example output

A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.

When to use this skill

  • Use this skill when you want a reusable workflow rather than writing the same prompt again and again.

When not to use this skill

  • Do not use this when you only need a one-off answer and do not need a reusable workflow.
  • Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/code-generator/SKILL.md --create-dirs "https://raw.githubusercontent.com/partme-ai/full-stack-skills/main/skills/dev-utils-skills/code-generator/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/code-generator/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How code-generator Compares

Feature / Agentcode-generatorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Generates production-ready code scaffolds, functions, classes, and project structures across Python, TypeScript, Java, and Go. Use when the user asks to generate code from templates, scaffold a new project, create boilerplate classes or modules, or automate repetitive code creation tasks.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

## When to use this skill

Use this skill whenever the user wants to:
- Generate functions, classes, or modules with proper documentation and error handling
- Scaffold a new project with configuration files and directory structure
- Create boilerplate code (CRUD controllers, service layers, data models)
- Refactor or optimize existing code structure
- Generate code from templates or specifications

## How to use this skill

### Workflow

1. **Clarify requirements** - Identify the target language, framework, and coding conventions
2. **Choose the generation type** - Function/class, module/package, or full project scaffold
3. **Generate code** - Produce complete, documented, tested code following the patterns below
4. **Validate output** - Ensure the code compiles/runs and follows project conventions

### Code Generation Patterns

**Function generation (Python example):**
```python
def calculate_order_total(
    items: list[OrderItem],
    discount_pct: float = 0.0,
    tax_rate: float = 0.08,
) -> Decimal:
    """Calculate the total price for an order including tax and discount.

    Args:
        items: List of order items with price and quantity.
        discount_pct: Discount percentage (0.0 to 1.0).
        tax_rate: Tax rate to apply after discount.

    Returns:
        Final order total as a Decimal rounded to 2 places.

    Raises:
        ValueError: If discount_pct is not between 0 and 1.
    """
    if not 0 <= discount_pct <= 1:
        raise ValueError(f"discount_pct must be 0-1, got {discount_pct}")

    subtotal = sum(item.price * item.quantity for item in items)
    discounted = subtotal * Decimal(1 - discount_pct)
    total = discounted * Decimal(1 + tax_rate)
    return total.quantize(Decimal("0.01"))
```

**Project scaffold (TypeScript/Node):**
```
my-service/
├── src/
│   ├── controllers/    # Route handlers
│   ├── services/       # Business logic
│   ├── models/         # Data models / DTOs
│   ├── middleware/      # Auth, logging, error handling
│   └── index.ts        # Entry point
├── tests/
│   ├── unit/
│   └── integration/
├── package.json
├── tsconfig.json
└── README.md
```

### Supported Languages

- Python (with type hints, docstrings, pytest)
- JavaScript / TypeScript (ESM, JSDoc or TSDoc)
- Java (JavaDoc, Maven/Gradle)
- Go (godoc, modules)
- Rust (rustdoc, Cargo)

## Best Practices

1. **Always include error handling** - Validate inputs, use typed exceptions, return meaningful error messages
2. **Add documentation** - Every public function/class gets a docstring with params, returns, and raises
3. **Follow language conventions** - PEP 8 for Python, gofmt for Go, Prettier for TypeScript
4. **Generate tests alongside code** - At minimum, one happy-path and one error-path test per function
5. **Use type annotations** - Catch bugs early with static typing where the language supports it

## Keywords

代码生成, code generation, scaffold, boilerplate, template, 函数, 类, 模块, project structure, code scaffold, 项目脚手架

Related Skills

teaching-resource-generator

261
from partme-ai/full-stack-skills

Generate teaching resources including slide deck outlines, progressive exercises, hands-on case studies, and learning guides with self-assessment checkpoints. Use when the user asks to create courseware, design practice exercises, build teaching materials, develop lesson content, or generate educational resources.

stitch-ui-design-spec-generator

261
from partme-ai/full-stack-skills

Translate user requirements into a structured Stitch Design Spec JSON covering theme, primaryColor, font, roundness, density, designMode, styleKeywords, and deviceType. Use when starting a new Stitch design task to determine visual direction before prompt assembly. Supports one-shot user requests and PRD documents as input.

pencil-ui-design-spec-generator

261
from partme-ai/full-stack-skills

Translates high-level user requirements into a PENCIL_PLAN: a strict sequence of Pencil MCP tool calls (open_document, set_variables, batch_design, get_screenshot). Use when the user explicitly mentions Pencil and wants to plan a design task, generate a step-by-step design spec, or create a login form, dashboard, or design system initialization plan.

api-doc-generator

261
from partme-ai/full-stack-skills

Generate API documentation by scanning Controller classes, extracting endpoint URLs, HTTP methods, parameters, and response structures, then producing standardized docs from templates. Use when the user explicitly mentions generating API documentation, creating API docs, scanning interfaces, or documenting REST APIs. Do not trigger for generic documentation requests without explicit API mention.

mybatis-plus-generator

261
from partme-ai/full-stack-skills

Generates MyBatis-Plus code (Entity, Mapper, Service, ServiceImpl, Controller, DTO, VO, BO) from database tables. Supports MVC and DDD architectures, Java and Kotlin, with standard CRUD and custom methods. Use ONLY when the user explicitly mentions MyBatis-Plus or mybatis-plus-generator; do NOT trigger for JPA, Hibernate, or other ORMs.

vant-vue3

261
from partme-ai/full-stack-skills

Provides structured guidance for Vant of Vue 3.0. Use when the user needs Vant with Vue 3, asks about mobile UI components such as Button, Cell, Form, Dialog, Toast, Popup, ConfigProvider, theme customization, project setup, or wants to implement mobile-first interfaces with vant or van- components.

layui-vue3

261
from partme-ai/full-stack-skills

Provides comprehensive guidance for Layui Vue component library including components, layer dialogs, and utilities. Use when the user asks about Layui Vue, needs to use Layui components in Vue 3, or implement UI components.

element-plus-vue3

261
from partme-ai/full-stack-skills

Provides comprehensive guidance for Element Plus Vue 3 component library including installation, components, themes, internationalization, and API reference. Use when the user asks about Element Plus for Vue 3, needs to build Vue 3 applications with Element Plus, or customize component styles.

bootstrap-vue3

261
from partme-ai/full-stack-skills

Provides comprehensive guidance for Bootstrap Vue 3 component library including Bootstrap components, grid system, utilities, and Vue 3 integration. Use when the user asks about Bootstrap Vue 3, needs to use Bootstrap components in Vue 3, or implement responsive layouts.

vuex-vue2

261
from partme-ai/full-stack-skills

Provides comprehensive guidance for Vuex 2.x state management in Vue 2 applications including state, mutations, actions, getters, modules, and plugins. Use when the user asks about Vuex for Vue 2, needs to manage state in Vue 2 applications, or implement Vuex patterns.

vue3

261
from partme-ai/full-stack-skills

Guidance for Vue 3 using the official guide and API reference. Use when the user needs Vue 3 concepts, patterns, or API details to build components, apps, and tooling.

vue2

261
from partme-ai/full-stack-skills

Provides comprehensive guidance for Vue 2.x development including Options API, components, directives, lifecycle hooks, computed properties, watchers, Vuex state management, and Vue Router. Use when the user asks about Vue 2, needs to create Vue 2 components, implement reactive data binding, handle component communication, or work with Vue 2 ecosystem tools.