Skip to content

Commit 8f59078

Browse files
bingggcursoragent
andcommitted
feat: integrate skill-enhancer plugin and improve setup scripts
- Add skill-enhancer plugin to enforce proper skill usage - Integrate plugin installation into setup.mjs (unified mjs format) - Update documentation to prioritize local npx commands - Improve SKILL.md with plugin installation and verification steps - Add troubleshooting section for plugin issues Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 182337a commit 8f59078

File tree

8 files changed

+437
-99
lines changed

8 files changed

+437
-99
lines changed

skills/setup-cloudbase-openclaw/README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,35 @@ This skill helps you configure your OpenClaw/Moltbot installation for CloudBase
77
### Option 1: Run the Setup Script
88

99
```bash
10-
# Using bash - detect installation
11-
bash <(curl -s https://raw.githubusercontent.com/tencentcloudbase/skills/main/scripts/detect-setup.sh) detect
12-
13-
# Or using Node.js
1410
npx @cloudbase/setup-openclaw detect
1511
```
1612

1713
### Option 2: Copy App Template
1814

1915
```bash
20-
# Copy the CloudBase React template to a new project directory
21-
bash <(curl -s https://raw.githubusercontent.com/tencentcloudbase/skills/main/scripts/detect-setup.sh) copy-template --dest /path/to/my-project
22-
23-
# Or using Node.js
2416
npx @cloudbase/setup-openclaw copy-template --dest /path/to/my-project
2517
```
2618

27-
### Option 3: Manual Setup
19+
### Option 3: Install Skill Enhancer Plugin
20+
21+
```bash
22+
# Install the skill-enhancer plugin (optional but recommended)
23+
npx @cloudbase/setup-openclaw install-plugin
24+
```
25+
26+
This plugin automatically instructs the model to list available skills and justify their usage before responding.
27+
28+
### Option 4: Manual Setup
2829

2930
Follow these steps:
3031

3132
1. **Find your workspace** - Check your config file for the workspace path
3233
2. **Configure MCP** - Add CloudBase MCP to `<workspace>/config/mcporter.json`
3334
3. **Update AGENTS.md** - Add CloudBase development rules
34-
4. **Install skills** - `npx skills add tencentcloudbase/skills -y`
35-
5. **Copy app template (optional)** - `cp -r <workspace>/app <workspace>/my-new-project`
36-
6. **Restart gateway** - `moltbot gateway restart`
35+
4. **Install skill-enhancer plugin (optional)** - `npx @cloudbase/setup-openclaw install-plugin`
36+
5. **Install skills** - `npx skills add tencentcloudbase/skills -y`
37+
6. **Copy app template (optional)** - `cp -r <workspace>/app <workspace>/my-new-project`
38+
7. **Restart gateway** - `moltbot gateway restart`
3739

3840
See [SKILL.md](./SKILL.md) for detailed instructions.
3941

@@ -43,6 +45,7 @@ See [SKILL.md](./SKILL.md) for detailed instructions.
4345
- ✅ Finds your workspace configuration
4446
- ✅ Checks for existing CloudBase MCP setup
4547
- ✅ Verifies CloudBase skills are installed
48+
- ✅ Installs skill-enhancer plugin (optional) to enforce proper skill usage
4649
- ✅ Copies CloudBase React template for new projects
4750
- ✅ Provides step-by-step guidance for configuration
4851

skills/setup-cloudbase-openclaw/SKILL.md

Lines changed: 76 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ Before starting, ensure you have:
2121
| 2 | Locate workspace | Identify the agent workspace directory |
2222
| 3 | Configure MCP | Set up CloudBase MCP with credentials |
2323
| 4 | Update AGENTS.md | Add CloudBase development rules |
24-
| 5 | Install skills | Install CloudBase-related skills |
25-
| 6 | Copy app template (optional) | Copy CloudBase React template to workspace |
26-
| 7 | Apply changes | Use /new to start a new session |
24+
| 5 | Install skill-enhancer plugin (optional) | Install plugin to enforce skill usage |
25+
| 6 | Install skills | Install CloudBase-related skills |
26+
| 7 | Copy app template (optional) | Copy CloudBase React template to workspace |
27+
| 8 | Apply changes | Use /new to start a new session |
2728

2829
---
2930

@@ -49,16 +50,12 @@ ls -la ~/.moltbot/
4950

