Skip to content
Agent Memory
Skill

/backfill-enumerate-drain

How to backfill a newly-added repo or team — the enumerate-then-drain loop, the single-event contract, and resume-safe todo discipline. Load this when handling a *.added seed event with the planner on.

From plugin
potpie
5.8k2 skills

Claude Code

$ npx -y skills add potpie-ai/potpie --skill backfill-enumerate-drain --agent claude-code

SKILL.md

backfill-enumerate-drain.SKILL.md
name: backfill-enumerate-drain
description: How to backfill a newly-added repo or team — the enumerate-then-drain loop, the single-event contract, and resume-safe todo discipline. Load this when handling a *.added seed event with the planner on.
version: "1.0.0"
tags: [backfill, planner, todo, ingestion]

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

1. **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. 2. **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. 3. **Drain newest-first.** For each todo: hydrate the ref with the detail tool named by the playbook (for example `github_get_pull_request` or `github_get_issue`), apply the extraction the relevant per-kind playbook prescribes via `apply_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_id` to every `apply_graph_mutations` call.
  • Finish with a single `mark_event_processed(seed_event_id, summary)` then

`finish_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.

Budget discipline

Breadth of a coherent recent seed beats exhaustive depth. If you approach the tool budget, ingest what you already have cleanly, then `mark_event_processed` the seed and `finish_batch` — the remainder re-batches later. Never fabricate a PR/issue/project/document/comment you did not actually fetch; add a warning instead.

Read more
Stats
5,799
Stars
Active
Maintenance
Python
Language
Apache-2.0
License
Last commit
Created
Added

Repo: potpie-ai/potpie

@potpie-ai
Ships withpotpie

Context Graph for AI Native SDLC

Stars on GitHub

Momentum

stars in total
5.8k
Star history of potpie-ai/potpie on GitHub, a chart by star-history.com

Other skills on potpie.

graph-mutation-plan

graph-mutation-plan

Compose canonical semantic operations for apply_graph_mutations using stable entity keys and source evidence.

@potpie-ai@potpie-aiInstall Skill

More skills from other plugins.

agent-cost-report

agent-cost-report

Believable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude…

claude-mem11d116k
@thedotmack@thedotmackInstall Skill
bot-handoff

bot-handoff

Keep a durable record of work passed between Bots in the shared Hindsight memory bank. Use when handing work to another Bot, when…

hindsight11d60k
@vectorize-io@vectorize-ioInstall Skill
mempalace

mempalace

Install, configure, and operate MemPalace, including a private local palace, a shared-brain hub, or a client joining an existing…

@mempalace@mempalaceInstall Skill
mempalace

mempalace

Install, configure, and operate MemPalace, including a private local palace, a shared-brain hub, or a client joining an existing…

@milla-jovovich@milla-jovovichInstall Skill

Questions about backfill-enumerate-drain.

Which coding agents can use backfill-enumerate-drain?
backfill-enumerate-drain installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.