cap-core 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,363 @@
1
+ Metadata-Version: 2.4
2
+ Name: cap-core
3
+ Version: 1.0.0
4
+ Summary: CAP Core: Codebase-Awareness Protocol parsing library
5
+ Author-email: Domas Leščinskas <domas.lescinskas@gmail.com>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/domasles/cap
8
+ Project-URL: Bug Reports, https://github.com/domasles/cap/issues
9
+ Project-URL: Source, https://github.com/domasles/cap
10
+ Project-URL: Documentation, https://github.com/domasles/cap#readme
11
+ Keywords: ai,mcp,codebase,documentation,developer-tools,parsing
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: Software Development :: Libraries
15
+ Classifier: Topic :: Software Development :: Documentation
16
+ Classifier: Topic :: Software Development :: Code Generators
17
+ Classifier: License :: OSI Approved :: Apache Software License
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Operating System :: OS Independent
23
+ Requires-Python: >=3.11
24
+ Description-Content-Type: text/markdown
25
+ Requires-Dist: pyyaml>=6.0.3
26
+ Requires-Dist: pydantic>=2.12.5
27
+
28
+ # CAP
29
+
30
+ **Codebase Awareness Protocol**
31
+
32
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
33
+ [![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
34
+ [![Python: ≥3.11](https://img.shields.io/badge/python-≥3.11-3776ab.svg)](https://python.org)
35
+ [![Node.js: ≥20](https://img.shields.io/badge/node.js-≥20-339933.svg)](https://nodejs.org)
36
+ [![VS Code: ≥1.109.0](https://img.shields.io/badge/vscode-≥1.109.0-007acc.svg)](https://code.visualstudio.com/)
37
+
38
+ > Give AI coding agents the context they need - architecture, dependencies, and API - so they stop guessing and start respecting your codebase.
39
+
40
+ ---
41
+
42
+ ## Philosophy
43
+
44
+ AI coding agents are powerful, but they are blind. They see files, not architecture. They read imports, not intent. Without explicit context, they silently violate boundaries, import forbidden packages, and ignore the structure you spent months building.
45
+
46
+ **CAP fixes this.** You describe your codebase once in three small YAML files. CAP serves that knowledge to any AI agent through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/), the open standard for connecting AI to tools.
47
+
48
+ The result: agents that understand your layers, respect your dependency rules, and use your public API - without you repeating yourself in every prompt.
49
+
50
+ ### Three principles
51
+
52
+ 1. **Declarative over discovery** - You know your codebase better than static analysis. Write it down once, in plain YAML.
53
+ 2. **Protocol over prompts** - Structured MCP tool responses beat pasted context every time.
54
+ 3. **Zero lock-in** - YAML files live in your repo. No SaaS, no accounts, no telemetry.
55
+
56
+ ---
57
+
58
+ ## Getting Started
59
+
60
+ ### VS Code Extension (recommended)
61
+
62
+ The fastest path. The extension handles Python, installs CAP, runs the MCP server, and connects it to your AI agent - all automatically.
63
+
64
+ **1. Install the extension**
65
+
66
+ Search for **"CAP - Codebase Awareness Protocol"** in the VS Code Extensions Marketplace, or install from the command line:
67
+
68
+ ```
69
+ code --install-extension domasles.cap-vscode
70
+ ```
71
+
72
+ **2. Initialize your workspace**
73
+
74
+ Open the Command Palette (`Ctrl+Shift+P`) and run:
75
+
76
+ ```
77
+ CAP: Initialize Configuration
78
+ ```
79
+
80
+ This creates a `.cap/` directory with three template files:
81
+
82
+ ```
83
+ .cap/
84
+ ├── api.yaml # What your code exports
85
+ ├── architecture.yaml # How your code is organized
86
+ └── dependencies.yaml # What your code depends on
87
+ ```
88
+
89
+ Edit them to match your project. That's all the setup you need.
90
+
91
+ **3. Enable the MCP server**
92
+
93
+ When `.cap/` is created, the extension shows a notification prompting you to enable the MCP server. Click **Open Chat** to go to the Copilot panel, then enable the **CAP** server in the MCP tools list.
94
+
95
+ Once enabled, every AI agent conversation has access to three tools:
96
+
97
+ | Tool | What the agent gets |
98
+ |---|---|
99
+ | `get_architecture` | Layers, modules, ownership, architectural rules |
100
+ | `get_dependencies` | Runtime/dev packages, versions, forbidden patterns |
101
+ | `get_api` | Public/internal exports, stability, access rules |
102
+
103
+ The agent calls these tools when it needs context. You don't need to prompt for it.
104
+
105
+ ### CLI
106
+
107
+ If you prefer working from the terminal or want CAP without VS Code:
108
+
109
+ ```bash
110
+ pip install cap-cli
111
+ ```
112
+
113
+ **Initialize:**
114
+
115
+ ```bash
116
+ cap init # Create .cap/ with templates
117
+ cap init --minimal # Bare minimum scaffolding
118
+ cap init --force # Overwrite existing files
119
+ ```
120
+
121
+ **Validate your configuration:**
122
+
123
+ ```bash
124
+ cap validate # Pretty terminal output
125
+ cap validate --json # Machine-readable for CI
126
+ ```
127
+
128
+ **Start the MCP server:**
129
+
130
+ ```bash
131
+ cap serve
132
+ ```
133
+
134
+ This runs a [stdio MCP server](https://modelcontextprotocol.io/docs/concepts/transports#standard-io-stdio) that any MCP-compatible client can connect to. Point your AI tool at the `cap serve` command and it will discover the three tools automatically.
135
+
136
+ ---
137
+
138
+ ## The `.cap/` Files
139
+
140
+ ### `architecture.yaml`
141
+
142
+ Defines the structural skeleton of your codebase.
143
+
144
+ ```yaml
145
+ architecture:
146
+ style: "hexagonal"
147
+
148
+ layers:
149
+ domain:
150
+ owns: "src/domain/**"
151
+ may_import: []
152
+
153
+ application:
154
+ owns: "src/application/**"
155
+ may_import:
156
+ - "domain"
157
+
158
+ infrastructure:
159
+ owns: "src/infrastructure/**"
160
+ may_import:
161
+ - "domain"
162
+
163
+ modules:
164
+ core:
165
+ owns: "src/core/**"
166
+ purpose: "Core business logic and domain models"
167
+
168
+ rules:
169
+ forbid:
170
+ - path: "src/domain/**"
171
+ calls: "requests.get"
172
+ reason: "Domain must not make HTTP calls"
173
+ ```
174
+
175
+ ### `dependencies.yaml`
176
+
177
+ Lists every dependency with its purpose and defines what layers cannot use.
178
+
179
+ ```yaml
180
+ dependencies:
181
+ python:
182
+ runtime:
183
+ pydantic:
184
+ version: ">=2.0"
185
+ reason: "Data validation using type annotations"
186
+ dev:
187
+ pytest:
188
+ version: ">=7.0"
189
+ reason: "Testing framework"
190
+
191
+ rules:
192
+ forbid:
193
+ - layer: "domain"
194
+ dependency: "requests"
195
+ reason: "Domain should not make HTTP calls directly"
196
+
197
+ notes:
198
+ - "Prefer standard library when possible"
199
+ ```
200
+
201
+ ### `api.yaml`
202
+
203
+ Maps what your code exports and who should use it.
204
+
205
+ ```yaml
206
+ api:
207
+ public:
208
+ core:
209
+ location: "src/api.py"
210
+ exports:
211
+ - "initialize"
212
+ - "process_data"
213
+ stability: "stable"
214
+
215
+ internal:
216
+ utilities:
217
+ location: "src/utils/**"
218
+ exports:
219
+ - "helper_function"
220
+ stability: "experimental"
221
+ warning: "Internal only - use the public API instead"
222
+
223
+ rules:
224
+ forbid:
225
+ - path: "src/plugins/**"
226
+ api: "internal.utilities"
227
+ reason: "Plugins must use the public API"
228
+ ```
229
+
230
+ All fields are validated with strict schemas. Unknown keys are rejected. Run `cap validate` to catch mistakes before your agent does.
231
+
232
+ ---
233
+
234
+ ## Architecture
235
+
236
+ CAP itself follows hexagonal architecture. The monorepo contains three packages with a strict one-way dependency flow:
237
+
238
+ ```
239
+ Dependency flow: cli -> mcp -> core. Never the reverse.
240
+ ```
241
+
242
+ ```
243
+ cap/
244
+ ├── core/ # cap-core - parsing, validation, formatting
245
+ │ └── cap_core/
246
+ │ ├── domain/ # Pydantic models - pure data, no I/O
247
+ │ │ └── models/
248
+ │ ├── infrastructure/ # FileReader - the only class that touches disk
249
+ │ └── application/ # ConfigService, ValidationService, MCPFormatter
250
+ │ └── services/
251
+ ├── mcp/ # cap-mcp - FastMCP server with stdio transport
252
+ │ └── cap_mcp/
253
+ │ ├── server.py # Composition root - wires ConfigService into tools
254
+ │ └── tools/ # One file per MCP tool
255
+ ├── shells/
256
+ │ ├── cli/ # cap-cli - click-based CLI
257
+ │ │ └── cap_cli/
258
+ │ │ ├── commands/ # init, serve, validate
259
+ │ │ ├── templates/ # Default .cap/ YAML files
260
+ │ │ └── utils/ # Workspace detection, output helpers
261
+ │ └── vscode/ # VS Code extension - TypeScript
262
+ │ └── src/
263
+ │ ├── setup/ # Python discovery, venv management, updates
264
+ │ ├── cap/ # CLI runner, init commands, validation
265
+ │ ├── mcp/ # MCP server provider, enable notice
266
+ │ └── utils/ # Shared workspace/venv/watcher helpers
267
+ └── .cap/ # CAP's own configuration (we eat our own dogfood)
268
+ ```
269
+
270
+ ### Key design decisions
271
+
272
+ - **Domain models are pure data.** Pydantic `BaseModel` subclasses with `extra="forbid"` - no I/O, no side effects, strict validation.
273
+ - **`ConfigService` is the main facade.** All config loading goes through it. Shells never touch `FileReader` directly.
274
+ - **One MCP tool per file.** Each tool module exposes a `register(mcp, config_service)` function.
275
+ - **The VS Code extension calls `cap` as a subprocess.** It never imports Python - it installs `cap-cli` into an isolated venv and runs commands through it.
276
+
277
+ ---
278
+
279
+ ## Development
280
+
281
+ ### Prerequisites
282
+
283
+ - **Python** ≥ 3.11
284
+ - **Node.js** ≥ 20 (VS Code extension only)
285
+ - **VS Code** ≥ 1.109.0 (VS Code extension only)
286
+ - **Git** (for version control integration)
287
+
288
+ ### Setup
289
+
290
+ Clone and install all packages in editable mode:
291
+
292
+ ```bash
293
+ git clone https://github.com/domasles/cap.git
294
+ cd cap
295
+
296
+ pip install -e core/
297
+ pip install -e mcp/
298
+ pip install -e shells/cli/
299
+ ```
300
+
301
+ Verify everything works:
302
+
303
+ ```bash
304
+ cap --version
305
+ cap validate
306
+ ```
307
+
308
+ ### VS Code Extension Development
309
+
310
+ ```bash
311
+ cd shells/vscode
312
+ npm install
313
+ npm run build
314
+ ```
315
+
316
+ Press `F5` in VS Code to launch the Extension Development Host. In dev mode, the extension skips venv setup and expects `cap` to be installed on your PATH (from the editable installs above).
317
+
318
+ ### Project structure cheat sheet
319
+
320
+ | Package | Language | Entry point | Install |
321
+ |---|---|---|---|
322
+ | cap-core | Python | `cap_core.ConfigService` | `pip install -e core/` |
323
+ | cap-mcp | Python | `cap_mcp.create_server()` | `pip install -e mcp/` |
324
+ | cap-cli | Python | `cap` CLI command | `pip install -e shells/cli/` |
325
+ | cap-vscode | TypeScript | `src/extension.ts` | `npm install` in `shells/vscode/` |
326
+
327
+ ### Running tests
328
+
329
+ ```bash
330
+ cap validate --json # Validate .cap/ files
331
+ ```
332
+
333
+ ### Adding a new shell
334
+
335
+ CAP is designed to be extended with new shells (IDE plugins, web UIs, etc.). A shell:
336
+
337
+ 1. Calls `cap` CLI commands as a subprocess - it does not import core or mcp directly
338
+ 2. Never adds logic to core - it only wires CLI output into its own UI
339
+ 3. Lives in `shells/<name>/`
340
+ 4. Gets its own build system and entry point
341
+
342
+ ---
343
+
344
+ ## Contributing
345
+
346
+ Contributions are welcome. Before you start:
347
+
348
+ 1. **Open an issue first** for non-trivial changes so we can discuss the approach.
349
+ 2. **Run `cap validate`** to make sure your `.cap/` files are correct.
350
+ 3. **Respect the architecture.** The layer rules in `architecture.yaml` aren't suggestions - they're the contract.
351
+ 4. **Keep the dependency flow.** `cli -> mcp -> core`. If you find yourself importing from a shell into core, stop and rethink.
352
+
353
+ ### Style
354
+
355
+ - Python: [Black](https://github.com/psf/black) formatter, type hints everywhere
356
+ - TypeScript: Strict mode, no `any`
357
+ - YAML: 2-space indent, comments for anything non-obvious
358
+
359
+ ---
360
+
361
+ ## License
362
+
363
+ [Apache License 2.0](LICENSE)
@@ -0,0 +1,336 @@
1
+ # CAP
2
+
3
+ **Codebase Awareness Protocol**
4
+
5
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
6
+ [![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
7
+ [![Python: ≥3.11](https://img.shields.io/badge/python-≥3.11-3776ab.svg)](https://python.org)
8
+ [![Node.js: ≥20](https://img.shields.io/badge/node.js-≥20-339933.svg)](https://nodejs.org)
9
+ [![VS Code: ≥1.109.0](https://img.shields.io/badge/vscode-≥1.109.0-007acc.svg)](https://code.visualstudio.com/)
10
+
11
+ > Give AI coding agents the context they need - architecture, dependencies, and API - so they stop guessing and start respecting your codebase.
12
+
13
+ ---
14
+
15
+ ## Philosophy
16
+
17
+ AI coding agents are powerful, but they are blind. They see files, not architecture. They read imports, not intent. Without explicit context, they silently violate boundaries, import forbidden packages, and ignore the structure you spent months building.
18
+
19
+ **CAP fixes this.** You describe your codebase once in three small YAML files. CAP serves that knowledge to any AI agent through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/), the open standard for connecting AI to tools.
20
+
21
+ The result: agents that understand your layers, respect your dependency rules, and use your public API - without you repeating yourself in every prompt.
22
+
23
+ ### Three principles
24
+
25
+ 1. **Declarative over discovery** - You know your codebase better than static analysis. Write it down once, in plain YAML.
26
+ 2. **Protocol over prompts** - Structured MCP tool responses beat pasted context every time.
27
+ 3. **Zero lock-in** - YAML files live in your repo. No SaaS, no accounts, no telemetry.
28
+
29
+ ---
30
+
31
+ ## Getting Started
32
+
33
+ ### VS Code Extension (recommended)
34
+
35
+ The fastest path. The extension handles Python, installs CAP, runs the MCP server, and connects it to your AI agent - all automatically.
36
+
37
+ **1. Install the extension**
38
+
39
+ Search for **"CAP - Codebase Awareness Protocol"** in the VS Code Extensions Marketplace, or install from the command line:
40
+
41
+ ```
42
+ code --install-extension domasles.cap-vscode
43
+ ```
44
+
45
+ **2. Initialize your workspace**
46
+
47
+ Open the Command Palette (`Ctrl+Shift+P`) and run:
48
+
49
+ ```
50
+ CAP: Initialize Configuration
51
+ ```
52
+
53
+ This creates a `.cap/` directory with three template files:
54
+
55
+ ```
56
+ .cap/
57
+ ├── api.yaml # What your code exports
58
+ ├── architecture.yaml # How your code is organized
59
+ └── dependencies.yaml # What your code depends on
60
+ ```
61
+
62
+ Edit them to match your project. That's all the setup you need.
63
+
64
+ **3. Enable the MCP server**
65
+
66
+ When `.cap/` is created, the extension shows a notification prompting you to enable the MCP server. Click **Open Chat** to go to the Copilot panel, then enable the **CAP** server in the MCP tools list.
67
+
68
+ Once enabled, every AI agent conversation has access to three tools:
69
+
70
+ | Tool | What the agent gets |
71
+ |---|---|
72
+ | `get_architecture` | Layers, modules, ownership, architectural rules |
73
+ | `get_dependencies` | Runtime/dev packages, versions, forbidden patterns |
74
+ | `get_api` | Public/internal exports, stability, access rules |
75
+
76
+ The agent calls these tools when it needs context. You don't need to prompt for it.
77
+
78
+ ### CLI
79
+
80
+ If you prefer working from the terminal or want CAP without VS Code:
81
+
82
+ ```bash
83
+ pip install cap-cli
84
+ ```
85
+
86
+ **Initialize:**
87
+
88
+ ```bash
89
+ cap init # Create .cap/ with templates
90
+ cap init --minimal # Bare minimum scaffolding
91
+ cap init --force # Overwrite existing files
92
+ ```
93
+
94
+ **Validate your configuration:**
95
+
96
+ ```bash
97
+ cap validate # Pretty terminal output
98
+ cap validate --json # Machine-readable for CI
99
+ ```
100
+
101
+ **Start the MCP server:**
102
+
103
+ ```bash
104
+ cap serve
105
+ ```
106
+
107
+ This runs a [stdio MCP server](https://modelcontextprotocol.io/docs/concepts/transports#standard-io-stdio) that any MCP-compatible client can connect to. Point your AI tool at the `cap serve` command and it will discover the three tools automatically.
108
+
109
+ ---
110
+
111
+ ## The `.cap/` Files
112
+
113
+ ### `architecture.yaml`
114
+
115
+ Defines the structural skeleton of your codebase.
116
+
117
+ ```yaml
118
+ architecture:
119
+ style: "hexagonal"
120
+
121
+ layers:
122
+ domain:
123
+ owns: "src/domain/**"
124
+ may_import: []
125
+
126
+ application:
127
+ owns: "src/application/**"
128
+ may_import:
129
+ - "domain"
130
+
131
+ infrastructure:
132
+ owns: "src/infrastructure/**"
133
+ may_import:
134
+ - "domain"
135
+
136
+ modules:
137
+ core:
138
+ owns: "src/core/**"
139
+ purpose: "Core business logic and domain models"
140
+
141
+ rules:
142
+ forbid:
143
+ - path: "src/domain/**"
144
+ calls: "requests.get"
145
+ reason: "Domain must not make HTTP calls"
146
+ ```
147
+
148
+ ### `dependencies.yaml`
149
+
150
+ Lists every dependency with its purpose and defines what layers cannot use.
151
+
152
+ ```yaml
153
+ dependencies:
154
+ python:
155
+ runtime:
156
+ pydantic:
157
+ version: ">=2.0"
158
+ reason: "Data validation using type annotations"
159
+ dev:
160
+ pytest:
161
+ version: ">=7.0"
162
+ reason: "Testing framework"
163
+
164
+ rules:
165
+ forbid:
166
+ - layer: "domain"
167
+ dependency: "requests"
168
+ reason: "Domain should not make HTTP calls directly"
169
+
170
+ notes:
171
+ - "Prefer standard library when possible"
172
+ ```
173
+
174
+ ### `api.yaml`
175
+
176
+ Maps what your code exports and who should use it.
177
+
178
+ ```yaml
179
+ api:
180
+ public:
181
+ core:
182
+ location: "src/api.py"
183
+ exports:
184
+ - "initialize"
185
+ - "process_data"
186
+ stability: "stable"
187
+
188
+ internal:
189
+ utilities:
190
+ location: "src/utils/**"
191
+ exports:
192
+ - "helper_function"
193
+ stability: "experimental"
194
+ warning: "Internal only - use the public API instead"
195
+
196
+ rules:
197
+ forbid:
198
+ - path: "src/plugins/**"
199
+ api: "internal.utilities"
200
+ reason: "Plugins must use the public API"
201
+ ```
202
+
203
+ All fields are validated with strict schemas. Unknown keys are rejected. Run `cap validate` to catch mistakes before your agent does.
204
+
205
+ ---
206
+
207
+ ## Architecture
208
+
209
+ CAP itself follows hexagonal architecture. The monorepo contains three packages with a strict one-way dependency flow:
210
+
211
+ ```
212
+ Dependency flow: cli -> mcp -> core. Never the reverse.
213
+ ```
214
+
215
+ ```
216
+ cap/
217
+ ├── core/ # cap-core - parsing, validation, formatting
218
+ │ └── cap_core/
219
+ │ ├── domain/ # Pydantic models - pure data, no I/O
220
+ │ │ └── models/
221
+ │ ├── infrastructure/ # FileReader - the only class that touches disk
222
+ │ └── application/ # ConfigService, ValidationService, MCPFormatter
223
+ │ └── services/
224
+ ├── mcp/ # cap-mcp - FastMCP server with stdio transport
225
+ │ └── cap_mcp/
226
+ │ ├── server.py # Composition root - wires ConfigService into tools
227
+ │ └── tools/ # One file per MCP tool
228
+ ├── shells/
229
+ │ ├── cli/ # cap-cli - click-based CLI
230
+ │ │ └── cap_cli/
231
+ │ │ ├── commands/ # init, serve, validate
232
+ │ │ ├── templates/ # Default .cap/ YAML files
233
+ │ │ └── utils/ # Workspace detection, output helpers
234
+ │ └── vscode/ # VS Code extension - TypeScript
235
+ │ └── src/
236
+ │ ├── setup/ # Python discovery, venv management, updates
237
+ │ ├── cap/ # CLI runner, init commands, validation
238
+ │ ├── mcp/ # MCP server provider, enable notice
239
+ │ └── utils/ # Shared workspace/venv/watcher helpers
240
+ └── .cap/ # CAP's own configuration (we eat our own dogfood)
241
+ ```
242
+
243
+ ### Key design decisions
244
+
245
+ - **Domain models are pure data.** Pydantic `BaseModel` subclasses with `extra="forbid"` - no I/O, no side effects, strict validation.
246
+ - **`ConfigService` is the main facade.** All config loading goes through it. Shells never touch `FileReader` directly.
247
+ - **One MCP tool per file.** Each tool module exposes a `register(mcp, config_service)` function.
248
+ - **The VS Code extension calls `cap` as a subprocess.** It never imports Python - it installs `cap-cli` into an isolated venv and runs commands through it.
249
+
250
+ ---
251
+
252
+ ## Development
253
+
254
+ ### Prerequisites
255
+
256
+ - **Python** ≥ 3.11
257
+ - **Node.js** ≥ 20 (VS Code extension only)
258
+ - **VS Code** ≥ 1.109.0 (VS Code extension only)
259
+ - **Git** (for version control integration)
260
+
261
+ ### Setup
262
+
263
+ Clone and install all packages in editable mode:
264
+
265
+ ```bash
266
+ git clone https://github.com/domasles/cap.git
267
+ cd cap
268
+
269
+ pip install -e core/
270
+ pip install -e mcp/
271
+ pip install -e shells/cli/
272
+ ```
273
+
274
+ Verify everything works:
275
+
276
+ ```bash
277
+ cap --version
278
+ cap validate
279
+ ```
280
+
281
+ ### VS Code Extension Development
282
+
283
+ ```bash
284
+ cd shells/vscode
285
+ npm install
286
+ npm run build
287
+ ```
288
+
289
+ Press `F5` in VS Code to launch the Extension Development Host. In dev mode, the extension skips venv setup and expects `cap` to be installed on your PATH (from the editable installs above).
290
+
291
+ ### Project structure cheat sheet
292
+
293
+ | Package | Language | Entry point | Install |
294
+ |---|---|---|---|
295
+ | cap-core | Python | `cap_core.ConfigService` | `pip install -e core/` |
296
+ | cap-mcp | Python | `cap_mcp.create_server()` | `pip install -e mcp/` |
297
+ | cap-cli | Python | `cap` CLI command | `pip install -e shells/cli/` |
298
+ | cap-vscode | TypeScript | `src/extension.ts` | `npm install` in `shells/vscode/` |
299
+
300
+ ### Running tests
301
+
302
+ ```bash
303
+ cap validate --json # Validate .cap/ files
304
+ ```
305
+
306
+ ### Adding a new shell
307
+
308
+ CAP is designed to be extended with new shells (IDE plugins, web UIs, etc.). A shell:
309
+
310
+ 1. Calls `cap` CLI commands as a subprocess - it does not import core or mcp directly
311
+ 2. Never adds logic to core - it only wires CLI output into its own UI
312
+ 3. Lives in `shells/<name>/`
313
+ 4. Gets its own build system and entry point
314
+
315
+ ---
316
+
317
+ ## Contributing
318
+
319
+ Contributions are welcome. Before you start:
320
+
321
+ 1. **Open an issue first** for non-trivial changes so we can discuss the approach.
322
+ 2. **Run `cap validate`** to make sure your `.cap/` files are correct.
323
+ 3. **Respect the architecture.** The layer rules in `architecture.yaml` aren't suggestions - they're the contract.
324
+ 4. **Keep the dependency flow.** `cli -> mcp -> core`. If you find yourself importing from a shell into core, stop and rethink.
325
+
326
+ ### Style
327
+
328
+ - Python: [Black](https://github.com/psf/black) formatter, type hints everywhere
329
+ - TypeScript: Strict mode, no `any`
330
+ - YAML: 2-space indent, comments for anything non-obvious
331
+
332
+ ---
333
+
334
+ ## License
335
+
336
+ [Apache License 2.0](LICENSE)