Commit Message Format
All commits to Bifrost should follow a standardized format. This ensures clear history and makes it easy to understand changes at a glance.Format
Types
- feat - New feature
- fix - Bug fix
- refactor - Code refactoring (no feature change, no bug fix)
- docs - Documentation changes
- test - Test changes
- chore - Build, dependencies, tooling changes
- perf - Performance improvements
Key Rule: Always List Affected Packages
For every commit, explicitly mention all packages/directories that were modified. This is crucial for understanding the scope of changes.Examples
Good:Go Code Conventions
Style Guidelines
-
Follow standard Go conventions
- Use
gofmtfor formatting - Run
make fmtbefore committing
- Use
-
Naming
- Use meaningful variable names
- Avoid single letters except in loops
- Use
camelCasefor variables and functions - Use
PascalCasefor exported types
-
Comments
- Comment exported functions and types
- Use clear, concise comments
- Explain why, not what
-
Error Handling
- Always check and handle errors
- Provide context in error messages
- Don’t ignore errors with
_
Structure
Documentation
Each package should have:- A
packagecomment - Exported function/type comments
- Complex logic explanations
TypeScript/React Code Conventions
Style Guidelines
-
Use TypeScript - Avoid
anytypes when possible - Use functional components - No class components
-
Props interface
-
Naming
- Components:
PascalCase - Functions/variables:
camelCase - Constants:
UPPER_SNAKE_CASE
- Components:
Structure
Testing Conventions
Go Tests
- Test file naming:
*_test.go - Test function naming:
Test<FunctionName> - Table-driven tests for multiple cases
Running Tests
Documentation Conventions
MDX Files
-
Front matter
-
Headings - Use H2 (
##) as top level in body -
Code blocks - Always include language:
```go -
Links - Use relative paths:
/features/caching
Examples
This is important information that needs highlighting.
Benefits
- Reduces costs by 30-40%
- Improves latency for similar queries
core/changelog.mdframework/changelog.mdtransports/changelog.mdplugins/{plugin-name}/changelog.md
Code Quality Standards
Before submitting code:Go Code
TypeScript/React
- Use ESLint configuration from project
- Run
npm run formatfor formatting - Ensure TypeScript compilation succeeds
Key Principles
- Clarity - Code should be easy to understand
- Consistency - Follow existing patterns in codebase
- Testing - All code should have tests
- Documentation - Document public APIs and complex logic
- Simplicity - Avoid over-engineering
- Performance - Consider performance implications of changes
Common Pitfalls
❌ Don’t:- Submit PRs without running tests
- Use
fmt.Printlnfor logging (use logger) - Ignore error handling
- Create huge functions (>100 lines)
- Mix refactoring with feature changes
- Forget to list affected packages in commit messages
- Run
make test-allbefore opening PR - Use structured logging
- Handle all error cases
- Keep functions focused and testable
- Make logical, focused commits
- Always mention affected packages and changes
Getting Help
- See Setting up the repository for development setup
- Check Architecture docs to understand the codebase
- Ask in Discord if you have questions

