# General Code Style

> Load before writing or editing any source file, in any language, the moment a task will create or modify code and before the first edit. Covers line breaks, the 100-character line limit, comments, and docblocks. The trigger is writing; a session that only reads code leaves it unloaded.

- **Type:** Skill
- **Install:** `agentstack add skill-toverux-grimoire-general-code-style`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [toverux](https://agentstack.voostack.com/s/toverux)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [toverux](https://github.com/toverux)
- **Source:** https://github.com/toverux/grimoire/tree/main/plugins/wards/skills/general-code-style

## Install

```sh
agentstack add skill-toverux-grimoire-general-code-style
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# General Code Style

Language-agnostic style rules.
Apply every rule below to all code you write or edit.

## Formatting

- Let the code breathe: separate logical blocks, and a variable's assignment from its usage, with single blank lines (never consecutive ones).
- Break every `{}` block across multiple lines, even a short one.
- Pass at most 4 parameters to a function; beyond that, group them into an object.
  Symmetry with neighboring code wins over this rule.
- Punctuate prose in comments, docblocks, and docs with commas, semicolons, or colons; never em dashes (—).
  When you meet an em dash, remove it or find a simpler formulation.
- Enforce a strict 100-character line length limit in source files, comments and docblock decoration included.
  Exceptions:
  - One-line lint warning suppression comments.
  - Long strings that would read worse split across lines.
  - AGENTS.md and other Markdown documents intended for agents (ex. skills, rules).
  - Any file where the limit is not applicable or desirable.

  On Claude Code, the wards plugin also ships a `check-line-length` hook that mechanically warns on limit breaches after edits, tunable per project via an optional `wards.config.json`.

## Comments and Docblocks

- Comment anything that is not self-explanatory within a few adjacent lines, and make each comment earn its place: a few high-value comments beat blanket coverage.
- Explain intent and the non-obvious why; the code already says what it does.
- Pitch comments at the durable altitude: capture the rule or invariant that stays true.
  Transient specifics (measured values, one-off observations, counts, dates) rot into misleading noise, as does over-description and heavy cross-referencing of other files.
- Describe the code as it is now, never narrating deleted or changed code ("this used to…", "the old X is gone").
  Reference removed code only when the present code cannot stand without it (a wire- or API-compatibility constraint, a non-obvious gotcha the removal left behind), and then state the constraint, not the chronology.
- Write in the active voice, end every sentence with a period, and use Oxford commas.
- In docblocks, wrap lines at sentence or logical boundaries to keep each legible on its own:

  Bad:

  ```text
  The cow is white. The
  dog is brown.
  ```

  Good:

  ```text
  The cow is white.
  The dog is brown.
  ```

- Outside Markdown and actual links, reference project files with wikilinks: `[[document.md]]`, never a bare `document.md`.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [toverux](https://github.com/toverux)
- **Source:** [toverux/grimoire](https://github.com/toverux/grimoire)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-toverux-grimoire-general-code-style
- Seller: https://agentstack.voostack.com/s/toverux
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
