You're building a Streamlit energy-audit calculator for Bwalya Mwamba, the founder of a solar consulting business in Lusaka — an app he uses live in client sales meetings on his laptop, with the methodology in configuration and a trust indicator validated against 85 historical installations.
The discipline skills: tool-selection judgment across paradigms (BI dashboard vs code-based app vs spreadsheet) decided on audience and maintenance criteria; analytics delivered as a deployed Streamlit application with pinned dependencies and local-first packaging; configuration-driven methodology in config/methodology.yml with a schema and a validator gating the pre-commit hook; a calculation engine separated from presentation; a validation analysis against the 85 installations with a survivorship-bias resolution; and handoff documentation for a non-developer maintainer with four runnable maintenance procedures.
The AI-direction lesson: you design context per agent before any code is written — six phases, six scoped briefs, what each agent loads and what it does NOT load. You design connectivity per phase with "when NOT to connect" as a deliverable judgment — only one phase needs an MCP connection, BigQuery is explicitly omitted, the aggregate security surface is recorded. You design decomposition with "when NOT to delegate" expressed concretely — tool selection, methodology audit, audience design framing, and honest-validation-claim wording are non-delegable. AI generates Streamlit apps that replicate BI-dashboard grids, scatters configuration through code, writes handoff documentation in developer voice, overclaims on validation, and never surfaces Bwalya's three hidden constraints (quarterly tariffs, panel degradation, survivorship bias) unless directly asked. You catch each — and encode the directing discipline as infrastructure with a new streamlit-handoff-review skill that lives on after the project closes.
Your Role
You're the analytics-and-application developer Bwalya texted after Joseph from the business incubator passed along your number. The deliverables are the tool-selection rationale, the methodology configuration with its schema and validator, the calculation engine, the Streamlit app (three pages — Inputs, Results, Comparison), the validation analysis with the survivorship-bias resolution, the per-agent context strategy, the per-phase connectivity plan, the decomposition architecture, the handoff documentation, the four maintenance scenarios, and the streamlit-handoff-review skill.
The infrastructure floor runs in the background. What's new is the paradigm and the up-front design: deciding which paradigm fits this audience at all, then building the deployed app, then designing for a maintainer who has never used Streamlit. Raj Patel is available on demand for a sanity check on tool selection, infrastructure, or handoff design.
What's New
Last time you delivered ECDF's organisational governance framework, the data-acquisition strategy across heterogeneous regional systems, the three-tier verification architecture, and the multi-stakeholder analysis serving USAID, the EU, and DFID — with the governance-framework-review skill and a formal-memo plus video-call discovery cadence.
This time the first contact is a text message — three short bursts in casual SMS register, no formal brief, no scheduled meeting. Discovery happens through messaging back-and-forth across the first unit, with Bwalya answering in short bursts during his workday and going dark by 6pm. The deliverable shifts from analytical reports to a deployed application. Two audiences (the sales-meeting client and Bwalya as future maintainer) drive every design decision.
The hard part is the moment AI's first-draft Streamlit app arrives looking like a BI dashboard — a grid of charts with no information hierarchy, configuration scattered through the UI code, handoff documentation that describes what the app does rather than how to maintain it. The three hidden constraints surface only because you ask the right questions, not because AI surfaces them.
Tools
- Established and carried forward: Claude Code, Codex CLI, DuckDB with the read-only MCP server, Python with pandas and numpy, Jupyter, Git and GitHub with
pre-commit, the rootCLAUDE.mdandAGENTS.md, path-scopedCLAUDE.md, theinfrastructure/connectivity.mdartifact, theprofile-dataset,dashboard-design-review, andgovernance-framework-reviewskills, and the auto-memory from P19 (curated at project start). - Streamlit — new; the deployed application framework. The unit that introduces it walks through the conventions.
- PyYAML and pytest — new; configuration loading and the test discipline.
streamlit-handoff-reviewskill — new; SKILL.md format encoding the handoff-design rubric for non-developer maintainers. Fourth skill in the encoded-discipline library.infrastructure/maintenance.md— new path-scoped artifact recording the four maintenance scenarios as runnable procedures.
Materials
- Bwalya's text-message thread (
bwalya-text-thread.md) — the entry artifact. Three short bursts in casual SMS register; discovery happens through messaging back-and-forth across the first unit. - Bwalya's current energy-audit spreadsheet (
bwalya-current-spreadsheet.xlsx) — 40 inputs across five sheets feeding 20 outputs. The hardcoded outdated ZESCO tariff bands, the un-degraded 20-year savings line, and the implicit "operational installations only" filter on the historical-comparison sheet are present exactly as Bwalya uses it. - 85-installation historical dataset (
data/installations.csvanddata/installations.duckdb) — installation records with survivorship-adjusted columns. Three rows are failed-year-one with faulty inverters from the previous supplier; these are the survivorship-bias cases. - Reference primers at
reference/— tool-selection judgment across paradigms, configuration-driven application design, Streamlit conventions, handoff design for non-developer maintainers, survivorship-bias resolution patterns, solar-PV energy-audit methodology, and Zambian energy-market context. - Starter project layout with empty section-header skeletons:
config/,app/withpages/,analysis/validation.ipynb,design/,docs/,infrastructure/,bin/,tests/,.claude/skills/streamlit-handoff-review/SKILL.md,context-strategy.md, andrequirements.txt. - Carried-forward AI infrastructure —
CLAUDE.mdandAGENTS.mdpopulated with project context, the three established skills, the pre-commit hook scaffolding with the P20 regex reset (hook runspytest -qplus./bin/validate-config.sh), and the auto-memory carry-forward from P19.
Download the materials zip (https://learntodriveai.dev/materials/analytics/p-20/materials.zip) and unzip it to ~/dev/analytics/p-20.