Turn a vague goal into measurable KPIs, then check them
Turn "increase customer satisfaction" into a metrics table with baseline, target and guardrail, then check each formula against your real column names.
The quarterly plan says "Significantly increase customer satisfaction" and nothing else: no baseline, no target, no way to measure it. Ask an AI to turn that into metrics and the table comes back fast, but whether each formula can be computed from the data you actually hold is a separate question. The example below is an invented online-course site with seven data columns. Give the model the column names first, make it leave the baseline empty, make it attach a guardrail to every metric (a second metric that catches the distortion you get from pushing the first one), then check the table with a script.
[1] Only two sections of the prompt change from task to task: [Available Data Columns] and [Vague Goals]. This is the prompt that was actually run.
You are a business planning and performance management expert. Convert the following [Vague Goals] into specific, measurable Key Performance Indicators (KPIs) suitable for a quarterly planning document. [Available Data Columns]- user_id (Unique user identifier)- signup_date (Account registration date)- course_id (Unique course identifier)- completed_yn (Course completion status, Y/N)- completion_date (Course completion date)- survey_score (Satisfaction survey score, 1-5)- survey_submitted_at (Survey submission timestamp) [Vague Goals]1. Significantly increase customer satisfaction.2. Improve course completion rates. [Rules]1. Derive 1-2 measurable key metrics for each goal.2. The formula must combine ONLY columns from [Available Data Columns]. Do not use fictional columns (e.g., NPS, time spent, retention rate).3. Baseline: Since current baseline numbers are not provided, do not fabricate numbers. Write exactly "Needs measurement".4. Target: State the direction or condition to be set once the baseline is established.5. Guardrail Metric: For each goal, specify at least one guardrail metric to prevent metric gaming or perverse incentives.6. The formula must include the date column that cuts the quarter (signup_date, completion_date or survey_submitted_at, whichever applies) and state which column defines the quarter. In the 'Data Columns' cell, list only column names separated by commas and nothing else.7. Output ONLY a single Markdown table in the following format without any introductory or concluding text: | Goal | Key Metric | Formula | Data Columns | Baseline | Target | Guardrail Metric ||---|---|---|---|---|---|---|Splitting the rules into what not to do (fictional columns, made-up baselines) and what to do (guardrails), and showing the table header up front, follows the constraints and output-format advice in Google's Gemini prompting strategies.
[2] Feed the prompt on standard input. User instructions and tools are switched off so the run starts from the same conditions every time.
$ claude -p --model claude-sonnet-5-5 --max-turns 1 --tools "" --setting-sources "" --strict-mcp-config < run/kpi.en.v3.prompt.txt > run/kpi.en.v3.1.out.txt[3] One seven-column table came back. Long cells are cut to their first 44 characters with … (full text in run/kpi.en.v3.1.out.txt).
| Goal | Key Metric | Formula | Data Columns | Baseline | Target | Guardrail Metric ||---|---|---|---|---|---|---|| Significantly increase customer satisfaction | Average satisfaction score | AVG(survey_score) over survey responses wher… | survey_score, survey_submitted_at | Needs measurement | After the baseline is measured, set a target… | Survey response rate = COUNT(DISTINCT user_i… || Significantly increase customer satisfaction | Share of satisfied responses (score 4-5) | COUNT(survey_score >= 4) / COUNT(survey_scor… | survey_score, survey_submitted_at | Needs measurement | After the baseline is measured, set a target… | Survey response volume = COUNT(survey_submit… || Improve course completion rates | Cohort course completion rate | COUNT(user_id-course_id records with complet… | user_id, course_id, completed_yn, signup_dat… | Needs measurement | After the baseline is measured, set a target… | Average survey_score of completed_yn = 'Y' r… || Improve course completion rates | 30-day completion rate | COUNT(records with completed_yn = 'Y' and co… | user_id, course_id, completed_yn, completion… | Needs measurement | After the baseline is measured, set a target… | Share of completed records with survey_score… |All four baselines read "Needs measurement". Across the 12 runs in this post (6 English, 6 Korean) no baseline ever contained a number. The prompt did say to write exactly that in rule 3, though; what happens without that rule was not tested in this run.
[4] Checking formulas by eye is slow, so a script reads each row. It looks for column names in the Data Columns cell and for snake_case names inside the formula and guardrail, all of which must exist in schema.txt; every column used in the formula must also be listed in the Data Columns cell. It checks that the baseline is "Needs measurement" and nothing else, that the target has no figure such as 4.5 points, that metric names are unique, and that each goal has one or two metrics. A formula without a date column only gets a WARN, not a FAIL. The listing below drops the setup lines, marked with ….
…schema = {l.strip() for l in open(sys.argv[1], encoding="utf-8") if l.strip() and not l.startswith("#")}DATE_COLS = {"signup_date", "completion_date", "survey_submitted_at"}TOKEN = re.compile(r"[a-z]+(?:_[a-z]+)+")NUM = re.compile(r"\d")FIG = re.compile(r"\d+(?:\.\d+)?\s*(?:%|points?|pp|percent)")EXPECTED_HEADER = 7…data = [r for r in rows[1:] if not set("".join(r)) <= set("-: ")]fail = warn = 0seen, per_goal = set(), {}for i, r in enumerate(data, 1): if len(r) != EXPECTED_HEADER: print(f"FAIL row {i}: {len(r)} cells (need 7)"); fail += 1; continue goal, metric, formula, cols, base, target, guard = r err, note = [], [] per_goal[goal] = per_goal.get(goal, 0) + 1 key = metric.lower() if key in seen: err.append(f"duplicate metric name '{metric}'") seen.add(key) listed = {c.strip("`") for c in re.split(r"[,\s]+", cols) if c.strip("`")} if not listed: err.append("Data Columns is empty") if listed - schema: err.append(f"unknown column listed: {sorted(listed - schema)}") in_formula = set(TOKEN.findall(formula)) in_guard = set(TOKEN.findall(guard)) if in_formula - schema: err.append(f"unknown column in formula: {sorted(in_formula - schema)}") if in_guard - schema: err.append(f"unknown column in guardrail: {sorted(in_guard - schema)}") if (in_formula & schema) - listed: err.append(f"formula column missing from Data Columns: {sorted((in_formula & schema) - listed)}") if base.strip(" *`") != "Needs measurement": err.append(f"Baseline is not 'Needs measurement' alone ('{base}')") if FIG.search(target): err.append(f"Target contains a number ('{target[:30]}…')") if len(guard) < 5 or not (in_guard or "=" in guard): err.append(f"Guardrail is not a metric definition ('{guard[:30]}')") if not (in_formula & DATE_COLS): note.append("formula has no period condition (no date column)") if err: fail += 1; print(f"FAIL row {i} [{metric}]: " + "; ".join(err)) elif note: warn += 1; print(f"WARN row {i} [{metric}]: " + "; ".join(note)) else: print(f"OK row {i} [{metric}]")for g, n in per_goal.items(): if not 1 <= n <= 2: fail += 1; print(f"FAIL goal '{g[:20]}': {n} metrics (need 1-2)")if len(per_goal) != 2: fail += 1; print(f"FAIL {len(per_goal)} goals (need 2)")print(f"\nrows {len(data)} · FAIL {fail} · WARN {warn}")sys.exit(1 if fail else 0)$ python run/check_kpi_en.py run/schema.txt run/kpi.en.v3.1.out.txtOK row 1 [Average satisfaction score]OK row 2 [Share of satisfied responses (score 4-5)]OK row 3 [Cohort course completion rate]OK row 4 [30-day completion rate] rows 4 · FAIL 0 · WARN 0The script cannot see a nonexistent column written as plain words ("time spent") or whether a formula matches its metric name. To test the catching side, run/make_tests_en.py copies a correct table eight times with exactly one defect each (unknown column, number in the baseline, guardrail -, duplicate metric name, unknown column inside the formula, formula column missing from the column cell, figure in the target, one goal missing). All eight returned FAIL. The first version of the script only looked at the column cell, the baseline, the guardrail and duplicate names, and the other four checks were added during this test. One representative case follows (this is not model output).
$ python run/check_kpi_en.py run/schema.txt run/test_en_bad_formula_col.txtFAIL row 1 [Average satisfaction score]: unknown column in formula: ['retention_rate']OK row 2 [Course completion rate] rows 2 · FAIL 1 · WARN 0[5] Some rows came back without a date condition, so the prompt was changed twice and each version was run twice (row counts from run/tally.py). v1 has no date rule, v2 adds "put the date column that cuts the quarter in the formula", and v3, the prompt above, also says "list only column names in the Data Columns cell".
| Version | Run 1 | Run 2 |
|---|---|---|
| v1 | OK 3 rows · WARN 1 row | OK 4 rows |
| v2 | OK 4 rows | OK 4 rows |
| v3 | OK 4 rows | OK 4 rows |
Three things went wrong.
- Missing period condition. In the English v1 runs, 1 of 8 rows had a formula with no date column (the satisfied-response share, run 1), so it was unclear which quarter's data it counts. The Korean v1 runs did it in 4 of 8 rows.
- The fix broke the table. In the Korean v2 runs, run 1 put notes such as
(quarter basis: survey_submitted_at)into the Data Columns cell and all 4 rows failed the column check; run 2 was fine. The English v2 runs did not do this. Version v3 passed both languages twice, but that is two runs each and no promise it stays stable. - Name, formula and goal drifting apart. English v2 run 2, row 4 answers the goal "improve completion rates" with "number of completed courses per active learner", which is not a rate. In the Korean v1 run 1, row 3 is named "completion rate by course" but divides by all enrollments, not by course. The Korean row only got a WARN for having no date column, so its name/formula mismatch went unnoticed, and the English row was marked OK; a person has to read whether name, formula and goal point at the same thing.
Do not paste this table straight into a plan in two cases. If the column list is not final, the metrics sit on columns that may not exist. And a target cell that only says "increase once the baseline is measured" is a slot for a person to set the number. For re-computing figures an AI states against the source data, see Recompute the averages and rates an AI states from a CSV.