Thank you for your interest in contributing to the Codebase CLI! This document provides guidelines for contributing to the project.
- Go 1.21 or later
- Task for running development tasks
- Git for version control
- Clone the repository:
git clone https://github.com/codebase-interface/cli.git
cd cli- Install dependencies:
task setup- Build the CLI:
task build📝 Note: The bin/ directory is git-ignored. Built binaries are not committed to the repository - each developer builds locally.
- Run tests:
task test- Follow Go best practices and idioms
- Use
gofmtfor formatting - Run linting with
task lint - Maintain test coverage above 80%
This project follows Conventional Commits specification:
feat:for new featuresfix:for bug fixesdocs:for documentation updatesrefactor:for code refactoringtest:for adding or updating testschore:for maintenance tasks
Examples:
feat: add support for custom validation rules
fix: resolve issue with git branch detection
docs: update README with installation instructionsUse the following patterns for branch names:
feature/descriptionfor new featuresfix/descriptionfor bug fixesdocs/descriptionfor documentation updateschore/descriptionfor maintenance tasks
All code must be thoroughly tested:
- Write tests first (TDD approach)
- Ensure all tests pass:
task test - Maintain high test coverage
- Use table-driven tests where appropriate
To add a new validation agent:
- Create the agent struct in
internal/agents/ - Implement the
Agentinterface - Add configuration options to
internal/config/ - Write comprehensive tests
- Update documentation
- Fork the repository
- Create a feature branch with a descriptive name
- Make your changes following the coding standards
- Write or update tests for your changes
- Ensure all tests pass and linting is clean
- Commit your changes using conventional commits
- Push your branch and create a pull request
- Provide a clear description of your changes
- Code must be reviewed by at least one maintainer
- All tests must pass
- Code coverage must be maintained
- Documentation must be updated if applicable
- Follow the existing code style and patterns
Use the following Task commands for development:
# Build the CLI
task build
# Run all tests
task test
# Run tests in watch mode
task test:watch
# Run linting
task lint
# Clean build artifacts
task clean
# Install CLI locally
task install
# Run the CLI on itself
task validate-self
# Serve documentation locally
task docs:serve
# Open documentation in browser
task docs:open
# Check documentation for issues
task docs:checkThe CLI follows a modular architecture:
cmd/ # CLI commands (Cobra)
├── root.go # Root command
├── validate.go # Validation command
└── version.go # Version command
internal/ # Internal packages
├── agents/ # Validation agents
├── config/ # Configuration handling
├── output/ # Output formatters
└── ui/ # User interface components
pkg/ # Public API (future use)
test/ # Test fixtures and helpers- Agents: Modular validation logic for different aspects
- Config: YAML configuration system with sensible defaults
- Output: Multiple output formats (JSON, table) with styled output
- Registry: Plugin-like system for registering and running agents
If you have questions or encounter issues:
- Check existing GitHub issues
- Create a new issue with detailed information
- Join our discussions in GitHub Discussions
- Follow our code of conduct
Thank you for contributing to make codebase validation better for everyone!