Getting Started
Installation
Development Workflow
Before You Start
Making Changes
Follow these practices for all contributions:- Small, atomic commits - Make focused commits for easier rollback and review
- Feature branches - Create a branch for each feature or bugfix
- Code review - All changes require review before merging
- Tests first - Write or update tests for your changes
- Documentation - Update README.md and AGENTS.md as needed
Adding a New Feature
Define the interface (if needed)
Add service contracts to
builder/services/interfaces.go:builder/services/interfaces.go
Implement the service
Create or modify service in
builder/services/:builder/services/asset_service.go
Architecture Overview
Service Layer Pattern
Kosh follows a clean architecture with separated concerns:Dependency Injection
TheBuilder struct acts as a composition root:
builder/run/builder.go
- Testability - Easy mocking of dependencies
- Separation of Concerns - Each service has a single responsibility
- Flexibility - Swap implementations without changing business logic
Testing Strategy
Kosh uses multiple testing approaches:- Unit Tests - Test individual functions and methods
- Integration Tests - Test service interactions
- Performance Tests - Benchmark before/after changes
- Race Detection - Detect concurrent access issues
- End-to-End - Full build pipeline validation
Running Tests
Writing Tests
Follow existing test patterns:builder/search/search_test.go
WASM Compilation
The search engine compiles to WebAssembly for browser execution.Full Compilation Process
Output files:internal/build/wasm/search.wasm- WASM source (~4.2 MB)public/static/wasm/search.wasm- Deployed WASM (extracted from CLI)public/search.bin- Search index (~200 KB, msgpack + gzip)
Release Checklist
Before releasing a new version:- All tests pass:
go test ./... - Linter passes:
golangci-lint run - Binary builds:
go build -o kosh.exe ./cmd/kosh - Version command works:
./kosh version - README.md is up to date
- AGENTS.md is up to date
- WASM recompiled if search changed
- CHANGELOG.md updated
Getting Help
If you need help:- Read the AGENTS.md developer guide
- Check existing issues and pull requests
- Open a new issue with details about your contribution
- Join discussions in pull requests
Code Review Process
All contributions go through code review:- Submit PR - Create a pull request with clear description
- Automated checks - Tests and linter must pass
- Review - Maintainers review code quality and design
- Revisions - Address feedback and update PR
- Merge - Once approved, PR is merged to main