2.0 KiB
2.0 KiB
Contributing to Ollie
Development Workflow
- Make changes in the source directory (
~/src/ollie/). - Build and test:
make(runs build + test + install). - Verify: Run
olliesrvand test your changes.
Code Style
- Go:
gofmt, short variable names, error returns (no panics), table-driven tests. - Tool scripts: Emit structured output (
STATUS=ok,STATUS=error). - Prompts: Markdown, concise, example-driven.
Match the existing code style: naming conventions, error handling patterns, indentation, imports.
Testing
make test # all tests
make test-core # cmd/olliesrv, cmd/toolsrv, shared packages
make test-9p # lib9p tests
Run tests before committing. If you add a feature, add tests.
Commits
- Keep commits atomic and focused.
- Write clear commit messages explaining what and why.
- Prefer new commits over
--amendunless incorporating pre-commit hook changes.
Package Documentation
Each package should have a doc.go file with a package-level comment explaining:
- What the package does
- Key types and their relationships
- Usage patterns
File Organization
Split large files by concern:
- One primary type per file when it has significant logic
- Group related functions in the same file
- Keep files under ~500 lines when practical
Adding Tools
Script-based (Python/Bash)
- Create executable in
data/tools/<name> - Create
data/tools/<name>.metawith JSON metadata - Run
make install-data
Compiled (Go)
- Create package under
tools/<family>/cmd/<name>/main.go - Create
<name>.metaalongsidemain.go - Add build target in Makefile
- Run
make
Adding Prompts
- Write markdown in
data/prompts/ - Reference in agent config if needed
- Run
make install-data
Key Conventions
- Edit source files here, not
~/.config/ollie/(that's the install target) - 9P namespace is the API — every capability is a file
- No pointless indirection — call the real thing directly
- Subtraction > addition — look for what to remove first