| name | grove |
| description | Development skill for the Grove CLI repository - a TypeScript Git worktree management tool built with Bun.
Use when working on grove features, bug fixes, or maintenance tasks.
Covers: development workflow, code patterns, testing, commands structure, and commit conventions.
|
Grove Development
Project Stack
- Runtime: Bun
- Language: TypeScript (strict mode)
- CLI Framework: Commander.js
- Git Operations: simple-git library
- Testing: Bun's built-in test runner
Development Workflow
Before committing
bun run typecheck
bun test
Common commands
bun install
bun run dev
bun run build
bun run build:compile
Code Patterns
Adding a new command
- Create
src/commands/<name>.ts with factory function:
import { Command } from "commander";
import { handleCommandError } from "../utils";
export function create<Name>Command(): Command {
return new Command("<name>")
.description("Short description")
.argument("<arg>", "Argument description")
.option("-f, --flag", "Flag description")
.action(async (arg, options) => {
try {
} catch (error) {
handleCommandError(error);
}
});
}
- Register in
src/index.ts:
import { create<Name>Command } from "./commands/<name>";
program.addCommand(create<Name>Command());
Git operations
Use WorktreeManager class instead of calling git directly:
const manager = await WorktreeManager.discover();
Error handling
import { formatError, formatWarning, handleCommandError } from "../utils";
Interfaces
Define in src/models/index.ts
Testing
Structure
- Unit tests:
test/unit/*.test.ts - Uses Bun's built-in test runner
- Integration tests:
test/integration/*.hone - Uses Hone CLI testing framework
Unit test pattern
import { describe, test, expect, mock } from "bun:test";
describe("FeatureName", () => {
test("should do something", () => {
expect(result).toBe(expected);
});
});
Running tests
bun test
bun run test:integration
Commit Messages
Use Conventional Commits format:
<type>: <subject>
Types: feat, fix, chore, test, doc
Rules:
- Lowercase type and subject
- No period at end
- Imperative mood ("add" not "added")
- Under 72 characters
Examples:
feat: add support for branch tracking
fix: handle missing git config gracefully
chore: update dependencies
test: add edge case tests for prune
doc: update readme with new command
Documentation
When adding/changing commands:
- Update
README.md Commands section
- Update
site/index.html to match (keep in sync)
Platform Support
Linux and macOS only (x64, arm64). No Windows code.