session-sandvault
Use when delegating a task to an agent inside Sandvault macOS sandbox. Returns agent output (JSONL/JSON) for parsing.
What this skill does
# Sandvault Session
Like session-claude / session-codex but inside Sandvault sandbox. `sv` handles isolation and permission flags. Sandbox user is a different macOS user with a different home — files move via shared bare git repo.
## Variables
- `${SHARED}` — `/Users/Shared/sv-${USER}`
- `${REPO}` — bare repo name in shared space (e.g., `myproject.git`)
- `${PROJECT_DIR}` — `${REPO%.git}` (e.g., `myproject`) — compute once to avoid nested quoting issues
- `${SV_REPO}` — sandbox working copy: `~/repositories/${PROJECT_DIR}`
- `${NAME}` — branch/worktree name
- `${PROMPT}` — task prompt
- `${THREAD_ID}` — Codex session ID (for resume)
## Git remote naming
- Host: remote `sandvault` → `${SHARED}/${REPO}` (bare repo bridge)
- Host: remote `origin` → upstream (GitHub etc.)
- Sandbox: remote `origin` → `${SHARED}/${REPO}` (natural — it's where clone came from)
## Prerequisites
User must have:
1. Sandvault installed and built (`sv build`)
2. Logged into Claude and Codex inside `sv shell` (one-time)
3. After brew upgrade of Claude/Codex: run once on host first to accept update prompts
If `sv shell -- echo ok` fails → STOP, tell user to set up Sandvault.
## Environment check
When setting up a project for sandbox use, verify the sandbox has the project's toolchain. Do not assume — check:
```bash
sv shell -- zsh -c "which <tool> && <tool> --version"
```
Examples:
- Android: `java`, `gradle`, `adb`, `JAVA_HOME`, `ANDROID_HOME`. SDK managed via `sdkmanager` on host → `/opt/homebrew/share/android-commandlinetools/`, visible to both users. Emulator runs on host (needs GUI), sandbox agent connects via `adb` over localhost.
- Python: `python3`, `uv`, `VIRTUAL_ENV`
- Node: `node`, `npm`/`bun`, `npx`
- Rust: `cargo`, `rustc`
If a required tool is missing → install via brew on host (sandbox shares `/opt/homebrew/bin`). SDK components (e.g., `sdkmanager "platforms;android-34"`) also install to the shared brew prefix — but sandbox can't install them itself (no write access to brew dir), so install on host. If build tools complain about missing SDK components → install them on host, not sandbox.
If env vars are missing → copy the relevant exports from host's profile to sandbox's `~/user/.zprofile`. For multi-line or complex setup, write a script to shared space to avoid quoting issues:
```bash
cat > ${SHARED}/setup-env.sh << 'EOF'
#!/bin/zsh
echo 'export JAVA_HOME=/opt/homebrew/opt/openjdk@17' >> ~/user/.zprofile
echo 'export ANDROID_HOME=/opt/homebrew/share/android-commandlinetools' >> ~/user/.zprofile
EOF
chmod +x ${SHARED}/setup-env.sh
sv shell -- ${SHARED}/setup-env.sh
```
## Sync setup
Sandbox user cannot write host user's files. Shared bare repo bridges the gap.
### If CWD is a git repo
Check if shared remote exists:
```bash
git remote get-url sandvault 2>/dev/null
```
If no shared remote → create the bridge. Compute `${PROJECT_DIR}` (repo name without `.git`) first to avoid nested quoting issues:
```bash
PROJECT_DIR="${REPO%.git}"
git clone --bare "$(pwd)" "${SHARED}/${REPO}"
git -C "${SHARED}/${REPO}" config core.sharedRepository group
chgrp -R "sandvault-${USER}" "${SHARED}/${REPO}"
chmod -R g+w "${SHARED}/${REPO}"
git remote add sandvault "${SHARED}/${REPO}"
sv shell -- zsh -c "git config --global --add safe.directory ${SHARED}/${REPO} && git config --global --add safe.directory ~/repositories/${PROJECT_DIR}"
```
Push current branch:
```bash
git push sandvault ${NAME}
```
Sandbox user clones to `~/repositories/` (first time) or fetches:
```bash
sv shell -- zsh -c "mkdir -p ~/repositories && cd ~/repositories && { [ -d ${PROJECT_DIR} ] && cd ${PROJECT_DIR} && git fetch || git clone ${SHARED}/${REPO} ${PROJECT_DIR} && cd ${PROJECT_DIR}; }"
```
After clone/fetch, install project dependencies inside sandbox (e.g., `npm install`, `uv sync`).
### Shell quoting
`sv shell -- zsh -c "..."` breaks easily with quotes, dollars, semicolons. For anything beyond simple commands, write a script to shared space:
```bash
cat > ${SHARED}/task.sh << 'SCRIPT'
#!/bin/zsh
cd /Users/Shared/sv-vre/myproject
npm install
npx expo prebuild
SCRIPT
chmod +x ${SHARED}/task.sh
sv shell -- ${SHARED}/task.sh
```
### If CWD is not a git repo
Copy to shared space:
```bash
rsync -a --exclude node_modules --exclude .git "$(pwd)/" "${SHARED}/$(basename "$(pwd)")/"
```
Sandbox works on the copy. Results must be rsynced back manually.
## Delegate to Codex
Pass prompt via stdin (`-`) to avoid shell quoting issues. Use `sv shell PATH --` (not `sv codex --` which does not support `exec` subcommand).
First run:
```bash
echo "${PROMPT}" | sv shell "~/repositories/${PROJECT_DIR}" -- codex exec --json -
```
Resume:
```bash
echo "${PROMPT}" | sv shell "~/repositories/${PROJECT_DIR}" -- codex exec resume --json ${THREAD_ID} -
```
## Delegate to Claude
First run:
```bash
echo "${PROMPT}" | sv shell "~/repositories/${PROJECT_DIR}" -- claude -p --output-format json
```
Resume (`-c` continues most recent in cwd):
```bash
echo "${PROMPT}" | sv shell "~/repositories/${PROJECT_DIR}" -- claude -p -c --output-format json
```
## Get results back
After agent finishes, push from sandbox and fetch on host:
```bash
sv shell -- zsh -c "cd ~/repositories/${PROJECT_DIR} && git push origin ${NAME}"
git fetch sandvault
git log sandvault/${NAME} --oneline -5
```
Merge or cherry-pick as needed.
## Parse response
Codex: first JSONL line `{"type":"thread.started","thread_id":"<id>"}` → set `${THREAD_ID}`. Messages: `item.type == "agent_message"` → `item.text`.
Claude: JSON `{"type":"result","result":"...","session_id":"..."}`.
If error or empty output → show stderr, STOP.
Bash timeout >= 300000.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.