Contributing Guidelines - robwhite4/claude-memory GitHub Wiki

Contributing Guidelines

Thank you for your interest in contributing to Claude Memory! This guide will help you get started.

Code of Conduct

By participating in this project, you agree to abide by our Code of Conduct. Please treat everyone with respect and create a welcoming environment for all contributors.

Ways to Contribute

🐛 Reporting Bugs

Found a bug? Help us fix it!

  1. Check existing issues first to avoid duplicates
  2. Use the bug report template when creating an issue
  3. Include details:
    • Claude Memory version (cmem --version)
    • Node.js version (node --version)
    • Operating system
    • Steps to reproduce
    • Expected vs actual behavior
    • Error messages/stack traces

💡 Suggesting Features

Have an idea for improvement?

  1. Check the roadmap in Roadmap and existing issues
  2. Use the feature request template
  3. Explain the use case - why is this needed?
  4. Provide examples of how it would work
  5. Consider implementation complexity

📝 Improving Documentation

Documentation improvements are always welcome!

  • Fix typos or clarify confusing sections
  • Add examples or use cases
  • Improve installation instructions
  • Create tutorials or guides
  • Update wiki pages

🔧 Contributing Code

Ready to code? Here's how:

Development Setup

1. Fork and Clone

# Fork on GitHub, then:
git clone https://github.com/YOUR-USERNAME/claude-memory.git
cd claude-memory
npm install

2. Create Branch

# For features
git checkout -b feature/your-feature-name

# For fixes
git checkout -b fix/issue-123-description

3. Development Workflow

# Make changes
edit files...

# Run tests frequently
npm test

# Check code style
npm run lint

# Test your changes locally
npm link
cmem --version  # Test your local version

4. Commit Guidelines

Write clear commit messages:

# Good examples:
git commit -m "feat: add --verbose flag to task list command"
git commit -m "fix: handle empty task descriptions properly"
git commit -m "docs: clarify multi-machine setup instructions"
git commit -m "test: add coverage for pattern resolution"

# Format: <type>: <description>
# Types: feat, fix, docs, test, refactor, perf, style, chore

5. Test Requirements

Before submitting:

  • All tests pass: npm test
  • No lint errors: npm run lint
  • Coverage maintained: npm run test:coverage
  • New features have tests
  • Edge cases considered

6. Pull Request Process

  1. Update your fork

    git remote add upstream https://github.com/robwhite4/claude-memory.git
    git fetch upstream
    git rebase upstream/main
  2. Push your branch

    git push origin feature/your-feature-name
  3. Create PR

    • Use the PR template
    • Link related issues
    • Describe changes clearly
    • Include screenshots if UI changes
  4. Review Process

    • CI must pass
    • Code review required
    • Address feedback
    • Maintainer will merge

Coding Standards

Style Guide

// Use 2 spaces indentation
function example() {
  const result = await someOperation();
  return result;
}

// Async/await over promises
// Good
async function getData() {
  const data = await fetchData();
  return process(data);
}

// Avoid
function getData() {
  return fetchData().then(data => process(data));
}

// Clear variable names
const taskList = [];  // Good
const tl = [];       // Avoid

Code Organization

  • Keep functions small and focused
  • One responsibility per function
  • Descriptive function/variable names
  • Add JSDoc comments for public APIs
  • Group related functionality

Error Handling

// Always handle errors appropriately
try {
  await riskyOperation();
} catch (error) {
  if (error.code === 'ENOENT') {
    throw new MemoryError('File not found', 'FILE_NOT_FOUND');
  }
  throw error;
}

Project Memory Guidelines

This project uses Claude Memory itself for development context.

For Contributors

  • Don't modify .claude/ or CLAUDE.md in PRs
  • Document decisions in PR descriptions
  • Report patterns via issues, not memory commands

For Maintainers

After merging PRs:

# Record important decisions
cmem decision "Implemented feature X" "Reasoning from PR #123" "alternatives"

# Add discovered patterns
cmem pattern "Common issue pattern" "How to handle it" 0.9 high

# Update knowledge base
cmem knowledge add "new_feature_design" "Design details" --category architecture

Memory Conflicts

If you encounter conflicts in .claude/context/:

# Accept incoming changes
git checkout --theirs .claude/context/

# Re-add your updates
cmem knowledge add "your_update" "value"

Testing Guidelines

Write Tests For

  • New features
  • Bug fixes
  • Edge cases
  • Error conditions

Test Structure

describe('Feature Name', () => {
  test('should perform expected behavior', () => {
    // Arrange
    const input = 'test';
    
    // Act
    const result = functionUnderTest(input);
    
    // Assert
    expect(result).toBe('expected');
  });
});

See Testing-Guidelines for detailed testing information.

Documentation

When to Update Docs

  • New features added
  • Behavior changes
  • Bug fixes that affect usage
  • New examples needed

What to Update

  • README.md for major changes
  • Wiki pages for detailed guides
  • JSDoc comments for API changes
  • CHANGELOG.md for all changes

Review Checklist

Before submitting PR:

  • Tests pass
  • Lint passes
  • Coverage maintained
  • Documentation updated
  • Commit messages clear
  • PR template completed
  • Issues linked

Getting Help

  • 💬 Open an issue for questions
  • 📚 Check existing documentation
  • 🔍 Search closed issues
  • 👥 Ask in discussions

Recognition

Contributors are recognized in:

  • Release notes
  • Contributors list
  • Individual commit credits

Thank you for contributing to Claude Memory! 🎉


See also:

⚠️ **GitHub.com Fallback** ⚠️