Pi agent rust

From Dicklesworthstone/pi_agent_rust · View interactive version

Pi agent rust is an AI agent skill from the GitHub repository Dicklesworthstone/pi_agent_rust. Speeds up pi_agent_rust development and verification workflows. Use when editing providers, tools, sessions, extensions, installer/uninstaller logic, or triaging regressions in this repo.

How to use this skill

Skill file

<!-- pi_agent_rust installer managed skill -->

Pi Agent Rust

Use This Skill When

60-Second Bootstrap

export CARGO_TARGET_DIR="/data/tmp/pi_agent_rust/${USER:-agent}"
export TMPDIR="/data/tmp/pi_agent_rust/${USER:-agent}/tmp"
mkdir -p "$TMPDIR"

rch exec -- cargo check --all-targets
rch exec -- cargo clippy --all-targets -- -D warnings
cargo fmt --check
bash tests/installer_regression.sh

Symptom Router

| Symptom | First 3 Commands |

|---|---|

| Provider stream/tool-call regression | cargo test --test provider_streaming -- --nocapture ; rg -n "stream|tool|delta|event|SSE" src/providers src/sse.rs ; cargo test conformance |

| Session replay/index drift | cargo test session -- --nocapture ; rg -n "Session|save|open|index|jsonl|sqlite" src/session.rs src/session_index.rs ; cargo test conformance |

| Extension policy/runtime failure | cargo test extension -- --nocapture ; rg -n "policy|hostcall|capability|quickjs|deny|allow" src/extensions.rs src/extensions_js.rs ; cargo test conformance |

| Installer/uninstaller/skill issue | bash tests/installer_regression.sh ; rg -n "AGENT_SKILL_STATUS|CHECKSUM_STATUS|SIGSTORE_STATUS|COMPLETIONS_STATUS" install.sh ; rg -n "managed skill|expected skill directory|PIAR_AGENT_SKILL" uninstall.sh |

| Interactive vs RPC divergence | cargo test --test e2e_rpc -- --nocapture ; rg -n "interactive|rpc|stdin|event|session" src/main.rs src/interactive.rs src/rpc.rs ; cargo test conformance |

For deeper diagnosis, use references/DEBUGGING-PLAYBOOKS.md.

Non-Negotiables

Core Workflow

Changed Files -> Required Tests

| Changed Files (examples) | Minimum Required Tests |

|---|---|

| install.sh, uninstall.sh, .claude/skills/pi-agent-rust/** | bash -n install.sh uninstall.sh tests/installer_regression.sh ; shellcheck -x install.sh uninstall.sh tests/installer_regression.sh ; bash tests/installer_regression.sh ; bash scripts/skill-smoke.sh |

| src/providers/**, src/provider.rs, src/sse.rs | cargo test --test provider_streaming ; cargo test --test e2e_provider_streaming ; cargo test conformance |

| src/session.rs, src/session_index.rs, src/session_test.rs | cargo test session ; cargo test conformance |

| src/extensions.rs, src/extensions_js.rs | cargo test extension ; cargo test conformance |

| src/tools.rs | cargo test tools ; cargo test conformance |

| src/interactive.rs, src/rpc.rs, src/main.rs | cargo test --test e2e_rpc ; cargo test conformance |

Do Not Run Yet

Run these only after targeted repro + focused slice indicates need:

High-Value Commands

# Fast recon
git status --short
rg -n "install|uninstall|skill|checksum|sigstore|completion|provider|session|extension" \
  install.sh uninstall.sh README.md tests/installer_regression.sh src/

# Installer + skill safety gates
bash -n install.sh uninstall.sh tests/installer_regression.sh
shellcheck -x install.sh uninstall.sh tests/installer_regression.sh
bash tests/installer_regression.sh
bash scripts/skill-smoke.sh

# Rust gates
rch exec -- cargo check --all-targets
rch exec -- cargo clippy --all-targets -- -D warnings
cargo fmt --check

For an expanded command cookbook, see references/COMMANDS.md.

For deep incident triage, see references/DEBUGGING-PLAYBOOKS.md.

Critical Files

Known Footguns

Patch Patterns

Pattern 1: Mixed Outcome Status Clarity

# BEFORE: everything collapsed into "skipped custom"
if [ "$skipped_custom" -ge 1 ]; then
  AGENT_SKILL_STATUS="skipped (existing custom skill)"
fi

# AFTER: distinguish custom-skip from write failure
if [ "$skipped_custom" -ge 1 ] && [ "$failed_writes" -ge 1 ]; then
  AGENT_SKILL_STATUS="partial (custom skill kept; other install failed)"
elif [ "$skipped_custom" -ge 1 ]; then
  AGENT_SKILL_STATUS="skipped (existing custom skill)"
fi

Pattern 2: Safe Skill Replacement

# BEFORE: remove destination before validating copy result
rm -rf "$destination"
cp "$source" "$destination/SKILL.md"

# AFTER: stage then atomically move into place
staged="$(mktemp -d ...)"
cp "$source" "$staged/SKILL.md"
mv "$staged" "$destination"

Failure Triage

trace AGENT_SKILL_STATUS, CHECKSUM_STATUS, and COMPLETIONS_STATUS in install.sh.

verify marker checks and expected destination guards in both scripts.

use symptom router, then follow references/DEBUGGING-PLAYBOOKS.md.

ensure README.md flags/examples match current installer behavior.

Done Criteria

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.