dimagi-internal/ace / skills/build-targeting-model
build-targeting-model
VerifiedTurn a targeting selection into a shareable Doc and a formula-driven Excel model. Use when the answer must leave the conversation.
Build Targeting Model
A figure that only exists in a chat transcript cannot be argued with, and cannot be re-run when somebody challenges the unit cost. This skill produces the two artifacts a funding conversation actually needs: a document that states the claim with its sources, and a spreadsheet that is a model rather than an export — assumptions in input cells, every cost column a formula, so a reader can change a number and watch it propagate.
The distinction matters more than it sounds. A static export invites the reader to trust the total. A model invites them to test it, and the ones that survive testing are the ones that get funded.
Inputs
Every row except the optional Phase 1 PDD is an explicit argument or a live labs read; no run is needed.
| Source | Artifact | Used for |
|---|---|---|
| Upstream | the selection and its totals | the headline figures |
defend-a-figure | the three paragraphs and Sources table | the document body |
| Connect Labs MCP | indicators_select (high limit) | the ranked geography rows |
| Connect Labs MCP | cea_market_size | cost basis and unit price |
| Connect Labs MCP | indicators_methodology | source URLs, licences, cross-check verdicts |
| Phase 1 (optional) | 1-design/idea-to-pdd.md | the intervention and its pricing basis |
cost-effectiveness (optional) | cea_model_run per scenario | a Cost-effectiveness sheet: the ranking as values, with price and units of value per death as yellow input cells and the multiple as a formula (deaths averted x units per death / spend / benchmark), and the uncounted benefits, so the funder can change the price live |
Products
- A Google Doc via
drive_create_doc_from_markdown— claim, defence, methods considered, Sources table with live links <country>-<indicator>-targeting-model.xlsxviadrive_upload_binary— five sheets, described below<phase>/build-targeting-model_summary.md— what was produced and the links
Terminology
Every string this skill puts in front of a reader follows
skills/_terminology.md: Connect, never CommCare Connect, and
US spelling, always — program, enrollment, enroll, organization, behavior, center; never
programme, enrolment, organisation (owner, 2026-10-20: "everything should be US spelling",
ace#3232). Identifiers (case properties, slugs, ids, config keys) keep their spelling.
Process
- Confirm the figures have been defended. If
defend-a-figurehas not run, run it. Publishing an undefended number is the failure this whole toolchain exists to prevent. - Pull the ranked rows with
indicators_selectat a highlimit— the document shows a headline, the model shows the list, and a reader who cannot see their own district loses interest in both. - Settle the cost basis explicitly with
cea_market_size. A unit price is meaningless without a unit: per newborn, per child, per household, per case. Where an indicator implies no case count the per-case basis is refused rather than approximated — pick another basis, do not work around it. - Build the workbook with
openpyxl(available in the labs venv), as a model and not an export — the sheet layout is below. - Make every cost column a formula referencing the Assumptions cells. A reader who changes the unit price and sees nothing move stops believing the spreadsheet.
- Reconcile the column sums against the published totals and disclose the difference. Row values arrive rounded, so a column can differ from the headline by a few units. State it on the Assumptions sheet; a reader who finds it themselves assumes worse.
- Write the Doc from the defence, with the Sources table carrying a working URL per input, taken from the methodology rather than invented.
- Upload both and return the links together. A model without its document loses its caveats; a document without its model cannot be tested.
MCP Tools Used
connect_labs (remote HTTP, PAT auth)
indicators_select— builtcea_market_size— builtindicators_methodology— built
ace-gdrive
drive_create_doc_from_markdown— builtdrive_upload_binary— built
The workbook
| Sheet | Holds |
|---|---|
| Assumptions | Unit cost, pricing basis, threshold, method, vintage — highlighted as inputs. Everything else references these. Carries the rounding note. |
| Ranked geographies | The eligible list ranked by burden, with population, the count being funded, cumulative share, and formula-driven cost columns. |
| Threshold comparison | The same selection at each threshold under discussion, so the reader can see what the cutoff is buying. |
| Method comparison | What every method reports, with the conservative figure named rather than left to be inferred. |
| Sources & caveats | Source, vintage, licence, live URL, and each cross-check's verdict. |
The cost columns are the load-bearing part: =IF(Assumptions!$B$6="birth", E2, ...)
to pick the denominator from the basis cell, and =H2*Assumptions!$B$5 for the
cost itself. Hard-coded costs are the single most common reason a model gets
returned.
Mode Behavior
- Auto: build both artifacts, upload, notify the admin group with the links and the headline figure.
- Review: present the document draft and the model's assumptions for approval before uploading to a shared Drive location.
Change Log
| Date | Change | Author |
|---|---|---|
| 2026-08-29 | Initial version — model-not-export principle, five-sheet layout, formula-driven costs, rounding disclosure | ACE team |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |