Skip to content

Latest commit

 

History

History
96 lines (72 loc) · 2.34 KB

File metadata and controls

96 lines (72 loc) · 2.34 KB

Contributing to claude-code-doctor

Thank you for helping make Claude Code setups healthier! 🩺

Adding a New Check

The easiest way to contribute is to add a new diagnostic check.

1. Create the Check Module

Create a new file in src/checks/:

import { DiagnosticResult, CheckModule } from '../types';

async function checkSomething(projectPath: string): Promise<DiagnosticResult> {
  // Your check logic here
  return {
    id: 'category-check-name',       // Unique ID
    label: 'Human-readable label',    // Shown in output
    status: 'pass',                   // pass | fail | warn | skip
    severity: 'success',             // success | error | warning | info
    message: 'Description of result',
    suggestions: ['How to fix if not pass'],
    autoFixable: false,              // Set true if fix() is provided
    fix: async () => {               // Optional auto-fix function
      // Repair logic
      return true;
    },
  };
}

const myCheck: CheckModule = {
  category: {
    id: 'my-category',
    name: 'My Category',
    icon: '🔍',
    description: 'What this category checks',
  },
  async run(projectPath) {
    return [await checkSomething(projectPath)];
  },
};

export default myCheck;

2. Register the Check

Add your check to src/checks/index.ts:

export { default as myCheck } from './my-check';

And add it to the ALL_CHECKS array in src/doctor.ts.

3. Test It

npm run build
node bin/cli.js --only my-category

Development Setup

git clone https://github.com/Mishit18/claude-code-doctor.git
cd claude-code-doctor
npm install
npm run build
node bin/cli.js

Code Style

  • TypeScript strict mode
  • No any types (use unknown instead)
  • Functions should be focused and well-documented
  • Every check must have a unique id
  • Every non-pass result should have suggestions

Pull Request Guidelines

  1. One check per PR (unless they're closely related)
  2. Include a description of what the check detects and why it matters
  3. Test on all platforms if possible (Windows, macOS, Linux)
  4. Update the README if adding a new category

Reporting Issues

Found a false positive or missing check? Open an issue with:

  • Your OS and Node.js version
  • Claude Code version
  • The output of claude-doctor --format json