All skills
github avatar

/openapi-to-application-code

@90921cc official
by githubgithub/awesome-copilot40k stars
5,040

Generate a complete, production-ready application from an OpenAPI specification

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/openapi-to-application-code

This session only. Nothing lands on disk.

SKILL.md

β‰ˆ27 tokens always: the name and description. β‰ˆ1.2k when used: this file.

Generate Application from OpenAPI Spec

Your goal is to generate a complete, working application from an OpenAPI specification using the active framework's conventions and best practices.

Input Requirements

  1. OpenAPI Specification: Provide either:

    • A URL to the OpenAPI spec (e.g., https://api.example.com/openapi.json)
    • A local file path to the OpenAPI spec
    • The full OpenAPI specification content pasted directly
  2. Project Details (if not in spec):

    • Project name and description
    • Target framework and version
    • Package/namespace naming conventions
    • Authentication method (if not specified in OpenAPI)

Generation Process

Step 1: Analyze the OpenAPI Specification

  • Validate the OpenAPI spec for completeness and correctness
  • Identify all endpoints, HTTP methods, request/response schemas
  • Extract authentication requirements and security schemes
  • Note data model relationships and constraints
  • Flag any ambiguities or incomplete definitions

Step 2: Design Application Architecture

  • Plan directory structure appropriate for the framework
  • Identify controller/handler grouping by resource or domain
  • Design service layer organization for business logic
  • Plan data models and entity relationships
  • Design configuration and initialization strategy

Step 3: Generate Application Code

  • Create project structure with build/package configuration files
  • Generate models/DTOs from OpenAPI schemas
  • Generate controllers/handlers with route mappings
  • Generate service layer with business logic
  • Generate repository/data access layer if applicable
  • Add error handling, validation, and logging
  • Generate configuration and startup code

Step 4: Add Supporting Files

  • Generate appropriate unit tests for services and controllers
  • Create README with setup and running instructions
  • Add .gitignore and environment configuration templates
  • Generate API documentation files
  • Create example requests/integration tests

Output Structure

The generated application will include:

project-name/
β”œβ”€β”€ README.md                      # Setup and usage instructions
β”œβ”€β”€ [build-config]                 # Framework-specific build files (pom.xml, build.gradle, package.json, etc.)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”œβ”€β”€ [language]/
β”‚   β”‚   β”‚   β”œβ”€β”€ controllers/       # HTTP endpoint handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ services/          # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ models/            # Data models and DTOs
β”‚   β”‚   β”‚   β”œβ”€β”€ repositories/      # Data access (if applicable)
β”‚   β”‚   β”‚   └── config/            # Application configuration
β”‚   β”‚   └── resources/             # Configuration files
β”‚   └── test/
β”‚       β”œβ”€β”€ [language]/
β”‚       β”‚   β”œβ”€β”€ controllers/       # Controller tests
β”‚       β”‚   └── services/          # Service tests
β”‚       └── resources/             # Test configuration
β”œβ”€β”€ .gitignore
β”œβ”€β”€ .env.example                   # Environment variables template
└── docker-compose.yml             # Optional: Docker setup (if applicable)

Best Practices Applied

  • Framework Conventions: Follows framework-specific naming, structure, and patterns
  • Separation of Concerns: Clear layers with controllers, services, and repositories
  • Error Handling: Comprehensive error handling with meaningful responses
  • Validation: Input validation and schema validation throughout
  • Logging: Structured logging for debugging and monitoring
  • Testing: Unit tests for services and controllers
  • Documentation: Inline code documentation and setup instructions
  • Security: Implements authentication/authorization from OpenAPI spec
  • Scalability: Design patterns support growth and maintenance

Next Steps

After generation:

  1. Review the generated code structure and make customizations as needed
  2. Install dependencies according to framework requirements
  3. Configure environment variables and database connections
  4. Run tests to verify generated code
  5. Start the development server
  6. Test endpoints using the provided examples

Questions to Ask if Needed

  • Should the application include database/ORM setup, or just in-memory/mock data?
  • Do you want Docker configuration for containerization?
  • Should authentication be JWT, OAuth2, API keys, or basic auth?
  • Do you need integration tests or just unit tests?
  • Any specific database technology preferences?
  • Should the API include pagination, filtering, and sorting examples?

Source: SKILL.md on GitHub

2 warnings16d5 checks Β· Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is designed to generate application code from OpenAPI specifications. It is generally safe but possesses a vulnerability surface for indirect prompt injection, as it processes external, untrusted specifications that could contain malicious instructions designed to manipulate the agent's output.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: MEDIUM Β· 1 issue

  • Runlayer7mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 Β· 2 sections analyzed

Signed by skilld at 90921cc. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 18 hours ago.

Activeupdated 5 months ago

README badge

README badge for github/awesome-copilot/openapi-to-application-code

Generates a complete application codebase from an OpenAPI specification, creating controllers, services, models, and tests following framework conventions. Supports multiple frameworks and languages, includes error handling, validation, logging, and authentication based on the spec definition.

Generated from the current SKILL.md.

What frameworks does this skill support?
The skill generates applications following the active framework's conventions and best practices, but does not specify which frameworks are supported. Review the skill implementation or documentation for the list of compatible frameworks.
Can I provide the OpenAPI spec as a URL, file, or pasted content?
Yes. The skill accepts an OpenAPI specification as a URL, a local file path, or the full specification content pasted directly.
Does the generated application include database setup?
The skill can generate database/ORM setup, in-memory data, or mock data depending on your configuration. You will be prompted to specify your database technology preference during generation.
What layers does the generated code include?
The generated application includes controllers/handlers, services, models/DTOs, repositories/data access, configuration, and unit tests organized by framework conventions.
Does this handle authentication from the OpenAPI spec?
Yes. The skill extracts authentication requirements and security schemes from the OpenAPI specification and implements them in the generated application.

Generated from the current SKILL.md. These answers refresh after source changes.