Skip to content

Instantly share code, notes, and snippets.

@happytomatoe
happytomatoe / gist-readme.md
Last active August 30, 2026 16:02
Merge Gateway provider for pi coding agent — registers gateway.merge.dev's live model catalog as a pi provider (env: MERGE_GATEWAY_API_KEY, /login fallback)

Merge Gateway provider for pi coding agent

Registers Merge Gateway as a provider in pi coding agent. The model list is discovered live from GET /v1/models at load time, so the picker always reflects what Gateway currently serves — no hardcoded catalog to go stale.

Install

  1. Download the extension into pi's extensions directory:
curl -o ~/.pi/agent/extensions/merge-gateway.ts \
@happytomatoe
happytomatoe / herdr-wait-idle
Last active August 19, 2026 07:27
Wait for terminal output to settle (herdr pane idle detection)
#!/usr/bin/env bash
# Wait for herdr pane output to settle (no changes for N ms)
# Usage: wait-idle <pane-id> [idle-ms] [poll-ms]
# pane-id: herdr pane ID (e.g., w6B:p2)
# idle-ms: exit after this many ms of no changes (default: 200)
# poll-ms: how often to check (default: same as idle-ms)
set -euo pipefail
PANE_ID="${1:?Usage: wait-idle <pane-id> [idle-ms] [poll-ms]}"
@happytomatoe
happytomatoe / audit-your-codebase.md
Created August 16, 2026 23:10 — forked from aarondfrancis/audit-your-codebase.md
A read-only, agent-orchestrated codebase audit prompt for data structures, state modeling, algorithms, and ownership.

Audit this entire codebase for materially useful simplifications in its data structures, state representation, control flow, algorithms, and ownership.

This is an audit-only exercise. Do not edit files, run tests, implement recommendations, commit, or push. Read-only inspection commands are allowed.

You are the coordinator. Continue until the complete codebase has been reviewed and the final audit is validated.

  1. Establish the coverage contract

Inspect the repository and inventory every identifiable subsystem.

@happytomatoe
happytomatoe / README.md
Last active July 31, 2026 06:41
Code quality tools for ts

Quick Reference

Tool Purpose Languages Command
jscpd Copy/paste detection 200+ npx jscpd .
knip Dead code detection JS/TS npx knip
@happytomatoe
happytomatoe / README.md
Created July 17, 2026 07:51
pi-recent-files: /recent-files — copy .md/.html file paths from recent messages to clipboard

pi-recent-files

A pi extension that lets you quickly copy .md / .html file paths from recent conversation messages to the clipboard.

What it does

Registers the /recent-files command. When invoked, it:

  1. Scans the last 5 messages for .md, .markdown, .html, and .htm file paths
  2. Extracts paths from tool-call arguments (read, edit, write, bash) and free text
@happytomatoe
happytomatoe / SKILL.md
Last active August 20, 2026 17:13 — forked from geoffreylitt/explain-diff-html.md
explain-diff
name explain-diff-html
description Use when the user asks for a rich explanation of a code change, diff, branch, PR, or entire system. Produces HTML output.

Explain Diff / System

Please make a rich, interactive explanation of the specified code change, diff, or system.

First, determine the scope: is this a diff/change explanation or a system-wide explanation? Adapt the sections accordingly.

How to Run Podman Inside Toolbox Containers

The Problem

When trying to use Podman from within a Toolbox container on Fedora Silverblue, you encounter user namespace errors:

Error: fatal error, invalid internal status, unable to create a new pause process: cannot re-exec process to join the existing user namespace.

This happens because the Podman binary inside the Toolbox container still tries to perform privileged operations that fail in the restricted container environment.

@happytomatoe
happytomatoe / hashline-plugins-pi.md
Last active July 3, 2026 11:26
Registry of hashline plugins and extensions for pi-coding-agent

Hashline Plugins for pi-coding-agent

A registry of pi extensions that implement hash-anchored file editing (hashline) — replacing or augmenting the built-in read and edit tools.

What is Hashline?

Hashline is a diff format designed for LLM-driven file edits. Every line carries a short content-hash anchor (e.g., 8#VR:function hello()). Edits reference these anchors instead of raw text strings, so:

  • Stale-context edits are rejected before they corrupt code
  • "String not found" errors drop dramatically
@happytomatoe
happytomatoe / convert-markdown-to-github-style-html.sh
Created June 30, 2026 18:18
convert markdown to github style html page
#!/bin/bash
# convert-to-github-html.sh
# Usage: ./convert-to-github-html.sh input.md output.html
INPUT_FILE=$1
OUTPUT_FILE=$2
if [ -z "$INPUT_FILE" ] || [ -z "$OUTPUT_FILE" ]; then
echo "Usage: $0 <input.md> <output.html>"
exit 1
@happytomatoe
happytomatoe / support_agent_architecture_report.md
Created June 30, 2026 11:32
Investigation Report on Support Agent Architectures

Support Agent Architecture Investigation Report

Executive Summary

This report explores various architecture options for building a support agent capable of handling customer support activities and reasoning about production incidents. The goal is to deploy an LLM-powered agent in the cloud with reasoning capabilities, access to tools/skills, and a robust knowledge base.

Three primary architectural paths have been identified:

  1. Fully Managed Ecosystems (e.g., AWS Bedrock Agents)
  2. Custom Agentic Frameworks (e.g., LangGraph, CrewAI)
  3. Specialized Coding/SRE Agents (for high-tier technical support and incident response)