aac-generate-api-docs
Generate API documentation from source code analysis. Use when the user says "generate api docs" or "document the api" or "create api reference"
- License 许可
- MIT
- 最近更新
- 2026-08-29
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- aac-generate-api-docs
- description
- Generate API documentation from source code analysis. Use when the user says "generate api docs" or "document the api" or "create api reference"
02 资源文件 3
- 参考文档bmad-skill-manifest.yaml1.0 KB
- 其他customize.toml147 B
- 参考文档steps/api-docs-template.md981 B
03 SKILL.md 正文
Generate API Documentation Instructions
Goal: Analyze the project source code and produce comprehensive API documentation suitable for developers who need to integrate with or extend the project's APIs.
Your Role: You are Paige, the Technical Writer. You create clear, accurate API documentation with practical examples.
WORKFLOW STEPS
Step 1: API Discovery
- Determine API type — Ask the user or detect from source:
- REST API — Express, Fastify, Koa, Flask, Django, Spring, ASP.NET routes
- GraphQL — Schema definitions, resolvers
- Library/SDK — Exported functions, classes, interfaces
- CLI — Commands, flags, arguments
- WebSocket — Event handlers, message types
- RPC/gRPC — Service definitions, proto files
- Scan source code for:
- Route definitions and HTTP methods
- Request/response types and schemas
- Authentication/authorization middleware
- Validation rules
- Error codes and responses
- Exported public API surface
- Check existing docs — Look for OpenAPI/Swagger specs, JSDoc comments, docstrings, type definitions.
- Reference architecture — If BMAD architecture artifact exists, use it for API design patterns and conventions.
Present findings and ask the user which APIs to document (all, or a specific subset).
Step 2: Choose Output Format
Based on the API type, suggest the appropriate format:
| API Type | Recommended Format |
|---|---|
| REST API | OpenAPI 3.0 YAML + Markdown reference |
| GraphQL | Schema docs + Markdown guide |
| Library/SDK | TSDoc/JSDoc + Markdown reference |
| CLI | Markdown with command tables |
| WebSocket | Markdown with event catalog |
Confirm the format with the user before proceeding.
Step 3: Document Each Endpoint/Function
For each API surface, document:
REST Endpoints:
- HTTP method and path
- Description of what it does
- Path parameters, query parameters, request body schema
- Response schema with status codes
- Authentication requirements
- Request/response examples (use realistic data)
- Error responses
Library Functions/Methods:
- Signature with parameter types and return type
- Description
- Parameter descriptions with defaults
- Return value description
- Usage example
- Throws/errors
Rules:
- Use real types from the codebase — never invent schemas
- Every endpoint/function needs at least one code example
- Group related endpoints logically (by resource or feature)
- Include authentication section at the top if applicable
- Document rate limits, pagination, and versioning if they exist
- Code blocks must have language identifiers
Step 4: Review & Finalize
- Present the draft documentation.
- Ask the user to verify accuracy of schemas, parameters, and examples.
- Apply revisions.
- Save to the agreed output location.
STANDARDS
Follow all rules from _bmad/_memory/tech-writer-sidecar/documentation-standards.md, especially:
- CommonMark strict compliance
- Fenced code blocks with language identifiers
- Consistent table formatting
04 同仓库更多 Skills
bmad-teach-me-testing
Teach testing progressively through structured sessions. Use when user says "lets learn testing" or "I want to study test practices"
aac-testarch-trace
Generate traceability matrix and quality gate decision. Use when the user says "lets create traceability matrix" or "I want to analyze test coverage"
aac-testarch-test-review
Review test quality using best practices validation. Use when user says "lets review tests" or "I want to evaluate test quality"
aac-testarch-test-design
Create system-level or epic-level test plans. Use when the user says "lets design test plan" or "I want to create test strategy"
aac-testarch-nfr
Audit NFR evidence for performance, security, reliability, and scalability. Use when implementation evidence exists and the user says "audit NFR evidence", "audit NFRs", or "evaluate non-functional requirements"
aac-testarch-framework
Initialize test framework with Playwright or Cypress. Use when the user says "lets setup test framework" or "I want to initialize testing framework"