|
| 1 | +# Eval Runbook for `genpage` |
| 2 | + |
| 3 | +How to evaluate the `genpage` skill. Three layers, run in order. |
| 4 | + |
| 5 | +## Related files |
| 6 | + |
| 7 | +- **Skill definition:** `plugins/model-apps/skills/genpage/SKILL.md` |
| 8 | +- **Specialist agents:** |
| 9 | + - `plugins/model-apps/agents/genpage-planner.md` |
| 10 | + - `plugins/model-apps/agents/genpage-entity-builder.md` |
| 11 | + - `plugins/model-apps/agents/genpage-page-builder.md` |
| 12 | + - `plugins/model-apps/agents/genpage-edit-planner.md` |
| 13 | +- **References:** |
| 14 | + - `plugins/model-apps/references/rules.md` |
| 15 | + - `plugins/model-apps/references/plan-schema.md` |
| 16 | + - `plugins/model-apps/references/troubleshooting.md` |
| 17 | +- **Sample pages:** `plugins/model-apps/samples/1-account-grid.tsx` through `10-detail-with-pageinput.tsx` |
| 18 | + |
| 19 | +## Eval data |
| 20 | + |
| 21 | +All eval definitions live in `evals.json` alongside this file. The file contains: |
| 22 | + |
| 23 | +- `common_workflow_assertions`: 15 workflow checks every run must pass (prereqs, auth, solution selection gating, check-auth pre-flight, plan creation, workflow log, --prompt scoping, prefix discipline at plan-format / resolved-names / solution-alignment) |
| 24 | +- `common_code_assertions`: 18 code-quality checks the generated `.tsx` must pass (Fluent UI V9 only, no forbidden patterns, etc.) |
| 25 | +- `evals`: 16 test cases — each with `id`, `tier`, `prompt`, `data`, and per-eval `expectations` |
| 26 | + |
| 27 | +The `data` field specifies the user answers and environment state the eval assumes. During manual eval runs, the human grader role-plays this data. During automated runs, the eval harness provides these responses to `AskUserQuestion`. |
| 28 | + |
| 29 | +### Tiers |
| 30 | + |
| 31 | +Each eval has a `tier` for selective running: |
| 32 | + |
| 33 | +| Tier | Count | Purpose | |
| 34 | +|------|-------|---------| |
| 35 | +| `smoke` | 4 | Diverse representatives (Dataverse page, mock page, edit, plan-schema compliance). Run on every PR. | |
| 36 | +| `full` | 9 | All core scenarios (wizard, kanban, analytics, entity creation, app creation, multi-page, localization, choices). Run nightly or pre-release. | |
| 37 | +| `stress` | 3 | Edge cases (az not logged in / not member of org, filename collision, plan revision loop). Run with full suite. | |
| 38 | + |
| 39 | +## Quick start: running one eval |
| 40 | + |
| 41 | +Example using eval id 1 (account gallery). |
| 42 | + |
| 43 | +1. Open Claude Code with the `model-apps` plugin loaded. |
| 44 | +2. Send: |
| 45 | + > /genpage Build a page showing Account records as a gallery of cards. Include name, website, email, phone number. Make the gallery scrollable and each card clickable to open the Account record. |
| 46 | +3. As the planner asks questions, answer per the eval's `data.question_answers` field. |
| 47 | +4. When the planner enters plan mode, approve it (or reject per the stress eval's `plan_revision_scenario`). |
| 48 | +5. Save the generated `workflow-log.md` and the produced `.tsx` files. |
| 49 | +6. **Layer 1 check:** Grade the workflow-log against the eval's `expectations` and the `common_workflow_assertions`. |
| 50 | +7. **Layer 2 check:** Grep the generated `.tsx` against `common_code_assertions`. |
| 51 | +8. **Layer 3 check:** Score the generated page against the UX rubric. |
| 52 | + |
| 53 | +## How to run evals |
| 54 | + |
| 55 | +### Step 1: Execute each eval's prompt |
| 56 | + |
| 57 | +Invoke `/genpage` with the eval's `prompt` as the user message. For each user question the planner asks (`AskUserQuestion`), respond per the eval's `data.question_answers`. For edit evals, provide the stated app-id and page-id when asked. |
| 58 | + |
| 59 | +For stress evals with specific scenarios (e.g., eval 12's plan-revision-scenario or eval 14's filename-collision), follow the scripted behavior in the `data` field. |
| 60 | + |
| 61 | +Save for each run: |
| 62 | +- `workflow-log.md` (required output, per `eval_instructions`) |
| 63 | +- Every `.tsx` file produced in the working directory |
| 64 | +- Any plan documents (`genpage-plan.md`, `genpage-edit-plan.md`) |
| 65 | + |
| 66 | +To run only a subset, filter by `tier` (e.g., `smoke`-only for quick validation). |
| 67 | + |
| 68 | +### Step 2: Layer 1 — Workflow assertions |
| 69 | + |
| 70 | +For each eval, verify: |
| 71 | +- All 15 `common_workflow_assertions` — generic workflow guarantees that every run must satisfy |
| 72 | +- All of the eval's own `expectations` — the eval-specific workflow checks |
| 73 | + |
| 74 | +These are checked against the `workflow-log.md` and the files in the working directory. No browser or deployment needed for this layer. |
| 75 | + |
| 76 | +**Pass criteria:** Every assertion passes. Zero missed agent invocations, zero skipped phases, zero misordered operations. |
| 77 | + |
| 78 | +### Step 3: Layer 2 — Code quality |
| 79 | + |
| 80 | +For every generated `.tsx` file, check against the 18 `common_code_assertions`. |
| 81 | + |
| 82 | +These can be verified with grep / regex against the source: |
| 83 | + |
| 84 | +| Assertion | Grep pattern | |
| 85 | +|-----------|--------------| |
| 86 | +| Single file + default export | `^export default GeneratedComponent` | |
| 87 | +| Destructures `pageInput` | `const.*\{.*pageInput.*\}.*=.*props` | |
| 88 | +| Uses `makeStyles` | `makeStyles` | |
| 89 | +| No `100vh`/`100vw` | `grep -E '100v[hw]'` should return nothing | |
| 90 | +| No forbidden theme functions | `grep -E '(createTheme\|mergeThemes\|useTheme)'` should return nothing | |
| 91 | +| No `<FluentProvider>` wrapper | `grep '<FluentProvider'` should return nothing (except in Dark Mode Toggle pattern) | |
| 92 | +| No raw URL navigation | `grep -E '(window\.location\|href=.*pagetype=)'` should return nothing | |
| 93 | +| `Xrm.Navigation.navigateTo` | If navigation is used, must appear | |
| 94 | +| Unsized icons | `grep -E '\w+(16\|20\|24\|28\|32)(Regular\|Filled)\b'` should return nothing | |
| 95 | +| try-catch on dataApi | Each `await dataApi\.` must be inside a try block | |
| 96 | +| No placeholders | `grep -E '(TODO\|FIXME\|\.\.\..*$)'` should not match in function bodies | |
| 97 | +| FormattedValue for lookups | Any `_xxx_value` in a select must be paired with a FormattedValue access | |
| 98 | +| `createTableColumn` import | If `<DataGrid>` is used, must import `createTableColumn` | |
| 99 | + |
| 100 | +**Pass criteria:** Every generated `.tsx` passes all 18 code assertions. Regressions here indicate the page-builder agent drifted from the rules. |
| 101 | + |
| 102 | +### Step 4: Layer 3 — UX rubric |
| 103 | + |
| 104 | +Review each deployed page visually (screenshot or live in the browser) against this rubric: |
| 105 | + |
| 106 | +| Category | 2 (Full) | 1 (Partial) | 0 (Fail) | |
| 107 | +|----------|----------|-------------|----------| |
| 108 | +| **Workflow** | All phases ran correctly, all agents invoked as expected | Minor deviation (e.g., wrong Phase order) | Phase skipped or wrong agent invoked | |
| 109 | +| **Code** | Clean code, all rules followed, no placeholders, good naming | Minor issues (1-2 rule violations) | Code has JS errors, broken logic, or major rule violations | |
| 110 | +| **Visual** | Polished layout, good spacing, Fluent tokens, consistent hierarchy | Decent but cramped, misaligned, or inconsistent | Broken layout or no visible content | |
| 111 | +| **Data** | All data fields populated correctly, real data shown, lookups resolved | Some fields missing or showing IDs instead of names | Blank page or wrong data | |
| 112 | +| **Design** | Right visual for the data (grid vs cards vs dashboard), compact, no clutter, accessible | Reasonable but suboptimal choice | Wrong visual type for the data | |
| 113 | + |
| 114 | +Max score: **10 per page** (5 categories × 2 points). |
| 115 | + |
| 116 | +**Pass criteria:** Average score ≥ 8.5/10 across all pages, no individual page below 7/10. |
| 117 | + |
| 118 | +## Pass / fail summary |
| 119 | + |
| 120 | +An eval run passes when: |
| 121 | +- **Layer 1:** 100% of workflow assertions pass |
| 122 | +- **Layer 2:** 100% of code assertions pass on every `.tsx` |
| 123 | +- **Layer 3:** Average UX score ≥ 8.5, no page below 7 |
| 124 | + |
| 125 | +An eval run fails if any layer's criteria is not met. Failures should be filed against the specific agent that owns the concern: |
| 126 | + |
| 127 | +| Failure type | Likely owner | |
| 128 | +|--------------|--------------| |
| 129 | +| Missed agent invocation, wrong phase order | Orchestrator (`SKILL.md`) | |
| 130 | +| Plan document missing sections or wrong structure | `genpage-planner.md` or `plan-schema.md` | |
| 131 | +| Entity created in wrong order or missing columns | `genpage-entity-builder.md` | |
| 132 | +| Generated code violates a common_code_assertion | `genpage-page-builder.md` or `rules.md` | |
| 133 | +| Edit modified the wrong thing or broke existing behavior | `genpage-edit-planner.md` or orchestrator edit flow | |
| 134 | + |
| 135 | +## When to run evals |
| 136 | + |
| 137 | +- **Smoke tier:** on every PR that touches the skill, agents, or rules reference |
| 138 | +- **Full + smoke:** nightly, or before merging a significant change |
| 139 | +- **Stress tier:** with the full suite, or when changing the orchestrator probe logic, filename validation, or plan-mode handling |
| 140 | +- **All tiers:** before bumping the plugin version (any 2.x.0 release) |
0 commit comments