rule-editing-guide
9 principles for writing effective rules that maximize LLM execution accuracy. Use when creating or modifying skills, agent prompts, or command instructions.
What this skill does
# Rule Editing Guide
## Purpose
This guide provides principles for writing rules (skills, agent instructions, command definitions) that maximize LLM execution accuracy. Rules are instructions that guide AI agent behavior — poorly written rules lead to inconsistent or incorrect execution.
## The 9 Principles
### Principle 1: Context Efficiency
Write rules that provide maximum information with minimum tokens. Every sentence should carry meaning.
**DO**: "Functions MUST have ≤3 parameters. Extract to options object if more needed."
**DON'T**: "When writing functions, it's generally a good practice to try to keep the number of parameters relatively low, ideally around three or fewer, because having too many parameters can make the function harder to understand and use."
### Principle 2: Unified Notation
Use consistent formatting throughout all rules. Same concepts should use same notation.
**Convention table:**
| Element | Notation |
|---|---|
| Required action | **MUST** / **REQUIRED** |
| Prohibited action | **MUST NOT** / **PROHIBITED** |
| Recommended action | **SHOULD** / **RECOMMENDED** |
| Optional action | **MAY** / **OPTIONAL** |
| File paths | `backtick code` |
| Code elements | `backtick code` |
| Key concepts | **bold** |
### Principle 3: Eliminate Duplication
Each rule should exist in exactly one location. Cross-reference instead of copying.
**DO**: "Error handling follows the patterns defined in `coding-principles` skill, Error Handling section."
**DON'T**: [Copy-paste the entire error handling section from coding-principles]
### Principle 4: Aggregate Responsibilities
Group related rules together. One skill should cover one coherent domain.
**DO**: All testing rules in `testing-principles`, all coding rules in `coding-principles`
**DON'T**: Testing rules scattered across 5 different skills
### Principle 5: Measurable Criteria
Rules must be objectively verifiable. Avoid subjective language.
**DO**: "Test coverage MUST be ≥80%. Functions MUST have ≤20 lines."
**DON'T**: "Code should have good test coverage. Functions should be reasonably short."
### Principle 6: NG Patterns as Recommendations
Show both wrong and right patterns. NG patterns are more memorable than abstract rules.
**DO**:
```
❌ NG: catch (error) { return null; } // Error suppression
✅ OK: catch (error) { logger.error(error); throw new AppError(error); }
```
**DON'T**: "Don't suppress errors in catch blocks."
### Principle 7: Verbalize Implicit Assumptions
Make every assumption explicit. What seems obvious to you may not be obvious to an LLM.
**DO**: "This skill applies to backend services only. Frontend components follow `typescript-rules` instead."
**DON'T**: [Assume the LLM knows which skill applies to which context]
### Principle 8: Arrange by Importance
Put the most critical rules first. LLMs pay more attention to content at the beginning.
**Structure**:
1. Critical constraints (MUST/MUST NOT)
2. Standard practices (SHOULD)
3. Preferences (MAY)
4. Examples and edge cases
### Principle 9: Clarify Scope Boundaries
Every skill must state what it covers and what it does NOT cover.
**DO**:
```
## Scope
- **Covers**: Language-agnostic coding principles
- **Does NOT cover**: TypeScript-specific rules (see `typescript-rules`), testing (see `testing-principles`)
```
## Applying the Principles
When creating or editing a skill:
1. Draft the content
2. Review against all 9 principles
3. Count tokens — can you say the same in fewer words? (Principle 1)
4. Check for duplicated content across skills (Principle 3)
5. Verify all criteria are measurable (Principle 5)
6. Add scope boundaries (Principle 9)
## Quality Checklist
- [ ] Every rule uses consistent MUST/SHOULD/MAY notation
- [ ] No copy-pasted content from other skills
- [ ] All criteria are objectively measurable
- [ ] NG patterns shown alongside correct patterns
- [ ] Scope boundaries clearly stated
- [ ] Most important rules appear first
- [ ] No implicit assumptions left unverbalized
- [ ] Content is token-efficient (no fluff)
- [ ] Related rules are grouped together
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.