pi-extension-lifecycle

Document the Pi coding agent's turn and tool execution lifecycle for extension design.

143|52|Updated May 15, 2026
One-click install
npx skills add https://github.com/gotgenes/pi-packages --skill pi-extension-lifecycle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pi-extension-lifecycle
Source: https://github.com/gotgenes/pi-packages/tree/main/.pi/skills/pi-extension-lifecycle
Command: npx skills add https://github.com/gotgenes/pi-packages --skill pi-extension-lifecycle

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a reference for the Pi coding agent's turn and tool execution model and extension event lifecycle, enabling teams to design timings, intercepts, and messages with a clear lifecycle diagram and documented capabilities.

Core Features & Use Cases

  • Comprehensive agent loop reference detailing outer and inner loops, including turn_start, context, before_provider_request, and tool execution lifecycle.
  • Clear documentation of event handler capabilities and input/output structures (context, tool_call, tool_result, turn_end, etc.).
  • Guidance on tool_call sequencing, abort/interrupt lifecycle, and message delivery semantics (steering vs follow-up) across turns.
  • Design implications for safe, reliable extension development with empirical session-data patterns.

Quick Start

Consult this lifecycle reference when designing extensions or integrating new tools for Pi agents.

Frequently Asked Questions about pi-extension-lifecycle

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does the Pi agent loop handle tool execution lifecycle and event sequencing?

The Pi agent loop processes tool execution through inner and outer loops, managing event sequencing from turn_start to turn_end. It structures context, before_provider_request, tool_call, and tool_result events to govern extension timing and message delivery.

What is the tool-call sequencing behavior when designing extensions for Pi agent workflows?

Tool-call sequencing in Pi agent workflows follows a structured lifecycle that governs execution order and event handler capabilities. It defines specific input and output structures for tool_call and tool_result events to ensure reliable extension design.

How do I intercept an agent turn to manage abort and interrupt behavior in Pi-driven workflows?

To manage abort and interrupt behavior in Pi-driven workflows, you intercept the agent turn using event handlers. The lifecycle reference documents specific interrupt points and abort mechanisms to safely halt tool execution and control message delivery.

What are the message delivery semantics for steering versus follow-up across Pi agent turns?

Message delivery semantics across Pi agent turns distinguish between steering messages and follow-up messages. Steering intercepts and guides an active turn, while follow-up messages queue for subsequent execution after the current tool execution lifecycle completes.

When do I need to use the extension lifecycle reference for Pi coding agents?

You need the extension lifecycle reference when designing new extensions, integrating tools, or building event handlers for Pi coding agents. It provides the necessary lifecycle diagrams and empirical session-data patterns required for safe, reliable extension development.

Can I use this lifecycle reference to document event handler capabilities for Pi agent extensions?

Yes, you can use this lifecycle reference to document event handler capabilities for Pi agent extensions. It details the input and output structures for core events like context, tool_call, and turn_end, satisfying requirements for extension documentation.