Skip to content
Skills Library
Programming · Learning & explanation

coding

/coding

This skill should be used when writing or reviewing code in any language. Provides language-agnostic coding conventions for code quality, comments, error handling, and formatting. Project-specific conventions always take priority.

Author
sorah ↗
Repository
config ↗
Licence
MIT
Last repository change
24.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

This skill should be used when writing or reviewing code in any language. Provides language-agnostic coding conventions for code quality, comments, error handling, and formatting. Project-specific conventions always take priority.

Original author description

This skill should be used when writing or reviewing code in any language. Provides language-agnostic coding conventions for code quality, comments, error handling, and formatting. Project-specific conventions always take priority.

How it works

  1. Code Quality
  2. Code Comments
  3. Error Handling
Original SKILL.md headings · 82 lines, 899 words
SKILL.md preview
---
name: coding
description: This skill should be used when writing or reviewing code in any language. Provides language-agnostic coding conventions for code quality, comments, error handling, and formatting. Project-specific conventions always take priority.
version: 0.3.0
---

# General Coding Guidelines

Language-agnostic coding conventions applicable across all projects. Project-specific conventions (CLAUDE.md, style guides) always take priority over this guidance.

## Code Quality

- Do not leave empty lines containing only whitespace
- Write clean, readable code that follows the language's established conventions
- Use consistent indentation and formatting

## Code Comments

Comments must not repeat what the code already expresses. Use comments to explain **why** something is done, or to record context that cannot be recovered from the code itself.

Three rules govern everything below.

**Write for a stranger reading the file, not a reviewer reading the diff.** The reader has never seen the pull request, the spec, the ticket, the review discussion, or the previous version of the code. A comment that only makes sense with that context is noise to everyone else.

**Keep them short.** Default to a single line. Use two or three only when one genuinely cannot carry the constraint. This applies to doc comments too: a class or method doc comment states what the thing is and what it guarantees, in a sentence or two. It is not a design document.

**Avoid narrative.** A comment states a fact. It does not build to a point, weigh alternatives, or qualify itself. Punctuation is a reliable tell: reaching for an em dash, a semicolon, or a colon that introduces an explanation is the signal to stop and cut, not to keep writing. So is a second sentence opening with "But", "So", "Note that", or "In practice".

**When to comment:**

- To explain why a non-obvious approach or workaround was chosen
- To clarify intent when the code could be misread or misunderstood
- To record an external constraint (protocol, spec, upstream bug, API quirk) the code must satisfy
- To document an assumption, edge case, or limitation a reader would otherwise have to rediscover

**When not to comment:**

- Do not narrate what the code is doing, the code already says that
- Do not duplicate function or variable names in plain English
- Do not leave stale comments that contradict the code
- Do not reference removed or obsolete code paths

**Never write these:**

- **Change narration.** Anything phrased against a previous state of the code: "now falls back to ...", "no longer needed", "same answer as before", "pre-existing behaviour". The comment outlives the change. The diff and the commit message own that story.
- **Retold discussion.** Summarising the spec, the ticket, or the review instead of citing it: "beyond what the spec anticipated", "as discussed", "which is accepted", "the spec called this out".
- **Alternatives-considered essays.** Defending the chosen design against a design that is not in the file, or explaining at length why some other class was not extended instead.
- **Tutorial voice.** Addressing a future implementer rather than a reader: "the obvious implementation is X and it is wrong", "a consumer that wants Y calls Z".
- **Speculative threat or failure narratives.** Name the risk in a clause. Do not write out the attack or the hypothetical incident.
- **Inventories of sibling code.** Listing the other classes that do the same thing, or asserting what none of them do. It goes stale silently, and grep answers it anyway.
- **Markdown emphasis** (`**bold**`, `*italics*`) inside comments.

Test and spec files follow the same rules. Let the example name carry the intent instead of narrating the setup.

When the rationale is genuinely valuable but too long for a line or two, it belongs where a reader will look for it: the pull request description, the commit message, `docs/`, or the spec.

**Cite a discussion rather than retelling it.** A bare reference to a pull request, a GitHub or Linear issue, or an upstream bug is the compact form of context too large for a comment, and beats a paragraph whenever the reasoning behind the code is genuinely complex: `# Bound set from the measurements in #1234.` The reference still has to earn its line. Straightforward code with nothing hidden behind it gets no comment and no link.

**Example.** The same fact, before and after:

```ruby
# Retries with a fresh connection rather than reusing the pooled one — the
# pooled connection is what went stale in the first place, so reusing it is
# the obvious implementation and it is wrong: the second attempt then fails
# exactly as the first did, which is what happened before this changed.
```

```ruby
# A pooled connection may be stale, so the retry opens its own.
```

## Error Handling

- Avoid blanket exception handling unless absolutely necessary — error logging is typically handled by the runtime or framework
- Prefer letting exceptions propagate up the call stack
- Only catch specific exceptions when there is a meaningful reason:
  - Adding context to the error
  - Performing cleanup operations
  - Converting one exception type to another with additional information
  - Recovering from expected error conditions

When a boundary converts failures into one exception type:

- Wrap every failure unconditionally. Code behind the boundary raises ordinary errors, never the wrapper type, so the boundary has no "already wrapped?" branch to keep correct.
- Keep the cause out of the wrapper's message. The message says what failed at the boundary, and the cause already carries the original type and message.
- Log the cause. The wrapper's message alone says nothing about what went wrong.

Versions

RepositoryScoreLicence
This page · sorah/config100MIT
sudheer554/claude-code-project-template100MIT
pssah4/digital-innovation-agents100MIT
vaayne/agent-kit90MIT
Reevias/Prometheus-90MIT
liustack/vibemaster90MIT
skhoroshavin/tandem-skills86MIT

Database snapshot: 13.11.2026 · package version 280e64da9738 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100coding-principles
    This skill provides language-agnostic coding principles for maintainability, readability, and quality. Automatically loaded when implementing features, refactoring code, reviewing code quality, or when the user mentions "clean code", "best practices", "code quality", or "maintainability".
  • 100coding-principles
    Language-agnostic coding principles for maintainability, readability, and quality. Use when implementing features, refactoring code, or reviewing code quality.
  • 90rust
    This skill should be used when writing or reviewing Rust code, or when the project uses "Rust", "Cargo", "cargo clippy", "crate", or Rust module patterns. Provides Rust coding conventions, patterns, and best practices. Project-specific conventions always take priority.
  • 96python
    Python coding conventions and guidelines Triggers on: **/*.py
  • 95coding-standards
    Baseline cross-project coding conventions for naming, readability, immutability, and code-quality review. Use detailed frontend or backend skills for framework-specific patterns. Use when reviewing code quality or naming with no framework-specific skill that applies.
  • 95coding-standards
    Baseline cross-project coding conventions for naming, readability, immutability, and code-quality review. Use detailed frontend or backend skills for framework-specific patterns. Use when reviewing code quality or naming with no framework-specific skill that applies.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.