From a1c0efe7c2ab720395bdf2e6ed3feb2de9e7a4a1 Mon Sep 17 00:00:00 2001 From: Mike Thicke Date: Thu, 7 Aug 2025 13:58:37 -0400 Subject: [PATCH] Claude init --- CLAUDE.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..d919a5b --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,59 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +Co-Intelligence AI is an Obsidian plugin that integrates AI chat functionality directly into Obsidian. It uses Solid.js for the UI framework and TypeScript throughout. + +## Development Commands + +```bash +# Install dependencies +npm install + +# Development mode with hot reload +npm run dev + +# Production build +npm run build +``` + +## Architecture + +### Key Entry Points +- `src/CoIntelligencePlugin.tsx` - Main plugin class that extends Obsidian's Plugin +- `src/ChatView.tsx` - Custom Obsidian view for the chat interface +- `src/CoiChatApp.tsx` - Main Solid.js app component + +### Core Services +- `src/services/modelRegistry.ts` - Singleton managing AI provider integrations +- `src/services/modelService.ts` - Handles AI model interactions and streaming + +### Plugin Integration +The plugin uses `monkey-around` to patch Obsidian's `WorkspaceLeaf` to automatically open COI chat notes in the custom chat view. This happens in `src/CoIntelligencePlugin.tsx:139-171`. + +### Chat Storage +Chats are stored as markdown files with special frontmatter: +- `is-coi-chat: true` - Identifies COI chat notes +- `coi-chat-view: "chat"|"source"` - Display mode +- Chat content is wrapped in `` and `` tags + +### Build Configuration +- Uses Vite with `vite-plugin-solid` for Solid.js support +- Outputs CommonJS format for Obsidian compatibility +- Path aliases: `@/` → `src/`, `@assets/` → `assets/` + +## Testing + +Currently no test suite exists. When implementing tests, consider: +- Obsidian plugin testing patterns +- Mocking Obsidian API +- Testing Solid.js components + +## Important Notes + +- Target Obsidian version: 1.8.0+ +- Uses Vercel AI SDK for model integrations +- Supports OpenAI, Anthropic, Google, and Perplexity providers +- CSS is in `src/styles.css` and gets copied to dist during build \ No newline at end of file