承接 cyto/phpdocumentor-llms 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cyto/phpdocumentor-llms

最新稳定版本:v1.0.0

Composer 安装命令:

composer require cyto/phpdocumentor-llms

包简介

LLM-friendly single-file documentation template for phpDocumentor

README 文档

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

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-02