Skip to content

Commit 7ab5b7d

Browse files
committed
*: update CLAUDE.md files
1 parent c0f3a7d commit 7ab5b7d

File tree

3 files changed

+67
-129
lines changed

3 files changed

+67
-129
lines changed

CLAUDE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# CLAUDE.md
2+
3+
Last verified: 2026-03-07
4+
5+
## Monorepo Structure
6+
7+
Three npm workspaces:
8+
9+
- **`plugin/`** - Obsidian plugin source code (TypeScript, React, Vite)
10+
- **`docs/`** - Documentation site (Docusaurus)
11+
- **`scripts/`** - Release and code generation scripts
12+
13+
Each workspace has its own `package.json` and commands. See workspace-specific `CLAUDE.md` files for details.
14+
15+
## Top-Level Commands
16+
17+
- `npm run gen` - Run code generation scripts (delegates to `scripts/` workspace)
18+
19+
## Shared Tooling
20+
21+
- **Biome** (`biome.json` at root) - Linting and formatting for all TypeScript/React code
22+
- **TypeScript** - Shared at root, workspace-specific `tsconfig.json` files
23+
- **Vite** - Build tooling shared at root, configured per workspace
24+
25+
## Project-Wide Conventions
26+
27+
- No default exports (enforced by Biome `noDefaultExport` rule)
28+
- All user-facing text in the plugin must use i18n (see `plugin/CLAUDE.md`)
29+
- Run lint/format checks from the workspace directory: `npm run lint:check` / `npm run lint:fix`

docs/CLAUDE.md

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,26 @@
1-
# CLAUDE.md
1+
# Docs CLAUDE.md
22

3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
3+
Last verified: 2026-03-07
44

5-
## Project Overview
5+
## Commands
66

7-
This is the documentation site for the Sync with Todoist Plugin for Obsidian. The site is built using Docusaurus and contains user guides, configuration instructions, and contributing information.
7+
All commands run from this `docs/` directory:
88

