mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-18 01:00:32 +00:00
feat: acp http adapter
This commit is contained in:
parent
2ba630c180
commit
b4c8564cb2
217 changed files with 18785 additions and 17400 deletions
|
|
@ -1,88 +1,81 @@
|
|||
---
|
||||
title: "Skills"
|
||||
description: "Auto-load skills into agent sessions."
|
||||
description: "Configure skill sources for agent sessions."
|
||||
sidebarTitle: "Skills"
|
||||
icon: "sparkles"
|
||||
---
|
||||
|
||||
Skills are local instruction bundles stored in `SKILL.md` files. Sandbox Agent can fetch, discover, and link skill directories into agent-specific skill paths at session start using the `skills.sources` field. The format is fully compatible with [skills.sh](https://skills.sh).
|
||||
Skills are local instruction bundles stored in `SKILL.md` files.
|
||||
|
||||
## Session Config
|
||||
## Configuring skills
|
||||
|
||||
Pass `skills.sources` when creating a session to load skills from GitHub repos, local paths, or git URLs.
|
||||
Use `setSkillsConfig` / `getSkillsConfig` / `deleteSkillsConfig` to manage skill source config by directory + skill name.
|
||||
|
||||
<CodeGroup>
|
||||
```ts
|
||||
import { SandboxAgent } from "sandbox-agent";
|
||||
|
||||
```ts TypeScript
|
||||
import { SandboxAgentClient } from "sandbox-agent";
|
||||
|
||||
const client = new SandboxAgentClient({
|
||||
const sdk = await SandboxAgent.connect({
|
||||
baseUrl: "http://127.0.0.1:2468",
|
||||
token: process.env.SANDBOX_TOKEN,
|
||||
agent: "mock",
|
||||
});
|
||||
});
|
||||
|
||||
await client.createSession("claude-skills", {
|
||||
agent: "claude",
|
||||
skills: {
|
||||
// Add a skill
|
||||
await sdk.setSkillsConfig(
|
||||
{
|
||||
directory: "/workspace",
|
||||
skillName: "default",
|
||||
},
|
||||
{
|
||||
sources: [
|
||||
{ type: "github", source: "rivet-dev/skills", skills: ["sandbox-agent"] },
|
||||
{ type: "local", source: "/workspace/my-custom-skill" },
|
||||
],
|
||||
},
|
||||
);
|
||||
|
||||
// Create a session using the configured skills
|
||||
const session = await sdk.createSession({
|
||||
agent: "claude",
|
||||
sessionInit: {
|
||||
cwd: "/workspace",
|
||||
},
|
||||
});
|
||||
|
||||
await session.prompt([
|
||||
{ type: "text", text: "Use available skills to help with this task." },
|
||||
]);
|
||||
|
||||
// List skills
|
||||
const config = await sdk.getSkillsConfig({
|
||||
directory: "/workspace",
|
||||
skillName: "default",
|
||||
});
|
||||
|
||||
console.log(config.sources.length);
|
||||
|
||||
// Delete skill
|
||||
await sdk.deleteSkillsConfig({
|
||||
directory: "/workspace",
|
||||
skillName: "default",
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
curl -X POST "http://127.0.0.1:2468/v1/sessions/claude-skills" \
|
||||
-H "Authorization: Bearer $SANDBOX_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"agent": "claude",
|
||||
"skills": {
|
||||
"sources": [
|
||||
{ "type": "github", "source": "rivet-dev/skills", "skills": ["sandbox-agent"] },
|
||||
{ "type": "local", "source": "/workspace/my-custom-skill" }
|
||||
]
|
||||
}
|
||||
}'
|
||||
```
|
||||
## Skill sources
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
Each skill directory must contain `SKILL.md`. See [Skill authoring best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices) for tips on writing effective skills.
|
||||
|
||||
## Skill Sources
|
||||
|
||||
Each entry in `skills.sources` describes where to find skills. Three source types are supported:
|
||||
Each `skills.sources` entry describes where to find skills.
|
||||
|
||||
| Type | `source` value | Example |
|
||||
|------|---------------|---------|
|
||||
| `github` | `owner/repo` | `"rivet-dev/skills"` |
|
||||
| `local` | Filesystem path | `"/workspace/my-skill"` |
|
||||
| `git` | Git clone URL | `"https://git.example.com/skills.git"` |
|
||||
| `local` | filesystem path | `"/workspace/my-skill"` |
|
||||
| `git` | git clone URL | `"https://git.example.com/skills.git"` |
|
||||
|
||||
### Optional fields
|
||||
Optional fields:
|
||||
|
||||
- **`skills`** — Array of skill directory names to include. When omitted, all discovered skills are installed.
|
||||
- **`ref`** — Branch, tag, or commit to check out (default: HEAD). Applies to `github` and `git` types.
|
||||
- **`subpath`** — Subdirectory within the repo to search for skills.
|
||||
- `skills`: subset of skill directory names to include
|
||||
- `ref`: branch/tag/commit (for `github` and `git`)
|
||||
- `subpath`: subdirectory within repo to scan
|
||||
|
||||
## Custom Skills
|
||||
## Custom skills
|
||||
|
||||
To write, upload, and configure your own skills inside the sandbox, see [Custom Tools](/custom-tools).
|
||||
|
||||
## Advanced
|
||||
|
||||
### Discovery logic
|
||||
|
||||
After resolving a source to a local directory (cloning if needed), Sandbox Agent discovers skills by:
|
||||
1. Checking if the directory itself contains `SKILL.md`.
|
||||
2. Scanning `skills/` subdirectory for child directories containing `SKILL.md`.
|
||||
3. Scanning immediate children of the directory for `SKILL.md`.
|
||||
|
||||
Discovered skills are symlinked into project-local skill roots (`.claude/skills/<name>`, `.agents/skills/<name>`, `.opencode/skill/<name>`).
|
||||
|
||||
### Caching
|
||||
|
||||
GitHub sources are downloaded as zip archives and git sources are cloned to `~/.sandbox-agent/skills-cache/` and updated on subsequent session creations. GitHub sources do not require `git` to be installed.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue