Gresso
Gives a long task its own live progress page. The agent keeps rewriting one HTML file as it works, and the tab you leave open keeps itself up to date.
Cuándo se usa
When a task has four steps or more, or is going to take a while.
SKILL.md
# Gresso
The progress of a task on a single page nobody has to ask for. While the agent works it keeps
rewriting the same file, and the open tab updates by itself within seconds, without pressing
anything: anyone can look at it and see how far along it is **without interrupting it and without
waiting for the wrap-up**.
Without this there are two bad options: ask the agent (and stop it) or wait for the final summary.
Tracking that only gets written at the end is not tracking, it is a report.
## When to use it, and when not to
**Yes**, as soon as the task has **four steps or more**, or is going to take more than a few minutes:
setting up something new, a migration, an audit, a plan with checkboxes, cleaning up a whole
repository, the rundown of what is left to build in a project.
**No**, for a one-off answer or a two-line fix. Setting up tracking for three steps is ceremony, and a
tool that pops up all the time ends up being ignored altogether.
## Process
Everything goes through `scripts/gresso.py`, inside this skill's folder (the one shown as the base
directory when it loads). Python 3, no dependencies. In the examples, `GRESSO` is the path to that
script; on Windows, `python` instead of `python3`.
### 1. Split the task into tasks before touching anything
Each task is **one thing that can be closed in one go**, said in one sentence and in plain words:
whoever reads it wants to know what is missing, not to read your technical plan. If a task needs a
bulleted list to be told, it is several tasks.
Group them in **phases** when the work has real stages (`Montaje`, `Pruebas`, `Publicación`). If it does
not, one single phase and that is it; inventing phases to make the page look more serious is noise.
Each task accepts:
- `texto` - the sentence. Required.
- `estado` - `pendiente` (the default), `haciendo`, `hecho`, `bloqueado`, `descartado`.
- `nota` - one line of detail, and on what is blocked, **exactly what is missing** to unblock it.
- `peso` - a number, only when one task is worth several and a flat percentage would lie.
- `quien` - `"tu"` if it falls to the person reading; without this field, the task is the agent's.
- `id` - the script assigns it by itself (`t1`, `t2`...). An id **never changes**, even if tasks are
added in the middle later, so it can be remembered to mark the task afterwards.
What belongs to the person goes apart from what belongs to the agent, in two columns on a big screen and
one on a phone (what they have to decide, on top and full width), with everything they need to do it
without asking:
- `porque` - why it falls to them, in one or two sentences.
- `pasos` - the list of numbered steps.
- `acciones` - buttons: `{"texto": "Abrir el panel", "url": "https://..."}` opens a link and
`{"texto": "Copiar el correo", "copiar": "..."}` copies a value.
- `dime` - what they have to tell you when they finish.
- `ya` - `true` if they have to do it **now, no matter what**. Only when both things hold: only the person
reading can do it (their account, their signature, their money, their permission to publish, their
opinion when work is stopped waiting for it) **and** something stops or is lost if they do not do it now
(blocked work, a deadline, an expiry). Its `texto` says what they do, where, and what stops if they do
not, in the same sentence: `"Pagar la factura del servidor antes del día 10: si no, lo apagan"`.
**What is urgent goes at the very top and apart**, in "Ya, sí o sí" (now, no matter what), above "Lo
siguiente" (what comes next), with its steps and buttons like any task of theirs. The rest of what is
theirs is then called "Cuando puedas" (whenever you can). **At most three in view**, in page order: if
there are more, a line says how many and the others drop, first in line, to "Cuando puedas" (the script
warns). If everything is urgent, nothing is: what can wait does not carry `ya`. With no `ya` task, the
block does not show and the page stays as always. It also works on a decision. To move it up or down
later, without touching its state: `estado <ruta> t3=ya` or `estado <ruta> t3=noya`. When it becomes
`hecho`, it leaves the block by itself. On what the agent does, `ya` does not apply: it is not urgent for
the person reading if they do not have to do it.
Each task of theirs carries a checkbox saved in their browser that counts towards the percentage. **That
checkbox does not reach you**: when they tell you, mark it with `estado`, and then it also counts in
`ver`. `porque`, `pasos`, `dime` and `nota` accept `<strong>`, `<em>`, `<code>` and links; any other tag is ignored.
**What they have to decide goes on the same page**, not on another one. A decision is a task with the
`decision` field:
```json
{"texto": "¿Publico hoy o espero al lunes?", "quien": "tu",
"porque": "El lunes tendrás a alguien mirando si algo falla.",
"decision": {
"opciones": [
{"texto": "Hoy", "icono": "ya", "detalle": "Queda publicado esta tarde y te lo enseño.",
"recomendada": true, "porque": "lo que falta ya está probado y el lunes hay otra entrega.",
"malo": "Si algo falla, lo veo yo solo hasta el lunes.", "bueno": "Queda hecho hoy.",
"cuesta": "Nada.", "noHace": "avisar a los clientes, eso va aparte"},
{"texto": "El lunes", "icono": "esperar", "detalle": "Lo dejo listo y lo publico el lunes a primera hora.",
"malo": "Tres días más sin la versión nueva.", "bueno": "Hay alguien mirando si algo falla.",
"cuesta": "Tres días."}
],
"siNoDices": "Si no me dices nada, espero al lunes."
}}
```
This is how to write it so it reads cold:
- The task's `texto` is **the whole question**, in one sentence ending in "?". `porque` says why it has to
be decided now, and `siNoDices`, what happens if there is no answer.
- In each option, `texto` is **the word** (one to three words) and `detalle` **the sentence**: what happens
to the person reading if they pick it, with a verb.
- `malo`, `bueno` and `cuesta` (downside, upside and cost), **one line each and always all three**, so the
options compare themselves. If an option can be read two ways, `noHace` says what it does not include.
- The recommended one carries `"recomendada": true` and its `porque`, and **is never preselected**.
- `icono`, if you want, one of those the template brings: `si`, `no`, `ya`, `esperar`, `pregunta`,
`gente`, `dinero`, `texto`, `igual`, `estrella`, `lapiz`, `flecha`, `escudo`.
- Three open decisions at most is better: what you can decide yourself, you decide and report.
On the page **one decision shows at a time**, full width, above the two columns: the question on top, the
options as word-and-sentence tiles (the recommended one says so), and pressing one shows the downside, the
upside and the cost, and why it is the recommended one. Only one can be picked, unless `"varias": true`.
Below, the box "Otra cosa, con tus palabras" (something else, in your own words); "Siguiente" moves on to
the next one and at the end comes what was decided, each with its "Cambiar", with **one single "Copiar
respuestas"**. Everything is saved in their browser, and the tab stays on the same decision when it updates
by itself. A decision with `ya` goes on top, alone in its card.
Each open decision carries **a letter** (A, B, C...) and each option **a number**, in page order, and that
is how the copied text arrives: `A. ¿Publico hoy o espero al lunes? → 1 · Hoy`. If the same questions also
have to go through somewhere else (a tool that asks from the phone, for example), get them with
`decisiones`: it gives them with their letter, in the same order and with the options numbered the same, so
that "A one" means the same in both places.
```bash
python3 "$GRESSO" decisiones "<ruta>"
# [{"letra": "A", "id": "t3", "title": "¿Publico hoy...?", "context": "...",
# "options": [{"text": "Hoy", "detail": "...", "recommended": true}, ...]}]
```
When they answer, close it: `estado t3=hecho:"eligió el lunes"`. The letters of the remaining ones shift, so
if you ask again through somewhere else, get them again.
What is `descartado` leaves the total: it is not work that remains, and leaving it counted sinks the
percentage for no reason. It stays written and crossed out, at the end with what is done, because knowing what
was decided against is information.
### 2. One single page per front
A person should never have to wonder which of their tabs is the right one. **If tracking for this front is
already open, do not create another: add to that one with `anadir`.** `crear` warns on the error output if it
sees another unfinished one in that folder or for that project, with its path and its percentage, and creates
the page anyway: if it is not the same front, carry on. If it is the same, delete the one you just created and
use the other.
The project is the git repository you are working in, or the one you name with `--proyecto`. To remember
across sessions, `crear` notes the page's path and its project in `~/.gresso/seguimientos.json` (another
location with the `GRESSO_REGISTRO` variable). It is a local file and never leaves the machine.
### 3. Create the file at a path that does not change
**No password or key in plain view.** If the person needs one, it goes in a button that copies it without
showing it: `{"texto": "Copiar la contraseña", "copiar": "..."}`. The script warns if it sees something that
looks like one in visible text, and even so the value is still inside the file: that page is not uploaded anywhere.
In the session's temporary folder if it is the rundown of a task, **never inside the project's code**. The
name carries no date or version number: the same tab has to serve from start to finish.
```bash
python3 "$GRESSO" crear "<carpeta temporal>/seguimiento.html" <<'EOF'
{
"titulo": "Migrar la web a Cloudflare",
"subtitulo": "Lo que queda para que el dominio sirva con HTTPS y despliegue solo.",
"parte": "Arrancando: todavía no he tocado el DNS.",
"fases": [
{"nombre": "Preparar", "tareas": [
{"texto": "Crear el token de API con los permisos justos", "estado": "haciendo"},
{"texto": "Conectar el repositorio a Pages"}
]},
{"nombre": "Comprobar", "tareas": [
{"texto": "Que el candado salga en el dominio y en www"}
]}
]
}
EOF
```
If the pipe gives trouble (or the JSON is long), write it to a file and pass it with `--datos archivo.json`,
which works the same in `crear` and in `anadir`. The input is read as UTF-8, and if it is not, as cp1252, so
accents and eñes arrive fine from Git Bash. The PowerShell 5.1 pipe turns them into `?` before they arrive and
they cannot be recovered: there, use `--datos` (the script warns).
The script prints the absolute path and nothing else. **Do not open the template or the generated HTML with the
file-reading tools**: they are hundreds of lines you do not need in context, and that is what `ver` is for.
### 4. Open it once, in front of them, and say so in one line
Open it yourself in the browser (`Start-Process "<ruta>"` on Windows, `open` on macOS, `xdg-open` on Linux),
without asking for permission and without just leaving the path written down for someone else to open by hand.
In the chat, **one single line**: what you are doing and that the page updates by itself. Never repeat the task
list in the terminal: they already have it in front of them.
The page **updates by itself**: each command writes `<ruta>.version.js` next to the HTML, the tab asks for it
every 5 seconds and reloads only if it changed. With no changes it neither reloads nor flickers, and on reloading
it keeps the scroll, what is folded, what is checked and what is typed. It does not reload while someone is typing
or has text selected. **Leave that file next to the HTML**: if you move it or delete it, the tab stops noticing.
### 5. Rewrite it every time you move forward, not at the end
This is the whole skill. When you close a step, when you start the next one, when you hit a block and when the
plan changes:
```bash
# cambiar estados (varios de una vez); con ":" detrás se pone la nota, y con ":" solo se borra
python3 "$GRESSO" estado "<ruta>" t1=hecho t2=haciendo "t5=bloqueado:falta la clave de API"
# subir a «Ya, sí o sí» lo que no puede esperar, o bajarlo a «Cuando puedas»
python3 "$GRESSO" estado "<ruta>" t4=ya t6=noya
# el parte de situación de arriba, en dos o tres líneas
python3 "$GRESSO" parte "<ruta>" "DNS ya apuntando. Esperando a que propague para probar el candado."
# tareas que aparecen por el camino (lo normal, no un fallo del plan)
python3 "$GRESSO" anadir "<ruta>" --fase "Comprobar" <<'EOF'
[{"texto": "Redirigir www al dominio sin www"}]
EOF
# recordar qué ids hay, sin cargar el HTML en el contexto
python3 "$GRESSO" ver "<ruta>"
# las decisiones abiertas, con su letra y en el orden de la página
python3 "$GRESSO" decisiones "<ruta>"
```
Each of those commands also rewrites **the date and time at the top**, which is the only thing that tells the
reader whether what they are looking at is current.
Two traps that turn it into a report without you noticing:
1. **Marking several tasks at once at the end.** If the page jumps from 20% to 100% in a single leap, it was of no
use while you were working.
2. **Not writing down what comes up.** New tasks are added when they appear; a percentage that only rises because
the plan got smaller is a lie.
### 6. When closing
Leave everything in its real state, including what was left undone and why. Tracking that ends with tasks in
`haciendo` forever is rubbish. If the task carries on tomorrow, **the file stays**: it is the only place that holds
what was missing.
If what you were tracking belongs to the project and not the session (what is left to build), the source is still
the project's (its list of goals, its `TODO.md` or whatever it uses): **the HTML is its view, it is regenerated when
the source changes and it never overrides it.** And if it is an internal document, it does not go up to a public repository.
## What the template already brings, and must not be touched
- **One single file, zero CDN.** It has to look the same with no internet.
- **System theme with no button**, light or dark through `prefers-color-scheme`, and readable on a phone.
- **At the very top, "Ya, sí o sí"**, only if some task carries `ya`: three at most, side by side on a big screen and
one under another on a phone, and one line if there are more.
- **Below, "Lo siguiente"**: what falls to the person reading, with a button that takes them to that step, and what the
agent is doing now. It comes out of the tasks by itself and is not written separately: it is enough to keep the states
current. While something remains in "Ya, sí o sí", the reader's line does not show, because it would repeat it. The
`parte` goes below what the agent is doing.
- **The big percentage figure, one single-colour bar and a sentence**: "31 de 60 tareas hechas. Quedan 29.", which is the
real question.
- **What they have to decide, one at a time and full width**, with the options as word-and-sentence tiles, the downside,
upside and cost of the chosen one, "Siguiente" and one single "Copiar respuestas" at the end.
- **What is stopped goes first** in what the agent is doing, with what is missing to unblock it.
- **The state is a loose bold word** ("Ahora", "Parado") and a checkbox. No pills, no coloured dots, nothing that pulses
and no mini charts: the page does not explain itself.
- **What is done, folded and at the end**, with its count: the question of whoever opens the page is what is left.
- **Type from 17 px up**, growing on big screens, and nothing below 16.
- **The time of the latest update in the header**, and the percentage in the tab title too. **If the file has gone 90
minutes without being written, it says so in red** ("lleva 2 h sin moverse") instead of keeping up the appearance of being
current: if you stop with tasks open, it will show.
- **It updates by itself and does not move you around**: it keeps the scroll on reload.
## The project's brand
With no brand, the page uses a neutral palette. With `--marca` it carries the project's logo, mascot, colours and font,
**without touching the HTML**:
```bash
python3 "$GRESSO" crear "<ruta>" --marca marca.json --datos datos.json
```
```json
{"nombre": "Mi proyecto", "logo": "logo.svg", "logoOscuro": "logo-claro.svg",
"mascota": "mascota.png", "pixelada": false,
"colores": {"acento": "#3E5BA9", "fondo": "#FAF9F6", "tinta": "#101A3D"},
"oscuro": {"fondo": "#0E1116", "tinta": "#EEF1F8"},
"letra": "Inter", "letraTitulos": "Montserrat"}
```
Everything is optional. Images are a file (relative to the JSON), an `<svg>` or a `data:`, and they end up inside the page,
which is still one single file. Colours: `fondo`, `tarjeta`, `tinta`, `texto`, `suave`, `acento`, `acentoTexto`, `sobreAcento`,
`botonSuave`, `botonSuaveTexto`, `linea`, `caja`, `exito`, `alerta` and `fondoBarra`. The font has to be installed: the page
downloads nothing.
To move an existing page to the current template, or change its brand, without losing anything:
```bash
python3 "$GRESSO" renovar "<ruta>" --marca marca.json
```
It keeps the tasks and their ids, leaves a copy in `<ruta>.bak`, and the open tab updates by itself without losing what is checked.
## Files
- `references/plantilla.html` - the page. It is copied, not edited by hand.
- `scripts/gresso.py` - creates and updates the data block without the HTML going through the model.