| name | cli-worker |
| description | Implements CLI tool with command handlers, API client, and Bun compilation to standalone binary |
CLI Worker
NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.
When to Use This Skill
Use for features involving:
- CLI command implementation
- API client for agent interactions
- Binary compilation and distribution
- CLI testing
Work Procedure
-
Write tests first (RED) - Create test file in cli/tests/
- Command parsing tests
- API client integration tests (mocked server)
- Output formatting tests
- Run
bun test to verify tests FAIL
-
Implement feature (GREEN) - Make tests pass
- Add command in
cli/src/commands/
- Use commander.js or similar for CLI framework
- Implement API client methods
- Format output with chalk/colors
- Handle errors gracefully
-
Manual verification
- Build CLI:
bun run build:cli
- Test with actual API server running
- Test error scenarios (offline, invalid input)
- Verify binary size is reasonable
-
Run validators
bun run typecheck - TypeScript validation
bun run lint - Code style
bun test - All tests must pass
bun run build:cli - Binary compilation succeeds
-
Integration test
- Test CLI with live API server
- Verify all commands work end-to-end
- Test binary on target platform
Example Handoff
{
"salientSummary": "Implemented 'mission claim' and 'mission update' commands with status validation, added API client methods, compiled to 15MB binary, verified with live server.",
"whatWasImplemented": "CLI command 'mission claim <task-id>' that calls PATCH /api/tasks/:id with status=in_progress and agent_id from config. Command 'mission update <task-id> --status <status>' with validation against allowed statuses. Added ApiClient class with claimTask() and updateTask() methods. Config file support at ~/.mission-board/config.json for agent_id. Binary compilation via 'bun build --compile'. Help text and usage examples.",
"whatWasLeftUndone": "",
"verification": {
"commandsRun": [
{
"command": "bun test cli/tests/commands.test.ts",
"exitCode": 0,
"observation": "6 tests passing: claim command success, claim already claimed task, update status, invalid status error, missing task-id error, config file reading"
},
{
"command": "bun run build:cli",
"exitCode": 0,
"observation":
When to Return to Orchestrator
- API endpoints not yet implemented
- Binary compilation fails
- Missing dependencies that cannot be installed
- Platform-specific issues