5051
**Run the setup script to auto-detect:**
5152

52-
```bash
53-
bash <(curl -s https://raw.githubusercontent.com/tencentcloudbase/skills/main/scripts/detect-setup.sh)
54-
```
55-
56-
Or use the Node.js version:
57-
5853
```bash
5954
npx @cloudbase/setup-openclaw detect
6055
```
6156

57+
This command automatically downloads and runs the latest version of the setup script from npm.
58+
6259
---
6360

6461
## Step 2: Locate Workspace Directory
@@ -97,7 +94,7 @@ You need three values:
9794

9895
**How to get them:**
9996

100-
1. **EnvId**: Go to [CloudBase Console](https://tcb.cloud.tencent.com)
97+
1. **EnvId**: Go to [CloudBase Console](https://tcb.cloud.tencent.com/dev)
10198
- Select your environment
10299
- Copy the Environment ID from the top-left corner
103100

@@ -188,14 +185,65 @@ When working with CloudBase projects, the agent MUST:
188185

189186
3. **Prefer SDK + security rules** - If the requirement can be satisfied with the document database SDK and security rules alone, do NOT introduce cloud functions.
190187

191-
4. **Deploy to subdirectory (mandatory)** - When deploying web apps to static hosting, you MUST use a subdirectory path (e.g., `/my-app/`), not the root, unless the user explicitly asks otherwise.
188+
4. The workspace includes a **CloudBase + React template** (`app/` directory) that you can copy as a starting point for new projects.
189+
190+
192191

193-
5. **Auto-deploy web apps** - After completing a web application, automatically deploy it to CloudBase static hosting using MCP tools.
192+
5. **Deploy to subdirectory (mandatory)** - When deploying web apps to static hosting, you MUST use a subdirectory path (e.g., `/my-app/`), not the root, unless the user explicitly asks otherwise.
193+
194+
6. **Auto-deploy web apps** - After completing a web application, automatically deploy it to CloudBase static hosting using MCP tools.
194195
```
195196

196197
---
197198

198-
## Step 5: Install CloudBase Skills
199+
## Step 5: Install Skill Enhancer Plugin (Optional)
200+
201+
The **skill-enhancer** plugin automatically instructs the model to list available skills and justify their usage before responding, ensuring skills are properly considered before writing code.
202+
203+
### 5.1 Install the Plugin
204+
205+
```bash
206+
npx @cloudbase/setup-openclaw install-plugin
207+
```
208+
209+
**What it does:**
210+
- Detects your OpenClaw/Moltbot installation directory (`~/.openclaw/`, `~/.clawdbot/`, or `~/.moltbot/`)
211+
- Creates `extensions/skill-enhancer/` directory in the installation directory
212+
- Copies plugin files (`openclaw.plugin.json` and `index.ts`) from the skill package
213+
- Creates or updates `openclaw.json` to enable the plugin
214+
- Provides instructions to restart the gateway
215+
216+
### 5.2 Plugin Behavior
217+
218+
The plugin injects instructions into the model's context before each turn:
219+
- **Lists available Skills** that can be used for the request
220+
- **States the reason** for calling each Skill
221+
- **Prevents skipping Skills** - requires reading relevant skills before writing code
222+
223+
**Example:** When working with CloudBase projects, the model will be instructed to read `cloudbase-guidelines` skill FIRST before writing any code.
224+
225+
### 5.3 Restart Gateway
226+
227+
After installation, restart the gateway to load the plugin:
228+
229+
```bash
230+
# For Moltbot
231+
moltbot gateway restart
232+
233+
# For OpenClaw
234+
openclaw gateway restart
235+
236+
# Or for Clawdbot
237+
clawdbot restart
238+
```
239+
240+
**Verify plugin is loaded:**
241+
242+
After restarting, the plugin will automatically inject instructions into the model's context. You can verify this by asking the agent a question and checking if it lists available skills before responding.
243+
244+
---
245+
246+
## Step 6: Install CloudBase Skills
199247

200248
Install the CloudBase skills package to make all CloudBase-related skills available:
201249

@@ -226,64 +274,6 @@ You should see skills like:
226274

227275
---
228276

229-
## Step 6: Copy App Template (Optional)
230-
231-
The workspace includes a **CloudBase + React template** (`app/` directory) that you can copy as a starting point for new projects.
232-
233-
**What's included in the template:**
234-
235-
- React 19 + Vite 6 + TypeScript
236-
- Tailwind CSS + DaisyUI
237-
- CloudBase Web SDK integration
238-
- Example project (Swimming Tracker)
239-
- Build configuration and deployment scripts
240-
241-
**To copy the template to your workspace:**
242-
243-
```bash
244-
# Option 1: Copy to a new project directory
245-
cp -r <workspace>/app <workspace>/my-new-project
246-
247-
# Option 2: Use the setup script to copy
248-
npx @cloudbase/setup-openclaw copy-template --dest <workspace>/my-project
249-
```
250-
251-
**After copying, update the configuration:**
252-
253-
1. **Update `cloudbaserc.json`** - Replace `{{env.ENV_ID}}` with your actual Environment ID
254-
2. **Install dependencies:**
255-
```bash
256-
cd <workspace>/my-new-project
257-
npm install
258-
```
259-
3. **Run development server:**
260-
```bash
261-
npm run dev
262-
```
263-
4. **Build for production:**
264-
```bash
265-
npm run build
266-
```
267-
268-
**Template structure:**
269-
270-
```
271-
app/
272-
├── src/
273-
│ ├── components/ # React components
274-
│ ├── types/ # TypeScript types
275-
│ ├── utils/ # Utilities (CloudBase SDK, API)
276-
│ └── main.tsx # App entry point
277-
├── public/ # Static assets
278-
├── cloudfunctions/ # Cloud functions (optional)
279-
├── cloudbaserc.json # CloudBase deployment config
280-
├── vite.config.ts # Vite build config
281-
├── tailwind.config.js # Tailwind CSS config
282-
├── tsconfig.json # TypeScript config
283-
└── package.json # Dependencies and scripts
284-
```
285-
286-
---
287277

288278
## Step 7: Apply Changes
289279

@@ -313,6 +303,12 @@ To verify everything is working correctly:
313303
Should use MCP to query environment details
314304
```
315305

306+
4. **Verify plugin is working (if installed):**
307+
```
308+
Ask the agent: "Create a simple CloudBase web app"
309+
Should list available skills (e.g., cloudbase-guidelines, web-development) before writing code
310+
```
311+
316312
---
317313

318314
## Troubleshooting
@@ -337,6 +333,14 @@ To verify everything is working correctly:
337333
2. Ensure AGENTS.md exists in the workspace root
338334
3. Check that the agent has read/write permissions
339335

336+
### Plugin not working
337+
338+
1. Verify plugin files exist in `~/.openclaw/extensions/skill-enhancer/` (or equivalent for your installation)
339+
2. Check that `openclaw.json` has the plugin enabled: `"skill-enhancer": { "enabled": true }`
340+
3. Restart the gateway after installation
341+
4. Check gateway logs for plugin loading errors
342+
5. Ensure you're using a version of OpenClaw that supports plugins
343+
340344
---
341345

342346
## Reference: OpenClaw Skills Loading
@@ -353,7 +357,7 @@ OpenClaw loads skills from multiple locations, in priority order:
353357

354358
## Need Help?
355359

356-
- [CloudBase MCP Documentation](https://github.com/ TencentCloudBase/cloudbase-mcp)
360+
- [CloudBase MCP Documentation](https://github.com/TencentCloudBase/cloudbase-mcp)
357361
- [CloudBase Console](https://tcb.cloud.tencent.com)
358362
- [Skills Hub](https://skills.sh/)
359363
- [OpenClaw Documentation](https://docs.molt.bot)

skills/setup-cloudbase-openclaw/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
"README.md",
1313
"references",
1414
"scripts",
15+
"plugins",
1516
"setup-cloudbase-openclaw.js"
1617
],
1718
"scripts": {
1819
"detect": "node scripts/setup.mjs detect",
1920
"detect:bash": "bash scripts/detect-setup.sh detect",
2021
"copy-template": "node scripts/setup.mjs copy-template",
21-
"copy-template:bash": "bash scripts/detect-setup.sh copy-template"
22+
"copy-template:bash": "bash scripts/detect-setup.sh copy-template",
23+
"install-plugin": "node scripts/setup.mjs install-plugin"
2224
},
2325
"keywords": [
2426
"cloudbase",

0 commit comments

Comments
 (0)