rules
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."
R02. Every line must earn its tokens. Context window is finite. If a line doesn't change Claude's behavior, delete it.
R03. Positive framing over prohibitions. "Use X" not "Don't use Y." The Pink Elephant effect: Claude fixates on prohibited things and sometimes does them anyway.
More from xiaolai/nlpm-for-claude
patterns
Use when writing or reviewing NL artifacts and need to check for anti-patterns — vague quantifiers, prohibitions without alternatives, oversized skills, write-on-read-only agents, monolithic prompts, or linter-duplicating rules.
2conventions
Use when writing, reviewing, or validating Claude Code plugin artifacts — check frontmatter schemas, hook event names, naming conventions, prompt structure, or reference syntax. Loaded by the NLPM scorer and checker agents for schema validation.
2writing-prompts
How to write effective system prompts for any LLM. Universal prompt engineering -- role clarity, structured output, injection resistance, few-shot examples. Use when writing prompts, system instructions, or AI configuration.
2scoring
Use when scoring NL artifact quality, applying penalties, or calibrating lint judgment — contains the 100-point rubric with penalty tables per artifact type and 4 worked calibration examples.
1security
Detects execution surface risks, supply chain vulnerabilities, data exfiltration vectors, and prompt injection patterns in Claude Code plugins. Use when auditing plugins for security risks, reviewing MCP server configurations, scanning hooks and scripts for vulnerabilities, or checking extensions before installation.
1testing
Use when writing test specs for NL artifacts, running /nlpm:test, or setting up TDD workflows for skills, agents, commands, rules, hooks, and prompts.
1