This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
githru-vscode-ext is a VSCode extension that provides Git visualization and analytics. It's a monorepo with three main packages:
- analysis-engine: Core Git analysis engine that parses git logs and GitHub data
- view: React-based UI components for visualization (uses D3.js, Material-UI)
- vscode: VSCode extension wrapper that bridges the engine and view
# Install dependencies for all packages
npm install
# Build all packages
npm run build:all
# Test all packages
npm run test:all
# Lint all packages
npm run lint
npm run lint:fix
# Format code
npm run prettier
npm run prettier:fix# Build with type declarations
npm run build
# Run specific tests
npm run test:stem
npm run test
# Lint
npm run lint# Start development server
npm run start
# Build for production
npm run build
# Run tests
npm run test
# Run E2E tests
npm run test:e2e# Build extension (also builds view package)
npm run build
# Watch mode for development
npm run watch
# Package extension
npm run package
# Debug: F5 in VSCode or Run > Start Debugging- Run
npm run build:allfrom root - Open the
packages/vscodefolder in VSCode - Press F5 or use Run > Start Debugging
- In the Extension Development Host, use Command Palette > "Open Githru View"
- VSCode Extension captures git repository context
- Analysis Engine processes git log and GitHub API data:
- Parses raw git commits (
parser.ts) - Builds commit dictionary (
commit.util.ts) - Creates stem/branch structure (
stem.ts) - Generates cluster summary map (
csm.ts)
- Parses raw git commits (
- View renders interactive visualizations using the processed data
AnalysisEngine: Main orchestrator classPluginOctokit: GitHub API integration with retry/throttling- Dependency injection using
tsyringe
- State Management: Zustand stores in
src/store/ - Components: Modular React components with D3.js integration
- IDE Adapter Pattern:
VSCodeIDEAdapterbridges VSCode API - Component structure:
ComponentName/index.tsexports, separate.const.ts,.type.ts,.util.tsfiles
- Extension activation on git repositories
- Webview integration for React UI
- Command palette integration
- GitHub authentication management
Follow conventional commits with these scopes:
feat(engine): Analysis engine featuresfeat(view): UI/visualization featuresfeat(vscode): VSCode extension featuresfix(scope): Bug fixesrefactor(scope): Code refactoring
- ESLint configuration with Prettier
- TypeScript strict mode
- 2-space indentation, 120 character line width
- Single quotes disabled, trailing commas on ES5
- Jest for unit testing
- Playwright for E2E testing (view package)
- Test files:
*.spec.tsor*.test.ts
- Node.js >= 16
- npm >= 8
- VSCode with ESLint extension
In VSCode, activate workspace TypeScript:
- Open a TypeScript file
- Ctrl/Cmd + Shift + P
- "Select TypeScript Version"
- "Use Workspace Version"
The project uses npm workspaces. Each package has its own dependencies and build configuration but shares root-level linting and formatting rules.