rover
AGENTS.md270 starsChanged 10 months agoApache-2.0View on GitHub
Rover is a TypeScript-based workspace that helps developers and AI agents spin up services instantly. The project is organized as a monorepo with multiple packages, each serving different purposes in the Rover ecosystem. Key architectural decisions: Always use launch (async) and launchSync from packages/core/src/os.ts to spawn processes. Do not use the Node.js child_process API directly. These functions are wrappers around execa that provide consistent behavior across the codebase:
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 152
After building in dev mode, use pnpm start in the CLI package to run with full source maps:
- Distinctive: line 172
Fix Code, Not Tests: If a test fails due to an implementation bug:
- Distinctive: line 202
After implementing changes, always run these commands before considering the work complete:
- Very specific: line 223
Update package.json scripts: if new build/dev commands are needed
- Distinctive: line 230
Fix the implementation: - never change tests to mask bugs
- Distinctive: line 231
Verify the fix: - ensure the corrected code passes existing and new tests
- Distinctive: line 232
Consider edge cases: - add additional tests if the bug reveals gaps
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
This file provides guidance to AI agents (Claude Code, Cursor, etc.) when working with code in this repository.
Project Overview
Rover is a TypeScript-based workspace that helps developers and AI agents spin up services instantly. The project is organized as a monorepo with multiple packages, each serving different purposes in the Rover ecosystem.
Repository Structure
rover/
├── packages/
│ ├── cli/ # Main CLI tool (TypeScript)
│ ├── extension/ # VS Code extension (TypeScript)
│ └── telemetry/ # Telemetry library (TypeScript)
├── package.json # Root workspace configuration
└── AGENTS.md # This fileEssential Development Commands
Workspace Commands (run from root)
# Development workflow
pnpm dev # Start all packages in development mode
# Building
pnpm build # Build all packages
# Testing
pnpm test # Run tests for all packages
# Type checking
pnpm check # TypeScript type checking for all packages
# Linting & Formatting
pnpm lint # Lint all files (with auto-fix)
pnpm format # Format all filesPackage-Specific Commands
# CLI package (packages/cli/)
cd packages/cli
pnpm dev # Development mode with watch
pnpm build # Type-check and build
pnpm check # TypeScript type checking
pnpm test # Run tests with Vitest
pnpm test:watch # Run tests in watch mode
pnpm test:ui # Open Vitest UI
pnpm test:coverage # Run tests with coverage
# Extension package (packages/extension/)
cd packages/extension
pnpm compile # Compile TypeScript
pnpm watch # Watch mode for development
pnpm package # Build for production
pnpm test # Run VS Code extension tests
# Telemetry package (packages/telemetry/)
cd packages/telemetry
pnpm dev # Development mode with watch
pnpm build # Build for production
pnpm check # TypeScript type checkingArchitecture
CLI Package (packages/cli/)
- Entry point:
src/index.ts- Sets up the CLI using Commander.js - Commands:
src/commands/- Each command is implemented as a separate module - Build output:
dist/index.mjs- Single bundled ES module file - Libraries:
src/lib/- Core functionality (Git, Docker, AI agents, configs) - Utilities:
src/utils/- Helper functions and utilities - Testing: Uses Vitest with real Git operations and mocked external dependencies
Key architectural decisions:
- Uses tsdown for bundling
- AI providers implement a common interface for easy switching between Claude and Gemini
- Commands interact with Git worktrees for isolated task execution
- Docker containers execute AI agent tasks
Extension Package (packages/extension/)
- Entry point:
src/extension.mts- VS Code extension activation - Providers: Tree data providers for Rover tasks
- Panels: Webview panels for detailed task information
- Views: Lit-based webview components
- CLI Integration: Communicates with Rover CLI via child processes
Telemetry Package (packages/telemetry/)
- Shared telemetry library used by CLI and extension
- Event tracking for usage analytics
- Privacy-focused implementation
Technical Details
- TypeScript: Strict mode enabled, targeting ES2022
- Module system: ES modules with Node.js compatibility
- Node version: Requires Node.js 20+ and pnpm 10+ (see root package.json engines)
- Monorepo: Uses pnpm workspaces for package management
Process Execution
Always use launch (async) and launchSync from packages/core/src/os.ts to spawn processes. Do not use the Node.js child_process API directly.
These functions are wrappers around execa that provide consistent behavior across the codebase:
launch(command, args?, options?)- Async process execution. Returns an execa result object.launchSync(command, args?, options?)- Synchronous process execution. Returns an execa sync result object.
Key behaviors handled by these wrappers:
- Proper argument escaping via
parseCommandStringand execa template strings - Detached process groups by default (prevents child termination on parent signals)
- Verbose logging when
VERBOSEis enabled - Consistent stdio option expansion
Build Pipeline
The project uses tsdown for bundling with two distinct build modes controlled by the TSUP_DEV environment variable.
Production Build (pnpm build)
- Minified output for smaller bundle size
- No source maps generated
- Workspace packages kept external (imported from their
dist/folders) - Used for releases and distribution
Development Build (pnpm build-dev or pnpm dev)
- No minification for readable stack traces
- Source maps enabled pointing to original TypeScript files
- Workspace packages bundled and aliased to their TypeScript source (
src/index.ts) - Enables full debugging with accurate line numbers across all packages
Key differences in packages/cli/tsdown.config.ts:
| Feature | Production | Development |
minify | true | false |
sourcemap | false | true |
alias | {} | Points to workspace src/*.ts |
Running with Source-Mapped Stack Traces
After building in dev mode, use pnpm start in the CLI package to run with full source maps:
# Build all packages in dev mode
pnpm build-dev
# Run CLI with source-mapped backtraces (from packages/cli/)
cd packages/cli
pnpm start <command>
# Example: run the list command with full TypeScript backtraces
pnpm start listTesting Philosophy & Guidelines
Critical Testing Principles
🚨 NEVER make tests pass by changing the test to ignore real bugs. Always fix the underlying code issue.
- Fix Code, Not Tests: If a test fails due to an implementation bug:
- ✅ DO: Fix the bug in the implementation code
- ❌ DON'T: Modify the test to ignore the bug
- ❌ DON'T: Add
.skip()or change assertions to make tests green
- Mock Strategy:
- Mock only external dependencies (APIs, CLI tools like Docker/Claude/Gemini)
- Use real implementations for core logic (Git operations, file system, environment detection)
- Create real test environments (temporary Git repos, actual project files)
- Test Environment:
- Tests create real temporary directories with actual Git repositories
- Project files (package.json, tsconfig.json, etc.) are created to test environment detection
- File system operations use real files, not mocks
Running Tests
# All tests
pnpm test
# Test per package
pnpm --filter @endorhq/rover test
pnpm --filter @endorhq/agent test
pnpm --filter rover-core test
pnpm --filter rover-schemas testValidation
After implementing changes, always run these commands before considering the work complete:
pnpm check— TypeScript type checking across all packagespnpm lint— Lint all files (with auto-fix)pnpm format— Format all filespnpm test— Run tests for all packages
You can focus formatting/linting on changed files by running pnpm exec biome format --changed or pnpm exec biome lint --changed.
AI Agent Guidelines
When Working on Commands
- Read existing command structure in
packages/cli/src/commands/ - Follow established patterns for error handling, validation, and user interaction
- Add comprehensive tests for new functionality
- Mock external dependencies but test core logic with real operations
When Adding Features
- Check if the feature belongs in CLI, extension, or telemetry package
- Update package.json scripts if new build/dev commands are needed
- Consider cross-package dependencies and update imports accordingly
- Test integration between packages when applicable
When Debugging Failed Tests
- Examine the actual failure - understand what the code is doing wrong
- Fix the implementation - never change tests to mask bugs
- Verify the fix - ensure the corrected code passes existing and new tests
- Consider edge cases - add additional tests if the bug reveals gaps
Important File Patterns
CLI Package
- Commands:
src/commands/*.ts - Tests:
src/commands/__tests__/*.test.ts - Library code:
src/lib/*.ts - Utilities:
src/utils/*.ts
Extension Package
- Main entry:
src/extension.mts - Providers:
src/providers/*.mts - Views:
src/views/*.mts - Tests:
src/test/*.test.ts
Configuration Files
- Root:
package.json,tsconfig.json(workspace config) - CLI:
packages/cli/package.json,vitest.config.ts - Extension:
packages/extension/package.json - Telemetry:
packages/telemetry/package.json
Remember: This is a development tool that interacts with Git repositories and executes containerized AI agents. Reliability and correctness are critical - never compromise test integrity for convenience.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

