infer-conventions

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

1.6k|185|Updated Sep 25, 2024
One-click install
npx skills add https://github.com/relaticle/relaticle --skill infer-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: infer-conventions
Source: https://github.com/relaticle/relaticle/tree/main/.claude/skills/infer-conventions
Command: npx skills add https://github.com/relaticle/relaticle --skill infer-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Laravel projects accumulate implicit coding conventions that AI agents and new teammates cannot see, causing inconsistent code across validation styles, architecture patterns, and testing approaches. This Skill systematically analyzes how an application is actually written and records those conventions as durable, path-scoped rules in .ai/rules.

Core Features & Use Cases

  • Systematic Convention Sweep: Evaluates roughly 49 Laravel convention dimensions across validation, controllers, Eloquent models, architecture, frontend, database, and testing using a structured checklist.
  • Architecture Discovery: Maps non-default app/ directories (Actions, Services, DTOs, Queries, domain modules) and records structural patterns and deliberate absences like "no repository layer".
  • Conflict Detection: Reports mixed patterns with counts and example files instead of arbitrarily picking a winner, deferring to the user when the codebase is genuinely split.
  • Rule Recording: Writes approved conventions via the Boost record-rule MCP tool, scoped to precise globs like app/Models/** or tests/**.
  • Use Case: When onboarding an AI agent to an existing Laravel app, run this Skill to document that the project uses legacy magic-method accessors, Action classes invoked via handle(), and Pest tests with factories, so all future generated code matches the house style.

Quick Start

Analyze this Laravel project's coding conventions and record them as shared 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 document coding conventions in a Laravel project?

Run a systematic sweep of the codebase across validation, models, architecture, testing, and database dimensions, then record each confirmed pattern as a path-scoped rule in .ai/rules. This Skill automates that detection using grep-based evidence gathering and the Boost record-rule MCP tool.

How to detect conflicting code patterns in a Laravel codebase?

Grep for both sides of each fork, such as inline validation versus Form Requests, and count occurrences with example files. When both styles appear in meaningful numbers, report the split to the user rather than recording a preferred winner that does not reflect reality.

Does this work with Laravel projects using Rector or Pint?

Yes, the Skill inspects Pint and Rector configuration first and skips any convention an active tool already enforces. It only records patterns no tool can decide, such as architecture choices or deliberate legacy holds that go against a tool's target form.

What is the record-rule MCP tool in Laravel Boost?

record-rule is a Boost MCP tool that writes a convention as a titled note scoped to a glob path like app/Models/**, so agents discover it when working in that path. If it is unavailable, the Skill outputs the rule text for manual addition to .ai/rules.

When should I not use automated convention inference?

Skip it for one-off code reviews, formatting that a linter already handles, or very fresh apps with too little code to establish patterns. The Skill requires at least three consistent examples per convention and stays silent when there is no signal.