@cubis/foundry 0.3.28 → 0.3.29

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 CHANGED
@@ -1,509 +1,351 @@
1
- # Cubis Foundry CLI (`cbx`)
1
+ # @cubis/foundry
2
2
 
3
- Workflow-first installer for AI agent environments, with Codex callable-skill wrappers.
3
+ Workflow-first installer for multi-platform AI agent environments.
4
4
 
5
- Repository layout note: reusable workflow/skill/power assets are stored under `Ai Agent Workflow/`.
6
-
7
- Primary support in this release:
8
-
9
- - Antigravity
5
+ `cbx` installs workflows, skills, wrappers, and rule files for:
10
6
  - Codex
11
- - Copilot (VS Code Chat + Copilot CLI)
12
-
13
- ## Changelog
14
-
15
- - Latest release notes are visible here on npm and tracked in [`CHANGELOG.md`](./CHANGELOG.md).
16
- - GitHub view: [CHANGELOG.md](https://github.com/CUBETIQ/cubis-foundry/blob/main/CHANGELOG.md)
7
+ - Antigravity (Gemini)
8
+ - GitHub Copilot
9
+
10
+ ## Table of Contents
11
+
12
+ - [What This CLI Manages](#what-this-cli-manages)
13
+ - [Install](#install)
14
+ - [Quickstarts](#quickstarts)
15
+ - [Scope Model (Global vs Project)](#scope-model-global-vs-project)
16
+ - [Credential Model (`cbx_config.json` only)](#credential-model-cbx_configjson-only)
17
+ - [Postman and Stitch Setup Flows](#postman-and-stitch-setup-flows)
18
+ - [MCP Placement Matrix](#mcp-placement-matrix)
19
+ - [Command Reference](#command-reference)
20
+ - [Troubleshooting](#troubleshooting)
21
+ - [Migration Notes](#migration-notes)
22
+ - [Platform Docs](#platform-docs)
23
+
24
+ ## What This CLI Manages
25
+
26
+ - Workflow files (`/plan`, `/create`, etc.)
27
+ - Skill folders
28
+ - Codex callable wrapper skills (`$workflow-*`, `$agent-*`)
29
+ - Platform rule files (`AGENTS.md`, `GEMINI.md`, etc.)
30
+ - Engineering artifacts in workspace (`ENGINEERING_RULES.md`, `TECH.md`)
31
+ - Managed MCP config for Postman and Stitch
17
32
 
18
33
  ## Install
19
34
 
20
35
  ```bash
21
36
  npm install -g @cubis/foundry
22
- cbx --help
23
37
  ```
24
38
 
25
- Compatibility binaries are still shipped for migration:
26
-
27
- - `cubiskill`
28
- - `cubis`
29
-
30
- ## Quick Setup (Simple)
39
+ Recommended environment setup:
31
40
 
32
41
  ```bash
33
- # 1) Install CLI
34
- npm install -g @cubis/foundry
35
-
36
- # 2) Set API keys once (recommended: env mode)
37
42
  export POSTMAN_API_KEY="<your-postman-api-key>"
38
43
  export STITCH_API_KEY="<your-stitch-api-key>" # Antigravity StitchMCP only
39
-
40
- # 3) Install workflow bundle for your platform
41
- cbx workflows install --platform codex --bundle agent-environment-setup --postman
42
-
43
- # 4) Optional: install for other platforms too
44
- cbx workflows install --platform antigravity --bundle agent-environment-setup --postman
45
- cbx workflows install --platform copilot --bundle agent-environment-setup --postman
46
44
  ```
47
45
 
48
- ## Command Model
46
+ ## Quickstarts
49
47
 
50
- `workflows` is now the primary command group.
48
+ ### Codex (recommended baseline)
51
49
 
52
50
  ```bash
53
- cbx workflows install --platform antigravity
54
- cbx workflows install --platform codex
55
- cbx workflows install --platform copilot
56
- cbx workflows remove <bundle-or-workflow> --platform antigravity
57
- cbx workflows sync-rules --platform codex
58
- cbx workflows doctor codex
59
- cbx workflows platforms
60
- cbx workflows install --platform antigravity --dry-run
61
- cbx workflows install --platform antigravity --terminal-integration --terminal-verifier codex
62
- cbx workflows install --platform codex --postman
63
- cbx workflows install --platform codex --postman --postman-workspace-id null
64
- cbx workflows install --platform codex --postman --postman-workspace-id "<workspace-id>"
65
- cbx workflows install --platform codex --postman --postman-api-key "<key>"
66
- cbx workflows install --platform codex --postman --mcp-scope global
67
- cbx workflows install --platform copilot --postman --mcp-scope project
68
- cbx workflows install --platform antigravity --postman
69
- cbx workflows install --platform antigravity --postman --stitch-api-key "<key>"
70
- cbx workflows install --platform copilot --postman
51
+ cbx workflows install --platform codex --bundle agent-environment-setup --postman
71
52
  ```
72
53
 
73
- Install bootstrap behavior:
74
-
75
- - `cbx workflows install` now also bootstraps `ENGINEERING_RULES.md` and `TECH.md` (creates when missing; keeps existing files unless explicitly regenerated).
76
- - When install scope is `global` (default), skills/powers install to global paths, while workflows + agents stay in workspace (`project`) paths.
77
- - Rule sync + engineering artifacts (`AGENTS.md`/`GEMINI.md`/Copilot instructions, `ENGINEERING_RULES.md`, `TECH.md`) are maintained in workspace (`project`) scope.
78
- - Codex workflow templates are maintained in workspace `.agents/workflows` so workflow-wrapper routing remains discoverable in project rules.
79
- - Optional `--postman` bootstrap creates `cbx_config.json`, stores managed MCP definitions in `.cbx/mcp/`, and installs/configures Postman MCP for Codex, Antigravity, and Copilot.
80
- - For Antigravity only, `--postman` also installs a default `StitchMCP` entry (`stitch.googleapis.com/mcp`) using key from `--stitch-api-key` or `STITCH_API_KEY`.
81
- - Use `--mcp-scope <project|workspace|global|user>` to choose where MCP runtime config is installed (interactive installs prompt for this when not provided).
82
- - Use `cbx rules init --platform <platform> --overwrite` to force-regenerate both files.
83
-
84
- Postman + Antigravity Stitch setup behavior:
85
-
86
- - `cbx_config.json` is generated in workspace root (project MCP scope) or `~/.cbx/cbx_config.json` (global MCP scope).
87
- - Managed MCP definition files are generated under `.cbx/mcp/<platform>/postman.json` (workspace scope) or `~/.cbx/mcp/<platform>/postman.json` (global scope).
88
- - Env-first auth is supported: when `POSTMAN_API_KEY` is set, generated settings keep `apiKey: null` and MCP config uses `Bearer ${POSTMAN_API_KEY}`.
89
- - Inline auth is supported with `--postman-api-key <key>`.
90
- - `--postman-workspace-id null` writes JSON `null` for `defaultWorkspaceId`.
91
- - If `POSTMAN_API_KEY` is available and install is interactive (no `--yes`) without `--postman-workspace-id`, `cbx` fetches your Postman workspaces and prompts you to pick one as default.
92
- - Antigravity gets an additional managed file at `.cbx/mcp/antigravity/stitch.json` (or `~/.cbx/mcp/antigravity/stitch.json` in global MCP scope).
93
- - Stitch key source priority for Antigravity: `--stitch-api-key` then `STITCH_API_KEY`; when unset, generated config keeps placeholder `X-Goog-Api-Key: ur stitch key`.
94
- - In project MCP scope, `cbx_config.json` and `.cbx/mcp/` are auto-added to `.gitignore` (no duplicate entries).
54
+ Important:
55
+ - Do not use `--yes` if you want interactive Postman workspace selection.
56
+ - Interactive install can fetch your Postman workspaces and save the selected workspace as the active profile `workspaceId`.
95
57
 
96
- Codex Postman workspace selection:
58
+ ### Antigravity
97
59
 
98
60
  ```bash
99
- # Set Postman API key first
100
- export POSTMAN_API_KEY="<your-postman-api-key>"
101
-
102
- # Interactive workspace selector (recommended)
103
- cbx workflows install --platform codex --bundle agent-environment-setup --postman
61
+ cbx workflows install --platform antigravity --bundle agent-environment-setup --postman
104
62
  ```
105
63
 
106
- - Do not use `--yes` here (it skips prompts).
107
- - You will get a workspace selector and the selected value is saved as `defaultWorkspaceId`.
64
+ This also manages default `StitchMCP` wiring for Antigravity.
108
65
 
109
- Direct/manual workspace ID:
66
+ ### Copilot
110
67
 
111
68
  ```bash
112
- cbx workflows install --platform codex --bundle agent-environment-setup --postman --postman-workspace-id "<workspace-id>" --yes
69
+ cbx workflows install --platform copilot --bundle agent-environment-setup --postman
113
70
  ```
114
71
 
115
- Clear default workspace:
72
+ ## Scope Model (Global vs Project)
116
73
 
117
- ```bash
118
- cbx workflows install --platform codex --bundle agent-environment-setup --postman --postman-workspace-id null --yes
119
- ```
74
+ Default install scope is `global`.
120
75
 
121
- Important:
76
+ Behavior:
77
+ - Skills are installed in global platform skill directories.
78
+ - Workflows and agents are installed in project paths for active workspace behavior.
79
+ - Rule files remain workspace-oriented for current repo context.
80
+ - Engineering files (`ENGINEERING_RULES.md`, `TECH.md`) are workspace files.
81
+
82
+ ### Where files go
83
+
84
+ Codex:
85
+ - Global skills: `~/.agents/skills`
86
+ - Project workflows: `<workspace>/.agents/workflows`
87
+ - Project rules: `<workspace>/AGENTS.md`
88
+ - Global rules: `~/.codex/AGENTS.md`
89
+
90
+ Antigravity:
91
+ - Global skills: `~/.gemini/antigravity/skills`
92
+ - Project workflows: `<workspace>/.agent/workflows`
93
+ - Project rules: `<workspace>/.agent/rules/GEMINI.md`
94
+ - Global rules: `~/.gemini/GEMINI.md`
95
+
96
+ Copilot:
97
+ - Global skills: `~/.copilot/skills`
98
+ - Project workflows: `<workspace>/.github/copilot/workflows`
99
+ - Project rules: `<workspace>/AGENTS.md` and `<workspace>/.github/copilot-instructions.md`
100
+ - Global rules: `~/.copilot/copilot-instructions.md`
101
+
102
+ ## Credential Model (`cbx_config.json` only)
103
+
104
+ `cbx_config.json` is the single supported credentials/config source.
105
+
106
+ Paths:
107
+ - Global: `~/.cbx/cbx_config.json`
108
+ - Project: `<workspace>/cbx_config.json`
109
+
110
+ ### Profile schema
111
+
112
+ Postman and Stitch now support multiple named profiles with active selection.
113
+
114
+ ```json
115
+ {
116
+ "postman": {
117
+ "profiles": [
118
+ {
119
+ "name": "default",
120
+ "apiKey": null,
121
+ "apiKeyEnvVar": "POSTMAN_API_KEY",
122
+ "workspaceId": null
123
+ }
124
+ ],
125
+ "activeProfileName": "default",
126
+ "mcpUrl": "https://mcp.postman.com/minimal"
127
+ },
128
+ "stitch": {
129
+ "profiles": [
130
+ {
131
+ "name": "default",
132
+ "apiKey": null,
133
+ "apiKeyEnvVar": "STITCH_API_KEY"
134
+ }
135
+ ],
136
+ "activeProfileName": "default",
137
+ "mcpUrl": "https://stitch.googleapis.com/mcp"
138
+ }
139
+ }
140
+ ```
122
141
 
123
- - If `cbx_config.json` already exists and you want to change the saved workspace, use `--overwrite` (or edit config manually), because existing config is preserved by default.
124
- - If install output shows `Config file: skipped (...)`, your newly selected workspace is not persisted. Use `--overwrite` or edit with the config command below.
142
+ Compatibility fields (`apiKey`, `apiKeyEnvVar`, `apiKeySource`, `defaultWorkspaceId`) are still mirrored for older consumers, but profile fields are authoritative.
125
143
 
126
- View/edit config in terminal:
144
+ ### List/Add/Use/Remove profiles
127
145
 
128
146
  ```bash
129
- # View config
130
- cbx workflows config --scope global --show
147
+ # List profiles
148
+ cbx workflows config keys list --service all --scope global
131
149
 
132
- # Interactive edit (workspace ID)
133
- cbx workflows config --scope global --edit
150
+ # Add profile (env-alias-first)
151
+ cbx workflows config keys add --service postman --name team-a --env-var POSTMAN_API_KEY_TEAM_A --scope global
152
+ cbx workflows config keys add --service stitch --name prod --env-var STITCH_API_KEY_PROD --scope global
134
153
 
135
- # Direct set workspace ID
136
- cbx workflows config --scope global --workspace-id "<workspace-id>"
154
+ # Switch active profile
155
+ cbx workflows config keys use --service postman --name team-a --scope global
137
156
 
138
- # Clear workspace ID
139
- cbx workflows config --scope global --clear-workspace-id
157
+ # Remove non-active profile
158
+ cbx workflows config keys remove --service postman --name old-profile --scope global
140
159
  ```
141
160
 
142
- Platform runtime MCP placement:
143
-
144
- - Codex:
145
- - Global MCP scope: `~/.codex/config.toml` via `codex mcp add`.
146
- - Workspace MCP scope: `.vscode/mcp.json`.
147
- - Antigravity (Gemini CLI):
148
- - Global MCP scope: `~/.gemini/settings.json` (`mcpServers`, includes `postman` + default `StitchMCP`).
149
- - Workspace MCP scope: `.gemini/settings.json` (`mcpServers`, includes `postman` + default `StitchMCP`).
150
- - Copilot:
151
- - Workspace MCP scope: `.vscode/mcp.json`.
152
- - Global MCP scope: `~/.copilot/mcp-config.json`.
161
+ Alias commands are also available:
162
+ - `cbx skills config keys ...`
153
163
 
154
- API key docs:
164
+ ## Postman and Stitch Setup Flows
155
165
 
156
- - Google Stitch MCP setup docs: [stitch.withgoogle.com/docs/mcp/setup](https://stitch.withgoogle.com/docs/mcp/setup)
157
- - Google Stitch settings (create API key): [stitch.withgoogle.com/settings](https://stitch.withgoogle.com/settings)
158
- - Google Cloud API key guidance: [Authenticate to Google and Google Cloud MCP servers](https://docs.cloud.google.com/mcp/authenticate-mcp)
159
- - Postman API key creation: [Generate and use Postman API keys](https://learning.postman.com/docs/developer/postman-api/authentication/)
160
- - Postman MCP setup: [Set up the Postman MCP Server](https://learning.postman.com/docs/developer/postman-api/postman-mcp-server/set-up-postman-mcp-server)
161
-
162
- `rules` manages strict engineering policy and a generated codebase tech map:
166
+ ### Interactive Postman workspace selection
163
167
 
164
168
  ```bash
165
- cbx rules init --platform antigravity
166
- cbx rules init --platform codex
167
- cbx rules init --platform copilot
168
- cbx rules init --platform codex --scope global
169
- cbx rules tech-md --overwrite
170
- cbx rules init --platform codex --dry-run
169
+ cbx workflows install --platform codex --bundle agent-environment-setup --postman
171
170
  ```
172
171
 
173
- What `cbx rules init` does:
174
-
175
- - Creates `ENGINEERING_RULES.md` next to the active platform rule file.
176
- - Appends/patches one managed engineering block in that rule file.
177
- - Generates `TECH.md` at workspace root by scanning the current codebase.
178
- - Preserves user content outside managed markers.
179
-
180
- `TECH.md` scanner coverage (deterministic, no AI calls):
181
-
182
- - Language/file signals from workspace scan.
183
- - JS/TS package signals from `package.json` (including nested/monorepo package files).
184
- - Flutter/Dart package signals from `pubspec.yaml`.
185
- - Go module signals from `go.mod`.
186
- - Python package signals from `requirements*.txt` and `pyproject.toml`.
187
- - Rust crate signals from `Cargo.toml`.
188
-
189
- ### Deprecated Alias
190
-
191
- `cbx skills ...` still works for one minor cycle and prints a deprecation notice.
192
-
193
- ## Bundle Catalog
172
+ If `POSTMAN_API_KEY` is available and `--yes` is not used, installer can show workspace chooser and save selected `workspaceId` in active Postman profile.
194
173
 
195
- Catalog root:
174
+ ### Manual workspace ID
196
175
 
197
- ```text
198
- Ai Agent Workflow/workflows/
176
+ ```bash
177
+ cbx workflows install --platform codex --bundle agent-environment-setup --postman --postman-workspace-id "<workspace-id>" --yes
199
178
  ```
200
179
 
201
- First bundled profile:
202
-
203
- - `agent-environment-setup`
204
-
205
- Bundle manifest:
180
+ Clear workspace ID:
206
181
 
207
- ```text
208
- Ai Agent Workflow/workflows/agent-environment-setup/manifest.json
182
+ ```bash
183
+ cbx workflows install --platform codex --bundle agent-environment-setup --postman --postman-workspace-id null --yes
209
184
  ```
210
185
 
211
- Bundle contains platform-specific:
212
-
213
- - workflow templates (`workflows/*.md`)
214
- - specialist agent templates (`agents/*.md`)
215
- - mapped reusable skills copied from `Ai Agent Workflow/skills/<id>/`
216
- - Codex callable wrapper skills generated from workflow/agent templates
217
- - rule templates (`rules/*.md`)
218
-
219
- ## Installed Capability Set (v1)
220
-
221
- Database capability stack:
222
-
223
- - `database-skills` (engine hub)
224
- - `database-design` (schema/migration design)
225
- - `database-optimizer` (query/index/tuning triage)
226
- - `drift-flutter` (Flutter local persistence)
227
-
228
- Core workflows:
229
-
230
- - `/brainstorm`
231
- - `/plan`
232
- - `/create`
233
- - `/test`
234
- - `/debug`
235
- - `/implement-track`
236
- - `/backend`
237
- - `/security`
238
- - `/database`
239
- - `/mobile`
240
- - `/devops`
241
- - `/qa`
242
-
243
- Routing behavior:
244
-
245
- - Antigravity/Copilot: workflow + agent markdown can be routed by platform conventions.
246
- - Codex: use generated callable wrapper skills (`$workflow-*`, `$agent-*`).
247
- - Example for backend intent in Codex: `$workflow-backend` or `$agent-backend-specialist`.
248
- - Backend workflow policy: always include OpenAPI updates plus Swagger UI and Stoplight Elements status in output.
249
-
250
- ### Codex Runtime Mode
186
+ If config already exists and you want to overwrite saved values:
251
187
 
252
- Codex does not currently execute custom workflow slash commands or custom `@agent` markdown files as first-class runtime entities.
253
- Codex skill invocation syntax is `$skill-name` (not `@agent-name`).
254
-
255
- `cbx` handles this by generating callable Codex skills:
256
-
257
- - Workflow wrappers: `$workflow-<name>` (for example `$workflow-review`, `$workflow-plan`)
258
- - Agent wrappers: `$agent-<name>` (for example `$agent-backend-specialist`)
259
-
260
- Use these wrappers directly in Codex prompts.
261
- Do not rely on custom `/workflow` execution or custom `@agent` invocation in Codex runtime.
262
-
263
- ## Platform Paths
264
-
265
- ### Antigravity
266
-
267
- Project scope:
268
-
269
- - Workflows: `.agent/workflows`
270
- - Agents: `.agent/agents`
271
- - Skills: `.agent/skills`
272
- - Rules: `.agent/rules/GEMINI.md`
273
- - Terminal integration (optional): `.agent/terminal-integration`
274
-
275
- Global scope:
276
-
277
- - Skills: `~/.gemini/antigravity/skills`
278
- - Rules: `~/.gemini/GEMINI.md`
279
- - Workflows/agents/terminal-integration: default install keeps these in workspace (`.agent/...`) paths.
280
-
281
- ### Antigravity Terminal Integration (Optional)
282
-
283
- Install-time options:
284
-
285
- - `--terminal-integration`
286
- - `--terminal-verifier <codex|gemini>`
287
-
288
- Behavior:
289
-
290
- - Interactive installs prompt whether to enable terminal verification integration.
291
- - If enabled, cbx writes managed scripts/config under `.agent/terminal-integration`.
292
- - cbx also writes a managed terminal verification block into Antigravity rule files so post-task verification commands are explicit.
293
- - Removing the bundle cleans the managed terminal integration directory and block.
294
-
295
- ### Codex
296
-
297
- Project scope:
298
-
299
- - Workflow templates (reference docs): `.agents/workflows`
300
- - Skills: `.agents/skills`
301
- - Rules: `AGENTS.md`
302
- - Agents: not installed for Codex runtime
303
- - Callable wrappers: generated into `.agents/skills` as:
304
- - `workflow-<workflow-id>`
305
- - `agent-<agent-id>`
306
- - Example usage: `$workflow-plan`, `$agent-backend-specialist`
307
-
308
- Global scope:
309
-
310
- - Skills: `~/.agents/skills`
311
- - Rules: `~/.codex/AGENTS.md`
312
- - Workflow templates (reference docs): default install keeps these in workspace `.agents/workflows`
313
- - Agents: not installed for Codex runtime
314
-
315
- Legacy compatibility note:
316
-
317
- - `.codex/skills` is treated as legacy and flagged by `doctor` with migration guidance.
318
-
319
- ### Copilot
188
+ ```bash
189
+ cbx workflows install --platform codex --bundle agent-environment-setup --postman --overwrite --yes
190
+ ```
320
191
 
321
- Project scope:
192
+ ### StitchMCP (Antigravity)
193
+
194
+ Antigravity includes managed Stitch MCP support using active Stitch profile from `cbx_config.json`.
195
+
196
+ Default managed command template:
197
+
198
+ ```json
199
+ {
200
+ "StitchMCP": {
201
+ "$typeName": "exa.cascade_plugins_pb.CascadePluginCommandTemplate",
202
+ "command": "npx",
203
+ "args": [
204
+ "-y",
205
+ "mcp-remote",
206
+ "https://stitch.googleapis.com/mcp",
207
+ "--header",
208
+ "X-Goog-Api-Key: ur stitch key"
209
+ ],
210
+ "env": {}
211
+ }
212
+ }
213
+ ```
322
214
 
323
- - Workflows: `.github/copilot/workflows`
324
- - Agents: `.github/agents`
325
- - Skills: `.github/skills`
326
- - Rules: `AGENTS.md` (preferred), fallback `.github/copilot-instructions.md`
327
- - Skill schema note: `cbx` normalizes Copilot skill frontmatter by removing unsupported top-level keys like `displayName` and `keywords` during install.
215
+ ## MCP Placement Matrix
328
216
 
329
- Global scope:
217
+ Managed MCP definition files (`.cbx/mcp/...`):
218
+ - Global scope: `~/.cbx/mcp/<platform>/postman.json`
219
+ - Project scope: `<workspace>/.cbx/mcp/<platform>/postman.json`
330
220
 
331
- - Skills: `~/.copilot/skills`
332
- - Rules: `~/.copilot/copilot-instructions.md`
333
- - Workflows/agents: default install keeps these in workspace (`.github/...`) paths.
221
+ Runtime target patching:
334
222
 
335
- ## Rule Auto-Sync
223
+ Codex:
224
+ - Global MCP runtime target: `~/.codex/config.toml` (via `codex mcp add/remove`)
225
+ - Project MCP runtime target: `<workspace>/.vscode/mcp.json`
336
226
 
337
- `cbx` maintains a single managed block in the active platform rule file.
227
+ Antigravity:
228
+ - Global runtime target: `~/.gemini/settings.json` (`mcpServers`)
229
+ - Project runtime target: `<workspace>/.gemini/settings.json` (`mcpServers`)
338
230
 
339
- Markers:
231
+ Copilot:
232
+ - Global runtime target: `~/.copilot/mcp-config.json` (`servers`)
233
+ - Project runtime target: `<workspace>/.vscode/mcp.json` (`servers`)
340
234
 
341
- ```md
342
- <!-- cbx:workflows:auto:start platform=<platform-id> version=1 -->
235
+ ## Command Reference
343
236
 
344
- ...
237
+ ### Install / Remove / Doctor / Rule Sync
345
238
 
346
- <!-- cbx:workflows:auto:end -->
239
+ ```bash
240
+ cbx workflows install --platform <codex|antigravity|copilot> --bundle agent-environment-setup
241
+ cbx workflows remove <bundle-or-workflow> --platform <platform>
242
+ cbx workflows doctor --platform <platform> --scope <project|global>
243
+ cbx workflows sync-rules --platform <platform> --scope <project|global>
347
244
  ```
348
245
 
349
- Behavior:
350
-
351
- - Preserves user content outside markers.
352
- - Replaces first valid managed block in place.
353
- - Appends a managed block if missing.
354
- - On malformed/multiple markers, patches first valid range and warns.
355
- - Keeps markers even when no workflows are installed.
246
+ ### Config commands
356
247
 
357
- ## Scope and Detection
358
-
359
- Default scope:
248
+ ```bash
249
+ # Show config (+ computed status block)
250
+ cbx workflows config --scope global --show
360
251
 
361
- - Install/init commands:
362
- - `cbx workflows install`
363
- - `cbx workflows init`
364
- - `cbx skills install`
365
- - `cbx skills init`
366
- - `cbx install` (legacy alias)
367
- - `cbx init` (legacy alias)
368
- - Default scope for these commands is `global`.
369
- - In this default global mode, only skills/powers install globally. Workflows/agents and rule/engineering files remain workspace-scoped.
370
- - Other workflow/rules commands default to `project`.
252
+ # Edit active Postman workspace ID
253
+ cbx workflows config --scope global --edit
254
+ cbx workflows config --scope global --workspace-id "<workspace-id>"
255
+ cbx workflows config --scope global --clear-workspace-id
256
+ ```
371
257
 
372
- Optional:
258
+ `--show` now includes computed `status`:
259
+ - stored source (from active profile config)
260
+ - effective source (resolved at runtime with env)
261
+ - active profile name
262
+ - effective env var alias
373
263
 
374
- - `--scope global`
375
- - `--scope project`
264
+ ### Rules commands
376
265
 
377
- Platform auto-detection:
266
+ ```bash
267
+ cbx rules init --platform <platform> --scope project --overwrite
268
+ cbx rules tech-md --overwrite
269
+ ```
378
270
 
379
- - Uses repo markers for Antigravity/Codex/Copilot.
380
- - Prompts when ambiguous.
381
- - Remembers last selected platform in local state.
271
+ ### Legacy alias
382
272
 
383
- State files:
273
+ `cbx skills ...` remains as a compatibility alias for `cbx workflows ...`.
384
274
 
385
- - Project: `.cbx/workflows-state.json`
386
- - Global: `~/.cbx/state.json`
275
+ ## Troubleshooting
387
276
 
388
- ## Dry Run
277
+ ### `MCP startup failed: Environment variable POSTMAN_API_KEY ... is not set`
389
278
 
390
- Preview mode is supported on install/remove/sync:
279
+ Cause:
280
+ - Active profile uses env alias but variable is not exported in current shell/process.
391
281
 
282
+ Fix:
392
283
  ```bash
393
- cbx workflows install --platform antigravity --bundle agent-environment-setup --dry-run
394
- cbx workflows install --platform antigravity --bundle agent-environment-setup --terminal-integration --terminal-verifier codex --dry-run
395
- cbx workflows remove agent-environment-setup --platform antigravity --dry-run
396
- cbx workflows sync-rules --platform codex --dry-run
284
+ export POSTMAN_API_KEY="<key>"
285
+ cbx workflows config --scope global --show
397
286
  ```
398
287
 
399
- Dry-run behavior:
400
-
401
- - prints planned file changes
402
- - prints planned managed-block action (`would-create`/`would-patch`)
403
- - does not write files
404
- - does not update state files
288
+ Then confirm `status.postman.effectiveSource` is `env`.
405
289
 
406
- ## Full Smoke Test Sample
407
-
408
- Use this script-style sequence to validate end-to-end behavior:
290
+ ### `apiKeySource` looks unset even after export
409
291
 
292
+ Use:
410
293
  ```bash
411
- # 1) Create isolated workspace
412
- TMP_DIR="$(mktemp -d /tmp/cbx-smoke.XXXXXX)"
413
- cd "$TMP_DIR"
414
-
415
- # 2) Antigravity preview + apply + doctor
416
- cbx workflows install --platform antigravity --bundle agent-environment-setup --dry-run
417
- cbx workflows install --platform antigravity --bundle agent-environment-setup --terminal-integration --terminal-verifier codex --yes
418
- cbx workflows doctor antigravity --json
419
-
420
- # 3) Codex preview + apply + doctor
421
- mkdir -p .codex/skills # optional: simulate legacy path warning
422
- cbx workflows install --platform codex --bundle agent-environment-setup --dry-run
423
- cbx workflows install --platform codex --bundle agent-environment-setup --yes
424
- cbx workflows doctor codex --json
425
- # Codex runtime usage (in prompt): $workflow-review or $agent-backend-specialist
426
-
427
- # 4) Copilot preview + apply + doctor
428
- cbx workflows install --platform copilot --bundle agent-environment-setup --dry-run
429
- cbx workflows install --platform copilot --bundle agent-environment-setup --yes
430
- cbx workflows doctor copilot --json
431
-
432
- # 5) Remove bundle preview + apply
433
- cbx workflows remove agent-environment-setup --platform antigravity --dry-run
434
- cbx workflows remove agent-environment-setup --platform antigravity --yes
294
+ cbx workflows config --scope global --show
435
295
  ```
436
296
 
437
- ## Doctor Checks
438
-
439
- `cbx workflows doctor` validates:
297
+ Check these fields:
298
+ - `status.postman.storedSource`
299
+ - `status.postman.effectiveSource`
300
+ - `status.postman.effectiveEnvVar`
440
301
 
441
- - workflow/agent/skill path existence
442
- - active rule file status
443
- - managed block health
444
- - Codex wrapper-skill readiness (`$workflow-*`, `$agent-*`) through installed skills path
445
- - Codex legacy path warnings (`.codex/skills`)
446
- - Antigravity `.gitignore` warning for `.agent/` with recommendation to use `.git/info/exclude` for local-only excludes
447
- - Antigravity terminal integration status (directory/config/rule block)
448
- - Copilot project/global path health (`.github/agents`, `.github/skills`, `AGENTS.md` / `.github/copilot-instructions.md`)
302
+ If stored source is env but effective source is unset, your env var alias is missing in the running process.
449
303
 
450
- ## Conductor Integration
304
+ ### Existing config skipped during install
451
305
 
452
- No automatic Conductor installation is performed.
306
+ If installer says config was skipped:
307
+ - Re-run with `--overwrite`, or
308
+ - Use `cbx workflows config` / `cbx workflows config keys ...` to mutate existing config.
453
309
 
454
- If Conductor artifacts already exist, workflows may reference them as supporting context.
310
+ ### Duplicate skills shown in UI after older installs
455
311
 
456
- ## Development
312
+ Installer now auto-cleans nested duplicate skills (for example duplicates under `postman/*`).
457
313
 
458
- Run CLI help locally:
314
+ Run refresh install:
459
315
 
460
316
  ```bash
461
- node bin/cubis.js --help
317
+ cbx workflows install --platform codex --bundle agent-environment-setup --overwrite --yes
462
318
  ```
463
319
 
464
- Run attribute validation (non-strict):
320
+ ### Legacy Postman config file exists without `cbx_config.json`
465
321
 
466
- ```bash
467
- npm run test:attributes
468
- ```
469
-
470
- Run attribute validation (strict, fails on warnings):
322
+ Behavior is now hard-fail. Create/repair `cbx_config.json` first:
471
323
 
472
324
  ```bash
473
- npm run test:attributes:strict
325
+ cbx workflows config --scope global --clear-workspace-id
474
326
  ```
475
327
 
476
- Run TECH.md scanner integration tests:
328
+ ## Migration Notes
477
329
 
478
- ```bash
479
- npm run test:tech-md
480
- ```
330
+ ### Behavior changes in this release
481
331
 
482
- Run full workflow smoke test:
332
+ - `cbx_config.json` is now the only supported config source for Postman/Stitch credentials.
333
+ - Multi-profile key model added (`profiles[]` + `activeProfileName`).
334
+ - `config keys` commands added (`list/add/use/remove`).
335
+ - `config --show` now reports stored vs effective auth source.
336
+ - Install now defaults to indexed top-level all-skill install.
337
+ - Nested duplicate skill directories are auto-cleaned during install.
483
338
 
484
- ```bash
485
- bash scripts/smoke-workflows.sh
486
- ```
487
-
488
- Run the full suite:
339
+ ### Suggested refresh
489
340
 
490
341
  ```bash
491
- npm run test:all
492
- ```
493
-
494
- Run the full suite in strict mode:
495
-
496
- ```bash
497
- npm run test:all:strict
342
+ npm install -g @cubis/foundry
343
+ cbx workflows install --platform codex --bundle agent-environment-setup --overwrite --yes
344
+ cbx workflows config --scope global --show
498
345
  ```
499
346
 
500
- ## References
347
+ ## Platform Docs
501
348
 
502
- - [antigravity-kit](https://github.com/vudovn/antigravity-kit)
503
- - [Codex Skills](https://developers.openai.com/codex/skills/)
504
- - [Codex AGENTS Guide](https://developers.openai.com/codex/guides/agents-md)
505
- - [Codex Config Basics](https://developers.openai.com/codex/config-basic)
506
- - [OpenCode Skills](https://opencode.ai/docs/skills/)
507
- - [OpenCode Rules](https://opencode.ai/docs/rules/)
508
- - [Claude Code Skills](https://docs.anthropic.com/en/docs/claude-code/skills)
509
- - [GitHub Copilot Skills](https://docs.github.com/en/copilot/how-tos/context/configure-custom-instructions/add-repository-instructions#using-skills-to-group-custom-instructions)
349
+ - Postman API keys: <https://learning.postman.com/docs/developer/postman-api/authentication/>
350
+ - Postman MCP setup: <https://learning.postman.com/docs/developer/postman-api/postman-mcp-server/set-up-postman-mcp-server>
351
+ - Google Stitch MCP: <https://developers.google.com/stitch>