본문으로 건너뛰기
cccskills
무료GitHub에 공개

module-component-generator

Generates complete modules and components from interface contracts and specifications. Use when Claude needs to build larger software components, implement interfaces, create service layers, or generate complete modules with multiple related classes. Supports Python (with type hints and protocols) and Java (with interfaces and abstract classes). Trigger when users request "implement this interface", "generate a module for", "create a service layer", "build a component that implements", or provide interface definitions that need implementation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(4)

  • SKILL.md8.8 KB
  • references/documentation-patterns.md8.0 KB
  • references/java-patterns.md13.4 KB
  • references/python-patterns.md10.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Module/Component Generator

Generate complete, production-ready modules and components from interface contracts and specifications.

Quick Start

When a user provides an interface contract or requests a module:

  1. Understand the contract: Analyze the interface, abstract class, or specification
  2. Determine scope: Clarify if generating single implementation or full module
  3. Select patterns: Choose appropriate design patterns and structure
  4. Generate code: Create implementation with proper structure and documentation
  5. Add documentation: Include comprehensive docstrings and usage examples

What This Skill Generates

Interface Implementations

Generate concrete implementations from:

  • Python Protocols and Abstract Base Classes
  • Java interfaces and abstract classes
  • Complete with validation, error handling, and documentation

Complete Modules

Generate multi-file modules with:

  • Domain models
  • Repository/data access layer
  • Service/business logic layer
  • Custom exceptions
  • Comprehensive documentation

Documentation

Generate for all code:

  • Module-level documentation
  • Class and method docstrings
  • Usage examples
  • API reference documentation

Generation Scope

Single Interface Implementation

When to use:

  • User provides a single interface/protocol/abstract class
  • Need one concrete implementation
  • Simple, focused functionality

What to generate:

  • Implementation class with all required methods
  • Input validation
  • Error handling
  • Docstrings with examples
  • Basic usage example

Full Module Generation

When to use:

  • Building a complete feature or service
  • Need multiple related classes
  • Require layered architecture (model, repository, service)

What to generate:

  • Domain models with validation
  • Repository layer for data access
  • Service layer for business logic
  • Custom exception hierarchy
  • Module-level documentation
  • Complete usage examples

Language-Specific Guidance

Python

Patterns and conventions:

  • Use type hints for all parameters and returns
  • Use Protocol for structural typing
  • Use ABC for inheritance-based contracts
  • Follow PEP 8 style guidelines
  • Use dataclasses or Pydantic for models

See: python-patterns.md for detailed examples

Common structures:

  • Protocol implementation
  • ABC implementation
  • Service layer module (model + repository + service)
  • Adapter pattern module
  • Factory pattern module

Java

Patterns and conventions:

  • Implement interfaces explicitly
  • Use Objects.requireNonNull() for validation
  • Use Optional<T> for nullable returns
  • Follow Java naming conventions
  • Use proper exception hierarchy

See: java-patterns.md for detailed examples

Common structures:

  • Interface implementation
  • Abstract class extension
  • Service layer module (model + repository + service)
  • Strategy pattern module
  • Builder pattern module

Workflow

1. Analyze the Contract

For interfaces/protocols:

  • Identify all methods that need implementation
  • Note parameter types and return types
  • Check for any constraints or requirements
  • Understand the intended behavior

For module requests:

  • Identify core entities/models
  • Determine required operations (CRUD, business logic)
  • Understand relationships between components
  • Clarify persistence requirements

2. Determine Structure

Single implementation:

  • One class implementing the interface
  • Helper methods if needed
  • Validation and error handling

Full module:

  • Domain models (data structures)
  • Repository layer (data access)
  • Service layer (business logic)
  • Exception classes (error handling)
  • Module initialization

3. Generate Implementation

For each class:

  1. Write class declaration with proper inheritance
  2. Implement constructor with dependency injection
  3. Implement all required methods
  4. Add validation and error handling
  5. Add helper methods if needed
  6. Write comprehensive docstrings

Code quality standards:

  • Validate all inputs
  • Handle edge cases
  • Use meaningful variable names
  • Follow language conventions
  • Keep methods focused and small

4. Add Documentation

Module level:

Class level:

  • Purpose and responsibility
  • Constructor parameters
  • Key methods overview
  • Usage examples

Method level:

  • What the method does
  • Parameters and types
  • Return value and type
  • Exceptions that can be raised
  • Usage example for complex methods

5. Provide Usage Examples

Include:

  • Basic usage example
  • Common use cases
  • Error handling examples
  • Integration examples for modules

Design Patterns

Repository Pattern

Separate data access from business logic.

Structure:

  • Model: Domain entity
  • Repository: Data access interface and implementation
  • Service: Business logic using repository

Use when: Need to abstract data persistence

Service Layer Pattern

Encapsulate business logic in service classes.

