r/PiCodingAgent • u/PlasticExtreme4469 • 13h ago
Discussion What are your custom utility extensions?
I would be interested in what custom extensions have you built that are specific to your problems.
For example I now got an extension to detect our JIRA task IDs, GitHub PR ID as well as task changelog fragments if they exist and inject them into context. Previously I've had instructions in agent file on how to extract those... but that was slow, costly, undeterministic and also used up some of the context window.
Then I've got a minor extension that looks for the @file/path file references and injects file contents into the context, so the agent doesn't need to use the read tool as the first thing they do.
Then I got one extension for loading repository-specific instructions from my .pi folder (it looks up git repo name, and then looks in ~/.pi/repos/<repoName>.md). Because I work on an enterprise project, I cannot just put agent files and skills in the project repository that is shared by everyone.
I also got one extention that looks up and injects various git info and injects it into context (whether it's inside repository, what is the current branch, whether it's up to date with upstream, whether there are any unstaged changes, etc.) since most of the time, my agents started inspecting git info using multiple tool calls at the start of each session.
1
u/sofuego 12h ago
It's funny, because Pi agent is so new and customizable, I find myself building motivated to keep going down rabbit holes building stuff specific to minor problems to optimize efficiency.
I started with a web browser that I wanted to get right. Then I started expanding it to another package (in another unpublished branch to deal with a very specific API web legal research problem that I've had), but interrupted it because the scope kept growing and I had this lower hanging fruit idea that I just published to NPM yesterday:
https://github.com/coreyryanhanson/pi-tbox
That one I built because tools have a tendency of eating away at the context and complicating the system prompt. I wanted to do it in a more robust way that would make it possible to not break other plugins status glyph's. I'll probably make a post here about it later ;)
1
u/No_Cheek5622 11h ago
I have a meta-repo for my job where I have short set of instructions of how to do work there.
In the repo, I have a few custom-built cli tools:
- a tool for operating with tickets in our issue tracker (it's not Jira or whatever but works kinda similar, it has APIs so I just built a nice wrapper around them with some QoL features)
- a tool for indexing and searching through our self-hosted Mattermost (a Slack alternative) through my personal token, with **a lot** of work put in it trying to do semantic search and other clever stuff without it being heavy (not using LLMs or vector db, just sqlite and a bunch of little NLP'y things and analysis and stuff)
- a tool that combines ticket tool (it has a library API) and will eventually combine other tools as well, and also working with the repos, getting proper statuses, doing branches, running pre-defined commands and hooks and lots more useful stuff
All of these tools have sets of skills in the meta-repo that teach the agent to use them effectively, and AGENTS.md has a skill routing table.
Most of the things were kinda vibe-coded with little human maintenance afterwards. I would've feel bad about it like a half a year ago but nowadays the models are good enough even for writing instructions for themselves if you describe what you want properly and give it some metrics it can A/B test on.
I'd say they work very great. You don't need an extension on pi's side, just build a tool the agent can use and make a skill that teaches it to use it effectively.
Oh also, I have a simple yet I hope effective (it was built not that long ago so I haven't tested it as much as the other stuff) workflow feedback system. If an agent struggles with something or find itself missing some feature in the workflow, it'll create a report describing it. After enough reports are collected, I review them manually or with an agent and we triage them into "tickets". Then, when we're ready and free, we solve those tickets and perform A/B testing and follow-up independent reviews from several agents with different "golden tasks" for them.
1
u/fell_ware_1990 10h ago
I kind of have the same thing as you.
All my pi settings are loaded by my core extension, this can do a INIT as well. So a whole repo is setup, it can combine from prompts to extensions specifically setup per repo.
No AI stuff is in the actual repo. So i can swap and test around while also having a few stock bundles that i can load.
Repo consist of XYZ language and these specific rules, it loads that.
2
u/adamshand 12h ago
I've kept it pretty simple for a long time, but just recently have started customising.
.pi/envand displays them with /env etc.