Criteria
Turns several loose questions into a one-file HTML form that shows one question at a time, with a progress bar and a button that copies every answer at once.
Cuándo se usa
When you need to decide several different things at once and would rather fill in a form than answer them one by one.
SKILL.md
# Criteria
For when several different kinds of questions need asking at once (not just "pick option 2"),
and whoever is answering would rather fill them in with a keyboard and mouse and hand back
**the whole block in one go**, instead of answering each question one at a time in the chat.
It does not replace other ways of asking, it completes them:
- A back-and-forth **in the chat**, question by question, is still better when each answer
needs reasoning through before the next question can even be written.
- A **Markdown** questionnaire is still better for a third party (a client, a collaborator)
who has no coding agent installed and can only read plain text.
- **Criteria** is a form in the **browser**, for whoever already has a coding agent in front
of them, when the questions can all be asked at once and dictating or typing them one by one
is what is left over.
## Process
### 1. Gather the questions
Whatever the decision needs. For each one, pick its type:
- `texto` (text) - a short line (a name, a number).
- `parrafo` (paragraph) - several lines (an explanation, some context).
- `opcion` (single choice) - pick one from a list. The "Other:" free-text option is always
added on its own, nothing needs to ask for it.
- `multiple` (multiple choice) - pick several from a list. Same always-on "Other:".
- `escala` (scale) - rate on a range (0-10, 1-5), with labels at the ends if they help.
One question per decision: if a question carries two things inside it, that is two questions.
**Before treating the list as final, run every question through two filters, no exceptions:**
- **Is it actually needed?** If the answer would not change anything done afterward, the
question does not belong. Do not ask to pad out the form or "just in case": every extra
question wastes the time of whoever has to answer it.
- **Does it read clearly the first time?** A short sentence, one single idea, no jargon the
person answering has no reason to know. If a question needs context to make sense, that
context goes in `ayuda` (see below), never crammed into the title until it turns long or
technical.
Go through the whole list with these two filters before moving to step 2: drop every question
that would not change anything, and rewrite every question that needs a second read to figure
out what it is even asking. A forty-question form where half a dozen are noise is not more
thorough than a thirty-four-question one, it is just longer and more tiring to fill in.
Every question accepts `ayuda` (why it is being asked now, in one line) and `siNoDices` (what
happens if it stays unanswered). Both show under the question, which sits on top and in full.
Each option of `opcion` or `multiple` can be plain text, or carry more:
`{ texto, ayuda?, recomendada?, porque?, malo?, bueno?, cuesta?, noHace?, icono?, nota? }`.
- `texto` is the word, in large type: one to three words work better than a whole sentence.
- `ayuda` is the sentence underneath: what happens if that option is picked, with a verb.
- `recomendada: true` on one option only, and `porque` says why. **It is never preselected**:
the recommendation is said in words and the person answering chooses.
- `malo`, `bueno` and `cuesta` (the downside, the upside and the cost), one line each and always
all three, so the options compare themselves. They appear under the options when one is picked.
- `noHace`, what that option does not include, when it can be read two ways.
- `icono`, one of the template's own: `si`, `no`, `ya`, `esperar`, `pregunta`, `gente`,
`dinero`, `texto`, `igual`, `estrella`, `lapiz`, `flecha`, `escudo`.
- `nota`, one or two words underneath in the accent color (for example `"the cheapest"`).
The whole list does not need one format: a question can mix plain options with others that carry
everything. An option with only a long text is shown in regular type, not in large bold.
If the questionnaire is long and its questions fall into clear groups (like "the pricing ladder",
"mobile", "money"), any question accepts an optional `seccion: "Group title"`. It appears above
the question with an automatic letter (A, B, C...) as soon as it changes from one question to the
next. It is only grouping: the P1, P2... numbering and the answer format do not change.
**How to tell `opcion` from `multiple` apart, without guessing:** ask whether two of the
answers could be true at once. "How much does it cost a month?" is `opcion`, because one price
rules out the rest. "What justifies paying for this?" or "what should the app do?" are almost
always `multiple`, because several reasons or several features can be true at the same time. By
default, when in doubt, `multiple` costs less than forcing a single answer onto something that
is not one: it errs on letting people pick too much, not too little.
**This is not negotiable, not even when the questionnaire needs more design than the template
ships with.** The word, the sentence, the recommended option with its reason, and the downside,
upside and cost already cover the most common case of "I need to explain each option and mark the
recommended one". If something still genuinely does
not fit (a full comparison table, a large warning banner), a richer design can be hand-built, but
the behaviour does not get negotiated away: every single-choice question carries its free-text
"Other:", and every question where two answers could both be true uses checkboxes, not radios.
A hand-built questionnaire without this is not a simplified version of Criteria, it is a broken
questionnaire that looks like one.
### 2. Match the palette to the project you are working in
This is not optional: the questionnaire **does not always look the same**, it looks like the
conversation it was asked in. Before generating the file, check whether the active project has
its own design system (an `App.css`, a `globals.css`, Tailwind tokens, theme variables already
defined) and find its colors, its border radii and its typeface. If it has one, replace the
values in the block marked `PALETA` (the `--bg`, `--text`, `--accent`, `--accent-text`,
`--ok`, `--warn`, `--bad`, `--radio`, `font-family`, `--letra-titulos`...) with its own.
`--accent` is the background of what is selected and of the main button, with `--sobre` on top;
`--accent-text` is the accent when it sits on the page background. The `ESTRUCTURA` block below is
never touched: it always uses `var(--something)`, so it inherits the skin change on its own. If the
project has no identifiable design system of its own (a task with no website, or a repo with no
frontend), the template's neutral default palette is kept, already checked for WCAG 2.1
contrast.
### 3. Generate the file, without reading the whole template
`references/plantilla.html` never changes between one questionnaire and the next except in
three spots, so there is no need to load it into context to touch them: copy the file as-is
(`cp` / `Copy-Item`, never inside the project's own code, it is a working file) to
`criteria-<topic>.html` in a temporary session folder, and substitute the three placeholders
with a single-pass command that reads and writes the file without its content ever passing
through the model:
```bash
python3 - "<path-to-copy>" <<'EOF'
import json, sys
p = sys.argv[1]
html = open(p, encoding="utf-8").read()
html = html.replace("__TITULO__", "...") # what is being decided, in four words
html = html.replace("__SUBTITULO__", "...") # one sentence: what this is for and what happens when it's done
html = html.replace("__PREGUNTAS_JSON__", json.dumps([
# ...the questions, using the shapes from step 1...
], ensure_ascii=False))
open(p, "w", encoding="utf-8").write(html)
EOF
```
In PowerShell, the same thing with `-replace` over `Get-Content -Raw -Encoding UTF8` and
`Set-Content -Encoding utf8`. If step 2 calls for a different palette, those same commands add
more `-replace`/`.replace()` calls over the `PALETA` block's values; the `ESTRUCTURA` block is
never touched. The read-and-edit-file tools are not used on `plantilla.html` or on the copy:
there is no need to, and loading a hundreds-of-lines HTML file into context just to change three
values is spending tokens for nothing.
### 4. Open it yourself
Open the file in the browser on your own (on Windows, `Start-Process` on the path; on macOS,
`open`; on Linux, `xdg-open`), without asking permission and without just leaving the path
written down for someone else to open by hand. In the chat, one line: what is being asked and
that the block should be pasted back once it is done. Never repeat the question list in the
terminal: whoever has to read and answer it already has it in front of them, in the form.
### 5. When the pasted block comes back
It arrives in the shape `P1. <question>\n→ <answer>`. On choice questions, each picked option
comes with its number (`→ 2 · 99 €`) and whatever was typed in the free slot follows `Otra: `. The
ones saying `(sin responder)` are the ones left blank: they are not made up, they get asked again
in the chat if the decision needs them to close, or set aside if they are not blocking. With the
rest, build the prompt or make the decision the questionnaire was for.
If the same questions also go out through another channel (a phone notification, another question
tool), they go in the same order and with the options in the same order, so "P2, number 3" means the
same thing in both places.
## What the template already has, and why it stays untouched
- **Zero CDN, one file.** It has to look the same with no internet connection.
- **System theme, no toggle.** `prefers-color-scheme` decides light or dark on its own: this is
not a catalog that needs checking in both themes at once, it is a single-use form.
- **The default palette** (`--bg`, `--panel`, `--accent`...) is the one used in step 2 when the
project has none of its own, with contrast already measured against WCAG 2.1. If a hex value
is ever touched, it gets measured again, never adjusted by eye.
- **One question at a time.** Many dense questions in view at once are hard to take in and hard to
decide; one by one, the person thinks about a single thing. The question on top, in full; below it,
why it is being asked and what happens if it stays unanswered. "Back" and "Next" to move, and on the
last one, "See what you answered": a review of them all, each with its "Change". `Enter` in a short
answer moves to the next question.
- **Options are word-and-sentence tiles**: the large word with its number, the softer sentence below,
and pressing one fills it with the accent color. The recommended one says so in words and explains
why when pressed. The downside, upside and cost of the chosen one appear below, one line each. In
columns on a large screen, stacked on a phone.
- **One single "Copy answers"**, at the bottom and always within reach, which becomes the main button
once everything is answered or on the final review.
- **A progress bar up top**, always visible while scrolling (`position: sticky`), with the
answered count next to it. Not just a number lost at the bottom of the page.
- **"Other:" always present** on every single- or multiple-choice question, with its free-text
slot. It is built into the template, not something to remember to ask for. What is typed there
counts on its own, with nothing to press first, and does not remove what was already picked: it
works for adding nuance.
- **Real multi-select, and it says so.** `multiple` uses checkboxes (square, not round): more than
one can be picked at once, the final block joins them with commas, and the question says "pick one
or several" so it is never mistaken for single choice.
- **Sections with an automatic letter**, for long questionnaires: grouping questions under a
`seccion` does not change their numbering or the answer format, it only says above which group
they belong to.
- **No badges or boxed labels.** What needs to stand out does so through weight, size or text color,
never with a pill around it. 17 px type, and nothing below 14.
- **Nothing is required.** A form where everything is mandatory does not get filled in quickly
by anyone; the button still copies with blank questions, marked as such.
- **Copying with a safety net.** It tries `navigator.clipboard`, and if the browser blocks it
(which happens sometimes on a local `file://` page), it leaves the text selected in a visible
box so a manual Ctrl+C still works.
- **Autosaved to `localStorage`.** If the tab gets closed by accident halfway through, whatever
was already typed is still there when the same file is reopened, back on the question it was on.
## When NOT to use this
If there is only one thing to decide, or if the questions depend on each other (the second one
cannot be written until the first is answered), that is a back-and-forth in the chat, not
Criteria: here every question gets asked at once, in a single pass.