9-
## Common Commands
10-
11-
All commands should be run from this `docs/` directory:
12-
13-
### Development
14-
15-
- `npm start` - Start local development server (usually runs on http://localhost:3000)
9+
- `npm start` - Start local development server
1610
- `npm run build` - Build documentation site for production
1711
- `npm run serve` - Serve built site locally
1812
- `npm run clear` - Clear Docusaurus cache
19-
20-
### Documentation Management
21-
22-
- `npm run bump-version -- ${VERSION}` - Create new versioned documentation (e.g., `npm run bump-version -- 2.2.0`)
13+
- `npm run bump-version -- ${VERSION}` - Create new versioned docs (e.g., `npm run bump-version -- 2.2.0`)
2314
- `npm run write-translations` - Extract translatable strings
2415
- `npm run write-heading-ids` - Add heading IDs to markdown files
25-
26-
### Quality
27-
28-
- `npm run typecheck` - Run TypeScript type checking
16+
- `npm run typecheck` - TypeScript type checking
2917

3018
## Documentation Structure
3119

32-
### Core Documentation (`docs/`)
33-
34-
- `overview.md` - Main plugin introduction and features
35-
- `setup.md` - Installation and initial configuration
36-
- `configuration.md` - Detailed plugin settings
37-
- `query-blocks.md` - Query language documentation
38-
- `changelog.md` - Version history and changes
39-
40-
### Commands Documentation (`docs/commands/`)
41-
42-
- `add-task.md` - Creating tasks from Obsidian
43-
- `sync-with-todoist.md` - Manual sync functionality
44-
45-
### Contributing Documentation (`docs/contributing/`)
46-
47-
- `general.md` - Development setup and workflow
48-
- `release-process.md` - How to release new versions
49-
- `translation.mdx` - Translation contribution guide
20+
- `docs/` - Current documentation (markdown/MDX)
21+
- `docs/commands/` - Command-specific docs
22+
- `docs/contributing/` - Developer and contributor guides
23+
- `sidebars.ts` - Navigation structure (update when adding new pages)
5024

5125
## Versioned Documentation
5226

@@ -83,7 +57,6 @@ The site supports versioned documentation with past versions stored in:
8357
### Managing Versions
8458

8559
- Only cut new documentation versions for minor/major releases
86-
- Patch releases typically don't need new doc versions
8760
- Version bumping copies current docs to versioned storage
8861

8962
### Translation Support

plugin/CLAUDE.md

Lines changed: 27 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,39 @@
1-
# CLAUDE.md
1+
# Plugin CLAUDE.md
22

3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
3+
Last verified: 2026-03-07
44

5-
## Project Overview
5+
## Commands
66

7-
This is the main plugin source code for an unofficial Obsidian plugin that enables bidirectional sync between Obsidian and Todoist. The plugin allows users to view, create, and manage Todoist tasks directly within Obsidian using code blocks and modal interfaces.
7+
All commands run from this `plugin/` directory:
88

9-
## Common Commands
10-
11-
All commands should be run from this `plugin/` directory:
12-
13-
### Development
14-
15-
- `npm run dev` - Build plugin in development mode with type checking
16-
- `npm run build` - Build plugin for production
17-
- `npm run check` - Run TypeScript type checking only
18-
19-
### Testing and Quality
20-
21-
- `npm run test` - Run all tests with Vitest
9+
- `npm run dev` - Development build with type checking
10+
- `npm run build` - Production build
11+
- `npm run check` - TypeScript type checking only
12+
- `npm run test` - Run all tests (Vitest)
2213
- `npm run test ./src/utils` - Run tests for specific directory/file
23-
- `npm run lint:check` - Check code formatting and linting with BiomeJS
14+
- `npm run lint:check` - Check formatting and linting (BiomeJS)
2415
- `npm run lint:fix` - Auto-fix formatting and linting issues
2516

26-
## Architecture Overview
27-
28-
### Plugin Structure
29-
30-
- **Main Plugin** (`src/index.ts`): Core plugin class that initializes services, registers commands, and handles Obsidian lifecycle
31-
- **API Layer** (`src/api/`): Todoist REST API client with domain models for tasks, projects, sections, and labels
32-
- **Query System** (`src/query/`): Markdown code block processor that renders Todoist queries in notes
33-
- **UI Components** (`src/ui/`): React-based user interface components including modals, settings, and task displays
34-
- **Services** (`src/services/`): Business logic layer including token management and modal orchestration
35-
- **Data Layer** (`src/data/`): Repository pattern for caching and managing Todoist data with transformations
36-
37-
### Key Components
38-
39-
- **Query Injector** (`src/query/injector.tsx`): Processes `todoist` code blocks and renders interactive task lists
40-
- **Repository Pattern** (`src/data/repository.ts`): Generic caching layer for API data with sync capabilities
41-
- **Settings Store** (`src/settings.ts`): Zustand-based state management for plugin configuration
42-
- **Token Accessor** (`src/services/tokenAccessor.ts`): Secure storage and retrieval of Todoist API tokens
43-
44-
### UI Architecture
45-
46-
- Built with React 19 and React Aria Components
47-
- Uses Framer Motion for animations
48-
- SCSS with component-scoped styles
49-
- Supports both light and dark themes matching Obsidian
50-
51-
### Query Language
17+
## Project Structure
5218

53-
The plugin supports a custom query language in `todoist` code blocks with options for:
54-
55-
- Filtering tasks by project, labels, due dates
56-
- Sorting by priority, date, order
57-
- Grouping by project, section, priority, date, labels
58-
- Metadata display toggles for due dates, projects, labels, descriptions
59-
60-
## Development Environment
61-
62-
### Local Development
63-
64-
Set `VITE_OBSIDIAN_VAULT` in `.env.local` to automatically copy build output to your Obsidian vault for testing:
65-
66-
```
67-
export VITE_OBSIDIAN_VAULT=/path/to/your/obsidian/vault
68-
```
19+
- `src/index.ts` - Plugin entry point; initializes services, registers commands
20+
- `src/api/` - Todoist REST API client and domain models
21+
- `src/data/` - Repository pattern for caching API data with sync
22+
- `src/query/` - Custom query language parser and `todoist` code block renderer
23+
- `src/ui/` - React components (React 19 + React Aria Components + Framer Motion)
24+
- `src/services/` - Business logic (token management, modal orchestration)
25+
- `src/commands/` - Obsidian command definitions
26+
- `src/i18n/` - Internationalization (interface in `translation.ts`, implementations in `langs/`)
27+
- `src/utils/` - Shared utilities
6928

70-
### Code Style
29+
## Key Design Decisions
7130

72-
- Uses BiomeJS for formatting and linting
73-
- 2-space indentation, 100 character line width
74-
- Automatic import organization with package/alias/path grouping
75-
- React functional components with hooks
31+
- **Repository pattern** (`src/data/repository.ts`): Generic caching layer that decouples UI from API fetch timing. All Todoist data flows through repositories.
32+
- **Zustand for settings** (`src/settings.ts`): Reactive state management for plugin configuration, avoids prop drilling.
33+
- **React Aria Components**: Accessibility-first UI primitives. Prefer these over custom interactive elements.
34+
- **SCSS with component-scoped styles**: Each component has co-located `.scss`; supports Obsidian light/dark themes.
7635

77-
### Internationalization
36+
## Internationalization
7837

7938
- **Always use translations for user-facing text** - never hardcode strings in UI components
8039
- Import translations with `import { t } from "@/i18n"` and use `const i18n = t().section`
@@ -87,9 +46,9 @@ export VITE_OBSIDIAN_VAULT=/path/to/your/obsidian/vault
8746
deleteNotice: (itemName: string) => string;
8847

8948
// en.ts
90-
deleteNotice: (itemName: string) => `Item "${itemName}" was deleted`,
49+
deleteNotice: ((itemName: string) => `Item "${itemName}" was deleted`,
9150
// component.tsx
92-
new Notice(i18n.deleteNotice(item.name));
51+
new Notice(i18n.deleteNotice(item.name)));
9352
```
9453

9554
- Translation files are in `src/i18n/` with interface in `translation.ts` and implementations in `langs/`
@@ -98,26 +57,3 @@ export VITE_OBSIDIAN_VAULT=/path/to/your/obsidian/vault
9857

9958
- Vitest with jsdom environment for React component testing
10059
- Mocked Obsidian API (`src/mocks/obsidian.ts`)
101-
- Tests focus on data transformations and utility functions
102-
103-
## File Organization
104-
105-
- `src/api/` - Todoist API client and domain models
106-
- `src/commands/` - Obsidian command definitions
107-
- `src/data/` - Data layer with repositories and transformations
108-
- `src/i18n/` - Internationalization support
109-
- `src/query/` - Query parsing and code block processing
110-
- `src/services/` - Business logic and service layer
111-
- `src/ui/` - React components organized by feature
112-
- `src/utils/` - Shared utility functions
113-
114-
## Build Process
115-
116-
Uses Vite with:
117-
118-
- TypeScript compilation with path aliases
119-
- React JSX transformation
120-
- SCSS processing
121-
- Library mode targeting CommonJS for Obsidian compatibility
122-
- Manifest copying and build stamping
123-
- Development mode auto-copying to vault

0 commit comments

Comments
 (0)