Pi Skill Interpolation banner
joelhooks joelhooks

Pi Skill Interpolation

Development community

Description

⚡ pi extension for dynamic shell interpolation in skills — !\ syntax, gated on allowed-tools

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

⚡ pi-skill-interpolation

Dynamic shell interpolation for [pi](https://github.com/badlogic/pi-mono) skills. Embed `!`command`` in your SKILL.md and the output replaces the placeholder before the model sees it.

Compatible with [Claude Code's skill interpolation syntax](https://x.com/lydiahallie/status/2034337963820327017).

What it does

---
name: pr-summary
description: Summarize changes in a pull request
allowed-tools: Bash(git:*) Bash(gh:*)
---

- PR diff: !`gh pr diff`
- Changed files: !`gh pr diff --name-only`
- Current branch: !`git branch --show-current`

When you invoke `/skill:pr-summary`, the extension executes each `!`command`` and the model sees:

- PR diff: 
- Changed files: src/index.ts\nsrc/utils.ts
- Current branch: feat/my-feature

Security

Interpolation only runs when the skill declares `allowed-tools` with a Bash permission in its frontmatter. Without it, `!`command`` patterns pass through as literal text.

# These enable interpolation:
allowed-tools: Bash
allowed-tools: Bash(git:*) Bash(gh:*)
allowed-tools: Read Bash(echo:*)

# These do NOT enable interpolation:
allowed-tools: Read Write
# (or no allowed-tools at all)

This follows the [Agent Skills spec](https://agentskills.io/specification) `allowed-tools` field. Same trust model as npm postinstall scripts: you opt in per-skill.

Install

pi install git:github.com/joelhooks/pi-skill-interpolation

Or clone and symlink:

git clone git@github.com:joelhooks/pi-skill-interpolation.git ~/Code/joelhooks/pi-skill-interpolation
ln -sfn ~/Code/joelhooks/pi-skill-interpolation ~/.pi/agent/extensions/skill-interpolation

How it works

Two extension hooks, no core changes:

**`input` hook** - Intercepts `/skill:name` before pi's built-in expansion. Finds the skill file, checks `allowed-tools` for Bash, interpolates `!`command`` patterns, and returns the expanded `` block. Falls through to pi's normal expan