Docs Writing Style
inkline/inkline
How Inkline documentation is written and kept true — the doc surface, pointers-not-duplicates, the drift watch with its current inventory, voice rules, and the future docs website.
How to write .claude/rules/ files: golden format, enforceability, budget, scope.
$ npx skills add xiaolai/nlpm --skill writing-rules -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install xiaolai/nlpm writing-rules --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/xiaolai/nlpm.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/nlpm/writing-rules .claude/skills/writing-rules && 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 "writing-rules" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/writing-rules into .claude/skills/writing-rules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-rules", 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/xiaolai/nlpm/tree/main/skills/nlpm/writing-rulesType 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 xiaolai/nlpm --skill writing-rules -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install xiaolai/nlpm writing-rules --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/nlpm/writing-rules .agents/skills/writing-rules && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "writing-rules" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/writing-rules into .agents/skills/writing-rules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-rules", 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 xiaolai/nlpm --skill writing-rules -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install xiaolai/nlpm writing-rules --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/nlpm/writing-rules .cursor/skills/writing-rules && 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 "writing-rules" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/writing-rules into .cursor/skills/writing-rules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-rules", 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/xiaolai/nlpm.git --path skills/nlpm/writing-rules--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 xiaolai/nlpm --skill writing-rules -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install xiaolai/nlpm writing-rules --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/nlpm/writing-rules .gemini/skills/writing-rules && 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 "writing-rules" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/writing-rules into .gemini/skills/writing-rules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-rules", 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 xiaolai/nlpm writing-rulesInstalls 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 xiaolai/nlpm --skill writing-rules -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/nlpm/writing-rules .github/skills/writing-rules && 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 "writing-rules" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/writing-rules into .github/skills/writing-rules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-rules", 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 xiaolai/nlpm --skill writing-rules -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install xiaolai/nlpm writing-rules --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/nlpm/writing-rules .opencode/skills/writing-rules && 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 "writing-rules" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/writing-rules into .opencode/skills/writing-rules/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "writing-rules", 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.
writing-rulesHow to write .claude/rules/ files: golden format, enforceability, budget, scope.
Writing Rules is an agent skill from xiaolai/nlpm. How to write .claude/rules/ files: golden format, enforceability, budget, scope.
Its SKILL.md is about 2.5k 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 Agent Workflows, covering Brand voice and tone and Agent instruction files. The repository describes itself as: Natural-Language Programming Manager — scan, lint, and score NL artifacts with Claude-native quality scoring. The licence is ISC.
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 6fdbd05. 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.
Shell commands in SKILL.md call:
eslintpnpmFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.
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.
Writing Rules loads about 2.5k tokens when it runs. Until then it costs about 24 tokens; SKILL.md has 913 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 xiaolai/nlpm at commit 6fdbd05, republished under its ISC licence (© xiaolai). 913 words, ~2,506 tokens.
.claude/skills/writing-rules/SKILL.md (or your agent's skills folder).Scope: covers
.claude/rules/file authoring — a Claude-Code-specific concept (path-scoped, always-loaded instruction files withpaths:glob frontmatter). Codex CLI and Antigravity have no exact.claude/rules/equivalent; their always-on project instructions live in the hierarchical memory file (AGENTS.mdfor Codex,GEMINI.mdfor Antigravity — both can be pointed at the canonicalAGENTS.md; see [[nlpm:conventions-codex]] / [[nlpm:conventions-antigravity]]). The bold-imperative-plus-rationale writing technique here applies to any tool's instruction files. For CLAUDE.md / AGENTS.md conventions, see [[writing-plugins]]. For system prompts generally, see [[writing-prompts]].
Every rule should have three parts:
**Use X, not Y.** Without X, [concrete bad thing happens]. Y causes [specific problem] because [mechanism].| Part | Purpose | Example |
|---|---|---|
| Imperative | What to do | Use Result<T, AppError> for all API handler returns. |
| Consequence | What goes wrong without it | Without it, errors propagate as 500s with no context. |
| Mechanism | Why it fails | Raw panics bypass the error middleware and crash the worker. |
**Use `const`/`let`, never `var`.** `var` hoists to function scope, causing stale-reference bugs.**Use database transactions for multi-table writes.** Without transactions, partial writes leave the database in an inconsistent state. The ORM's `save()` method does not auto-wrap related writes -- you must explicitly call `db.transaction()`.Claude fixates on prohibited things. Saying "Don't use X" makes Claude think about X.
- Don't use var
- Don't mutate function parameters
- Don't use console.log in production code- **Use `const` for all bindings; use `let` only when reassignment is required.**
- **Return new objects instead of mutating function parameters.**
- **Use the `logger` service for all logging.** `console.log` is stripped in production builds.| Negative (avoid) | Positive (use instead) |
|---|---|
| Don't use X | Use Y (where Y is the correct alternative) |
| Never do X | Always do Y |
| Avoid X because... | Use Y because... (flip the rationale) |
| X is deprecated | Use Y, which replaced X in version N |
Before writing a rule, ask: "Can I check compliance in a 30-second code review?" If no, it is not a rule.
| Rule | Test |
|---|---|
Use Result<T, AppError> for all API handler returns. | Grep for handler functions, check return types |
All API endpoints require @auth decorator. | Grep for route definitions, check for decorator |
| Database queries use parameterized statements, not string concatenation. | Grep for SQL strings, check for + or template literals |
| Rule | Why it fails |
|---|---|
| "Write clean, maintainable code" | What is "clean"? No objective test. |
| "Keep functions small" | How small? 10 lines? 20? 50? |
| "Use meaningful variable names" | "Meaningful" is subjective. |
| "Follow best practices" | Which practices? Says nothing specific. |
| Vague | Enforceable version |
|---|---|
| "Keep functions small" | Functions must be under 40 lines. Reference: enforced by eslint max-lines-per-function |
| "Use meaningful names" | Variable names must be >= 3 characters except loop indices (i, j, k). |
| "Handle errors properly" | Every catch block must either re-throw, log + return error response, or call reportError(). |
All rules across .claude/rules/ must total under 500 lines. Every line costs tokens on every Claude interaction -- rules are always loaded.
| Rule lines | Approx tokens per interaction | Annual cost at 100 interactions/day |
|---|---|---|
| 100 | ~400 | Negligible |
| 300 | ~1,200 | Noticeable |
| 500 | ~2,000 | Budget line |
| 800+ | ~3,200+ | Over budget -- consolidate |
| Strategy | Example | Lines saved |
|---|---|---|
| Defer to linter | "Reference: enforced by pnpm lint" instead of re-stating lint rules | 10-30 |
| Merge related rules | Combine 3 files about error handling into 1 | 15-25 |
| Delete training knowledge | Remove rules Claude follows without being told | 5-15 |
| Use tables instead of lists | 10 rules as list = 20 lines; as table = 12 lines | 5-10 |
These are part of Claude's training and do not need rules:
Only write rules for things specific to your project that Claude would not know.
Rules without path scoping apply to every file -- expensive and often wrong.
---
paths: ["src/api/**/*.ts"]
---| Rule type | Scope | Example paths |
|---|---|---|
| API conventions | API routes only | src/api/**/*.ts, src/routes/**/*.ts |
| Database rules | Data layer only | src/db/**/*.ts, src/models/**/*.ts |
| Test conventions | Test files only | **/*.test.ts, **/*.spec.ts |
| Universal rules | No scope (apply everywhere) | (omit paths field) |
Rule: if a rule mentions a specific directory, technology, or layer -- scope it.
| Scenario | Token cost |
|---|---|
| Unscoped: 200-line rules file loaded on every interaction | 800 tokens always |
| Scoped: same rules split into 4 files with path scoping | 200 tokens per interaction (only relevant rules load) |
Two rules must never contradict. If they could, put them in the same file with explicit conditions.
rules/api.md:
**Return raw JSON objects from API handlers.**rules/error-handling.md:
**Wrap all returns in Result<T, AppError>.**rules/api-returns.md:
**Return `Result<T, AppError>` from API handler functions.** This ensures consistent error formatting through the error middleware.
**Return raw JSON from internal service functions.** Services are called by handlers, not directly by clients, so they do not need the Result wrapper.Before adding a new rule, check:
.claude/rules/
naming.md (80 lines -- mostly restates ESLint rules)
errors.md (90 lines -- contradicts exceptions.md)
exceptions.md (70 lines -- contradicts errors.md)
logging.md (60 lines -- unscoped, only relevant to src/api/)
testing.md (85 lines -- includes Jest tutorial content)
database.md (95 lines -- unscoped, only relevant to src/db/)
api.md (70 lines -- overlaps with errors.md)
security.md (55 lines -- restates OWASP basics Claude already knows)
performance.md (45 lines -- vague advice like "write fast code")
imports.md (30 lines -- restates ESLint import rules)
comments.md (25 lines -- Claude already adds good comments)
types.md (95 lines -- half is TypeScript tutorial)
Total: 800 lines, 12 files.claude/rules/
api.md (55 lines, scoped to src/api/**)
database.md (45 lines, scoped to src/db/**)
testing.md (40 lines, scoped to **/*.test.ts)
universal.md (40 lines, unscoped -- truly universal rules)
Total: 180 lines, 4 filesWhat was removed:
naming.md: deleted (ESLint handles this, Claude defaults are fine)errors.md + exceptions.md: merged into api.md with explicit conditionslogging.md: merged into api.md, scoped to src/api/**security.md: deleted (Claude already knows OWASP basics)performance.md: deleted (vague, unenforceable)imports.md: deleted (ESLint handles this)comments.md: deleted (Claude already writes good comments)types.md: reduced to 10 lines of project-specific type rules in universal.mdSavings: 800 -> 180 lines = 78% reduction. Token cost per interaction dropped from ~3,200 to ~720.
Before shipping rules, verify:
paths: frontmatter (e.g., paths: ["src/api/**/*.ts"]) when not universally applicable© xiaolai, ISC. 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 skills/nlpm/writing-rules of xiaolai/nlpm.
Open the folder on GitHubat commit 6fdbd05
Writing Rules 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 |
|---|---|---|---|---|---|---|
| Writing Rules this skillxiaolai/nlpm | 146 | — | ~2.5k | Automated safety check: Pass | ISC | |
| Docs Writing Styleinkline/inkline | 1.5k | — | ~1.2k | Automated safety check: Pass | None | |
| Johnny Suede WriteJasonColapietro/suede-creator-skills | 127 | — | ~7.8k | Automated safety check: Pass | MIT | |
| Audit Session Metricscentminmod/my-claude-code-setup | 2.7k | — | ~2.1k | Automated safety check: Pass | MIT | |
| Ponylang Prose Reviewponylang/ponylang-website | 160 | — | ~2.9k | Automated safety check: Pass | BSD-2-Clause | |
| Inherit Legacy Styleaffaan-m/ECC | 275k | 1 repos | ~2.1k | Automated safety check: Notes | MIT |
inkline/inkline
How Inkline documentation is written and kept true — the doc surface, pointers-not-duplicates, the drift watch with its current inventory, voice rules, and the future docs website.
JasonColapietro/suede-creator-skills
Suede Labs full writing stack: sharper copy for docs, pages, email, social, headlines, CTAs, product listings, and public explainers, with an SEO/AEO/AI EO pass, persona and framework selection…
centminmod/my-claude-code-setup
Audit a session-metrics JSON export for token-usage waste and produce a plain-English findings report.
ponylang/ponylang-website
Ensemble review of ponylang blog and Last Week in Pony prose.
affaan-m/ECC
Prevent AI style drift on legacy projects by scanning the codebase for implicit conventions, resolving conflicts with the operator one at a time, and writing an enforceable .ai-style-rules.md…
sickn33/agentic-awesome-skills
Humanize natural-language memory files (CLAUDE.md, todos, preferences, docs) by removing AI-isms and adding burstiness while preserving every code block, URL, path, command, and heading exactly.
xiaolai/nlpm
Universal NL conventions: SKILL.md open spec, AGENTS.md, vague quantifiers, naming.
xiaolai/nlpm
Antigravity and Gemini CLI artifact schemas: .gemini/ paths, extensions, hooks.
xiaolai/nlpm
Codex CLI artifact schemas: config.toml, .codex-plugin, skills, hooks, AGENTS.md.
xiaolai/nlpm
Multi-agent workflow patterns: parallel dispatch, pipelines, QC gates, retries.
xiaolai/nlpm
NL artifact anti-patterns: vague quantifiers, bare prohibitions, oversized skills.
xiaolai/nlpm
100-point NL artifact rubric: penalty tables per artifact type, calibration cases.
Categories
How to write .claude/rules/ files: golden format, enforceability, budget, scope. Writing Rules is an agent skill from xiaolai/nlpm.claude/rules/ files: golden format, enforceability, budget, scope.
Writing Rules fits situations like: tasks that involve Brand voice and tone; tasks that involve Agent instruction files.
Run `npx skills add xiaolai/nlpm --skill writing-rules -a claude-code`. Or copy the skill folder (skills/nlpm/writing-rules in xiaolai/nlpm) into .claude/skills/writing-rules in your project. Claude Code loads it when a task matches its description.
Run `npx skills add xiaolai/nlpm --skill writing-rules -a codex`. Or copy the skill folder (skills/nlpm/writing-rules in xiaolai/nlpm) into .agents/skills/writing-rules 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 xiaolai/nlpm --skill writing-rules -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/writing-rules, .gemini/skills/writing-rules, .github/skills/writing-rules and .opencode/skills/writing-rules in your project.
Going by SKILL.md and its folder, Writing Rules needs the command-line tools its instructions call (eslint and pnpm).
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.
Writing Rules is published under the ISC licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.5k tokens (SKILL.md is roughly 10k 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 Writing Rules: Docs Writing Style (inkline/inkline, 1.5k stars), Johnny Suede Write (JasonColapietro/suede-creator-skills, 127 stars), Audit Session Metrics (centminmod/my-claude-code-setup, 2.7k stars) and Ponylang Prose Review (ponylang/ponylang-website, 160 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
xiaolai (a GitHub user) maintains it in xiaolai/nlpm, which has 146 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 8, 2026.
Source: xiaolai/nlpm on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.