Agent skill

Coding Principles

by shinpr in shinpr/claude-code-workflows

Language-agnostic coding principles for maintainability, readability, and quality.

MITAuto-check passedDevelopment

Install Coding Principles

skills CLI
$ npx skills add shinpr/claude-code-workflows --skill coding-principles -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install shinpr/claude-code-workflows coding-principles --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/shinpr/claude-code-workflows.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/coding-principles .claude/skills/coding-principles && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
coding-principles
GitHub stars
690
Token cost
~2.4k tokens
SKILL.md length
1,213 words
Files
2 (incl. references)
Skills in repo
30
Repo updated
First seen
Licence
MIT

At a glance

Language-agnostic coding principles for maintainability, readability, and quality.

  • Works in 5 steps: Maintainability over Speed: Prioritize… → Simplicity First: Choose the simplest… → Design Convergence: Deliver the current… → …
  • Implementing features
  • SKILL.md covers Core Philosophy, Code Quality, Function Design and Error Handling, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Coding Principles is an agent skill from shinpr/claude-code-workflows. Language-agnostic coding principles for maintainability, readability, and quality. Use when implementing features, refactoring code, or reviewing code quality.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/security-checks.md`).

It sits in Development, covering Code quality, Plain language and style rules and Refactoring. The repository describes itself as: Development workflows for Claude Code that keep broad exploration focused on the outcome you approved. The licence is MIT.

When your agent uses it

  • Implementing features
  • Refactoring code
  • Reviewing code quality

Example prompts

  • “/coding-principles”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Maintainability over Speed: Prioritize long-term code health over initial development velocity
  2. Simplicity First: Choose the simplest solution that meets requirements (YAGNI principle)
  3. Design Convergence: Deliver the current required outcome with the least new design surface. Selecting persistent state, public or…
  4. Explicit over Implicit: Make intentions clear through code structure and naming
  5. Delete over Comment: Remove unused code instead of commenting it out

What it can do on your machine

Read from SKILL.md and the folder at commit a4ecd62. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Coding Principles loads about 2.4k tokens when it runs, and up to ~3.5k if it reads all its reference files. Until then it costs about 44 tokens; SKILL.md has 1,213 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~44
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from shinpr/claude-code-workflows at commit a4ecd62, republished under its MIT licence (© shinpr). 1,213 words, ~2,397 tokens.

Download SKILL.mdSave it as .claude/skills/coding-principles/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
coding-principles
description
Language-agnostic coding principles for maintainability, readability, and quality. Use when implementing features, refactoring code, or reviewing code quality.

Language-Agnostic Coding Principles

Core Philosophy

  1. Maintainability over Speed: Prioritize long-term code health over initial development velocity
  2. Simplicity First: Choose the simplest solution that meets requirements (YAGNI principle)
  3. Design Convergence: Deliver the current required outcome with the least new design surface. Selecting persistent state, public or cross-boundary contracts, behavioral modes, reusable abstractions, or component splits carries enough surface to justify the full convergence process first.
  4. Explicit over Implicit: Make intentions clear through code structure and naming
  5. Delete over Comment: Remove unused code instead of commenting it out

Code Quality

Continuous Improvement
  • Refactor related code inside the accepted outcome and governing boundaries when it reduces the change's risk or maintenance cost
  • Improve code structure incrementally
  • Keep the codebase lean and focused
  • Delete code proven obsolete by the requested change after checking its callers; report uncertain or out-of-scope cleanup separately
Readability
  • Use meaningful, descriptive names drawn from the problem domain
  • Use full words in names; abbreviations are acceptable only when widely recognized in the domain
  • Use descriptive names; single-letter names are acceptable only for loop counters or well-known conventions (i, j, x, y)
  • Extract magic numbers and strings into named constants
  • Keep code self-documenting where possible

Function Design

Parameter Management
  • Group related positional parameters into an object, struct, or dictionary when call-site clarity or coordinated evolution requires it. Retain positional parameters when their order is conventional and the call remains clear, or an external/public signature requires them
  • Preserve external/public signatures unless their migration is part of the accepted outcome or governing artifact
Single Responsibility
  • Each function should do one thing well
  • Extract a function when independently changing responsibilities or obscured control flow make the current unit harder to understand, verify, or reuse; retain a cohesive domain flow when extraction would create artificial coupling
  • Extract complex logic into separate, well-named functions
  • Functions should have a single level of abstraction
Function Organization
  • Pure functions when possible (no side effects)
  • Separate data transformation from side effects
  • Use early returns to reduce nesting
  • Use early returns or extraction when nesting obscures state transitions or decision ownership; retain nested structure when it maps the domain decision more clearly

Error Handling

Error Management Principles
  • Always handle errors: Log with context or propagate explicitly
  • Log appropriately: Include context for debugging
  • Protect sensitive data: Mask or exclude passwords, tokens, PII from logs
  • Fail fast: Detect and report errors as early as possible
Error Propagation
  • Use language-appropriate error handling mechanisms
  • Propagate errors to appropriate handling levels
  • Provide meaningful error messages
  • Include error context when re-throwing

Dependency Management

Loose Coupling via Parameterized Dependencies
  • Inject external dependencies as parameters (constructor injection for classes, function parameters for procedural/functional code)
  • Depend on abstractions, not concrete implementations
  • Minimize inter-module dependencies
  • Facilitate testing through mockable dependencies

Reference Representativeness

Verifying References Before Adoption

When adopting patterns, APIs, or dependencies from existing code:

  • IF a reference sample covers only nearby files → THEN confirm the pattern is representative by checking relevant repository usage before adopting
  • IF multiple approaches coexist in the repository → THEN identify the majority pattern and make a deliberate choice — selecting whichever is nearest is insufficient
  • IF adopting an external dependency (library, plugin, SDK) → THEN verify repository-wide usage and compatibility evidence; when that evidence cannot determine the required version, record the unresolved version decision and the evidence needed to settle it
  • IF following an existing pattern → THEN state the reason for following it when an alternative exists (e.g., consistency with surrounding code, avoiding breaking changes, pending coordinated update)
Principle

Nearby code is a starting point for investigation, not a sufficient basis for adoption. Verify that what you reference is representative of the repository's conventions and current best practices before using it as a model.

Performance Considerations

Optimization Approach
  • Measure first: Profile before optimizing
  • Focus on algorithms: Algorithmic complexity > micro-optimizations
  • Use appropriate data structures: Choose based on access patterns
  • Resource management: Handle memory, connections, and files properly
When to Optimize
  • After identifying actual bottlenecks through profiling
  • When performance issues are measurable
  • Optimize only after measurable bottlenecks are identified, not during initial development

Code Organization

Structural Principles
  • Group related functionality: Keep related code together
  • Separate concerns: Domain logic, data access, presentation
  • Consistent naming: Follow project conventions
  • Module cohesion: High cohesion within modules, low coupling between
File Organization
  • One primary responsibility per file
  • Logical grouping of related functions/classes
  • Clear folder structure reflecting architecture
  • Split a file when it contains independently changing responsibilities or creates material navigation, coupling, or verification cost; retain a cohesive file when splitting would add avoidable coupling or navigation cost
Show full SKILL.md (467 more words)Show less

Commenting Principles

Default: code first

Names, types, and structure are the primary medium. A comment earns its place only by carrying information the code itself cannot express. When in doubt, improve the name instead of adding a comment.

The test for every comment

A comment is justified only if it answers one of these:

  • Why: reasoning, trade-off, or constraint behind a non-obvious decision
  • Limitation / edge case: a boundary a reader cannot infer from the code
  • Public API contract: behavior, inputs, outputs of an exported interface

One comment per decision. If a comment restates what the names and control flow already show, delete it and rename instead.

Comment Scope
  • Comment the why, limits, and public contracts (per the test above); let names and structure carry everything else, including the "how"
  • Record historical context in version control commit messages, not in comments
  • Delete commented-out code (retrieve from git history when needed)
Comment Quality
  • Base comments on stable rationale, limits, and contracts rather than dates, versions, or temporary state
  • Update comments when changing code
  • Use proper grammar and formatting
  • Write for future maintainers

Refactoring Approach

Safe Refactoring
  • Small steps: Make one change at a time
  • Maintain working state: Keep tests passing
  • Verify behavior: Run tests after each change
  • Incremental improvement: Make the smallest sufficient improvement in each increment
Refactoring Triggers
  • Code duplication (DRY principle)
  • Functions that contain independently changing responsibilities or obscured control flow
  • Complex conditional logic
  • Unclear naming or structure

Security Principles

Secure Defaults
  • Store credentials and secrets through environment variables or dedicated secret managers
  • Use parameterized queries (prepared statements) for all database access
  • Use established cryptographic libraries provided by the language or framework
  • Generate security-critical values (tokens, IDs, nonces) with cryptographically secure random generators
  • Encrypt sensitive data at rest and in transit using standard protocols
Input and Output Boundaries
  • Validate all external input at system entry points for expected format, type, and length. External input includes request data, external service responses, model or tool output, and stored data whose writer is untrusted or whose consumer needs a guarantee the store does not make
  • When a change alters a boundary where external content or model output selects a tool's action, target, or destination, verify that those values cannot exceed the operation scope and access rights already granted to the caller
  • Encode output appropriately for its rendering context (HTML, SQL, shell, URL)
  • Return only information necessary for the caller in error responses; log detailed diagnostics server-side
Access Control
  • Apply authentication to all entry points that handle user data or trigger state changes
  • Verify authorization for each resource access, not only at the entry point
  • Grant only the permissions required for the operation (files, database connections, API scopes)
  • For changes involving identity or protected resources, prioritize authentication and per-resource authorization review

For concrete detection patterns used by security review, see references/security-checks.md.

© shinpr, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/coding-principles of shinpr/claude-code-workflows.

  • SKILL.md
  • references/security-checks.md

Open the folder on GitHubat commit a4ecd62

Compare with similar skills

Coding Principles next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Coding Principles compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Coding Principles this skillshinpr/claude-code-workflows690—~2.4kAutomated safety check: PassMIT
Cyclomatic Complexitysaurabhkumar8112/cyclomatic-complexity-skill405—~761Automated safety check: PassApache-2.0
Clean Codejd-solanki/slidev-theme-dracula1611 repos~3.8kAutomated safety check: PassMIT
Rnd Code Simplifychendongqi/OPB-Skills125—~2.2kAutomated safety check: PassNone
Coding Standardsshinpr/ai-coding-project-boilerplate232—~3.8kAutomated safety check: NotesMIT
Systematic Code Refactoringluongnv89/claude-howto42k—~3kAutomated safety check: PassMIT

Similar skills

  • Cyclomatic Complexity

    saurabhkumar8112/cyclomatic-complexity-skill

    Refactor code to reduce cyclomatic complexity so it stays readable, maintainable, and aligned with the long-term vision of the codebase, not just optimized for AI comprehension.

    405 GitHub stars~761 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Clean Code

    jd-solanki/slidev-theme-dracula

    Write readable, maintainable code through disciplined naming, small functions, and clean error handling.

    161 GitHub starsUsed in 1 repo~3.8k tokens
    DevelopmentAuto-check passed
  • Rnd Code Simplify

    chendongqi/OPB-Skills

    Expert code simplification and refactoring specialist that autonomously enhances code clarity, consistency, and maintainability while preserving exact functionality.

    125 GitHub stars~2.2k tokensUpdated 7 mo ago
    DevelopmentAuto-check passed
  • Coding Standards

    shinpr/ai-coding-project-boilerplate

    Detects code smells, anti-patterns, and readability issues. An agent skill from shinpr/ai-coding-project-boilerplate.

    232 GitHub stars~3.8k tokensUpdated 3 days ago
    DevelopmentAuto-check: notes
  • Systematic Code Refactoring

    luongnv89/claude-howto

    Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.

    42k GitHub stars~3k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    68k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from shinpr/claude-code-workflows

All 30 skills in this repo
  • Integration E2E Testing

    shinpr/claude-code-workflows

    Integration and E2E test design principles, ROI calculation, test skeleton specification, and review criteria.

    690 GitHub stars~3.5k tokensUpdated 6 days ago
    Auto-check passed
  • AI Development Guide

    shinpr/claude-code-workflows

    Applies language-agnostic and backend technical decision criteria, anti-pattern detection, debugging, and quality gates.

    690 GitHub stars~3.9k tokensUpdated 6 days ago
    Auto-check passed
  • Frontend AI Guide

    shinpr/claude-code-workflows

    Applies React/TypeScript-specific technical decision criteria, anti-pattern detection, debugging, and frontend quality gates.

    690 GitHub stars~3k tokensUpdated 6 days ago
    Auto-check passed
  • Implementation Approach

    shinpr/claude-code-workflows

    Implementation strategy selection framework. An agent skill from shinpr/claude-code-workflows.

    690 GitHub stars~2.6k tokensUpdated 6 days ago
    Auto-check passed
  • Recipe Quality Profile

    shinpr/claude-code-workflows

    Proposes repository-specific quality policy for implementation and review and, after confirmation, creates or updates docs/project-context/quality.yaml.

    690 GitHub stars~1.1k tokensUpdated 6 days ago
    Auto-check passed
  • Subagents Orchestration Guide

    shinpr/claude-code-workflows

    Guides subagent coordination through implementation workflows.

    690 GitHub stars~9.3k tokensUpdated 6 days ago
    Auto-check passed

Categories

Questions about Coding Principles

What does Coding Principles do?

Language-agnostic coding principles for maintainability, readability, and quality. Coding Principles is an agent skill from shinpr/claude-code-workflows. Language-agnostic coding principles for maintainability, readability, and quality.

When should I use Coding Principles?

Coding Principles fits situations like: implementing features; refactoring code; reviewing code quality.

How do I install Coding Principles in Claude Code?

Run `npx skills add shinpr/claude-code-workflows --skill coding-principles -a claude-code`. Or copy the skill folder (skills/coding-principles in shinpr/claude-code-workflows) into .claude/skills/coding-principles in your project. Claude Code loads it when a task matches its description.

How do I install Coding Principles in Codex?

Run `npx skills add shinpr/claude-code-workflows --skill coding-principles -a codex`. Or copy the skill folder (skills/coding-principles in shinpr/claude-code-workflows) into .agents/skills/coding-principles in your project. Codex loads it when a task matches its description.

Can I use Coding Principles in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add shinpr/claude-code-workflows --skill coding-principles -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/coding-principles, .gemini/skills/coding-principles, .github/skills/coding-principles and .opencode/skills/coding-principles in your project.

What does Coding Principles need to run?

SKILL.md names no scripts, command-line tools or credentials: Coding Principles is instructions for the agent only.

Does Coding Principles access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Coding Principles safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Coding Principles use?

Coding Principles is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Coding Principles use?

About 2.4k tokens (SKILL.md is roughly 9.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.

What are the alternatives to Coding Principles?

Skills that share tags, products or a category with Coding Principles: Cyclomatic Complexity (saurabhkumar8112/cyclomatic-complexity-skill, 405 stars), Clean Code (jd-solanki/slidev-theme-dracula, 161 stars), Rnd Code Simplify (chendongqi/OPB-Skills, 125 stars) and Coding Standards (shinpr/ai-coding-project-boilerplate, 232 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Coding Principles?

shinpr (a GitHub user) maintains it in shinpr/claude-code-workflows, which has 690 GitHub stars. The repository holds 30 skills in this directory. The repository was last updated on October 1, 2026.

Source: shinpr/claude-code-workflows on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.