You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+96-3Lines changed: 96 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,62 +1,80 @@
1
-
# CLAUDE.md
1
+
# AGENTS.md
2
2
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.
4
5
5
6
## Project Overview
6
7
7
8
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.
8
9
9
10
## Common Commands
10
11
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
+
11
18
### Development
19
+
12
20
-`pnpm run build` - Build extension in development mode
13
21
-`pnpm run bundle` - Build extension for production
14
22
-`pnpm run watch` - Watch mode for development
15
23
-`pnpm run clean` - Clean build artifacts
16
24
17
25
### Code Quality
26
+
18
27
-`pnpm run lint` - Run ESLint on TypeScript files
19
28
-`pnpm run lint:fix` - Run ESLint with auto-fix
20
29
-`pnpm run format` - Format code with Prettier
21
30
-`pnpm run format:check` - Check code formatting
22
31
23
32
### Packaging & Publishing
33
+
24
34
-`pnpm run package` - Create VSIX package
25
35
-`pnpm run package-pre` - Create pre-release VSIX package
26
36
-`pnpm run pub` - Publish to marketplace
27
37
-`pnpm run pub-pre` - Publish pre-release to marketplace
38
+
-`pnpm run generate:licenses` - Generate license files
28
39
29
40
## Architecture Overview
30
41
31
42
### Core Components
32
43
33
44
**Extension Entry Point** (`src/extension.ts`):
45
+
34
46
- Main activation point that initializes logging, configuration, and container
35
47
- Sets up the dependency injection container and registers commands
36
48
37
49
**Container** (`src/container.ts`):
50
+
38
51
- Dependency injection container managing all services and providers
39
52
- Central point for service resolution and lifecycle management
40
53
41
54
**MCP Provider** (`src/mcp/provider.ts`):
55
+
42
56
- Core MCP server implementation providing web component data
43
57
- Serves HTTP and SSE endpoints for AI assistant integration
-`wcai.manifests.exclude` - Array of manifest URIs to exclude
76
95
-`wcai.mcp.host/port` - MCP server network configuration
@@ -81,4 +100,78 @@ The extension uses VS Code settings under the `wcai.*` namespace:
81
100
- Uses Webpack with TypeScript compilation
82
101
- Node.js target for main extension code
83
102
- 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
0 commit comments