Why This Talk?

“The difference between a good LLM output and a great one is almost never the model — it’s the prompt.”


  • Most of us are brute-forcing our chats
  • Copy → paste → pray → re-paste
  • Today: move to structured, repeatable prompt engineering
  • 10 minutes to level up your LLM workflow

1 · Context & Role Prompting

❌ Without Role

Write an R script to join 
traffic counts to TAZ polygons.

Generic, may use wrong packages, ignores projection issues

✅ With Role

Act as an expert transportation 
data scientist using R with sf.
I work with WFRC TAZ shapefiles 
(UTM 12N, EPSG:26912) and AADT 
count stations as point data.

Write an R script to spatially 
join traffic counts to TAZ polygons 
using the base pipe operator.

When you DON’T need it: quick syntax lookups, simple factual questions

2 · Plan First, Implement Second

Brute-Force

Write a Python script to process 
the household travel survey, 
calculate average trip lengths 
by mode and income group, and 
export the results for Cube.

One shot → bugs, missed edge cases

Chain of Thought

I need to process the WFRC 
household travel survey (CSV) 
and calculate average trip lengths 
by mode and income group for 
Cube Voyager import.

STEP 1: Outline the logical steps 
you would take. Do NOT write code 
yet. List assumptions.

STEP 2: Wait for my approval 
before writing the Python code.

Why it works: You catch logic errors before they’re buried in 200 lines of code.

3 · File Uploads & Data Privacy

✅ Safe to Upload

  • R scripts, Python notebooks, .qmd files
  • WFRC public GitHub repos
  • Published documentation & specs
  • SQL query logic (no credentials!)

⛔ Do NOT Upload

  • Raw survey respondent data
  • Personally identifiable information (PII)
  • Proprietary model parameters
  • Internal HR / financial records

The Workaround

# Share a SCHEMA, not the data:
"My data looks like this:

hh_id | persons | income_group
  int |     int | chr (Low/Med/High)
veh   | lat     | lng
  int |   dbl   | dbl

~45,000 rows. Some NAs in 
income_group (~8%). 
Write an R script to impute 
missing income using a 
k-nearest neighbors approach 
based on persons, veh, lat, lng."

4 · Managing Long Contexts

The Problem

 Message 1: "Here's my R script..."
 Message 5: "Now add mode share..."
 Message 12: "Why did you forget 
              the CRS transform 
              from slide 1?"
 Message 18: 🤯 Complete nonsense

LLMs lose coherence as conversations grow.

The Fix: Summarize & Restart

Summarize our conversation so far:
- What script are we building?
- What variables and data are 
  involved?
- What's working and what's not?

Format it so I can paste it into 
a brand new chat as the opening 
message.

Copy that summary → New chat → Paste → Continue with full coherence.

5 · Coding Agents & System Prompts

The Agent Landscape (2026)

Tool Model Lock-in Open Source
Claude Code Claude No
GitHub Copilot Multi No
Cursor Multi No
Codex (OpenAI) GPT No
OpenClaw Multi ✅
Gemini Code Assist Gemini No

CLAUDE.md / AGENT.md

Place in your project root:

# CLAUDE.md
## Project Context
WFRC travel demand model (Cube).
R + sf + data.table. Base pipe.

## Conventions
- EPSG:26912 for all spatial ops
- Snake_case variable names
- Never use `library(tidyverse)`
  — import packages individually

## Data
TAZ shapefile: data/taz_v4.shp
Count stations: data/aadt_2025.csv

6 · Meta-Prompting

Let the LLM write your prompt


I need to write a complex ArcPy script that automates 
network analysis for our regional travel demand model.

Before writing any code:
1. Ask me 3 clarification questions about my data and goals.
2. Then generate the best possible prompt I should use — 
   including role, context, constraints, and output format — 
   so I can paste it back to you (or a different model) 
   for the best result.


Why? The LLM knows what it needs to perform well. Let it tell you.

7 · Before & After Examples

❌ Before (Vague)

Help me with SQL for 
traffic counts.


Make a map of transit 
routes in R.


My pandas script is broken, 
fix it.

✅ After (Engineered)

Act as a SQL Server expert. 
Write a query against our 
traffic_counts table (columns: 
station_id, date, hour, volume, 
direction) that returns AADT by 
station for 2025 using the AASHTO 
factor method. Include comments.
Act as an R/sf developer. 
Using {sf} and base R plotting, 
map UTA TRAX lines from a GTFS 
shapes.txt file. Color lines by 
route_id. Use EPSG:26912.
[Upload the .py file directly]
This script processes the WFRC 
household travel survey. It fails 
at line 47 with a KeyError on 
'trip_mode'. The CSV has columns: 
[list them]. What's wrong?

Cheat Sheet

# Technique One-Liner
1 Role Prompt “Act as an expert ___ using ___…”
2 Plan First “Outline steps first. Wait for approval.”
3 File Uploads Upload code freely; share schemas, not data.
4 Summarize & Restart “Summarize this chat for a fresh session.”
5 Agent Files Put a CLAUDE.md in your project root.
6 Meta-Prompt “Ask me 3 questions, then write my prompt.”
7 Be Specific Name the table, the CRS, the package, the error.

Resources

Official prompt engineering guides:

Interactive tutorials:

Coding agents: