infer-conventions

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

Updated Sep 5, 2025
One-click install
npx skills add https://github.com/baubyte/website --skill infer-conventions-baubyte
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: infer-conventions
Source: https://github.com/baubyte/website/tree/main/.agents/skills/infer-conventions
Command: npx skills add https://github.com/baubyte/website --skill infer-conventions-baubyte

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Teams and AI agents working on a Laravel application often guess at the project's coding style, producing inconsistent code that mixes Form Requests with inline validation, Actions with fat controllers, or legacy accessors with modern Attribute classes. This Skill systematically analyzes how the application is actually written and records the discovered conventions as durable, path-scoped rules in .ai/rules so every future agent and teammate follows the same patterns. ## 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 mapping: Maps non-default app/ directories (Actions, Services, DTOs, Queries, domain modules) and records deliberate structural choices, including consistent absences like "no repository layer". - Conflict and default filtering: Distinguishes genuine project decisions from framework defaults, tool-owned formatting (Pint, Rector), and unresolved mixed patterns, requiring at least three consistent examples before proposing a rule. - Rule recording via Boost MCP: Records approved conventions with the record-rule tool, scoped to precise globs such as app/Models/** or tests/**, with a confirmation step before anything is written. - Use Case: After inheriting a mature Laravel codebase, run the sweep to discover that the app uses invokable Action classes, legacy magic-method accessors, and Pest tests with factories, then record those as rules so the next agent matches the existing style instead of introducing conflicting patterns. ## Quick Start Ask the agent to analyze this Laravel project's conventions and record them as rules in .ai/rules.

Frequently Asked Questions about infer-conventions

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

FAQPage Schema
How do I detect coding conventions in an existing Laravel project?▼

Run a systematic sweep across roughly 49 convention dimensions covering validation, controllers, models, architecture, testing, and database code. Each dimension gets a verdict of pattern, conflict, default, or no-signal based on at least three consistent examples found in the codebase.

How do I document Laravel project conventions for AI agents?▼

Record each confirmed convention as a path-scoped rule in .ai/rules using the Boost record-rule MCP tool, with a glob like app/Models/** and a short imperative note. Rules already present in .ai/rules are detected first so re-runs stay incremental.

Does the convention sweep handle Pint and Rector configurations?▼

Yes, the process inspects Pint and Rector configuration first and skips any convention an active tool already enforces, such as casts() methods or anonymous migrations. Only choices no tool can decide, like legacy accessors or Action class structure, become rule candidates.

What happens when a Laravel codebase mixes two conflicting patterns?▼

Mixed patterns are reported as conflicts with counts and example files rather than recorded as rules. A rule is only recorded if the user identifies a stable path or context boundary that explains both styles; otherwise the conflict is deferred.

Can convention detection work without the record-rule MCP tool?▼

Yes, detection is read-only and runs fully without the tool. When record-rule is unavailable, the full rule text is reported so the user can enable BOOST_RULES_ENABLED or add the rules to .ai/rules manually.

When should I not run Laravel convention inference?▼

Skip it for one-off code reviews, formatting that a linter already handles, or very fresh applications with too little code to establish patterns. The skill documents existing reality and never proposes improvements to the codebase style.