bootstrap
Pre-session bootstrap - generates script to start recording BEFORE entering Claude Code. Chunking handled by daemon.
What this skill does
# /asciinema-tools:bootstrap
Generate a bootstrap script that runs OUTSIDE Claude Code to start a recording session.
**Important**: Chunking is handled by the launchd daemon. Run `/asciinema-tools:daemon-setup` first if you haven't already.
> **Self-Evolving Skill**: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
## Architecture
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ DAEMON-BASED RECORDING WORKFLOW │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ 1. ONE-TIME SETUP (if not done): │
│ /asciinema-tools:daemon-setup │
│ → Configures launchd daemon with Keychain credentials │
│ │
│ 2. GENERATE BOOTSTRAP (in Claude Code): │
│ /asciinema-tools:bootstrap │
│ → Generates tmp/bootstrap-claude-session.sh │
│ │
│ 3. EXIT CLAUDE and RUN BOOTSTRAP: │
│ $ ./tmp/bootstrap-claude-session.sh ← NOT source! │
│ → Writes config for daemon │
│ → Starts asciinema recording │
│ │
│ 4. WORK IN RECORDING: │
│ $ claude │
│ → Daemon automatically pushes chunks to GitHub │
│ │
│ 5. EXIT (two times): │
│ Ctrl+D (exit Claude) → exit (end recording) │
│ → Daemon pushes final chunk │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
## Arguments
| Argument | Description |
| ---------------- | ---------------------------------------------------- |
| `-r, --repo` | GitHub repository (e.g., `owner/repo`) |
| `-b, --branch` | Orphan branch name (default: `asciinema-recordings`) |
| `--setup-orphan` | Force create orphan branch |
| `-y, --yes` | Skip confirmation prompts |
## Execution
### Phase 0: Preflight Check
```bash
/usr/bin/env bash << 'PREFLIGHT_EOF'
MISSING=()
for tool in asciinema zstd git; do
command -v "$tool" &>/dev/null || MISSING+=("$tool")
done
if [[ ${#MISSING[@]} -gt 0 ]]; then
echo "MISSING: ${MISSING[*]}"
exit 1
fi
echo "PREFLIGHT: OK"
asciinema --version | head -1
# Check daemon status
if launchctl list 2>/dev/null | grep -q "asciinema-chunker"; then
echo "DAEMON: RUNNING"
else
echo "DAEMON: NOT_RUNNING"
fi
PREFLIGHT_EOF
```
**If DAEMON: NOT_RUNNING, use AskUserQuestion:**
```
Question: "The chunker daemon is not running. Chunks won't be pushed to GitHub without it."
Header: "Daemon"
Options:
- label: "Run daemon setup (Recommended)"
description: "Switch to /asciinema-tools:daemon-setup to configure the daemon"
- label: "Continue anyway"
description: "Generate bootstrap script without daemon (local recording only)"
```
### Phase 1: Detect Repository Context
**MANDATORY**: Run before AskUserQuestion to auto-populate options.
```bash
/usr/bin/env bash << 'DETECT_CONTEXT_EOF'
IN_GIT_REPO="false"
CURRENT_REPO_URL=""
CURRENT_REPO_OWNER=""
CURRENT_REPO_NAME=""
ORPHAN_BRANCH_EXISTS="false"
LOCAL_CLONE_EXISTS="false"
ORPHAN_BRANCH="asciinema-recordings"
if git rev-parse --git-dir &>/dev/null 2>&1; then
IN_GIT_REPO="true"
if git remote get-url origin &>/dev/null 2>&1; then
CURRENT_REPO_URL=$(git remote get-url origin)
elif [[ -n "$(git remote)" ]]; then
REMOTE=$(git remote | head -1)
CURRENT_REPO_URL=$(git remote get-url "$REMOTE")
fi
if [[ -n "$CURRENT_REPO_URL" ]]; then
if [[ "$CURRENT_REPO_URL" =~ github\.com[:/]([^/]+)/([^/.]+) ]]; then
CURRENT_REPO_OWNER="${BASH_REMATCH[1]}"
CURRENT_REPO_NAME="${BASH_REMATCH[2]%.git}"
fi
if git ls-remote --heads "$CURRENT_REPO_URL" "$ORPHAN_BRANCH" 2>/dev/null | grep -q "$ORPHAN_BRANCH"; then
ORPHAN_BRANCH_EXISTS="true"
fi
LOCAL_CLONE_PATH="$HOME/asciinema_recordings/$CURRENT_REPO_NAME"
if [[ -d "$LOCAL_CLONE_PATH/.git" ]]; then
LOCAL_CLONE_EXISTS="true"
fi
fi
fi
echo "IN_GIT_REPO=$IN_GIT_REPO"
echo "CURRENT_REPO_URL=$CURRENT_REPO_URL"
echo "CURRENT_REPO_OWNER=$CURRENT_REPO_OWNER"
echo "CURRENT_REPO_NAME=$CURRENT_REPO_NAME"
echo "ORPHAN_BRANCH_EXISTS=$ORPHAN_BRANCH_EXISTS"
echo "LOCAL_CLONE_EXISTS=$LOCAL_CLONE_EXISTS"
DETECT_CONTEXT_EOF
```
### Phase 2: Repository Selection (MANDATORY AskUserQuestion)
Based on detection results:
**If IN_GIT_REPO=true, ORPHAN_BRANCH_EXISTS=true:**
```
Question: "Orphan branch found in {repo}. Use it?"
Header: "Destination"
Options:
- label: "Use existing (Recommended)"
description: "Branch 'asciinema-recordings' already configured in {repo}"
- label: "Use different repository"
description: "Store recordings in a different repo"
```
**If IN_GIT_REPO=true, ORPHAN_BRANCH_EXISTS=false:**
```
Question: "No orphan branch in {repo}. Create one?"
Header: "Setup"
Options:
- label: "Create orphan branch (Recommended)"
description: "Initialize with GitHub Actions workflow for brotli"
- label: "Use different repository"
description: "Store recordings elsewhere"
```
**If IN_GIT_REPO=false:**
```
Question: "Not in a git repo. Where to store recordings?"
Header: "Destination"
Options:
- label: "Dedicated recordings repo"
description: "Use {owner}/asciinema-recordings"
- label: "Enter repository"
description: "Specify owner/repo manually"
```
### Phase 3: Create Orphan Branch (if needed)
Clear SSH caches first, then create orphan branch:
```bash
/usr/bin/env bash << 'CREATE_ORPHAN_EOF'
REPO_URL="${1:?}"
BRANCH="${2:-asciinema-recordings}"
LOCAL_PATH="$HOME/asciinema_recordings/$(basename "$REPO_URL" .git)"
# Clear SSH caches first
rm -f ~/.ssh/control-* 2>/dev/null || true
ssh -O exit [email protected] 2>/dev/null || true
# Get GitHub token for HTTPS clone (prefer env var to avoid process spawning)
GH_TOKEN="${GH_TOKEN:-${GITHUB_TOKEN:-$(gh auth token 2>/dev/null || echo "")}}"
if [[ -n "$GH_TOKEN" ]]; then
# Parse owner/repo
if [[ "$REPO_URL" =~ github\.com[:/]([^/]+)/([^/.]+) ]]; then
OWNER_REPO="${BASH_REMATCH[1]}/${BASH_REMATCH[2]}"
AUTH_URL="https://${GH_TOKEN}@github.com/${OWNER_REPO}.git"
CLEAN_URL="https://github.com/${OWNER_REPO}.git"
else
AUTH_URL="$REPO_URL"
CLEAN_URL="$REPO_URL"
fi
else
AUTH_URL="$REPO_URL"
CLEAN_URL="$REPO_URL"
fi
# Clone and create orphan
TEMP_DIR=$(mktemp -d)
git clone "$AUTH_URL" "$TEMP_DIR/repo"
cd "$TEMP_DIR/repo"
# Create orphan branch
git checkout --orphan "$BRANCH"
git reset --hard
git commit --allow-empty -m "Initialize asciinema recordings"
git push origin "$BRANCH"
# Cleanup temp
rm -rf "$TEMP_DIR"
# Clone orphan branch locally
mkdir -p "$(dirname "$LOCAL_PATH")"
git clone --single-branch --branch "$BRANCH" --depth 1 "$AUTH_URL" "$LOCAL_PATH"
# Strip token from remote
git -C "$LOCAL_PATH" remote set-url origin "$CLEAN_URL"
mkdir -p "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.