Skip to content

Latest commit

 

History

History
68 lines (47 loc) · 2.43 KB

File metadata and controls

68 lines (47 loc) · 2.43 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

docs-coderef is a tool for validating and auto-fixing code references in markdown documentation. It ensures code snippets in documentation stay synchronized with actual source code through CODE_REF comments and AST-based symbol searching.

Quick Reference

Essential Information

Code Style (Quick Reference)

  • Indentation: 2 spaces
  • Semicolons: Enabled
  • Quotes: Single quotes
  • Print width: 100 characters
  • Line endings: LF (Unix)
  • Trailing commas: ES5 style
  • Type imports: Prefer import type for type-only imports

Common Commands

npm run build              # Build for production (CJS + ESM + types)
npm test                   # Run all tests
npm run lint:fix           # Auto-fix linting issues
npm run format             # Format code with Prettier
npm run type-check         # Run TypeScript compiler checks
npm run docs:validate      # Validate documentation updates
npm run demo:validate      # Test with demo environment

Demo Environment

The demo/ directory provides a local testing environment:

npm run demo:validate:valid    # Validate correct CODE_REF usage
npm run demo:validate:invalid  # See error detection examples
npm run demo:fix:dry           # Preview auto-fix changes
npm run demo:reset             # Reset demo to original state

See demo/README.md for detailed usage.

Commit Message Format

Follow Conventional Commits:

<type>: <description>

Types: feat, fix, docs, style, refactor, test, chore, ci, perf, build, revert

See docs/development/git-conventions.md for the complete type table and semantic versioning impact.

Full Documentation

For comprehensive documentation, see docs/README.md.