Laravel Markdown Response banner
spatie spatie

Laravel Markdown Response

AI community

Description

Serve markdown versions of your HTML pages to AI agents and bots

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Logo for laravel-markdown-response

Serve markdown versions of your HTML pages to AI agents and bots

[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-markdown-response.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-markdown-response) [![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/spatie/laravel-markdown-response/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/spatie/laravel-markdown-response/actions?query=workflow%3Arun-tests+branch%3Amain) [![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/spatie/laravel-markdown-response/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/spatie/laravel-markdown-response/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain) [![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-markdown-response.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-markdown-response)

AI agents increasingly consume web content. This package lets your Laravel app serve markdown versions of HTML pages. Markdown requests are detected via `Accept: text/markdown` header, known AI user agent patterns, or `.md` URL suffix. The conversion is driver-based (local PHP or Cloudflare Workers AI), results are cached, and HTML can be preprocessed before conversion.

Here's a quick example:

use Spatie\MarkdownResponse\Middleware\ProvideMarkdownResponse;

Route::middleware(P