Project principles
Keep these principles in mind when contributing:Single file distribution
The compiled output must remain a single sourceable file with no installation required.
Modular architecture
Modules should have minimal coupling. Only
runtime.sh is required by all modules.Graceful degradation
Functions should check for dependencies and fail cleanly with helpful messages.
Consistent naming
All functions follow
module::function convention. No exceptions.Pure Bash preferred
Avoid external tools unless necessary. Document any dependencies clearly.
No side effects
Functions take input and return output. No global state mutation.
Getting started
Make your changes
Edit files in
src/ or add new modules following the adding modules guide.Code standards
Function naming
All public functions must followmodule::function pattern:
_:
Documentation comments
Every public function needs documentation:These comments are extracted by the wiki generator. Follow the format exactly for best results.
Error handling
Functions should fail gracefully with helpful messages:Dependencies
Check for external dependencies at runtime:Testing requirements
All new functions must have test coverage:
See the Testing guide for comprehensive testing patterns.
ShellCheck compliance
The compiler runs ShellCheck automatically if available: From main.sh:42-62:Pull request workflow
Create a feature branch
feature/add-json-modulefix/string-trim-edge-casedocs/improve-math-examples
Make atomic commits
Commit related changes together:Good commit messages:
- “Add string::levenshtein distance function”
- “Fix fs::path::join handling of absolute paths”
- “Improve math::factorial performance for large inputs”
PR checklist
Before submitting, ensure:Code quality
Code quality
All functions follow
module::function namingShellCheck passes with no errors
Code uses pure Bash where possible
Dependencies are checked at runtime
Error messages are helpful and descriptive
Documentation
Documentation
All public functions have doc comments
Comments include Usage and Example lines
Wiki pages generated for new functions
README updated if adding new module
Testing
Testing
All new functions have test coverage
Tests cover normal, edge, and error cases
All tests pass:
./main.sh test ./compiled.shFunctions marked as tested with
_mark_testedIntegration
Integration
Compilation succeeds:
./main.sh compileNo regression in existing tests
New module documented in main README if applicable
Types of contributions
New modules
Adding an entirely new module:- Create
src/newmodule.sh - Implement functions following naming conventions
- Add comprehensive tests
- Generate wiki documentation
- Update main README with module description
New functions in existing modules
Extending an existing module:- Add functions to appropriate
src/module.shfile - Follow existing code style in that module
- Add tests in the module’s test section
- Regenerate wiki pages
Bug fixes
Fixing issues:- Add a test that reproduces the bug (should fail)
- Fix the bug
- Verify the test now passes
- Update documentation if behavior changed
Documentation improvements
Enhancing docs:- Edit wiki pages directly (they won’t be overwritten)
- Add examples and use cases
- Clarify confusing explanations
- Fix typos and formatting
Performance improvements
Optimizing existing functions:- Add benchmarks showing improvement
- Ensure tests still pass
- Document any behavior changes
- Consider backwards compatibility
Project structure
Understanding the layout:The
compiled.sh file is gitignored. Users compile it themselves from source.License
Bash::framehead is licensed under AGPL-3.0. By contributing, you agree that your contributions will be licensed under the same license.Code review process
After submitting a PR:- Automated checks run (if configured)
- Maintainers review code quality and design
- Feedback provided via PR comments
- You address feedback with additional commits
- Once approved, PR is merged
Getting help
If you need help contributing:- Check existing issues on GitHub
- Review the module adding guide
- Look at existing modules as examples
- Ask questions in issue discussions
Recognition
Contributors are recognized in:- Git commit history
- GitHub contributors page
- Release notes for significant contributions
Next steps
Adding modules
Learn how to create new modules
Testing
Write comprehensive tests for your code
Wiki generation
Generate documentation from your code