Thank you for your interest in contributing to Ralph TUI! This document provides guidelines and information for contributors.
- Bun >= 1.0.0 (runtime and package manager)
- Git for version control
# Clone the repository
git clone https://github.com/subsy/ralph-tui.git
cd ralph-tui
# Install dependencies
bun install
# Run the TUI in development mode
bun run ./src/cli.tsx
# Or use the dev script
bun run dev# Type checking
bun run typecheck
# Linting
bun run lint
# Fix lint issues automatically
bun run lint:fix
# Build the project
bun run build- Simplicity over cleverness - Write clear, maintainable code
- Minimal changes - Make the smallest reasonable change to achieve the goal
- No unrelated changes - Don't refactor or "improve" code outside your scope
- Preserve comments - Only remove comments if they're provably false
- Strict mode is enabled - all code must be fully typed
- Use
ReactNodereturn type for component functions (notJSX.Element) - Use ES modules (
import/export) - the package is"type": "module"
Every source file must start with an ABOUTME comment explaining the file's purpose:
/**
* ABOUTME: Brief description of what this file does.
* Additional context if needed.
*/src/
├── cli.tsx # CLI entry point
├── commands/ # CLI command implementations
├── config/ # Configuration system
├── engine/ # Execution engine
├── interruption/ # Signal handling
├── logs/ # Iteration logging
├── plugins/
│ ├── agents/ # Agent plugins (claude, opencode)
│ └── trackers/ # Tracker plugins (beads, json)
├── session/ # Session management
├── setup/ # Interactive setup wizard
├── templates/ # Prompt templates
└── tui/
└── components/ # OpenTUI React components
- Tracker plugins go in
src/plugins/trackers/builtin/ - Agent plugins go in
src/plugins/agents/builtin/ - Use the factory pattern with singleton registries
- Extend
BaseTrackerPluginorBaseAgentPluginfor common functionality
- Components go in
src/tui/components/ - Use OpenTUI's React bindings (
@opentui/react) - Export components from
src/tui/components/index.ts
- Create a branch from
main - Make your changes following the code style guidelines
- Run quality checks:
bun run typecheck && bun run lint - Test your changes manually with
bun run ./src/cli.tsx - Commit with a descriptive message
- Open a pull request
Use conventional commit format:
type: brief description
Longer explanation if needed.
Types:
feat:- New featurefix:- Bug fixdocs:- Documentation changesrefactor:- Code refactoringchore:- Maintenance tasks
Examples:
feat: add support for custom prompt templates
fix: handle empty task lists gracefully
docs: update README with configuration examples
- One feature per PR - Keep changes focused
- Update documentation if adding features
- Ensure CI passes - typecheck and lint must succeed
- Describe your changes in the PR description
- Create a new file in
src/plugins/trackers/builtin/ - Extend
BaseTrackerPluginor implementTrackerPlugininterface - Register in
src/plugins/trackers/builtin/index.ts - Add a template in
src/templates/builtin.tsif needed
- Create a new file in
src/plugins/agents/builtin/ - Extend
BaseAgentPluginor implementAgentPlugininterface - Register in
src/plugins/agents/builtin/index.ts
- Create a command file in
src/commands/ - Export from
src/commands/index.ts - Add handling in
src/cli.tsx - Update the help text in
showHelp()
Currently, Ralph TUI relies on manual testing:
# Test the TUI
bun run ./src/cli.tsx
# Test specific commands
bun run ./src/cli.tsx run --help
bun run ./src/cli.tsx plugins agents
bun run ./src/cli.tsx config showWhen testing changes:
- Test with different trackers (beads, json)
- Test with different agents (claude, opencode)
- Test TUI keyboard navigation
- Test headless mode
- Test error conditions
When reporting issues, please include:
- Ralph TUI version (
ralph-tui --versionor check package.json) - Bun version (
bun --version) - Operating system
- Steps to reproduce
- Expected behavior
- Actual behavior
- Relevant logs (from
.ralph-tui/iterations/)
If you have questions about contributing, feel free to:
- Open a GitHub issue with the
questionlabel - Check existing issues for similar questions
Thank you for contributing to Ralph TUI!