@cubis/foundry 0.3.53 → 0.3.55
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/CHANGELOG.md +60 -0
- package/README.md +109 -3
- package/bin/cubis.js +5 -10286
- package/dist/cli/commands/register.js +88 -0
- package/dist/cli/commands/register.js.map +1 -0
- package/dist/cli/config/index.js +2 -0
- package/dist/cli/config/index.js.map +1 -0
- package/dist/cli/constants.js +4 -0
- package/dist/cli/constants.js.map +1 -0
- package/dist/cli/core.js +9173 -0
- package/dist/cli/core.js.map +1 -0
- package/dist/cli/index.js +3 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init/banner.js +21 -0
- package/dist/cli/init/banner.js.map +1 -0
- package/dist/cli/init/execute.js +65 -0
- package/dist/cli/init/execute.js.map +1 -0
- package/dist/cli/init/index.js +5 -0
- package/dist/cli/init/index.js.map +1 -0
- package/dist/cli/init/prompts.js +122 -0
- package/dist/cli/init/prompts.js.map +1 -0
- package/dist/cli/init/types.js +2 -0
- package/dist/cli/init/types.js.map +1 -0
- package/dist/cli/io.js +2 -0
- package/dist/cli/io.js.map +1 -0
- package/dist/cli/mcp/commands.js +67 -0
- package/dist/cli/mcp/commands.js.map +1 -0
- package/dist/cli/mcp/index.js +2 -0
- package/dist/cli/mcp/index.js.map +1 -0
- package/dist/cli/pathing.js +51 -0
- package/dist/cli/pathing.js.map +1 -0
- package/dist/cli/platforms.js +2 -0
- package/dist/cli/platforms.js.map +1 -0
- package/dist/cli/rules/commands.js +26 -0
- package/dist/cli/rules/commands.js.map +1 -0
- package/dist/cli/rules/index.js +2 -0
- package/dist/cli/rules/index.js.map +1 -0
- package/dist/cli/tech/index.js +2 -0
- package/dist/cli/tech/index.js.map +1 -0
- package/dist/cli/types.js +2 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/workflows/commands.js +74 -0
- package/dist/cli/workflows/commands.js.map +1 -0
- package/dist/cli/workflows/index.js +2 -0
- package/dist/cli/workflows/index.js.map +1 -0
- package/package.json +17 -6
- package/src/cli/commands/register.ts +163 -0
- package/src/cli/config/index.ts +1 -0
- package/src/cli/constants.ts +3 -0
- package/src/cli/core.ts +11325 -0
- package/src/cli/index.ts +3 -0
- package/src/cli/init/banner.ts +20 -0
- package/src/cli/init/execute.ts +88 -0
- package/src/cli/init/index.ts +4 -0
- package/src/cli/init/prompts.ts +163 -0
- package/src/cli/init/types.ts +43 -0
- package/src/cli/io.ts +1 -0
- package/src/cli/mcp/commands.ts +131 -0
- package/src/cli/mcp/index.ts +1 -0
- package/src/cli/pathing.ts +50 -0
- package/src/cli/platforms.ts +1 -0
- package/src/cli/rules/commands.ts +40 -0
- package/src/cli/rules/index.ts +1 -0
- package/src/cli/tech/index.ts +1 -0
- package/src/cli/types.ts +15 -0
- package/src/cli/workflows/commands.ts +163 -0
- package/src/cli/workflows/index.ts +1 -0
- package/tsconfig.cli.json +19 -0
- package/workflows/workflows/agent-environment-setup/platforms/antigravity/rules/GEMINI.md +18 -40
- package/workflows/workflows/agent-environment-setup/platforms/codex/rules/AGENTS.md +18 -41
- package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/AGENTS.md +18 -40
- package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/copilot-instructions.md +18 -40
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type {
|
|
3
|
+
CommandDecorator,
|
|
4
|
+
WorkflowAction,
|
|
5
|
+
WorkflowDoctorAction,
|
|
6
|
+
WorkflowTargetAction,
|
|
7
|
+
} from "../types.js";
|
|
8
|
+
|
|
9
|
+
export interface WorkflowCommandDeps {
|
|
10
|
+
withInstallOptions: CommandDecorator;
|
|
11
|
+
withWorkflowBaseOptions: CommandDecorator;
|
|
12
|
+
registerConfigKeysSubcommands: (configCommand: Command) => void;
|
|
13
|
+
runWorkflowInstall: WorkflowAction;
|
|
14
|
+
runWorkflowRemove: WorkflowTargetAction;
|
|
15
|
+
runWorkflowRemoveAll: WorkflowAction;
|
|
16
|
+
runWorkflowPruneSkills: WorkflowAction;
|
|
17
|
+
runWorkflowSyncRules: WorkflowAction;
|
|
18
|
+
runWorkflowDoctor: WorkflowDoctorAction;
|
|
19
|
+
runWorkflowConfig: WorkflowAction;
|
|
20
|
+
printPlatforms: () => void;
|
|
21
|
+
defaultSkillProfile: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function registerWorkflowCommands(
|
|
25
|
+
program: Command,
|
|
26
|
+
deps: WorkflowCommandDeps,
|
|
27
|
+
) {
|
|
28
|
+
const workflowsCommand = program
|
|
29
|
+
.command("workflows")
|
|
30
|
+
.description(
|
|
31
|
+
"Install and manage workflow bundles for Antigravity, Codex, and Copilot",
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
workflowsCommand
|
|
35
|
+
.command("platforms")
|
|
36
|
+
.description("List workflow platform ids and defaults")
|
|
37
|
+
.action(deps.printPlatforms);
|
|
38
|
+
|
|
39
|
+
deps
|
|
40
|
+
.withInstallOptions(
|
|
41
|
+
workflowsCommand
|
|
42
|
+
.command("install")
|
|
43
|
+
.description("Install a workflow bundle into the selected platform"),
|
|
44
|
+
)
|
|
45
|
+
.action(deps.runWorkflowInstall);
|
|
46
|
+
|
|
47
|
+
deps
|
|
48
|
+
.withWorkflowBaseOptions(
|
|
49
|
+
workflowsCommand
|
|
50
|
+
.command("remove <bundle-or-workflow>")
|
|
51
|
+
.description("Remove an installed bundle or workflow and sync rules")
|
|
52
|
+
.option("--dry-run", "preview remove and sync without writing files")
|
|
53
|
+
.option("-y, --yes", "skip interactive confirmation"),
|
|
54
|
+
)
|
|
55
|
+
.action(deps.runWorkflowRemove);
|
|
56
|
+
|
|
57
|
+
workflowsCommand
|
|
58
|
+
.command("remove-all")
|
|
59
|
+
.description(
|
|
60
|
+
"Remove all CBX-managed generated artifacts (workflows/agents/skills/rules/MCP config)",
|
|
61
|
+
)
|
|
62
|
+
.option(
|
|
63
|
+
"-p, --platform <platform>",
|
|
64
|
+
"target platform id or 'all' (default: all)",
|
|
65
|
+
"all",
|
|
66
|
+
)
|
|
67
|
+
.option(
|
|
68
|
+
"--scope <scope>",
|
|
69
|
+
"target scope: project|global|all (default: all)",
|
|
70
|
+
"all",
|
|
71
|
+
)
|
|
72
|
+
.option(
|
|
73
|
+
"--target <path>",
|
|
74
|
+
"remove project-scope artifacts from target project directory",
|
|
75
|
+
)
|
|
76
|
+
.option(
|
|
77
|
+
"--include-credentials",
|
|
78
|
+
"also remove ~/.cbx/credentials.env when scope includes global",
|
|
79
|
+
)
|
|
80
|
+
.option("--dry-run", "preview remove operations without writing files")
|
|
81
|
+
.option("-y, --yes", "skip interactive confirmation")
|
|
82
|
+
.action(deps.runWorkflowRemoveAll);
|
|
83
|
+
|
|
84
|
+
deps
|
|
85
|
+
.withWorkflowBaseOptions(
|
|
86
|
+
workflowsCommand
|
|
87
|
+
.command("prune-skills")
|
|
88
|
+
.description(
|
|
89
|
+
"Prune nested duplicates and out-of-profile installed skills",
|
|
90
|
+
)
|
|
91
|
+
.option(
|
|
92
|
+
"-b, --bundle <bundle>",
|
|
93
|
+
"bundle id (default: agent-environment-setup)",
|
|
94
|
+
)
|
|
95
|
+
.option(
|
|
96
|
+
"--skill-profile <profile>",
|
|
97
|
+
"skill prune profile: core|web-backend|full (default: core)",
|
|
98
|
+
deps.defaultSkillProfile,
|
|
99
|
+
)
|
|
100
|
+
.option("--all-skills", "alias for --skill-profile full")
|
|
101
|
+
.option(
|
|
102
|
+
"--dry-run",
|
|
103
|
+
"preview prune operations without deleting files",
|
|
104
|
+
)
|
|
105
|
+
.option("-y, --yes", "skip interactive confirmation"),
|
|
106
|
+
)
|
|
107
|
+
.action(deps.runWorkflowPruneSkills);
|
|
108
|
+
|
|
109
|
+
deps
|
|
110
|
+
.withWorkflowBaseOptions(
|
|
111
|
+
workflowsCommand
|
|
112
|
+
.command("sync-rules")
|
|
113
|
+
.description(
|
|
114
|
+
"Rebuild the managed workflow routing block for the selected platform",
|
|
115
|
+
)
|
|
116
|
+
.option("--dry-run", "preview managed rule sync without writing files")
|
|
117
|
+
.option("--json", "output JSON"),
|
|
118
|
+
)
|
|
119
|
+
.action(deps.runWorkflowSyncRules);
|
|
120
|
+
|
|
121
|
+
deps
|
|
122
|
+
.withWorkflowBaseOptions(
|
|
123
|
+
workflowsCommand
|
|
124
|
+
.command("doctor [platform]")
|
|
125
|
+
.description(
|
|
126
|
+
"Validate workflow paths, rule file status, and managed block health",
|
|
127
|
+
)
|
|
128
|
+
.option("--json", "output JSON"),
|
|
129
|
+
)
|
|
130
|
+
.action(deps.runWorkflowDoctor);
|
|
131
|
+
|
|
132
|
+
const workflowsConfigCommand = workflowsCommand
|
|
133
|
+
.command("config")
|
|
134
|
+
.description("View or edit cbx_config.json from terminal")
|
|
135
|
+
.option(
|
|
136
|
+
"-p, --platform <platform>",
|
|
137
|
+
"target platform id for MCP target patch",
|
|
138
|
+
)
|
|
139
|
+
.option(
|
|
140
|
+
"--scope <scope>",
|
|
141
|
+
"config scope: project|workspace|global|user",
|
|
142
|
+
"global",
|
|
143
|
+
)
|
|
144
|
+
.option("--show", "show current config (default when no edit flags)")
|
|
145
|
+
.option("--edit", "edit Postman default workspace ID interactively")
|
|
146
|
+
.option("--workspace-id <id|null>", "set postman.defaultWorkspaceId")
|
|
147
|
+
.option("--clear-workspace-id", "set postman.defaultWorkspaceId to null")
|
|
148
|
+
.option(
|
|
149
|
+
"--postman-mode <mode>",
|
|
150
|
+
"set postman.mcpUrl via mode: minimal|code|full",
|
|
151
|
+
)
|
|
152
|
+
.option("--mcp-runtime <runtime>", "set mcp.runtime: docker|local")
|
|
153
|
+
.option("--mcp-fallback <fallback>", "set mcp.fallback: local|fail|skip")
|
|
154
|
+
.option("--show-after", "print JSON after update")
|
|
155
|
+
.option("--dry-run", "preview changes without writing files")
|
|
156
|
+
.action(deps.runWorkflowConfig);
|
|
157
|
+
|
|
158
|
+
deps.registerConfigKeysSubcommands(workflowsConfigCommand);
|
|
159
|
+
|
|
160
|
+
workflowsCommand.action(() => {
|
|
161
|
+
workflowsCommand.help();
|
|
162
|
+
});
|
|
163
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"lib": ["ES2022"],
|
|
7
|
+
"outDir": "dist/cli",
|
|
8
|
+
"rootDir": "src/cli",
|
|
9
|
+
"strict": false,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"declaration": false,
|
|
15
|
+
"sourceMap": true
|
|
16
|
+
},
|
|
17
|
+
"include": ["src/cli/**/*.ts"],
|
|
18
|
+
"exclude": ["node_modules", "dist"]
|
|
19
|
+
}
|
|
@@ -14,18 +14,18 @@ This file defines mandatory behavior for Antigravity projects installed via `cbx
|
|
|
14
14
|
- Gemini commands: `.gemini/commands`
|
|
15
15
|
- Rules file: `.agent/rules/GEMINI.md`
|
|
16
16
|
|
|
17
|
-
## Startup Transparency (
|
|
17
|
+
## Startup Transparency (Minimal)
|
|
18
18
|
|
|
19
|
-
Before
|
|
19
|
+
Before substantial work, publish one short status line only:
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
2. MCP status: confirm Foundry MCP server (`cbx-mcp`) is reachable; if unavailable, declare "MCP offline — fallback mode" and continue without blocking.
|
|
23
|
-
3. Workflow decision (`/workflow` or direct mode) and why it was chosen.
|
|
24
|
-
4. Agent routing decision (`@agent` or direct mode) and why it was chosen.
|
|
25
|
-
5. Skill loading decision: skill IDs selected, how they were discovered, and why.
|
|
21
|
+
`Status: rules=<files> | mcp=<ok|offline> | route=<workflow|direct> | agent=<agent|direct> | skills=<ids|none>`
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
Rules:
|
|
24
|
+
|
|
25
|
+
1. Emit this once at task start; send an update only when routing materially changes.
|
|
26
|
+
2. Do not print tool-call transcripts (for example: "Explored ...", "Ran command ...") unless the user explicitly asks for verbose trace logs.
|
|
27
|
+
3. Keep progress updates to one short sentence.
|
|
28
|
+
4. For pure Q&A replies, skip the status line.
|
|
29
29
|
|
|
30
30
|
## 2) Workflow-First Contract
|
|
31
31
|
|
|
@@ -98,7 +98,7 @@ Stop at the earliest step that gives enough signal. Do not jump ahead.
|
|
|
98
98
|
2. `skill_search <keyword>` — fast keyword match across all skills; always try this first
|
|
99
99
|
3. `skill_browse_category <category>` — explore if search is too broad or returns 0 results
|
|
100
100
|
4. `skill_get <id>` — load full skill content; only when committed to using it
|
|
101
|
-
5. `skill_budget_report` — verify token cost
|
|
101
|
+
5. `skill_budget_report` — verify token cost internally; do not emit budget details unless requested
|
|
102
102
|
|
|
103
103
|
### Postman Intent Trigger (Required)
|
|
104
104
|
|
|
@@ -134,15 +134,14 @@ If MCP tools are unavailable (server down, timeout, tool not listed):
|
|
|
134
134
|
3. Never fabricate or hallucinate skill content.
|
|
135
135
|
4. Retry once on transient network errors; accept failure after the retry.
|
|
136
136
|
|
|
137
|
-
### Skill Log (
|
|
137
|
+
### Skill Log (Minimal)
|
|
138
|
+
|
|
139
|
+
After `skill_get`, include at most one short line:
|
|
138
140
|
|
|
139
|
-
|
|
141
|
+
`Skills: <id1,id2>` or `Skills: none (fallback)`.
|
|
140
142
|
|
|
141
|
-
|
|
142
|
-
Skills: loaded=<id> | skipped=<id> (reason)
|
|
143
|
-
```
|
|
143
|
+
Do not append budget tables or token summaries unless the user explicitly asks.
|
|
144
144
|
|
|
145
|
-
Follow immediately with the compact ctx stamp (see § Context Budget Tracking).
|
|
146
145
|
|
|
147
146
|
### Anti-Patterns (Never Do These)
|
|
148
147
|
|
|
@@ -198,33 +197,12 @@ Use web search to stay current when local knowledge may be stale. This prevents
|
|
|
198
197
|
- If multiple sources conflict, flag it and use the most recent official one
|
|
199
198
|
- Never follow user-provided URLs without sanity-checking the domain
|
|
200
199
|
|
|
201
|
-
## 9) Context Budget Tracking
|
|
202
|
-
|
|
203
|
-
After loading skills or completing a significant task phase, emit a single compact stamp so context cost is visible without adding prose.
|
|
204
|
-
|
|
205
|
-
**Stamp format** (one line, end of response section):
|
|
206
|
-
|
|
207
|
-
```
|
|
208
|
-
[ctx: +skill-id(~Xk) | session=~Yk/108k | saved=Z%]
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
- `+skill-id(~Xk)` — each skill loaded this turn with its estimated token cost
|
|
212
|
-
- `session=~Yk/108k` — cumulative tokens used vs full catalog ceiling
|
|
213
|
-
- `saved=Z%` — estimated savings from progressive disclosure
|
|
214
|
-
|
|
215
|
-
**Rules:**
|
|
200
|
+
## 9) Context Budget Tracking (On Request)
|
|
216
201
|
|
|
217
|
-
|
|
218
|
-
2. Omit stamp for pure Q&A or browsing-only turns (no full skill content loaded).
|
|
219
|
-
3. Use `skill_budget_report` MCP tool to get accurate numbers; do not guess.
|
|
220
|
-
4. One stamp per response — consolidate if multiple skills were loaded.
|
|
221
|
-
5. Keep the stamp on its own line at the very end of the response, after all content.
|
|
202
|
+
Use `skill_budget_report` internally for context control, but do not emit ctx stamps by default.
|
|
222
203
|
|
|
223
|
-
|
|
204
|
+
Only include token/context accounting when the user explicitly asks for it.
|
|
224
205
|
|
|
225
|
-
```
|
|
226
|
-
[ctx: +flutter-expert(~3k) | session=~3k/108k | saved=97%]
|
|
227
|
-
```
|
|
228
206
|
|
|
229
207
|
## 10) CBX Maintenance Commands
|
|
230
208
|
|
|
@@ -9,19 +9,18 @@ This file defines mandatory behavior for Codex projects installed via `cbx workf
|
|
|
9
9
|
- Skills: `.agents/skills`
|
|
10
10
|
- Rules file: `AGENTS.md`
|
|
11
11
|
|
|
12
|
-
## Startup Transparency (
|
|
12
|
+
## Startup Transparency (Minimal)
|
|
13
13
|
|
|
14
|
-
Before
|
|
14
|
+
Before substantial work, publish one short status line only:
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
2. MCP status: confirm Foundry MCP server (`cbx-mcp`) is reachable; if unavailable, declare "MCP offline — fallback mode" and continue without blocking.
|
|
18
|
-
3. Workflow decision ($workflow-\* or direct mode) and why it was chosen.
|
|
19
|
-
4. Agent routing decision ($agent-\* or direct mode) and why it was chosen.
|
|
20
|
-
5. Skill loading decision: skill IDs selected, how they were discovered, and why.
|
|
16
|
+
`Status: rules=<files> | mcp=<ok|offline> | route=<workflow|direct> | agent=<agent|direct> | skills=<ids|none>`
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
Rules:
|
|
19
|
+
|
|
20
|
+
1. Emit this once at task start; send an update only when routing materially changes.
|
|
21
|
+
2. Do not print tool-call transcripts (for example: "Explored ...", "Ran command ...") unless the user explicitly asks for verbose trace logs.
|
|
22
|
+
3. Keep progress updates to one short sentence.
|
|
23
|
+
4. For pure Q&A replies, skip the status line.
|
|
25
24
|
|
|
26
25
|
## 2) Skill-Based Workflow
|
|
27
26
|
|
|
@@ -96,7 +95,7 @@ Stop at the earliest step that gives enough signal. Do not jump ahead.
|
|
|
96
95
|
2. `skill_search <keyword>` — fast keyword match across all skills; always try this first
|
|
97
96
|
3. `skill_browse_category <category>` — explore if search is too broad or returns 0 results
|
|
98
97
|
4. `skill_get <id>` — load full skill content; only when committed to using it
|
|
99
|
-
5. `skill_budget_report` — verify token cost
|
|
98
|
+
5. `skill_budget_report` — verify token cost internally; do not emit budget details unless requested
|
|
100
99
|
|
|
101
100
|
### Postman Intent Trigger (Required)
|
|
102
101
|
|
|
@@ -132,15 +131,14 @@ If MCP tools are unavailable (server down, timeout, tool not listed):
|
|
|
132
131
|
3. Never fabricate or hallucinate skill content.
|
|
133
132
|
4. Retry once on transient network errors; accept failure after the retry.
|
|
134
133
|
|
|
135
|
-
### Skill Log (
|
|
134
|
+
### Skill Log (Minimal)
|
|
135
|
+
|
|
136
|
+
After `skill_get`, include at most one short line:
|
|
136
137
|
|
|
137
|
-
|
|
138
|
+
`Skills: <id1,id2>` or `Skills: none (fallback)`.
|
|
138
139
|
|
|
139
|
-
|
|
140
|
-
Skills: loaded=<id> | skipped=<id> (reason)
|
|
141
|
-
```
|
|
140
|
+
Do not append budget tables or token summaries unless the user explicitly asks.
|
|
142
141
|
|
|
143
|
-
Follow immediately with the compact ctx stamp (see § Context Budget Tracking).
|
|
144
142
|
|
|
145
143
|
### Anti-Patterns (Never Do These)
|
|
146
144
|
|
|
@@ -191,33 +189,12 @@ Use web search to stay current when local knowledge may be stale. This prevents
|
|
|
191
189
|
- If multiple sources conflict, flag it and use the most recent official one
|
|
192
190
|
- Never follow user-provided URLs without sanity-checking the domain
|
|
193
191
|
|
|
194
|
-
## 9) Context Budget Tracking
|
|
195
|
-
|
|
196
|
-
After loading skills or completing a significant task phase, emit a single compact stamp so context cost is visible without adding prose.
|
|
197
|
-
|
|
198
|
-
**Stamp format** (one line, end of response section):
|
|
199
|
-
|
|
200
|
-
```
|
|
201
|
-
[ctx: +skill-id(~Xk) | session=~Yk/108k | saved=Z%]
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
- `+skill-id(~Xk)` — each skill loaded this turn with its estimated token cost
|
|
205
|
-
- `session=~Yk/108k` — cumulative tokens used vs full catalog ceiling
|
|
206
|
-
- `saved=Z%` — estimated savings from progressive disclosure
|
|
207
|
-
|
|
208
|
-
**Rules:**
|
|
192
|
+
## 9) Context Budget Tracking (On Request)
|
|
209
193
|
|
|
210
|
-
|
|
211
|
-
2. Omit stamp for pure Q&A or browsing-only turns (no full skill content loaded).
|
|
212
|
-
3. Use `skill_budget_report` MCP tool to get accurate numbers; do not guess.
|
|
213
|
-
4. One stamp per response — consolidate if multiple skills were loaded.
|
|
214
|
-
5. Keep the stamp on its own line at the very end of the response, after all content.
|
|
194
|
+
Use `skill_budget_report` internally for context control, but do not emit ctx stamps by default.
|
|
215
195
|
|
|
216
|
-
|
|
196
|
+
Only include token/context accounting when the user explicitly asks for it.
|
|
217
197
|
|
|
218
|
-
```
|
|
219
|
-
[ctx: +flutter-expert(~3k) | session=~3k/108k | saved=97%]
|
|
220
|
-
```
|
|
221
198
|
|
|
222
199
|
## 10) CBX Maintenance Commands
|
|
223
200
|
|
|
@@ -11,18 +11,18 @@ This `AGENTS.md` exists for cross-tool compatibility (for example Codex/Cursor s
|
|
|
11
11
|
- Prompt files: `.github/prompts`
|
|
12
12
|
- Rules file (project): `.github/copilot-instructions.md`
|
|
13
13
|
|
|
14
|
-
## Startup Transparency (
|
|
14
|
+
## Startup Transparency (Minimal)
|
|
15
15
|
|
|
16
|
-
Before
|
|
16
|
+
Before substantial work, publish one short status line only:
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
2. MCP status: confirm Foundry MCP server (`cbx-mcp`) is reachable; if unavailable, declare "MCP offline — fallback mode" and continue without blocking.
|
|
20
|
-
3. Workflow decision (`/workflow` or direct mode) and why it was chosen.
|
|
21
|
-
4. Agent routing decision (`@agent` or direct mode) and why it was chosen.
|
|
22
|
-
5. Skill loading decision: skill IDs selected, how they were discovered, and why.
|
|
18
|
+
`Status: rules=<files> | mcp=<ok|offline> | route=<workflow|direct> | agent=<agent|direct> | skills=<ids|none>`
|
|
23
19
|
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
Rules:
|
|
21
|
+
|
|
22
|
+
1. Emit this once at task start; send an update only when routing materially changes.
|
|
23
|
+
2. Do not print tool-call transcripts (for example: "Explored ...", "Ran command ...") unless the user explicitly asks for verbose trace logs.
|
|
24
|
+
3. Keep progress updates to one short sentence.
|
|
25
|
+
4. For pure Q&A replies, skip the status line.
|
|
26
26
|
|
|
27
27
|
## 2) Workflow-First Contract
|
|
28
28
|
|
|
@@ -103,7 +103,7 @@ Stop at the earliest step that gives enough signal. Do not jump ahead.
|
|
|
103
103
|
2. `skill_search <keyword>` — fast keyword match across all skills; always try this first
|
|
104
104
|
3. `skill_browse_category <category>` — explore if search is too broad or returns 0 results
|
|
105
105
|
4. `skill_get <id>` — load full skill content; only when committed to using it
|
|
106
|
-
5. `skill_budget_report` — verify token cost
|
|
106
|
+
5. `skill_budget_report` — verify token cost internally; do not emit budget details unless requested
|
|
107
107
|
|
|
108
108
|
### Postman Intent Trigger (Required)
|
|
109
109
|
|
|
@@ -139,15 +139,14 @@ If MCP tools are unavailable (server down, timeout, tool not listed):
|
|
|
139
139
|
3. Never fabricate or hallucinate skill content.
|
|
140
140
|
4. Retry once on transient network errors; accept failure after the retry.
|
|
141
141
|
|
|
142
|
-
### Skill Log (
|
|
142
|
+
### Skill Log (Minimal)
|
|
143
|
+
|
|
144
|
+
After `skill_get`, include at most one short line:
|
|
143
145
|
|
|
144
|
-
|
|
146
|
+
`Skills: <id1,id2>` or `Skills: none (fallback)`.
|
|
145
147
|
|
|
146
|
-
|
|
147
|
-
Skills: loaded=<id> | skipped=<id> (reason)
|
|
148
|
-
```
|
|
148
|
+
Do not append budget tables or token summaries unless the user explicitly asks.
|
|
149
149
|
|
|
150
|
-
Follow immediately with the compact ctx stamp (see § Context Budget Tracking).
|
|
151
150
|
|
|
152
151
|
### Anti-Patterns (Never Do These)
|
|
153
152
|
|
|
@@ -198,33 +197,12 @@ Use web search to stay current when local knowledge may be stale. This prevents
|
|
|
198
197
|
- If multiple sources conflict, flag it and use the most recent official one
|
|
199
198
|
- Never follow user-provided URLs without sanity-checking the domain
|
|
200
199
|
|
|
201
|
-
## 10) Context Budget Tracking
|
|
202
|
-
|
|
203
|
-
After loading skills or completing a significant task phase, emit a single compact stamp so context cost is visible without adding prose.
|
|
204
|
-
|
|
205
|
-
**Stamp format** (one line, end of response section):
|
|
206
|
-
|
|
207
|
-
```
|
|
208
|
-
[ctx: +skill-id(~Xk) | session=~Yk/108k | saved=Z%]
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
- `+skill-id(~Xk)` — each skill loaded this turn with its estimated token cost
|
|
212
|
-
- `session=~Yk/108k` — cumulative tokens used vs full catalog ceiling
|
|
213
|
-
- `saved=Z%` — estimated savings from progressive disclosure
|
|
214
|
-
|
|
215
|
-
**Rules:**
|
|
200
|
+
## 10) Context Budget Tracking (On Request)
|
|
216
201
|
|
|
217
|
-
|
|
218
|
-
2. Omit stamp for pure Q&A or browsing-only turns (no full skill content loaded).
|
|
219
|
-
3. Use `skill_budget_report` MCP tool to get accurate numbers; do not guess.
|
|
220
|
-
4. One stamp per response — consolidate if multiple skills were loaded.
|
|
221
|
-
5. Keep the stamp on its own line at the very end of the response, after all content.
|
|
202
|
+
Use `skill_budget_report` internally for context control, but do not emit ctx stamps by default.
|
|
222
203
|
|
|
223
|
-
|
|
204
|
+
Only include token/context accounting when the user explicitly asks for it.
|
|
224
205
|
|
|
225
|
-
```
|
|
226
|
-
[ctx: +flutter-expert(~3k) | session=~3k/108k | saved=97%]
|
|
227
|
-
```
|
|
228
206
|
|
|
229
207
|
## 11) CBX Maintenance Commands
|
|
230
208
|
|
package/workflows/workflows/agent-environment-setup/platforms/copilot/rules/copilot-instructions.md
CHANGED
|
@@ -10,18 +10,18 @@ This file defines mandatory behavior for GitHub Copilot projects installed via `
|
|
|
10
10
|
- Prompt files: `.github/prompts`
|
|
11
11
|
- Rules file (project): `.github/copilot-instructions.md`
|
|
12
12
|
|
|
13
|
-
## Startup Transparency (
|
|
13
|
+
## Startup Transparency (Minimal)
|
|
14
14
|
|
|
15
|
-
Before
|
|
15
|
+
Before substantial work, publish one short status line only:
|
|
16
16
|
|
|
17
|
-
|
|
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.
|
|
17
|
+
`Status: rules=<files> | mcp=<ok|offline> | route=<workflow|direct> | agent=<agent|direct> | skills=<ids|none>`
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
Rules:
|
|
20
|
+
|
|
21
|
+
1. Emit this once at task start; send an update only when routing materially changes.
|
|
22
|
+
2. Do not print tool-call transcripts (for example: "Explored ...", "Ran command ...") unless the user explicitly asks for verbose trace logs.
|
|
23
|
+
3. Keep progress updates to one short sentence.
|
|
24
|
+
4. For pure Q&A replies, skip the status line.
|
|
25
25
|
|
|
26
26
|
## 2) Workflow-First Contract
|
|
27
27
|
|
|
@@ -102,7 +102,7 @@ Stop at the earliest step that gives enough signal. Do not jump ahead.
|
|
|
102
102
|
2. `skill_search <keyword>` — fast keyword match across all skills; always try this first
|
|
103
103
|
3. `skill_browse_category <category>` — explore if search is too broad or returns 0 results
|
|
104
104
|
4. `skill_get <id>` — load full skill content; only when committed to using it
|
|
105
|
-
5. `skill_budget_report` — verify token cost
|
|
105
|
+
5. `skill_budget_report` — verify token cost internally; do not emit budget details unless requested
|
|
106
106
|
|
|
107
107
|
### Postman Intent Trigger (Required)
|
|
108
108
|
|
|
@@ -138,15 +138,14 @@ If MCP tools are unavailable (server down, timeout, tool not listed):
|
|
|
138
138
|
3. Never fabricate or hallucinate skill content.
|
|
139
139
|
4. Retry once on transient network errors; accept failure after the retry.
|
|
140
140
|
|
|
141
|
-
### Skill Log (
|
|
141
|
+
### Skill Log (Minimal)
|
|
142
|
+
|
|
143
|
+
After `skill_get`, include at most one short line:
|
|
142
144
|
|
|
143
|
-
|
|
145
|
+
`Skills: <id1,id2>` or `Skills: none (fallback)`.
|
|
144
146
|
|
|
145
|
-
|
|
146
|
-
Skills: loaded=<id> | skipped=<id> (reason)
|
|
147
|
-
```
|
|
147
|
+
Do not append budget tables or token summaries unless the user explicitly asks.
|
|
148
148
|
|
|
149
|
-
Follow immediately with the compact ctx stamp (see § Context Budget Tracking).
|
|
150
149
|
|
|
151
150
|
### Anti-Patterns (Never Do These)
|
|
152
151
|
|
|
@@ -197,33 +196,12 @@ Use web search to stay current when local knowledge may be stale. This prevents
|
|
|
197
196
|
- If multiple sources conflict, flag it and use the most recent official one
|
|
198
197
|
- Never follow user-provided URLs without sanity-checking the domain
|
|
199
198
|
|
|
200
|
-
## 10) Context Budget Tracking
|
|
201
|
-
|
|
202
|
-
After loading skills or completing a significant task phase, emit a single compact stamp so context cost is visible without adding prose.
|
|
203
|
-
|
|
204
|
-
**Stamp format** (one line, end of response section):
|
|
205
|
-
|
|
206
|
-
```
|
|
207
|
-
[ctx: +skill-id(~Xk) | session=~Yk/108k | saved=Z%]
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
- `+skill-id(~Xk)` — each skill loaded this turn with its estimated token cost
|
|
211
|
-
- `session=~Yk/108k` — cumulative tokens used vs full catalog ceiling
|
|
212
|
-
- `saved=Z%` — estimated savings from progressive disclosure
|
|
213
|
-
|
|
214
|
-
**Rules:**
|
|
199
|
+
## 10) Context Budget Tracking (On Request)
|
|
215
200
|
|
|
216
|
-
|
|
217
|
-
2. Omit stamp for pure Q&A or browsing-only turns (no full skill content loaded).
|
|
218
|
-
3. Use `skill_budget_report` MCP tool to get accurate numbers; do not guess.
|
|
219
|
-
4. One stamp per response — consolidate if multiple skills were loaded.
|
|
220
|
-
5. Keep the stamp on its own line at the very end of the response, after all content.
|
|
201
|
+
Use `skill_budget_report` internally for context control, but do not emit ctx stamps by default.
|
|
221
202
|
|
|
222
|
-
|
|
203
|
+
Only include token/context accounting when the user explicitly asks for it.
|
|
223
204
|
|
|
224
|
-
```
|
|
225
|
-
[ctx: +flutter-expert(~3k) | session=~3k/108k | saved=97%]
|
|
226
|
-
```
|
|
227
205
|
|
|
228
206
|
## 11) CBX Maintenance Commands
|
|
229
207
|
|