Coding standards

From ithinkihaveacat/dotfiles · View interactive version

Coding standards is an AI agent skill from the GitHub repository ithinkihaveacat/dotfiles. Repository coding standards, linters, formatters, CLI design rules, HTTP caching guidelines, and git commit message conventions (Conventional Commits). Includes scripts for formatting Python, shell, Markdown, Kotlin, JSON, and XML. Use when writing, reviewing, formatting, or linting code, verifying

How to use this skill

Skill file

Coding Standards

This skill provides coding guidelines, linters, and formatters for making

changes across languages and domains in this repository.

Formatting Scripts

Helper scripts live in <skill-dir>/scripts/<tool> (without .py or .sh

extensions) and are symlinked onto PATH via ~/.dotfiles/bin/<tool>, so they

can be invoked directly by name (e.g., markdown-format) or via

scripts/<tool> relative to this skill directory. All formatters accept

--check, expand directory arguments recursively, format multiple files in

place, and read from stdin / write to stdout when given no paths (except

command-index-format, which uses --all instead of stdin). In strict

scratch-only sandboxes where ~/.cache/uv is read-only, set UV_CACHE_DIR to a

writable scratch directory before running uv-backed formatters.

using ruff (supports --check and recursive .py directory scanning).

scripts using shfmt and shellcheck, and format Fish scripts (.fish or

fish shebang) using fish_indent (supports --check and recursive

directory scanning).

mdformat with GFM and frontmatter wrapping (supports --check and recursive

.md directory scanning).

--help blocks in Markdown files with marker comments (accepts file or

directory paths, --check, and --all).

ktfmt with kotlinlang style (supports --check, recursive .kt/.kts

directory scanning, and AGENT_OFFLINE=1 when the jar is cached).

(supports --check and recursive .json directory scanning).

(supports --check and recursive .xml directory scanning; repository-local

XML layout rules in AGENTS.md, such as multi-line manifest attributes, take

precedence where specified).

Always prefer the helper scripts in scripts/ over raw tool invocations to

guarantee consistent repository formatting rules.

Core Standards & Guidelines

Markdown Quality

All Markdown files must be formatted with scripts/markdown-format (enforced in

CI via --check; .markdownlint-cli2.jsonc is optional editor configuration).

Keep repository Markdown strictly Unicode-only for symbols and notation (→,

≤, ×, code spans)—never use $...$ or $$...$$ LaTeX math, which plain GFM

mdformat escapes. Headings default to clean, unadorned ATX style

(## Heading) without manual bolding, ALL CAPS, or section numbers on topical

headings; see references/markdown.md for

existing-document and sequential-step rules.

Python Development

All Python files must be linted and formatted with scripts/python-format.

Follow type annotation conventions, structured CLI argument parsing with

argparse, and error handling standards. See

references/python.md.

Shell Script Quality

All shell scripts must pass scripts/shell-format (shellcheck and shfmt).

Use POSIX or Bash idioms with strict error handling (set -euo pipefail or

set -u), safe quoting, and discoverable help systems conforming to CLI design

guidelines. See references/shell.md.

CLI Tool Design

Language-agnostic rules for designing predictable, discoverable command-line

tools: clean command structures (tool [verb] [noun]), dual output streams

(stdout for data, stderr for diagnostics), deterministic exit codes, and

--help formatting. See references/cli-tools.md.

Script Self-Containment

Tools are one executable file by default. Split a script only when its

dependency set is materially different; keep the split file in scripts/ (never

libexec/); and resolve any unavoidable sibling from the script's real path, a

sentinel root, and an environment override. See

references/cli-tools.md.

Caching and Offline Mode

Cross-cutting conventions for tools that fetch remote resources over the

network: caching under $XDG_CACHE_HOME, strict offline mode enforcement via

AGENT_OFFLINE=1, and cache-age reporting. See

references/caching.md.

Long-Running Servers

Servers log one content-free record per request, bounded on disk, and leave

reading the logs to one separate reader; servers of one kind (this repository's

MCP servers) match each other, taking the existing ones as their specification.

See references/servers.md.

Git Operations & Commit Messages

Agents must not commit changes automatically unless explicitly authorized (or

when running guarded taskgo tracker commands—create, checkpoint, commit,

fix—in a control repository whose committed AGENTS.md declares taskgo).

Commit messages must adhere strictly to Conventional Commits syntax

(type(scope): description), keeping the subject under 50 characters and

hard-wrapping body prose to 72 characters. See

references/git.md.

Web Development

Guidelines for web development focusing on resilient client-side state

management, deep-linking, scroll-position preservation, and navigation behavior.

See references/web.md.

Reference Material

handling, and heading conventions.

packaging practices.

handling, and linters.

output streams, and exit codes.

offline-mode variables.

consistency between servers of one kind.

commit message rules.

guidelines.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.