code-conventions

Enforce NewsParser code conventions for structure, naming, and layer boundaries.

Updated Mar 29, 2026
One-click install
npx skills add https://github.com/roromanenko/NewsParser --skill code-conventions-roromanenko
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-conventions
Source: https://github.com/roromanenko/NewsParser/tree/main/.claude/skills/code-conventions
Command: npx skills add https://github.com/roromanenko/NewsParser --skill code-conventions-roromanenko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

NewsParser project-specific conventions for where code should live, how layers interact, and how naming patterns are applied, guiding developers when adding a new class or evaluating architecture decisions.

Core Features & Use Cases

  • Layer boundaries and allowed/forbidden placements per Core/, Infrastructure/, Api/, and Worker/.
  • Constructor injection and worker architecture patterns to ensure consistent DI and lifecycle.
  • Repository naming patterns (GetByIdAsync, UpdateXxxAsync, etc.) to standardize data access.
  • Update patterns using SQL constants and Dapper ExecuteAsync rather than in-memory mutations.
  • Enum storage as strings and parsing with TryParse for safety.
  • Mapper conventions for Entity↔Domain and Api/ DTO conversions.
  • Exception handling contract: mapping exceptions to HTTP status in middleware.
  • Configuration via the Options pattern with SectionName constants and defaults.
  • Interface organization and Domain model conventions.
  • Single Responsibility, DRY boundaries, and clear base controller usage.

Quick Start

Apply these conventions whenever you introduce a new class to the codebase to ensure proper layer placement, naming, and dependency usage.

Frequently Asked Questions about code-conventions

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

FAQPage Schema
How do I enforce layered architecture boundaries in a .NET project?▼

Layered architecture boundaries are enforced by defining allowed and forbidden code placements across Core, Infrastructure, Api, and Worker layers. This ensures dependency injection and class placement comply with project-specific structure and naming rules.

What naming conventions should I use for Dapper repository methods in C#?▼

Dapper repository methods should use standardized naming patterns like GetByIdAsync and UpdateXxxAsync. Updates should execute via Dapper's ExecuteAsync using SQL constants rather than performing in-memory entity mutations.

How do I map exceptions to HTTP status codes in ASP.NET Core middleware?▼

Exception mapping to HTTP status codes is handled through a defined exception handling contract in middleware. This standardizes how domain and infrastructure exceptions translate to API responses across the application.

What is the best way to configure strongly-typed settings using the Options pattern?▼

The Options pattern configuration uses SectionName constants and defined defaults. This approach standardizes strongly-typed application settings binding, ensuring consistent configuration access across Core and Infrastructure layers.

How do I structure Entity to Domain model mappings in a layered .NET application?▼

Entity to Domain mappings follow specific mapper conventions for Entity↔Domain and API DTO conversions. This isolates data transformation logic, maintaining clear boundaries between infrastructure data models and Core domain models.

Should I store C# enums as strings in the database and parse them with TryParse?▼

Enums are stored as strings in the database and parsed using TryParse for safety. This convention prevents invalid cast exceptions and ensures reliable database record to domain object mapping.