E536 Fix agent-friendly documentation issues by JakeSCahill · Pull Request #159 · redpanda-data/docs-site · GitHub
[go: up one dir, main page]

Skip to content

Fix agent-friendly documentation issues#159

Merged
JakeSCahill merged 15 commits intomainfrom
fix-afdocs-issues
Mar 5, 2026
Merged

Fix agent-friendly documentation issues#159
JakeSCahill merged 15 commits intomainfrom
fix-afdocs-issues

Conversation

@JakeSCahill
Copy link
Contributor
@JakeSCahill JakeSCahill commented Feb 26, 2026

Summary

Fixes agent-friendly documentation issues identified by the afdocs checker and adds comprehensive AI agent documentation.

https://deploy-preview-159--redpanda-documentation.netlify.app/llms-full.txt

https://deploy-preview-159--redpanda-documentation.netlify.app/llms.txt

Problem

The afdocs checker identified several issues:

  • Broken links: API URLs returning 503 errors, Twitter/X returning 403, missing sitemap
  • Link resolution: Only 87% of links resolved successfully
  • Environment-specific URLs: Hardcoded docs.redpanda.com URLs prevented testing on deploy previews
  • Missing content: No documentation for AI agents and Agentic Data Plane

Solution

1. Fixed Broken Links

  • Updated API URLs to match actual paths in proxy-api-docs.js edge function
  • Removed dead Twitter/X link (always returns 403 to automated tools)
  • Re-added sitemap.xml link after confirming it exists

2. Added Markdown Access Documentation

  • Documented the indexify convention (all pages are index.md)
  • Explained content negotiation with Accept: text/markdown headers
  • Provided example URLs for accessing markdown content

3. Added AI Agent & Agentic Data Plane Documentation

  • Comprehensive section covering:
    • Agentic Data Plane overview
    • Model Context Protocol (MCP)
    • AI Gateway
    • Building AI agents
    • Agent observability

4. Implemented Dynamic llms.txt Generation

Key Innovation: Converted llms.txt to llms.adoc page with environment-aware URL generation via new convert-llms-to-txt Antora extension.

How it works:

  1. Author llms.adoc as a regular Antora page with {site-url} attribute placeholders
  2. Antora automatically expands AsciiDoc attributes during page processing
  3. convert-to-markdown extension converts HTML page to markdown
  4. convert-llms-to-txt extension:
    • Detects environment using PREVIEW env var and playbook.site.url
    • Extracts markdown from page.markdownContents
    • Unpublishes the HTML page
    • Generates llms.txt at site root
    • Generates llms-full.txt with all markdown from latest versions (~12MB)

Environment-aware URLs:

  • Production: https://docs.redpanda.com
  • PR previews: https://deploy-preview-NNN--redpanda-documentation.netlify.app
  • Local builds: http://localhost:8000

This enables CI/CD testing with afdocs on deploy previews before merging to production.

Changes

Modified Files

  • home/modules/ROOT/pages/llms.adoc - New page (converted from llms.txt)
  • antora-playbook.yml - Added convert-llms-to-txt extension
  • local-antora-playbook.yml - Added convert-llms-to-txt extension (local path)
  • preview-antora-playbook.yml - Added convert-llms-to-txt extension

Removed Files

  • home/modules/ROOT/attachments/llms.txt - Replaced by llms.adoc page

Testing

Local testing with netlify dev:

  • llms.txt: 7KB with correct URLs and markdown formatting
  • llms-full.txt: 12MB with 1,583 pages from latest versions
  • Edge functions working correctly
  • Markdown content negotiation working
  • All formatting converted properly

Link resolution:

  • Improved from 87% to 100%
  • All broken links fixed

afdocs results:

Link resolution: 100%
Content accessible: ✓
Markdown support: ✓

Related

@JakeSCahill JakeSCahill requested a review from a team as a code owner February 26, 2026 13:19
@netlify
Copy link
netlify bot commented Feb 26, 2026

Deploy Preview for redpanda-documentation ready!

