Conventions and formatting rules for contributing to Claude How To. Follow this guide to keep content consistent, professional, and easy to maintain.


File and Folder Naming

Lesson Folders

Lesson folders use a two-digit numbered prefix followed by a kebab-case descriptor:

01-slash-commands/
02-memory/
03-skills/
04-subagents/
05-mcp/

The number reflects the learning path order from beginner to advanced.

File Names

Type Convention Examples
Lesson README README.md 01-slash-commands/README.md
Feature file Kebab-case .md code-reviewer.md, generate-api-docs.md
Shell script Kebab-case .sh format-code.sh, validate-input.sh
Config file Standard names .mcp.json, settings.json
Memory file Scope-prefixed project-CLAUDE.md, personal-CLAUDE.md
Top-level docs UPPER_CASE .md CATALOG.md, QUICK_REFERENCE.md, CONTRIBUTING.md
Image assets Kebab-case pr-slash-command.png, claude-howto-logo.svg

Rules


Document Structure

Root README

The root README.md follows this order:

  1. Logo (<picture> element with dark/light variants)
  2. H1 title
  3. Introductory blockquote (one-line value proposition)
  4. "Why This Guide?" section with comparison table
  5. Horizontal rule (---)
  6. Table of Contents
  7. Feature Catalog
  8. Quick Navigation
  9. Learning Path
  10. Feature sections
  11. Getting Started
  12. Best Practices / Troubleshooting
  13. Contributing / License

Lesson README

Each lesson README.md follows this order:

  1. H1 title (e.g., # Slash Commands)
  2. Brief overview paragraph
  3. Quick reference table (optional)
  4. Architecture diagram (Mermaid)
  5. Detailed sections (H2)
  6. Practical examples (numbered, 4-6 examples)
  7. Best practices (Do's and Don'ts tables)
  8. Troubleshooting
  9. Related guides / Official documentation
  10. Document metadata footer

Feature/Example File

Individual feature files (e.g., optimize.md, pr.md):

  1. YAML frontmatter (if applicable)
  2. H1 title
  3. Purpose / description
  4. Usage instructions
  5. Code examples
  6. Customization tips

Section Separators

Use horizontal rules (---) to separate major document regions:

---

## New Major Section

Place them after the introductory blockquote and between logically distinct parts of the document.


Headings

Hierarchy

Level Use Example
# H1 Page title (one per document) # Slash Commands
## H2 Major sections ## Best Practices
### H3 Subsections ### Adding a Skill
#### H4 Sub-subsections (rare) #### Configuration Options

Rules


Text Formatting

Emphasis

Style When to Use Example
Bold (**text**) Key terms, labels in tables, important concepts **Installation**:
Italic (*text*) First use of a technical term, book/doc titles *frontmatter*
Code (`text`) File names, commands, config values, code references `CLAUDE.md`

Blockquotes for Callouts

Use blockquotes with bold prefixes for important notes:

> **Note**: Custom slash commands have been merged into skills since v2.0.

> **Important**: Never commit API keys or credentials.

> **Tip**: Combine memory with skills for maximum effectiveness.

Supported callout types: Note, Important, Tip, Warning.

Paragraphs


Lists

Unordered Lists

Use dashes (-) with 2-space indentation for nesting:

- First item
- Second item
  - Nested item
  - Another nested item
    - Deep nested (avoid going deeper than 3 levels)
- Third item

Ordered Lists

Use numbered lists for sequential steps, instructions, and ranked items:

1. First step
2. Second step
   - Sub-point detail
   - Another sub-point
3. Third step

Descriptive Lists

Use bold labels for key-value style lists:

- **Performance bottlenecks** - identify O(n^2) operations, inefficient loops
- **Memory leaks** - find unreleased resources, circular references
- **Algorithm improvements** - suggest better algorithms or data structures

Rules


Tables

Standard Format

| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Data     | Data     | Data     |

Common Table Patterns

Feature comparison (3-4 columns):

| Feature | Invocation | Persistence | Best For |
|---------|-----------|------------|----------|
| **Slash Commands** | Manual (`/cmd`) | Session only | Quick shortcuts |
| **Memory** | Auto-loaded | Cross-session | Long-term learning |

Do's and Don'ts:

| Do | Don't |
|----|-------|
| Use descriptive names | Use vague names |
| Keep files focused | Overload a single file |

Quick reference:

| Aspect | Details |
|--------|---------|
| **Purpose** | Generate API documentation |
| **Scope** | Project-level |
| **Complexity** | Intermediate |

Rules


Code Blocks

Language Tags

Always specify a language tag for syntax highlighting:

Language Tag Use For
Shell bash CLI commands, scripts
Python python Python code
JavaScript javascript JS code
TypeScript typescript TS code
JSON json Configuration files
YAML yaml Frontmatter, config
Markdown markdown Markdown examples
SQL sql Database queries
Plain text (no tag) Expected output, directory trees

Conventions

# Comment explaining what the command does
claude mcp add notion --transport http https://mcp.notion.com/mcp

Installation Blocks

Use this pattern for installation instructions:

# Copy files to your project
cp 01-slash-commands/*.md .claude/commands/

Multi-step Workflows

# Step 1: Create the directory
mkdir -p .claude/commands

# Step 2: Copy the templates
cp 01-slash-commands/*.md .claude/commands/

# Step 3: Verify installation
ls .claude/commands/

Use relative paths for all internal links:

[Slash Commands](01-slash-commands/)
[Skills Guide](03-skills/)
[Memory Architecture](02-memory/#memory-architecture)

From a lesson folder back to root or sibling:

[Back to main guide](../README.md)
[Related: Skills](../03-skills/)

Use full URLs with descriptive anchor text:

[Anthropic's official documentation](https://code.claude.com/docs/en/overview)

Section Anchors

Link to sections within the same document using GitHub-style anchors:

[Feature Catalog](#-feature-catalog)
[Best Practices](#best-practices)

End lessons with a related guides section:

## Related Guides

- [Slash Commands](../01-slash-commands/) - Quick shortcuts
- [Memory](../02-memory/) - Persistent context
- [Skills](../03-skills/) - Reusable capabilities

Diagrams

Mermaid

Use Mermaid for all diagrams. Supported types:

Style Conventions

Apply consistent colors using style blocks:

graph TB
    A["Component A"] --> B["Component B"]
    B --> C["Component C"]

    style A fill:#e1f5fe,stroke:#333,color:#333
    style B fill:#fce4ec,stroke:#333,color:#333
    style C fill:#e8f5e9,stroke:#333,color:#333

Color palette:

Color Hex Use For
Light blue #e1f5fe Primary components, inputs
Light pink #fce4ec Processing, middleware
Light green #e8f5e9 Outputs, results
Light yellow #fff9c4 Configuration, optional
Light purple #f3e5f5 User-facing, UI

Rules


Emoji Usage

Where Emojis Are Used

Emojis are used sparingly and purposefully — only in specific contexts:

Context Emojis Example
Root README section headers Category icons ## 📚 Learning Path
Skill level indicators Colored circles 🟢 Beginner, 🔵 Intermediate, 🔴 Advanced
Do's and Don'ts Check/cross marks ✅ Do this, ❌ Don't do this
Complexity ratings Stars ⭐⭐⭐

Standard Emoji Set

Emoji Meaning
📚 Learning, guides, documentation
Getting started, quick reference
🎯 Features, quick reference
🎓 Learning paths
📊 Statistics, comparisons
🚀 Installation, quick commands
🟢 Beginner level
🔵 Intermediate level
🔴 Advanced level
Recommended practice
Avoid / anti-pattern
Complexity rating unit

Rules


YAML Frontmatter

Feature Files (Skills, Commands, Agents)

---
name: unique-identifier
description: What this feature does and when to use it
allowed-tools: Bash, Read, Grep
---

Optional Fields

---
name: my-feature
description: Brief description
argument-hint: "[file-path] [options]"
allowed-tools: Bash, Read, Grep, Write, Edit
model: opus                        # opus, sonnet, or haiku
disable-model-invocation: true     # User-only invocation
user-invocable: false              # Hidden from user menu
context: fork                      # Run in isolated subagent
agent: Explore                     # Agent type for context: fork
---

Rules


Images and Media

Logo Pattern

All documents that start with a logo use the <picture> element for dark/light mode support:

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="resources/logos/claude-howto-logo-dark.svg">
  <img alt="Claude How To" src="resources/logos/claude-howto-logo.svg">
</picture>

Screenshots

Rules


Tone and Voice

Writing Style

Content Principles

Principle Example
Show, don't tell Provide working examples, not abstract descriptions
Progressive complexity Start simple, add depth in later sections
Explain the "why" "Use memory for... because..." not just "Use memory for..."
Copy-paste ready Every code block should work when pasted directly
Real-world context Use practical scenarios, not contrived examples

Vocabulary


Commit Messages

Follow Conventional Commits:

type(scope): description

Types

Type Use For
feat New feature, example, or guide
fix Bug fix, correction, broken link
docs Documentation improvements
refactor Restructuring without changing behavior
style Formatting changes only
test Test additions or changes
chore Build, dependencies, CI

Scopes

Use the lesson name or file area as scope:

feat(slash-commands): Add API documentation generator
docs(memory): Improve personal preferences example
fix(README): Correct table of contents link
docs(skills): Add comprehensive code review skill

Lesson READMEs end with a metadata block:

---
**Last Updated**: March 2026
**Claude Code Version**: 2.1.97
**Compatible Models**: Claude Sonnet 4.6, Claude Opus 4.7, Claude Haiku 4.5

Checklist for Authors

Before submitting content, verify:


Last Updated: May 2, 2026 Claude Code Version: 2.1.126 Sources: