thanh-kit 2.5.3 → 2.5.4

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.
Files changed (79) hide show
  1. package/package.json +1 -1
  2. package/templates/.env.example +100 -0
  3. package/templates/commands/bootstrap/auto/fast.md +111 -0
  4. package/templates/commands/bootstrap/auto/parallel.md +66 -0
  5. package/templates/commands/bootstrap/auto.md +115 -0
  6. package/templates/commands/bootstrap.md +137 -0
  7. package/templates/commands/code/auto.md +203 -0
  8. package/templates/commands/code/no-test.md +174 -0
  9. package/templates/commands/code/parallel.md +100 -0
  10. package/templates/commands/code.md +205 -0
  11. package/templates/commands/content/cro.md +43 -0
  12. package/templates/commands/content/enhance.md +14 -0
  13. package/templates/commands/content/fast.md +13 -0
  14. package/templates/commands/content/good.md +16 -0
  15. package/templates/commands/cook/auto/fast.md +26 -0
  16. package/templates/commands/cook/auto/parallel.md +49 -0
  17. package/templates/commands/cook/auto.md +15 -0
  18. package/templates/commands/cook.md +105 -0
  19. package/templates/commands/debug.md +13 -0
  20. package/templates/commands/design/3d.md +83 -0
  21. package/templates/commands/design/describe.md +23 -0
  22. package/templates/commands/design/fast.md +31 -0
  23. package/templates/commands/design/good.md +35 -0
  24. package/templates/commands/design/screenshot.md +34 -0
  25. package/templates/commands/design/video.md +34 -0
  26. package/templates/commands/fix/ci.md +17 -0
  27. package/templates/commands/fix/fast.md +19 -0
  28. package/templates/commands/fix/hard.md +39 -0
  29. package/templates/commands/fix/logs.md +26 -0
  30. package/templates/commands/fix/parallel.md +54 -0
  31. package/templates/commands/fix/test.md +20 -0
  32. package/templates/commands/fix/types.md +9 -0
  33. package/templates/commands/fix/ui.md +48 -0
  34. package/templates/commands/fix.md +43 -0
  35. package/templates/commands/plan/ci.md +33 -0
  36. package/templates/commands/plan/cro.md +69 -0
  37. package/templates/commands/plan/fast.md +82 -0
  38. package/templates/commands/plan/hard.md +108 -0
  39. package/templates/commands/plan/parallel.md +145 -0
  40. package/templates/commands/plan/two.md +45 -0
  41. package/templates/commands/plan.md +30 -0
  42. package/templates/commands/scout/ext.md +39 -0
  43. package/templates/commands/scout.md +28 -0
  44. package/templates/commands/skill/add.md +36 -0
  45. package/templates/commands/skill/create.md +29 -0
  46. package/templates/commands/skill/fix-logs.md +22 -0
  47. package/templates/commands/skill/optimize/auto.md +25 -0
  48. package/templates/commands/skill/optimize.md +34 -0
  49. package/templates/commands/skill/update.md +36 -0
  50. package/templates/skills/.env.example +1 -0
  51. package/templates/statusline.cjs +0 -0
  52. package/templates/statusline.sh +0 -0
  53. package/templates/AGENTS.md +0 -104
  54. package/templates/README.md +0 -241
  55. package/templates/command-archive/ask.md +0 -56
  56. package/templates/command-archive/ck-help.md +0 -129
  57. package/templates/command-archive/coding-level.md +0 -48
  58. package/templates/command-archive/docs/init.md +0 -38
  59. package/templates/command-archive/docs/summarize.md +0 -22
  60. package/templates/command-archive/docs/update.md +0 -76
  61. package/templates/command-archive/journal.md +0 -18
  62. package/templates/command-archive/kanban.md +0 -99
  63. package/templates/command-archive/plan/archive.md +0 -57
  64. package/templates/command-archive/plan/red-team.md +0 -200
  65. package/templates/command-archive/plan/validate.md +0 -188
  66. package/templates/command-archive/preview.md +0 -283
  67. package/templates/command-archive/review/codebase/parallel.md +0 -122
  68. package/templates/command-archive/review/codebase.md +0 -49
  69. package/templates/command-archive/test/ui.md +0 -92
  70. package/templates/command-archive/test.md +0 -8
  71. package/templates/command-archive/use-mcp.md +0 -38
  72. package/templates/command-archive/watzup.md +0 -8
  73. package/templates/command-archive/worktree.md +0 -109
  74. package/templates/discord/README.md +0 -274
  75. package/templates/discord/config.json5 +0 -87
  76. package/templates/discord/skills/auto-intent-router/SKILL.md +0 -195
  77. package/templates/discord/skills/train-prompt/SKILL.md +0 -306
  78. package/templates/discord/start-bot.sh +0 -47
  79. package/templates/gemini/settings.json +0 -12
@@ -1,109 +0,0 @@
1
- ---
2
- description: 'Create isolated git worktree for parallel development'
3
- argument-hint: '[feature-description] OR [project] [feature] (monorepo)'
4
- ---
5
-
6
- Create an isolated git worktree for parallel feature development.
7
-
8
- ## Workflow
9
-
10
- ### Step 1: Get Repo Info
11
-
12
- ```bash
13
- node .claude/scripts/worktree.cjs info --json
14
- ```
15
-
16
- Parse JSON response for: `repoType`, `baseBranch`, `projects`, `worktreeRoot`, `worktreeRootSource`.
17
-
18
- ### Step 2: Detect Branch Prefix
19
-
20
- From user's description:
21
- - "fix", "bug", "error", "issue" → `fix`
22
- - "refactor", "restructure", "rewrite" → `refactor`
23
- - "docs", "documentation", "readme" → `docs`
24
- - "test", "spec", "coverage" → `test`
25
- - "chore", "cleanup", "deps" → `chore`
26
- - "perf", "performance", "optimize" → `perf`
27
- - Default → `feat`
28
-
29
- ### Step 3: Convert to Slug
30
-
31
- "add authentication system" → `add-auth`
32
- "fix login bug" → `login-bug`
33
- Max 50 chars, kebab-case.
34
-
35
- ### Step 4: Handle Monorepo
36
-
37
- If `repoType === "monorepo"` and project not specified, use AskUserQuestion:
38
- ```javascript
39
- AskUserQuestion({
40
- questions: [{
41
- header: "Project",
42
- question: "Which project for the worktree?",
43
- options: projects.map(p => ({ label: p.name, description: p.path })),
44
- multiSelect: false
45
- }]
46
- })
47
- ```
48
-
49
- ### Step 5: Execute
50
-
51
- **Monorepo:**
52
- ```bash
53
- node .claude/scripts/worktree.cjs create "<PROJECT>" "<SLUG>" --prefix <TYPE>
54
- ```
55
-
56
- **Standalone:**
57
- ```bash
58
- node .claude/scripts/worktree.cjs create "<SLUG>" --prefix <TYPE>
59
- ```
60
-
61
- **Options:**
62
- - `--prefix` - Branch type: feat|fix|refactor|docs|test|chore|perf
63
- - `--worktree-root <path>` - Override default location (only if needed)
64
- - `--json` - JSON output
65
- - `--dry-run` - Preview
66
-
67
- ### Step 6: Install Dependencies
68
-
69
- Based on project context, run in background:
70
- - `bun.lock` → `bun install`
71
- - `pnpm-lock.yaml` → `pnpm install`
72
- - `yarn.lock` → `yarn install`
73
- - `package-lock.json` → `npm install`
74
- - `poetry.lock` → `poetry install`
75
- - `requirements.txt` → `pip install -r requirements.txt`
76
- - `Cargo.toml` → `cargo build`
77
- - `go.mod` → `go mod download`
78
-
79
- ## Commands
80
-
81
- | Command | Usage | Description |
82
- |---------|-------|-------------|
83
- | `create` | `create [project] <feature>` | Create worktree |
84
- | `remove` | `remove <name-or-path>` | Remove worktree |
85
- | `info` | `info` | Repo info with worktree location |
86
- | `list` | `list` | List worktrees |
87
-
88
- ## Example
89
-
90
- ```
91
- User: /worktree fix the login validation bug
92
-
93
- Claude: [Runs: node .claude/scripts/worktree.cjs info --json]
94
- repoType: standalone
95
- worktreeRoot: /home/user/worktrees
96
- worktreeRootSource: sibling directory
97
-
98
- [Prefix: fix, Slug: login-validation-bug]
99
- [Runs: node .claude/scripts/worktree.cjs create "login-validation-bug" --prefix fix]
100
-
101
- Output: Worktree created at /home/user/worktrees/my-project-login-validation-bug
102
- ```
103
-
104
- ## Notes
105
-
106
- - Script auto-detects superproject, monorepo, and standalone repos
107
- - Default worktree location is smart: superproject > monorepo > sibling
108
- - Use `--worktree-root` only to override defaults
109
- - Env templates (`.env*.example`) auto-copied with `.example` suffix removed
@@ -1,274 +0,0 @@
1
- # Discord + OpenClaw Setup Guide
2
-
3
- This directory contains configuration for running your AI agent on Discord via [OpenClaw](https://docs.openclaw.ai).
4
-
5
- ## Features
6
-
7
- - **Auto Intent Detection** - No need to type `/plan` or `/brainstorm`, bot understands natural language
8
- - **Skills System** - Commands converted to skills format for better context
9
- - **Train Prompt** - Add new knowledge via URLs, files, or inline content
10
- - **Progressive Disclosure** - Skills load on-demand to save tokens
11
- - **Gemini CLI OAuth** - Use Google OAuth via Gemini CLI (no API key needed!)
12
-
13
- ## Quick Start
14
-
15
- ### 1. Install Required CLIs
16
-
17
- ```bash
18
- # Install OpenClaw CLI
19
- npm install -g openclaw
20
-
21
- # Install Gemini CLI (for OAuth authentication)
22
- npm install -g @anthropic-ai/gemini-cli
23
- ```
24
-
25
- ### 2. Setup AI Model Authentication (Choose One)
26
-
27
- #### Option A: Gemini CLI OAuth (Recommended)
28
-
29
- No API key needed! Uses Google OAuth via Gemini CLI plugin.
30
-
31
- ```bash
32
- # Login to Gemini CLI
33
- gemini auth login
34
-
35
- # Enable Gemini CLI auth plugin
36
- openclaw plugins enable google-gemini-cli-auth
37
-
38
- # Set as default model provider
39
- openclaw models auth login --provider google-gemini-cli --set-default
40
- ```
41
-
42
- **Or use the start script:**
43
- ```bash
44
- ./start-bot.sh
45
- ```
46
-
47
- #### Option B: API Key
48
-
49
- ```bash
50
- # Set your API key
51
- openclaw config set models.anthropic.apiKey '"sk-your-api-key"' --json
52
- ```
53
-
54
- ### 3. Create Discord Bot
55
-
56
- 1. Go to [Discord Developer Portal](https://discord.com/developers/applications)
57
- 2. Click "New Application" and name your bot
58
- 3. Go to "Bot" section and click "Add Bot"
59
- 4. Enable these Intents:
60
- - **Message Content Intent** (required)
61
- - **Server Members Intent** (recommended)
62
- 5. Click "Reset Token" to get your bot token
63
-
64
- ### 4. Configure Bot Token
65
-
66
- **Option A: Environment Variable (Recommended)**
67
- ```bash
68
- export DISCORD_BOT_TOKEN="your-bot-token-here"
69
- ```
70
-
71
- **Option B: Direct Configuration**
72
- ```bash
73
- openclaw config set channels.discord.token '"your-bot-token-here"' --json
74
- ```
75
-
76
- ### 5. Enable Discord Channel
77
-
78
- ```bash
79
- openclaw config set channels.discord.enabled true --json
80
- ```
81
-
82
- ### 6. Start Gateway
83
-
84
- ```bash
85
- # Using start script (handles Gemini CLI auth automatically)
86
- ./start-bot.sh
87
-
88
- # Or directly
89
- openclaw gateway
90
- ```
91
-
92
- ### 6. Invite Bot to Server
93
-
94
- 1. Go to OAuth2 > URL Generator in Discord Developer Portal
95
- 2. Select scopes: `bot`, `applications.commands`
96
- 3. Select permissions:
97
- - View Channels
98
- - Send Messages
99
- - Read Message History
100
- - Embed Links
101
- - Attach Files
102
- - Add Reactions
103
- 4. Copy the generated URL and open it to invite the bot
104
-
105
- ### 7. Pairing (First-time Setup)
106
-
107
- 1. Send a DM to your bot in Discord
108
- 2. Bot responds with a pairing code
109
- 3. Approve the pairing:
110
- ```bash
111
- openclaw pairing approve discord <CODE>
112
- ```
113
-
114
- ## Using Commands
115
-
116
- Your commands are available in two ways:
117
-
118
- ### As Slash Commands
119
- Discord will automatically register your commands as slash commands.
120
- Type `/` in Discord to see available commands.
121
-
122
- Example:
123
- - `/plan create a login feature`
124
- - `/brainstorm how to optimize database queries`
125
-
126
- ### As Message Commands
127
- Mention the bot with a command:
128
- ```
129
- @YourBot /plan create a login feature
130
- ```
131
-
132
- ## Configuration
133
-
134
- Edit `config.json5` to customize:
135
-
136
- - **dmPolicy**: Control who can DM the bot
137
- - **groupPolicy**: Control which servers can use the bot
138
- - **guilds**: Configure per-server settings
139
- - **streaming**: Enable live typing preview
140
- - **bindings**: Route different users to different agents
141
-
142
- ## Commands Available
143
-
144
- Your commands are defined in the `commands/` directory:
145
-
146
- | Command | Description |
147
- |---------|-------------|
148
- | `/plan` | Create implementation plans |
149
- | `/brainstorm` | Brainstorm solutions |
150
- | `/fix` | Fix code issues |
151
- | `/code` | Write code |
152
- | `/review` | Review code changes |
153
- | ... | See `commands/` for full list |
154
-
155
- ## Useful OpenClaw Commands
156
-
157
- ```bash
158
- # Check status
159
- openclaw channels status --probe
160
-
161
- # View logs
162
- openclaw logs --follow
163
-
164
- # List pairings
165
- openclaw pairing list discord
166
-
167
- # Restart gateway
168
- openclaw gateway restart
169
-
170
- # Health check
171
- openclaw doctor
172
- ```
173
-
174
- ## Skills System
175
-
176
- Your commands are converted to **OpenClaw Skills** format for better AI understanding.
177
-
178
- ### Structure
179
- ```
180
- .discord/
181
- ├── skills/
182
- │ ├── auto-intent-router/ # Auto-detects user intent
183
- │ │ └── SKILL.md
184
- │ ├── train-prompt/ # Add new knowledge
185
- │ │ └── SKILL.md
186
- │ ├── planning/ # Converted from /plan
187
- │ │ └── SKILL.md
188
- │ ├── brainstorm/ # Converted from /brainstorm
189
- │ │ └── SKILL.md
190
- │ └── ...
191
- ├── commands/ # Original commands (backup)
192
- ├── commands.json5 # Slash commands config
193
- └── config.json5 # Main config
194
- ```
195
-
196
- ### How It Works
197
-
198
- 1. **Auto Intent Router** detects what user wants from natural language
199
- 2. **Appropriate skill** is activated automatically
200
- 3. User gets response without typing commands
201
-
202
- Example:
203
- ```
204
- User: "I need to add payment processing"
205
- Bot: [Detects PLANNING intent, activates planning skill]
206
- "I'll help you plan the payment processing feature..."
207
- ```
208
-
209
- ## Training New Knowledge
210
-
211
- Use the **train-prompt** skill to teach the bot new things:
212
-
213
- ### Train from URL
214
- ```
215
- /train https://docs.stripe.com/api
216
- ```
217
-
218
- ### Train from File
219
- ```
220
- /train:file ./docs/coding-standards.md
221
- ```
222
-
223
- ### Train Inline
224
- ```
225
- /train:inline
226
- Our deployment process:
227
- 1. Run tests
228
- 2. Build
229
- 3. Deploy staging
230
- 4. Deploy production
231
- ```
232
-
233
- ### List Trained Knowledge
234
- ```
235
- /train:list
236
- ```
237
-
238
- ## Troubleshooting
239
-
240
- **Bot not responding?**
241
- - Check Message Content Intent is enabled
242
- - Verify bot token is correct
243
- - Run `openclaw doctor` for diagnostics
244
-
245
- **Commands not showing?**
246
- - Wait a few minutes for Discord to sync
247
- - Check `commands.native` is set to `"auto"`
248
-
249
- **Permission errors?**
250
- - Verify bot has required permissions
251
- - Check guild configuration in `config.json5`
252
-
253
- **Skills not loading?**
254
- - Check `skills/` directory exists
255
- - Verify SKILL.md files have correct frontmatter
256
- - Run `openclaw skills list` to see active skills
257
-
258
- **Gemini CLI OAuth issues?**
259
- - Re-login: `gemini auth login`
260
- - Check plugin status: `openclaw plugins list`
261
- - Re-enable plugin: `openclaw plugins enable google-gemini-cli-auth`
262
- - Check auth status: `openclaw models auth status --provider google-gemini-cli`
263
- - Set as default again: `openclaw models auth login --provider google-gemini-cli --set-default`
264
-
265
- **Token expired?**
266
- - Gemini CLI OAuth tokens auto-refresh
267
- - If issues persist, run `gemini auth login` again
268
-
269
- ## Resources
270
-
271
- - [OpenClaw Documentation](https://docs.openclaw.ai)
272
- - [Discord Channel Guide](https://docs.openclaw.ai/channels/discord)
273
- - [Skills Guide](https://docs.openclaw.ai/tools/skills)
274
- - [Slash Commands](https://docs.openclaw.ai/tools/slash-commands)
@@ -1,87 +0,0 @@
1
- // Clawbot Discord Configuration
2
- // Generated by Apero Kit CLI
3
- // Documentation: https://docs.openclaw.ai/channels/discord
4
- {
5
- // Discord Channel Settings
6
- "channels": {
7
- "discord": {
8
- // Bot token - set via environment variable or here
9
- // Recommended: Use DISCORD_BOT_TOKEN environment variable
10
- "token": "${DISCORD_BOT_TOKEN}",
11
-
12
- // Enable Discord channel
13
- "enabled": true,
14
-
15
- // Direct Message Policy
16
- // "pairing" - Require pairing approval (recommended)
17
- // "allowlist" - Only allow specific users
18
- // "open" - Allow all DMs
19
- // "disabled" - Disable DMs
20
- "dmPolicy": "pairing",
21
-
22
- // Guild (Server) Policy
23
- // "open" - Allow all guilds
24
- // "allowlist" - Only allow specific guilds
25
- // "disabled" - Disable guild messages
26
- "groupPolicy": "allowlist",
27
-
28
- // Message History Limit (for context)
29
- "historyLimit": 20,
30
- "dmHistoryLimit": 50,
31
-
32
- // Reply Mode
33
- // "off" - No reply threading
34
- // "first" - Reply to first message only
35
- // "all" - Reply to all messages
36
- "replyToMode": "first",
37
-
38
- // Streaming Mode (live typing preview)
39
- // "off" - No streaming
40
- // "partial" - Partial updates
41
- // "block" - Block updates
42
- // "progress" - Progress indicator
43
- "streaming": "partial",
44
-
45
- // Guild Configurations
46
- // Add your server(s) here
47
- "guilds": {
48
- // Example guild configuration
49
- // Replace YOUR_SERVER_ID with actual Discord server ID
50
- // "YOUR_SERVER_ID": {
51
- // "requireMention": true,
52
- // "users": ["YOUR_USER_ID"],
53
- // "roles": ["ALLOWED_ROLE_ID"],
54
- // "channels": {
55
- // "general": { "allow": true },
56
- // "bot-commands": { "allow": true }
57
- // }
58
- // }
59
- },
60
-
61
- // Bot Presence
62
- "status": "online",
63
- "activity": "Ready to assist",
64
- "activityType": 4 // 0=Playing, 1=Streaming, 2=Listening, 3=Watching, 4=Custom
65
- }
66
- },
67
-
68
- // Commands Configuration
69
- "commands": {
70
- // Enable native Discord slash commands
71
- "native": "auto"
72
- },
73
-
74
- // Agent Bindings (optional)
75
- // Route different users/roles to different agents
76
- "bindings": [
77
- // Example: Route users with specific role to opus agent
78
- // {
79
- // "agentId": "opus",
80
- // "match": {
81
- // "channel": "discord",
82
- // "guildId": "YOUR_SERVER_ID",
83
- // "roles": ["PREMIUM_ROLE_ID"]
84
- // }
85
- // }
86
- ]
87
- }
@@ -1,195 +0,0 @@
1
- ---
2
- name: auto-intent-router
3
- description: Automatically detects user intent and routes to appropriate skill without manual commands
4
- user-invocable: false
5
- disable-model-invocation: false
6
- metadata: {"openclaw": {"always": true, "priority": 1}}
7
- ---
8
-
9
- # Auto Intent Router
10
-
11
- ## Purpose
12
-
13
- This skill runs on EVERY message to detect user intent and automatically activate the appropriate skill. Users don't need to type commands like `/plan` or `/brainstorm` - the bot understands natural language.
14
-
15
- ## Priority
16
-
17
- This skill has highest priority (runs first) to route messages before other processing.
18
-
19
- ## Intent Detection Matrix
20
-
21
- | Intent | Keywords/Patterns | Activated Skill |
22
- |--------|-------------------|-----------------|
23
- | **PLANNING** | plan, design, architect, implement, create, build feature | `planning`, `plan-fast`, `plan-hard` |
24
- | **BRAINSTORMING** | brainstorm, ideas, options, alternatives, think about, explore | `brainstorm` |
25
- | **DEBUGGING** | fix, debug, error, broken, bug, issue, not working, crash | `debugging`, `fix-fast`, `fix-hard` |
26
- | **CODE REVIEW** | review, check my code, look at this, audit, examine | `code-review` |
27
- | **CODING** | code, implement, write, develop, create function | `code`, `cook` |
28
- | **TESTING** | test, unit test, spec, coverage, jest, vitest | `testing` |
29
- | **DATABASE** | database, schema, migration, query, sql, table | `database` |
30
- | **API DESIGN** | api, endpoint, rest, graphql, route | `api-design` |
31
- | **DOCUMENTATION** | document, docs, readme, explain, describe | `documentation` |
32
- | **DEPLOYMENT** | deploy, release, staging, production, ci/cd | `deployment` |
33
- | **TRAINING** | train, learn, teach, add knowledge, remember | `train-prompt` |
34
- | **SCOUTING** | find, search, where is, locate, explore codebase | `scout` |
35
-
36
- ## Detection Algorithm
37
-
38
- ```
39
- 1. EXTRACT keywords from user message
40
- 2. MATCH against intent patterns
41
- 3. CALCULATE confidence score for each intent
42
- 4. IF confidence > 0.7:
43
- ACTIVATE corresponding skill
44
- ELSE IF multiple intents detected:
45
- ASK user for clarification
46
- ELSE:
47
- PROCEED with general response
48
- ```
49
-
50
- ## Confidence Scoring
51
-
52
- ```
53
- score = (keyword_matches * 0.4) + (pattern_matches * 0.3) + (context_relevance * 0.3)
54
-
55
- - keyword_matches: Number of intent keywords found
56
- - pattern_matches: Regex patterns matched
57
- - context_relevance: Based on conversation history
58
- ```
59
-
60
- ## Workflow
61
-
62
- ### Step 1: Parse Message
63
-
64
- Extract:
65
- - Primary keywords
66
- - Question type (how, what, why, can you)
67
- - Code references (file paths, function names)
68
- - URLs or links
69
-
70
- ### Step 2: Intent Classification
71
-
72
- For each potential intent:
73
- 1. Count keyword matches
74
- 2. Check pattern matches
75
- 3. Consider conversation context
76
- 4. Calculate confidence score
77
-
78
- ### Step 3: Route or Clarify
79
-
80
- **High Confidence (>0.7):**
81
- ```
82
- Silently activate the matched skill.
83
- User sees natural response, not "Activating planning skill..."
84
- ```
85
-
86
- **Medium Confidence (0.4-0.7):**
87
- ```
88
- "I think you want to [intent]. Should I:
89
- A) Create a plan for this
90
- B) Brainstorm alternatives first
91
- C) Just help directly"
92
- ```
93
-
94
- **Low Confidence (<0.4):**
95
- ```
96
- Respond naturally without special skill activation.
97
- ```
98
-
99
- ## Examples
100
-
101
- ### Example 1: Planning Intent
102
- ```
103
- User: "I need to add user authentication to the app"
104
-
105
- [Intent Detection]
106
- Keywords: "add", "authentication", "app"
107
- Pattern: "I need to" + feature description
108
- Confidence: PLANNING = 0.85
109
-
110
- [Action]
111
- Activate: planning skill
112
- Response: "I'll help you plan the authentication system..."
113
- ```
114
-
115
- ### Example 2: Debugging Intent
116
- ```
117
- User: "The login button isn't working anymore"
118
-
119
- [Intent Detection]
120
- Keywords: "isn't working"
121
- Pattern: [component] + "not working"
122
- Confidence: DEBUGGING = 0.9
123
-
124
- [Action]
125
- Activate: debugging skill
126
- Response: "Let me investigate the login button issue..."
127
- ```
128
-
129
- ### Example 3: Ambiguous Intent
130
- ```
131
- User: "Can you help with the API?"
132
-
133
- [Intent Detection]
134
- Keywords: "API"
135
- Confidence: API_DESIGN = 0.5, DEBUGGING = 0.4
136
-
137
- [Action]
138
- Clarify: "I can help with the API. Do you want to:
139
- A) Design new endpoints
140
- B) Fix an existing issue
141
- C) Review the current implementation"
142
- ```
143
-
144
- ### Example 4: Training Intent
145
- ```
146
- User: "Learn this documentation: https://docs.stripe.com/api"
147
-
148
- [Intent Detection]
149
- Keywords: "learn", URL present
150
- Confidence: TRAINING = 0.95
151
-
152
- [Action]
153
- Activate: train-prompt skill
154
- Response: "I'll learn from the Stripe API documentation..."
155
- ```
156
-
157
- ## Context Awareness
158
-
159
- The router considers conversation history:
160
-
161
- - If previous message was about planning → lower threshold for planning-related follow-ups
162
- - If user just shared code → debugging/review more likely
163
- - If discussing architecture → planning/design more likely
164
-
165
- ## Override Behavior
166
-
167
- Users can still use explicit commands to override:
168
- - `/plan` - Force planning mode
169
- - `/brainstorm` - Force brainstorming mode
170
- - `/fix` - Force debugging mode
171
-
172
- Explicit commands bypass intent detection.
173
-
174
- ## Configuration
175
-
176
- Skills can declare their trigger conditions in their SKILL.md frontmatter:
177
-
178
- ```yaml
179
- metadata: {
180
- "openclaw": {
181
- "triggers": {
182
- "keywords": ["plan", "design", "architect"],
183
- "patterns": ["how should I", "best way to"],
184
- "confidence_boost": 0.1
185
- }
186
- }
187
- }
188
- ```
189
-
190
- ## Performance Notes
191
-
192
- - Intent detection runs in <50ms
193
- - Only loads full skill content after routing
194
- - Caches recent intent classifications
195
- - Batches multiple skill reads when needed