code-conventions

Enforce project-wide code conventions to eliminate magic numbers and require constants.

Updated Nov 26, 2025
One-click install
npx skills add https://github.com/shiroinock/Darts-Score-Trainer --skill code-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-conventions
Source: https://github.com/shiroinock/Darts-Score-Trainer/tree/main/.claude/skills/code-conventions
Command: npx skills add https://github.com/shiroinock/Darts-Score-Trainer --skill code-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill codifies project-wide coding conventions to eliminate magic numbers, enforce constants, optimize performance, and separate coordinate systems.

Core Features & Use Cases

  • Eliminate magic numbers: Use constants from imported modules.
  • Constant references: Import constants instead of hardcoding numbers.
  • Performance optimization: Move invariant setup out of loops.
  • Coordinate separation: Always separate physical vs screen coordinates.
  • Use Case: When implementing new features, follow these conventions to keep codebase consistent.

Quick Start

Follow these conventions when implementing, testing, or reviewing code. Import BOARD_PHYSICAL constants and use constants to avoid magic numbers.

Frequently Asked Questions about code-conventions

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

FAQPage Schema
How do I eliminate magic numbers from my codebase?

Eliminate magic numbers by importing and referencing constants from your project's modules instead of hardcoding numeric values. This approach centralizes value definitions, improves maintainability, and makes code intent explicit across implementation and testing phases.

Why should I separate physical and screen coordinates in my code?

Separating physical and screen coordinates prevents coordinate-system confusion and bugs in rendering and collision detection. Always distinguish between domain coordinates and display coordinates to maintain consistency across your codebase and avoid performance issues from misaligned transformations.

What performance gains come from moving invariant setup out of loops?

Moving setup operations outside loops eliminates redundant computation on each iteration, reducing CPU cycles and improving runtime performance. This convention ensures expensive operations—constant initialization, complex calculations—execute once rather than repeatedly during loop execution.

How do I implement consistent coding conventions across a team project?

Enforce project-wide coding conventions during implementation and code reviews by requiring constant references, eliminating magic numbers, separating coordinates, and following performance best practices. Apply these standards uniformly so all contributors maintain the same codebase style and quality.

Can I apply these conventions to existing codebases?

Yes, code-conventions standards apply during implementation, testing, and code reviews for both new features and legacy code. Incrementally refactor existing code to import BOARD_PHYSICAL constants and eliminate magic numbers as you modify or review sections.