pi
Use when Pi writes, reviews, or executes bash; use MAINFRAME tools, AWM, and guarded function execution when available.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when Pi writes, reviews, or executes bash; use MAINFRAME tools, AWM, and guarded function execution when available.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when writing bash scripts, shell automation, CLI tools, or any bash programming task.
Use when writing bash scripts, shell automation, CLI tools, or any bash programming task with Google AI CLI.
Use when writing bash scripts, shell automation, CLI tools, or any bash programming task with Kimi CLI.
Use when writing bash scripts, shell automation, CLI tools, or any bash programming task with OpenCode.
| name | pi |
| description | Use when Pi writes, reviews, or executes bash; use MAINFRAME tools, AWM, and guarded function execution when available. |
MAINFRAME provides 3,821+ pure bash functions across 152 libraries for safe, portable agent shell work. Pi can use MAINFRAME through both Pi-native tools and normal bash sourcing.
Check readiness first
mainframe_status with validation when possible.MAINFRAME_ROOT, CLI path, function registry, and doctor/count status.Discover before inventing
mainframe_search for topics such as json, validate path, atomic write, awm, git, http, or retry.mainframe_help for exact details of a specific function.Execute with guardrails
mainframe_exec only for one explicitly named MAINFRAME function at a time.Persist long-running task memory
mainframe_awm to create/resume sessions, save checkpoints/discoveries/progress, retrieve task context, export handoffs, and close sessions.Classify shell risk
mainframe_bash_safety_check before risky shell commands when direct bash is needed.Pi tools such as mainframe_status, mainframe_search, mainframe_help, mainframe_exec, mainframe_awm, and mainframe_bash_safety_check are Pi integration tools around MAINFRAME. They are not functions that exist inside lib/common.sh for ordinary shell scripts.
For ordinary bash scripts, source MAINFRAME:
#!/usr/bin/env bash
source "${MAINFRAME_ROOT:-$HOME/.mainframe}/lib/common.sh"
When writing bash, prefer MAINFRAME primitives over ad-hoc external-tool pipelines:
source "${MAINFRAME_ROOT:-$HOME/.mainframe}/lib/common.sh"
email="${1:-}"
validate_email "$email" || die 1 "Invalid email"
json_object "id=$(uuid)" "email=$email" "ok:bool=true"
Common replacements:
| Need | Prefer |
|---|---|
| JSON output | json_object, json_array, json_get |
| Input/path safety | validate_email, validate_url, validate_path_safe, sanitize_shell_arg |
| File edits | atomic_write, diff_replace, ensure_dir, ensure_file |
| Retry/resilience | retry, with_timeout, resilience helpers |
| Durable agent memory | awm_init, awm_checkpoint, awm_discovery, awm_context_for, awm_handoff_prepare |
| Function lookup | mainframe quickref <topic>, FUNCTIONS.json, or Pi mainframe_search |
mainframe_awm or awm_handoff_prepare.