general

Enforce Laravel conventions for configuration, database, logging, and code style.

3|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/codebar-ag/coding-guidelines --skill general-codebar-ag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: general
Source: https://github.com/codebar-ag/coding-guidelines/tree/main/resources/boost/skills/general
Command: npx skills add https://github.com/codebar-ag/coding-guidelines --skill general-codebar-ag

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Project-wide Laravel conventions that always apply across configurations, database patterns, logging, activity tracking, and code formatting to ensure a uniform codebase.

Core Features & Use Cases

  • Configuration & Environment Guidance: Use config() for reading values; avoid env() in application code to prevent runtime environment leakage.
  • Database & Transaction Best Practices: Prefer Eloquent or Query Builder; wrap multi-step writes in DB::transaction().
  • Logging & Activity Tracking: Use structured logs via Log with context; apply Spatie Activity Log on business models and log activity consistently.
  • Quality & Consistency: Enforce style and quality checks with Laravel Pint and static analysis to maintain standards.

Quick Start

Apply Laravel general conventions to ensure consistent project-wide coding practices.

Frequently Asked Questions about general

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the standard Laravel conventions for configuration and environment access?

Standard Laravel conventions dictate using the config() helper for reading values in application code. You should avoid using env() outside of configuration files to prevent runtime environment leakage and ensure consistent configuration access across your project.

How do I implement structured logging and activity tracking in Laravel?

To implement structured logging in Laravel, use the Log facade with context arrays to record meaningful event data. For tracking business model actions, apply Spatie Activity Log to consistently log user activity and model changes across your application.

Can I enforce Laravel coding standards automatically with static analysis tools?

Yes, you can enforce Laravel coding standards automatically by integrating Laravel Pint for style checks and static analyzers for quality validation. These tools inspect models, controllers, and services to validate that your codebase follows unified project-wide conventions.

When should I not use env() in my Laravel application code?

You should not use env() in Laravel application code outside of config files because it returns null after configuration caching. Relying on env() in controllers or models causes runtime environment leakage, so always use config() to access environment variables.

Does this Laravel convention guide apply to small projects and large teams alike?

Yes, these Laravel conventions are applicable to projects of any size. They guide models, controllers, migrations, services, and utilities to follow a unified standard, ensuring that both small setups and large teams maintain a uniform codebase.

What's the best way to manage database transactions in Laravel Eloquent?

The best way to manage multi-step database writes in Laravel is using DB::transaction(). Wrapping Eloquent or Query Builder operations in DB::transaction() ensures that all database changes roll back automatically if any step fails, maintaining data integrity.