cyto/phpdocumentor-llms

LLM-friendly single-file documentation template for phpDocumentor

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:phpdocumentor-template

pkg:composer/cyto/phpdocumentor-llms

v1.0.0 2025-12-02 15:37 UTC

This package is auto-updated.

Last update: 2025-12-02 15:38:35 UTC


README

LLM-friendly single-file documentation template for phpDocumentor.

Generates documentation in a format optimized for Large Language Models (LLMs) context input.

Output

This template generates two files:

File Description
llms.txt Index file with namespace overview and class list
llms-full.txt Complete API documentation in a single file

Installation

composer require --dev cyto/phpdocumentor-llms

Usage

Command Line

phpdoc --directory=src --target=docs --template="vendor/cyto/phpdocumentor-llms/themes/llms"

Configuration File (phpdoc.xml)

<?xml version="1.0" encoding="UTF-8" ?>
<phpdocumentor configVersion="3">
    <template name="vendor/cyto/phpdocumentor-llms/themes/llms"/>
</phpdocumentor>

Composer Script

{
    "scripts": {
        "docs:llms": "phpdoc --directory=src --target=docs --template='vendor/cyto/phpdocumentor-llms/themes/llms'"
    }
}

Then run:

composer docs:llms

Example Output

llms.txt (Index)

# My Project

> API Documentation for My Project

## Overview

This documentation covers the following namespaces:

- `\App\Controller` (5 classes)
- `\App\Service` (3 classes)
- `\App\Repository` (2 classes, 1 interfaces)

## Classes

- `\App\Controller\UserController`: Handles user-related HTTP requests
- `\App\Service\AuthService`: Authentication and authorization service
...

llms-full.txt (Full Documentation)

# My Project - Full API Documentation

> Complete API documentation for My Project

---

## \App\Controller\UserController

Handles user-related HTTP requests

- **Type**: Class
- **Extends**: `\App\Controller\AbstractController`

### Methods

#### index()

\`\`\`php
public index(): Response
\`\`\`

Returns list of all users.

**Returns:** Response - JSON response with user list

---
...

Use Cases

  • AI Code Assistants: Feed API documentation as context to Claude, GPT, etc.
  • RAG Systems: Single file is easier to chunk and index
  • Code Reviews: Quick reference for understanding project structure

Related

License

MIT