openapi-to-application-code
Skill này làm gì
Công cụ này tạo một ứng dụng hoàn chỉnh, sẵn sàng dùng từ một file mô tả API (gọi là OpenAPI). Nó hiểu cách API nên hoạt động và tạo mã cần thiết.
Khi nào nên dùng
- ✓Khi bạn có mô tả API và muốn một ứng dụng dùng nó.
- ✓Khi bạn muốn nhanh chóng tạo một nguyên mẫu ứng dụng dựa trên API có sẵn.
- ✓Khi bạn bắt đầu dự án mới và muốn tự động tạo cấu trúc mã cơ bản.
Liên kết skill
https://github.com/github/awesome-copilot/blob/main/skills/openapi-to-application-code/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tạo một ứng dụng từ đặc tả OpenAPI tại 'https://api.example.com/v2/openapi.json', dùng framework 'Spring Boot' và xác thực 'JWT'.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
AI đọc mô tả API (OpenAPI), hiểu dữ liệu và các chức năng có sẵn. Sau đó, nó lắp ráp cấu trúc ứng dụng, viết mã cho từng phần (như nhận yêu cầu, xử lý dữ liệu và phản hồi), rồi thêm test và tài liệu.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
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
- A URL to the OpenAPI spec (e.g.,
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:
- Review the generated code structure and make customizations as needed
- Install dependencies according to framework requirements
- Configure environment variables and database connections
- Run tests to verify generated code
- Start the development server
- 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?
Câu hỏi thường gặp
Đặc tả OpenAPI là gì?
Đó là một file mô tả cách API hoạt động, gồm dữ liệu nó nhận và trả về, cùng các hành động nó có thể thực hiện.
Ứng dụng được tạo ra đã chạy được chưa?
Có, mục tiêu là tạo ra một ứng dụng hoàn chỉnh và chạy được, sẵn sàng để cấu hình và chạy.
Tôi có thể chọn công nghệ dùng cho ứng dụng không?
Có, bạn có thể chỉ định framework và các công nghệ khác nếu chúng chưa được xác định trong đặc tả API.
Chi tiết
Mô tả gốc của tác giả
Generate a complete, production-ready application from an OpenAPI specification
repo: github/awesome-copilot
Độ phổ biến
- Sao GitHub
- 40k
- Vị trí xếp hạng
- #7313
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
acquire-codebase-knowledge
40kGiúp agent của bạn hiểu và ghi tài liệu cho một dự án mã nguồn có sẵn. Hữu ích khi đón thành viên mới hoặc nắm tổng quan về kiến trúc.
acreadiness-assess
40kGiúp agent của bạn đánh giá mức độ sẵn sàng cho AI của dự án và tạo báo cáo. Hữu ích để biết dự án đã sẵn sàng dùng công cụ AI đến đâu.
acreadiness-generate-instructions
40kGiúp agent của bạn tạo hướng dẫn cho công cụ AI dựa trên kết quả đánh giá. Hữu ích để cải thiện cách AI làm việc với mã và khắc phục các khoảng trống.
acreadiness-policy
40kGiúp agent của bạn xác định hoặc áp dụng chính sách đánh giá dự án bằng AI. Hữu ích để chuẩn hóa cách đánh giá dự án và đảm bảo tuân thủ.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.