convention-learner

Detect and enforce project-specific coding conventions from an existing codebase.

224|87|Updated Dec 15, 2018
One-click install
npx skills add https://github.com/Resgrid/Core --skill convention-learner-resgrid
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convention-learner
Source: https://github.com/Resgrid/Core/tree/main/.opencode/skills/convention-learner
Command: npx skills add https://github.com/Resgrid/Core --skill convention-learner-resgrid

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents slow, inconsistent development by detecting the actual conventions already used in a codebase and turning them into actionable guidance, rather than guessing rules from a template.

Core Features & Use Cases

  • Project pattern detection: Learns conventions for project structure, naming, layering, and test organization by analyzing the existing codebase patterns.
  • Public API-based convention discovery: Infers type naming and usage norms by examining representative public types across multiple layers.
  • Config-aware enforcement: Detects and respects explicit convention sources like .editorconfig, Directory.Build.props, and global.json so project rules override generic defaults.
  • Convention documentation output: Produces a structured “Detected Conventions” summary to help teams persist knowledge (e.g., via CLAUDE.md).
  • Deviation detection guidance: Identifies likely convention violations during generation/review and suggests aligning generated code to the discovered patterns.
  • Anti-pattern tracking: Flags recurring quality issues over time using anti-pattern detection to prioritize lasting convention improvements.

Quick Start

Use the convention-learner skill to analyze an existing repository and generate a concrete, evidence-based conventions summary that you can apply when generating or reviewing new code.

Frequently Asked Questions about convention-learner

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

FAQPage Schema
How do I detect coding conventions from an existing codebase?

Coding conventions are detected by analyzing project structure, naming patterns, and layering across the codebase. The skill examines representative public types and existing folders to infer actual style norms rather than relying on generic templates.

How do I enforce project-specific naming patterns during code review?

Project-specific naming patterns are enforced by learning existing conventions and tracking deviations during code review. The skill identifies likely convention violations and suggests aligning generated code to the discovered patterns.

Does convention detection respect .editorconfig and Directory.Build.props?

Convention detection respects explicit configuration sources like .editorconfig, Directory.Build.props, and global.json. These project rules act as authoritative constraints that override any generic default style enforcement.

What is the best way to document real coding conventions for team onboarding?

The best way to document coding conventions is generating a structured Detected Conventions summary. This evidence-based output captures project patterns and anti-patterns to persist knowledge for onboarding and code generation.

Can I track anti-patterns and convention violations over time?

Anti-patterns and convention violations are tracked over time using recurring quality issue detection. The skill flags deviations during generation and review to prioritize lasting convention improvements across the project.

Why should I analyze existing codebase patterns instead of using a standard style template?

Analyzing existing codebase patterns prevents slow, inconsistent development by turning actual conventions into actionable guidance. Standard templates guess rules blindly, while evidence-based detection enforces true architecture consistency.