PHPackages                             shredio/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. shredio/docs-generator

ActiveLibrary

shredio/docs-generator
======================

1.0.0(9mo ago)0179↓100%MITPHPPHP &gt;=8.3CI failing

Since Jun 24Pushed 2d agoCompare

[ Source](https://github.com/Shredio/docs-generator)[ Packagist](https://packagist.org/packages/shredio/docs-generator)[ RSS](/packages/shredio-docs-generator/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

Shredio Docs Generator
======================

[](#shredio-docs-generator)

A Symfony bundle for generating structured documentation from markdown templates. Designed primarily for creating AI-consumable documentation (Claude Skills, Commands, project docs), but also supports generating general documentation files.

Features
--------

[](#features)

- **Markdown templates with YAML frontmatter** - write documentation in markdown with YAML configuration
- **Multiple output types** - generate Claude Skills, Claude Commands, project docs, or general files
- **Macro system** - dynamic content generation using `{{ macro-name: "args" }}` syntax with cross-reference validation
- **API reference generation** - auto-document PHP classes, interfaces, traits with reflection
- **Composer package references** - link to documentation of composer dependencies
- **Code examples** - embed and validate PHP class source code in documentation
- **Priority-based processing** - control generation order with priority settings
- **Main file support** - designate a central file that collects references to all docs

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

[](#installation)

```
composer require shredio/docs-generator
```

Register the bundle in your Symfony application:

```
// config/bundles.php
return [
    // ...
    Shredio\DocsGenerator\DocsGeneratorBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

```
# config/packages/docs_generator.yaml
docs_generator:
    root_dir: '%kernel.project_dir%'     # Project root directory (default)
    source_dir: '/docs-templates'         # Directory containing template files
    docs_dir: '/docs'                     # Base path for generated docs (optional)
```

Usage
-----

[](#usage)

Generate documentation with the console command:

```
php bin/console docs:generate
```

The generator discovers all `.md` files in the configured `source_dir`, parses their YAML frontmatter, and produces output files based on the configuration.

Template Structure
------------------

[](#template-structure)

Templates are markdown files with YAML frontmatter that controls how the output is generated:

```
---
metadata:
  priority: 10
skill:
  target: .claude/skills/my-skill
  description: Description of what this skill does
api:
  - App\Some\ClassName
  - class: App\Some\Interface
  - composer: vendor/package-name
examples:
  - App\Example\ExampleClass
  - class: App\Another\Example
    contains:
      - "expectedMethod"
  - file: path/to/example.php
---

# My Skill Documentation

Content goes here with {{ macro-name: "arguments" }} support.
```

Output Types
------------

[](#output-types)

A single template can produce one or more output types simultaneously.

### Skills

[](#skills)

Generates Claude AI Skill files (`SKILL.md`) in the target directory:

```
skill:
  target: .claude/skills/skill-name
  name: Skill Display Name          # optional, defaults to directory basename
  description: What this skill does
```

### Commands

[](#commands)

Generates Claude CLI command files. The `prompt` field must contain `$ARGUMENTS`:

```
commands:
  - name: my-command
    prompt: Execute this task with $ARGUMENTS
```

### Docs

[](#docs)

Generates documentation files that can be cross-referenced by other templates. When a main file exists, all docs are automatically listed in a "Project Docs" section:

```
docs:
  target: getting-started.md    # must end with .md
  description: Getting started guide
```

### Output

[](#output)

Generates arbitrary markdown files:

```
output:
  target: path/to/output.md    # must end with .md
```

Frontmatter Reference
---------------------

[](#frontmatter-reference)

### Metadata

[](#metadata)

OptionTypeDefaultDescription`metadata.priority``int``5`Processing priority (0-10, higher = processed first)`main``bool``false`Designates this as the main file (sets priority to -1, enables docs list)`macros.disabled``bool``false`Disable macro processing for this file### API Reference

[](#api-reference)

The `api` frontmatter generates an "API Reference" section with links to source files. Each entry is labeled with its kind (class, interface, trait, or composer package):

```
api:
  # String form - class/interface/trait name
  - App\Http\Controller

  # Object form with class
  - class: App\Http\ResponseFactory

  # Composer package - resolves to llm.md, LLM.md, AGENTS.md, README.md, etc.
  - composer: vendor/package-name
```

### Code Examples

[](#code-examples)

The `examples` frontmatter generates an "Examples" section with links to source files:

```
examples:
  # String form - class name
  - App\Example\ExampleController

  # Object form with validation
  - class: App\Example\ExampleController
    contains:
      - "ResponseFactory"
      - "execute"

  # File reference (relative to root dir)
  - file: src/Example/example.php
```

Built-in Macros
---------------

[](#built-in-macros)

MacroArgumentsDescription`{{ class-name: "FQN" }}`1Validates class exists, outputs backtick-wrapped FQN`{{ skill-reference: "name" }}`1Validates skill exists, outputs backtick-wrapped reference`{{ docs-reference: "name" }}`1Validates doc exists, outputs backtick-wrapped reference`{{ module-namespace: "Suffix" }}`1Outputs `Module\%ModuleName%\Suffix``{{ submodule-namespace: "Sub", "Suffix" }}`2Outputs `Module\%ModuleName%\Sub\%SubmoduleName%\Suffix``{{ test-module-namespace: "Type", "Suffix" }}`2Outputs `Tests\Type\Module\%ModuleName%\Suffix``{{ test-submodule-namespace: "Type", "Sub", "Suffix" }}`3Outputs `Tests\Type\Module\%ModuleName%\Sub\%SubmoduleName%\Suffix`Requirements
------------

[](#requirements)

- PHP 8.3+
- Symfony 7.0+

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance81

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Unknown

Total

1

Last Release

270d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/312e788a47a251e05734378921d4596a91819b7de416fa18e77aa69e08798ea8?d=identicon)[Antik](/maintainers/Antik)

---

Top Contributors

[![MartkCz](https://avatars.githubusercontent.com/u/10145362?v=4)](https://github.com/MartkCz "MartkCz (25 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5165.2M68](/packages/symplify-monorepo-builder)

PHPackages © 2026

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