PHPackages                             rdcstarr/docs-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rdcstarr/docs-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rdcstarr/docs-generator
=======================

Generate AI-optimized Markdown documentation from Laravel-ecosystem docs sites for Claude, Cursor, and Copilot.

v0.1.5(3w ago)09MITPHPPHP ^8.3

Since Apr 17Pushed 3w agoCompare

[ Source](https://github.com/rdcstarr/docs-generator)[ Packagist](https://packagist.org/packages/rdcstarr/docs-generator)[ RSS](/packages/rdcstarr-docs-generator/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (6)Versions (7)Used By (0)

docs-generator
==============

[](#docs-generator)

Generate AI-optimized Markdown documentation from Laravel-ecosystem docs sites (Laravel, Flux UI, Livewire) for [Claude Code](https://claude.com/claude-code), [Cursor](https://cursor.sh), and [GitHub Copilot](https://github.com/features/copilot).

[![Latest Version on Packagist](https://camo.githubusercontent.com/21ff2a71c5735e78fb2fc1f5fef79f71c11cdfcf323f35ec14f73b00805a9a9e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72646373746172722f646f63732d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rdcstarr/docs-generator)[![License](https://camo.githubusercontent.com/797278c93ca7f1af8999665a6e7279f56127a76baa4a1f30ee6fdd4f2a18b79c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f72646373746172722f646f63732d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Why
---

[](#why)

When you work with AI coding assistants in Laravel projects, the model answers better when it has the official docs close at hand — sliced into small Markdown files you can load on demand. This package fetches the public docs, asks an LLM to rewrite each page as a clean, AI-friendly Markdown file, and writes it into the right folder for your IDE (`.claude/`, `.cursor/rules/`, or `.github/instructions/`).

Features
--------

[](#features)

- Three built-in sources: **Laravel**, **Flux UI** (with authentication for Flux Pro), and **Livewire**
- Three IDE targets: **Claude** (with auto-sync of `CLAUDE.md` index), **Cursor** (`.mdc` with frontmatter), **Copilot** (`.instructions.md`)
- Uses the **native Laravel AI SDK** (`laravel/ai`) — 10+ providers out of the box: DeepSeek, OpenAI, Anthropic, Gemini, Groq, xAI, Mistral, Ollama, Cohere, and more
- Configurable per-project: enable only the sources you use
- Smart retry with rate-limit backoff
- Skip-existing with `--force` to regenerate
- Filter with `--only=routing,eloquent` during development

Installation
------------

[](#installation)

```
composer require rdcstarr/docs-generator
```

Publish the Laravel AI SDK config and run its migrations (used internally by `laravel/ai`):

```
php artisan vendor:publish --provider="Laravel\Ai\AiServiceProvider"
php artisan migrate
```

Then publish this package's config:

```
php artisan vendor:publish --tag=docs-generator-config
```

Setup
-----

[](#setup)

Add the credentials for whichever AI provider and sources you use in `.env`. API keys are read by the Laravel AI SDK, so you can use any provider it supports:

```
# DeepSeek (default)
DEEPSEEK_API_KEY=sk-...

# OpenAI
OPENAI_API_KEY=sk-...

# Anthropic
ANTHROPIC_API_KEY=sk-ant-...

# Gemini
GEMINI_API_KEY=...

# Required only if you use the Flux UI source (for Flux Pro access)
FLUXUI_EMAIL=you@example.com
FLUXUI_PASSWORD=your-password
```

In `config/docs-generator.php`, keep only the sources you want to generate. For a plain Laravel project without Flux/Livewire:

```
'sources' => [
    'laravel' => [
        'driver'  => \Rdcstarr\DocsGenerator\Drivers\LaravelDriver::class,
        'version' => '13.x',
    ],
],
```

Usage
-----

[](#usage)

Generate docs for all enabled sources, for Claude (the default target):

```
php artisan docs:generate
```

Generate only one source:

```
php artisan docs:generate laravel
php artisan docs:generate flux
php artisan docs:generate livewire
```

Target Cursor or Copilot instead of Claude:

```
php artisan docs:generate --for=cursor
php artisan docs:generate laravel --for=copilot
```

Force regeneration of already-generated files:

```
php artisan docs:generate --force
```

Generate only specific pages (matches by slug, case-insensitive, substring):

```
php artisan docs:generate laravel --only=routing,eloquent
```

Use a different AI provider for this run (any key from `config/docs-generator.php`):

```
php artisan docs:generate --provider=openai
php artisan docs:generate --provider=anthropic
php artisan docs:generate --provider=gemini
```

Re-sync the `CLAUDE.md` index without generating any files:

```
php artisan docs:generate --sync-only
php artisan docs:generate laravel --sync-only
```

Output
------

[](#output)

### Claude target (default)

[](#claude-target-default)

```
.claude/
├── laravel/
│   ├── index.md         ← per-source index (filenames + H1 titles)
│   ├── routing.md
│   ├── eloquent.md
│   └── ...
├── flux/
│   ├── index.md
│   └── ...
└── livewire/
    ├── index.md
    └── ...
CLAUDE.md                ← single managed block pointing at the per-source indexes

```

Each source gets its own `index.md` listing every generated file with its H1 title. Your root `CLAUDE.md` is touched only between markers:

```

## Generated documentation

Indexes maintained by docs-generator. Load on demand:

- **Flux UI** → `.claude/flux/index.md`
- **Laravel** → `.claude/laravel/index.md`
- **Livewire** → `.claude/livewire/index.md`

```

Anything outside `\` … `` is preserved untouched, so it's safe to keep your own project instructions in the same file.

### Cursor target

[](#cursor-target)

```
.cursor/rules/
├── laravel.routing.mdc       (with Cursor frontmatter)
├── fluxui.button.mdc
└── livewire.actions.mdc

```

### Copilot target

[](#copilot-target)

```
.github/instructions/
├── laravel.routing.instructions.md
├── fluxui.button.instructions.md
└── livewire.actions.instructions.md

```

Extending
---------

[](#extending)

### Add a new AI provider entry

[](#add-a-new-ai-provider-entry)

Most providers you'd want are already available natively through the Laravel AI SDK (OpenAI, Anthropic, Gemini, Groq, xAI, Mistral, Ollama, Cohere, DeepSeek, …). To add another entry to `config/docs-generator.php`, point `class` at `LaravelAiProvider` and set the SDK `provider` key plus the model you want:

```
'providers' => [
    'groq' => [
        'class'    => \Rdcstarr\DocsGenerator\Providers\LaravelAiProvider::class,
        'provider' => 'groq',
        'model'    => env('GROQ_MODEL', 'llama-3.3-70b-versatile'),
        'timeout'  => env('GROQ_TIMEOUT', 60),
    ],
],
```

Then add `GROQ_API_KEY=...` to `.env` and run `php artisan docs:generate --provider=groq`.

### Add a fully custom AI provider

[](#add-a-fully-custom-ai-provider)

If you need a service not supported by the Laravel AI SDK, implement `Rdcstarr\DocsGenerator\Contracts\AIProvider`:

```
namespace App\DocsGenerator;

use Rdcstarr\DocsGenerator\Contracts\AIProvider;

class MyCustomProvider implements AIProvider
{
    public function __construct(array $config) { /* ... */ }

    public function generate(string $prompt): ?string
    {
        // call your API, return Markdown
    }
}
```

Register it under `providers` and use it via `--provider=mycustom`.

### Add a custom documentation source

[](#add-a-custom-documentation-source)

Implement `Rdcstarr\DocsGenerator\Contracts\DocsDriver` — five methods:

```
namespace App\DocsGenerator;

use Rdcstarr\DocsGenerator\Contracts\DocsDriver;

class FilamentDriver implements DocsDriver
{
    public function __construct(array $config) { /* ... */ }

    public function name(): string          { return 'filament'; }
    public function indexSection(): string  { return '## Filament'; }
    public function discoverPages(): array  { /* fetch + parse sidebar */ }
    public function fetchPage(string $url): ?string { /* fetch + clean HTML */ }
    public function buildPrompt(string $url, string $html): string { /* prompt */ }
}
```

Register it under `sources` in the config. Helpers `Rdcstarr\DocsGenerator\Support\HtmlExtractor` and `SidebarDiscovery` are available to keep your driver small.

### Add a custom IDE target

[](#add-a-custom-ide-target)

Implement `Rdcstarr\DocsGenerator\Contracts\Target` and register under `targets`.

Requirements
------------

[](#requirements)

- PHP **8.3+**
- Laravel **13+**
- `laravel/ai` (installed automatically as a dependency)

License
-------

[](#license)

MIT © [rdcstarr](https://github.com/rdcstarr)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance95

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

6

Last Release

23d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/42062586?v=4)[rdcstarr](/maintainers/rdcstarr)[@rdcstarr](https://github.com/rdcstarr)

---

Top Contributors

[![rdcstarr](https://avatars.githubusercontent.com/u/42062586?v=4)](https://github.com/rdcstarr "rdcstarr (7 commits)")

---

Tags

laraveldocumentationaiopenaicursorcopilotclaudedocsdeepseek

### Embed Badge

![Health badge](/badges/rdcstarr-docs-generator/health.svg)

```
[![Health](https://phpackages.com/badges/rdcstarr-docs-generator/health.svg)](https://phpackages.com/packages/rdcstarr-docs-generator)
```

###  Alternatives

[spatie/laravel-export

Create a static site bundle from a Laravel app

670139.5k6](/packages/spatie-laravel-export)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[zidbih/laravel-deadlock

Make temporary Laravel workarounds expire and fail CI when ignored.

954.0k](/packages/zidbih-laravel-deadlock)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
