Skip to content

Pi skills to replicate AmpCode experience - thread-aware handoffs and web access

License

Notifications You must be signed in to change notification settings

pasky/pi-amplike

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-amplike

Pi skills and extensions that give Pi similar capabilities to Amp Code out of the box.

Features

Session Management

  • Handoff - Create a new focused session with AI-generated context transfer:
    • /handoff <goal> command - Manually create a handoff session
    • handoff tool - The agent can invoke this when you explicitly request a handoff
  • session_query tool - The agent in handed-off sessions automatically gets the ability to query the parent session for context, decisions, or code changes
  • Use /resume to switch between and navigate handed-off sessions

Prompt Modes

  • /mode command with interactive mode selector/configuration UI (a mode is a model + thinking + color preset, active mode is shown in prompt editor border)
  • Shortcuts:
    • Ctrl+Shift+S - mode selector
    • Ctrl+Space - cycle modes

Web Access

  • web-search - Search the web via Jina Search API
  • visit-webpage - Extract webpage content as markdown (using Jina API), or download images

Amp Skill Compatibility

  • Auto-loads Amp skill directories when present:
    • ~/.config/agents/skills
    • ~/.config/amp/skills
    • .agents/skills (project-local)

Installation

Option A: Install from npm (recommended)

mkdir -p ~/.pi/packages
cd ~/.pi/packages
npm install pi-amplike

This creates ~/.pi/packages/node_modules/pi-amplike. Pi will pick it up as a package automatically.

Option B: Install from git

git clone https://github.com/pasky/pi-amplike ~/.pi/packages/pi-amplike
cd ~/.pi/packages/pi-amplike
npm install

Setup

Get a Jina API key for web skills (optional, works with rate limits without it):

export JINA_API_KEY="your-key"  # Add to ~/.profile or ~/.zprofile

Get an API key at jina.ai. Even if you charge only the minimum credit, it's going to last approximately forever.

Usage

Session Handoff

When your conversation gets long or you want to branch off to a focused task, you can use handoff in two ways:

Manual handoff via command:

/handoff now implement this for teams as well
/handoff execute phase one of the plan
/handoff check other places that need this fix

Agent-invoked handoff: The agent can also initiate a handoff when you explicitly ask for it:

"Please hand this off to a new session to implement the fix"
"Create a handoff session to execute phase one"

Both methods create a new session with:

  • AI-generated summary of relevant context from the current conversation
  • List of relevant files that were discussed or modified
  • Clear task description based on your goal
  • Reference to parent session (accessible via session_query tool)

Session Navigation

Use Pi's built-in /resume command to switch between sessions, including handed-off sessions. The handoff creates sessions with descriptive names that make them easy to find.

Querying Past Sessions

The session_query tool lets the model look up information from previous sessions. It's automatically used when a handoff includes parent session reference, but can also be invoked directly:

session_query("/path/to/session.jsonl", "What files were modified?")
session_query("/path/to/session.jsonl", "What approach was chosen?")

Permissions

The permissions extension enforces Amp-style bash command permissions automatically. Use the /permissions command to toggle modes:

/permissions    # toggles between enabled and yolo
  • enabled (default): Amp permission rules from ~/.config/amp/settings.json are enforced
  • yolo: All bash commands are allowed without any checks; YOLO mode shown in status bar

The selected mode is persisted in ~/.pi/agent/amplike.json and restored on the next pi invocation.

Prompt Modes

/mode              # mode picker
/mode configure    # open mode configuration UI
/mode <name>       # switch directly
/mode store <name> # store current model+thinking into a mode

Notes:

  • The extension bootstraps with default modes are rush, smart, and deep; they somewhat mirror Amp defaults.
  • Modes config is loaded from .pi/modes.json (project), falling back to ~/.pi/agent/modes.json (global).
  • Deleting all modes or setting "modes": {} in your modes file disables mode overlay behavior (shortcuts + editor mode border), while keeping /mode config UI available.

Web Search

~/.pi/packages/pi-amplike/skills/web-search/search.py "python async tutorial"

Visit Webpage

~/.pi/packages/pi-amplike/skills/visit-webpage/visit.py https://docs.example.com/api

Components

Component Type Description
amp-skills Extension Adds Amp-compatible skill discovery paths (~/.config/agents/skills, ~/.config/amp/skills, .agents/skills)
permissions Extension Reads amp.commands.allowlist and amp.permissions from ~/.config/amp/settings.json (and .agents/settings.json) and intercepts bash tool calls accordingly; /permissions toggles between enabled and yolo (all commands allowed, status bar indicator, persisted in ~/.pi/agent/amplike.json)
handoff Extension /handoff command + handoff tool for AI-powered context transfer
modes Extension Prompt mode manager with model/thinking/color presets, editor border overlay, and shortcuts
session-query Extension session_query tool for querying parent sessions
session-query Skill Instructions for using the session_query tool
web-search Skill Web search via Jina API
visit-webpage Skill Webpage content extraction

Why "AmpCode-like"?

Amp Code has excellent session management built-in - you can branch conversations, reference parent context, and navigate session history. This package brings similar workflows to Pi:

  • Context handoff → Amp's conversation branching
  • Session querying → Amp's ability to reference parent context

Web Skills Origin

The web-search and visit-webpage skills were extracted from pasky/muaddib. The original implementations have additional features (rate limiting, multiple backends, async execution) that aren't needed for Pi's skill system.

License

MIT

About

Pi skills to replicate AmpCode experience - thread-aware handoffs and web access

Resources

License

Stars

Watchers

Forks

Packages

No packages published