Skip to content

Commit d942591

Browse files
committed
fix: preserve CloudBase skill routing checks
1 parent 909a1fc commit d942591

4 files changed

Lines changed: 42 additions & 20 deletions

File tree

config/source/guideline/cloudbase/SKILL.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ If a skill points to its own `references/...` files, keep following those relati
4444

4545
<!-- DO NOT EDIT: auto-generated from references/activation-map.yaml -->
4646

47-
| Scenario | Read first | Then read | Do NOT route to first |
48-
|----------|------------|-----------|------------------------|
49-
| web-auth | `auth-tool` | auth-web, web-development | cloud-functions, http-api |
50-
| miniapp-cloudbase | `miniprogram-development` | auth-wechat, no-sql-wx-mp-sdk | auth-web, web-development |
51-
| native-http-api | `http-api` | auth-tool, relational-database-tool | auth-web, no-sql-web-sdk, web-development |
52-
| web-nosql | `web-development` | no-sql-web-sdk, auth-web | relational-database-tool, http-api |
53-
| mysql-mcp | `relational-database-tool` | relational-database-web, http-api | no-sql-web-sdk, web-development |
54-
| cloud-functions | `cloud-functions` | auth-tool, ai-model-nodejs | cloudrun-development, auth-web |
55-
| cloudrun-backend | `cloudrun-development` | auth-tool, relational-database-tool | cloud-functions |
56-
| ai-agent | `cloudbase-agent` | cloud-functions, cloudrun-development | - |
57-
| ui-first | `ui-design` | web-development, miniprogram-development | cloud-functions |
58-
| ai-web | `web-development` | ai-model-web, ui-design | ai-model-wechat, http-api |
59-
| ops-inspector | `ops-inspector` | cloud-functions, cloudrun-development | ui-design, spec-workflow |
60-
| spec-workflow | `spec-workflow` | cloudbase | web-development, cloud-functions |
47+
| Scenario | Read first | Then read | Do NOT route to first | Must check before action |
48+
|----------|------------|-----------|------------------------|--------------------------|
49+
| Web login / registration / auth UI | `auth-tool` | auth-web, web-development | cloud-functions, http-api | Provider status and publishable key |
50+
| WeChat mini program + CloudBase | `miniprogram-development` | auth-wechat, no-sql-wx-mp-sdk | auth-web, web-development | Whether the project really uses CloudBase / `wx.cloud` |
51+
| Native App / Flutter / React Native | `http-api` | auth-tool, relational-database-tool | auth-web, no-sql-web-sdk, web-development | SDK boundary, OpenAPI, auth method |
52+
| Web projects + NoSQL Database | `web-development` | no-sql-web-sdk, auth-web | relational-database-tool, http-api | Login state and database access permission model |
53+
| MySQL Database (relational) | `relational-database-tool` | relational-database-web, http-api | no-sql-web-sdk, web-development | Distinguish MCP management vs app code access |
54+
| Cloud Functions | `cloud-functions` | auth-tool, ai-model-nodejs | cloudrun-development, auth-web | Event vs HTTP function, runtime, `scf_bootstrap` |
55+
| CloudRun backend | `cloudrun-development` | auth-tool, relational-database-tool | cloud-functions | Container boundary, Dockerfile, CORS |
56+
| AI Agent (智能体开发) | `cloudbase-agent` | cloud-functions, cloudrun-development | cloud-functions, cloudrun-development | AG-UI protocol, scf_bootstrap, SSE streaming |
57+
| UI generation | `ui-design` | web-development, miniprogram-development | cloud-functions | Design specification first |
58+
| AI Model (Web) | `web-development` | ai-model-web, ui-design | ai-model-wechat, http-api | Platform and streaming interaction mode |
59+
| Resource health inspection / troubleshooting | `ops-inspector` | cloud-functions, cloudrun-development | ui-design, spec-workflow | CLS enabled, time range for logs |
60+
| Spec workflow / architecture design | `spec-workflow` | cloudbase | web-development, cloud-functions | Requirements, design, tasks confirmed |
6161

6262

6363
### Routing reminders
@@ -79,7 +79,7 @@ If a skill points to its own `references/...` files, keep following those relati
7979

8080
### Approach A: IDE Native MCP
8181

82-
Configure CloudBase MCP via your IDE\'s MCP settings. For detailed config examples (Cursor, Claude Code, Windsurf, Cline, etc.), see `references/mcp-setup.md`.
82+
Configure CloudBase MCP via your IDE's MCP settings. For detailed config examples (Cursor, Claude Code, Windsurf, Cline, etc.), see `references/mcp-setup.md`.
8383

8484

8585
### Approach B: mcporter CLI

config/source/guideline/cloudbase/references/activation-map.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ scenarios:
184184
beforeAction:
185185
- 先确认是 Agent 开发而不是普通云函数。
186186
- 确认 AG-UI 协议、SSE streaming、部署目标(云函数或 CloudRun)。
187-
doNotUse: []
187+
doNotUse:
188+
- cloud-functions
189+
- cloudrun-development
188190
commonMistakes:
189191
- 把 Agent 开发误当成普通云函数开发。
190192
- 未确认 AG-UI 协议就直接写代码。

config/source/guideline/cloudbase/references/mcp-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,6 @@ When your IDE does not support native MCP, use **mcporter** as the CLI.
8282
- Query app-side login config:
8383
`npx mcporter call cloudbase.queryAppAuth action=getLoginConfig --output json`
8484
- Patch app-side login strategy:
85-
`npx mcporter call cloudbase.manageAppAuth action=patchLoginStrategy patch='{"usernamePassword\":true}' --output json`
85+
`npx mcporter call cloudbase.manageAppAuth action=patchLoginStrategy patch='{"usernamePassword":true}' --output json`
8686
- Query publishable key:
8787
`npx mcporter call cloudbase.queryAppAuth action=getPublishableKey --output json`

tests/skill-activation-routing.test.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ import { loadYamlModule } from '../scripts/lib/load-yaml-module.mjs';
77
const __filename = fileURLToPath(import.meta.url);
88
const __dirname = path.dirname(__filename);
99
const ROOT_DIR = path.resolve(__dirname, '..');
10-
const ACTIVATION_MAP_FILE = path.join(
10+
const GUIDELINE_DIR = path.join(
1111
ROOT_DIR,
1212
'config',
1313
'source',
1414
'guideline',
1515
'cloudbase',
16-
'references',
17-
'activation-map.yaml',
1816
);
17+
const GUIDELINE_FILE = path.join(GUIDELINE_DIR, 'SKILL.md');
18+
const ACTIVATION_MAP_FILE = path.join(GUIDELINE_DIR, 'references', 'activation-map.yaml');
19+
const MCP_SETUP_FILE = path.join(GUIDELINE_DIR, 'references', 'mcp-setup.md');
1920

2021
const SKILL_SOURCE_DIR = path.join(ROOT_DIR, 'config', 'source', 'skills');
2122

@@ -77,4 +78,23 @@ describe('skill activation routing contract', async () => {
7778
expect(byId.get('cloud-functions').doNotUse).toContain('cloudrun-development');
7879
expect(byId.get('ui-first').firstRead).toBe('ui-design');
7980
});
81+
82+
test('keeps the source guideline routing table aligned with activation checks', () => {
83+
const source = fs.readFileSync(GUIDELINE_FILE, 'utf8');
84+
85+
expect(source).toContain('| Scenario | Read first | Then read | Do NOT route to first | Must check before action |');
86+
expect(source).toContain('| Web login / registration / auth UI | `auth-tool` | auth-web, web-development | cloud-functions, http-api | Provider status and publishable key |');
87+
expect(source).toContain('| AI Agent (智能体开发) | `cloudbase-agent` | cloud-functions, cloudrun-development |');
88+
expect(source).not.toContain('| web-auth | `auth-tool` |');
89+
});
90+
91+
test('keeps moved mcporter patch examples copy-pasteable', () => {
92+
const setup = fs.readFileSync(MCP_SETUP_FILE, 'utf8');
93+
const patchExamples = Array.from(setup.matchAll(/patch='([^']+)'/g));
94+
95+
expect(patchExamples.length).toBeGreaterThan(0);
96+
for (const [, patch] of patchExamples) {
97+
expect(() => JSON.parse(patch)).not.toThrow();
98+
}
99+
});
80100
});

0 commit comments

Comments
 (0)