
convention-learner
Detects and enforces project-specific coding conventions by analyzing existing codebase patterns. Learns naming conventions, folder structure, test organization, and coding style from the existing code. Load when: "conventions", "coding standards", "project patterns", "enforce style", "detect patterns", "learn conventions", "code consistency".
- Installs
- 2.9K
- Last 24h
- +55
- Trending rank
- #3136
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill convention-learner- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads convention-learner automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Convention Learner
Core Principles
- Observe before enforcing — Never impose conventions without first analyzing the existing codebase. A project with 200
internal sealed classhandlers should not get a newpublic classhandler. Detect first, then match. - Project conventions override generic rules — If the project uses
*Serviceinstead of*Handler, follow the project's convention even if the kit default is different. Explicit.editorconfigandDirectory.Build.propsrules always win. - Use MCP tools for analysis —
get_public_apireveals naming patterns,get_project_graphshows structure conventions,detect_antipatternstracks quality trends. Tools provide objective data; file reads provide confirmation. - Document findings — After detecting conventions, suggest adding them to the project's CLAUDE.md. Undocumented conventions are lost when the original developers leave.
- Consistency over perfection — A project with consistent
snake_casedatabase columns is better than a project with halfsnake_caseand halfPascalCase. Match the existing pattern, even if another convention is theoretically superior.
Patterns
Convention Detection Flow
Systematic analysis to understand a project's coding conventions. Run this when joining an existing project or before generating new code.
Step 1: Project Structure Analysis
→ get_project_graph
Detect:
- Project naming: PascalCase? Dots? (MyApp.Domain vs Domain)
- Layer organization: by layer (Domain/Application/Infrastructure) or by feature?
- Test project naming: *.Tests, *.UnitTests, *.IntegrationTests?
- Shared project: Common/, Shared/, BuildingBlocks/?
Step 2: Type Naming Patterns
→ get_public_api (on 3-5 key types across different layers)
Detect:
- Class modifiers: sealed? internal? internal sealed?
- Interface prefix: I* (standard) or no prefix?
- Suffix conventions: Handler, Service, Repository, Validator, Endpoint?
- Record usage: for DTOs? for value objects? for commands/queries?
- Primary constructor usage: consistently? selectively?
Step 3: Folder Structure Patterns Scan the file system for structural conventions:
- Feature folders:
Features/{FeatureName}/with all files together? - Layer folders:
Controllers/,Services/,Repositories/separate? - Shared patterns:
Common/,Extensions/,Middleware/? - Configuration location: root?
Config/folder?Infrastructure/?
Step 4: Configuration Detection Check for explicit convention enforcers:
→ Look for Directory.Build.props
- TreatWarningsAsErrors?
- Nullable enabled globally?
- ImplicitUsings?
- AnalysisLevel?
→ Look for .editorconfig
- Naming rules: camelCase fields? _prefixed privates?
- Code style: var preferences, expression bodies, using placement
→ Look for global.json
- SDK version pinned?
- Roll-forward policy?
Step 5: Build Convention Summary Compile findings into a structured summary:
## Detected Conventions
### Naming
- Classes: `internal sealed class` (95% of handlers/services)
- Suffixes: Handlers end in `Handler`, validators in `Validator`
- Records: Used for DTOs and commands/queries
### Structure
- Architecture: Vertical Slice Architecture
- Features: `Features/{Name}/` with command, handler, validator, endpoint in one file
### Code Style
- Primary constructors: Used consistently for DI injection
- Nullable: Enabled globally, no suppressions (`!`) used
- File-scoped namespaces: 100% consistent
Add categories as needed: EF Core (configurations, naming, migrations), Testing (framework, naming, fixtures), etc.
Convention Enforcement
Apply detected conventions when generating new code or reviewing existing code.
When Generating Code: Match every detected pattern:
// If existing handlers are: internal sealed class + primary constructor
// Generate matching:
internal sealed class CreateProductHandler(AppDbContext db, TimeProvider clock)
{
// Not: public class CreateProductHandler
// Not: internal class CreateProductHandler (missing sealed)
}
// If existing DTOs are records with init properties
// Generate matching:
public record ProductResponse(Guid Id, string Name, decimal Price);
// Not: public class ProductResponse { public Guid Id { get; set; } }
When Reviewing Code: Flag deviations from detected conventions:
⚠️ Convention violation: CreateOrderHandler is `public class` but project convention
is `internal sealed class` (detected in 12/12 existing handlers).
Change to: internal sealed class CreateOrderHandler
Suggesting Enforcement Rules:
After detecting conventions, suggest .editorconfig rules to enforce them automatically:
# Key .editorconfig rules to suggest based on detected conventions
dotnet_diagnostic.CA1852.severity = warning # Seal internal types
csharp_style_namespace_declarations = file_scoped:warning
csharp_style_prefer_primary_constructors = true:suggestion
# Add dotnet_naming_rule entries for private field prefix (_camelCase) if detected
Anti-pattern Tracking
Use detect_antipatterns to track recurring quality issues across sessions.
Periodic Check:
→ detect_antipatterns (scope: solution)
Track over time:
- Are the same patterns recurring? (DateTime.Now keeps appearing)
- Are new patterns emerging? (new HttpClient() in a new module)
- Is the count trending up or down?
Prioritization:
| Anti-pattern | Count | Trend | Priority |
|-------------|-------|-------|----------|
| DateTime.Now | 12 | ↑ +3 | High — add to CLAUDE.md conventions |
| async void | 1 | → same | Medium — one-off fix |
| new HttpClient | 0 | ↓ -2 | Low — already fixing |
When patterns recur, add explicit rules to CLAUDE.md:
## Conventions
- **NEVER use DateTime.Now** — Use TimeProvider.GetUtcNow() (12 violations found, fixing)
Anti-patterns
Enforcing Without Detecting
# BAD — Imposing kit defaults on a project with its own conventions
"All handlers should be internal sealed class"
# But this project uses public class with interfaces for testing
# GOOD — Detect first, then follow what exists
→ get_public_api reveals: 8/8 handlers are `public class` implementing `IHandler<T>`
"This project uses public handlers with interfaces. Matching that convention."
Overriding Explicit Project Rules
# BAD — Ignoring .editorconfig because kit says otherwise
# .editorconfig says: csharp_style_expression_bodied_methods = false
# But generating expression-bodied methods anyway
# GOOD — .editorconfig and Directory.Build.props always win
"Your .editorconfig disables expression-bodied methods.
I'll use block-bodied methods to match your project settings."
Applying Generic Conventions to Unconventional Projects
# BAD — Forcing Clean Architecture naming on a VSA project
"You need a Services/ folder and a Repositories/ folder"
# But this project uses feature folders with everything co-located
# GOOD — Match the project's organizational convention
"This project uses feature folders. I'll add the new feature
at Features/Shipping/ with all related files together."
Documenting Conventions Without Evidence
# BAD — "Conventions" based on reading one file
"Convention: Use var everywhere" (based on seeing var in one method)
# GOOD — Document only patterns confirmed across multiple files
→ get_public_api on 5 types: 100% use explicit types for non-obvious cases
"Convention: Use explicit types for non-obvious cases (e.g., method returns),
var for obvious cases (e.g., new MyClass()). Confirmed across 5 files."
Decision Guide
| Scenario | Action | Tool |
|---|---|---|
| Joining existing project | Run full convention detection flow | get_project_graph, get_public_api |
| Generating new code | Check detected conventions first | Previous detection results |
| Reviewing code | Flag convention deviations | get_public_api + comparison |
| Convention conflict (kit vs project) | Project wins | — |
| Convention conflict (team disagreement) | Document both, suggest .editorconfig | — |
| No conventions detected | Use kit defaults, document them | architecture-advisor skill |
| Recurring anti-pattern | Add to CLAUDE.md conventions | detect_antipatterns |
| New team member onboarding | Run detection, generate convention doc | Full detection flow |
| .editorconfig exists | Trust it, don't override | Read .editorconfig |
| No .editorconfig | Suggest creating one based on detected patterns | Detection + generation |
| Pattern seen once | Create instinct at 0.3 confidence via instinct-system skill | instinct-system |
| Pattern confirmed 3+ times | Instinct auto-promotes to 0.7, suggest adding to CLAUDE.md | instinct-system |
FAQ
What does the convention-learner skill do?
Detects and enforces project-specific coding conventions by analyzing existing codebase patterns. Learns naming conventions, folder structure, test organization, and coding style from the existing code. Load when: "conventions", "coding standards", "project patterns", "enforce style", "detect patterns", "learn conventions", "code consistency".
How do I install convention-learner?
Run npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill convention-learner in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/convention-learner/ (personal) or .claude/skills/convention-learner/ (project).
Which AI agents can use convention-learner?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is convention-learner safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains convention-learner?
It is published by codewithmukesh in codewithmukesh/dotnet-claude-kit. It has 2,863 recorded installs.
More from codewithmukesh/dotnet-claude-kit
clean-architecture
codewithmukesh/dotnet-claude-kit
Clean Architecture for .NET applications. Covers the 4-project layout (Domain, Application, Infrastructure, Api), dependency inversion, use case handlers, domain entities with behavior, and infrastructure as a plugin. Load this skill when building a project with Clean Architecture, discussing layered architecture, dependency inversion, use cases, or when the architecture-advisor recommends Clean Architecture.
ddd
codewithmukesh/dotnet-claude-kit
Domain-Driven Design tactical patterns for .NET applications. Covers aggregates, aggregate roots, value objects, domain events, domain services, strongly-typed IDs, and repository patterns for aggregate persistence. Load this skill when implementing DDD, working with aggregates, value objects, domain events, bounded contexts, or when the architecture-advisor recommends DDD + Clean Architecture. Pair with the clean-architecture skill.
modern-csharp
codewithmukesh/dotnet-claude-kit
Modern C language features for .NET 10 and C 14. Covers primary constructors, collection expressions, the field keyword, extension members, records, pattern matching, spans, and raw string literals. Load this skill when writing any new C code, reviewing existing code for modernization, using "modern C", "C 14", "primary constructor", "collection expression", "records", "pattern matching", "span", "field keyword", or "extension members". Always loaded as the baseline for all agents.
vertical-slice
codewithmukesh/dotnet-claude-kit
Vertical Slice Architecture (VSA) for .NET applications — one of several supported architectures in dotnet-claude-kit. Covers feature folders, endpoint grouping, and handler patterns for Mediator, Wolverine, and raw handler classes. Load this skill when the architecture-advisor recommends VSA, when working in an existing VSA codebase, when adding features to a feature-folder project, or when discussing vertical slice patterns, feature folders, or handler patterns.
security-scan
codewithmukesh/dotnet-claude-kit
Deep security scanning for .NET applications across 6 layers: vulnerable packages, secrets detection, OWASP code patterns, auth configuration, CORS policy, and data protection. Produces severity-rated findings with specific remediation steps. Load this skill when: "security scan", "security audit", "check for vulnerabilities", "find secrets", "OWASP", "auth review", "CORS check", "security review", "penetration test prep", "CVE check", "vulnerability scan", "hardcoded password", "data protection", "security posture".
serilog
codewithmukesh/dotnet-claude-kit
Structured logging with Serilog for .NET 10 applications. Covers two-stage bootstrap, appsettings configuration, enrichers, sinks, request logging, destructuring, and Serilog.Expressions. Load this skill when setting up Serilog, configuring log sinks, enrichers, or structured logging, or when the user mentions "Serilog", "structured logging", "log enrichment", "Seq", "LogContext", "UseSerilog", "WriteTo", "message template", "Serilog.Expressions", "request logging", "log sink", "rolling file", or "audit log".
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.