resources/boost/skills/general/SKILL.md
--- name: general description: Project-wide Laravel conventions that always apply: configuration access, database patterns, logging, activity logging, and code formatting. compatible_agents: - architect - implement - refactor - review --- # Laravel General Conventions ## When to Apply - Apply to most PHP application code in `app/` and related tests. - Apply during implementation, refactors, and reviews to keep behavior consistent. - Do not apply activity-log rules to third-party packa
npx skillsauth add codebar-ag/coding-guidelines resources/boost/skills/generalInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
app/ and related tests.config/, and new keys can be added there.composer show spatie/laravel-activitylog).config/activitylog.php exists when configuring model activity behavior.vendor/bin/pint).config(), not env() in runtime app code.config/*.php first.DB::transaction().LogsActivity on business models that need audit trails (e.g., invoice status changes, payout approvals, role/permission changes).getActivitylogOptions() with logAll(), logOnlyDirty(), and dontSubmitEmptyLogs(): log tracked attributes, only when values changed, and skip no-op writes.activity()->performedOn($model)->log(...) entries for key workflow events.vendor/bin/pint before commit.// Configuration: always use config().
$secret = config('services.stripe.secret');
// Bad: env('STRIPE_SECRET')
// Add env-backed value in config/services.php, then consume through config().
'stripe' => [
'secret' => env('STRIPE_SECRET'),
];
// Structured logging.
Log::info('Invoice created.', [
'invoice_id' => $invoice->id,
'order_id' => $order->id,
'amount' => $invoice->amount,
]);
// Multi-step writes must be transactional.
$payment = DB::transaction(function () use ($order) {
$invoice = $this->createInvoice->execute($order);
return $this->chargePaymentMethod->execute($order, $invoice);
});
// Anti-pattern: partial write risk without transaction.
$invoice = $this->createInvoice->execute($order);
$this->chargePaymentMethod->execute($order, $invoice); // throws
// Invariant breaks: accounting now has an invoice record without matching payment state.
env() calls outside config files.DB::transaction().vendor/bin/pint ran successfully.env('KEY') in application code outside config files.LogsActivity to models with no business audit value.resources/boost/skills/migrations/SKILL.md (schema-specific conventions)testing
Translation and localization conventions for Laravel. Use when adding user-facing strings, creating translation files, or working with lang/ directory.
tools
Reusable behaviour shared across multiple unrelated classes. Traits provide shared Eloquent scopes, accessors, lifecycle hooks, and small stateless helper methods.
development
Tailwind CSS v4 styling conventions. Use when working with CSS, Tailwind utilities, or customizing the theme in Laravel projects.
development
Orchestration classes that coordinate multiple Actions, external APIs, or domain operations into a cohesive workflow. Services own transaction boundaries and third-party API integrations.