infer-conventions

Detect Laravel codebase conventions and record them as path-scoped rules.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/alemamdevs/expense-tracker --skill infer-conventions-alemamdevs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: infer-conventions
Source: https://github.com/alemamdevs/expense-tracker/tree/main/.agents/skills/infer-conventions
Command: npx skills add https://github.com/alemamdevs/expense-tracker --skill infer-conventions-alemamdevs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? AI agents and new teammates often write Laravel code that clashes with how a project actually does things, because conventions live only in the codebase and in people's heads. This Skill systematically analyzes a Laravel application and records its real conventions as durable, path-scoped rules in .ai/rules that agents read automatically. ## Core Features & Use Cases - Systematic convention sweep: Evaluates roughly 49 Laravel convention dimensions across validation, controllers, authorization, Eloquent models, architecture, frontend, database, testing, and API responses using a structured checklist. - Architecture discovery: Maps non-default app/ directories (Actions, Services, DTOs, Queries, domain modules) and records structural patterns and deliberate absences, such as "no repository layer". - Conflict and noise filtering: Distinguishes genuine conventions from framework defaults, tool-owned formatting (Pint/Rector), and mixed-style conflicts, requiring at least 3 consistent examples before proposing a rule. - Use Case: An agent keeps generating Form Request classes while the app validates inline everywhere. Run this Skill to detect the inline-validation convention, confirm it, and record a rule scoped to app/Http/** so every future agent matches the house style. ## Quick Start Analyze this Laravel project's conventions and record them as rules in .ai/rules using the infer-conventions skill.

Frequently Asked Questions about infer-conventions

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

FAQPage Schema
How do I document Laravel project conventions for AI coding agents?

Run a convention-inference sweep that inspects your app/ tree, controllers, models, and tests, then records each confirmed convention as a path-scoped rule in .ai/rules. Agents reading those rules automatically match your project's established style.

How to detect coding style inconsistencies in a Laravel codebase?

Check each convention dimension with targeted greps, such as Form Requests versus inline $request->validate() calls, and count occurrences per style. When both styles appear in meaningful numbers, report it as a conflict rather than picking a winner.

Does convention detection work with Pint and Rector configured?

Yes. The process reads your Pint and Rector configuration first and skips any convention an active tool already enforces, such as casts() migrations or attribute rewrites. Only choices no tool can decide are recorded as rules.

What Laravel conventions can be inferred automatically?

Around 49 dimensions are covered, including validation entry points, controller shapes, mass assignment style, accessor syntax, primary key types, Action and Service patterns, DTO usage, testing frameworks, and pagination contracts. Architecture-level patterns carry the highest value.

When should I not record a detected pattern as a rule?

Skip patterns that are framework defaults, forms an active Rector or Pint rule produces automatically, or styles with fewer than three consistent examples. Also never record a preferred winner while the codebase remains genuinely mixed between two styles.