Open Sourcing Our Cloudflare Workers Tools
We are open sourcing some Cloudflare Workers tools we use on this site - one helps AI agents read our content, the other handles our contact form securely.
We design civil engineering plans for complex hillside sites throughout Los Angeles, with a focus on drainage and grading plans for Altadena, Pacific Palisades, and Malibu fire rebuilds. But we also pay attention to bleeding edge web technology and AI agent standards. We have been working on a few internal tools for this website and decided to open source them on GitHub. You can find the repo at github.com/bwengr/cloudflare-workers.
The repo contains two tools we use on this site.
Markdown for Agents
This is a Cloudflare Pages middleware that helps AI agents read our website better. When an AI agent requests a page with the Accept header set to text/markdown, this tool converts the HTML response into clean markdown. It also adds Link headers that help AI agents discover our sitemap and RSS feed. This makes it easier for AI systems like ChatGPT, Claude, and other agents to understand and reference our content. If you want to check how your own site scores on agent readiness, IsItAgentReady.com runs through similar checks for things like markdown negotiation, Link headers, and sitemap availability.
Contact Form Handler
This is a serverless contact form backend running on Cloudflare Pages. It validates required fields, uses honeypot protection to filter out spam bots, sanitizes email inputs, and sends submissions through Mailgun. This lets us keep our contact form simple without exposing email credentials on the client side.
These tools work together to make our site work better for visitors and AI systems alike. If you use Cloudflare Pages and find these useful, feel free to adapt them for your own projects.