casabot 1.1.13 → 1.2.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/README.md +3 -1
- package/dist/agent/base.js +2 -0
- package/dist/cli/setup.js +59 -1
- package/dist/config/manager.js +1 -1
- package/package.json +1 -1
- package/skills/agent/SKILL.md +91 -31
- package/skills/config/SKILL.md +2 -1
- package/skills/subskills/SKILL.md +199 -0
- package/src/agent/base.ts +2 -0
- package/src/cli/setup.ts +59 -1
- package/src/config/manager.ts +1 -1
- package//354/227/220/354/235/264/354/240/204/355/212/270/354/227/220/352/262/214.md +24 -0
package/README.md
CHANGED
|
@@ -57,7 +57,8 @@ User ↔ TUI (Terminal UI) ↔ Base Agent (terminal access)
|
|
|
57
57
|
│ ├── config/SKILL.md # CasAbot configuration
|
|
58
58
|
│ ├── chat/SKILL.md # Conversation management
|
|
59
59
|
│ ├── service/SKILL.md # System service registration
|
|
60
|
-
│
|
|
60
|
+
│ ├── memory/SKILL.md # Memory management
|
|
61
|
+
│ └── subskills/SKILL.md # Sub-agent skill attachment and management
|
|
61
62
|
├── workspaces/ # Per-agent workspaces
|
|
62
63
|
├── history/ # Full conversation logs (raw)
|
|
63
64
|
└── memory/ # Agent-authored notes (.md)
|
|
@@ -83,6 +84,7 @@ User ↔ TUI (Terminal UI) ↔ Base Agent (terminal access)
|
|
|
83
84
|
| `chat` | Conversation session management and search |
|
|
84
85
|
| `service` | systemd service registration and automation |
|
|
85
86
|
| `memory` | Write, query, and search agent notes |
|
|
87
|
+
| `subskills` | Attach and manage skills available to sub-agents |
|
|
86
88
|
|
|
87
89
|
## Adding Skills
|
|
88
90
|
|
package/dist/agent/base.js
CHANGED
|
@@ -24,6 +24,8 @@ export function buildSystemPrompt(skills) {
|
|
|
24
24
|
2. Refer to skill documents first. Read the relevant SKILL.md and follow the instructions.
|
|
25
25
|
3. Delegate to an appropriate sub-agent if one exists; otherwise, create a new one and delegate.
|
|
26
26
|
4. Only perform orchestration (agent creation/delegation/management) directly.
|
|
27
|
+
5. Try to solve problems independently using all available information before asking the user. Only ask the user when you truly need information you cannot obtain on your own (e.g. API keys, sudo passwords, personal preferences).
|
|
28
|
+
6. When you encounter information worth remembering (e.g. user preferences, API keys, system details), use the memory skill to persist it for future sessions.
|
|
27
29
|
|
|
28
30
|
## Available Tools
|
|
29
31
|
- \`run_command\`: Executes a command in the terminal. Use this single tool to read skills, manage sub-agents, and perform all orchestration.
|
package/dist/cli/setup.js
CHANGED
|
@@ -101,7 +101,8 @@ ls ~/casabot/workspaces/<agent-name>/output/
|
|
|
101
101
|
│ ├── config/
|
|
102
102
|
│ ├── chat/
|
|
103
103
|
│ ├── service/
|
|
104
|
-
│
|
|
104
|
+
│ ├── memory/
|
|
105
|
+
│ └── subskills/
|
|
105
106
|
├── workspaces/ # Per-agent workspaces
|
|
106
107
|
├── history/ # Full conversation logs (raw logs)
|
|
107
108
|
└── memory/ # Agent-written memos (.md)
|
|
@@ -270,6 +271,63 @@ grep -rl "keyword" ~/casabot/memory/
|
|
|
270
271
|
|
|
271
272
|
# Read specific memory file
|
|
272
273
|
cat ~/casabot/memory/<filename>.md
|
|
274
|
+
\`\`\``,
|
|
275
|
+
},
|
|
276
|
+
subskills: {
|
|
277
|
+
name: "Sub-Agent Skills (subskills)",
|
|
278
|
+
description: "Manual for attaching and managing skills available to sub-agents",
|
|
279
|
+
content: `# Sub-Agent Skills (subskills)
|
|
280
|
+
|
|
281
|
+
## What is /subskills?
|
|
282
|
+
Each skill directory can contain a \`/subskills\` subdirectory holding skill documents intended for sub-agents.
|
|
283
|
+
|
|
284
|
+
\`\`\`
|
|
285
|
+
~/casabot/skills/
|
|
286
|
+
├── agent/
|
|
287
|
+
│ ├── SKILL.md
|
|
288
|
+
│ └── subskills/
|
|
289
|
+
│ ├── python-dev/SKILL.md
|
|
290
|
+
│ └── web-scraper/SKILL.md
|
|
291
|
+
└── subskills/
|
|
292
|
+
└── SKILL.md
|
|
293
|
+
\`\`\`
|
|
294
|
+
|
|
295
|
+
## Who can add subskills?
|
|
296
|
+
- **Agents**: Search for tools/techniques and write subskill documents autonomously.
|
|
297
|
+
- **Users**: Place skill documents directly into any \`/subskills\` directory.
|
|
298
|
+
|
|
299
|
+
\`\`\`bash
|
|
300
|
+
# Create a subskill
|
|
301
|
+
mkdir -p ~/casabot/skills/agent/subskills/python-dev
|
|
302
|
+
cat > ~/casabot/skills/agent/subskills/python-dev/SKILL.md << 'EOF'
|
|
303
|
+
---
|
|
304
|
+
name: Python Development
|
|
305
|
+
description: Guidelines for Python-based sub-agents
|
|
306
|
+
metadata:
|
|
307
|
+
casabot:
|
|
308
|
+
requires:
|
|
309
|
+
bins: [python3]
|
|
310
|
+
---
|
|
311
|
+
# Python Development
|
|
312
|
+
Instructions for sub-agents...
|
|
313
|
+
EOF
|
|
314
|
+
\`\`\`
|
|
315
|
+
|
|
316
|
+
## Passing subskills to sub-agents
|
|
317
|
+
\`\`\`bash
|
|
318
|
+
# Mount subskills into container
|
|
319
|
+
podman run -d --name <agent-name> --label casabot=true \\
|
|
320
|
+
-v ~/casabot/skills/agent/subskills:/subskills:ro \\
|
|
321
|
+
-v ~/casabot/workspaces/<agent-name>:/workspace \\
|
|
322
|
+
node:20-slim sleep infinity
|
|
323
|
+
\`\`\`
|
|
324
|
+
|
|
325
|
+
## Listing and searching
|
|
326
|
+
\`\`\`bash
|
|
327
|
+
# List all subskills
|
|
328
|
+
find ~/casabot/skills/*/subskills -name "SKILL.md" 2>/dev/null
|
|
329
|
+
# Search by keyword
|
|
330
|
+
grep -rl "keyword" ~/casabot/skills/*/subskills/ 2>/dev/null
|
|
273
331
|
\`\`\``,
|
|
274
332
|
},
|
|
275
333
|
};
|
package/dist/config/manager.js
CHANGED
|
@@ -9,7 +9,7 @@ export const PATHS = {
|
|
|
9
9
|
history: join(CASABOT_HOME, "history"),
|
|
10
10
|
memory: join(CASABOT_HOME, "memory"),
|
|
11
11
|
};
|
|
12
|
-
const SKILL_DIRS = ["agent", "config", "chat", "service", "memory"];
|
|
12
|
+
const SKILL_DIRS = ["agent", "config", "chat", "service", "memory", "subskills"];
|
|
13
13
|
export function getDefaultConfig() {
|
|
14
14
|
return {
|
|
15
15
|
providers: [],
|
package/package.json
CHANGED
package/skills/agent/SKILL.md
CHANGED
|
@@ -15,7 +15,7 @@ This manual explains how the base agent creates and manages podman-based sub-age
|
|
|
15
15
|
|
|
16
16
|
## 1. Install podman
|
|
17
17
|
|
|
18
|
-
podman
|
|
18
|
+
podman is needed before creating sub-agents.
|
|
19
19
|
|
|
20
20
|
### Step 1: Check if podman is already installed
|
|
21
21
|
|
|
@@ -25,27 +25,21 @@ which podman && podman --version
|
|
|
25
25
|
|
|
26
26
|
If podman is found, skip to Section 2.
|
|
27
27
|
|
|
28
|
-
### Step 2: Gather
|
|
28
|
+
### Step 2: Gather system information
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Try to detect as much as possible automatically before involving the user.
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
If the distro cannot be determined, ask the user: *"Which Linux distribution are you using? (e.g. Ubuntu, Fedora, Arch, Debian, RHEL, etc.)"*
|
|
37
|
-
|
|
38
|
-
2. **Ask about sudo privileges:**
|
|
39
|
-
*"Do you have sudo (root) privileges on this system?"*
|
|
40
|
-
— If the user does not have sudo, guide them to request it from an administrator, or suggest rootless podman setup if possible.
|
|
32
|
+
```bash
|
|
33
|
+
# Detect distro
|
|
34
|
+
cat /etc/os-release
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
# Check if sudo is available
|
|
37
|
+
sudo -n true 2>/dev/null && echo "sudo: available" || echo "sudo: not available"
|
|
38
|
+
```
|
|
44
39
|
|
|
45
|
-
|
|
46
|
-
*"Do you have any specific requirements? (e.g. a particular podman version, a custom storage location, proxy settings, etc.)"*
|
|
40
|
+
If auto-detection fails or sudo is unavailable, ask the user for clarification. You may also ask about preferences like rootless mode or custom storage locations if relevant.
|
|
47
41
|
|
|
48
|
-
### Step 3: Install podman
|
|
42
|
+
### Step 3: Install podman
|
|
49
43
|
|
|
50
44
|
```bash
|
|
51
45
|
# Debian / Ubuntu
|
|
@@ -61,7 +55,7 @@ sudo pacman -S podman
|
|
|
61
55
|
sudo zypper install -y podman
|
|
62
56
|
```
|
|
63
57
|
|
|
64
|
-
If
|
|
58
|
+
If rootless mode is desired, configure subuid/subgid:
|
|
65
59
|
|
|
66
60
|
```bash
|
|
67
61
|
sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $(whoami)
|
|
@@ -75,6 +69,8 @@ podman --version
|
|
|
75
69
|
podman info
|
|
76
70
|
```
|
|
77
71
|
|
|
72
|
+
Consider using the memory skill to save the detected distro and podman version for future reference.
|
|
73
|
+
|
|
78
74
|
## 2. Configure podman storage
|
|
79
75
|
|
|
80
76
|
Check the path where container images and layers are stored, and verify sufficient disk space.
|
|
@@ -87,11 +83,11 @@ podman info --format '{{.Store.GraphRoot}}'
|
|
|
87
83
|
df -h $(podman info --format '{{.Store.GraphRoot}}')
|
|
88
84
|
```
|
|
89
85
|
|
|
90
|
-
If space is insufficient,
|
|
86
|
+
If space is insufficient, `graphroot` in `~/.config/containers/storage.conf` can be adjusted.
|
|
91
87
|
|
|
92
88
|
## 3. Create sub-agent container
|
|
93
89
|
|
|
94
|
-
All sub-agent containers
|
|
90
|
+
All sub-agent containers should be assigned the `casabot` label for identification.
|
|
95
91
|
|
|
96
92
|
```bash
|
|
97
93
|
# Create a new agent container
|
|
@@ -103,7 +99,7 @@ podman run -d \
|
|
|
103
99
|
node:20-slim sleep infinity
|
|
104
100
|
```
|
|
105
101
|
|
|
106
|
-
###
|
|
102
|
+
### Recommended conventions
|
|
107
103
|
- `--label casabot=true`: Used to identify all CasAbot sub-agents.
|
|
108
104
|
- `-v ~/casabot/workspaces/<agent-name>:/workspace`: Mounts a dedicated workspace for each agent.
|
|
109
105
|
- `-v ~/casabot/skills:/skills:ro`: Shares the skills directory as read-only.
|
|
@@ -117,7 +113,9 @@ podman exec <agent-name> node /workspace/agent.js
|
|
|
117
113
|
|
|
118
114
|
## 4. Pass provider settings
|
|
119
115
|
|
|
120
|
-
|
|
116
|
+
Provider settings can be read from `~/casabot/casabot.json`. If the file is unavailable or incomplete, ask the user for the provider type, API key, and model name.
|
|
117
|
+
|
|
118
|
+
When sensitive information like API keys is obtained, consider persisting it via the memory skill so it doesn't need to be requested again.
|
|
121
119
|
|
|
122
120
|
Pass LLM provider information to sub-agents via environment variables.
|
|
123
121
|
|
|
@@ -131,7 +129,7 @@ podman exec \
|
|
|
131
129
|
<agent-name> node /workspace/agent.js
|
|
132
130
|
```
|
|
133
131
|
|
|
134
|
-
Or set them
|
|
132
|
+
Or set them when creating the container:
|
|
135
133
|
|
|
136
134
|
```bash
|
|
137
135
|
podman run -d \
|
|
@@ -158,7 +156,69 @@ cat /skills/memory/SKILL.md
|
|
|
158
156
|
ls /skills/
|
|
159
157
|
```
|
|
160
158
|
|
|
161
|
-
## 6.
|
|
159
|
+
## 6. Pass subskills
|
|
160
|
+
|
|
161
|
+
Each skill directory can contain a `subskills/` subdirectory with skills specifically intended for sub-agents. When delegating a task, consider checking for relevant subskills to pass along.
|
|
162
|
+
|
|
163
|
+
> **Note:** The full skills mount (`-v ~/casabot/skills:/skills:ro` from Section 3) already includes all `subskills/` directories. The separate mount shown below is an alternative for providing targeted access to specific subskills.
|
|
164
|
+
|
|
165
|
+
### Discover available subskills
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# List all subskills across all skill directories
|
|
169
|
+
find ~/casabot/skills/*/subskills -name "SKILL.md" 2>/dev/null
|
|
170
|
+
|
|
171
|
+
# List subskills for a specific skill
|
|
172
|
+
ls ~/casabot/skills/agent/subskills/ 2>/dev/null
|
|
173
|
+
|
|
174
|
+
# Search subskills by keyword
|
|
175
|
+
grep -rl "keyword" ~/casabot/skills/*/subskills/ 2>/dev/null
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Mount subskills into a sub-agent container
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# Mount a specific skill's subskills
|
|
182
|
+
podman run -d \
|
|
183
|
+
--name <agent-name> \
|
|
184
|
+
--label casabot=true \
|
|
185
|
+
-v ~/casabot/skills/agent/subskills:/subskills:ro \
|
|
186
|
+
-v ~/casabot/workspaces/<agent-name>:/workspace \
|
|
187
|
+
node:20-slim sleep infinity
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Or copy specific subskill documents:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
podman cp ~/casabot/skills/agent/subskills/python-dev/SKILL.md \
|
|
194
|
+
<agent-name>:/workspace/skills/python-dev/SKILL.md
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Create new subskills
|
|
198
|
+
|
|
199
|
+
If a task requires capabilities not yet covered by existing subskills, the agent can search the web for relevant tools, libraries, or techniques and write a new subskill document.
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
mkdir -p ~/casabot/skills/<skill>/subskills/<new-subskill>
|
|
203
|
+
cat > ~/casabot/skills/<skill>/subskills/<new-subskill>/SKILL.md << 'EOF'
|
|
204
|
+
---
|
|
205
|
+
name: New Subskill
|
|
206
|
+
description: What this subskill provides
|
|
207
|
+
metadata:
|
|
208
|
+
casabot:
|
|
209
|
+
requires:
|
|
210
|
+
bins: []
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
# New Subskill
|
|
214
|
+
|
|
215
|
+
(Instructions for sub-agents)
|
|
216
|
+
EOF
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Users can also add subskill documents manually at any time. Refer to the `subskills` skill for detailed guidance.
|
|
220
|
+
|
|
221
|
+
## 7. List agents
|
|
162
222
|
|
|
163
223
|
Query all containers with the `casabot` label.
|
|
164
224
|
|
|
@@ -170,7 +230,7 @@ podman ps --filter "label=casabot" --format "{{.Names}}\t{{.Status}}"
|
|
|
170
230
|
podman ps -a --filter "label=casabot" --format "table {{.Names}}\t{{.Status}}\t{{.Created}}"
|
|
171
231
|
```
|
|
172
232
|
|
|
173
|
-
##
|
|
233
|
+
## 8. Destroy and clean up agents
|
|
174
234
|
|
|
175
235
|
Clean up agents that are no longer needed.
|
|
176
236
|
|
|
@@ -190,7 +250,7 @@ podman ps -a --filter "label=casabot" --format "{{.Names}}" | xargs -r podman st
|
|
|
190
250
|
podman ps -a --filter "label=casabot" --format "{{.Names}}" | xargs -r podman rm
|
|
191
251
|
```
|
|
192
252
|
|
|
193
|
-
##
|
|
253
|
+
## 9. Delegate tasks
|
|
194
254
|
|
|
195
255
|
How to pass tasks to sub-agents.
|
|
196
256
|
|
|
@@ -204,11 +264,11 @@ podman exec <agent-name> node /workspace/agent.js --task /workspace/task.txt
|
|
|
204
264
|
```
|
|
205
265
|
|
|
206
266
|
### Delegation principles
|
|
207
|
-
- base is an orchestrator.
|
|
208
|
-
- If no suitable sub-agent exists,
|
|
209
|
-
-
|
|
267
|
+
- The base agent is an orchestrator. Actual work is typically delegated to sub-agents.
|
|
268
|
+
- If no suitable sub-agent exists, a new one can be created for the task.
|
|
269
|
+
- Clear and specific task descriptions tend to produce better results.
|
|
210
270
|
|
|
211
|
-
##
|
|
271
|
+
## 10. Collect results
|
|
212
272
|
|
|
213
273
|
Check the results of sub-agent work.
|
|
214
274
|
|
|
@@ -226,4 +286,4 @@ ls ~/casabot/workspaces/<agent-name>/output/
|
|
|
226
286
|
cat ~/casabot/workspaces/<agent-name>/output/result.txt
|
|
227
287
|
```
|
|
228
288
|
|
|
229
|
-
After collecting results,
|
|
289
|
+
After collecting results, the findings can be summarized and reported to the user.
|
package/skills/config/SKILL.md
CHANGED
|
@@ -25,7 +25,8 @@ All CasAbot data is stored under `~/casabot/`.
|
|
|
25
25
|
│ ├── config/ # Configuration management (this document)
|
|
26
26
|
│ ├── chat/ # Conversation management
|
|
27
27
|
│ ├── service/ # System service registration
|
|
28
|
-
│
|
|
28
|
+
│ ├── memory/ # Memory (memo) management
|
|
29
|
+
│ └── subskills/ # Sub-agent skill attachment and management
|
|
29
30
|
├── workspaces/ # Per-agent workspaces
|
|
30
31
|
│ └── <agent-name>/ # Individual agent working directory
|
|
31
32
|
│ └── output/ # Agent output results
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Sub-Agent Skills (subskills)
|
|
3
|
+
description: Manual for attaching and managing skills available to sub-agents
|
|
4
|
+
metadata:
|
|
5
|
+
casabot:
|
|
6
|
+
requires:
|
|
7
|
+
bins: []
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Sub-Agent Skills (subskills)
|
|
11
|
+
|
|
12
|
+
This manual explains the `/subskills` directory mechanism — a way to attach, discover, and manage skill documents that sub-agents can use.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 1. What is /subskills?
|
|
17
|
+
|
|
18
|
+
Each skill directory under `~/casabot/skills/` can contain a `/subskills` subdirectory. This subdirectory holds skill documents intended for sub-agents rather than the base agent.
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
~/casabot/skills/
|
|
22
|
+
├── agent/
|
|
23
|
+
│ ├── SKILL.md
|
|
24
|
+
│ └── subskills/ ← Skills for sub-agents in this domain
|
|
25
|
+
│ ├── python-dev/
|
|
26
|
+
│ │ └── SKILL.md
|
|
27
|
+
│ └── web-scraper/
|
|
28
|
+
│ └── SKILL.md
|
|
29
|
+
├── memory/
|
|
30
|
+
│ ├── SKILL.md
|
|
31
|
+
│ └── subskills/
|
|
32
|
+
│ └── vector-search/
|
|
33
|
+
│ └── SKILL.md
|
|
34
|
+
└── subskills/
|
|
35
|
+
└── SKILL.md ← This document
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Key Concepts
|
|
39
|
+
|
|
40
|
+
- **Base skills** (`SKILL.md` at the skill root) are read by the base agent.
|
|
41
|
+
- **Subskills** (`subskills/<name>/SKILL.md`) are passed to sub-agents when they are created or delegated tasks.
|
|
42
|
+
- Subskill documents follow the same format as regular skills (YAML frontmatter + Markdown body).
|
|
43
|
+
|
|
44
|
+
## 2. Who can add subskills?
|
|
45
|
+
|
|
46
|
+
### Agent-driven discovery
|
|
47
|
+
|
|
48
|
+
The base agent (or a sub-agent) can search for relevant tools, libraries, or techniques and write a new subskill document based on the findings.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Create a subskill directory
|
|
52
|
+
mkdir -p ~/casabot/skills/agent/subskills/python-dev
|
|
53
|
+
|
|
54
|
+
# Write the subskill document
|
|
55
|
+
cat > ~/casabot/skills/agent/subskills/python-dev/SKILL.md << 'EOF'
|
|
56
|
+
---
|
|
57
|
+
name: Python Development
|
|
58
|
+
description: Guidelines and tools for Python-based sub-agents
|
|
59
|
+
metadata:
|
|
60
|
+
casabot:
|
|
61
|
+
requires:
|
|
62
|
+
bins: [python3, pip]
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
# Python Development
|
|
66
|
+
|
|
67
|
+
Instructions for sub-agents working on Python projects...
|
|
68
|
+
EOF
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### User-provided subskills
|
|
72
|
+
|
|
73
|
+
Users can also place skill documents directly into the `/subskills` directory of any skill. This is useful for domain-specific instructions or custom tool configurations that the user wants sub-agents to follow.
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# User manually adds a subskill
|
|
77
|
+
mkdir -p ~/casabot/skills/agent/subskills/my-custom-tool
|
|
78
|
+
cat > ~/casabot/skills/agent/subskills/my-custom-tool/SKILL.md << 'EOF'
|
|
79
|
+
---
|
|
80
|
+
name: My Custom Tool
|
|
81
|
+
description: Custom tool usage instructions for sub-agents
|
|
82
|
+
metadata:
|
|
83
|
+
casabot:
|
|
84
|
+
requires:
|
|
85
|
+
bins: []
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
# My Custom Tool
|
|
89
|
+
|
|
90
|
+
(Custom instructions for sub-agents...)
|
|
91
|
+
EOF
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 3. How to pass subskills to sub-agents
|
|
95
|
+
|
|
96
|
+
When creating or delegating to a sub-agent, mount or copy the relevant subskills into the container.
|
|
97
|
+
|
|
98
|
+
### Mount the entire subskills directory
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Mount a specific skill's subskills into the container
|
|
102
|
+
podman run -d \
|
|
103
|
+
--name <agent-name> \
|
|
104
|
+
--label casabot=true \
|
|
105
|
+
-v ~/casabot/skills/agent/subskills:/subskills:ro \
|
|
106
|
+
-v ~/casabot/workspaces/<agent-name>:/workspace \
|
|
107
|
+
node:20-slim sleep infinity
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Copy specific subskill documents
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Copy only the relevant subskill into the container
|
|
114
|
+
podman cp ~/casabot/skills/agent/subskills/python-dev/SKILL.md \
|
|
115
|
+
<agent-name>:/workspace/skills/python-dev/SKILL.md
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Reading subskills inside a sub-agent
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# List available subskills
|
|
122
|
+
ls /subskills/
|
|
123
|
+
|
|
124
|
+
# Read a specific subskill
|
|
125
|
+
cat /subskills/python-dev/SKILL.md
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 4. Listing and searching subskills
|
|
129
|
+
|
|
130
|
+
### List all subskills across all skill directories
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
find ~/casabot/skills/*/subskills -name "SKILL.md" 2>/dev/null
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Search subskills by keyword
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
grep -rl "keyword" ~/casabot/skills/*/subskills/ 2>/dev/null
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### List subskills for a specific skill
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
ls ~/casabot/skills/agent/subskills/
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## 5. Managing subskills
|
|
149
|
+
|
|
150
|
+
### Remove a subskill
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
rm -rf ~/casabot/skills/<skill>/subskills/<subskill-name>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Update a subskill
|
|
157
|
+
|
|
158
|
+
Simply overwrite the `SKILL.md` file in the subskill directory.
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
cat > ~/casabot/skills/<skill>/subskills/<subskill-name>/SKILL.md << 'EOF'
|
|
162
|
+
---
|
|
163
|
+
name: Updated Skill Name
|
|
164
|
+
description: Updated description
|
|
165
|
+
metadata:
|
|
166
|
+
casabot:
|
|
167
|
+
requires:
|
|
168
|
+
bins: []
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
# Updated content...
|
|
172
|
+
EOF
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## 6. Subskill Document Format
|
|
176
|
+
|
|
177
|
+
Subskill documents follow the same structure as regular skill documents:
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
---
|
|
181
|
+
name: Subskill Name
|
|
182
|
+
description: What this subskill provides to sub-agents
|
|
183
|
+
metadata:
|
|
184
|
+
casabot:
|
|
185
|
+
requires:
|
|
186
|
+
bins: []
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
# Subskill Title
|
|
190
|
+
|
|
191
|
+
(Instructions, examples, and references for sub-agents)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## 7. Important Notes
|
|
195
|
+
|
|
196
|
+
- Subskills are **not** automatically loaded by the base agent. They must be explicitly passed to sub-agents.
|
|
197
|
+
- The base agent decides which subskills are relevant for a given task and passes them accordingly.
|
|
198
|
+
- Agents are encouraged to search for new tools and techniques and create subskills to expand future capabilities.
|
|
199
|
+
- Users can add subskills at any time without restarting CasAbot.
|
package/src/agent/base.ts
CHANGED
|
@@ -33,6 +33,8 @@ export function buildSystemPrompt(skills: Skill[]): string {
|
|
|
33
33
|
2. Refer to skill documents first. Read the relevant SKILL.md and follow the instructions.
|
|
34
34
|
3. Delegate to an appropriate sub-agent if one exists; otherwise, create a new one and delegate.
|
|
35
35
|
4. Only perform orchestration (agent creation/delegation/management) directly.
|
|
36
|
+
5. Try to solve problems independently using all available information before asking the user. Only ask the user when you truly need information you cannot obtain on your own (e.g. API keys, sudo passwords, personal preferences).
|
|
37
|
+
6. When you encounter information worth remembering (e.g. user preferences, API keys, system details), use the memory skill to persist it for future sessions.
|
|
36
38
|
|
|
37
39
|
## Available Tools
|
|
38
40
|
- \`run_command\`: Executes a command in the terminal. Use this single tool to read skills, manage sub-agents, and perform all orchestration.
|
package/src/cli/setup.ts
CHANGED
|
@@ -108,7 +108,8 @@ ls ~/casabot/workspaces/<agent-name>/output/
|
|
|
108
108
|
│ ├── config/
|
|
109
109
|
│ ├── chat/
|
|
110
110
|
│ ├── service/
|
|
111
|
-
│
|
|
111
|
+
│ ├── memory/
|
|
112
|
+
│ └── subskills/
|
|
112
113
|
├── workspaces/ # Per-agent workspaces
|
|
113
114
|
├── history/ # Full conversation logs (raw logs)
|
|
114
115
|
└── memory/ # Agent-written memos (.md)
|
|
@@ -277,6 +278,63 @@ grep -rl "keyword" ~/casabot/memory/
|
|
|
277
278
|
|
|
278
279
|
# Read specific memory file
|
|
279
280
|
cat ~/casabot/memory/<filename>.md
|
|
281
|
+
\`\`\``,
|
|
282
|
+
},
|
|
283
|
+
subskills: {
|
|
284
|
+
name: "Sub-Agent Skills (subskills)",
|
|
285
|
+
description: "Manual for attaching and managing skills available to sub-agents",
|
|
286
|
+
content: `# Sub-Agent Skills (subskills)
|
|
287
|
+
|
|
288
|
+
## What is /subskills?
|
|
289
|
+
Each skill directory can contain a \`/subskills\` subdirectory holding skill documents intended for sub-agents.
|
|
290
|
+
|
|
291
|
+
\`\`\`
|
|
292
|
+
~/casabot/skills/
|
|
293
|
+
├── agent/
|
|
294
|
+
│ ├── SKILL.md
|
|
295
|
+
│ └── subskills/
|
|
296
|
+
│ ├── python-dev/SKILL.md
|
|
297
|
+
│ └── web-scraper/SKILL.md
|
|
298
|
+
└── subskills/
|
|
299
|
+
└── SKILL.md
|
|
300
|
+
\`\`\`
|
|
301
|
+
|
|
302
|
+
## Who can add subskills?
|
|
303
|
+
- **Agents**: Search for tools/techniques and write subskill documents autonomously.
|
|
304
|
+
- **Users**: Place skill documents directly into any \`/subskills\` directory.
|
|
305
|
+
|
|
306
|
+
\`\`\`bash
|
|
307
|
+
# Create a subskill
|
|
308
|
+
mkdir -p ~/casabot/skills/agent/subskills/python-dev
|
|
309
|
+
cat > ~/casabot/skills/agent/subskills/python-dev/SKILL.md << 'EOF'
|
|
310
|
+
---
|
|
311
|
+
name: Python Development
|
|
312
|
+
description: Guidelines for Python-based sub-agents
|
|
313
|
+
metadata:
|
|
314
|
+
casabot:
|
|
315
|
+
requires:
|
|
316
|
+
bins: [python3]
|
|
317
|
+
---
|
|
318
|
+
# Python Development
|
|
319
|
+
Instructions for sub-agents...
|
|
320
|
+
EOF
|
|
321
|
+
\`\`\`
|
|
322
|
+
|
|
323
|
+
## Passing subskills to sub-agents
|
|
324
|
+
\`\`\`bash
|
|
325
|
+
# Mount subskills into container
|
|
326
|
+
podman run -d --name <agent-name> --label casabot=true \\
|
|
327
|
+
-v ~/casabot/skills/agent/subskills:/subskills:ro \\
|
|
328
|
+
-v ~/casabot/workspaces/<agent-name>:/workspace \\
|
|
329
|
+
node:20-slim sleep infinity
|
|
330
|
+
\`\`\`
|
|
331
|
+
|
|
332
|
+
## Listing and searching
|
|
333
|
+
\`\`\`bash
|
|
334
|
+
# List all subskills
|
|
335
|
+
find ~/casabot/skills/*/subskills -name "SKILL.md" 2>/dev/null
|
|
336
|
+
# Search by keyword
|
|
337
|
+
grep -rl "keyword" ~/casabot/skills/*/subskills/ 2>/dev/null
|
|
280
338
|
\`\`\``,
|
|
281
339
|
},
|
|
282
340
|
};
|
package/src/config/manager.ts
CHANGED
|
@@ -13,7 +13,7 @@ export const PATHS = {
|
|
|
13
13
|
memory: join(CASABOT_HOME, "memory"),
|
|
14
14
|
} as const;
|
|
15
15
|
|
|
16
|
-
const SKILL_DIRS = ["agent", "config", "chat", "service", "memory"];
|
|
16
|
+
const SKILL_DIRS = ["agent", "config", "chat", "service", "memory", "subskills"];
|
|
17
17
|
|
|
18
18
|
export function getDefaultConfig(): CasabotConfig {
|
|
19
19
|
return {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
명심해야할 사항
|
|
2
|
+
# 0. README를 읽고 시작할 것.
|
|
3
|
+
1. README.md를 읽고 시작할 것.
|
|
4
|
+
2. 현재 변경한 내용이 아니더라도 특정 부분이 README와 다르다면 README를 업데이트할 것.
|
|
5
|
+
3. 변경 사항이 있었고 그 부분이 README에 명시된 내용 중 포함되어 있다면 README를 업데이트할 것.
|
|
6
|
+
# 1. CasAbot의 시스템 프롬프트에는 다음 내용이 "영어로" 포함되어야 한다.
|
|
7
|
+
1. SKILL을 잘 사용하기 위한 모든 내용
|
|
8
|
+
2. 에이전트 자기 자신을 정의하는 내용
|
|
9
|
+
3. 필요 시(예: api key, sudo 비밀번호 등) 사용자에게 정보를 요청해야 한다는 것
|
|
10
|
+
4. 되도록이면 자신이 할 수 있는 모든 정보를 동원하여 사용자의 도움 없이 해결할 것
|
|
11
|
+
5. 기억해야 하는 내용(예: 사용자 취향, api key, sudo 비밀번호, 현재 시스템 정보 등)이면 memory skill
|
|
12
|
+
6. 기타 변경 가능 내용들
|
|
13
|
+
# 2. 스킬 설명에서 명심해야할 사항
|
|
14
|
+
1. 모든 스킬은 "어떻게 사용하는가"를 명시해야 하지만, "어떻게 사용해야 한다라고" 단정짓는 것은 피해야 한다. 에이전트가 스킬을 "자유롭고 창의적으로 이용"하는것이 중요하다.
|
|
15
|
+
2. 스킬에 들어갈 내용은 "최신 사항"이어야 하며, "과거의 사실"이 포함되지 않아야 한다. 너의 지식은 과거의 지식이 많기 때문에 꼭 "검색"을 하여 최신 사항을 체크해야 한다.
|
|
16
|
+
3. 스킬 문서는 영어로 작성되어야 하지만, "일부 예외적인 상황"에서는 다른 언어로 작성을 허용한다.
|
|
17
|
+
# 3. 철학 변경 금지
|
|
18
|
+
1. README에 명시되어 있는 핵심 철학을 확인할 것.
|
|
19
|
+
2. 핵심 철학을 이해하였다면 절대 핵심 철학을 변경하지 말것.
|
|
20
|
+
3. 핵심 철학을 이해하지 못하였다면, 너의 지식이 부족한 것이니, 검색을 하여 찾아볼 것.
|
|
21
|
+
# 4. 실행 환경
|
|
22
|
+
1. 이 패키지는 이 컴퓨터에서 실행되지 않는다.여기서 실행하게 하지 말 것.
|
|
23
|
+
2. 이 패키지는 여기 설치되어 있지 않다. 이 환경 기준으로 생각하지 말 것.
|
|
24
|
+
|