Code Review Graph Navigator
handsontable/handsontable
Queries a pre-built, Tree-sitter-based code graph of the whole monorepo instead of grepping call chains, for exploring, debugging, refactoring or reviewing code.
Mandatory coding discipline rules that prevent common AI coding anti-patterns.
$ npx skills add luoling8192/ai-coding-principles --skill ai-coding-discipline -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install luoling8192/ai-coding-principles ai-coding-discipline --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/luoling8192/ai-coding-principles.git skills-src && mkdir -p .claude/skills && cp -r skills-src/ai-coding-discipline .claude/skills/ai-coding-discipline && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "ai-coding-discipline" agent skill from https://github.com/luoling8192/ai-coding-principles/tree/main/ai-coding-discipline into .claude/skills/ai-coding-discipline/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ai-coding-discipline", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/luoling8192/ai-coding-principles/tree/main/ai-coding-disciplineType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add luoling8192/ai-coding-principles --skill ai-coding-discipline -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install luoling8192/ai-coding-principles ai-coding-discipline --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/luoling8192/ai-coding-principles.git skills-src && mkdir -p .agents/skills && cp -r skills-src/ai-coding-discipline .agents/skills/ai-coding-discipline && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "ai-coding-discipline" agent skill from https://github.com/luoling8192/ai-coding-principles/tree/main/ai-coding-discipline into .agents/skills/ai-coding-discipline/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ai-coding-discipline", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add luoling8192/ai-coding-principles --skill ai-coding-discipline -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install luoling8192/ai-coding-principles ai-coding-discipline --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/luoling8192/ai-coding-principles.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/ai-coding-discipline .cursor/skills/ai-coding-discipline && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "ai-coding-discipline" agent skill from https://github.com/luoling8192/ai-coding-principles/tree/main/ai-coding-discipline into .cursor/skills/ai-coding-discipline/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ai-coding-discipline", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/luoling8192/ai-coding-principles.git --path ai-coding-discipline--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add luoling8192/ai-coding-principles --skill ai-coding-discipline -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install luoling8192/ai-coding-principles ai-coding-discipline --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/luoling8192/ai-coding-principles.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/ai-coding-discipline .gemini/skills/ai-coding-discipline && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "ai-coding-discipline" agent skill from https://github.com/luoling8192/ai-coding-principles/tree/main/ai-coding-discipline into .gemini/skills/ai-coding-discipline/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ai-coding-discipline", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install luoling8192/ai-coding-principles ai-coding-disciplineInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add luoling8192/ai-coding-principles --skill ai-coding-discipline -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/luoling8192/ai-coding-principles.git skills-src && mkdir -p .github/skills && cp -r skills-src/ai-coding-discipline .github/skills/ai-coding-discipline && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "ai-coding-discipline" agent skill from https://github.com/luoling8192/ai-coding-principles/tree/main/ai-coding-discipline into .github/skills/ai-coding-discipline/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ai-coding-discipline", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add luoling8192/ai-coding-principles --skill ai-coding-discipline -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install luoling8192/ai-coding-principles ai-coding-discipline --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/luoling8192/ai-coding-principles.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/ai-coding-discipline .opencode/skills/ai-coding-discipline && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "ai-coding-discipline" agent skill from https://github.com/luoling8192/ai-coding-principles/tree/main/ai-coding-discipline into .opencode/skills/ai-coding-discipline/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ai-coding-discipline", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
ai-coding-disciplineMandatory coding discipline rules that prevent common AI coding anti-patterns.
AI Coding Discipline is an agent skill from luoling8192/ai-coding-principles. Mandatory coding discipline rules that prevent common AI coding anti-patterns. MUST be loaded for ALL code writing, editing, reviewing, bug fixing, and testing tasks. Trigger on: writing code, editing code, fixing bugs, writing tests, implementing features, refactoring, code review, creating functions, adding error handling, debugging. This skill enforces fail-fast principles, proper error propagation, meaningful tests, and disciplined debugging workflows. Always active when Claude writes or modifies code.
Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development, covering Debugging and Refactoring. The repository describes itself as: A collection of Claude Code skills that enforce coding discipline and prevent common AI coding anti-patterns. The licence is MIT.
3 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 27db986. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
AI Coding Discipline loads about 1.9k tokens when it runs. Until then it costs about 133 tokens; SKILL.md has 552 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from luoling8192/ai-coding-principles at commit 27db986, republished under its MIT licence (© luoling8192). 552 words, ~1,856 tokens.
.claude/skills/ai-coding-discipline/SKILL.md (or your agent's skills folder).These rules override default AI coding tendencies. Follow them in ALL code you write or modify.
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:
Checklist before writing ??, ||, or ?.:
If the answer to #3 is yes, throw instead of falling back.
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' });
}
});Where try/catch IS appropriate:
Never catch Error just to return null, undefined, false, or an empty object.
Every test must verify specific business outcomes. A test that passes when the core logic is deleted is worthless.
// FORBIDDEN — passes even if processOrder returns garbage
test('should process order', async () => {
const result = await processOrder(mockOrder);
expect(result).toBeDefined();
});
// CORRECT — verifies exact business behavior
test('should calculate total with 10% discount', async () => {
const result = await processOrder({
...mockOrder,
discount: 0.1,
});
expect(result.totalAmount).toBe(900); // 1000 * 0.9
expect(result.discountAmount).toBe(100);
expect(result.status).toBe('confirmed');
});Test quality checklist:
Banned weak assertions (unless testing existence is the actual requirement):
toBeDefined(), toBeTruthy(), toBeFalsy() as sole assertiontoHaveLength(expect.any(Number))expect(result).not.toBeNull() without further value checksNever implement business logic by hardcoding return values that match test cases.
// FORBIDDEN — fake implementation that "fits" the tests
function calculateDiscount(amount: number, level: string): number {
if (amount === 1000 && level === 'gold') return 100;
if (amount === 500 && level === 'silver') return 25;
return 0;
}
// CORRECT — real logic
function calculateDiscount(amount: number, level: string): number {
const rates: Record<string, number> = { gold: 0.1, silver: 0.05, bronze: 0.02 };
const rate = rates[level] ?? 0;
return amount * rate;
}How to prevent this:
When fixing a bug, always write the failing test FIRST, then fix the code.
Correct order:
1. Discover bug
2. Write a test that reproduces the bug
3. Run the test — confirm it FAILS (red)
4. Fix the code
5. Run the test — confirm it PASSES (green)Why this matters: If you fix the code first and then write a test, you can never be sure the test would have caught the bug. The test might pass for the wrong reason.
Never skip step 3. Seeing the test go from red to green is the proof that the test is valid.
When debugging, debug logs are removed ONLY after the human confirms the fix works.
FORBIDDEN workflow:
1. Human asks to add debug logs
2. AI adds logs
3. Human runs code, shares log output
4. AI "finds the problem", applies fix AND removes debug logs in the same edit
5. Fix doesn't work — logs are gone, must re-add them
CORRECT workflow:
1. Human asks to add debug logs
2. AI adds logs
3. Human runs code, shares log output
4. AI applies fix ONLY — debug logs stay untouched
5. Human verifies the fix
6. Human decides when to remove debug logs (or asks AI to remove them)Rule: Never touch debug/diagnostic logs in the same commit as a fix. They are separate concerns.
Before finalizing any code change, run through this checklist:
| Check | Question |
|---|---|
| Fallbacks | Did I use ?? or || to hide a value that should never be missing? |
| Error handling | Did I add try/catch in business logic that should just let errors propagate? |
| Test strength | Would my tests still pass if I deleted the implementation? |
| Test honesty | Did I hardcode values to match test cases instead of implementing real logic? |
| TDD order | For bug fixes: did I see the test fail before applying the fix? |
| Debug logs | Am I removing diagnostic logs in the same change as the fix? |
If any answer is "yes", revise before proceeding.
© luoling8192, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in ai-coding-discipline of luoling8192/ai-coding-principles.
Open the folder on GitHubat commit 27db986
AI Coding Discipline next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| AI Coding Discipline this skillluoling8192/ai-coding-principles | 173 | — | ~1.9k | Automated safety check: Pass | MIT | |
| Code Review Graph Navigatorhandsontable/handsontable | 22k | — | ~939 | Automated safety check: Pass | Custom licence | |
| Andrej Karpathy Skillduolahypercho/andrej-karpathy-skills | 248 | — | ~793 | Automated safety check: Pass | MIT | |
| Verdaccio Change Implementationverdaccio/verdaccio | 18k | — | ~1.3k | Automated safety check: Pass | MIT | |
| RoamCranot/roam-code | 517 | — | ~2.4k | Automated safety check: Pass | Apache-2.0 | |
| Odoo Workflowunclecatvn/agent-skills | 143 | — | ~4.7k | Automated safety check: Pass | MIT |
handsontable/handsontable
Queries a pre-built, Tree-sitter-based code graph of the whole monorepo instead of grepping call chains, for exploring, debugging, refactoring or reviewing code.
duolahypercho/andrej-karpathy-skills
Apply Andrej Karpathy-inspired coding-agent guidelines in Codex.
verdaccio/verdaccio
A workflow for implementing a Verdaccio bug fix, feature or refactor: pick the release lines, check existing options, edit the owning layer, test and add a changeset.
Cranot/roam-code
Codebase comprehension via roam-code CLI. An agent skill from Cranot/roam-code.
unclecatvn/agent-skills
Mandatory pre-code gate and definition-of-done for ANY Odoo change (add field, override method, inherit view/xpath, OWL/JS patch, wizard, cron, controller, report, security, migration, bug fix…
S1LV4/th0th
Use the th0th Synapse cognitive modulation layer to get focused, low-noise retrieval during multi-step coding tasks.
luoling8192/ai-coding-principles
Designing Data-Intensive Applications (DDIA) distilled reference guide by Martin Kleppmann.
Categories
Mandatory coding discipline rules that prevent common AI coding anti-patterns. AI Coding Discipline is an agent skill from luoling8192/ai-coding-principles. Mandatory coding discipline rules that prevent common AI coding anti-patterns.
AI Coding Discipline fits situations like: implementing features; creating functions; adding error handling.
Run `npx skills add luoling8192/ai-coding-principles --skill ai-coding-discipline -a claude-code`. Or copy the skill folder (ai-coding-discipline in luoling8192/ai-coding-principles) into .claude/skills/ai-coding-discipline in your project. Claude Code loads it when a task matches its description.
Run `npx skills add luoling8192/ai-coding-principles --skill ai-coding-discipline -a codex`. Or copy the skill folder (ai-coding-discipline in luoling8192/ai-coding-principles) into .agents/skills/ai-coding-discipline in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add luoling8192/ai-coding-principles --skill ai-coding-discipline -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ai-coding-discipline, .gemini/skills/ai-coding-discipline, .github/skills/ai-coding-discipline and .opencode/skills/ai-coding-discipline in your project.
SKILL.md names no scripts, command-line tools or credentials: AI Coding Discipline is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
AI Coding Discipline is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.9k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with AI Coding Discipline: Code Review Graph Navigator (handsontable/handsontable, 22k stars), Andrej Karpathy Skill (duolahypercho/andrej-karpathy-skills, 248 stars), Verdaccio Change Implementation (verdaccio/verdaccio, 18k stars) and Roam (Cranot/roam-code, 517 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
luoling8192 (a GitHub user) maintains it in luoling8192/ai-coding-principles, which has 173 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on March 26, 2026.
Source: luoling8192/ai-coding-principles on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.