본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)8.5k · #12454

Capsule Development

하는 일

이 스킬은 Unicity AOS 안에서 실행되는 작은 보안 프로그램인 캡슐을 만드는 과정을 안내합니다. 에이전트 시스템을 위해 새 프로그램 조각을 작성하고 설치하려는 개발자를 위한 것입니다.

사용하는 경우

  • ✓Unicity AOS 설정을 위한 새 캡슐을 시작하고 싶을 때.
  • ✓캡슐이 빌드, 링크, 설치에 실패해 디버깅해야 할 때.
  • ✓캡슐의 접근 규칙이 올바르게 설정되었는지 확인해야 할 때.

스킬 링크

https://github.com/unicity-aos/aos-ce/blob/main/capsules/capsule-system/src/skills/capsule-development/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/unicity-aos/aos-ce/blob/main/capsules/capsule-system/src/skills/capsule-development/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“지원되는 템플릿으로 새 Unicity AOS 캡슐을 만들고, 빌드한 뒤 테스트용으로 설치해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 공식 프로젝트 템플릿에서 시작해 매니페스트를 설정합니다. 매니페스트는 캡슐이 접근할 수 있는 것을 조절합니다. 그다음 필요한 대상으로 빌드하고 설치 전에 접근 목록을 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Capsule Development

A capsule is a Rust WebAssembly component that runs inside the Astrid Runtime sandbox shipped by Unicity AOS. The runtime routes IPC, enforces capabilities, mediates host access, and audits execution. Business logic belongs in capsules.

The manifest is part of the security boundary. Its [publish] and [subscribe] tables are the IPC access-control list: a topic that is not declared is denied. Capsules target wasm32-unknown-unknown, not WASI, and reach the host only through the audited SDK/WIT imports granted by the manifest.

Start from the supported scaffold

aos capsule new my-capsule
cd my-capsule

The generated project contains:

my-capsule/
├── .cargo/config.toml
├── rust-toolchain.toml
├── Cargo.toml
├── Capsule.toml
└── src/lib.rs

Do not begin from an old [[interceptor]] manifest or an ipc_publish / ipc_subscribe capability array. Those formats are obsolete.

Compiler target

.cargo/config.toml selects the capsule target and activates the SDK's custom randomness backend:

[build]
target = "wasm32-unknown-unknown"

[target.wasm32-unknown-unknown]
rustflags = ["--cfg=getrandom_backend=\"custom\""]

The getrandom_backend setting must live in the final capsule crate. Without it, dependencies such as UUID generators or randomized hash maps can fail to link.

Pin the toolchain and target in rust-toolchain.toml:

[toolchain]
channel = "1.94.0"
targets = ["wasm32-unknown-unknown"]
components = ["rustfmt", "clippy"]

Cargo package

Use a cdylib and the current 0.7 SDK surface:

[package]
name = "my-capsule"
version = "0.1.0"
edition = "2024"
publish = false

[lib]
crate-type = ["cdylib"]

[dependencies]
astrid-sdk = { version = "0.7", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
strip = true
panic = "abort"

Capsule manifest

This minimal tool capsule exposes one hello tool:

[package]
name = "my-capsule"
version = "0.1.0"
description = "A small example capsule"
authors = ["Your Name <you@example.com>"]
astrid-version = ">=0.7.0"

[[component]]
id = "my-capsule"
file = "my_capsule.wasm"
type = "executable"

[capabilities]
fs_read = ["home://data/my-capsule/"]
fs_write = ["home://data/my-capsule/"]

[publish]
"tool.v1.execute.*.result" = { wit = "@unicity-astrid/wit/types/tool-call-result" }
"tool.v1.response.describe.*" = { wit = "@unicity-astrid/wit/tool/describe-response" }

[subscribe]
"tool.v1.execute.hello" = { wit = "@unicity-astrid/wit/types/tool-call", handler = "tool_execute_hello" }
"tool.v1.request.describe" = { wit = "@unicity-astrid/wit/tool/describe-request", handler = "tool_describe" }

Skills are agent user-space instructions, not a Capsule.toml protocol. Ship a trigger Skill through the host plugin or the agent-level Skills service, and expose capsule-owned reference material through typed IPC tools when useful. Do not add an agent Skill section to the manifest or request filesystem write authority merely to modify a host's instruction directory.

The published @unicity-astrid/wit/... strings and astrid:* WIT namespaces are stable runtime identifiers. Keep them exact even though the product CLI is aos.

For a tool capsule, both publish entries are required: one returns tool results, and the other answers the describe fan-out that makes tools visible to agents. Every tool needs its own concrete execute subscription. A subscribe wildcard may have one trailing *; publish permissions should be as narrow as practical.

Manifest data is untrusted input. Do not put operator authority, principal identity, or a secret scope in a capsule-controlled field. The kernel stamps the caller identity and decides operator-only policy.

Implement a tool

#![deny(unsafe_code)]
#![deny(clippy::all)]

use astrid_sdk::prelude::*;
use astrid_sdk::schemars;
use serde::Deserialize;

#[derive(Default)]
pub struct MyCapsule;

#[derive(Debug, Default, Deserialize, schemars::JsonSchema)]
pub struct HelloArgs {
    /// Person to greet.
    pub name: String,
}

#[capsule]
impl MyCapsule {
    /// Greet a person by name.
    #[astrid::tool("hello")]
    pub fn hello(&self, args: HelloArgs) -> Result<String, SysError> {
        Ok(format!("Hello, {}!", args.name))
    }
}

The tool macro derives the input schema from JsonSchema, uses the method's doc comment as the tool desc

자주 묻는 질문

매니페스트가 왜 중요한가요?

접근 목록이 캡슐이 보내고 받을 수 있는 메시지를 통제하며, 선언되지 않은 것은 모두 거부됩니다.

오래된 예제에서 시작해도 되나요?

아닙니다. 이전 매니페스트 형식은 폐기되었으므로 스킬은 현재 템플릿에서 시작합니다.

Rust를 알아야 하나요?

스킬은 Rust를 사용하므로, Rust를 아는 개발자가 가장 큰 도움을 받습니다.

상세 정보

작성자의 원본 설명

Build, test, package, install, and debug a current Unicity AOS capsule

repo: unicity-aos/aos-ce

인기도

GitHub 스타
8.5k
순위
#12454
라이선스
Apache-2.0
업데이트
2026. 10. 22.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