code-conventions

Standardize logging, error mapping, validation, and queue integration for Zoppy API backend operations.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/Zoppy-crm/.github --skill code-conventions-zoppy-crm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-conventions
Source: https://github.com/Zoppy-crm/.github/tree/main/skills/backend/code-conventions
Command: npx skills add https://github.com/Zoppy-crm/.github --skill code-conventions-zoppy-crm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill eliminates inconsistent backend implementations by standardizing logging, error mapping, validation, method complexity, and queue integration practices for zoppy-api, reducing bugs and coupling across services.

Core Features & Use Cases

  • Structured Logging: Mandates using LogService for all mutating operations and before queue dispatches while prohibiting console.log and direct interpolation of user input into messages.
  • Error Mapping: Defines when to throw NotFoundException, UnprocessableEntityException, or BadRequestException to preserve correct HTTP semantics.
  • Validation and Architecture Rules: Instructs use of ApplicationValidationBase for application-layer validation, domain-level DomainValidation<T> for entity rules, and encourages early returns and smaller private helper methods to control complexity.
  • Queue Integration & Migration: Requires internal queue services for inter-service communication and deprecates using api-signatures HMAC HTTP calls to avoid coupling.
  • Use Case: When implementing a create/update/delete operation or migrating an internal HTTP-based call to a queue, follow these conventions to ensure consistency across services.

Quick Start

Use the code-conventions skill to determine the correct logging, exception, validation, and queue patterns when implementing a new create or update operation in zoppy-api.

Frequently Asked Questions about code-conventions

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

FAQPage Schema
How do I standardize logging and error mapping in a TypeScript backend?

Standardize TypeScript backend logging and error mapping by mandating LogService for all mutating operations and throwing NotFoundException, UnprocessableEntityException, or BadRequestException to preserve correct HTTP semantics.

When should I throw UnprocessableEntityException versus BadRequestException in backend code?

Throw UnprocessableEntityException or BadRequestException in backend code based on semantic error mapping rules, replacing direct user input interpolation and ensuring correct HTTP status codes for invalid operations.

How do I migrate internal HTTP api-signatures calls to a queue integration?

Migrate internal HTTP api-signatures calls to queue integration by replacing HMAC HTTP calls with internal queue services, avoiding direct service coupling and using LogService before queue dispatches.

What is the best way to validate application-layer logic in a TypeScript backend?

Validate application-layer logic in a TypeScript backend by extending ApplicationValidationBase for application rules and using DomainValidation<T> for entity constraints, ensuring early returns to control method complexity.

Why should I avoid console.log in backend mutation operations?

Avoid console.log in backend mutation operations to maintain consistent structured logging, relying instead on LogService to capture mutation events and prepare standardized logs before queue dispatches.

How do I generate UUIDs for identifiers in a TypeScript backend without external dependencies?

Generate UUIDs for identifiers in a TypeScript backend using StringUtil.generateUuid, avoiding external dependencies and ensuring consistent identifier creation across create, update, and delete operations.