Skip to content

Commit 4a7cb54

Browse files
committed
Updates agent instructions
1 parent fe486e6 commit 4a7cb54

File tree

1 file changed

+96
-3
lines changed

1 file changed

+96
-3
lines changed

CLAUDE.md renamed to AGENTS.md

Lines changed: 96 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,80 @@
1-
# CLAUDE.md
1+
# AGENTS.md
22

3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
3+
> Guidance for AI-powered coding assistants (Augment Agent Mode, Augment Auggie CLI, Copilot Agent Mode, Claude Code, Cursor, Windsurf, etc.) when working with code in this repository.
4+
> Read this before writing, editing, or executing anything in this repo.
45
56
## Project Overview
67

78
This is a VS Code extension that provides web component information to AI assistants via Model Context Protocol (MCP). The extension discovers custom elements manifests in workspaces and exposes them through an MCP server with HTTP/SSE transports.
89

910
## Common Commands
1011

12+
### Prerequisites
13+
14+
- `nvm use` - Switch to the correct Node.js version
15+
- `corepack enable` - Enable corepack for package manager
16+
- `pnpm install` - Install dependencies
17+
1118
### Development
19+
1220
- `pnpm run build` - Build extension in development mode
1321
- `pnpm run bundle` - Build extension for production
1422
- `pnpm run watch` - Watch mode for development
1523
- `pnpm run clean` - Clean build artifacts
1624

1725
### Code Quality
26+
1827
- `pnpm run lint` - Run ESLint on TypeScript files
1928
- `pnpm run lint:fix` - Run ESLint with auto-fix
2029
- `pnpm run format` - Format code with Prettier
2130
- `pnpm run format:check` - Check code formatting
2231

2332
### Packaging & Publishing
33+
2434
- `pnpm run package` - Create VSIX package
2535
- `pnpm run package-pre` - Create pre-release VSIX package
2636
- `pnpm run pub` - Publish to marketplace
2737
- `pnpm run pub-pre` - Publish pre-release to marketplace
38+
- `pnpm run generate:licenses` - Generate license files
2839

2940
## Architecture Overview
3041

3142
### Core Components
3243

3344
**Extension Entry Point** (`src/extension.ts`):
45+
3446
- Main activation point that initializes logging, configuration, and container
3547
- Sets up the dependency injection container and registers commands
3648

3749
**Container** (`src/container.ts`):
50+
3851
- Dependency injection container managing all services and providers
3952
- Central point for service resolution and lifecycle management
4053

4154
**MCP Provider** (`src/mcp/provider.ts`):
55+
4256
- Core MCP server implementation providing web component data
4357
- Serves HTTP and SSE endpoints for AI assistant integration
4458
- Implements MCP tools: search-components, get-component-details, list-all-components
4559

4660
**Custom Elements Manifest (CEM) System**:
61+
4762
- `src/cem/locator.ts` - Discovers custom-elements.json files in workspace and dependencies
4863
- `src/cem/reader.ts` - Reads and parses manifest files with caching
4964

5065
**Commands** (`src/commands/`):
66+
5167
- VS Code command implementations for starting/stopping MCP server
5268
- Manifest management commands (list, locate, include/exclude)
5369
- Tree view refresh and information display commands
5470

5571
**Views** (`src/views/`):
72+
5673
- Tree view implementation showing discovered manifests
5774
- Custom tree nodes for different manifest states and groupings
5875

5976
**System Utilities** (`src/system/`):
77+
6078
- Logging, configuration, decorators, and common utilities
6179
- Standardized patterns for async operations and error handling
6280

@@ -71,6 +89,7 @@ This is a VS Code extension that provides web component information to AI assist
7189
### Configuration
7290

7391
The extension uses VS Code settings under the `wcai.*` namespace:
92+
7493
- `wcai.outputLevel` - Logging verbosity (off, error, warn, info, debug)
7594
- `wcai.manifests.exclude` - Array of manifest URIs to exclude
7695
- `wcai.mcp.host/port` - MCP server network configuration
@@ -81,4 +100,78 @@ The extension uses VS Code settings under the `wcai.*` namespace:
81100
- Uses Webpack with TypeScript compilation
82101
- Node.js target for main extension code
83102
- Separate webpack configs for extension and potential webviews
84-
- TypeScript project references for modular compilation
103+
- TypeScript project references for modular compilation
104+
105+
## Coding Standards & Styles Rules
106+
107+
### TypeScript Configuration
108+
109+
- Recommended TypeScript with `recommendedTypeChecked` ESLint config
110+
- No `any` usage (exceptions for external APIs)
111+
- Explicit return types for public methods
112+
- Prefer `type` over `interface` for unions
113+
114+
### Import Organization
115+
116+
- Group imports: built-in, external, internal, parent, sibling, index
117+
- Alphabetical order within groups
118+
- No unused imports or variables
119+
- Consistent type imports with `import type`
120+
121+
### Naming Conventions
122+
123+
- **Classes**: PascalCase (no I prefix for interfaces)
124+
- **Methods/Variables**: camelCase
125+
- **Constants**: camelCase for module-level constants
126+
- **Private members**: Leading underscore allowed
127+
- **Files**: `camelCase.ts`, `camelCase.utils.ts` for related utilities
128+
- **Folders**
129+
- Models under a `models/` sub-folder
130+
- Utilities under a `utils/` sub-folder if they can be used in both the extension host and webviews, or `utils/-webview/` sub-folder for extension host-specific utilities
131+
132+
### Code Structure
133+
134+
- **Single responsibility** - Each service has focused purpose
135+
- **Dependency injection** - Services injected via Container
136+
- **Event-driven** - EventEmitter pattern for service communication
137+
- **Disposable pattern** - Proper cleanup with VS Code `Disposable` interface
138+
139+
### Error Handling
140+
141+
- Use custom error types extending Error
142+
- Log errors with context using `Logger.error()`
143+
- Graceful degradation for network/API failures
144+
- Validate external data with schema validators
145+
146+
## Repository Guidelines
147+
148+
### Commit Messages
149+
150+
- Use a future-oriented manner, third-person singular present tense (e.g., 'Fixes', 'Updates', 'Improves', 'Adds', 'Removes')
151+
- Reference issues with #123 syntax for auto-linking
152+
- Keep first line under 72 characters
153+
154+
### Branch Workflow
155+
156+
- Feature branches from main
157+
- Prefix with feature type: feature/, bug/, debt/
158+
- Use descriptive names: feature/search-natural-language
159+
160+
### Code Reviews
161+
162+
- Check TypeScript compilation and tests pass
163+
- Verify no new ESLint violations
164+
165+
## Development Environment
166+
167+
### Prerequisites
168+
169+
- Node.js ≥ 22.12.0
170+
- pnpm ≥ 10.x (via corepack)
171+
- Git ≥ 2.7.2
172+
173+
### VS Code Tasks
174+
175+
- Build - `Ctrl+Shift+P` → "Tasks: Run Task" → "npm: watch"
176+
- Test - Use VS Code's built-in test runner
177+
- Debug - `F5` to launch Extension Development Host

0 commit comments

Comments
 (0)