Skip to content

Commit 8bf920a

Browse files
committed
add info on using Claude Code to maintain docs
1 parent 56b861d commit 8bf920a

File tree

1 file changed

+119
-9
lines changed

1 file changed

+119
-9
lines changed

guides/claude-code.mdx

Lines changed: 119 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,131 @@
11
---
22
title: "Claude Code"
3-
description: "Configure Claude Code to help write, review, and update docs"
3+
description: "Configure Claude Code to help write, review, and update your docs"
44
icon: "asterisk"
55
---
66

7-
Claude Code is an agentic command line tool that lets you delegate documentation tasks from your terminal. You can create workflows to create, maintain, and review your docs.
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.
88

9-
Claude Code can be used immediately after installation, but becomes more powerful when you configure it to work with your docs.
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.
1010

11-
## Prerequisites
11+
## Getting started
1212

13-
- Claude Code API key
13+
**Prerequisites:**
14+
- Active Claude subscription (Pro, Max, or API access)
15+
- Node.js v19+ installed
1416

15-
## Set up
17+
**Setup:**
18+
1. Install Claude Code:
19+
```bash
20+
npm install -g @anthropic-ai/claude-code
21+
```
22+
2. Navigate to your docs directory.
23+
3. (Optional) Add the `CLAUDE.md` file below to your project.
24+
4. Run `claude` to start.
1625

17-
## Use cases
26+
## CLAUDE.md template
1827

19-
Claude Code is a tool that allows you to use Claude to write code.
28+
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.
2029

21-
## Examples
30+
Copy this example template or make changes for your docs specifications:
31+
32+
```mdx
33+
# Mintlify documentation
34+
35+
## Working relationship
36+
- You can push back on ideas-this can lead to better documentation. Cite sources and explain your reasoning when you do so
37+
- ALWAYS ask for clarification rather than making assumptions
38+
- NEVER lie, guess, or make up information
39+
40+
## Project context
41+
- Format: MDX files with YAML frontmatter
42+
- Config: docs.json for navigation, theme, settings
43+
- Components: Mintlify components
44+
45+
## Content strategy
46+
- Document just enough for user success - not too much, not too little
47+
- Prioritize accuracy and usability of information
48+
- Make content evergreen when possible
49+
- Search for existing information before adding new content. Avoid duplication unless it is done for a strategic reason
50+
- Check existing patterns for consistency
51+
- Start by making the smallest reasonable changes
52+
53+
## Frontmatter requirements for pages
54+
- title: Clear, descriptive page title
55+
- description: Concise summary for SEO/navigation
56+
57+
## Writing standards
58+
- Second-person voice ("you")
59+
- Prerequisites at start of procedural content
60+
- Test all code examples before publishing
61+
- Match style and formatting of existing pages
62+
- Include both basic and advanced use cases
63+
- Language tags on all code blocks
64+
- Alt text on all images
65+
- Relative paths for internal links
66+
67+
## Git workflow
68+
- NEVER use --no-verify when committing
69+
- Ask how to handle uncommitted changes before starting
70+
- Create a new branch when no clear branch exists for changes
71+
- Commit frequently throughout development
72+
- NEVER skip or disable pre-commit hooks
73+
74+
## Do not
75+
- Skip frontmatter on any MDX file
76+
- Use absolute URLs for internal links
77+
- Include untested code examples
78+
- Make assumptions - always ask for clarification
79+
```
80+
81+
## Sample prompts
82+
83+
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.
84+
85+
### Convert notes to polished docs
86+
Turn rough drafts into proper `MDX` with components and frontmatter.
87+
88+
**Example prompt:**
89+
```text wrap
90+
Convert this text into a properly formatted MDX page: [paste your text here]
91+
```
92+
93+
### Review docs for consistency
94+
Get suggestions to improve style, formatting, and component usage.
95+
96+
**Example prompt:**
97+
```text wrap
98+
Review the files in docs/ and suggest improvements for consistency and clarity
99+
```
100+
101+
### Update docs when features change
102+
Keep documentation current when your product evolves.
103+
104+
**Example prompt:**
105+
```text wrap
106+
Our API now requires a version parameter. Update our docs to include version=2024-01 in all examples
107+
```
108+
109+
### Generate comprehensive code examples
110+
Create multi-language examples with error handling.
111+
112+
**Example prompt:**
113+
```text wrap
114+
Create code examples for [your API endpoint] in JavaScript, Python, and cURL with error handling
115+
```
116+
117+
## Extending Claude Code
118+
119+
Beyond manually prompting Claude Code, you can integrate it with your existing workflows.
120+
121+
### Automation with GitHub Actions
122+
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.
123+
124+
### Multi-instance workflows
125+
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.
126+
127+
### Team collaboration
128+
Share your refined `CLAUDE.md` file with your team to ensure documentation standards across all contributors. Teams often develop project-specific prompts and workflows that become part of their documentation process.
129+
130+
### Custom commands
131+
Create reusable slash commands in `.claude/commands/` for frequently used documentation tasks specific to your project or team.

0 commit comments

Comments
 (0)