rules

A style guide containing 50 rules for writing instructions that AI coding tools consume. It covers artifacts such as skills, agents, commands, rules, hooks, prompts, plugins, and project memory files.

In plain words
What is it for?
Use it when writing, reviewing, or improving natural-language programming files, including instructions for Claude Code, Codex CLI, and other supported tools.
Why use it?
It gives authors concrete ways to replace ambiguous wording with instructions that can be checked and followed. The rules are also used by the scoring and automatic-fix workflows.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/xiaolai/nlpm/rules
Any agent
npx skills add xiaolai/nlpm --skill rules
Clone the repo
git clone --depth 1 https://github.com/xiaolai/nlpm

Made for: Claude Code, Codex.

Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 19,559 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00065 $0.19559
Opus 5 $0.00032 $0.09779
Sonnet 5 $0.00013 $0.03912
Haiku 4.5 $0.00006 $0.01956

Measured 2d ago against content hash cabe763f5bfb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rules 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 2d 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.

codex/skills/rules/SKILL.md · 419 lines

How it starts

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

The Rules of Natural Language Programming

These rules govern how to write NL artifacts that Claude Code and other LLMs consume. They are enforced by /nlpm:score (penalty-based) and referenced by /nlpm:fix (auto-repair). When writing any NL artifact, follow these rules.


Universal (all artifacts)

R01. No vague quantifiers without criteria. "appropriate", "relevant", "as needed", "sufficient", "adequate", "reasonable", "properly", "correctly", "some", "several", "various" are meaningless without specifics. Replace with measurable criteria. Penalty: -2 each, cap -20.

Bad: "Use appropriate error handling." Good: "Return Result<T, AppError> from all API handlers. Map errors to HTTP status codes via the From<AppError> for StatusCode impl."

Mention versus use: a vague term presented as a literal token that the clause explicitly instructs a reader or tool to detect, flag, or replace is data, not an instruction, and is not counted (see the exclusion note in nlpm:scoring). Backticks alone do not qualify.

Real-world example: AgriciDaniel-claude-ads, ChromeDevTools-chrome-devtools-mcp, Graphify-Labs-graphify, Xquik-dev-x-twitter-scraper, blader-humanizer, coreyhaines31-marketingskills, earthtojake-text-to-cad, google-labs-code-stitch-skills, greensock-gsap-skills, kazukinagata-shinkoku, krodak-clickup-cli, larksuite-cli, nexu-io-open-design, prompt-security-clawsec, realrossmanngroup-no_ai_slop_writing_rules, slavingia-skills, tintinweb-pi-subagents

Read the full file on GitHub · 419 lines

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. 2d ago First seen · 419 lines · 65 tokens per session scan A cabe763f5bfb

Subscribe to this mod's changes

rules is a skill published in the GitHub repository xiaolai/nlpm (133 stars, last pushed 2d ago), licensed ISC. It adds 65 tokens to every session and 19,559 once invoked, about $0.0003 per session on Opus 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.