Create quiz

From niznik-dev/cruijff_kit · View interactive version

Create quiz is an AI agent skill from the GitHub repository niznik-dev/cruijff_kit. Turn one or two completed cruijff_kit experiments into a self-contained, self-grading HTML quiz that tests a recipient's intuition about the results. Use whenever the user wants to teach, share, or stress-test understanding of an experiment — phrases like "make a quiz from this experiment", "test my

How to use this skill

Skill file

Create Quiz

You help users turn completed experiments into a teaching artifact: a self-contained HTML quiz, with questions grounded in the experiment's actual results, that scores itself and reveals explanations after each answer.

The point is intuition-testing, not trivia. Good questions force the recipient to make a prediction or judgment that the experiment's data can settle. Boilerplate ("how many runs were there?") fails that bar.

Audience and assumption

The recipient has not seen the experiment, the report, or any of the source files. Everything they need to answer must live inside quiz.html. Two consequences:

Your task

  1. Locate one or two experiment directories.
  2. Parse what each contains: the design (experiment_summary.yaml), the analysis (exploration/report.md, summary.md), and any rendered figures (exploration/*.png).
  3. Plan a portfolio of 6–8 questions, focused on results (not the experimental process or compute).
  4. Write a canonical quiz/quiz.json spec.
  5. Render quiz/quiz.html via python -m cruijff_kit.tools.quiz.render_quiz.
  6. Log the run to logs/create-quiz.log.

See the modular sub-files for details:

Prerequisites

Workflow

1. Locate experiment(s) → `parsing.md`

Accept one or two paths. If none provided and the current directory has experiment_summary.yaml, use it. Otherwise ask the user.

If two experiments are given, both must individually pass the prerequisite check (each has its own exploration/report.md). When generating questions, plan at least one comparison or contrast question that requires reading both.

2. Parse inputs → `parsing.md`

For each experiment, extract:

Preserve full numeric precision when reading from report.md — these experiments are typically evaluated at n=2000 per cell and CIs are tight. Store the source number verbatim (e.g. 0.987, 99.8%–100.0%), don't round to 0.99. This is independent from a question's tolerance field, which controls how forgiving the auto-grader is — that can be loose for intuition questions and zero for precise lookups, picked per-question. The principle is: lossy transcription corrupts the answer key; a deliberate tolerance does not.

3. Write the title and intro

The title field is what appears as the H1 and in the browser tab. Don't use the experiment's directory name (e.g. length_sweep_nth14) — it's a slug, not a title. Write a short recipient-friendly question or claim that frames what the quiz is actually about.

Good titles:

Bad titles:

Then draft the intro field of quiz.json. It must include:

Use markdown headings. The intro is the first thing the recipient reads — assume it's the only context they get.

4. Plan the question portfolio → `question_catalog.md`

Pick 6–8 questions, all about the results (not about how the experiment was run, what went wrong operationally, or compute efficiency).

Default mix:

If two experiments are loaded, at least one question must require both.

Question ordering matters. Order roughly:

  1. Anchor: a concrete lookup the recipient can answer from the intro alone (warm-up, builds confidence).
  2. Predict: numerical estimate with the answer derivable from the table.
  3. Twist: the most surprising / non-monotonic finding (the lesson the experiment teaches that intuition wouldn't predict).
  4. Hypothesis check: did the data confirm what the experiment set out to test?
  5. Predict (harder): a second numerical, or a comparison.
  6. Synthesis: which conclusion is best supported?

Don't lead with anything that gives away a later answer.

Question types to avoid by default

For each question, write:

5. Write `quiz/quiz.json`

The canonical spec. Schema is documented in generation.md. Top level contains:

How the renderer places these:

Always include all three fields.

6. Render `quiz/quiz.html`

python -m cruijff_kit.tools.quiz.render_quiz \
  --spec {experiment_dir}/quiz/quiz.json \
  --out {experiment_dir}/quiz/quiz.html

The renderer embeds PNGs as base64 (when used) and inlines all CSS/JS so the resulting file is portable — the recipient can open quiz.html from a download folder with no server.

7. Logging → `logging.md`

Append to {experiment_dir}/logs/create-quiz.log. Action types: LOCATE_EXPERIMENT, PARSE_INPUTS, WRITE_INTRO, PLAN_QUESTIONS, WRITE_SPEC, RENDER_HTML.

Why explanations must be self-sufficient

The skill's value depends on the recipient trusting the answer key. Hallucinated numbers destroy that trust on first inspection — and so does an answer key that says "see the report" when the recipient doesn't have the report. So every answer's explanation must:

  1. Quote the relevant fact inline — the exact number, the exact rule, the exact comparison. The recipient should be able to read the explanation and learn the answer without opening any other file.
  2. Be grounded in a real artifact — when you (the skill) write the explanation, the number you quote must come verbatim from report.md or summary.md. Don't paraphrase, don't round.

If you can't write a self-sufficient explanation, drop the question.

Output structure

After running, the experiment directory will contain:

{experiment_dir}/
├── quiz/
│   ├── quiz.json     # Canonical spec
│   └── quiz.html     # Self-contained, self-grading
├── logs/
│   └── create-quiz.log
└── (existing files unchanged)

User questions

Existing quiz outputs

If quiz/ already exists with a quiz.html, ask:

Found existing quiz in quiz/. What would you like to do?

1. Overwrite (Recommended)
2. Keep, write to quiz_v2/ instead

Two-experiment confirmation

If the user passed two paths, briefly summarize what's in each (one-line research question per experiment) and confirm before generating, since two-experiment quizzes take longer and the user may have meant to pass just one.

Validation before completion

Before reporting success, verify:

Output summary

After completing, tell the user:

## Quiz created

Experiment: {experiment_name}
Questions: {N} ({breakdown by type})

Files:
- {experiment_dir}/quiz/quiz.html   ← open in browser
- {experiment_dir}/quiz/quiz.json
- {experiment_dir}/logs/create-quiz.log

End with the absolute path to quiz.html on its own line so the user can command-click it.

Relationship to other skills

Workflow position:

design-experiment → scaffold-experiment → run-experiment → summarize-experiment → explore-experiment → create-quiz

Important notes

Module organization

| Module | Purpose |

|--------|---------|

| parsing.md | Loading experiment_summary.yaml + report.md + summary.md |

| question_catalog.md | Types, when to use each, worked examples |

| generation.md | quiz.json schema + render command |

| logging.md | Action types and file location |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.