提供即时的 Laravel 文档,自动检测项目版本,生成符合 PSR-12 标准的 Laravel 代码,并突出 Laravel 10 到 12 版本之间的差异。
Skill Name: Laravel Docs Reader Type: Development Reference Skill Target: OpenClaw Agent and Laravel developers Version: 1.0.0
VersionStatusNotesLaravel 12✅ DefaultLatest stableLaravel 11✅ SupportedFull referenceLaravel 10✅ SupportedFull reference
When the agent runs on a project, it auto-detects Laravel version:
composer.json → "laravel/framework": "^12.x"artisan --versionvendor/laravel/framework/src/Illuminate/Foundation/Application.php → VERSION constantDetection path: references/version-detection.md
bash
php laradoc.php <command> [args]
CommandArgsDescriptionsearch``<query>Natural language search (with Package Search cross-link)version``[path]Detect local Laravel versioncurrent—Show default versionconfig``<file>Config reference (database/cache/mail/...)facade``<name>Facade method signaturesartisan``<cmd>Artisan command helpdiff``<feature>Version diff (auth/routing/middleware/exception)generate``<type> <name>Code skeleton (controller/model/job/middleware)lang``<query>Blade directive lookuppsr``[topic]PSR-12 quick reference (full/arrays/naming/methods)cache—Show local cache statusupdate—Force-refresh cache from GitHubsubscribe—Show subscription / auto-update status
CategoryTopicsRoutingBasic routes, route groups, resource routes, named routes, middlewareControllersCRUD, REST, API, single-action, dependency injectionModelsEloquent, relationships (12 types), mutators, scopesMigrationsSchema builder, foreign keys, indexes, modifiersValidationForm requests, inline validation, custom rulesAuthBreeze, Sanctum, Gates, Policies, JWTQueuesJobs, dispatching, failed job handling, Laravel HorizonCacheStore API, tags, atomic locksMailMarkdown, attachments, queuingNotificationsMulti-channel, database notificationsTestingFeature tests, unit tests, Pest, factoriesEventsListeners, broadcasting, queueable eventsStorageLocal/S3/FTP, temporary URLs, uploadsSchedulingCron, recurring jobs, prevention of overlapService ContainerBinding, singletons, contextual bindingFacadesAll 30+ facades with method signaturesBroadcastingPrivate/public channels, presence channelsConfigurationdatabase, cache, mail, queue, auth, session
The generate command outputs standard Laravel code for:
controller — RESTful API controllermodel — Eloquent model with fillable/casts/relationshipsjob — Queueable job with failed handlermiddleware — HTTP middlewarerequest — Form Request validationnotification — Multi-channel notificationfactory — Model factory for testingAll output follows PSR-12 and Laravel conventions.
FeatureLaravel 10Laravel 11Laravel 12Auth scaffoldinglaravel new --authBreezeBreeze (minimal)Middleware registrationKernel.php``bootstrap/app.php``bootstrap/app.phpRoute registrationRouteServiceProvider``bootstrap/app.php``bootstrap/app.phpException handlingapp/Exceptions/Handler``bootstrap/app.php``bootstrap/app.phpCycle tasksapp/Console/Kernel.php``routes/console.php``routes/console.phpBroadcast channelsroutes/channels.php``routes/channels.php``routes/channels.php
A GitHub Actions workflow runs weekly to:
laravel/framework version from Packagisttext
.github/workflows/update-docs.yml
├── Schedule: Every Sunday 00:00 UTC
└── Creates PR: updates SKILL.md + version-detection.md
Anyone using this skill can review the auto-PR and merge after verification.
text
laravel-docs-reader/
├── SKILL.md # This file
├── README.md # English (default)
├── README.zh-CN.md # Chinese
├── .github/
│ └── workflows/
│ └── update-docs.yml # Auto-update PR workflow
├── .cache/ # Local doc cache (auto-created)
├── references/
│ ├── version-detection.md # Version detection logic
│ ├── version-diff.md # Version diff table (10/11/12)
│ ├── psr-12.md # PSR-12 quick reference
│ ├── api-index.md # Full API index
│ ├── artisan-commands.md # All artisan commands
│ ├── facades.md # Facade method signatures
│ ├── blade-directives.md # All Blade directives
│ ├── config-ref.md # Config file reference
│ └── examples/
│ ├── controller.md
│ ├── model.md
│ ├── migration.md
│ ├── middleware.md
│ ├── queue-job.md
│ ├── notification.md
│ └── testing.md
└── scripts/
└── laradoc.php # CLI tool (14 commands)
Built-in PSR-12 standard reference — no external formatter needed:
bash
php laradoc.php psr # Full PSR-12 table (rules + examples)
php laradoc.php psr arrays # Arrays rule
php laradoc.php psr naming # Naming conventions (class/method/var/const)
php laradoc.php psr methods # Visibility + method rules
php laradoc.php psr namespace # use statements
php laradoc.php psr operators # Operator spacing
Topics: arrays, naming, methods, control, namespace, operators
The skill stores docs in .cache/ for fast, offline access:
bash
php laradoc.php cache # Show cache status, size, age, offline availability
php laradoc.php update # Force-refresh from GitHub
Cache is created automatically on first search. All bundled reference files work without internet.
GitHub Actions runs weekly (Sunday 00:00 UTC):
laravel/framework version from PackagistSKILL.md, version-detection.md, version-diff.mdbash
php laradoc.php subscribe # Show current subscription / update status
After every search result, the agent suggests laravel-package-search
for third-party package discovery.
When the agent needs to write Laravel code:
Each doc entry is rated on:
CriterionDescriptionAccuracyMatches official Laravel docs exactlyCompletenessCovers all common use casesFreshnessUpdated for latest Laravel versionCode QualityPSR-12 compliant, idiomatic LaravelVersion CoverageCovers 10 / 11 / 12 differences
bash
clawhub login --token <TOKEN>
clawhub publish laravel-docs-reader
Or submit at https://clawhub.com