context-packer
Build LLM-ready code dumps with optional docs, then count tokens with tokencount (o200k-base) against a context budget (for example 272k for GPT-5).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build LLM-ready code dumps with optional docs, then count tokens with tokencount (o200k-base) against a context budget (for example 272k for GPT-5).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | context-packer |
| description | Build LLM-ready code dumps with optional docs, then count tokens with tokencount (o200k-base) against a context budget (for example 272k for GPT-5). |
Use this skill when the user wants to:
prepare-context.sh:
path + ``` + contents) for all selected files<project>/prompt/<output>.txt (or /tmp/context-packer/... with --tmp-output)tokencount --encoding o200k-base$HOME/dev/pi-skills/context-packer/prepare-context.sh <project_dir> [options]
# Default budget (272000), code + docs + tests pack
$HOME/dev/pi-skills/context-packer/prepare-context.sh ~/dev/pui
# Code-focused pack (exclude docs and tests)
$HOME/dev/pi-skills/context-packer/prepare-context.sh ~/dev/pui --no-docs --no-tests
# Include env/sensitive files explicitly (off by default for safety)
$HOME/dev/pi-skills/context-packer/prepare-context.sh ~/dev/pui --include-env --include-secrets
# Custom budget and output name
$HOME/dev/pi-skills/context-packer/prepare-context.sh ~/dev/pui \
--budget 272000 \
--output pui-gpt5.txt
# Fail with exit code 2 if over budget
$HOME/dev/pi-skills/context-packer/prepare-context.sh ~/dev/pui --fail-over-budget
--output <name> output filename (default: context-dump.txt)--tmp-output write output to /tmp/context-packer/... instead of <project>/prompt/--budget <tokens> token budget (default: 272000)--with-docs include docs/ (default: on)--with-tests include test files (__tests__, tests/, test/, *.test.*, *.spec.*, etc.) (default: on)--no-docs exclude docs/--no-tests exclude test files (__tests__, tests/, test/, *.test.*, *.spec.*, etc.)--include-lockfiles include lockfiles (pnpm-lock.yaml, Cargo.lock, etc.)--include-env include env files (.env, .env.*, .envrc) (default: off)--include-secrets include potentially sensitive files (.npmrc, .netrc, keys/certs, cloud credential files, etc.) (default: off)--no-clipboard do not refresh clipboard from output file--fail-over-budget return non-zero if budget exceeded--install-tools install missing tokencount via cargotokencount installed (cargo install tokencount)copy_files (not required)pbcopywl-copyIf no clipboard tool is available, the script still writes output files; it just skips clipboard copy.
Analyze pi session transcripts to discover patterns that could become AGENTS.md rules, skills, or prompt templates. Mines your usage history for automation opportunities.
Build PR-focused context packs (PR description + git diff + full changed files + related files via Scribe), then budget-fit and token-check with o200k-base.
Review a pull request for bugs, style issues, and guideline compliance. Local review - does not post to GitHub.
Compress images to a target file size using macOS sips. No dependencies required.
Multi-model code review. Runs code-review skill with 3 models in parallel, then synthesizes findings.
Compress videos to a target file size using ffmpeg two-pass encoding. Useful for Discord/Slack upload limits.