agentleFS
dbtinoy-dbtinoy-/lexigram-framework-skills/cli-code-generation/SKILL.md

cli-code-generation

Skill1 starsChanged 3 months agoMITView on GitHub

Use when scaffolding code components like controllers, services, models, or using lexigram gen generators

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After running a generator:

    line 72
  2. Very specific:

    Add any config sections to application.yaml

    line 74

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

CLI Code Generation

Overview

lexigram gen assembles code generators at runtime via CLI contributors: two built-in plus one or more per installed extension package. Each generator scaffolds files into its default_output_dir.

Basic Usage

lexigram gen list                    # List discovered generators

# Built-in (always available)
lexigram gen provider MyProvider     # DI provider → src/providers
lexigram gen test ProductServiceTest # Test scaffold → tests/unit

# Web (lexigram-web)
lexigram gen controller ProductController   # Controller with CRUD routes
lexigram gen resource Product               # RESTful resource, CRUD endpoints
lexigram gen middleware AuthMiddleware      # Middleware component
lexigram gen graphql ProductSchema          # GraphQL schema + resolvers
lexigram gen webhook stripe_payment         # Webhook handler
lexigram gen websocket chat                 # WebSocket handler

# Database (lexigram-sql)
lexigram gen repository ProductRepo  # Repository with query methods
lexigram gen model Product           # SQLAlchemy model
lexigram gen service ProductService  # Service with unit of work
lexigram gen filter ProductFilter    # Query filter
lexigram gen seeder product_seeder   # Test/dev data seeder

# Events & Messaging
lexigram gen event OrderPlaced              # Domain event
lexigram gen event_handler OrderPlaced      # Handler with bus registration
lexigram gen command CreateOrder            # CQRS command
lexigram gen query GetOrder                 # CQRS query
lexigram gen saga order_saga                # Saga orchestrator
lexigram gen saga_step reserve_inventory    # Saga step w/ compensation
lexigram gen message_consumer order_worker  # Queue consumer
lexigram gen task process_payment           # Background task

# Infrastructure & Other
lexigram gen cache_repo ProductCache        # Cache-backed repo (lexigram-cache)
lexigram gen api_client PaymentGateway      # HTTP client (lexigram-http)
lexigram gen document_repo OrderDoc         # NoSQL document repo (lexigram-nosql)
lexigram gen vector_collection Documents    # Vector collection (lexigram-vector)
lexigram gen search_index Products          # Search index (lexigram-search)
lexigram gen storage_driver S3              # Storage backend (lexigram-storage)
lexigram gen feature_flag dark_mode         # Feature flag (lexigram-features)
lexigram gen metric request_latency         # Custom metric (lexigram-monitor)
lexigram gen notification_template welcome  # Notification template
lexigram gen pipeline data_pipeline         # Pipeline stages (lexigram-workflow)

Generated Output Example

lexigram gen model Product produces a SQLAlchemy model:

class ProductModel(Base):
    """Product database model."""
    __tablename__ = "product"
    # typed columns derived from field args

Post-Generation

After running a generator:

  • Register the generated provider in your module (configure())
  • Add any config sections to application.yaml
  • Apply schema changes with lexigram db upgrade (create migrations first with lexigram db migrate <name>)

Common Mistakes

  • Running gen outside a project — CLI needs project context
  • Missing package — extension generators only appear if their package is installed
  • Forgetting to register generated providers — generators scaffold files but don't auto-register

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.