Skip to content

Commit 962ced6

Browse files
committed
Add the results of running /init
1 parent 2c82f4c commit 962ced6

File tree

5 files changed

+225
-0
lines changed

5 files changed

+225
-0
lines changed

.roo/rules-architect/AGENTS.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Architect Mode Rules
2+
3+
## Design Principles
4+
5+
- **VSCode Extension Architecture**: Work within VSCode's webview + extension host model
6+
- **Monorepo Organization**: Maintain clear separation between packages
7+
- **Provider Pattern**: New AI providers must follow existing interface patterns
8+
- **State Management**: React hooks for UI, VSCode context for extension state
9+
10+
## Package Structure Requirements
11+
12+
- New packages go in `packages/` directory
13+
- Must include proper TypeScript configuration extending base
14+
- Shared types belong in `packages/types/src/`
15+
- Follow existing naming conventions (e.g., @roo-code/package-name)
16+
17+
## API Design
18+
19+
- All providers implement Provider interface from packages/types
20+
- IPC messages must be strongly typed
21+
- Backwards compatibility required for existing provider contracts
22+
- Error handling must include proper error types and recovery
23+
24+
## Performance Considerations
25+
26+
- Large JSON operations must use streaming (see safeWriteJson)
27+
- Webview content should lazy-load heavy components
28+
- Code indexing happens asynchronously in background
29+
- Terminal operations should not block UI
30+
31+
## Evals Database & Migrations
32+
33+
- Evals database schemas in `packages/evals/src/db/`
34+
- Migrations required for schema changes
35+
- Use proper transaction handling for data consistency
36+
37+
## Security Patterns
38+
39+
- Never expose sensitive data in webview
40+
- API keys stored in VSCode SecretStorage
41+
- File operations must validate paths
42+
- Command execution requires user approval

.roo/rules-ask/AGENTS.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Ask Mode Rules
2+
3+
## Documentation Sources
4+
5+
- Main documentation: README.md, CONTRIBUTING.md, CHANGELOG.md
6+
- API docs: Check provider implementations in `src/api/providers/`
7+
- UI patterns: Reference `webview-ui/src/components/` for React components
8+
- Types: Refer to `packages/types/src/` for TypeScript interfaces
9+
10+
## Code Examples
11+
12+
- Provider examples: Each provider in `src/api/providers/` shows implementation patterns
13+
- Test examples: `src/__tests__/` and `webview-ui/src/**/*.test.tsx`
14+
- IPC patterns: `packages/ipc/src/` for communication examples
15+
- Custom modes: Check `.roo/rules-*/` directories for mode-specific patterns
16+
17+
## Architecture Explanations
18+
19+
- **Monorepo Structure**:
20+
- `src/` - VSCode extension backend
21+
- `webview-ui/` - React frontend
22+
- `packages/` - Shared libraries
23+
- `apps/` - Additional applications
24+
- **Webview Architecture**: VSCode extension hosts React app via webview API
25+
- **Provider Pattern**: All AI providers implement common interface for consistency
26+
- **IPC Communication**: Typed messages between extension and webview
27+
28+
## Command References
29+
30+
- Build commands: See `package.json` scripts section
31+
- Test commands: Must run from workspace directory with package.json
32+
- Development: F5 launches extension in new VSCode window
33+
- VSIX packaging: `pnpm vsix` creates installable package
34+
35+
## Localization
36+
37+
- i18n files in `locales/` directory
38+
- Extension uses vscode.l10n API for translations
39+
- Webview uses i18next for React component translations

.roo/rules-code/AGENTS.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Code Mode Rules
2+
3+
## JSON File Operations
4+
5+
- **MANDATORY**: Use `safeWriteJson()` from `src/utils/safeWriteJson.ts` for ALL JSON writes
6+
- Never use `JSON.stringify` with direct file writes - always use `safeWriteJson`
7+
- `safeWriteJson` handles directory creation, atomic writes, and locking automatically
8+
9+
## Provider Implementation
10+
11+
- All new providers MUST implement the Provider interface from `packages/types/src/`
12+
- Provider implementations go in `src/api/providers/`
13+
- Each provider needs proper error handling and retry mechanisms
14+
15+
## UI Component Guidelines
16+
17+
- Use Tailwind CSS classes exclusively - no inline styles
18+
- VSCode CSS variables must be added to `webview-ui/src/index.css` before use
19+
- React components use functional components with hooks
20+
- State management via React hooks, not external state libraries
21+
22+
## Testing Requirements
23+
24+
- All new features require test coverage
25+
- Tests use vitest framework (vi, describe, test, it are global)
26+
- Run tests from workspace directory: `cd src && npx vitest run`
27+
- Never run tests from project root
28+
29+
## IPC Communication
30+
31+
- Use packages/ipc for webview ↔ extension communication
32+
- Messages must be typed using interfaces from packages/types
33+
- Handle all async operations with proper error boundaries
34+
35+
## File Restrictions
36+
37+
- Code mode can edit all file types
38+
- Always verify file exists before operations
39+
- Use proper file locking for concurrent access safety

