apero-kit-cli 2.3.0 → 2.4.0
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/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
# Discord +
|
|
1
|
+
# Discord + OpenClaw Setup Guide
|
|
2
2
|
|
|
3
|
-
This directory contains configuration for running your AI agent on Discord via [
|
|
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
|
|
4
11
|
|
|
5
12
|
## Quick Start
|
|
6
13
|
|
|
@@ -128,6 +135,70 @@ openclaw gateway restart
|
|
|
128
135
|
openclaw doctor
|
|
129
136
|
```
|
|
130
137
|
|
|
138
|
+
## Skills System
|
|
139
|
+
|
|
140
|
+
Your commands are converted to **OpenClaw Skills** format for better AI understanding.
|
|
141
|
+
|
|
142
|
+
### Structure
|
|
143
|
+
```
|
|
144
|
+
.discord/
|
|
145
|
+
├── skills/
|
|
146
|
+
│ ├── auto-intent-router/ # Auto-detects user intent
|
|
147
|
+
│ │ └── SKILL.md
|
|
148
|
+
│ ├── train-prompt/ # Add new knowledge
|
|
149
|
+
│ │ └── SKILL.md
|
|
150
|
+
│ ├── planning/ # Converted from /plan
|
|
151
|
+
│ │ └── SKILL.md
|
|
152
|
+
│ ├── brainstorm/ # Converted from /brainstorm
|
|
153
|
+
│ │ └── SKILL.md
|
|
154
|
+
│ └── ...
|
|
155
|
+
├── commands/ # Original commands (backup)
|
|
156
|
+
├── commands.json5 # Slash commands config
|
|
157
|
+
└── config.json5 # Main config
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### How It Works
|
|
161
|
+
|
|
162
|
+
1. **Auto Intent Router** detects what user wants from natural language
|
|
163
|
+
2. **Appropriate skill** is activated automatically
|
|
164
|
+
3. User gets response without typing commands
|
|
165
|
+
|
|
166
|
+
Example:
|
|
167
|
+
```
|
|
168
|
+
User: "I need to add payment processing"
|
|
169
|
+
Bot: [Detects PLANNING intent, activates planning skill]
|
|
170
|
+
"I'll help you plan the payment processing feature..."
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Training New Knowledge
|
|
174
|
+
|
|
175
|
+
Use the **train-prompt** skill to teach the bot new things:
|
|
176
|
+
|
|
177
|
+
### Train from URL
|
|
178
|
+
```
|
|
179
|
+
/train https://docs.stripe.com/api
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Train from File
|
|
183
|
+
```
|
|
184
|
+
/train:file ./docs/coding-standards.md
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Train Inline
|
|
188
|
+
```
|
|
189
|
+
/train:inline
|
|
190
|
+
Our deployment process:
|
|
191
|
+
1. Run tests
|
|
192
|
+
2. Build
|
|
193
|
+
3. Deploy staging
|
|
194
|
+
4. Deploy production
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### List Trained Knowledge
|
|
198
|
+
```
|
|
199
|
+
/train:list
|
|
200
|
+
```
|
|
201
|
+
|
|
131
202
|
## Troubleshooting
|
|
132
203
|
|
|
133
204
|
**Bot not responding?**
|
|
@@ -143,8 +214,14 @@ openclaw doctor
|
|
|
143
214
|
- Verify bot has required permissions
|
|
144
215
|
- Check guild configuration in `config.json5`
|
|
145
216
|
|
|
217
|
+
**Skills not loading?**
|
|
218
|
+
- Check `skills/` directory exists
|
|
219
|
+
- Verify SKILL.md files have correct frontmatter
|
|
220
|
+
- Run `openclaw skills list` to see active skills
|
|
221
|
+
|
|
146
222
|
## Resources
|
|
147
223
|
|
|
148
224
|
- [OpenClaw Documentation](https://docs.openclaw.ai)
|
|
149
225
|
- [Discord Channel Guide](https://docs.openclaw.ai/channels/discord)
|
|
226
|
+
- [Skills Guide](https://docs.openclaw.ai/tools/skills)
|
|
150
227
|
- [Slash Commands](https://docs.openclaw.ai/tools/slash-commands)
|
|
@@ -0,0 +1,195 @@
|
|
|
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
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: train-prompt
|
|
3
|
+
description: Add new documents, links, or knowledge to train and expand bot capabilities
|
|
4
|
+
user-invocable: true
|
|
5
|
+
disable-model-invocation: false
|
|
6
|
+
metadata: {"openclaw": {"always": true}}
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Train Prompt - Auto Learning System
|
|
10
|
+
|
|
11
|
+
## Trigger Conditions
|
|
12
|
+
|
|
13
|
+
Activate when user:
|
|
14
|
+
- Says: "train", "learn", "add knowledge", "teach you"
|
|
15
|
+
- Provides: URL, document link, file path
|
|
16
|
+
- Requests: "remember this", "add this to your knowledge"
|
|
17
|
+
- Commands: "/train", "/learn", "/add-doc"
|
|
18
|
+
|
|
19
|
+
## Input Types Supported
|
|
20
|
+
|
|
21
|
+
1. **URLs** - Web pages, documentation, articles
|
|
22
|
+
2. **Files** - Markdown, PDF, text files
|
|
23
|
+
3. **Inline content** - Direct text/instructions
|
|
24
|
+
4. **GitHub repos** - Repository documentation
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
### Step 1: Detect Input Type
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
IF input contains URL → fetch_and_process_url
|
|
32
|
+
IF input contains file path → read_and_process_file
|
|
33
|
+
IF input is inline text → process_inline_content
|
|
34
|
+
IF input is GitHub URL → clone_and_extract_docs
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Step 2: Process Content
|
|
38
|
+
|
|
39
|
+
#### For URLs:
|
|
40
|
+
1. Fetch URL content using `web_fetch` tool
|
|
41
|
+
2. Extract main content (remove nav, ads, etc.)
|
|
42
|
+
3. Convert to markdown format
|
|
43
|
+
4. Identify key concepts and patterns
|
|
44
|
+
|
|
45
|
+
#### For Files:
|
|
46
|
+
1. Read file content
|
|
47
|
+
2. Parse based on file type (md, pdf, txt)
|
|
48
|
+
3. Extract structured information
|
|
49
|
+
|
|
50
|
+
#### For Inline Content:
|
|
51
|
+
1. Parse user's instructions
|
|
52
|
+
2. Identify intent and knowledge type
|
|
53
|
+
3. Structure as skill or reference
|
|
54
|
+
|
|
55
|
+
### Step 3: Generate Skill/Reference
|
|
56
|
+
|
|
57
|
+
Based on content type, create:
|
|
58
|
+
|
|
59
|
+
**A) New Skill** (if content describes a workflow/process):
|
|
60
|
+
```
|
|
61
|
+
skills/<skill-name>/
|
|
62
|
+
├── SKILL.md ← Generated skill definition
|
|
63
|
+
└── references/
|
|
64
|
+
└── source.md ← Original content
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**B) Reference Document** (if content is documentation):
|
|
68
|
+
```
|
|
69
|
+
skills/<parent-skill>/
|
|
70
|
+
└── references/
|
|
71
|
+
└── <doc-name>.md ← Extracted knowledge
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**C) Bootstrap Update** (if content is identity/rules):
|
|
75
|
+
```
|
|
76
|
+
Append to SOUL.md or AGENTS.md
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Step 4: Skill Generation Template
|
|
80
|
+
|
|
81
|
+
For new skills, generate:
|
|
82
|
+
|
|
83
|
+
```yaml
|
|
84
|
+
---
|
|
85
|
+
name: {extracted-name}
|
|
86
|
+
description: {one-line-summary}
|
|
87
|
+
user-invocable: true
|
|
88
|
+
metadata: {"openclaw": {"always": true, "source": "{original-url-or-path}"}}
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
# {Skill Title}
|
|
92
|
+
|
|
93
|
+
## Purpose
|
|
94
|
+
{extracted-purpose}
|
|
95
|
+
|
|
96
|
+
## Trigger Conditions
|
|
97
|
+
Activate when user mentions:
|
|
98
|
+
{extracted-keywords}
|
|
99
|
+
|
|
100
|
+
## Workflow
|
|
101
|
+
{extracted-steps}
|
|
102
|
+
|
|
103
|
+
## Reference
|
|
104
|
+
Source: {original-source}
|
|
105
|
+
Added: {timestamp}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Step 5: Confirm & Save
|
|
109
|
+
|
|
110
|
+
1. Show preview of generated skill/reference
|
|
111
|
+
2. Ask user to confirm or edit
|
|
112
|
+
3. Save to appropriate location
|
|
113
|
+
4. Update skill index
|
|
114
|
+
|
|
115
|
+
## Commands
|
|
116
|
+
|
|
117
|
+
### /train <url>
|
|
118
|
+
Fetch and learn from a URL.
|
|
119
|
+
|
|
120
|
+
Example:
|
|
121
|
+
```
|
|
122
|
+
/train https://docs.example.com/api-guide
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### /train:file <path>
|
|
126
|
+
Learn from a local file.
|
|
127
|
+
|
|
128
|
+
Example:
|
|
129
|
+
```
|
|
130
|
+
/train:file ./docs/coding-standards.md
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### /train:inline
|
|
134
|
+
Learn from inline content.
|
|
135
|
+
|
|
136
|
+
Example:
|
|
137
|
+
```
|
|
138
|
+
/train:inline
|
|
139
|
+
When handling API errors:
|
|
140
|
+
1. Log the error with context
|
|
141
|
+
2. Return appropriate HTTP status
|
|
142
|
+
3. Never expose internal details
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### /train:github <repo-url>
|
|
146
|
+
Extract knowledge from GitHub repository.
|
|
147
|
+
|
|
148
|
+
Example:
|
|
149
|
+
```
|
|
150
|
+
/train:github https://github.com/example/repo
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### /train:list
|
|
154
|
+
Show all trained knowledge sources.
|
|
155
|
+
|
|
156
|
+
### /train:remove <skill-name>
|
|
157
|
+
Remove a trained skill.
|
|
158
|
+
|
|
159
|
+
## Output Format
|
|
160
|
+
|
|
161
|
+
After training:
|
|
162
|
+
|
|
163
|
+
```markdown
|
|
164
|
+
## Training Complete
|
|
165
|
+
|
|
166
|
+
**Source:** {url-or-path}
|
|
167
|
+
**Type:** {skill|reference|bootstrap}
|
|
168
|
+
**Location:** {saved-path}
|
|
169
|
+
|
|
170
|
+
### Generated Knowledge
|
|
171
|
+
|
|
172
|
+
**Skill:** {skill-name}
|
|
173
|
+
**Description:** {description}
|
|
174
|
+
**Triggers:** {keyword-list}
|
|
175
|
+
|
|
176
|
+
### Next Steps
|
|
177
|
+
- Test with: "{example-trigger}"
|
|
178
|
+
- Edit at: {file-path}
|
|
179
|
+
- View all: /train:list
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Storage Structure
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
.discord/
|
|
186
|
+
├── skills/
|
|
187
|
+
│ ├── trained/ ← Auto-generated skills
|
|
188
|
+
│ │ ├── api-docs-example/
|
|
189
|
+
│ │ │ ├── SKILL.md
|
|
190
|
+
│ │ │ └── references/
|
|
191
|
+
│ │ │ └── source.md
|
|
192
|
+
│ │ └── coding-standards/
|
|
193
|
+
│ │ └── SKILL.md
|
|
194
|
+
│ └── train-prompt/ ← This skill
|
|
195
|
+
│ └── SKILL.md
|
|
196
|
+
├── knowledge/ ← Reference documents
|
|
197
|
+
│ ├── sources.json ← Index of all sources
|
|
198
|
+
│ └── docs/
|
|
199
|
+
│ ├── doc-001.md
|
|
200
|
+
│ └── doc-002.md
|
|
201
|
+
└── SOUL.md ← Updated with rules
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Knowledge Index (sources.json)
|
|
205
|
+
|
|
206
|
+
```json
|
|
207
|
+
{
|
|
208
|
+
"sources": [
|
|
209
|
+
{
|
|
210
|
+
"id": "src-001",
|
|
211
|
+
"type": "url",
|
|
212
|
+
"source": "https://docs.example.com/api",
|
|
213
|
+
"skill": "api-docs-example",
|
|
214
|
+
"added": "2024-01-15T10:30:00Z",
|
|
215
|
+
"keywords": ["api", "rest", "endpoints"]
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"stats": {
|
|
219
|
+
"total_skills": 5,
|
|
220
|
+
"total_references": 12,
|
|
221
|
+
"last_updated": "2024-01-15T10:30:00Z"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Advanced Features
|
|
227
|
+
|
|
228
|
+
### Auto-Refresh
|
|
229
|
+
For URLs, optionally set up periodic refresh:
|
|
230
|
+
```
|
|
231
|
+
/train <url> --refresh=daily
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Merge Knowledge
|
|
235
|
+
Combine multiple sources into one skill:
|
|
236
|
+
```
|
|
237
|
+
/train:merge skill-a skill-b --into=combined-skill
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Export Training
|
|
241
|
+
Export all trained knowledge:
|
|
242
|
+
```
|
|
243
|
+
/train:export --format=zip
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Security Notes
|
|
247
|
+
|
|
248
|
+
- Only fetch from trusted URLs
|
|
249
|
+
- Sanitize all external content
|
|
250
|
+
- Don't execute code from external sources
|
|
251
|
+
- Review generated skills before enabling
|
|
252
|
+
|
|
253
|
+
## Examples
|
|
254
|
+
|
|
255
|
+
### Example 1: Train from API Documentation
|
|
256
|
+
```
|
|
257
|
+
User: /train https://stripe.com/docs/api
|
|
258
|
+
|
|
259
|
+
Bot: Fetching Stripe API documentation...
|
|
260
|
+
|
|
261
|
+
Training Complete!
|
|
262
|
+
|
|
263
|
+
**Skill:** stripe-api
|
|
264
|
+
**Triggers:** "stripe", "payment", "checkout", "subscription"
|
|
265
|
+
**Capabilities:**
|
|
266
|
+
- Create payment intents
|
|
267
|
+
- Handle webhooks
|
|
268
|
+
- Manage subscriptions
|
|
269
|
+
|
|
270
|
+
Test with: "How do I create a Stripe checkout session?"
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Example 2: Train Custom Workflow
|
|
274
|
+
```
|
|
275
|
+
User: /train:inline
|
|
276
|
+
Our deployment process:
|
|
277
|
+
1. Run tests: npm test
|
|
278
|
+
2. Build: npm run build
|
|
279
|
+
3. Deploy staging: ./deploy.sh staging
|
|
280
|
+
4. Smoke test staging
|
|
281
|
+
5. Deploy prod: ./deploy.sh prod
|
|
282
|
+
|
|
283
|
+
Bot: Training Complete!
|
|
284
|
+
|
|
285
|
+
**Skill:** deployment-workflow
|
|
286
|
+
**Triggers:** "deploy", "release", "staging", "production"
|
|
287
|
+
|
|
288
|
+
Test with: "Help me deploy to staging"
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Example 3: Train from GitHub
|
|
292
|
+
```
|
|
293
|
+
User: /train:github https://github.com/company/styleguide
|
|
294
|
+
|
|
295
|
+
Bot: Cloning repository...
|
|
296
|
+
Found: README.md, CONTRIBUTING.md, docs/*.md
|
|
297
|
+
|
|
298
|
+
Training Complete!
|
|
299
|
+
|
|
300
|
+
**Skills Generated:**
|
|
301
|
+
1. code-style (from style-guide.md)
|
|
302
|
+
2. git-workflow (from CONTRIBUTING.md)
|
|
303
|
+
3. project-setup (from README.md)
|
|
304
|
+
|
|
305
|
+
Test with: "What's our code style for TypeScript?"
|
|
306
|
+
```
|