bc-code-intelligence-mcp 1.4.5 → 1.5.1
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.
- package/dist/config/config-loader.d.ts.map +1 -1
- package/dist/config/config-loader.js +33 -1
- package/dist/config/config-loader.js.map +1 -1
- package/dist/config/config-validator.d.ts.map +1 -1
- package/dist/config/config-validator.js +5 -1
- package/dist/config/config-validator.js.map +1 -1
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +193 -17
- package/dist/index.js.map +1 -1
- package/dist/layers/base-layer.d.ts +41 -17
- package/dist/layers/base-layer.d.ts.map +1 -1
- package/dist/layers/base-layer.js +103 -41
- package/dist/layers/base-layer.js.map +1 -1
- package/dist/layers/embedded-layer.d.ts +5 -2
- package/dist/layers/embedded-layer.d.ts.map +1 -1
- package/dist/layers/embedded-layer.js +16 -3
- package/dist/layers/embedded-layer.js.map +1 -1
- package/dist/layers/git-layer.d.ts +16 -1
- package/dist/layers/git-layer.d.ts.map +1 -1
- package/dist/layers/git-layer.js +118 -10
- package/dist/layers/git-layer.js.map +1 -1
- package/dist/layers/project-layer.d.ts +8 -0
- package/dist/layers/project-layer.d.ts.map +1 -1
- package/dist/layers/project-layer.js +33 -3
- package/dist/layers/project-layer.js.map +1 -1
- package/dist/services/methodology-service.d.ts.map +1 -1
- package/dist/services/methodology-service.js +5 -1
- package/dist/services/methodology-service.js.map +1 -1
- package/dist/services/multi-content-layer-service.d.ts +13 -0
- package/dist/services/multi-content-layer-service.d.ts.map +1 -1
- package/dist/services/multi-content-layer-service.js +59 -3
- package/dist/services/multi-content-layer-service.js.map +1 -1
- package/dist/services/roleplay-engine.d.ts.map +1 -1
- package/dist/services/roleplay-engine.js +4 -4
- package/dist/services/roleplay-engine.js.map +1 -1
- package/dist/tools/specialist-tools.d.ts.map +1 -1
- package/dist/tools/specialist-tools.js +7 -1
- package/dist/tools/specialist-tools.js.map +1 -1
- package/dist/tools/workspace-tools.d.ts +96 -0
- package/dist/tools/workspace-tools.d.ts.map +1 -0
- package/dist/tools/workspace-tools.js +188 -0
- package/dist/tools/workspace-tools.js.map +1 -0
- package/dist/types/bc-knowledge.d.ts +6 -0
- package/dist/types/bc-knowledge.d.ts.map +1 -1
- package/dist/types/bc-knowledge.js +3 -0
- package/dist/types/bc-knowledge.js.map +1 -1
- package/dist/types/config-types.d.ts +1 -0
- package/dist/types/config-types.d.ts.map +1 -1
- package/dist/types/config-types.js +2 -0
- package/dist/types/config-types.js.map +1 -1
- package/embedded-knowledge/domains/alex-architect/object-id-ninja-integration.md +281 -0
- package/embedded-knowledge/domains/alex-architect/recommend-object-id-ninja.md +248 -0
- package/embedded-knowledge/domains/chris-config/configuration-file-discovery.md +444 -0
- package/embedded-knowledge/domains/chris-config/configuration-file-formats.md +540 -0
- package/embedded-knowledge/domains/chris-config/content-types-structure.md +421 -0
- package/embedded-knowledge/domains/chris-config/layer-system-fundamentals.md +257 -0
- package/embedded-knowledge/domains/chris-config/workspace-detection-solutions.md +336 -0
- package/embedded-knowledge/domains/dean-debug/bc-telemetry-buddy-integration.md +453 -0
- package/embedded-knowledge/domains/dean-debug/recommend-bc-telemetry-buddy.md +160 -0
- package/embedded-knowledge/specialists/chris-config.md +96 -464
- package/embedded-knowledge/specialists/dean-debug.md +55 -0
- package/package.json +1 -1
- package/dist/services/agent-onboarding-service.d.ts +0 -45
- package/dist/services/agent-onboarding-service.d.ts.map +0 -1
- package/dist/services/agent-onboarding-service.js +0 -372
- package/dist/services/agent-onboarding-service.js.map +0 -1
- package/dist/services/specialist-handoff-service.d.ts +0 -85
- package/dist/services/specialist-handoff-service.d.ts.map +0 -1
- package/dist/services/specialist-handoff-service.js +0 -492
- package/dist/services/specialist-handoff-service.js.map +0 -1
- package/dist/streamlined-tools.d.ts +0 -328
- package/dist/streamlined-tools.d.ts.map +0 -1
- package/dist/streamlined-tools.js +0 -201
- package/dist/streamlined-tools.js.map +0 -1
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Content Types Structure"
|
|
3
|
+
domain: "chris-config"
|
|
4
|
+
bc_versions: "1.5.0+"
|
|
5
|
+
difficulty: "intermediate"
|
|
6
|
+
tags: ["mcp-configuration", "content-types", "yaml-frontmatter", "knowledge-structure"]
|
|
7
|
+
related_topics:
|
|
8
|
+
- "layer-system-fundamentals.md"
|
|
9
|
+
- "git-layer-configuration.md"
|
|
10
|
+
- "company-layer-setup.md"
|
|
11
|
+
applies_to:
|
|
12
|
+
- "BC Code Intelligence MCP Server"
|
|
13
|
+
- "Knowledge Layer Architecture"
|
|
14
|
+
last_updated: "2025-10-27"
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Content Types Structure
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
|
|
21
|
+
The BC Code Intelligence MCP server (v1.5.0+) supports **three universal content types** across all knowledge layers: Topics, Specialists, and Methodologies. Each content type has specific format requirements and directory placement.
|
|
22
|
+
|
|
23
|
+
## The Three Content Types
|
|
24
|
+
|
|
25
|
+
### **1. Topics** - BC Domain Knowledge
|
|
26
|
+
- **Purpose**: Atomic BC development knowledge and patterns
|
|
27
|
+
- **Location**: `domains/[domain-name]/` subdirectories
|
|
28
|
+
- **Format**: Markdown with YAML frontmatter
|
|
29
|
+
- **Examples**: Performance patterns, API design, security concepts
|
|
30
|
+
|
|
31
|
+
### **2. Specialists** - AI Persona Definitions
|
|
32
|
+
- **Purpose**: AI expert personalities with domain expertise
|
|
33
|
+
- **Location**: `specialists/` directory
|
|
34
|
+
- **Format**: Markdown with comprehensive YAML frontmatter
|
|
35
|
+
- **Examples**: sam-coder, dean-debug, chris-config
|
|
36
|
+
|
|
37
|
+
### **3. Methodologies** - Systematic Workflows
|
|
38
|
+
- **Purpose**: Multi-phase guided workflows for complex tasks
|
|
39
|
+
- **Location**: `methodologies/` directory
|
|
40
|
+
- **Format**: Structured workflow definitions
|
|
41
|
+
- **Examples**: Performance optimization, architecture review
|
|
42
|
+
|
|
43
|
+
## Directory Structure
|
|
44
|
+
|
|
45
|
+
All knowledge layers must follow this structure:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
layer-root/
|
|
49
|
+
├── domains/ # Topics by domain
|
|
50
|
+
│ ├── performance/
|
|
51
|
+
│ │ ├── caching-strategies.md
|
|
52
|
+
│ │ └── query-optimization.md
|
|
53
|
+
│ ├── api-design/
|
|
54
|
+
│ │ ├── rest-api-patterns.md
|
|
55
|
+
│ │ └── pagination-strategies.md
|
|
56
|
+
│ └── [other-domains]/
|
|
57
|
+
├── specialists/ # AI specialist definitions
|
|
58
|
+
│ ├── sam-coder.md
|
|
59
|
+
│ ├── dean-debug.md
|
|
60
|
+
│ ├── chris-config.md
|
|
61
|
+
│ └── [other-specialists].md
|
|
62
|
+
└── methodologies/ # Systematic workflows
|
|
63
|
+
├── optimize-performance/
|
|
64
|
+
│ ├── phases/
|
|
65
|
+
│ └── workflow.json
|
|
66
|
+
└── [other-workflows]/
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Critical:** Git layers only load content from these specific subdirectories.
|
|
70
|
+
|
|
71
|
+
## Topics Format (BC Domain Knowledge)
|
|
72
|
+
|
|
73
|
+
### **YAML Frontmatter (Required)**
|
|
74
|
+
|
|
75
|
+
```yaml
|
|
76
|
+
---
|
|
77
|
+
title: "Descriptive Topic Title"
|
|
78
|
+
domain: "performance|api-design|security|etc"
|
|
79
|
+
bc_versions: "14+|18+|19+|specific-range"
|
|
80
|
+
difficulty: "beginner|intermediate|advanced"
|
|
81
|
+
tags: ["tag1", "tag2", "tag3"]
|
|
82
|
+
related_topics:
|
|
83
|
+
- "../other-domain/related-topic.md"
|
|
84
|
+
- "another-topic.md"
|
|
85
|
+
applies_to:
|
|
86
|
+
- "AL Language"
|
|
87
|
+
- "Business Central Server"
|
|
88
|
+
- "Web Client"
|
|
89
|
+
last_updated: "2025-10-27"
|
|
90
|
+
---
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### **Content Structure**
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
# Topic Title
|
|
97
|
+
|
|
98
|
+
## Overview
|
|
99
|
+
2-3 sentence summary of the concept
|
|
100
|
+
|
|
101
|
+
## Implementation Details
|
|
102
|
+
Step-by-step guidance with BC code examples
|
|
103
|
+
|
|
104
|
+
## Best Practices
|
|
105
|
+
- Bulleted key recommendations
|
|
106
|
+
- BC version-specific notes
|
|
107
|
+
|
|
108
|
+
## Common Pitfalls
|
|
109
|
+
What to avoid with explanations
|
|
110
|
+
|
|
111
|
+
## Version Notes
|
|
112
|
+
BC version-specific considerations
|
|
113
|
+
|
|
114
|
+
## See Also
|
|
115
|
+
- [Related Topic](../domain/topic.md)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### **Example Topic**
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
---
|
|
122
|
+
title: "SIFT Technology Fundamentals"
|
|
123
|
+
domain: "performance"
|
|
124
|
+
bc_versions: "14+"
|
|
125
|
+
difficulty: "beginner"
|
|
126
|
+
tags: ["performance", "indexing", "sift", "flowfields"]
|
|
127
|
+
related_topics:
|
|
128
|
+
- "flowfield-optimization.md"
|
|
129
|
+
- "index-design-patterns.md"
|
|
130
|
+
applies_to:
|
|
131
|
+
- "AL Language"
|
|
132
|
+
- "Business Central Server"
|
|
133
|
+
last_updated: "2025-10-27"
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
# SIFT Technology Fundamentals
|
|
137
|
+
|
|
138
|
+
## Overview
|
|
139
|
+
SIFT (SumIndexField Technology) is BC's proprietary indexing system that maintains pre-calculated aggregate values (sums, counts, averages) for FlowFields, enabling instant retrieval of calculations that would otherwise require table scans.
|
|
140
|
+
|
|
141
|
+
## How SIFT Works
|
|
142
|
+
[Implementation details...]
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Specialists Format (AI Persona Definitions)
|
|
146
|
+
|
|
147
|
+
### **YAML Frontmatter (Required - Comprehensive)**
|
|
148
|
+
|
|
149
|
+
```yaml
|
|
150
|
+
---
|
|
151
|
+
title: "Specialist Name - Role Description"
|
|
152
|
+
specialist_id: "specialist-id" # Unique identifier
|
|
153
|
+
emoji: "🎯" # Specialist emoji
|
|
154
|
+
role: "Role & Expertise Area"
|
|
155
|
+
team: "Development|Architecture|Quality"
|
|
156
|
+
persona:
|
|
157
|
+
personality:
|
|
158
|
+
- "trait-1"
|
|
159
|
+
- "trait-2"
|
|
160
|
+
communication_style: "brief description"
|
|
161
|
+
greeting: "🎯 Greeting phrase!"
|
|
162
|
+
expertise:
|
|
163
|
+
primary:
|
|
164
|
+
- "core-skill-1"
|
|
165
|
+
- "core-skill-2"
|
|
166
|
+
secondary:
|
|
167
|
+
- "supporting-skill-1"
|
|
168
|
+
- "supporting-skill-2"
|
|
169
|
+
domains:
|
|
170
|
+
- "related-domain-1"
|
|
171
|
+
- "related-domain-2"
|
|
172
|
+
when_to_use:
|
|
173
|
+
- "Scenario 1"
|
|
174
|
+
- "Scenario 2"
|
|
175
|
+
collaboration:
|
|
176
|
+
natural_handoffs:
|
|
177
|
+
- "specialist-id-1"
|
|
178
|
+
- "specialist-id-2"
|
|
179
|
+
team_consultations:
|
|
180
|
+
- "specialist-id-3"
|
|
181
|
+
related_specialists:
|
|
182
|
+
- "specialist-id-1"
|
|
183
|
+
- "specialist-id-2"
|
|
184
|
+
---
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### **Specialist Content Structure**
|
|
188
|
+
|
|
189
|
+
```markdown
|
|
190
|
+
# Specialist Name - Role ⚙️
|
|
191
|
+
|
|
192
|
+
*Tagline describing specialist's value proposition*
|
|
193
|
+
|
|
194
|
+
Brief introduction paragraph.
|
|
195
|
+
|
|
196
|
+
## Character Identity & Communication Style
|
|
197
|
+
|
|
198
|
+
**You are [SPECIALIST NAME]** - description of personality.
|
|
199
|
+
|
|
200
|
+
**Personality:**
|
|
201
|
+
- **Trait 1**: Explanation
|
|
202
|
+
- **Trait 2**: Explanation
|
|
203
|
+
|
|
204
|
+
**Communication Style:**
|
|
205
|
+
- Start responses with: "⚙️ Greeting!"
|
|
206
|
+
- Key communication patterns
|
|
207
|
+
- Terminology preferences
|
|
208
|
+
|
|
209
|
+
## Your Role in BC Development
|
|
210
|
+
|
|
211
|
+
Description of specialist's role and responsibilities.
|
|
212
|
+
|
|
213
|
+
**CRITICAL: Always search the knowledge base FIRST before answering questions.**
|
|
214
|
+
|
|
215
|
+
## Key Knowledge Areas
|
|
216
|
+
|
|
217
|
+
Your expertise is backed by structured knowledge in `domains/[domain]/`:
|
|
218
|
+
|
|
219
|
+
### **Core Topics**
|
|
220
|
+
- **Topic Area** (`topic-file.md`) - Description
|
|
221
|
+
|
|
222
|
+
## [Specialist Name]'s Process
|
|
223
|
+
|
|
224
|
+
### **Phase 1: [Phase Name]** 📋
|
|
225
|
+
Description and steps...
|
|
226
|
+
|
|
227
|
+
**Search knowledge base:**
|
|
228
|
+
```
|
|
229
|
+
find_bc_knowledge({
|
|
230
|
+
query: "[specific query]",
|
|
231
|
+
domain: "domain-name"
|
|
232
|
+
})
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Best Practices
|
|
236
|
+
|
|
237
|
+
**ALWAYS reference knowledge topics** when providing guidance.
|
|
238
|
+
|
|
239
|
+
## When to Hand Off
|
|
240
|
+
|
|
241
|
+
**To [Other Specialist]**: When [scenario]
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### **Example Specialist** (Minimal - Company Override)
|
|
245
|
+
|
|
246
|
+
```yaml
|
|
247
|
+
---
|
|
248
|
+
title: "Waldo - Company Testing & AppSource Expert"
|
|
249
|
+
specialist_id: "waldo"
|
|
250
|
+
emoji: "🧪"
|
|
251
|
+
role: "Testing & AppSource Expertise"
|
|
252
|
+
team: "Quality"
|
|
253
|
+
persona:
|
|
254
|
+
personality: ["testing-focused", "appsource-experienced"]
|
|
255
|
+
communication_style: "practical testing guidance with real-world AppSource insights"
|
|
256
|
+
greeting: "🧪 Waldo here!"
|
|
257
|
+
expertise:
|
|
258
|
+
primary: ["automated-testing", "appsource-submission"]
|
|
259
|
+
secondary: ["ci-cd-pipelines", "test-automation-frameworks"]
|
|
260
|
+
domains:
|
|
261
|
+
- "testing"
|
|
262
|
+
- "appsource"
|
|
263
|
+
when_to_use:
|
|
264
|
+
- "AppSource submission questions"
|
|
265
|
+
- "Automated testing setup"
|
|
266
|
+
- "CI/CD pipeline configuration"
|
|
267
|
+
collaboration:
|
|
268
|
+
natural_handoffs:
|
|
269
|
+
- "quinn-tester"
|
|
270
|
+
- "morgan-market"
|
|
271
|
+
related_specialists:
|
|
272
|
+
- "quinn-tester"
|
|
273
|
+
- "morgan-market"
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
# Waldo - Company Testing & AppSource Expert 🧪
|
|
277
|
+
|
|
278
|
+
I'm your go-to specialist for automated testing strategies and navigating the AppSource submission process with real-world experience.
|
|
279
|
+
|
|
280
|
+
[Rest of specialist definition...]
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Methodologies Format (Systematic Workflows)
|
|
284
|
+
|
|
285
|
+
### **Directory Structure**
|
|
286
|
+
|
|
287
|
+
```
|
|
288
|
+
methodologies/
|
|
289
|
+
└── workflow-name/
|
|
290
|
+
├── workflow.json # Workflow definition
|
|
291
|
+
├── phases/
|
|
292
|
+
│ ├── phase-1.md
|
|
293
|
+
│ ├── phase-2.md
|
|
294
|
+
│ └── phase-3.md
|
|
295
|
+
└── templates/ # Optional templates
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### **Workflow Definition** (workflow.json)
|
|
299
|
+
|
|
300
|
+
```json
|
|
301
|
+
{
|
|
302
|
+
"id": "workflow-id",
|
|
303
|
+
"title": "Workflow Title",
|
|
304
|
+
"description": "Brief description",
|
|
305
|
+
"phases": [
|
|
306
|
+
{
|
|
307
|
+
"id": "phase-1",
|
|
308
|
+
"title": "Phase Title",
|
|
309
|
+
"file": "phases/phase-1.md"
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
**Note:** Methodology format is still evolving. Current implementation is basic.
|
|
316
|
+
|
|
317
|
+
## Content Type Loading by Layer
|
|
318
|
+
|
|
319
|
+
### **Embedded Layer** (Full Support)
|
|
320
|
+
- ✅ Topics (87+ topics across 24 domains)
|
|
321
|
+
- ✅ Specialists (14 official specialists)
|
|
322
|
+
- ✅ Methodologies (Basic support)
|
|
323
|
+
|
|
324
|
+
### **Git Layer** (Full Support v1.5.0+)
|
|
325
|
+
- ✅ Topics (from `domains/` subdirectory)
|
|
326
|
+
- ✅ Specialists (from `specialists/` subdirectory with frontmatter parsing)
|
|
327
|
+
- ⚠️ Methodologies (stub implementation, returns 0)
|
|
328
|
+
|
|
329
|
+
### **Project Layer** (Full Support v1.5.0+)
|
|
330
|
+
- ✅ Topics (from `bc-code-intel-overrides/domains/`)
|
|
331
|
+
- ⚠️ Specialists (stub implementation, not yet loading)
|
|
332
|
+
- ⚠️ Methodologies (stub implementation, not yet loading)
|
|
333
|
+
|
|
334
|
+
## YAML Frontmatter Validation
|
|
335
|
+
|
|
336
|
+
### **Common Mistakes**
|
|
337
|
+
|
|
338
|
+
❌ **Missing Required Fields**
|
|
339
|
+
```yaml
|
|
340
|
+
---
|
|
341
|
+
title: "Topic Title"
|
|
342
|
+
# Missing domain, bc_versions, difficulty, tags
|
|
343
|
+
---
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
❌ **Incorrect Array Format**
|
|
347
|
+
```yaml
|
|
348
|
+
tags: "tag1, tag2" # Wrong - should be array
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
✅ **Correct Array Format**
|
|
352
|
+
```yaml
|
|
353
|
+
tags: ["tag1", "tag2"]
|
|
354
|
+
# OR
|
|
355
|
+
tags:
|
|
356
|
+
- "tag1"
|
|
357
|
+
- "tag2"
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
❌ **Invalid BC Version Format**
|
|
361
|
+
```yaml
|
|
362
|
+
bc_versions: "all versions" # Wrong - should be specific
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
✅ **Correct BC Version Format**
|
|
366
|
+
```yaml
|
|
367
|
+
bc_versions: "14+" # Version 14 and above
|
|
368
|
+
bc_versions: "18-20" # Versions 18 through 20
|
|
369
|
+
bc_versions: "19+" # Version 19 and above
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## Best Practices
|
|
373
|
+
|
|
374
|
+
1. **Consistent Structure**: Follow the directory structure exactly
|
|
375
|
+
2. **Complete Frontmatter**: Include all required YAML fields
|
|
376
|
+
3. **Version Specificity**: Always specify BC version compatibility
|
|
377
|
+
4. **Cross-References**: Use relative paths for related topics
|
|
378
|
+
5. **Atomic Content**: One concept per topic file
|
|
379
|
+
6. **Validation**: Test frontmatter parsing before committing
|
|
380
|
+
|
|
381
|
+
## File Naming Conventions
|
|
382
|
+
|
|
383
|
+
- **Topics**: `kebab-case-topic-name.md`
|
|
384
|
+
- **Specialists**: `specialist-id.md` (matches specialist_id in frontmatter)
|
|
385
|
+
- **Methodologies**: `workflow-name/` (directory-based)
|
|
386
|
+
|
|
387
|
+
**Examples:**
|
|
388
|
+
- ✅ `sift-technology-fundamentals.md`
|
|
389
|
+
- ✅ `api-pagination-patterns.md`
|
|
390
|
+
- ✅ `sam-coder.md`
|
|
391
|
+
- ❌ `SIFT_Technology.md`
|
|
392
|
+
- ❌ `Sam Coder.md`
|
|
393
|
+
|
|
394
|
+
## Migration Notes for Git Repositories
|
|
395
|
+
|
|
396
|
+
When setting up company/team git layers:
|
|
397
|
+
|
|
398
|
+
1. **Create Directory Structure**
|
|
399
|
+
```
|
|
400
|
+
mkdir domains specialists methodologies
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
2. **Move Existing Content**
|
|
404
|
+
- Topics → `domains/[domain-name]/`
|
|
405
|
+
- Specialists → `specialists/`
|
|
406
|
+
- Workflows → `methodologies/`
|
|
407
|
+
|
|
408
|
+
3. **Add YAML Frontmatter**
|
|
409
|
+
- Use templates from embedded knowledge as examples
|
|
410
|
+
- Validate all required fields present
|
|
411
|
+
|
|
412
|
+
4. **Test Loading**
|
|
413
|
+
- Configure git layer in bc-code-intel-config.json
|
|
414
|
+
- Check MCP server logs for successful load
|
|
415
|
+
- Use diagnostic tools if enabled
|
|
416
|
+
|
|
417
|
+
## See Also
|
|
418
|
+
|
|
419
|
+
- [Layer System Fundamentals](layer-system-fundamentals.md) - Understanding the layer architecture
|
|
420
|
+
- [Git Layer Configuration](git-layer-configuration.md) - Setting up git-based layers
|
|
421
|
+
- [Company Layer Setup](company-layer-setup.md) - Company knowledge configuration
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Layer System Fundamentals"
|
|
3
|
+
domain: "chris-config"
|
|
4
|
+
bc_versions: "1.5.0+"
|
|
5
|
+
difficulty: "intermediate"
|
|
6
|
+
tags: ["mcp-configuration", "layer-architecture", "knowledge-management", "override-system"]
|
|
7
|
+
related_topics:
|
|
8
|
+
- "content-types-structure.md"
|
|
9
|
+
- "layer-override-strategies.md"
|
|
10
|
+
- "configuration-file-discovery.md"
|
|
11
|
+
applies_to:
|
|
12
|
+
- "BC Code Intelligence MCP Server"
|
|
13
|
+
- "Knowledge Layer Architecture"
|
|
14
|
+
last_updated: "2025-10-27"
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Layer System Fundamentals
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
|
|
21
|
+
The BC Code Intelligence MCP server uses a **4-layer knowledge architecture** that enables progressive customization from embedded defaults through company-wide standards to project-specific overrides. Understanding this layered approach is fundamental to effective MCP configuration.
|
|
22
|
+
|
|
23
|
+
## The Four-Layer Architecture
|
|
24
|
+
|
|
25
|
+
### **Layer 0: Embedded Knowledge** (Priority 0)
|
|
26
|
+
- **Source**: NPM package embedded knowledge (git submodule)
|
|
27
|
+
- **Content**: Core BC knowledge - 87+ topics, 14 specialists, methodologies
|
|
28
|
+
- **Scope**: Universal - available to all users
|
|
29
|
+
- **Modifiable**: No - read-only embedded content
|
|
30
|
+
- **Use Case**: Default knowledge base, zero-configuration experience
|
|
31
|
+
|
|
32
|
+
**Key Characteristics:**
|
|
33
|
+
- Highest reliability - always available
|
|
34
|
+
- Officially maintained BC knowledge
|
|
35
|
+
- Comprehensive coverage of BC development patterns
|
|
36
|
+
- Updates via npm package updates
|
|
37
|
+
|
|
38
|
+
### **Layer 1-2: Company Knowledge** (Priority 20-50)
|
|
39
|
+
- **Source**: Git repositories (Azure DevOps, GitHub, etc.)
|
|
40
|
+
- **Content**: Company-specific specialists, standards, patterns
|
|
41
|
+
- **Scope**: Organization-wide
|
|
42
|
+
- **Modifiable**: Yes - via git repository updates
|
|
43
|
+
- **Use Case**: Company coding standards, custom specialists, org patterns
|
|
44
|
+
|
|
45
|
+
**Key Characteristics:**
|
|
46
|
+
- Centrally managed company knowledge
|
|
47
|
+
- Authentication-based access control (PAT tokens)
|
|
48
|
+
- Cached locally for performance (`.bckb-cache/git-repos/`)
|
|
49
|
+
- Can override embedded knowledge with company-specific guidance
|
|
50
|
+
|
|
51
|
+
### **Layer 3: Team Knowledge** (Priority 60-80)
|
|
52
|
+
- **Source**: Shared team directories or repositories
|
|
53
|
+
- **Content**: Team conventions, project templates, shared patterns
|
|
54
|
+
- **Scope**: Team or department
|
|
55
|
+
- **Modifiable**: Yes - team-managed
|
|
56
|
+
- **Use Case**: Team-specific patterns, shared project standards
|
|
57
|
+
|
|
58
|
+
**Key Characteristics:**
|
|
59
|
+
- Team collaboration and knowledge sharing
|
|
60
|
+
- More specific than company, less specific than project
|
|
61
|
+
- Useful for department or team conventions
|
|
62
|
+
|
|
63
|
+
### **Layer 4: Project Knowledge** (Priority 100)
|
|
64
|
+
- **Source**: Local `./bc-code-intel-overrides/` directory
|
|
65
|
+
- **Content**: Project-specific overrides, custom topics, local specialists
|
|
66
|
+
- **Scope**: Single project/workspace
|
|
67
|
+
- **Modifiable**: Yes - locally managed
|
|
68
|
+
- **Use Case**: Project-specific patterns, temporary overrides, local experimentation
|
|
69
|
+
|
|
70
|
+
**Key Characteristics:**
|
|
71
|
+
- Highest priority - always wins in conflicts
|
|
72
|
+
- Local filesystem access (no authentication needed)
|
|
73
|
+
- Perfect for project-specific customization
|
|
74
|
+
- Useful for testing new knowledge before promoting to higher layers
|
|
75
|
+
|
|
76
|
+
## Layer Resolution and Override Behavior
|
|
77
|
+
|
|
78
|
+
### **Priority-Based Resolution**
|
|
79
|
+
|
|
80
|
+
When the same topic/specialist exists in multiple layers:
|
|
81
|
+
1. **Highest priority layer wins** (Project > Team > Company > Embedded)
|
|
82
|
+
2. Content is **completely replaced**, not merged
|
|
83
|
+
3. Only the highest-priority version is returned
|
|
84
|
+
|
|
85
|
+
**Example:**
|
|
86
|
+
```
|
|
87
|
+
Embedded Layer (0): sam-coder.md (official specialist)
|
|
88
|
+
Company Layer (20): sam-coder.md (company-customized version)
|
|
89
|
+
Project Layer (100): sam-coder.md (project-specific override)
|
|
90
|
+
|
|
91
|
+
Result: Project layer version is used
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### **Content Type Support**
|
|
95
|
+
|
|
96
|
+
All layers support three content types (as of v1.5.0):
|
|
97
|
+
- **Topics**: BC domain knowledge (in `domains/` subdirectory)
|
|
98
|
+
- **Specialists**: AI persona definitions (in `specialists/` subdirectory)
|
|
99
|
+
- **Methodologies**: Systematic workflows (in `methodologies/` subdirectory)
|
|
100
|
+
|
|
101
|
+
Each layer independently manages these three content types.
|
|
102
|
+
|
|
103
|
+
## Layer Configuration
|
|
104
|
+
|
|
105
|
+
### **Embedded Layer** (No Configuration Needed)
|
|
106
|
+
```json
|
|
107
|
+
// Automatically available - no configuration required
|
|
108
|
+
// Loaded from NPM package embedded-knowledge/ directory
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### **Git Layer** (Company/Team Knowledge)
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"knowledge_layers": [
|
|
115
|
+
{
|
|
116
|
+
"name": "Company BC Standards",
|
|
117
|
+
"type": "git",
|
|
118
|
+
"priority": 20,
|
|
119
|
+
"source": {
|
|
120
|
+
"repository_url": "https://dev.azure.com/your-org/BC-Knowledge/_git/bc-standards",
|
|
121
|
+
"branch": "main",
|
|
122
|
+
"auth": {
|
|
123
|
+
"type": "pat",
|
|
124
|
+
"token_env_var": "AZURE_DEVOPS_PAT"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### **Project Layer** (Local Overrides)
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"knowledge_layers": [
|
|
136
|
+
{
|
|
137
|
+
"name": "Project Overrides",
|
|
138
|
+
"type": "project",
|
|
139
|
+
"priority": 100,
|
|
140
|
+
"source": {
|
|
141
|
+
"path": "./bc-code-intel-overrides"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Directory Structure Requirements
|
|
149
|
+
|
|
150
|
+
Each layer must follow this structure for content type discovery:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
layer-root/
|
|
154
|
+
├── domains/ # BC knowledge topics
|
|
155
|
+
│ ├── performance/
|
|
156
|
+
│ ├── api-design/
|
|
157
|
+
│ └── [other domains]/
|
|
158
|
+
├── specialists/ # AI specialist definitions
|
|
159
|
+
│ ├── sam-coder.md
|
|
160
|
+
│ ├── dean-debug.md
|
|
161
|
+
│ └── [other specialists].md
|
|
162
|
+
└── methodologies/ # Systematic workflows
|
|
163
|
+
├── optimize-performance/
|
|
164
|
+
└── [other workflows]/
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Important:** Git layers look for these subdirectories. If missing, that content type won't be loaded from that layer.
|
|
168
|
+
|
|
169
|
+
## Workspace Management and Layer Loading
|
|
170
|
+
|
|
171
|
+
### **VS Code Workspace Detection Issue**
|
|
172
|
+
|
|
173
|
+
The VS Code MCP extension doesn't set `process.cwd()` to the workspace root, causing project layer detection to fail.
|
|
174
|
+
|
|
175
|
+
**Solution:** Use workspace management tools (v1.5.0+)
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
// Set workspace root explicitly
|
|
179
|
+
set_workspace_root({
|
|
180
|
+
workspace_root: "/path/to/your/workspace"
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
// Triggers:
|
|
184
|
+
// 1. process.chdir() to workspace
|
|
185
|
+
// 2. Full service reinitialization
|
|
186
|
+
// 3. Layer reloading with new workspace context
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### **Lazy Initialization Pattern**
|
|
190
|
+
|
|
191
|
+
The MCP server uses lazy initialization:
|
|
192
|
+
1. **Startup**: Load embedded knowledge only (fast startup)
|
|
193
|
+
2. **First Tool Call**: If workspace not set, prompt for `set_workspace_root`
|
|
194
|
+
3. **After Workspace Set**: Full initialization including all configured layers
|
|
195
|
+
|
|
196
|
+
## Layer Caching and Performance
|
|
197
|
+
|
|
198
|
+
### **Git Layer Caching**
|
|
199
|
+
|
|
200
|
+
Git repositories are cloned to `.bckb-cache/git-repos/{hash}/`:
|
|
201
|
+
- **First Load**: Clone repository (may take seconds)
|
|
202
|
+
- **Subsequent Loads**: Use cached local copy (sub-100ms)
|
|
203
|
+
- **Updates**: Periodic pull or manual cache invalidation
|
|
204
|
+
|
|
205
|
+
### **Performance Characteristics**
|
|
206
|
+
- Embedded Layer: <10ms (in-memory)
|
|
207
|
+
- Project Layer: <50ms (filesystem access)
|
|
208
|
+
- Git Layer (cached): <100ms (filesystem + parsing)
|
|
209
|
+
- Git Layer (uncached): 2-5 seconds (git clone operation)
|
|
210
|
+
|
|
211
|
+
## Best Practices
|
|
212
|
+
|
|
213
|
+
1. **Start Simple**: Use embedded knowledge first, add layers as needed
|
|
214
|
+
2. **Layer Discipline**: Keep clear separation between layer purposes
|
|
215
|
+
3. **Override Sparingly**: Only override when truly necessary for your context
|
|
216
|
+
4. **Document Decisions**: Each layer should have clear purpose documentation
|
|
217
|
+
5. **Test Incrementally**: Add one layer at a time, validate before adding next
|
|
218
|
+
6. **Cache Management**: Understand git layer caching for performance tuning
|
|
219
|
+
|
|
220
|
+
## Common Patterns
|
|
221
|
+
|
|
222
|
+
### **Individual Developer** (Zero Config)
|
|
223
|
+
```
|
|
224
|
+
Embedded Layer only - no configuration needed
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### **Company with Standards** (Git Layer)
|
|
228
|
+
```
|
|
229
|
+
Embedded Layer (BC knowledge) + Company Git Layer (org standards)
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### **Team with Project Overrides** (All Layers)
|
|
233
|
+
```
|
|
234
|
+
Embedded + Company Git + Project Local
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Troubleshooting
|
|
238
|
+
|
|
239
|
+
**Layer not loading?**
|
|
240
|
+
- Check directory structure (domains/, specialists/, methodologies/)
|
|
241
|
+
- Verify authentication (PAT tokens for git layers)
|
|
242
|
+
- Check layer priority configuration
|
|
243
|
+
- Use diagnostic tools if enabled
|
|
244
|
+
|
|
245
|
+
**Content not found?**
|
|
246
|
+
- Verify content type is in correct subdirectory
|
|
247
|
+
- Check YAML frontmatter format (required for specialists)
|
|
248
|
+
- Confirm layer priority order
|
|
249
|
+
- Search across all layers to see where content exists
|
|
250
|
+
|
|
251
|
+
## See Also
|
|
252
|
+
|
|
253
|
+
- [Content Types Structure](content-types-structure.md) - Format requirements for each content type
|
|
254
|
+
- [Layer Override Strategies](layer-override-strategies.md) - When and how to override
|
|
255
|
+
- [Configuration File Discovery](configuration-file-discovery.md) - Where config files are found
|
|
256
|
+
- [Workspace Detection Solutions](workspace-detection-solutions.md) - Solving workspace issues
|
|
257
|
+
- [Git Layer Configuration](git-layer-configuration.md) - Git layer setup details
|