conventions-code

Enforces Toollab coding conventions for PHP controllers, services, and Vue components.

Updated May 5, 2025
One-click install
npx skills add https://github.com/sebauvray/toollab-api --skill conventions-code-sebauvray
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: conventions-code
Source: https://github.com/sebauvray/toollab-api/tree/main/.claude/skills/conventions-code
Command: npx skills add https://github.com/sebauvray/toollab-api --skill conventions-code-sebauvray

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? New code written for the Toollab project often clashes with the existing codebase style, producing inconsistent naming, unwanted comments, wrong formatting, and English-only validation messages. This Skill ensures any code you write blends into the existing Laravel and Nuxt codebase. ## Core Features & Use Cases - Comment policy enforcement: Near-zero comments allowed, except one-liners explaining non-derivable constraints, with existing "why" comments preserved. - Mixed FR/EN naming rules: Follows the domain's language (French for PaiementService methods, English for ClassroomController) instead of forced harmonization. - Structural conventions: Defines controller/service layering, model property ordering, Vue script-setup organization, file placement, dead-code removal rules, and Pint formatting scoped to touched files only. - Use Case: Before adding a new endpoint to PaiementController, invoke this Skill so the validation messages are in French, the response uses the {status, message, data} format, and no JsonResource is introduced. ## Quick Start Apply the Toollab coding conventions while writing the new PHP controller and Vue page for the payment feature.

Frequently Asked Questions about conventions-code

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

FAQPage Schema
How do I write code that matches an existing Laravel project style?▼

Follow the project's documented conventions: keep business logic in services, validate inline or with FormRequests, wrap multi-table writes in DB transactions, and map responses to arrays by hand. This Skill codifies those rules for the Toollab codebase.

What comment policy should a PHP codebase follow?▼

This project enforces a near-zero comment policy where identifiers carry intent. The only exception is a one-liner explaining constraints not derivable from code, such as external bug workarounds or hidden invariants.

Should I run Pint on the whole Laravel project before committing?▼

No. The codebase is not fully formatted, so running Pint globally produces an unreadable diff. Format only the files you touched using ./vendor/bin/pint with the file path.

Why do Laravel validation messages appear in English instead of French?▼

The project has no published lang/ directory and APP_LOCALE=en, so default validation messages render in English. FormRequests must define a hand-written French messages() method for every user-facing rule.

Can I use TypeScript or the Options API in the Nuxt front end?▼

No. The project uses script setup exclusively with plain JavaScript; the tsconfig.json is only the Nuxt-generated one. Always use defineProps and defineEmits with explicit types and defaults.