Skip to content

Instantly share code, notes, and snippets.

View nicobailon's full-sized avatar

Nico Bailon nicobailon

View GitHub Profile
@nicobailon
nicobailon / oh-my-pi.json
Created February 10, 2026 05:33
oh-my-pi theme for pi coding agent
{
"$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/theme-schema.json",
"name": "oh-my-pi",
"vars": {
"cyan": "#0088fa",
"blue": "#178fb9",
"green": "#89d281",
"red": "#fc3a4b",
"yellow": "#e4c00f",
"gray": "#777d88",
@nicobailon
nicobailon / packages-ranking-plan.md
Created February 7, 2026 20:22
Packages page ranking overhaul - replace npm downloads with GitHub stars

Packages Page Ranking Overhaul

Problem

npm download counts on the packages page are being gamed. An attacker published 22 versions of pi-screenshots-picker in 7 days and used a download inflation tool that targets a fixed ~100-120 downloads per version. Since npm counts every tarball HTTP 200 as a "download," the tool pushed the package to 2,581/mo (edging out pi-interactive-shell at 2,262/mo, a package that actually went viral on Twitter). The same pattern exists on pi-super-curl, the attacker's other package.

The current page defaults to "Most downloads" sort, giving the attacker the #1 slot. The root issue: npm downloads are a fundamentally unreliable signal. Any client-side slicing of npm download data (latest-version-only, anomaly detection, etc.) can be adapted around once the attacker reads the defense.

Solution

@nicobailon
nicobailon / SKILL.md
Last active February 11, 2026 02:03
Pi skill for Codex CLI. Place in ~/.pi/agent/skills/codex-cli/SKILL.md. Gives pi the flags, config options, sandbox modes, and interactive-shell patterns for launching and controlling Codex CLI sessions.
name description
codex-cli
OpenAI Codex CLI reference. Use when running codex in interactive_shell overlay or when user asks about codex CLI options.

Codex CLI (OpenAI)

Commands

| Command | Description |

@nicobailon
nicobailon / codex-implement-plan.md
Created February 6, 2026 04:16
Meta-prompt template for pi interactive-shell + Codex CLI. Place in ~/.pi/agent/prompts/ to use as a slash command (/codex-implement-plan). Offloads plan implementation to Codex as a subagent — pi reads the plan, generates a tailored Codex prompt following GPT-5.2 best practices, then launches Codex in an overlay you can observe or take over via…
description
Launch Codex CLI in overlay to fully implement an existing plan/spec document

Read the Codex prompting guide at https://developers.openai.com/cookbook/examples/gpt-5/gpt-5-2_prompting_guide using fetch_content or web_search. Then read the plan at $1.

Analyze the plan to understand: how many files are created vs modified, whether there's a prescribed implementation order or prerequisites, what existing code is referenced, and roughly how large the implementation is.

Based on the prompting guide's best practices and the plan's content, generate a comprehensive meta prompt tailored for Codex CLI. The meta prompt should instruct Codex to:

  1. Read and internalize the full plan document. Identify every file to be created, every file to be modified, and any prerequisites or ordering constraints.
@nicobailon
nicobailon / double-check-clarify-plan.md
Created January 30, 2026 16:22
Custom prompt template for Pi coding agent's Interview extension (https://github.com/nicobailon/pi-interview-tool). Deeply reviews a plan/spec through multiple interview waves, asking non-obvious questions about architecture, UX, tradeoffs, and implementation details, then updates the plan with answers woven in.
description args
Interview deeply about a plan/spec, asking non-obvious questions, then update the plan
name description required
plan
Path to the plan/spec file to review
true

Deep Plan Review with Interview Waves

@nicobailon
nicobailon / path-wrapper.ts
Created January 22, 2026 15:14
Pi extension: PATH wrapper - prepend directory to PATH for all bash commands (proves PR #903 isn't needed)
/**
* PATH Wrapper Extension
*
* Prepends a directory to PATH for all bash commands.
* Requires config in settings.json — does nothing without it:
*
* { "pathWrapper": { "prependPath": "/path/to/wrappers" } }
*/
import { spawn } from "node:child_process";
@nicobailon
nicobailon / git-commit-guard.ts
Last active January 22, 2026 15:14
Pi extension: Git commit/push guard with confirmation prompts and destructive command protection
/**
* PATH Wrapper Extension
*
* Prepends a directory to PATH for all bash commands.
* Requires config in settings.json — does nothing without it:
*
* { "pathWrapper": { "prependPath": "/path/to/wrappers" } }
*/
import { spawn } from "node:child_process";
@nicobailon
nicobailon / terminal-title.ts
Created January 15, 2026 22:59
Pi coding agent extension: Dynamic terminal tab titles with emoji identifiers and status tracking. Shows session emoji, project name, status (running/done/waiting/error), and current tool. Place in ~/.pi/agent/extensions/
/**
* Enhanced terminal tab status extension with emoji identifiers.
*
* Features:
* - Unique emoji identifier per session (hashed from session ID)
* - Status tracking: new running done/waiting/error/timeout
* - Interview tool detection for "waiting for input" state
* - 180s inactivity timeout detection
* - Current tool name display during execution
* - Resets title to "Terminal" on shutdown
@nicobailon
nicobailon / pdive.sh
Last active January 16, 2026 01:47
Shell function that primes pi on any codebase. cd into a project, run pdive, and the agent scans everything and waits—ready for your next prompt with full context. Steer with pdive "focus on auth" to prioritize.
Shell function that primes pi on any codebase. cd into a project, run pdive, and the agent scans everything and waits—ready for your next prompt with full context. Steer with pdive "focus on auth" to prioritize.
# pdive - Deep dive into any codebase with pi
#
# Wraps pi with a prompt that tells it to explore a codebase and summarize
# what it finds, then stop and wait. You can steer the exploration by adding
# context—like `pdive "focus on the auth system"`—and it'll prioritize that
# while still building the full picture.
#
# Install:
@nicobailon
nicobailon / terminal-title.ts
Created January 4, 2026 20:10
Pi coding agent hook: dynamic terminal title showing agent activity (thinking/tool calls). Place in ~/.pi/agent/hooks/. Requires pi-coding-agent v0.34.1+
// Sets terminal tab/window title based on agent activity
// Requires: PR #446 (setTitle API) - merged in v0.34.1
import type { HookAPI } from "@mariozechner/pi-coding-agent";
import path from "node:path";
export default function (pi: HookAPI) {
pi.on("session_start", async (_event, ctx) => {
ctx.ui.setTitle(`pi: ${path.basename(ctx.cwd)}`);
});