infer-conventions

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

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/coleYab/usacr --skill infer-conventions-coleyab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: infer-conventions
Source: https://github.com/coleYab/usacr/tree/main/.grok/skills/infer-conventions
Command: npx skills add https://github.com/coleYab/usacr --skill infer-conventions-coleyab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Teams and AI agents working on a Laravel codebase often guess at project conventions, producing inconsistent code across validation style, architecture, testing, and database patterns. This Skill systematically analyzes how the application is actually written and records the findings as durable, path-scoped rules in .ai/rules so every future agent and teammate follows the same conventions. ## Core Features & Use Cases - Systematic Convention Sweep: Evaluates roughly 49 Laravel convention dimensions across validation, controllers, Eloquent, architecture, frontend, database, testing, and responses using a structured checklist with grep hints. - 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 Detection & Evidence Bar: Requires at least 3 consistent examples per convention, reports genuinely mixed patterns as conflicts instead of picking a winner, and skips framework defaults or tool-owned formatting. - Rule Recording: Records approved conventions via the Boost record-rule MCP tool with precise path globs, falling back to manual rule text when the tool is unavailable. - Use Case: When onboarding an AI agent to an existing Laravel app, run the sweep to discover that the project uses inline validation, Action classes invoked via handle(), and legacy accessors, then record those as rules so all future generated code matches. ## 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 convention dimensions like validation entry points, controller shape, Eloquent patterns, and testing style using targeted greps and representative file reads. A pattern qualifies as a convention only with at least 3 consistent examples and no meaningful rival approach.

How do I document Laravel project conventions for AI agents?

Record each confirmed convention as a short imperative rule scoped to a specific path glob in .ai/rules, using the Boost record-rule MCP tool. Rules state only the convention itself, without detection evidence, counts, or example file lists.

What happens when a Laravel codebase has conflicting patterns?

Mixed patterns are reported as conflicts with counts and example files rather than recorded as rules. A convention is only recorded if the user identifies a stable path or context boundary explaining both styles; otherwise it is deferred until the code is reconciled.

Does convention detection work without the record-rule MCP tool?

Yes, detection is read-only and all analysis steps still run when the tool is unavailable. Recording falls back to reporting the full rule text so the user can enable BOOST_RULES_ENABLED or add rules manually.

When should I not run convention inference on a Laravel app?

Skip it for tiny or fresh applications where most dimensions lack enough code to show a signal, and for one-off code reviews or formatting that tools like Pint already enforce. The skill documents reality, not style improvements.