Codex Notes is a VS Code extension for managing notes directly within the IDE. The extension provides a sidebar view with features for creating, managing, searching, and organizing notes with markdown support.
- Language: TypeScript
- Build Tool: npm
- Platform: VS Code
- Code Quality: ESLint, Prettier
src/
βββ extension.ts # Main extension entry point
βββ commands.ts # VS Code command registrations
βββ container.ts # Dependency injection container
βββ core/
β βββ dtos/ # Data transfer objects (Note, WebviewMessage, etc.)
β βββ enums/ # Enums (NoteColor, SortType, DateFilter)
β βββ helpers/ # Pure utility helpers (Date, File, Search, etc.)
β βββ mappers/ # Entity-to-view model mappers
β βββ repositories/ # JSON file persistence (NoteRepository)
β βββ services/ # Business logic services
βββ infra/
βββ editor/
β βββ UserInteraction.ts # VS Code API wrapper (dialogs, quick pick, etc.)
β βββ settings/ # Extension settings helpers
β βββ view/ # Editor action handlers (create, delete, rename, etc.)
βββ view/
βββ HtmlTemplateBuilder.ts # Compiles HTML templates and injects CSS/JS
βββ ViewMessageHandler.ts # Routes webview messages to service callbacks
βββ ViewProvider.ts # VS Code WebviewViewProvider implementation
βββ ViewState.ts # Sidebar filter and sort state management
βββ html/ # Modular HTML templates (toolbar, filters, notes)
βββ js/ # Webview JavaScript (controller, renderer, etc.)
βββ style/ # Webview CSS stylesheet
- Make code changes following the coding rules
- Run
npm run formatto ensure code style - Run
npm run lintto validate code style - Run
npm run packageto build the extension - Test in Extension Development Host
- Write extremely concise and objective code
- Never put comments in the code - prefer clear names and method/class extraction
- Total priority for Single Responsibility (SRP) and Open/Closed (OCP)
- Separate responsibilities into reusable classes
Internationalization:
- Use VS Code's localization API for strings
- Store localized strings in
package.nls.jsonor locale-specific files
Language:
- Code must be written in English
- All text strings must be in English (localized via i18n)
Package Structure:
- Follow the existing structure under
src/ - Core functionality in
notes/ - UI components in
ui/ - Utilities in
utils/
VS Code APIs:
- Use VS Code extension APIs correctly
- Register commands, views, and configurations in
package.json - Follow VS Code extension best practices
- Use workspace and global state appropriately