coding-standards

amattas's avatarfrom amattas

Coding style and structural conventions for this codebase.

⭐0stars🔀0forks📁View on GitHub🕐Updated Dec 26, 2025

When & Why to Use This Skill

This Claude skill establishes comprehensive coding standards and structural conventions to ensure codebase consistency, readability, and maintainability. It provides a centralized reference for general programming principles—such as modular function design and structured logging—alongside language-specific best practices for Python, Swift, and Kotlin, helping teams reduce technical debt and streamline the development workflow.

Use Cases

  • Standardizing Code Architecture: Enforce uniform structural patterns like early returns, small focused functions, and pure functions to improve code clarity and testability.
  • Automating Code Reviews: Use the defined standards as a benchmark for reviewing pull requests, ensuring consistent logging fields, error handling, and documentation styles.
  • Onboarding and Training: Provide new developers with a clear roadmap of the project's stylistic expectations, including specific modularization guidelines for Python and memory management for Swift.
  • Technical Debt Prevention: Implement strict rules for TODO management and parameter grouping to prevent the accumulation of messy, undocumented, or overly complex code segments.
namecoding-standards
descriptionCoding style and structural conventions for this codebase.

Coding Standards

General Principles

Structure

  • Prefer small, focused functions.
  • Avoid deeply nested conditionals; use early returns.
  • Extract reusable logic into shared modules.

Comments & Documentation

  • Write comments to explain why, not what.
  • Keep docstrings in sync with behavior; avoid outdated comments.

Error & Logging

  • Use structured logging with consistent fields:
    • requestId, userId, component, severity
  • Never log secrets, tokens, or sensitive PII.

Misc

  • Avoid long parameter lists; group related values into objects.
  • Prefer pure functions where practical.
  • Add TODOs with owner and context, e.g.:
    • // TODO [owner]: [short description] ([ticket link])

Language-Specific Standards

For detailed language-specific conventions, see:

  • Python - Includes modularization guidelines (500-800 lines ideal, 1000 max), black/ruff usage, PEP 8, type hints, and testing conventions
  • Swift - iOS/macOS development standards, optionals, protocol-oriented programming, SwiftUI, and memory management
  • Kotlin - Android development standards, coroutines, idiomatic Kotlin, null safety, and Jetpack Compose patterns