Skip to content

Data Preparation Pipeline Redesign — Master Tracking Issue #149

Description

@EBukin

Overview

Redesign the devPTIpack data preparation pipeline and scaffolding workflow to be simpler, more transparent, and AI/human-comprehensible. A deployer starting from scratch — with no existing country data — should be able to scaffold a working PTI app, load default boundaries, run the full data pipeline, review a data quality report, and deploy to Posit Connect with minimal manual editing and no invisible steps.

This is a sibling of #9 (Architecture Redesign), which covers internal package plumbing. This issue covers the deployer-facing workflow: the template files a user interacts with when building a new country PTI app.

Goals

  1. Zero-friction project setup: create_new_pti() injects the app name everywhere, emits a clear next-steps checklist, and optionally opens the project.
  2. One-line boundary loading: get_country_shapes("ISO3") replaces 40 lines of manual GeoJSON renaming and spatial joins.
  3. Hex data on by default: Step 4 runs as part of the normal pipeline — not commented out.
  4. No manual Excel editing: The var_overrides block in Step 5 is the single place deployers control what goes into the PTI and Explorer.
  5. Data quality website: The full Quarto pipeline renders a navigable website into docs/ that shows boundary maps, data summaries, and the per-variable metadata report — ready to publish to GitHub Pages.
  6. Documentation updated in sync: All website tutorials (Steps 0–6) updated to match the new template files.
  7. AI-ready from day one: Every scaffolded project ships CLAUDE.md and an agent skill so an AI assistant has full pipeline context immediately.

Sub-issues

Setup

Helpers (prerequisite for all step changes)

Pipeline steps

Website and deployment

App content

Documentation (independent — flag for parallel work)

AI tooling

Maintenance rule

Any PR that changes the pipeline interface (new helper functions, renamed files, new steps, changed function signatures) must also update CLAUDE.md and the skill file (#165). This is a hard acceptance criterion for all sub-issues above.

Infrastructure dependencies

This issue depends on the WB Boundaries infrastructure being planned (not necessarily complete):

Sub-issues C (#151), D (#153), I (#158), L (#161) can start immediately. Sub-issues A (#152), B (#150) require #143. The full pipeline (E–H, J–K) requires C (#151). Issue P (#165) requires A (#152) and a stable pipeline (D–J).

Related standalone issues

Definition of done

  • source("00-master.R") in a freshly scaffolded Rwanda project produces: app-data/shapes.rds, app-data/metadata.xlsx, app-data/pti-metadata.html, docs/index.html
  • shiny::runApp("app.R") launches without error
  • All website tutorial vignettes (Steps 0–6) reflect the new file names, helper functions, and workflow
  • A freshly scaffolded project contains CLAUDE.md and .agents/skills/pti-data-prep/SKILL.md
  • End-to-end test (M: API coordination — pti_patch_admin_sheet() vs generate_metadata_from_csv() (#7) #164) passes for Rwanda and Ethiopia in CI

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureArchitectural design decisionsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions