# Contributing Guide
Thank you for your interest in contributing to Build-Your-Own-Tools! We welcome contributions of all kinds.
English | 简体中文
# 📋 Table of Contents
- Code of Conduct
- How to Contribute
- Spec-Driven Development
- Development Workflow
- Code Standards
- Commit Conventions
- Pull Request Process
# Code of Conduct
This project adheres to our Code of Conduct. By participating, you are expected to uphold this code.
# How to Contribute
# Reporting Bugs
- Search the Issues to see if the bug has already been reported
- If not, create a new issue using the Bug Report template
- Provide detailed reproduction steps and environment information
# Suggesting Features
- Search existing issues for similar suggestions
- Create a new issue using the Feature Request template
- Describe the use case and expected behavior
# Submitting Code
- Fork the repository
- Create a feature branch
- Write code and tests
- Submit a Pull Request
# Spec-Driven Development
This project follows Spec-Driven Development (SDD) methodology.
All implementations must be based on the specification documents in the /specs directory.
# Spec Directory Structure
specs/
├── product/ # Product requirements and acceptance criteria
├── rfc/ # Technical design documents (RFCs)
├── api/ # API/CLI interface definitions
├── db/ # Data model specifications
└── testing/ # BDD test case specifications2
3
4
5
6
# AI Agent Workflow
When developing new features, modifying existing functionality, or fixing bugs:
- Review Specs First: Read relevant product docs, RFCs, and API definitions in
/specs - Spec-First Update: For new features or interface changes, propose spec modifications first
- Implementation: Code must 100% comply with specs (no gold-plating)
- Test Verification: Write tests based on acceptance criteria in
/specs/testing/
See AGENTS.md for the complete SDD workflow.
# Development Workflow
# Environment Setup
# Clone your fork
git clone https://github.com/<your-username>/build-your-own-tools.git
cd build-your-own-tools
# Add upstream repository
git remote add upstream https://github.com/LessUp/build-your-own-tools.git
# Install dependencies
# Rust: https://rustup.rs/
# Go: https://golang.org/dl/2
3
4
5
6
7
8
9
10
# Creating a Branch
# Sync with upstream
git fetch upstream
git checkout main
git merge upstream/main
# Create feature branch
git checkout -b feature/your-feature-name2
3
4
5
6
7
# Local Testing
# Rust projects
cargo fmt --all
cargo clippy --all-targets -- -D warnings
cargo test --all
# Go projects
gofmt -w .
go vet ./...
go test ./...2
3
4
5
6
7
8
9
# Code Standards
# Rust
- Use
rustfmtfor code formatting - Use
clippyfor static analysis - Follow Rust API Guidelines
- Public APIs must have documentation
/// Converts CRLF line endings to LF
///
/// # Arguments
///
/// * `input` - Input string
///
/// # Returns
///
/// String with all CRLF replaced by LF
pub fn convert_crlf_to_lf(input: &str) -> String {
input.replace("\r\n", "\n")
}2
3
4
5
6
7
8
9
10
11
12
# Go
- Use
gofmtfor code formatting - Use
go vetfor static analysis - Follow Effective Go
- Exported functions must have documentation
// ConvertCRLFToLF converts Windows line endings to Unix line endings.
func ConvertCRLFToLF(input string) string {
return strings.ReplaceAll(input, "\r\n", "\n")
}2
3
4
# General Standards
- Use UTF-8 encoding
- Use LF line endings
- Preserve trailing newline at end of files
- Remove trailing whitespace
# Commit Conventions
We use Conventional Commits specification.
# Format
<type>(<scope>): <subject>
<body>
<footer>2
3
4
5
# Type
feat: New featurefix: Bug fixdocs: Documentation updatesstyle: Code formatting (no functional change)refactor: Refactoring (not a feature or bug fix)perf: Performance optimizationtest: Test relatedchore: Build/tooling related
# Scope
dos2unix: dos2unix sub-projectgzip: gzip sub-projecthtop: htop sub-projectci: CI/CD relateddocs: Documentation relatedspecs: Specifications related
# Examples
feat(dos2unix): add support for recursive directory processing
Add -r/--recursive flag to process all files in a directory tree.
Closes #1232
3
4
5
fix(gzip): handle empty input files correctly
Previously, empty files would cause a panic. Now they are handled
gracefully with an appropriate error message.2
3
4
# Pull Request Process
# Pre-submission Checklist
- [ ] Code passes all tests
- [ ] Code passes formatting checks
- [ ] Code passes lint checks
- [ ] Related documentation is updated
- [ ] Changelog entries added (if applicable)
# PR Description
Please include in your PR description:
- Purpose and background for the changes
- Summary of changes
- Testing methodology
- Related issues (if any)
# Code Review
- All PRs require review by at least one maintainer
- Please respond to review comments promptly
- Update code as needed based on feedback
# Merging
- PRs are merged by maintainers after review
- Use Squash and Merge to keep history clean
# 📝 Changelog
For feature changes, please add entries to the corresponding sub-project's changelog/ directory:
## [Unreleased]
### Added
- Brief description of the change
### Fixed
- Brief description of the fix2
3
4
5
6
# 🙏 Thank You
Thank you for taking the time to read this guide. We look forward to your contributions!
# 中文版本
请访问 CONTRIBUTING.zh-CN.md 查看中文版本的贡献指南。