Aspnet-Minimal-Api-Openapi
Aspnet-Minimal-Api-Openapi是一款code方向的AI技能,核心价值是Create ASP,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。
Create ASP.NET Minimal API endpoints with proper OpenAPI documentation
mkdir -p ./skills/aspnet-minimal-api-openapi && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/aspnet-minimal-api-openapi/SKILL.md -o ./skills/aspnet-minimal-api-openapi/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# ASP.NET Minimal API with OpenAPI
Your goal is to help me create well-structured ASP.NET Minimal API endpoints with correct types and comprehensive OpenAPI/Swagger documentation.
API Organization
- Group related endpoints using `MapGroup()` extension
- Use endpoint filters for cross-cutting concerns
- Structure larger APIs with separate endpoint classes
- Consider using a feature-based folder structure for complex APIs
Request and Response Types
- Define explicit request and response DTOs/models
- Create clear model classes with proper validation attributes
- Use record types for immutable request/response objects
- Use meaningful property names that align with API design standards
- Apply `[Required]` and other validation attributes to enforce constraints
- Use the ProblemDetailsService and StatusCodePages to get standard error responses
Type Handling
- Use strongly-typed route parameters with explicit type binding
- Use `Results<T1, T2>` to represent multiple response types
- Return `TypedResults` instead of `Results` for strongly-typed responses
- Leverage C# 10+ features like nullable annotations and init-only properties
OpenAPI Documentation
- Use the built-in OpenAPI document support added in .NET 9
- Define operation summary and description
- Add operationIds using the `WithName` extension method
- Add descriptions to properties and parameters with `[Description()]`
- Set proper content types for requests and responses
- Use document transformers to add elements like servers, tags, and security schemes
- Use schema transformers to apply customizations to OpenAPI schemas
🎯 Best For
- Technical writers
- API documentation teams
- Claude users
- GitHub Copilot users
- Software engineers
💡 Use Cases
- Generating JSDoc/TSDoc comments
- Writing README files for new projects
- Code quality improvement
- Best practice enforcement
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply Aspnet-Minimal-Api-Openapi to Your Work
Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.
- 4
Review and Refine
Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.
❓ Frequently Asked Questions
Does it follow my documentation style?
Most documentation skills respect existing style. Provide a style guide or example in your prompt.
Is Aspnet-Minimal-Api-Openapi compatible with Cursor and VS Code?
Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.
Do I need specific dependencies for Aspnet-Minimal-Api-Openapi?
Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.
How do I install Aspnet-Minimal-Api-Openapi?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/aspnet-minimal-api-openapi/SKILL.md, ready to use.
Can I customize this skill for my team?
Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.
⚠️ Common Mistakes to Avoid
Auto-generating without reviewing
AI documentation can contain inaccuracies. Always verify technical accuracy.
Skipping validation
Always test AI-generated code changes, even for simple refactors.
Missing dependency updates
Check if the skill requires updated dependencies or new packages.