ai-coding-discipline

ai-coding-discipline is a skill for Claude Code, Codex from satbirbhbc-ux/ai-coding-principles. It costs 100 tokens per session (1,761 once invoked), scanned A, a copy of ai-coding-discipline, MIT.

A set of rules for writing, editing, reviewing and testing code safely. It tells an AI coding assistant how to handle missing data, errors and other common programming mistakes.

In plain words
What is it for?
Use it during feature work, bug fixes, refactoring, code reviews and test writing.
Why use it?
It reduces hidden bugs caused by silently substituting values or catching errors too broadly, making failures easier to find.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it during feature work, bug fixes, refactoring, code reviews and test writing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/satbirbhbc-ux/ai-coding-principles/ai-coding-discipline
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.

Any agent
npx skills add satbirbhbc-ux/ai-coding-principles --skill ai-coding-discipline
Clone the repo
git clone --depth 1 https://github.com/satbirbhbc-ux/ai-coding-principles

Made for: Claude Code, Codex.

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 ai-coding-discipline

README.md
[![agentmods](https://agentmods.dev/badge/skills/satbirbhbc-ux/ai-coding-principles/ai-coding-discipline/github.svg)](https://agentmods.dev/skills/satbirbhbc-ux/ai-coding-principles/ai-coding-discipline)
Your own site
<a href="https://agentmods.dev/skills/satbirbhbc-ux/ai-coding-principles/ai-coding-discipline"><img src="https://agentmods.dev/badge/skills/satbirbhbc-ux/ai-coding-principles/ai-coding-discipline/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 ai-coding-discipline

Your own site · 80×15
<a href="https://agentmods.dev/skills/satbirbhbc-ux/ai-coding-principles/ai-coding-discipline"><img src="https://agentmods.dev/badge/skills/satbirbhbc-ux/ai-coding-principles/ai-coding-discipline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,761 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 100% copy Near-identical to another mod 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.00100 $0.01761
Opus 5 $0.00050 $0.00881
Sonnet 5 $0.00020 $0.00352
Haiku 4.5 $0.00010 $0.00176

Measured 8d ago against content hash 616f067df1d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

ai-coding-discipline 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 8d 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.

Origin

This is a copy

100% identical to ai-coding-discipline — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

ai-coding-discipline/SKILL.md · 216 lines

How it starts

The opening of the file, as written. The whole thing — 216 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AI Coding Discipline

These rules override default AI coding tendencies. Follow them in ALL code you write or modify.


Rule 1: No Silent Fallbacks

Never use fallback values to mask data that should not be missing.

// FORBIDDEN — hides upstream bugs
const price = product?.price ?? 0;
const userName = user?.name || "Unknown";

// CORRECT — fail fast when data contract is violated
if (product.price == null) {
  throw new Error(`Product ${product.id} is missing price`);
}
const price = product.price;

When fallbacks ARE acceptable:

  • User-facing display with explicit design intent (e.g., avatar placeholder)
  • Optional configuration with documented defaults
  • External input parsing where absence is a valid state

Checklist before writing ??, ||, or ?.:

  1. Can this value legitimately be null/undefined at this point?
  2. If it is null, will the fallback produce a correct result downstream?
  3. Would a thrown error help me find a bug faster?

If the answer to #3 is yes, throw instead of falling back.


Rule 2: No Catch-All try/catch in Business Logic

Business logic functions must NOT wrap everything in try/catch. Let errors propagate naturally.

// FORBIDDEN — swallows all errors into a useless null
async function createOrder(data: OrderInput) {
  try {
    const user = await getUser(data.userId);
    const coupon = await validateCoupon(data.couponCode);
    const order = await saveOrder({ ...data, discount: coupon.value });
    return order;
  } catch (error) {
    console.log('Error creating order:', error);
    return null; // caller gets null, has no idea what failed
  }
}

// CORRECT — let errors bubble up, catch at the boundary
async function createOrder(data: OrderInput) {
  const user = await getUser(data.userId);
  const coupon = await validateCoupon(data.couponCode);
  const order = await saveOrder({ ...data, discount: coupon.value });
  return order;
}

// Catch ONLY at the API/controller boundary
app.post('/orders', async (req, res) => {
  try {
    const order = await createOrder(req.body);
    res.json(order);
  } catch (error) {
    logger.error('Order creation failed', { error, body: req.body });
    res.status(500).json({ error: 'Order creation failed' });
  }
});

Read the full file on GitHub · 216 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 216 lines · 100 tokens per session scan A 616f067df1d0

Subscribe to this mod's changes

ai-coding-discipline is a skill published in the GitHub repository satbirbhbc-ux/ai-coding-principles (3 stars, last pushed today), licensed MIT. It adds 100 tokens to every session and 1,761 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to ai-coding-discipline, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

neuron-evaluation-engineer

Create and run AI evaluations with datasets, assertions, and output drivers in Neuron AI. Use this skill whenever the user mentions evaluation, testing AI systems, creating evaluators, dataset-driven testing, assertion-based validation, or wants to measure AI system performance. Also trigger for tasks involving…

neuron-core/neuron-ai · 77 tokens

neuron-structured-output

Design and implement structured output classes for Neuron AI agents using SchemaProperty attributes and validation rules. Use this skill when the user mentions structured output, JSON schema extraction, data validation, output classes, DTOs for AI responses, extracting structured data from LLM, or configuring property…

neuron-core/neuron-ai · 104 tokens

compare-harnesses

Diff two scaffolded harnesses (ADR-031). Reports manifest meta drift + host list + per-file fingerprint changes (added/removed/changed). Exits 0 IDENTICAL, 1 DRIFT, 2 missing manifest. Use --bundle for the ADR-031 schema-1 JSON envelope.

ruvnet/metaharness · 66 tokens

create-harness

Scaffold your own focused AI agent harness — pick host (Claude Code, Codex, pi.dev, Hermes), template, agents, skills, and ship a npm-publishable harness with its own npx CLI. Use when a user asks to "create my own agent harness", "scaffold a harness", "make a custom Claude Code plugin like ruflo", or "build a…

ruvnet/metaharness · 89 tokens

example-harness

Scaffold a ready-made AI agent harness in one command from the 19 published @metaharness/ example packages — 9 host integrations (Claude Code, Codex, Hermes, pi.dev, OpenClaw, RVM, Copilot, OpenCode, GitHub Actions) + 10 vertical pods (devops, research, trading, support, legal, coding, education, sales, gaming…

ruvnet/metaharness · 90 tokens

repo-genome

7-section readiness scorecard for a LOCAL repo. Reports repo type + agent topology + MCP risk + test confidence + release readiness + recommended harness plan + scorecard. Exit 0 ready, 1 needs-work, 2 blocked. --json for the 6-field scorecard, --bundle for the ADR-031 schema-1 envelope.

ruvnet/metaharness · 73 tokens