You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Zero-friction project setup: create_new_pti() injects the app name everywhere, emits a clear next-steps checklist, and optionally opens the project.
One-line boundary loading: get_country_shapes("ISO3") replaces 40 lines of manual GeoJSON renaming and spatial joins.
Hex data on by default: Step 4 runs as part of the normal pipeline — not commented out.
No manual Excel editing: The var_overrides block in Step 5 is the single place deployers control what goes into the PTI and Explorer.
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.
Documentation updated in sync: All website tutorials (Steps 0–6) updated to match the new template files.
AI-ready from day one: Every scaffolded project ships CLAUDE.md and an agent skill so an AI assistant has full pipeline context immediately.
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).
Overview
Redesign the
devPTIpackdata 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
create_new_pti()injects the app name everywhere, emits a clear next-steps checklist, and optionally opens the project.get_country_shapes("ISO3")replaces 40 lines of manual GeoJSON renaming and spatial joins.var_overridesblock in Step 5 is the single place deployers control what goes into the PTI and Explorer.docs/that shows boundary maps, data summaries, and the per-variable metadata report — ready to publish to GitHub Pages.CLAUDE.mdand an agent skill so an AI assistant has full pipeline context immediately.Sub-issues
Setup
create_new_pti(): injectapp_name+ compact next-steps CLI with open-project prompt — A:create_new_pti()— injectapp_nameinto scaffolded files + compact next-steps CLI with open-project prompt #152CHECKLIST.mdwith pre-run / pre-deploy task lists — B: Template — addCHECKLIST.mdwith pre-run / pre-deploy task lists #150Helpers (prerequisite for all step changes)
pti_plot_boundaries(),pti_plot_histogram(),pti_summary_table()— C: New helper functions —pti_plot_boundaries(),pti_plot_histogram(),pti_summary_table()#151Pipeline steps
02a-user-zonal-stats.qmd: document output contract and explicit feed to Step 3 — E: Rename03-metadata.qmd→03-user-data.qmd; data contract header +pti_patch_admin_sheet()helper #15303-metadata.qmd→03-user-data.qmd; data contract header +pti_patch_admin_sheet()— F:04-hex-data.qmd— removeeval: falseguards; render hex variable summary table #15404-hex-data.qmd: removeeval: falseguards; render hex variable summary table — D:02a-user-zonal-stats.qmd— document output contract and explicit feed into Step 3 #15505-compile.qmd: auto-detectmetadata-hex.xlsx;var_overridesblock; bird's-eye reactable summary — I: Template — scaffold_quarto.ymlQuarto website with sidebar nav (step pages + Metadata Report + App iframe) #15605-compile-report.qmd(new): boundary overview + per-variable HTML report + downloadable PDF — H:05-compile-report.qmd(new) — boundary overview + per-variable HTML report + downloadable PDF #157Website and deployment
_quarto.ymlwebsite with sidebar nav — G:05-compile.qmd— auto-detectmetadata-hex.xlsx;var_overridesblock; bird's-eye reactable summary #15800-master.R: addAPP_URLparam; render full Quarto site todocs/; un-comment Step 04 — J:00-master.R— addAPP_URLparam; render full Quarto site todocs/; un-comment Step 04 #15906-deploy.R: add GitHub Pages deployment instructions fordocs/— K:06-deploy.R— add GitHub Pages deployment instructions fordocs/#160App content
app.R+landing-page.md: update contact to Nga Thi Viet Nguyen; generic{{APP_NAME}}template — Doc: Update all website tutorial vignettes (Steps 0–6) to match redesigned pipeline and new helper functions #161Documentation (independent — flag for parallel work)
app.R+landing-page.md— update contact; generic template with{{APP_NAME}}; wire HTML metadata report #162AI tooling
CLAUDE.md+ agent skill.agents/skills/pti-data-prep/SKILL.mdwith scaffolded project — P: Bundle AI skills andCLAUDE.mdwith the scaffolded PTI project template #165Maintenance rule
Infrastructure dependencies
This issue depends on the WB Boundaries infrastructure being planned (not necessarily complete):
inst/wb_shapes_registry.yaml— bundled catalog of available countries, admin levels, and parquet base URL #146 (Inf-2) — shapes registry YAMLlist_country_shapes()— return tibble of available countries and admin levels from bundled registry #147 (Inf-3) —list_country_shapes()get_country_shapes()— fetch WB Official Boundaries parquet and return package-ready named sf list with hex grid #148 (Inf-4) —get_country_shapes()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
pti_patch_admin_sheet()vsgenerate_metadata_from_csv()(Refactor validation into step-by-step, user-facing data checks with CSV support #7)pti_patch_admin_sheet()vsgenerate_metadata_from_csv()(#7) #164 — End-to-end automated pipeline test: Rwanda + Ethiopia, fresh environmentDefinition 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.htmlshiny::runApp("app.R")launches without errorCLAUDE.mdand.agents/skills/pti-data-prep/SKILL.mdpti_patch_admin_sheet()vsgenerate_metadata_from_csv()(#7) #164) passes for Rwanda and Ethiopia in CI