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.
npx skills add luoling8192/ai-coding-principles --skill ai-coding-disciplinegit clone --depth 1 https://github.com/luoling8192/ai-coding-principlesWrote 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.
[](https://agentmods.dev/skills/luoling8192/ai-coding-principles/ai-coding-discipline)<a href="https://agentmods.dev/skills/luoling8192/ai-coding-principles/ai-coding-discipline"><img src="https://agentmods.dev/badge/skills/luoling8192/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.
<a href="https://agentmods.dev/skills/luoling8192/ai-coding-principles/ai-coding-discipline"><img src="https://agentmods.dev/badge/skills/luoling8192/ai-coding-principles/ai-coding-discipline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00100 | $0.01761 |
| Opus 5.5 | $0.00040 | $0.00704 |
| Sonnet 5.5 | $0.00020 | $0.00352 |
| Haiku 4.5 | $0.00010 | $0.00176 |
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 3mo 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- ai-coding-discipline — 100% identical, 0 lines differ
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 ?.:
- Can this value legitimately be null/undefined at this point?
- If it is null, will the fallback produce a correct result downstream?
- 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' });
}
});
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.
- 3mo ago First seen · 216 lines · 100 tokens per session scan A 616f067df1d0
ai-coding-discipline is a skill published in the GitHub repository luoling8192/ai-coding-principles (173 stars, last pushed 8mo ago), licensed MIT. It adds 100 tokens to every session and 1,761 once invoked, about $0.0004 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.
ai-coding-discipline compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ai-coding-disciplineluoling8192/ai-coding-principles | Skill | 173 | 8mo ago | MIT | A | 100 | Claude Code, Codex |
| claude-md-improveranthropics/claude-plugins-official | Skill | 49k | today | Apache-2.0 | A | 82 | Claude Code |
| agent-platform-model-registrygoogle/skills | Skill | 25k | today | Apache-2.0 | A | 60 | Claude Code, Codex |
| gke-reliabilitygoogle/skills | Skill | 25k | today | Apache-2.0 | A | 85 | Claude Code, Codex |
| gke-workload-securitygoogle/skills | Skill | 25k | today | Apache-2.0 | A | 171 | Claude Code, Codex |
| google-cloud-solution-agentic-analytics-spark-knowledge-cataloggoogle/skills | Skill | 25k | today | Apache-2.0 | A | 132 | Claude Code, Codex |
| glance-canonical-layoutsandroid/skills | Skill | 11k | 8d ago | Apache-2.0 | A | 56 | Claude Code |