fai-api-docs-generator — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited fai-api-docs-generator (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Generate production-ready API documentation from source artifacts instead of manually maintaining drift-prone markdown. This skill turns OpenAPI specs, route annotations, and example payloads into reference docs, quickstarts, and publishable artifacts.
Choose one primary source of truth and derive the rest.
| Source | Best for | Output |
|---|---|---|
| OpenAPI document | HTTP APIs with existing schema coverage | reference docs, SDK examples, changelog |
| Framework annotations | FastAPI, ASP.NET, NestJS | generated OpenAPI then docs |
| Contract tests | example-heavy public APIs | request and response snippets |
If the spec and implementation diverge, fix the spec generation first. Do not patch the rendered docs by hand.
A useful API doc set should contain:
npx @redocly/cli lint openapi.json
npx spectral lint openapi.jsonFail the pipeline if:
FastAPI example:
from fastapi import FastAPI
from pydantic import BaseModel, Field
app = FastAPI(title="FAI Support API", version="1.0.0")
class TicketRequest(BaseModel):
query: str = Field(..., description="User support request")
top_k: int = Field(5, ge=1, le=20)
class TicketResponse(BaseModel):
category: str
confidence: float
@app.post("/classify", response_model=TicketResponse, summary="Classify support ticket")
async def classify_ticket(body: TicketRequest) -> TicketResponse:
return TicketResponse(category="billing", confidence=0.94)Export the spec during CI:
python -c "from app.main import app; import json; print(json.dumps(app.openapi()))" > openapi.jsonRedocly example:
npx @redocly/cli build-docs openapi.json --output docs/api-reference.htmlFor markdown output, generate one page per tag or resource group so the docs stay navigable.
Examples should be executable and realistic.
{
"query": "Customer asks for a copy of the latest invoice",
"top_k": 5
}{
"category": "billing",
"confidence": 0.94
}Curl example:
curl -X POST https://api.contoso.dev/classify \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"query":"Customer asks for a copy of the latest invoice","top_k":5}'Every public endpoint should map known failures to stable error codes.
| HTTP | Code | Meaning | Client action |
|---|---|---|---|
| 400 | INVALID_INPUT | request body failed validation | fix payload |
| 401 | UNAUTHORIZED | token missing or invalid | refresh token |
| 429 | RATE_LIMITED | quota exceeded | retry after header |
| 500 | INTERNAL_ERROR | unexpected server failure | retry or escalate |
| 503 | DEPENDENCY_UNAVAILABLE | upstream AI service degraded | use fallback or retry |
Document errors in the OpenAPI spec:
responses:
'429':
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWTAlso document:
Retry-After and X-RateLimit-RemainingUse contract tests so example payloads do not rot.
import json
from pathlib import Path
def test_example_request_matches_schema(client):
example = json.loads(Path("docs/examples/classify-request.json").read_text())
response = client.post("/classify", json=example)
assert response.status_code == 200
assert "category" in response.json()name: API Docs
on:
pull_request:
paths: ["app/**", "openapi.json", "docs/examples/**"]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm install -g @redocly/cli @stoplight/spectral-cli
- run: npx @redocly/cli lint openapi.json
- run: npx spectral lint openapi.json
- run: npx @redocly/cli build-docs openapi.json --output docs/api-reference.html| Symptom | Likely cause | Fix |
|---|---|---|
| Docs drift from implementation | spec is hand-edited | regenerate from code or tests |
| Missing schemas in docs | framework models not annotated | add response models and field metadata |
| Example payload fails | stale docs example | validate examples in CI |
| Auth instructions are inconsistent | multiple unofficial docs sources | keep OpenAPI security as source of truth |
Use this skill when the docs need to be regenerated from real API contracts, not polished by hand. Good API documentation is a build artifact backed by tests, linting, and a stable source of truth.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.