claude-code.mdx 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. ---
  2. title: "Claude Code setup"
  3. description: "Configure Claude Code for your documentation workflow"
  4. icon: "asterisk"
  5. ---
  6. Claude Code is Anthropic's official CLI tool. This guide will help you set up Claude Code to help you write and maintain your documentation.
  7. ## Prerequisites
  8. - Active Claude subscription (Pro, Max, or API access)
  9. ## Setup
  10. 1. Install Claude Code globally:
  11. ```bash
  12. npm install -g @anthropic-ai/claude-code
  13. ```
  14. 2. Navigate to your docs directory.
  15. 3. (Optional) Add the `CLAUDE.md` file below to your project.
  16. 4. Run `claude` to start.
  17. ## Create `CLAUDE.md`
  18. Create a `CLAUDE.md` file at the root of your documentation repository to train Claude Code on your specific documentation standards:
  19. ````markdown
  20. # Mintlify documentation
  21. ## Working relationship
  22. - You can push back on ideas-this can lead to better documentation. Cite sources and explain your reasoning when you do so
  23. - ALWAYS ask for clarification rather than making assumptions
  24. - NEVER lie, guess, or make up information
  25. ## Project context
  26. - Format: MDX files with YAML frontmatter
  27. - Config: docs.json for navigation, theme, settings
  28. - Components: Mintlify components
  29. ## Content strategy
  30. - Document just enough for user success - not too much, not too little
  31. - Prioritize accuracy and usability of information
  32. - Make content evergreen when possible
  33. - Search for existing information before adding new content. Avoid duplication unless it is done for a strategic reason
  34. - Check existing patterns for consistency
  35. - Start by making the smallest reasonable changes
  36. ## Frontmatter requirements for pages
  37. - title: Clear, descriptive page title
  38. - description: Concise summary for SEO/navigation
  39. ## Writing standards
  40. - Second-person voice ("you")
  41. - Prerequisites at start of procedural content
  42. - Test all code examples before publishing
  43. - Match style and formatting of existing pages
  44. - Include both basic and advanced use cases
  45. - Language tags on all code blocks
  46. - Alt text on all images
  47. - Relative paths for internal links
  48. ## Git workflow
  49. - NEVER use --no-verify when committing
  50. - Ask how to handle uncommitted changes before starting
  51. - Create a new branch when no clear branch exists for changes
  52. - Commit frequently throughout development
  53. - NEVER skip or disable pre-commit hooks
  54. ## Do not
  55. - Skip frontmatter on any MDX file
  56. - Use absolute URLs for internal links
  57. - Include untested code examples
  58. - Make assumptions - always ask for clarification
  59. ````