Name Link
🔨 Latest commit 2aff17a
🔍 Latest deploy log https://app.netlify.com/projects/redpanda-documentation/deploys/69a8900e11693100084e00b3
😎 Deploy Preview https://deploy-preview-159--redpanda-documentation.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 91 (🟢 up 20 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (🟢 up 25 from production)
SEO: 83 (🔴 down 9 from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

- Fix broken links (API URLs, removed dead Twitter/X link, re-add sitemap.xml)
- Add markdown access documentation (indexify convention, content negotiation)
- Add comprehensive AI agents and Agentic Data Plane documentation section
- Convert llms.txt to llms.adoc page for dynamic URL generation
- Configure convert-llms-to-txt extension for environment-aware URLs
  - Production: https://docs.redpanda.com
  - PR previews: https://deploy-preview-NNN--redpanda-documentation.netlify.app
  - Local: http://localhost:8000
- Generate llms-full.txt with all latest version markdown (12MB, 1583 pages)

Requires docs-extensions-and-macros#173 to be merged and published to npm
before this PR can be merged.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
JakeSCahill and others added 4 commits March 2, 2026 08:56
- Add afdocs as dev dependency (^0.3.4)
- Add npm script to run afdocs checks (excludes HTML-specific checks)
- Create GitHub Actions workflow to run on PR deploys
- Exclude HTML-specific checks: page-size-html, content-start-position
- Include all other checks: llms.txt validation, markdown support,
  URL stability, caching, and authentication checks

The workflow waits for Netlify deploy preview and runs checks against
the deployed site to ensure agent-friendly documentation standards.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updated all links to use .md extensions for direct markdown access:
- Top-level components: /current/ → /current.md
- All other pages: /path/page → /path/page/index.md

This ensures AI agents get direct markdown links and makes afdocs checks pass:
- llms-txt-links-markdown
- markdown-url-support
- content-negotiation

All links now point to markdown files via Netlify redirects and the
indexify convention.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add commit_ref parameter to wait-for-netlify action to ensure it waits
  for the deploy of the specific commit that triggered the workflow
- Add continue-on-error: true to afdocs step so workflow doesn't fail CI
  when some checks don't pass (informational only)
- Improve PR comment to show pass/fail status and commit SHA
- Remove redundant ternary for PR check in comment

This fixes the timing issue where the action would run against an old
deploy instead of waiting for the new one to finish building.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@redpanda-data redpanda-data deleted a comment from github-actions bot Mar 2, 2026
@redpanda-data redpanda-data deleted a comment from github-actions bot Mar 2, 2026
@redpanda-data redpanda-data deleted a comment from github-actions bot Mar 3, 2026
JakeSCahill and others added 8 commits March 3, 2026 18:37
This version includes the fix for URL encoding in llms.txt where em dashes
were breaking Netlify deploy preview URLs.

Fixes:
- Convert em dashes back to double hyphens in URLs
- Resolves afdocs check failures for links-resolve, markdown-url-support, and content-negotiation
This version includes the fix for zero-width spaces and other invisible
Unicode characters in llms.txt URLs.

Fixes:
- Strip zero-width space (U+200B)
- Strip zero-width non-joiner (U+200C)
- Strip zero-width joiner (U+200D)
- Strip zero-width no-break space (U+FEFF)

This should resolve the remaining broken links in afdocs checks.
- Fix console config URL: /current/console/config/index.md → /current/console/config.md
- Remove /index.md from API doc URLs (HTML-only OpenAPI specs, no markdown)
- Fix redpanda-labs shortcut: /redpanda-labs.md → /redpanda-labs/home/index.md
- Fix version shortcut: /24.1.md → /24.1/home/index.md

This resolves the 7 broken links identified by afdocs checks.
- Fix console config path: /current/console/config.md → /current/manage/console/index.md (path changed)
- Remove Tutorials & use cases section (redpanda-labs doesn't have markdown version)

All remaining URLs now resolve correctly with markdown support.
API docs do support markdown format at /api/doc/{name}.md URLs.

Added back:
- /api/doc/admin.md
- /api/doc/schema-registry.md
- /api/doc/http-proxy.md
- /api/doc/cloud-controlplane.md
API docs .md files were being returned with text/plain content-type
from Bump.sh. Updated edge function to detect .md requests and set
correct text/markdown; charset=utf-8 content-type.

This fixes the content-negotiation warning in afdocs checks.
@JakeSCahill JakeSCahill requested review from a team and Feediver1 March 4, 2026 20:39
Copy link
Contributor
@Feediver1 Feediver1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@JakeSCahill JakeSCahill merged commit dd2424a into main Mar 5, 2026
5 checks passed
@JakeSCahill JakeSCahill deleted the fix-afdocs-issues branch March 5, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0