hardimpactdev / librarian
Structured documentation tooling for Laravel projects
Fund package maintenance!
0.0.2
2026-05-18 19:44 UTC
Requires
- php: ^8.4
- illuminate/contracts: ^11.0||^12.0||^13.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/boost: ^2.4
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^11.0.0||^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/guidelines-skills: dev-main
README
Librarian gives Laravel projects a strict documentation structure for keeping product intent, code, and tests aligned.
Installation
composer require hardimpactdev/librarian
php artisan vendor:publish --tag="librarian-config"
Usage
php artisan librarian:init php artisan librarian:domain node php artisan librarian:domains:normalize php artisan librarian:build php artisan librarian:lint
librarian:init creates the required documentation spine. Use
librarian:domain to add ordered domain documentation, librarian:build to
regenerate package-owned docs and lint them, and librarian:lint in CI for a
read-only consistency check.
Optional Rules
Projects can opt into additional rules without changing Librarian's required
spine. Register rule classes in config/librarian.php:
use HardImpact\Librarian\Linting\Rules\BulletComplexityRule; use HardImpact\Librarian\Linting\Rules\CompoundNounStackRule; use HardImpact\Librarian\Linting\Rules\DocumentComplexityRule; use HardImpact\Librarian\Linting\Rules\LongSectionStructureRule; use HardImpact\Librarian\Linting\Rules\RequirementSmellRule; use HardImpact\Librarian\Linting\Rules\SectionOpenerProseRule; use HardImpact\Librarian\Linting\Rules\SentenceCaseHeadingRule; use HardImpact\Librarian\Linting\Rules\TableProseComplexityRule; return [ 'path' => base_path('docs'), 'rules' => [ DocumentComplexityRule::class, RequirementSmellRule::class, SentenceCaseHeadingRule::class, LongSectionStructureRule::class, BulletComplexityRule::class, SectionOpenerProseRule::class, TableProseComplexityRule::class, [ 'rule' => CompoundNounStackRule::class, 'options' => [ 'accepted_compounds' => [ 'project-owned', ], ], ], ], ];
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.