Skill
API Documentation Generator Skill for GitHub Copilot
A GitHub Copilot custom skill that generates structured API reference documentation from source code or OpenAPI specifications.

- Sample type
- Skill
- Products
- GitHub Copilot
- Created
- Updated
Sample documentation
How to use this sample
Summary
A GitHub Copilot custom skill that generates structured API reference documentation from source code or OpenAPI specifications. Point Copilot at a controller, route handler, or Swagger spec and it produces clean Markdown docs with endpoints, parameters, request/response schemas, authentication details, and curl examples.
Skill đĄ
The full skill definition is in SKILL.md. To use it, copy the SKILL.md file into your repository's .github/skills/api-docs-generator/ folder.
Trigger Phrases
Say any of these to GitHub Copilot to activate the skill:
- "Generate API documentation"
- "Document this API"
- "Create API docs for this controller"
- "Scaffold API reference docs"
- "Write endpoint documentation"
Description âšī¸
This skill teaches GitHub Copilot to generate professional API reference documentation by analyzing source code. It works with any language/framework (ASP.NET Core, Express.js, FastAPI, etc.) and follows a structured process:
- Analyze the source â identify all endpoints, routes, and resource groups
- Extract parameters â document path, query, header, and body parameters with types
- Document responses â capture all status codes with realistic JSON examples
- Write authentication â describe the auth mechanism and how to use it
- Generate examples â produce a curl command for every endpoint
- Assemble the docs â combine into a structured Markdown document with TOC
The output follows industry-standard API documentation conventions and can be used as-is or fed into documentation tools like DocFX, MkDocs, or Docusaurus.
Contributors đ¨âđģ
Version history
| Version | Date | Comments |
|---|---|---|
| 1.0 | February 18, 2026 | Initial release |
Instructions đ
- Copy the
SKILL.mdfile into your repository at.github/skills/api-docs-generator/SKILL.md - Open a source code file (e.g., a controller or route handler) in VS Code
- Open GitHub Copilot Chat
- Say: "Generate API documentation for this file"
- Copilot will ask for any missing details (API name, base URL, auth method) and then produce structured API docs
Customization đ
- Single or multi-file output: Ask for "one file per endpoint" or "single file" output
- Specific endpoints: Say "Document only the POST endpoints in this controller"
- Custom base URL: Provide your actual API base URL for accurate curl examples
- Add to existing docs: Say "Add documentation for this new endpoint to the existing API docs"
- Extend the skill: Fork the
SKILL.mdand add your organization's documentation template or style guide
Prerequisites
Help
We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.
You can try looking at issues related to this sample to see if anybody else is having the same issues.
If you encounter any issues using this sample, create a new issue.
Finally, if you have an idea for improvement, make a suggestion.
Disclaimer
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

Learn more
References
Background and supporting resources provided by the contributor.