Potpie is a tool that turns a software repository and its development history into a context graph for AI coding agents. Agents use that graph to answer codebase questions, plan changes, debug problems, and write code with project-specific information. The catalogue includes skills, hooks, commands, and a plugin for integrating Potpie into coding-agent workflows.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add potpie-ai/potpie --skill backfill-enumerate-draingit clone --depth 1 https://github.com/potpie-ai/potpieWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/potpie-ai/potpie/backfill-enumerate-drain)<a href="https://agentmods.dev/skills/potpie-ai/potpie/backfill-enumerate-drain"><img src="https://agentmods.dev/badge/skills/potpie-ai/potpie/backfill-enumerate-drain/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/potpie-ai/potpie/backfill-enumerate-drain"><img src="https://agentmods.dev/badge/skills/potpie-ai/potpie/backfill-enumerate-drain.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00052 | $0.00649 |
| Opus 5.5 | $0.00021 | $0.00260 |
| Sonnet 5.5 | $0.00010 | $0.00130 |
| Haiku 4.5 | $0.00005 | $0.00065 |
Grade A, and why
backfill-enumerate-drain scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Backfill: enumerate, then drain
You are handling a single *.added seed event (a repository or a team was
just connected). The graph has no history for it yet. One seed fans out into
many artifacts (PRs, issues, projects, documents). Your todo/plan tools are ON.
Use this procedure for any such backfill; the playbook tells you WHICH
enumerators and WHAT to extract per artifact.
The loop
- Enumerate (one call per list tool). Call each list/enumerator tool the playbook names exactly once. They are bounded server-side to a trailing window and a hard item cap, and come back newest-first. Do not page or scrape beyond what one call returns — the window/cap is deliberate; the tail arrives via live webhooks and future backfill.
- Write one todo per returned ref, across all enumerated kinds. If the playbook says some kinds frame the others (e.g. projects/documents frame issues), drain those first.
- Drain newest-first. For each todo: hydrate the ref with the detail tool
named by the playbook (for example
github_get_pull_requestorgithub_get_issue), apply the extraction the relevant per-kind playbook prescribes viaapply_graph_mutations, then mark the todo done and move on.
Resume discipline (critical)
The todo list rides in your message history, which is checkpointed after every tool call. A resumed run therefore continues an existing list — if todos already exist, never re-enumerate and never restart the walk from scratch. Re-running an enumerator on resume duplicates work and burns budget.
Single-event contract
This batch contains exactly one event — the seed. Per-artifact identity
lives in each artifact's stable entity_key, not in event ids. So:
- Pass the seed's
event_idto everyapply_graph_mutationscall. - Finish with a single
mark_event_processed(seed_event_id, summary)thenfinish_batch.
Stable keys make a backfilled artifact and a later live webhook for the same
thing converge on one node instead of duplicating. See the
graph-mutation-plan skill for the key patterns.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 58 lines · 52 tokens per session scan A 53cb98bd71e8
backfill-enumerate-drain is a skill published in the GitHub repository potpie-ai/potpie (5,743 stars, last pushed yesterday), licensed Apache-2.0. It adds 52 tokens to every session and 649 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
langchain_patterns
Implement Retrieval-Augmented Generation (RAG) systems with LangChain4j. Build document ingestion pipelines, embedding stores, vector search strategies, and knowledge-enhanced AI applications. Use when creating question-answering systems over document collections or AI assistants with external knowledge bases.
langchain_patterns
Implement Retrieval-Augmented Generation (RAG) systems with LangChain4j. Build document ingestion pipelines, embedding stores, vector search strategies, and knowledge-enhanced AI applications. Use when creating question-answering systems over document collections or AI assistants with external knowledge bases.
browser-d5fa0b7f
A requestIdleCallback pattern for scheduling low-priority browser work during periods when the page is idle.
email-drafting
Draft an email matching the user's voice, with structured intent and CTA.
slack-summary
Distill a Slack channel or thread into actionable summary.
skill-creator
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.