-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add the results of running /init #7399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
962ced6
2581fcc
8db9d2f
053e159
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Architect Mode Rules | ||
|
|
||
| ## Design Principles | ||
|
|
||
| - **VSCode Extension Architecture**: Work within VSCode's webview + extension host model | ||
| - **Monorepo Organization**: Maintain clear separation between packages | ||
| - **Provider Pattern**: New AI providers must follow existing interface patterns | ||
| - **State Management**: React hooks for UI, VSCode context for extension state | ||
|
|
||
| ## Package Structure Requirements | ||
|
|
||
| - New packages go in `packages/` directory | ||
| - Must include proper TypeScript configuration extending base | ||
| - Shared types belong in `packages/types/src/` | ||
| - Follow existing naming conventions (e.g., @roo-code/package-name) | ||
|
|
||
| ## API Design | ||
|
|
||
| - All providers implement Provider interface from packages/types | ||
| - IPC messages must be strongly typed | ||
| - Backwards compatibility required for existing provider contracts | ||
| - Error handling must include proper error types and recovery | ||
|
|
||
| ## Performance Considerations | ||
|
|
||
| - Large JSON operations must use streaming (see safeWriteJson) | ||
| - Webview content should lazy-load heavy components | ||
| - Code indexing happens asynchronously in background | ||
| - Terminal operations should not block UI | ||
|
|
||
| ## Evals Database & Migrations | ||
|
|
||
| - Evals database schemas in `packages/evals/src/db/` | ||
| - Migrations required for schema changes | ||
| - Use proper transaction handling for data consistency | ||
|
|
||
| ## Security Patterns | ||
|
|
||
| - Never expose sensitive data in webview | ||
| - API keys stored in VSCode SecretStorage | ||
| - File operations must validate paths | ||
| - Command execution requires user approval |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Ask Mode Rules | ||
|
|
||
| ## Documentation Sources | ||
|
|
||
| - Main documentation: README.md, CONTRIBUTING.md, CHANGELOG.md | ||
| - API docs: Check provider implementations in `src/api/providers/` | ||
| - UI patterns: Reference `webview-ui/src/components/` for React components | ||
| - Types: Refer to `packages/types/src/` for TypeScript interfaces | ||
|
|
||
| ## Code Examples | ||
|
|
||
| - Provider examples: Each provider in `src/api/providers/` shows implementation patterns | ||
| - Test examples: `src/__tests__/` and `webview-ui/src/**/*.test.tsx` | ||
| - IPC patterns: `packages/ipc/src/` for communication examples | ||
| - Custom modes: Check `.roo/rules-*/` directories for mode-specific patterns | ||
|
|
||
| ## Architecture Explanations | ||
|
|
||
| - **Monorepo Structure**: | ||
| - `src/` - VSCode extension backend | ||
| - `webview-ui/` - React frontend | ||
| - `packages/` - Shared libraries | ||
| - `apps/` - Additional applications | ||
| - **Webview Architecture**: VSCode extension hosts React app via webview API | ||
| - **Provider Pattern**: All AI providers implement common interface for consistency | ||
| - **IPC Communication**: Typed messages between extension and webview | ||
|
|
||
| ## Command References | ||
|
|
||
| - Build commands: See `package.json` scripts section | ||
| - Test commands: Must run from workspace directory with package.json | ||
| - Development: F5 launches extension in new VSCode window | ||
| - VSIX packaging: `pnpm vsix` creates installable package | ||
|
|
||
| ## Localization | ||
|
|
||
| - i18n files in `locales/` directory | ||
| - Extension uses vscode.l10n API for translations | ||
| - Webview uses i18next for React component translations |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Code Mode Rules | ||
|
|
||
| ## JSON File Operations | ||
|
|
||
| - **MANDATORY**: Use `safeWriteJson()` from `src/utils/safeWriteJson.ts` for ALL JSON writes | ||
| - Never use `JSON.stringify` with direct file writes - always use `safeWriteJson` | ||
| - `safeWriteJson` handles directory creation, atomic writes, and locking automatically | ||
|
|
||
| ## Provider Implementation | ||
|
|
||
| - All new providers MUST implement the Provider interface from `packages/types/src/` | ||
| - Provider implementations go in `src/api/providers/` | ||
| - Each provider needs proper error handling and retry mechanisms | ||
|
|
||
| ## UI Component Guidelines | ||
|
|
||
| - Use Tailwind CSS classes exclusively - no inline styles | ||
| - VSCode CSS variables must be added to `webview-ui/src/index.css` before use | ||
| - React components use functional components with hooks | ||
| - State management via React hooks, not external state libraries | ||
|
|
||
| ## Testing Requirements | ||
|
|
||
| - All new features require test coverage | ||
| - Tests use vitest framework (vi, describe, test, it are global) | ||
| - Run tests from workspace directory: `cd src && npx vitest run` | ||
| - Never run tests from project root | ||
|
|
||
| ## IPC Communication | ||
|
|
||
| - Use packages/ipc for webview ↔ extension communication | ||
| - Messages must be typed using interfaces from packages/types | ||
| - Handle all async operations with proper error boundaries | ||
|
|
||
| ## File Restrictions | ||
|
|
||
| - Code mode can edit all file types | ||
|
||
| - Always verify file exists before operations | ||
| - Use proper file locking for concurrent access safety | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # Debug Mode Rules | ||
|
|
||
| ## Debugging Entry Points | ||
|
|
||
| - VSCode Debug Console shows extension logs via `outputChannel` | ||
| - Webview DevTools accessible via Command Palette → "Developer: Open Webview Developer Tools" | ||
| - Extension host debugging: Press F5 to launch new VSCode window with extension loaded | ||
|
|
||
| ## Common Debug Patterns | ||
|
|
||
| - Provider issues: Check `src/api/providers/__tests__/` for test patterns | ||
| - IPC communication: Review `packages/ipc/src/` for message flow | ||
| - Webview state issues: Check React DevTools in webview developer tools | ||
| - Extension activation: Review `src/extension.ts` and `src/activate/` | ||
|
|
||
| ## Log Locations | ||
|
|
||
| - Extension logs: VSCode Output panel → "Roo Code" | ||
| - Terminal command logs: Check TerminalRegistry in `src/integrations/terminal/` | ||
| - MCP server logs: Check McpServerManager output | ||
| - Cloud service logs: Check CloudService initialization in extension.ts | ||
|
|
||
| ## Testing Debug Workflow | ||
|
|
||
| 1. Add console.log or debugger statements | ||
| 2. Run tests with: `cd src && npx vitest run --reporter=verbose` | ||
| 3. For UI tests: `cd webview-ui && npx vitest run --reporter=verbose` | ||
| 4. Use VSCode's built-in debugger for stepping through code | ||
|
|
||
| ## Performance Debugging | ||
|
|
||
| - Memory issues: Check for proper cleanup in `deactivate()` function | ||
| - Slow operations: Profile with Chrome DevTools for webview | ||
| - Extension performance: Use VSCode's Extension Host profiler | ||
|
|
||
| ## Error Handling | ||
|
|
||
| - All async operations should have try-catch blocks | ||
| - Errors should be logged to outputChannel | ||
| - Critical errors should provide user-friendly messages via vscode.window.showErrorMessage |
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,65 @@ | ||||||||||||||
| # AGENTS.md | ||||||||||||||
|
|
||||||||||||||
| This file provides guidance to agents when working with code in this repository. | ||||||||||||||
|
|
||||||||||||||
| ## Project Overview | ||||||||||||||
|
|
||||||||||||||
| Roo Code - AI-powered autonomous coding agent VSCode extension with React webview UI, supporting multiple AI providers and custom modes. | ||||||||||||||
|
||||||||||||||
|
|
||||||||||||||
| ## Build/Test/Lint Commands | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| # Install dependencies (from root) | ||||||||||||||
| pnpm install | ||||||||||||||
|
|
||||||||||||||
| # Build entire project | ||||||||||||||
| pnpm build | ||||||||||||||
|
|
||||||||||||||
| # Run tests (CRITICAL: run from workspace directory containing package.json) | ||||||||||||||
| cd src && npx vitest run tests/user.test.ts # Backend tests | ||||||||||||||
|
||||||||||||||
| cd src && npx vitest run tests/user.test.ts # Backend tests | |
| # Run tests (CRITICAL: run from workspace directory containing package.json) | |
| cd src && npx vitest run tests/user.test.ts # Specific backend test | |
| cd src && npx vitest run tests/ # All backend tests | |
| cd webview-ui && npx vitest run src/components/Button.test.tsx # Specific UI test | |
| cd webview-ui && npx vitest run # All UI tests |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed the architecture section shows a simplified structure. Would it be helpful to also mention other important directories that are part of the monorepo? For example, apps/ (web-roo-code, web-evals, vscode-e2e), locales/, and scripts/ directories?
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this could be useful if users ask the model how to run the extension?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there's also a use-safeWriteJson.md file in this directory that provides additional context about the safeWriteJson requirement, should we cross-reference it? This could help developers find the detailed usage guidelines more easily.