Capsule Development
यह क्या करती है
यह स्किल capsule बनाने का मार्गदर्शन देती है, जो Unicity AOS के भीतर चलने वाला छोटा सुरक्षित प्रोग्राम है। यह उन डेवलपर्स के लिए है जो अपने एजेंट सिस्टम के लिए नए प्रोग्राम हिस्से लिखना और इंस्टॉल करना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप अपने Unicity AOS सेटअप के लिए नया capsule शुरू करना चाहते हैं।
- ✓जब कोई capsule बिल्ड, link या इंस्टॉल न हो और उसे debug करना हो।
- ✓जब आपको जांचना है कि capsule के access नियम सही सेट हैं।
Skill का लिंक
https://github.com/unicity-aos/aos-ce/blob/main/capsules/capsule-system/src/skills/capsule-development/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“समर्थित टेम्पलेट से एक नया Unicity AOS capsule बनाइए, उसे build कीजिए, और टेस्ट के लिए इंस्टॉल कीजिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट आधिकारिक प्रोजेक्ट टेम्पलेट से शुरू करता है और manifest सेट करता है, जो नियंत्रित करता है कि capsule किस चीज़ तक पहुंच सकता है। फिर वह आवश्यक target के लिए build करता है और इंस्टॉल से पहले access सूची जांचता है।
तकनीकी सामग्री (मूल 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
अक्सर पूछे जाने वाले सवाल
manifest क्यों ज़रूरी है?
उसकी access सूची तय करती है कि capsule कौन से संदेश भेज और पा सकता है, और जो घोषित नहीं है वह अस्वीकार होता है।
क्या मैं पुराने उदाहरण से शुरू कर सकता हूं?
नहीं। पुराने manifest फ़ॉर्मेट अप्रचलित हैं, इसलिए स्किल मौजूदा टेम्पलेट से शुरू करती है।
क्या मुझे 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
- अपडेट की गई
- 22/10/2026
कमेंट
- …
इस repository की और skills
capsule-forge
8.5kयह आपके एजेंट को तय करने में मदद करती है कि नई क्षमता skill, capsule या plugin हो, फिर उसे Unicity AOS सिस्टम पर बनाए या ठीक करे।
meta-harness
8.5kयह आपके एजेंट को असली काम के दौरान अपने टूल, मेमोरी या निर्देशों की कमियां पहचानकर उन्हें सुधारने और बेहतर संस्करण रखने देती है।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।