Skip to content

Commit 614e25f

Browse files
authored
Add Claude Code guide (#890)
* add Claude Code page * add CLAUDE.md file * revise CLAUDE.md * different CLAUDE.md approach * add info on using Claude Code to maintain docs * remove node prereq since redundant with Mintlify * 💅
1 parent 55f5ed2 commit 614e25f

File tree

3 files changed

+177
-0
lines changed

3 files changed

+177
-0
lines changed

.claude/CLAUDE.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Mintlify documentation
2+
3+
## Working relationship
4+
- You can push back on ideas-this can lead to better documentation. Cite sources and explain your reasoning when you do so
5+
- ALWAYS ask for clarification rather than making assumptions
6+
- NEVER lie, guess, or make up information
7+
8+
## Project context
9+
- Format: MDX files with YAML frontmatter
10+
- Config: docs.json for navigation, theme, settings
11+
- Components: Mintlify components
12+
13+
## Content strategy
14+
- Document just enough for user success - not too much, not too little
15+
- Prioritize accuracy and usability of information
16+
- Make content evergreen when possible
17+
- Search for existing information before adding new content. Avoid duplication unless it is done for a strategic reason
18+
- Check existing patterns for consistency
19+
- Start by making the smallest reasonable changes
20+
21+
## Frontmatter requirements for pages
22+
- title: Clear, descriptive page title
23+
- description: Concise summary for SEO/navigation
24+
25+
## Writing standards
26+
- Second-person voice ("you")
27+
- Prerequisites at start of procedural content
28+
- Test all code examples before publishing
29+
- Match style and formatting of existing pages
30+
- Include both basic and advanced use cases
31+
- Language tags on all code blocks
32+
- Alt text on all images
33+
- Relative paths for internal links
34+
35+
## Git workflow
36+
- NEVER use --no-verify when committing
37+
- Ask how to handle uncommitted changes before starting
38+
- Create a new branch when no clear branch exists for changes
39+
- Commit frequently throughout development
40+
- NEVER skip or disable pre-commit hooks
41+
42+
## Do not
43+
- Skip frontmatter on any MDX file
44+
- Use absolute URLs for internal links
45+
- Include untested code examples
46+
- Make assumptions - always ask for clarification

docs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"guides/analytics",
111111
"guides/assistant",
112112
"mcp",
113+
"guides/claude-code",
113114
"guides/cursor",
114115
"translations",
115116
"react-components",

guides/claude-code.mdx

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
title: "Claude Code"
3+
description: "Configure Claude Code to help write, review, and update your docs"
4+
icon: "asterisk"
5+
---
6+
7+
Claude Code is an agentic command line tool that can help you maintain your documentation. It can write new content, review existing pages, and keep docs up to date.
8+
9+
You can train Claude Code to understand your documentation standards and workflows by adding a `CLAUDE.md` file to your project and refining it over time.
10+
11+
## Getting started
12+
13+
**Prerequisites:**
14+
- Active Claude subscription (Pro, Max, or API access)
15+
16+
**Setup:**
17+
1. Install Claude Code:
18+
```bash
19+
npm install -g @anthropic-ai/claude-code
20+
```
21+
2. Navigate to your docs directory.
22+
3. (Optional) Add the `CLAUDE.md` file below to your project.
23+
4. Run `claude` to start.
24+
25+
## CLAUDE.md template
26+
27+
Save a `CLAUDE.md` file at the root of your docs directory to help Claude Code understand your project. This file trains Claude Code on your documentation standards, preferences, and workflows. See [Manage Claude's memory](https://docs.anthropic.com/en/docs/claude-code/memory) in the Anthropic docs for more information.
28+
29+
Copy this example template or make changes for your docs specifications:
30+
31+
```mdx
32+
# Mintlify documentation
33+
34+
## Working relationship
35+
- You can push back on ideas-this can lead to better documentation. Cite sources and explain your reasoning when you do so
36+
- ALWAYS ask for clarification rather than making assumptions
37+
- NEVER lie, guess, or make up information
38+
39+
## Project context
40+
- Format: MDX files with YAML frontmatter
41+
- Config: docs.json for navigation, theme, settings
42+
- Components: Mintlify components
43+
44+
## Content strategy
45+
- Document just enough for user success - not too much, not too little
46+
- Prioritize accuracy and usability of information
47+
- Make content evergreen when possible
48+
- Search for existing information before adding new content. Avoid duplication unless it is done for a strategic reason
49+
- Check existing patterns for consistency
50+
- Start by making the smallest reasonable changes
51+
52+
## Frontmatter requirements for pages
53+
- title: Clear, descriptive page title
54+
- description: Concise summary for SEO/navigation
55+
56+
## Writing standards
57+
- Second-person voice ("you")
58+
- Prerequisites at start of procedural content
59+
- Test all code examples before publishing
60+
- Match style and formatting of existing pages
61+
- Include both basic and advanced use cases
62+
- Language tags on all code blocks
63+
- Alt text on all images
64+
- Relative paths for internal links
65+
66+
## Git workflow
67+
- NEVER use --no-verify when committing
68+
- Ask how to handle uncommitted changes before starting
69+
- Create a new branch when no clear branch exists for changes
70+
- Commit frequently throughout development
71+
- NEVER skip or disable pre-commit hooks
72+
73+
## Do not
74+
- Skip frontmatter on any MDX file
75+
- Use absolute URLs for internal links
76+
- Include untested code examples
77+
- Make assumptions - always ask for clarification
78+
```
79+
80+
## Sample prompts
81+
82+
Once you have Claude Code set up, try these prompts to see how it can help with common documentation tasks. You can copy and paste these examples directly, or adapt them for your specific needs.
83+
84+
### Convert notes to polished docs
85+
Turn rough drafts into proper Markdown pages with components and frontmatter.
86+
87+
**Example prompt:**
88+
```text wrap
89+
Convert this text into a properly formatted MDX page: [paste your text here]
90+
```
91+
92+
### Review docs for consistency
93+
Get suggestions to improve style, formatting, and component usage.
94+
95+
**Example prompt:**
96+
```text wrap
97+
Review the files in docs/ and suggest improvements for consistency and clarity
98+
```
99+
100+
### Update docs when features change
101+
Keep documentation current when your product evolves.
102+
103+
**Example prompt:**
104+
```text wrap
105+
Our API now requires a version parameter. Update our docs to include version=2024-01 in all examples
106+
```
107+
108+
### Generate comprehensive code examples
109+
Create multi-language examples with error handling.
110+
111+
**Example prompt:**
112+
```text wrap
113+
Create code examples for [your API endpoint] in JavaScript, Python, and cURL with error handling
114+
```
115+
116+
## Extending Claude Code
117+
118+
Beyond manually prompting Claude Code, you can integrate it with your existing workflows.
119+
120+
### Automation with GitHub Actions
121+
Run Claude Code automatically when code changes to keep docs up to date. You can trigger documentation reviews on pull requests or update examples when API changes are detected.
122+
123+
### Multi-instance workflows
124+
Use separate Claude Code sessions for different tasks - one for writing new content and another for reviewing and quality assurance. This helps maintain consistency and catch issues that a single session might miss.
125+
126+
### Team collaboration
127+
Share your refined `CLAUDE.md` file with your team to ensure consistent documentation standards across all contributors. Teams often develop project-specific prompts and workflows that become part of their documentation process.
128+
129+
### Custom commands
130+
Create reusable slash commands in `.claude/commands/` for frequently used documentation tasks specific to your project or team.

0 commit comments

Comments
 (0)