﻿# CloudBase Setup Skill

> For AI coding agents. Humans: copy the Setup Prompt from https://docs.cloudbase.net/ or the CloudBase website homepage, paste it into your AI IDE, then let the agent follow this file.

CloudBase (腾讯云开发) is an AI-native backend platform: database, auth, storage, cloud functions, hosting, and deep WeChat mini program integration. Your job is to connect the current project to CloudBase so the user can build and deploy without leaving the IDE.

---

## Preferred (do this first)

**Prefer `npx plugins add`. Do not hand-write MCP JSON** when the plugins CLI can install into the current AI tool.

Default install (user/global scope — works across projects):

```bash
npx plugins add TencentCloudBase/cloudbase-plugin -y --scope user
```

Optional: pin one IDE with `--target`:

| `--target` | Tool |
|---|---|
| `claude-code` | Claude Code |
| `cursor` | Cursor |
| `codex` | Codex |
| `grok` | Grok Build |
| `kimi` | Kimi Code |
| `github-copilot` | GitHub Copilot CLI |
| `vscode` | VS Code (Preview) |

Omit `--target` to install into all detected supported IDEs. Inspect detection:

```bash
npx plugins targets
```

Examples:

```bash
npx plugins add TencentCloudBase/cloudbase-plugin -y --scope user --target cursor
npx plugins add TencentCloudBase/cloudbase-plugin -y --scope user --target claude-code
```

After install:

1. Restart / reload the AI tool if the installer says so.
2. Confirm CloudBase tools or skills are available in this session.
3. Reply in one short sentence that setup is ready, then suggest the most relevant next steps for this project.

Docs: https://docs.cloudbase.net/ai/cloudbase-ai-toolkit/ai-agent-plugins

---

## When GitHub is unreachable (CNB / npm)

Short `owner/repo` forms **always** resolve to GitHub. If `git clone` / `plugins add` / `skills add` fails on GitHub, use a **full CNB git URL** or npm (no git).

### 1. Plugin via CNB (preferred fallback)

```bash
npx plugins add https://cnb.cool/tencent/cloud/cloudbase/cloudbase-plugin.git -y --scope user

# Optional Sites plugin
npx plugins add https://cnb.cool/tencent/cloud/cloudbase/cloudbase-sites-plugin.git -y --scope user
```

Do **not** use the monorepo mirror `CloudBase-AI-ToolKit` for `npx plugins add` — its marketplace layout is not OPS-installable the same way as the dedicated plugin repos.

### 2. Skills via CNB

```bash
npx skills add https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills.git -y
```

### 3. MCP via npm (no git clone)

Configure the IDE MCP entry as:

```bash
npx -y @cloudbase/cloudbase-mcp@latest
```

Docs: https://docs.cloudbase.net/ai/cloudbase-ai-toolkit/getting-started

---

## Fallbacks (only when Plugin cannot install)

Use these **only** if `npx plugins add` is unsupported for this IDE, fails (including after CNB retry), or the user already uses a conflicting native install.

### A. Skills only

```bash
npx skills add tencentcloudbase/cloudbase-skills -y
# or CNB: npx skills add https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills.git -y
```

Docs: https://docs.cloudbase.net/ai/cloudbase-ai-toolkit/prompts/how-to-use

### B. Native MCP / IDE marketplace / mcporter

- Follow the matching IDE guide under https://docs.cloudbase.net/ai/cloudbase-ai-toolkit/
- Typical stdio shape when you must configure MCP by hand: `npx -y @cloudbase/cloudbase-mcp@latest`
- Getting started: https://docs.cloudbase.net/ai/cloudbase-ai-toolkit/getting-started
- Do **not** also run `npx plugins add` for the same IDE if marketplace / native plugin is already installed (duplicate instances).

### C. Built-in connectors

Some tools ship CloudBase built-in (e.g. WorkBuddy connector, ZCode plugin). Prefer the built-in path for that IDE; do not double-install.

### D. WeChat mini program focus

If the user is building a WeChat mini program, after Preferred (or a Fallback), also read:

- https://docs.cloudbase.net/ai/cloudbase-ai-toolkit/tutorials/ai-develop-miniprogram

---

## Verify (run after install)

Ask the platform / MCP (do not invent answers):

1. What is the current CloudBase environment / login status?
2. List available CloudBase capabilities relevant to this project (database, functions, hosting, auth, etc.).
3. Propose one concrete first task based on the repo (e.g. init backend, create a table, deploy a hello API).

If tools are missing, go back to Preferred, CNB mirror, or the matching Fallback—do not fake success.

---

## Rules

- **Preferred path = plugins CLI** with `--scope user`. Do not default to project-local scope unless the user explicitly asks.
- If GitHub clone fails, retry with the **CNB full URL** before giving up on plugins.
- Do **not** invent env IDs, secrets, or API keys.
- Do **not** skip login / auth when the tool requires it.
- Do **not** stack Plugin + manual MCP + Skills on the same IDE unless the user asks.
- Prefer real MCP/tool results over guessing CloudBase behavior.
- Deeper product docs index: https://docs.cloudbase.net/llms.txt

---

## 中文摘要（给人 / 中文 Agent）

**优先：** 用 `npx plugins add`，不要手写 MCP JSON。  
**默认命令：** `npx plugins add TencentCloudBase/cloudbase-plugin -y --scope user`（全局，跨项目可用）  
**GitHub 不可达：** 改用完整 CNB URL  
`npx plugins add https://cnb.cool/tencent/cloud/cloudbase/cloudbase-plugin.git -y --scope user`  
Skills：`npx skills add https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills.git -y`  
再不济：npm MCP `npx -y @cloudbase/cloudbase-mcp@latest`  
**可选 `--target`：** `claude-code` / `cursor` / `codex` / `grok` / `kimi` / `github-copilot` / `vscode`  
装完后确认环境可用，用一句话告知已就绪，再建议下一步。不要编造环境 ID 或密钥。