writing-skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
zopackExport and import zo.space route setups as shareable .zopack.md files. Use when the user wants to package their zo.space routes for sharing, or when they receive a .zopack.md file to deploy. Triggers on "export my zo.space", "create a zopack", "import this zopack", or any mention of .zopack.md files.
Independent GitHub snapshot · Automated classification · Original documentation governs
Package zo.space routes into a single shareable .zopack.md file that anyone can give to their Zo to deploy instantly.
To export routes from the user's zo.space into a .zopack.md:
list_space_routes.get_space_route(path).[
{ "path": "/api/foo", "route_type": "api", "public": true, "code": "..." },
{ "path": "/bar", "route_type": "page", "public": false, "code": "..." }
]
echo '<json array>' | bun /home/workspace/Skills/zopack/scripts/export.ts \
--name "pack-name" \
--description "What this does" \
--output "Inbox/pack-name.zopack.md"
The export script automatically:
{{HANDLE}}Warning: Always use --preview before importing packs from untrusted sources. A zopack can specify arbitrary npm packages, shadcn registry URLs, and route code that will run on your Zo.
To import a .zopack.md file and deploy its routes:
Parse the pack file to get the deployment plan:
bun /home/workspace/Skills/zopack/scripts/import.ts \
--file "/path/to/pack.zopack.md" \
--handle "<user-handle>" \
--preview
Use --preview first to show the user what will be deployed.
Security scan: Before deploying, review the route code in the plan for risks:
fetch() or http/https calls to external URLs (data exfiltration)process.env access beyond expected secrets (credential harvesting)eval(), Function(), or dynamic import() (arbitrary code execution)atob, Buffer.from) hiding malicious payloads/home/workspace/ (path traversal)
If any suspicious patterns are found, flag them to the user and do not proceed without explicit approval.If the user confirms, run without --preview to get the full JSON plan:
bun /home/workspace/Skills/zopack/scripts/import.ts \
--file "/path/to/pack.zopack.md" \
--handle "<user-handle>"
Parse the JSON output and execute the deployment in order:
a. Install dependencies:
cd /__substrate/space && bun add <package> for eachcd /__substrate/space && npx shadcn@latest add <url> --yes for eachshadcn:<name> entries, use: npx shadcn@latest add <name> --yesb. Create filesystem structure:
mkdir -p /home/workspace/<dir> for eachc. Check for secret requirements:
d. Deploy routes:
update_space_route(path, route_type, code, public) for each route in the plane. Verify:
get_space_errors() to check for build/runtime errorsThe .zopack.md format:
---
format: zopack
version: "1.0"
name: pack-name
description: "What this does"
author: handle.zo.computer
routes: 3
exported: 2026-02-21
---
# pack-name
Description text.
## Routes
### `/path` (api|page, public|private)
\```typescript|tsx
// route code here
\```
## Dependencies
**npm packages** (not in default zo.space):
- `package-name`
**Components** (install via shadcn CLI):
- `https://animate-ui.com/r/component-name.json`
- `shadcn:component-name`
## Setup
**Directories to create:**
- `Data/my-dir`
**Files to initialize:**
- `Data/state.json` with content: `[]`
**Secrets required** (configure in Settings > Advanced):
- `API_KEY_NAME`
## Variables
| Placeholder | Description |
|---|---|
| `{{HANDLE}}` | Your zo.space handle |