SDK Docs Auditor
Produces a comprehensive, cross-referenced audit of any SDK documentation site with a fully styled downloadable HTML report.
What this skill does
- Discovers all SDK pages via
llms.txt first, falling back to sitemap.xml (using curl), then homepage nav crawl
- Fetches and reads every relevant SDK page
- Audits six fixed sections: Installation, Quick Start, Error Handling, Troubleshooting, Examples, Best Practices
- Cross-references every gap across ALL other SDK pages — never flag something as missing if it exists elsewhere
- Scores each section 0–100 and assigns a rating tier
- Generates a beautiful, self-contained, downloadable HTML report
Step 1 — Discover all SDK pages
Use a three-tier discovery strategy, trying each method in order until one succeeds.
1a. Try llms.txt first (preferred)
Run a bash curl command to fetch llms.txt:
curl -s <docs_url>/llms.txt
If found:
- Extract every URL from lines matching the pattern
- [Page Title](URL): description
- Filter to SDK-relevant pages only — keep URLs whose path contains any of:
sdk, installation, quickstart, quick-start, error, troubleshoot, example, best-practice, getting-started, reference, api-reference, overview, client, service, memory, search, worker, job, policy, agent, team
- Exclude: marketing pages, changelog, blog, legal, community/forum pages
- Store as
SDK_PAGES[] — list of {title, url, description}
- Note in the report: "Discovery method: llms.txt"
1b. Fallback — Try sitemap.xml
If llms.txt is unavailable or returns no useful URLs, run a bash curl command to fetch the sitemap:
curl -s <docs_url>/sitemap.xml | python3 -c "import sys, re; print('\n'.join(re.findall(r'<loc>(.*?)</loc>', sys.stdin.read())))"
If the sitemap returns URLs:
- Parse every
<loc> entry to get the full URL list
- Filter using the same keyword list above
- Store as
SDK_PAGES[] — list of {title, url}
- Note in the report: "Discovery method: sitemap.xml — N total URLs found, M SDK-relevant kept"
Also check for a sitemap index (multiple sitemaps) by looking for <sitemapindex> in the response. If found, curl each child sitemap and aggregate all URLs before filtering.
1c. Final fallback — Homepage nav crawl
If both llms.txt and sitemap.xml fail, fetch the docs homepage (<docs_url>) and extract all links from the nav sidebar or sitemap structure, filtering using the same keyword list.
- Note in the report: "Discovery method: homepage nav crawl (llms.txt and sitemap.xml unavailable)"
1d. Identify section mapping
From the discovered pages, identify which pages map to the six audit targets:
| Audit section |
Look for paths/titles containing |
| Installation |
install, setup, getting-started |
| Quick Start |
quick-start, quickstart, tutorial |
| Error Handling |
error, exception, errors |
| Troubleshooting |
troubleshoot, faq, debug |
| Examples |
example, sample, cookbook, tutorial |
| Best Practices |
best-practice, guide, pattern |
If a dedicated page is not found for a section, note it — the absence itself is a finding.
Build the corpus
All discovered pages form the page corpus used for both section auditing and cross-referencing.
Report discovery summary:
Found N pages via [sitemap.xml / llms.txt / nav crawl]. Kept M SDK-relevant pages. Fetching now...
Step 2 — Fetch every page in the corpus
Fetch each page using bash_tool with curl, stripping HTML tags via Python to extract plain text. Do NOT use web_fetch for corpus pages — curl is more reliable and avoids permission errors.
Use this pattern for each page URL:
curl -s "https://docs.example.com/sdk/some-page" -L | python3 -c "
import sys, re, html
content = sys.stdin.read()
content = re.sub(r'<script[^>]*>.*?</script>', '', content, flags=re.DOTALL)
content = re.sub(r'<style[^>]*>.*?</style>', '', content, flags=re.DOTALL)
text = re.sub(r'<[^>]+>', ' ', content)
text = html.unescape(text)
text = re.sub(r'\s+', ' ', text).strip()
print(text[:6000])
"
Batch multiple pages in a single bash call using a loop to minimise round-trips:
```bash
for page in installation quick-start error-handling troubleshooting examples best-practices overview api-reference; do
echo "=== PAGE: $page ==="
curl -s "https://docs.example.com/sdk/$page" -L | python3 -c "
import sys, re, html
content = sys.stdin.read()
content = re.sub(r'<script[^>]*>.*?</script>', '', content, flags=re.DOTALL)
content = re.sub(r'<style[^>]*>.*?</style>', '', content, flags=re.DOTALL)
text = re.sub(r'<[^>]+>', ' ', content)
text = html.unescape(text)
text = re.sub(r'\s+', ' ', text).strip()
print(text[:6000])
"
echo ""
done
For large sites (>30 pages), prioritise in this order:
- The six target section pages (installation, quick-start, error-handling, troubleshooting, examples, best-practices)
- Overview / client overview pages
- API reference
- Service-specific pages (agents, jobs, workers, policies, memory, search, etc.)
Step 3 — Audit the six target sections
For each of the six sections below, read its page carefully and evaluate against the criteria. Then check every other fetched page to see if any gap is actually addressed elsewhere.
3a. Installation
Must have (deduct heavily if missing):
- Prerequisites with exact versions (Python/Node/language version, package manager)
- At least one complete install command (pip/npm/etc.)
- Authentication setup with exact steps to obtain and configure credentials
- A working verification snippet that proves the install succeeded
- At least one expected output or confirmation of success
Should have (deduct moderately):
- Multiple install methods (package manager, source, Docker)
- IDE/editor setup
- Environment variable configuration with
.env examples
- Version compatibility table
- Optional dependency explanations (what each extra includes)
- Constructor parameter reference (all params, types, defaults)
Common gaps to check across other pages:
- Env-var auto-detection (does the client read env vars when called with no args?) — check api-reference, overview
- Advanced constructor params (timeout, retries, org) — check api-reference
- Version pinning guidance — check any getting-started pages
3b. Quick Start
Must have:
- A minimal, numbered step-by-step path a first-time user can follow in under 5 minutes
- Complete working code from zero to first successful call
- Expected output for every code snippet
- Explanation of any prerequisite service/resource (queues, workers, etc.)
Should have:
- Both env-var and inline credential patterns
- Multiple install options (pip + poetry, etc.)
- Links to deeper docs for each concept introduced
Common gaps to check:
- Worker/queue prerequisites — check workers/environments pages
- Valid model/runtime IDs — check models/runtimes service pages
- Execute call signature accuracy — check api-reference and agents service pages
3c. Error Handling
Must have:
- Complete exception hierarchy (all exception classes, inheritance tree)
- Every exception class documented with: description, import path, code example
- At minimum: authentication, connection, timeout, rate-limit, API/HTTP errors
- HTTP status code branching (400/401/403/404/500 at minimum)
- At least one resilience pattern (retry with backoff)
Should have:
- Resource-specific exceptions (one per major service)
- Streaming error handling
- Context manager cleanup pattern
- Testing/pytest examples for error scenarios
- Do/don't anti-pattern examples
Cross-reference check — critical:
- List every exception class that appears in the api-reference or service pages
- Flag any that are missing from this page
- Check execute/method call signatures match across all pages — flag any discrepancies
3d. Troubleshooting
Must have:
- Authentication failures with diagnostic steps
- Connection / timeout issues with solutions
- At least one service-specific troubleshooting section
Should have:
- Troubleshooting for every major service (workers, jobs, policies, agents, etc.)
- Self-hosted / custom base_url issues
- Import errors with correct import paths
- A summary error-message lookup table
- Rate limiting with backoff references
- Actionable "getting help" checklist with actual links/commands
Cross-reference check:
- For every service page that has its own error handling section, check if its scenarios appear here
- Check if dataset/resource creation methods are linked when "not found" errors are described
- Check if health check API is referenced in the "verify status" step
3e. Examples
Must have:
- At least one complete, runnable end-to-end example per major service
- Expected output shown for every example
- Error handling within workflow examples
Should have:
- Coverage across: agent lifecycle, jobs/scheduling, memory/recall, semantic search, policy management, worker management, streaming
- No "workflow" examples that only survey resources without executing anything
- Multi-turn / session management examples where the SDK supports sessions
Cross-reference check — this is where most gaps accumulate:
- For every service that has its own dedicated page with examples, check if those examples are represented here
- Flag each missing service category with the source page that has the examples
3f. Best Practices
Must have:
- Authentication / credential security section
- Error handling / retry logic
- Performance (batching, pagination, caching)
Should have:
- One best-practices section per major service (workers, jobs, policies, agents)
- Resource cleanup / context managers
- Code organisation (type hints, reusable functions)
- Testing patterns
- Concurrency / thread-safety guidance
- Secret rotation / credential lifecycle
Cross-reference check:
- For every service page that defines its own best practices, check if those patterns appear here
- Note if concurrency/thread-safety is addressed anywhere in the entire corpus
Step 4 — Score each section
Score 0–100 using this rubric:
| Score |
Meaning |
| 85–100 |
Strong — all must-haves present, most should-haves, few gaps |
| 70–84 |
Good — all must-haves, some should-haves missing |
| 50–69 |
Adequate — most must-haves but notable gaps |
| 30–49 |
Weak — multiple must-haves missing |
| 0–29 |
Poor — section is superficial or largely absent |
Assign a rating label: Strong / Good / Adequate / Weak / Poor
Step 5 — Build the gap list for each section
For every gap:
- Write a clear one-sentence description of what is missing
- Tag it with where the content EXISTS in the corpus (if it does):
[covered in: page-name]
- Or tag it:
[not covered anywhere in corpus]
This distinction is critical — a gap that exists nowhere needs a new page; a gap that exists elsewhere just needs a cross-reference or consolidation.
Step 6 — Derive top priority recommendations
Rank the top 6–8 actions by impact × effort. Prioritise:
- Factual errors / signature mismatches (highest priority — causes user failures)
- Must-have gaps not covered anywhere
- Must-have gaps covered elsewhere but not linked
- High-value should-have gaps
- Cross-referencing and consolidation opportunities
Step 7 — Generate the HTML report
Read the template at assets/report-template.html and inject all audit data into it.
Fill these placeholders:
__AUDIT_URL__ → the audited URL
__PAGES_FETCHED__ → total pages fetched
__AUDIT_DATE__ → today's date
__SECTION_DATA_JSON__ → JSON blob (see schema below)
__PRIORITIES_JSON__ → JSON blob (see schema below)
__OVERALL_SCORE__ → integer 0-100 (weighted average of six scores)
Data schema
{
"sections": [
{
"num": "01",
"name": "Installation Guide",
"rating": "Good",
"score": 74,
"strengths": ["string", ...],
"gaps": [
{
"text": "Description of the gap",
"covered_in": ["page-name-1", "page-name-2"],
"nowhere": false
}
]
}
]
}
Set "nowhere": true and "covered_in": [] when the gap exists nowhere in the corpus.
{
"priorities": [
{
"rank": 1,
"text": "Fix X in Y page. The correct form per api-reference is Z.",
"type": "error"
}
]
}
Priority types: "error" (factual mistake), "missing" (not covered anywhere), "xref" (covered elsewhere, needs linking), "improvement" (should-have gap).
Output
Save the final report to /mnt/user-data/outputs/sdk-audit-report.html and present it with present_files.
Tell the user:
- How many pages were fetched
- The overall score and what it means
- The single most critical finding
Do NOT reproduce the full report text in the chat — just present the file and give the brief summary.
1---2name: sdk-docs-auditor3description: Audits any SDK documentation site and produces a fully scored, downloadable HTML report. Use this skill whenever a user provides a documentation URL and asks to audit, review, analyse, score, or check the quality of SDK docs. Also trigger for phrases like "audit the SDK docs at X", "check if the docs at X are complete", "review this SDK documentation", "how good are these docs", "run an SDK audit on X", or any time a user pastes a URL alongside words like audit, review, crawl, check, analyse, quality, completeness, or gaps. ALWAYS use this skill — do not attempt the audit without following this structured crawl → analyse → cross-reference → report workflow.4---56# SDK Docs Auditor78Produces a comprehensive, cross-referenced audit of any SDK documentation site with a fully styled downloadable HTML report.910## What this skill does11121. Discovers all SDK pages via `llms.txt` first, falling back to `sitemap.xml` (using curl), then homepage nav crawl132. Fetches and reads every relevant SDK page143. Audits six fixed sections: Installation, Quick Start, Error Handling, Troubleshooting, Examples, Best Practices154. Cross-references every gap across ALL other SDK pages — never flag something as missing if it exists elsewhere165. Scores each section 0–100 and assigns a rating tier176. Generates a beautiful, self-contained, downloadable HTML report1819---2021## Step 1 — Discover all SDK pages2223Use a three-tier discovery strategy, trying each method in order until one succeeds.2425### 1a. Try llms.txt first (preferred)2627Run a bash curl command to fetch llms.txt:2829```bash30curl -s <docs_url>/llms.txt31```3233If found:34- Extract every URL from lines matching the pattern `- [Page Title](URL): description`35- Filter to SDK-relevant pages only — keep URLs whose path contains any of:36 `sdk`, `installation`, `quickstart`, `quick-start`, `error`, `troubleshoot`, `example`, `best-practice`, `getting-started`, `reference`, `api-reference`, `overview`, `client`, `service`, `memory`, `search`, `worker`, `job`, `policy`, `agent`, `team`37- Exclude: marketing pages, changelog, blog, legal, community/forum pages38- Store as `SDK_PAGES[]` — list of `{title, url, description}`39- Note in the report: "Discovery method: llms.txt"4041### 1b. Fallback — Try sitemap.xml4243If llms.txt is unavailable or returns no useful URLs, run a bash curl command to fetch the sitemap:4445```bash46curl -s <docs_url>/sitemap.xml | python3 -c "import sys, re; print('\n'.join(re.findall(r'<loc>(.*?)</loc>', sys.stdin.read())))"47```4849If the sitemap returns URLs:50- Parse every `<loc>` entry to get the full URL list51- Filter using the same keyword list above52- Store as `SDK_PAGES[]` — list of `{title, url}`53- Note in the report: "Discovery method: sitemap.xml — N total URLs found, M SDK-relevant kept"5455Also check for a sitemap index (multiple sitemaps) by looking for `<sitemapindex>` in the response. If found, curl each child sitemap and aggregate all URLs before filtering.5657### 1c. Final fallback — Homepage nav crawl5859If both llms.txt and sitemap.xml fail, fetch the docs homepage (`<docs_url>`) and extract all links from the nav sidebar or sitemap structure, filtering using the same keyword list.60- Note in the report: "Discovery method: homepage nav crawl (llms.txt and sitemap.xml unavailable)"6162### 1d. Identify section mapping6364From the discovered pages, identify which pages map to the six audit targets:6566| Audit section | Look for paths/titles containing |67|---|---|68| Installation | `install`, `setup`, `getting-started` |69| Quick Start | `quick-start`, `quickstart`, `tutorial` |70| Error Handling | `error`, `exception`, `errors` |71| Troubleshooting | `troubleshoot`, `faq`, `debug` |72| Examples | `example`, `sample`, `cookbook`, `tutorial` |73| Best Practices | `best-practice`, `guide`, `pattern` |7475If a dedicated page is not found for a section, note it — the absence itself is a finding.7677### Build the corpus7879All discovered pages form the **page corpus** used for both section auditing and cross-referencing.8081Report discovery summary:82> Found N pages via [sitemap.xml / llms.txt / nav crawl]. Kept M SDK-relevant pages. Fetching now...8384---8586## Step 2 — Fetch every page in the corpus8788Fetch each page using `bash_tool` with `curl`, stripping HTML tags via Python to extract plain text. Do NOT use `web_fetch` for corpus pages — curl is more reliable and avoids permission errors.8990Use this pattern for each page URL:9192```bash93curl -s "https://docs.example.com/sdk/some-page" -L | python3 -c "94import sys, re, html95content = sys.stdin.read()96content = re.sub(r'<script[^>]*>.*?</script>', '', content, flags=re.DOTALL)97content = re.sub(r'<style[^>]*>.*?</style>', '', content, flags=re.DOTALL)98text = re.sub(r'<[^>]+>', ' ', content)99text = html.unescape(text)100text = re.sub(r'\s+', ' ', text).strip()101print(text[:6000])102"103104Batch multiple pages in a single bash call using a loop to minimise round-trips:105106```bash107for page in installation quick-start error-handling troubleshooting examples best-practices overview api-reference; do108 echo "=== PAGE: $page ==="109 curl -s "https://docs.example.com/sdk/$page" -L | python3 -c "110import sys, re, html111content = sys.stdin.read()112content = re.sub(r'<script[^>]*>.*?</script>', '', content, flags=re.DOTALL)113content = re.sub(r'<style[^>]*>.*?</style>', '', content, flags=re.DOTALL)114text = re.sub(r'<[^>]+>', ' ', content)115text = html.unescape(text)116text = re.sub(r'\s+', ' ', text).strip()117print(text[:6000])118"119 echo ""120done121```122123For large sites (>30 pages), prioritise in this order:1241. The six target section pages (installation, quick-start, error-handling, troubleshooting, examples, best-practices)1252. Overview / client overview pages1263. API reference1274. Service-specific pages (agents, jobs, workers, policies, memory, search, etc.)128129---130131## Step 3 — Audit the six target sections132133For each of the six sections below, read its page carefully and evaluate against the criteria. Then check every other fetched page to see if any gap is actually addressed elsewhere.134135### 3a. Installation136137**Must have (deduct heavily if missing):**138- Prerequisites with exact versions (Python/Node/language version, package manager)139- At least one complete install command (pip/npm/etc.)140- Authentication setup with exact steps to obtain and configure credentials141- A working verification snippet that proves the install succeeded142- At least one expected output or confirmation of success143144**Should have (deduct moderately):**145- Multiple install methods (package manager, source, Docker)146- IDE/editor setup147- Environment variable configuration with `.env` examples148- Version compatibility table149- Optional dependency explanations (what each extra includes)150- Constructor parameter reference (all params, types, defaults)151152**Common gaps to check across other pages:**153- Env-var auto-detection (does the client read env vars when called with no args?) — check api-reference, overview154- Advanced constructor params (timeout, retries, org) — check api-reference155- Version pinning guidance — check any getting-started pages156157### 3b. Quick Start158159**Must have:**160- A minimal, numbered step-by-step path a first-time user can follow in under 5 minutes161- Complete working code from zero to first successful call162- Expected output for every code snippet163- Explanation of any prerequisite service/resource (queues, workers, etc.)164165**Should have:**166- Both env-var and inline credential patterns167- Multiple install options (pip + poetry, etc.)168- Links to deeper docs for each concept introduced169170**Common gaps to check:**171- Worker/queue prerequisites — check workers/environments pages172- Valid model/runtime IDs — check models/runtimes service pages173- Execute call signature accuracy — check api-reference and agents service pages174175### 3c. Error Handling176177**Must have:**178- Complete exception hierarchy (all exception classes, inheritance tree)179- Every exception class documented with: description, import path, code example180- At minimum: authentication, connection, timeout, rate-limit, API/HTTP errors181- HTTP status code branching (400/401/403/404/500 at minimum)182- At least one resilience pattern (retry with backoff)183184**Should have:**185- Resource-specific exceptions (one per major service)186- Streaming error handling187- Context manager cleanup pattern188- Testing/pytest examples for error scenarios189- Do/don't anti-pattern examples190191**Cross-reference check — critical:**192- List every exception class that appears in the api-reference or service pages193- Flag any that are missing from this page194- Check execute/method call signatures match across all pages — flag any discrepancies195196### 3d. Troubleshooting197198**Must have:**199- Authentication failures with diagnostic steps200- Connection / timeout issues with solutions201- At least one service-specific troubleshooting section202203**Should have:**204- Troubleshooting for every major service (workers, jobs, policies, agents, etc.)205- Self-hosted / custom base_url issues206- Import errors with correct import paths207- A summary error-message lookup table208- Rate limiting with backoff references209- Actionable "getting help" checklist with actual links/commands210211**Cross-reference check:**212- For every service page that has its own error handling section, check if its scenarios appear here213- Check if dataset/resource creation methods are linked when "not found" errors are described214- Check if health check API is referenced in the "verify status" step215216### 3e. Examples217218**Must have:**219- At least one complete, runnable end-to-end example per major service220- Expected output shown for every example221- Error handling within workflow examples222223**Should have:**224- Coverage across: agent lifecycle, jobs/scheduling, memory/recall, semantic search, policy management, worker management, streaming225- No "workflow" examples that only survey resources without executing anything226- Multi-turn / session management examples where the SDK supports sessions227228**Cross-reference check — this is where most gaps accumulate:**229- For every service that has its own dedicated page with examples, check if those examples are represented here230- Flag each missing service category with the source page that has the examples231232### 3f. Best Practices233234**Must have:**235- Authentication / credential security section236- Error handling / retry logic237- Performance (batching, pagination, caching)238239**Should have:**240- One best-practices section per major service (workers, jobs, policies, agents)241- Resource cleanup / context managers242- Code organisation (type hints, reusable functions)243- Testing patterns244- Concurrency / thread-safety guidance245- Secret rotation / credential lifecycle246247**Cross-reference check:**248- For every service page that defines its own best practices, check if those patterns appear here249- Note if concurrency/thread-safety is addressed anywhere in the entire corpus250251---252253## Step 4 — Score each section254255Score 0–100 using this rubric:256257| Score | Meaning |258|-------|---------|259| 85–100 | Strong — all must-haves present, most should-haves, few gaps |260| 70–84 | Good — all must-haves, some should-haves missing |261| 50–69 | Adequate — most must-haves but notable gaps |262| 30–49 | Weak — multiple must-haves missing |263| 0–29 | Poor — section is superficial or largely absent |264265Assign a rating label: **Strong / Good / Adequate / Weak / Poor**266267---268269## Step 5 — Build the gap list for each section270271For every gap:272- Write a clear one-sentence description of what is missing273- Tag it with where the content EXISTS in the corpus (if it does): `[covered in: page-name]`274- Or tag it: `[not covered anywhere in corpus]`275276This distinction is critical — a gap that exists nowhere needs a new page; a gap that exists elsewhere just needs a cross-reference or consolidation.277278---279280## Step 6 — Derive top priority recommendations281282Rank the top 6–8 actions by impact × effort. Prioritise:2831. Factual errors / signature mismatches (highest priority — causes user failures)2842. Must-have gaps not covered anywhere2853. Must-have gaps covered elsewhere but not linked2864. High-value should-have gaps2875. Cross-referencing and consolidation opportunities288289---290291## Step 7 — Generate the HTML report292293Read the template at `assets/report-template.html` and inject all audit data into it.294295Fill these placeholders:296- `__AUDIT_URL__` → the audited URL297- `__PAGES_FETCHED__` → total pages fetched298- `__AUDIT_DATE__` → today's date299- `__SECTION_DATA_JSON__` → JSON blob (see schema below)300- `__PRIORITIES_JSON__` → JSON blob (see schema below)301- `__OVERALL_SCORE__` → integer 0-100 (weighted average of six scores)302303### Data schema304305```json306{307 "sections": [308 {309 "num": "01",310 "name": "Installation Guide",311 "rating": "Good",312 "score": 74,313 "strengths": ["string", ...],314 "gaps": [315 {316 "text": "Description of the gap",317 "covered_in": ["page-name-1", "page-name-2"],318 "nowhere": false319 }320 ]321 }322 ]323}324```325326Set `"nowhere": true` and `"covered_in": []` when the gap exists nowhere in the corpus.327328```json329{330 "priorities": [331 {332 "rank": 1,333 "text": "Fix X in Y page. The correct form per api-reference is Z.",334 "type": "error"335 }336 ]337}338```339340Priority types: `"error"` (factual mistake), `"missing"` (not covered anywhere), `"xref"` (covered elsewhere, needs linking), `"improvement"` (should-have gap).341342---343344## Output345346Save the final report to `/mnt/user-data/outputs/sdk-audit-report.html` and present it with `present_files`.347348Tell the user:349- How many pages were fetched350- The overall score and what it means351- The single most critical finding352353Do NOT reproduce the full report text in the chat — just present the file and give the brief summary.