Generate agent-friendly API documentation for Cloudflare Workers and Hono APIs. Use when building llms.txt files, API references, or machine-readable docs. Triggers on tasks involving API documentation, endpoint discovery, llms.txt generation, or docs-as-code pipelines. Covers the three-tier discovery pattern, Hono route scanning, and documentation quality standards.
Rules and patterns for generating high-quality, agent-consumable API documentation from Cloudflare Worker codebases. DocForge turns Hono route handlers into structured docs that both humans and AI agents can discover, understand, and use programmatically.
Reference these guidelines when:
llms.txt or llms-full.txt files for an API.well-known/ discovery endpoints to a Worker| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 |
| Discovery |
| CRITICAL |
discovery- |
| 2 | Route Scanning | HIGH | scanning- |
| 3 | Documentation Output | HIGH | output- |
| 4 | Quality Standards | MEDIUM | quality- |
| 5 | Automation | MEDIUM | automation- |
discovery-three-tier - Implement the three-tier discovery pattern
(llms.txt, llms-full.txt, docs.md)discovery-well-known - Serve .well-known/ endpoints for machine
discoverydiscovery-link-header - Include Link headers pointing to llms.txtscanning-hono-routes - Extract endpoints from Hono route registrationsscanning-middleware-context - Capture auth, rate limits, and middleware
from route chainsscanning-request-response - Infer request/response schemas from handler
codeoutput-llms-txt - Format llms.txt as a concise endpoint directoryoutput-llms-full - Format llms-full.txt with complete request/response
detailsoutput-json-schema - Generate JSON Schema for request/response bodiesoutput-curl-examples - Include working curl examples for every endpointquality-no-truncation - Never truncate response examples or field listsquality-real-values - Use realistic example values, not placeholdersquality-error-responses - Document all error codes and response shapesquality-auth-documented - Always document authentication requirementsautomation-git-hook - Generate docs on commit via pre-push hookautomation-cron-refresh - Schedule periodic doc regenerationautomation-diff-detection - Only regenerate docs when routes changeRead individual rule files for detailed explanations and code examples:
rules/discovery-three-tier.md
rules/scanning-hono-routes.md
rules/output-llms-txt.md
Each rule file contains: