Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .roo/rules-architect/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Architect Mode Rules

## Non-Obvious Architecture Constraints

- Providers MUST be stateless - hidden caching layer assumes this
- Webview and extension communicate through specific IPC channel patterns only
- React hooks required because external state libraries break webview isolation
- Large JSON operations must use `safeWriteJson()` for streaming (prevents memory issues)
- TypeScript `noUncheckedIndexedAccess: true` - array/object access may return undefined
- Import paths in packages/ require `.js` extensions despite TypeScript source
8 changes: 8 additions & 0 deletions .roo/rules-ask/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Ask Mode Rules

## Non-Obvious Documentation Context

- `src/` contains VSCode extension code, NOT generic source (counterintuitive naming)
- Two separate i18n systems: root `locales/` for extension, `webview-ui/src/i18n/` for UI
- Provider examples in `src/api/providers/` are canonical reference (docs may be outdated)
- Webview runs in VSCode context with restrictions (no localStorage, limited browser APIs)
10 changes: 10 additions & 0 deletions .roo/rules-code/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Code Mode Rules

## Critical Non-Obvious Patterns

- **MANDATORY**: Use `safeWriteJson()` from `src/utils/safeWriteJson.ts` for ALL JSON writes (prevents corruption via atomic writes with locking)
- Tests MUST run from workspace directory: `cd src && npx vitest run` (NOT from root)
- VSCode CSS variables must be added to `webview-ui/src/index.css` before use
- State management via React hooks only (external state libraries break webview isolation)
- Providers MUST be stateless (hidden caching layer assumes this)
- Import paths in packages/ require `.js` extensions despite TypeScript source
13 changes: 13 additions & 0 deletions .roo/rules-debug/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Debug Mode Rules

## Non-Obvious Debug Access

- Webview DevTools: Command Palette → "Developer: Open Webview Developer Tools" (NOT F12)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how relevant this is for the AI agent

- Extension logs: VSCode Output panel → "Roo Code" channel
- Extension Host output channel shows different logs than Debug Console

## Critical Debug Patterns

- IPC messages fail silently without try/catch in `packages/ipc/src/`
- Tests MUST run from workspace directory: `cd src && npx vitest run`
- Webview runs in restricted context (no localStorage, limited browser APIs)
24 changes: 0 additions & 24 deletions .roo/rules/rules.md

This file was deleted.

21 changes: 21 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# AGENTS.md

This file provides guidance to agents when working with code in this repository.

## Critical Non-Obvious Patterns

- **JSON Writes**: MUST use `safeWriteJson()` from `src/utils/safeWriteJson.ts` for ALL JSON writes (atomic writes with locking, handles streaming)
- **Test Execution**: Tests MUST run from workspace directory: `cd src && npx vitest run` or `cd webview-ui && npx vitest run` (NOT from root)
- **Import Extensions**: Use `.js` extensions in packages/ imports despite TypeScript source files
- **Bootstrap**: `pnpm install` auto-bootstraps via `scripts/bootstrap.mjs` if pnpm not found
- **Webview DevTools**: Access via Command Palette → "Developer: Open Webview Developer Tools" (not F12)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again not sure if this is relevant

- **VSCode CSS Variables**: Must be added to `webview-ui/src/index.css` before use in components
- **React Hooks Required**: External state libraries break webview isolation - use React hooks only
- **noUncheckedIndexedAccess**: TypeScript strict mode with this enabled - array/object access may return undefined

## Architecture Gotchas

- `src/` contains VSCode extension backend (not generic source)
- `webview-ui/` is React frontend in VSCode webview (restricted APIs, no localStorage)
- IPC messages between extension/webview must use typed interfaces from `packages/types`
- Provider implementations must be stateless (hidden caching layer assumes this)
Loading