bundles/backend/skills/incremental-fetch/SKILL.md
Build resilient data ingestion pipelines from APIs. Use when creating scripts that fetch paginated data from external APIs (Twitter, exchanges, any REST API) and need to track progress, avoid duplicates, handle rate limits, and support both incremental updates and historical backfills. Triggers: 'ingest data from API', 'pull tweets', 'fetch historical data', 'sync from X', 'build a data pipeline', 'fetch without re-downloading', 'resume the download', 'backfill older data'. NOT for: simple one-shot API calls, websocket/streaming connections, file downloads, or APIs without pagination.
npx skillsauth add shipshitdev/library incremental-fetchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build data pipelines that never lose progress and never re-fetch existing data.
Track TWO cursors to support both forward and backward fetching:
| Watermark | Purpose | API Parameter |
|-----------|---------|---------------|
| newest_id | Fetch new data since last run | since_id |
| oldest_id | Backfill older data | until_id |
A single watermark only fetches forward. Two watermarks enable:
newest_id)oldest_id)These are different operations with different timing:
| What | When to Save | Why | |------|--------------|-----| | Data records | After EACH page | Resilience: interrupted on page 47? Keep 46 pages | | Watermarks | ONCE at end of run | Correctness: only commit progress after full success |
fetch page 1 → save records → fetch page 2 → save records → ... → update watermarks
First run (no watermarks)?
├── YES → Full fetch (no since_id, no until_id)
└── NO → Backfill flag set?
├── YES → Backfill mode (until_id = oldest_id)
└── NO → Update mode (since_id = newest_id)
This pattern works best with ID-based pagination (numeric IDs that can be compared). For other pagination types:
| Type | Adaptation |
|------|------------|
| Cursor/token | Store cursor string instead of ID; can't compare numerically |
| Timestamp | Use last_timestamp column; compare as dates |
| Offset/limit | Store page number; resume from last saved page |
See references/patterns.md for schemas and code examples.
testing
Use this skill when users need to validate a launch plan, assess MVP scope, or determine if they're ready to execute. Activates for "validate my plan," "am I ready to launch," "is my scope too big," or when assessing action readiness.
testing
Use this skill when users are stuck on a decision, overthinking, experiencing analysis paralysis, or need to ship faster. Activates for "should I wait," "I can't decide," "I'm overthinking," or when speed is critical and perfectionism is the enemy.
development
Use this skill when users need to make early hires, build their founding team, determine compensation/equity, decide who to hire first, or scale from founders to first employees. Activates for "who should I hire first," "early hiring," "equity for employees," or team building questions.
data-ai
Use this skill when users need to remove customer friction, improve customer success, handle objections, design guarantees, or eliminate obstacles between customers and results. Activates for customer success issues, objection handling, or "customers can't get results" problems.