.roo/rules-debug/AGENTS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Debug Mode Rules
2+
3+
## Debugging Entry Points
4+
5+
- VSCode Debug Console shows extension logs via `outputChannel`
6+
- Webview DevTools accessible via Command Palette → "Developer: Open Webview Developer Tools"
7+
- Extension host debugging: Press F5 to launch new VSCode window with extension loaded
8+
9+
## Common Debug Patterns
10+
11+
- Provider issues: Check `src/api/providers/__tests__/` for test patterns
12+
- IPC communication: Review `packages/ipc/src/` for message flow
13+
- Webview state issues: Check React DevTools in webview developer tools
14+
- Extension activation: Review `src/extension.ts` and `src/activate/`
15+
16+
## Log Locations
17+
18+
- Extension logs: VSCode Output panel → "Roo Code"
19+
- Terminal command logs: Check TerminalRegistry in `src/integrations/terminal/`
20+
- MCP server logs: Check McpServerManager output
21+
- Cloud service logs: Check CloudService initialization in extension.ts
22+
23+
## Testing Debug Workflow
24+
25+
1. Add console.log or debugger statements
26+
2. Run tests with: `cd src && npx vitest run --reporter=verbose`
27+
3. For UI tests: `cd webview-ui && npx vitest run --reporter=verbose`
28+
4. Use VSCode's built-in debugger for stepping through code
29+
30+
## Performance Debugging
31+
32+
- Memory issues: Check for proper cleanup in `deactivate()` function
33+
- Slow operations: Profile with Chrome DevTools for webview
34+
- Extension performance: Use VSCode's Extension Host profiler
35+
36+
## Error Handling
37+
38+
- All async operations should have try-catch blocks
39+
- Errors should be logged to outputChannel
40+
- Critical errors should provide user-friendly messages via vscode.window.showErrorMessage

AGENTS.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# AGENTS.md
2+
3+
This file provides guidance to agents when working with code in this repository.
4+
5+
## Project Overview
6+
7+
Roo Code - AI-powered autonomous coding agent VSCode extension with React webview UI, supporting multiple AI providers and custom modes.
8+
9+
## Build/Test/Lint Commands
10+
11+
```bash
12+
# Install dependencies (from root)
13+
pnpm install
14+
15+
# Build entire project
16+
pnpm build
17+
18+
# Run tests (CRITICAL: run from workspace directory containing package.json)
19+
cd src && npx vitest run tests/user.test.ts # Backend tests
20+
cd webview-ui && npx vitest run src/components/Button.test.tsx # UI tests
21+
22+
# Lint/format
23+
pnpm lint
24+
pnpm format
25+
```
26+
27+
## Code Style
28+
29+
- **Formatting**: Tabs (4 width), 120 char lines, no semicolons, bracket same line
30+
- **Imports**: ESM modules, use `.js` extensions in packages/
31+
- **Types**: TypeScript strict mode, `noUncheckedIndexedAccess: true`
32+
- **Naming**: camelCase functions/variables, PascalCase components/classes
33+
- **UI**: Tailwind CSS classes only (no inline styles), VSCode CSS vars via webview-ui/src/index.css
34+
35+
## Architecture
36+
37+
```
38+
src/ # VSCode extension backend (TypeScript)
39+
├── extension.ts # Entry point, registers providers & commands
40+
├── api/providers/ # AI provider implementations
41+
├── core/webview/ # Webview provider & IPC
42+
└── utils/ # Utilities (MUST use safeWriteJson for JSON writes)
43+
44+
webview-ui/ # React frontend
45+
├── src/components/ # React components with Tailwind CSS
46+
└── src/hooks/ # Custom React hooks
47+
48+
packages/ # Shared packages
49+
├── types/ # Shared TypeScript types
50+
├── ipc/ # IPC communication layer
51+
└── evals/ # Evaluation framework
52+
```
53+
54+
## Critical Patterns
55+
56+
- **JSON Writes**: ALWAYS use `safeWriteJson()` from src/utils/safeWriteJson.ts (atomic writes with locking)
57+
- **Testing**: Run vitest from workspace directory containing package.json, NOT from project root
58+
- **Providers**: Implement Provider interface from packages/types/src/
59+
- **Webview**: VSCode webview architecture with IPC messaging between extension and UI
60+
61+
## Development
62+
63+
- **Debug**: Press F5 in VSCode to launch extension host
64+
- **Hot Reload**: Webview changes appear immediately, core changes auto-reload in dev mode
65+
- **VSIX**: `pnpm vsix` to build, `pnpm install:vsix` to install locally

0 commit comments

Comments
 (0)