package-scaffold
Skill78 starsChanged 3 months agoMITView on GitHub
Use this skill when adding Laravel package capabilities or wiring them through the service provider: commands, migrations, routes, config merges, views, translations, assets, middleware, publish tags, workbench files, or console-only behavior.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- md/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
- package-compatibilitySkill
- package-generate-skillSkill
- package-releaseSkill
- package-testingSkill
- package-compatibilitySkill
- package-generate-skillSkill
- package-releaseSkill
- package-scaffoldSkill
- package-testingSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Add package features in the right place and wire them through the service provider using explicit Laravel APIs, keeping package names, …
- Distinctive: line 19
Create the capability files under Laravel-native package paths and use the configured package names, namespaces, publish tags, URLs, and …
- Very specific: line 21
Use package-testing for coverage, update README or contributing documentation when user-facing behavior changes, use package-compatibility …
- Distinctive: line 22
Add only the files needed for the requested capability and validate with the narrowest relevant command before broader checks.
- Very specific: line 26
Keep provider wiring in register() or boot() unless extracting a method makes a real repeated concern clearer.
- Very specific: line 27
Put container bindings and mergeConfigFrom calls in register() when the host app must be able to override configuration.
- Very specific: line 28
Put resource loading in boot-time methods with Laravel-native APIs such as loadRoutesFrom, loadViewsFrom, and loadTranslationsFrom.
- Distinctive: line 31
Add tests for the observable provider behavior: merged config, loaded routes, publish tags, or command registration.
- Very specific: line 54
Add an Artisan command: create the command class under src/Console/Commands, register it in the commands array inside the …
- Very specific: line 55
Add a publishable migration: place the migration in database/migrations, wire it through a console-guarded publishesMigrations call with a …
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Package Scaffold
Primary Goal
Add package features in the right place and wire them through the service provider using explicit Laravel APIs, keeping package names, namespaces, config keys, and publish tags consistent.
Workflow
- Inspect the existing package structure, sibling examples, README setup notes, and the current service provider before creating files.
- Identify whether the request touches commands, migrations, routes, config, views, translations, assets, middleware, tests, README/contributing docs, compatibility, or release flow.
- Create the capability files under Laravel-native package paths and use the configured package names, namespaces, publish tags, URLs, and badges consistently.
- Wire the capability through the service provider using the patterns in Provider wiring below.
- Use
package-testingfor coverage, update README or contributing documentation when user-facing behavior changes, usepackage-compatibilityfor matrix-sensitive changes, and usepackage-releasefor release tasks. - Add only the files needed for the requested capability and validate with the narrowest relevant command before broader checks.
Provider Wiring
- Keep provider wiring in
register()orboot()unless extracting a method makes a real repeated concern clearer. - Put container bindings and
mergeConfigFromcalls inregister()when the host app must be able to override configuration. - Put resource loading in boot-time methods with Laravel-native APIs such as
loadRoutesFrom,loadViewsFrom, andloadTranslationsFrom. - Guard console-only publishing and command registration with
runningInConsole()before callingpublishes,publishesMigrations, orcommands. - Name publish tags with the
laravel-auditor-*convention so consumers can target individual resource groups. - Add tests for the observable provider behavior: merged config, loaded routes, publish tags, or command registration.
Provider wiring anti-patterns:
- Loading host app state too early during provider registration.
- Calling
env()outside config files; use config values aftermergeConfigFrominstead. - Registering web-only concerns unconditionally when the package can run in console contexts.
- Replacing explicit provider methods with
spatie/laravel-package-toolsby default.
References
src/*ServiceProvider.phpconfig/*.phproutes/*.phpresources/views/lang/database/migrations/public/src/Console/Commands/tests/Feature/andtests/Unit/
Examples
- Add an Artisan command: create the command class under
src/Console/Commands, register it in thecommandsarray inside therunningInConsole()guard, add a feature test for observable console output, and document the command if it is user-facing. - Add a publishable migration: place the migration in
database/migrations, wire it through a console-guardedpublishesMigrationscall with alaravel-auditor-migrationstag, and test publish behavior with Testbench. - Wire a new publish tag by adding a
publishesmap inside the existing console-guarded publishing method and naming the tag withlaravel-auditor-*.
Anti-Patterns
- Adding unused files because a package might need them later.
- Mixing package names, namespaces, config keys, or publish tags.
- Changing dependencies without approval.
- Replacing explicit Laravel package code with a helper abstraction when one feature-specific change would do.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

