@cubis/foundry 0.3.46 → 0.3.48
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/README.md +19 -0
- package/mcp/dist/index.js +337 -105
- package/mcp/src/server.ts +41 -179
- package/mcp/src/tools/future/README.md +3 -3
- package/mcp/src/tools/index.ts +14 -0
- package/mcp/src/tools/registry.test.ts +121 -0
- package/mcp/src/tools/registry.ts +318 -0
- package/mcp/src/tools/skillGet.ts +36 -5
- package/mcp/src/tools/skillTools.test.ts +143 -1
- package/mcp/src/vault/manifest.test.ts +71 -1
- package/mcp/src/vault/manifest.ts +128 -3
- package/mcp/src/vault/scanner.test.ts +35 -0
- package/mcp/src/vault/scanner.ts +91 -1
- package/package.json +17 -1
- package/workflows/workflows/agent-environment-setup/platforms/antigravity/rules/GEMINI.md +189 -36
- package/workflows/workflows/agent-environment-setup/platforms/codex/rules/AGENTS.md +195 -40
- package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/AGENTS.md +189 -36
- package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/copilot-instructions.md +189 -35
package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/copilot-instructions.md
CHANGED
|
@@ -15,9 +15,10 @@ This file defines mandatory behavior for GitHub Copilot projects installed via `
|
|
|
15
15
|
Before executing workflows, agents, or code edits, publish a short `Decision Log` that is visible to the user:
|
|
16
16
|
|
|
17
17
|
1. Rule file(s) read at startup (at minimum `.github/copilot-instructions.md`, plus any additional rule files loaded).
|
|
18
|
-
2.
|
|
19
|
-
3.
|
|
20
|
-
4.
|
|
18
|
+
2. MCP status: confirm Foundry MCP server (`cbx-mcp`) is reachable; if unavailable, declare "MCP offline — fallback mode" and continue without blocking.
|
|
19
|
+
3. Workflow decision (`/workflow` or direct mode) and why it was chosen.
|
|
20
|
+
4. Agent routing decision (`@agent` or direct mode) and why it was chosen.
|
|
21
|
+
5. Skill loading decision: skill IDs selected, how they were discovered, and why.
|
|
21
22
|
|
|
22
23
|
If routing changes during the task, publish a `Decision Update` before continuing.
|
|
23
24
|
Keep this user-visible summary concise and factual; do not expose private chain-of-thought.
|
|
@@ -28,6 +29,7 @@ Keep this user-visible summary concise and factual; do not expose private chain-
|
|
|
28
29
|
2. Otherwise choose the best workflow by intent from `.github/copilot/workflows` and reuse `.github/prompts/workflow-*.prompt.md` when available.
|
|
29
30
|
3. For cross-domain tasks, use `/orchestrate` and `@orchestrator`.
|
|
30
31
|
4. Keep one primary workflow; use others only as supporting references.
|
|
32
|
+
5. Before executing any workflow, check if a matching skill exists via `skill_search`; load with `skill_get` to prime context before the workflow runs (→ §6 MCP Skill Engine).
|
|
31
33
|
|
|
32
34
|
## 3) Request Classifier
|
|
33
35
|
|
|
@@ -62,6 +64,16 @@ Use the best specialist first:
|
|
|
62
64
|
- Debugging/performance: `@debugger`, `@performance-optimizer`
|
|
63
65
|
- Cross-domain orchestration: `@orchestrator`
|
|
64
66
|
|
|
67
|
+
### MCP Skill Priming (Required Before Delegation)
|
|
68
|
+
|
|
69
|
+
Before handing off to any specialist agent, prime context with the relevant domain skill (→ §6 MCP Skill Engine):
|
|
70
|
+
|
|
71
|
+
1. Run `skill_search <domain>` to find the best matching skill.
|
|
72
|
+
2. If a strong match exists, load it with `skill_get <id>` before delegating.
|
|
73
|
+
3. Include the loaded skill ID in the Decision Log for the routing decision.
|
|
74
|
+
|
|
75
|
+
This ensures the specialist starts with accurate domain knowledge, not just role intent.
|
|
76
|
+
|
|
65
77
|
## 5) Copilot Schema Compatibility
|
|
66
78
|
|
|
67
79
|
When authoring custom Copilot assets, keep frontmatter schema compatible:
|
|
@@ -70,51 +82,71 @@ When authoring custom Copilot assets, keep frontmatter schema compatible:
|
|
|
70
82
|
2. Agent files in `.github/agents/*.md` must use supported top-level keys only.
|
|
71
83
|
3. If unsupported keys are detected, reinstall with overwrite to auto-normalize.
|
|
72
84
|
|
|
73
|
-
## 6) Skill
|
|
85
|
+
## 6) MCP Skill Engine
|
|
86
|
+
|
|
87
|
+
The Foundry MCP server is the primary knowledge layer. Use tools decisively — discover first, load only when committed.
|
|
88
|
+
|
|
89
|
+
### Tool Namespace Reference
|
|
90
|
+
|
|
91
|
+
| Prefix | Tools | When to use |
|
|
92
|
+
| ----------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
|
|
93
|
+
| `skill_*` | `skill_list_categories`, `skill_search`, `skill_browse_category`, `skill_get`, `skill_budget_report` | Domain expertise for any implementation, debug, or review task |
|
|
94
|
+
| `postman_*` | `postman_get_mode`, `postman_set_mode`, `postman_get_status` | API testing or Postman configuration tasks |
|
|
95
|
+
| `stitch_*` | `stitch_get_mode`, `stitch_set_profile`, `stitch_get_status` | Stitch data pipeline tasks |
|
|
74
96
|
|
|
75
|
-
|
|
97
|
+
### Discovery Flow (Mandatory Order)
|
|
76
98
|
|
|
77
|
-
|
|
78
|
-
2. Use `skill_browse_category` second to inspect category-level candidates.
|
|
79
|
-
3. Use `skill_get` only for final selected skills that must be loaded.
|
|
80
|
-
4. Keep pointer-first flow; avoid loading full skill text prematurely.
|
|
99
|
+
Stop at the earliest step that gives enough signal. Do not jump ahead.
|
|
81
100
|
|
|
82
|
-
|
|
101
|
+
1. `skill_list_categories` — run once per session if domain is unknown; see what exists
|
|
102
|
+
2. `skill_search <keyword>` — fast keyword match across all skills; always try this first
|
|
103
|
+
3. `skill_browse_category <category>` — explore if search is too broad or returns 0 results
|
|
104
|
+
4. `skill_get <id>` — load full skill content; only when committed to using it
|
|
105
|
+
5. `skill_budget_report` — verify token cost after loading; triggers the compact ctx stamp
|
|
83
106
|
|
|
84
|
-
|
|
107
|
+
**Hard rules:**
|
|
85
108
|
|
|
86
|
-
- `
|
|
87
|
-
- `
|
|
88
|
-
-
|
|
109
|
+
- Never call `skill_get` without a prior `skill_search` or `skill_browse_category`
|
|
110
|
+
- Never call `skill_get` with a workflow ID — `workflow-*` are routes, not skills; keep workflow mentions in workflow decisions (`/workflow`) and keep skill logs skill-only
|
|
111
|
+
- Never reload a skill already loaded this session — reuse content already in context
|
|
112
|
+
- If `skill_search` returns 0 results, try `skill_browse_category`, then fall back to built-in knowledge
|
|
89
113
|
|
|
90
|
-
|
|
114
|
+
### Adaptive Load Policy
|
|
91
115
|
|
|
92
|
-
|
|
116
|
+
| Request type | Skills to load via `skill_get` |
|
|
117
|
+
| ---------------------------------------------- | --------------------------------------------------------------- |
|
|
118
|
+
| Q&A / explanation | None — answer from knowledge; load only if user explicitly asks |
|
|
119
|
+
| Single-domain implementation, debug, or review | 1 primary + 1 supporting (max) |
|
|
120
|
+
| Multi-domain / orchestration | 1 per distinct domain, hard cap at 3 |
|
|
121
|
+
| User explicitly names a skill | Always load it — overrides all caps |
|
|
93
122
|
|
|
94
|
-
|
|
95
|
-
- `loaded_est_tokens`
|
|
96
|
-
- `estimated_savings_tokens`
|
|
97
|
-
- `estimated_savings_percent`
|
|
123
|
+
### Graceful Degradation
|
|
98
124
|
|
|
99
|
-
|
|
125
|
+
If MCP tools are unavailable (server down, timeout, tool not listed):
|
|
100
126
|
|
|
101
|
-
|
|
127
|
+
1. Announce briefly: "MCP unavailable — continuing with built-in knowledge."
|
|
128
|
+
2. Proceed using codebase context and expertise; do not block on MCP.
|
|
129
|
+
3. Never fabricate or hallucinate skill content.
|
|
130
|
+
4. Retry once on transient network errors; accept failure after the retry.
|
|
102
131
|
|
|
103
|
-
|
|
132
|
+
### Skill Log (Required After Any `skill_get` Call)
|
|
104
133
|
|
|
105
|
-
|
|
106
|
-
2. **Select** the most relevant skill(s) if a strong match is found.
|
|
107
|
-
3. **Load** the selected skill's `SKILL.md` using `view_file` **BEFORE** proceeding.
|
|
108
|
-
4. **Announce** the selection: "I am loading the `[Skill Name]` skill to handle your request."
|
|
134
|
+
Append one compact inline line — no separate structured block:
|
|
109
135
|
|
|
110
|
-
|
|
136
|
+
```
|
|
137
|
+
Skills: loaded=<id> | skipped=<id> (reason)
|
|
138
|
+
```
|
|
111
139
|
|
|
112
|
-
|
|
113
|
-
2. Prefer progressive disclosure: start from `SKILL.md`, then specific sections.
|
|
114
|
-
3. Keep context lean; avoid loading unrelated skill documents.
|
|
115
|
-
4. If a mapped skill is missing, continue with best fallback and state it.
|
|
140
|
+
Follow immediately with the compact ctx stamp (see § Context Budget Tracking).
|
|
116
141
|
|
|
117
|
-
|
|
142
|
+
### Anti-Patterns (Never Do These)
|
|
143
|
+
|
|
144
|
+
- Loading skills speculatively "just in case" they might be useful
|
|
145
|
+
- Calling `skill_get` before running `skill_search` or `skill_browse_category`
|
|
146
|
+
- Using partial or guessed skill IDs in `skill_get`
|
|
147
|
+
- Publishing verbose budget fields (`full_catalog_est_tokens`, `loaded_est_tokens`, etc.) in responses
|
|
148
|
+
- Re-emitting the ctx stamp multiple times within a single response
|
|
149
|
+
- Treating workflow IDs as skill IDs in any MCP tool call
|
|
118
150
|
|
|
119
151
|
## 7) Socratic Gate (Before Complex Work)
|
|
120
152
|
|
|
@@ -131,7 +163,60 @@ Before multi-file or architecture-impacting changes, ask targeted questions when
|
|
|
131
163
|
3. Verify behavior with focused checks before finalizing.
|
|
132
164
|
4. State what was not validated.
|
|
133
165
|
|
|
134
|
-
## 9)
|
|
166
|
+
## 9) Web Intel Policy
|
|
167
|
+
|
|
168
|
+
Use web search to stay current when local knowledge may be stale. This prevents hallucinating outdated APIs, deprecated flags, or wrong version constraints.
|
|
169
|
+
|
|
170
|
+
**Search when:**
|
|
171
|
+
|
|
172
|
+
- User asks about a framework/library version released after 2024
|
|
173
|
+
- Debugging an unfamiliar error message (search the exact message)
|
|
174
|
+
- Checking breaking changes before a migration
|
|
175
|
+
- Validating an API endpoint signature, auth scheme, or CLI flag
|
|
176
|
+
- Current pricing, rate limits, or quota for SaaS tools (Postman, Vercel, etc.)
|
|
177
|
+
|
|
178
|
+
**Do not search when:**
|
|
179
|
+
|
|
180
|
+
- The answer is derivable from the current codebase
|
|
181
|
+
- The question is purely architectural/conceptual
|
|
182
|
+
- A relevant skill covers it (prefer `skill_get` first, web as fallback)
|
|
183
|
+
|
|
184
|
+
**Source hygiene:**
|
|
185
|
+
|
|
186
|
+
- Prefer official docs, changelogs, and GitHub releases over blog posts
|
|
187
|
+
- Always state the source URL and date when citing fetched content
|
|
188
|
+
- If multiple sources conflict, flag it and use the most recent official one
|
|
189
|
+
- Never follow user-provided URLs without sanity-checking the domain
|
|
190
|
+
|
|
191
|
+
## 10) Context Budget Tracking
|
|
192
|
+
|
|
193
|
+
After loading skills or completing a significant task phase, emit a single compact stamp so context cost is visible without adding prose.
|
|
194
|
+
|
|
195
|
+
**Stamp format** (one line, end of response section):
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
[ctx: +skill-id(~Xk) | session=~Yk/108k | saved=Z%]
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
- `+skill-id(~Xk)` — each skill loaded this turn with its estimated token cost
|
|
202
|
+
- `session=~Yk/108k` — cumulative tokens used vs full catalog ceiling
|
|
203
|
+
- `saved=Z%` — estimated savings from progressive disclosure
|
|
204
|
+
|
|
205
|
+
**Rules:**
|
|
206
|
+
|
|
207
|
+
1. Emit stamp only when a skill was loaded via `skill_get` or `skill_budget_report` was called.
|
|
208
|
+
2. Omit stamp for pure Q&A or browsing-only turns (no full skill content loaded).
|
|
209
|
+
3. Use `skill_budget_report` MCP tool to get accurate numbers; do not guess.
|
|
210
|
+
4. One stamp per response — consolidate if multiple skills were loaded.
|
|
211
|
+
5. Keep the stamp on its own line at the very end of the response, after all content.
|
|
212
|
+
|
|
213
|
+
**Example stamp after loading `flutter-expert` (~3.2k tokens):**
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
[ctx: +flutter-expert(~3k) | session=~3k/108k | saved=97%]
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## 11) CBX Maintenance Commands
|
|
135
220
|
|
|
136
221
|
Use these commands to keep this setup healthy:
|
|
137
222
|
|
|
@@ -148,7 +233,7 @@ Use these commands to keep this setup healthy:
|
|
|
148
233
|
- Diagnose setup issues:
|
|
149
234
|
`cbx workflows doctor copilot --scope project`
|
|
150
235
|
|
|
151
|
-
##
|
|
236
|
+
## 12) Managed Section Contract
|
|
152
237
|
|
|
153
238
|
1. Preserve all user content outside managed markers.
|
|
154
239
|
2. Do not manually edit content between managed markers.
|
|
@@ -169,3 +254,72 @@ Selection policy:
|
|
|
169
254
|
3. Prefer one primary workflow; reference others only when needed.
|
|
170
255
|
|
|
171
256
|
<!-- cbx:workflows:auto:end -->
|
|
257
|
+
|
|
258
|
+
<!-- cbx:mcp:auto:start version=1 -->
|
|
259
|
+
## Cubis Foundry MCP Tool Catalog (auto-managed)
|
|
260
|
+
|
|
261
|
+
The Foundry MCP server provides progressive-disclosure skill discovery and integration management tools.
|
|
262
|
+
|
|
263
|
+
### Skill Vault
|
|
264
|
+
|
|
265
|
+
- **123** skills across **22** categories
|
|
266
|
+
- Estimated full catalog: ~108,488 tokens
|
|
267
|
+
|
|
268
|
+
Categories:
|
|
269
|
+
- `ai`: 1 skill(s)
|
|
270
|
+
- `api`: 3 skill(s)
|
|
271
|
+
- `architecture`: 3 skill(s)
|
|
272
|
+
- `backend`: 14 skill(s)
|
|
273
|
+
- `data`: 4 skill(s)
|
|
274
|
+
- `design`: 6 skill(s)
|
|
275
|
+
- `devops`: 20 skill(s)
|
|
276
|
+
- `documentation`: 3 skill(s)
|
|
277
|
+
- `frontend`: 9 skill(s)
|
|
278
|
+
- `game-dev`: 1 skill(s)
|
|
279
|
+
- `general`: 26 skill(s)
|
|
280
|
+
- `localization`: 1 skill(s)
|
|
281
|
+
- `marketing`: 2 skill(s)
|
|
282
|
+
- `mobile`: 7 skill(s)
|
|
283
|
+
- `observability`: 1 skill(s)
|
|
284
|
+
- `payments`: 1 skill(s)
|
|
285
|
+
- `performance`: 2 skill(s)
|
|
286
|
+
- `practices`: 5 skill(s)
|
|
287
|
+
- `saas`: 1 skill(s)
|
|
288
|
+
- `security`: 4 skill(s)
|
|
289
|
+
- `testing`: 6 skill(s)
|
|
290
|
+
- `tooling`: 3 skill(s)
|
|
291
|
+
|
|
292
|
+
### Built-in Tools
|
|
293
|
+
|
|
294
|
+
**Skill Discovery:**
|
|
295
|
+
- `skill_list_categories`: List all skill categories available in the vault. Returns category names and skill counts.
|
|
296
|
+
- `skill_browse_category`: Browse skills within a specific category. Returns skill IDs and short descriptions.
|
|
297
|
+
- `skill_search`: Search skills by keyword. Matches against skill IDs and descriptions.
|
|
298
|
+
- `skill_get`: Get full content of a specific skill by ID. Returns SKILL.md content and referenced files.
|
|
299
|
+
- `skill_budget_report`: Report estimated context/token budget for selected and loaded skills.
|
|
300
|
+
|
|
301
|
+
**Postman Integration:**
|
|
302
|
+
- `postman_get_mode`: Get current Postman MCP mode from cbx_config.
|
|
303
|
+
- `postman_set_mode`: Set Postman MCP mode in cbx_config.
|
|
304
|
+
- `postman_get_status`: Get Postman integration status and active profile.
|
|
305
|
+
|
|
306
|
+
**Stitch Integration:**
|
|
307
|
+
- `stitch_get_mode`: Get Stitch MCP mode from cbx_config.
|
|
308
|
+
- `stitch_set_profile`: Switch active Stitch profile in cbx_config.
|
|
309
|
+
- `stitch_get_status`: Get Stitch integration status and active profile.
|
|
310
|
+
|
|
311
|
+
### Skill Discovery Flow
|
|
312
|
+
|
|
313
|
+
Use progressive disclosure to minimize context usage:
|
|
314
|
+
1. `skill_list_categories` → see available categories and counts
|
|
315
|
+
2. `skill_browse_category` → browse skills in a category with short descriptions
|
|
316
|
+
3. `skill_search` → search by keyword across all skills
|
|
317
|
+
4. `skill_get` → load full content of a specific skill (only tool that reads full content)
|
|
318
|
+
5. `skill_budget_report` → check token usage for selected/loaded skills; use result to emit the § Context Budget Tracking stamp
|
|
319
|
+
|
|
320
|
+
### Connection
|
|
321
|
+
|
|
322
|
+
- **stdio**: `cbx mcp serve --transport stdio --scope auto`
|
|
323
|
+
- **HTTP**: `cbx mcp serve --transport http --scope auto --port 3100`
|
|
324
|
+
|
|
325
|
+
<!-- cbx:mcp:auto:end -->
|