Code Standards

Code Standards is an agent for Claude Code from JSK9999/ai-nexus. It costs 16 tokens per session (759 once invoked), scanned A, original, Apache-2.0.

A set of English-language coding standards for clean code, safe changes, refactoring, and testing.

In plain words
What is it for?
Use it for implementation planning, code reviews, refactoring, regression tests, error handling, logging, and changes involving callers, configuration, or external systems.
Why use it?
It gives developers rules for understanding a codebase before editing it, comparing options, validating inputs, limiting complexity, and testing changes.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: mentions AGENTS.md.

Good fit Use it for implementation planning, code reviews, refactoring, regression tests, error handling, logging, and changes involving callers, configuration, or external systems.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/jsk9999/ai-nexus/code-standards
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/JSK9999/ai-nexus

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Code Standards

README.md
[![agentmods](https://agentmods.dev/badge/agents/jsk9999/ai-nexus/code-standards/github.svg)](https://agentmods.dev/agents/jsk9999/ai-nexus/code-standards)
Your own site
<a href="https://agentmods.dev/agents/jsk9999/ai-nexus/code-standards"><img src="https://agentmods.dev/badge/agents/jsk9999/ai-nexus/code-standards/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Code Standards

Your own site · 80×15
<a href="https://agentmods.dev/agents/jsk9999/ai-nexus/code-standards"><img src="https://agentmods.dev/badge/agents/jsk9999/ai-nexus/code-standards.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 759 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00016 $0.00759
Opus 5.5 $0.00006 $0.00304
Sonnet 5.5 $0.00003 $0.00152
Haiku 4.5 $0.00002 $0.00076

Measured 1mo ago against content hash 7eb17b955a13, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Code Standards scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

config/agents/code-standards.md · 82 lines

What it actually says

AGENTS.md

Problem Definition → Small Safe Changes → Change Review → Refactoring — Repeat this loop.

Mandatory Rules

Read related files from start to finish, including call/reference paths, before changing anything.
Keep work, commits, and PRs small.
Record assumptions in Issues/PRs/ADRs.
Validate all inputs and encode/normalize outputs.
Avoid premature abstraction and use intention-revealing names.
Compare at least two alternatives before deciding.

Mindset

Think like a senior engineer.
Don't jump to conclusions or rush into assumptions.
Always evaluate multiple approaches, write one line each for pros/cons/risks, then choose the simplest solution.

Code & File Reference Rules

Read files thoroughly from start to finish (no partial reading).
Before changing code, find and read definitions, references, call sites, related tests, docs/config/flags.
Don't change code without reading the entire file.
Before modifying symbols, use global search to understand pre/post conditions and document impact in 1-3 lines.

Required Coding Rules

Write Problem 1-Pager before coding: Background / Problem / Goals / Non-Goals / Constraints.
Follow limits: File ≤ 300 LOC, Function ≤ 50 LOC, Parameters ≤ 5, Cyclomatic Complexity ≤ 10. Split/refactor if exceeded.
Prefer explicit code; prohibit hidden "magic".
Follow DRY but avoid premature abstraction.
Isolate side effects (I/O, network, global state) to boundary layers.
Handle only specific exceptions and provide clear messages to users.
Use structured logging and don't record sensitive data (propagate request/correlation IDs when possible).
Consider timezones and DST.

Testing Rules

Add new tests for new code; bug fixes must include regression tests (write to fail first).
Tests should be deterministic and independent; replace external systems with fakes/contract tests.
E2E tests must include ≥1 success path and ≥1 failure path.
Proactively assess risks from concurrency/locks/retries (duplicates, deadlocks, etc.).

ABSOLUTE Security Rules

NEVER: Leave secrets (passwords/API keys/tokens) in code/logs/tickets/environment variables/.env files.
NEVER: Log sensitive data (PII/credit cards/SSN) in logs.
NEVER: Leave SQL injection, XSS, CSRF vulnerabilities.
ALWAYS: Validate, normalize, and encode all inputs; use parameterized queries.
ALWAYS: Use HTTPS/TLS and apply principle of least privilege.
ALWAYS: Apply authentication/authorization to all endpoints.
ALWAYS: Set security headers (CSP, HSTS, X-Frame-Options).
ALWAYS: Regularly scan and update dependency vulnerabilities.
Stop work immediately and request review upon security violations.

Clean Code Rules

Use intention-revealing names.
Each function does one thing.
Isolate side effects to boundary layers.
Prefer guard clauses.
Always symbolize constants (no hardcoding).
Structure code as Input → Processing → Return.
Report failures with specific errors/messages.
Make tests work as usage examples and include boundary/failure cases.
Never add useless emojis.

Anti-Pattern Rules

Don't modify code without reading full context.
Don't expose secrets.
Don't ignore failures or warnings.
Don't introduce unfounded optimizations or abstractions.
Don't abuse broad exceptions.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 82 lines · 16 tokens per session scan A 7eb17b955a13

Subscribe to this mod's changes

Code Standards is an agent published in the GitHub repository JSK9999/ai-nexus (19 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 16 tokens to every session and 759 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

skill-reviewer

Skill quality reviewer for SKILL.md format validation, content assessment, and structural refactoring following the agentskills.io standard.

pjt222/agent-almanac · 27 tokens

refactoring-expert

Improve code quality and reduce technical debt through systematic refactoring and clean code principles. Ideal after audits, design drift, or when preparing for feature work that relies on legacy areas.

NickCrew/Claude-Cortex · 42 tokens

ss-reviewer

Independent code reviewer for the specship review stage — one member of the opt-in review panel. Use to get fresh, context-free eyes on a working diff, optionally through a named lens (correctness, security, performance, contract-consistency). Reports findings only; it does not fix code, decide the verdict, or touch…

bonnguyenitc/specship · 72 tokens

code-reviewer

Reviews code for bugs, logic errors, security vulnerabilities, code quality issues, and adherence to project conventions. Merges security review capabilities including OWASP validation, secrets scanning, and regression detection. Uses confidence-based filtering for quality issues and severity classification for…

zircote-plugins/refactor · 65 tokens

simplifier

Code simplification specialist for refactoring workflows. Simplifies and refines recently changed code for clarity, consistency, and maintainability while preserving all functionality.

zircote-plugins/refactor · 33 tokens

Refactoring Specialist

Expert at breaking down complex methods into smaller, focused, testable units while maintaining backward compatibility.

DollhouseMCP/collection · 22 tokens