Structure:

  • Models: Domain entities
  • Services: Business operations
  • Exceptions: Domain-specific errors

Use when: Building business logic layer

Adapter Pattern

Provide unified interface to different implementations.

Structure:

  • Interface: Common contract
  • Adapters: Implementation for each variant
  • Factory: Create appropriate adapter

Use when: Need to support multiple backends/providers

Strategy Pattern

Encapsulate algorithms/behaviors as interchangeable strategies.

Structure:

  • Strategy interface: Common contract
  • Concrete strategies: Different implementations
  • Context: Uses strategy

Use when: Need runtime algorithm selection

Best Practices

Code Quality

Validation:

  • Validate all inputs at public API boundaries
  • Use type hints/annotations
  • Fail fast with clear error messages
  • Check for null/None values

Error Handling:

  • Create custom exception hierarchy
  • Use specific exception types
  • Provide meaningful error messages
  • Document exceptions in docstrings

Dependency Injection:

  • Accept dependencies through constructor
  • Use interfaces/protocols for dependencies
  • Make dependencies explicit
  • Facilitate testing with mocks

Documentation

Completeness:

  • Document all public classes and methods
  • Include parameter descriptions
  • Document return values
  • List possible exceptions

Examples:

  • Provide usage examples in docstrings
  • Show common use cases
  • Include error handling examples
  • Demonstrate integration patterns

Clarity:

  • Use clear, concise language
  • Explain the "why" not just the "what"
  • Include type information
  • Cross-reference related components

Structure

Organization:

  • Group related classes in modules/packages
  • Separate concerns (model, repository, service)
  • Use clear naming conventions
  • Keep files focused and cohesive

Modularity:

  • Keep classes focused on single responsibility
  • Use composition over inheritance
  • Minimize coupling between components
  • Design for testability

Example Usage Patterns

User: "Implement this DataRepository interface" → Generate single implementation class with all methods

User: "Create a user service module with CRUD operations" → Generate full module: User model, UserRepository, UserService, exceptions

User: "Build a notification system that supports email and SMS" → Generate adapter pattern: NotificationAdapter interface, EmailAdapter, SMSAdapter, factory

User: "Implement this PaymentProcessor abstract class for Stripe" → Generate StripePaymentProcessor extending abstract class

User: "Generate a complete order management module" → Generate full module: Order model, OrderRepository, OrderService, custom exceptions, documentation

User: "Create implementations for these three interfaces" → Generate three implementation classes, each with proper structure

Quality Checklist

Before delivering generated code, verify:

  • All interface methods implemented
  • Input validation present
  • Error handling included
  • Type hints/annotations added
  • Docstrings complete
  • Usage examples provided
  • Follows language conventions
  • Dependencies properly injected
  • Custom exceptions defined
  • Module documentation included

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Applies abstract interpretation using different abstract domains (intervals, octagons, polyhedra, sign, congruence) to statically analyze program variables and infer invariants, value ranges, and relationships. Use when analyzing program properties, inferring loop invariants, detecting potential errors, or understanding variable relationships through static analysis.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2572026년 8월 21일 업데이트

Uses abstract interpretation to automatically infer loop invariants, function preconditions, and postconditions for formal verification. Generates invariants that capture program behavior and support correctness proofs in Dafny, Isabelle, Coq, and other verification systems. Use when adding formal specifications to code, generating verification conditions, inferring contracts for functions, or discovering loop invariants for proofs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2572026년 8월 21일 업데이트

Performs abstract interpretation over source code to infer possible program states, variable ranges, and data properties without executing the program. Reports potential runtime errors including out-of-bounds accesses, null dereferences, type inconsistencies, division by zero, and integer overflows. Use when analyzing code for potential runtime errors, performing static analysis, checking safety properties, or verifying program behavior without execution.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2572026년 8월 21일 업데이트

Performs abstract interpretation to produce summarized execution traces and high-level program behavior representations. Highlights key control flow paths, variable relationships, loop invariants, function summaries, and potential runtime states using abstract domains (intervals, signs, nullness, etc.). Use when analyzing program behavior, understanding execution paths, computing loop invariants, tracking variable ranges, detecting potential runtime errors, or generating program summaries without concrete execution.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2572026년 8월 21일 업데이트

Create ACSL (ANSI/ISO C Specification Language) formal annotations for C/C++ programs. Use this skill when working with formal verification, adding function contracts (requires/ensures), loop invariants, assertions, memory safety annotations, or any ACSL specifications. Supports Frama-C verification and generates comprehensive formal specifications for C/C++ code.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2572026년 8월 21일 업데이트

CLI-based browser automation with persistent page state using ref-based element interaction. Use when users ask to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ArabelaTso/Skills-4-SE2572026년 8월 21일 업데이트

ArabelaTso의 스킬 모두 보기

이 스킬의 문제 신고