|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Critical Rules |
| 6 | + |
| 7 | +**These rules override all other instructions:** |
| 8 | + |
| 9 | +1. **NEVER commit directly to main** - Always create a feature branch and submit a pull request |
| 10 | +2. **Conventional commits** - Format: `type(scope): description` |
| 11 | +3. **GitHub Issues for TODOs** - Use `gh` CLI to manage issues, no local TODO files. Use conventional commit format for issue titles |
| 12 | +4. **Pull Requests** - Use the conventional commit format for PR titles as you do for commits |
| 13 | +5. **Working an issue** - When working an issue, always create a new branch from an updated main branch |
| 14 | +6. **Branch Names** - Use the conventional commit `type` as the first prefix, and `scope` as the second, then a short description: `feat/ui/connection-dialog` |
| 15 | +7. **Check branch status before pushing** - Verify the remote tracking branch still exists before pushing. If a PR was merged/deleted, create a new branch from main instead |
| 16 | +8. **WPF for all UI** - All UI must be implemented using WPF (XAML/C#). No web-based technologies (HTML, JavaScript, WebView) |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## Project Overview |
| 21 | + |
| 22 | +VS-CouchbaseExplorer is a Visual Studio 2022 extension for browsing and querying Couchbase Server and Capella databases. The extension is currently in preview/beta status. |
| 23 | + |
| 24 | +## Build Commands |
| 25 | + |
| 26 | +```bash |
| 27 | +# Restore NuGet packages |
| 28 | +nuget restore src/CodingWithCalvin.CouchbaseExplorer.sln |
| 29 | + |
| 30 | +# Build (Release, x64) |
| 31 | +msbuild src/CodingWithCalvin.CouchbaseExplorer/CodingWithCalvin.CouchbaseExplorer.csproj /p:configuration=Release /p:platform=x64 /p:DeployExtension=False |
| 32 | +``` |
| 33 | + |
| 34 | +The `/p:DeployExtension=False` flag prevents auto-deployment during CI builds. Remove it for local development to auto-deploy to the VS experimental instance. |
| 35 | + |
| 36 | +## Architecture |
| 37 | + |
| 38 | +### VS Extension Pattern |
| 39 | + |
| 40 | +The extension follows the standard Visual Studio SDK pattern: |
| 41 | + |
| 42 | +1. **CouchbaseExplorerPackage** (AsyncPackage) - Entry point that registers with VS and initializes the extension |
| 43 | +2. **CouchbaseExplorerWindowCommand** - Command handler that responds to menu clicks and shows the tool window |
| 44 | +3. **CouchbaseExplorerWindow** (ToolWindowPane) - Dockable tool window container |
| 45 | +4. **CouchbaseExplorerWindowControl** (WPF UserControl) - XAML-based UI with TreeView for server/bucket hierarchy |
| 46 | + |
| 47 | +### Key Files |
| 48 | + |
| 49 | +- `VSCommandTable.vsct` - Defines menu commands, groups, and placement in VS menus |
| 50 | +- `source.extension.vsixmanifest` - VSIX package metadata (version, dependencies, assets) |
| 51 | +- `CouchbaseExplorerPackage.cs` - Package initialization and service registration |
| 52 | + |
| 53 | +### Data Layer |
| 54 | + |
| 55 | +Uses **CouchbaseNetClient 3.5.2** for cluster connections, authentication, and N1QL queries. |
| 56 | + |
| 57 | +## Technology Stack |
| 58 | + |
| 59 | +- .NET Framework 4.8 |
| 60 | +- Visual Studio SDK 17.9 (VS 2022) |
| 61 | +- WPF for UI |
| 62 | +- MSBuild + NuGet for builds |
| 63 | +- VSIX packaging format |
| 64 | + |
| 65 | +## CI/CD |
| 66 | + |
| 67 | +GitHub Actions workflows in `.github/workflows/`: |
| 68 | +- `release_build_and_deploy.yml` - Builds on PR and main branch push, creates VSIX artifact |
| 69 | +- `publish.yml` - Manual trigger to publish to VS Marketplace |
| 70 | + |
| 71 | +## Development Prerequisites |
| 72 | + |
| 73 | +- Visual Studio 2022 with "Visual Studio extension development" workload |
| 74 | +- Extensibility Essentials 2022 extension (for template support) |
| 75 | +- A Couchbase Server or Capella instance for testing |
0 commit comments