# Priority

How priority and difficulty work as numbers on a configured scale, set by hand or scored by a framework.

A task’s `priority` holds a number on a scale. `mt` labels each number with the band it falls in, and sorts and filters by the number. You can set the number by hand, such as `priority: 7`, or let a framework compute it from inputs like impact and effort. A hand-set number takes seconds. A framework takes more input, but it scores every task on the same scale. You can then compare their scores.

## Scale and bands

The default scale runs from 0 to 9. Each band is a `[[tasks.priority.bands]]` entry:

| `label` | `min`–`max` | `glyph` | `color` |
| --- | --- | --- | --- |
| `low` | 0–2 | 🟢 | `green` |
| `normal` | 3–6 | 🟡 | `yellow` |
| `high` | 7–9 | 🔴 | `red` |

`[tasks.priority]` sets the scale with `kind` (`int` or `real`), `min` and `max`. `required` takes a filter that selects the tasks that must have a priority. Bands you declare replace the default list. `mt config show --defaults` prints the default values, and [Configuration](https://mlavrinenko.github.io/mindtape/config/index.md) lists every key.

## Difficulty

`difficulty` is a second number with the same `kind`, `min`, `max` and `required` keys, under `[tasks.difficulty]`. Its scale runs from 0 to 9, and it’s labeled by anchors instead of bands. A value between two anchors takes the lower anchor’s label:

| `value` | `label` | `glyph` | `color` |
| --- | --- | --- | --- |
| 0 | `junior` | 🟢 | `green` |
| 3 | `mid` | 🔵 | `cyan` |
| 6 | `senior` | 🟡 | `yellow` |
| 9 | `staff` | 🔴 | `red` |

## Frameworks

A framework computes the priority from inputs you fill in on the task. This project enables ICE:

```toml
# examples/priority/.mindtape/config.toml: score priority with ICE, and refuse a raw number
[tasks.priority]
framework = "ice"
allow-manual = false
```

Then a task calls the framework instead of giving a number:

```typ
// tasks/add-rate-limits-to-the-public-api.typ: an ICE call
  priority: ice(impact: 10, confidence: 0.9, ease: 9),
```

`mt` computes the score and labels it with its band. `--sort priority` and a filter such as `priority >= 7` read the score:

```
$ mt ls --columns title,priority --sort priority:desc
TITLE                              PRIORITY
Add rate limits to the public API  🔴 high
Fix the typo in the signup email   🟢 low
Rename the billing tables          🟢 low

3 of 3 tasks · default view (!terminal && (miss(start) || start <= now()))
```

`allow-manual` decides whether `mt` still accepts a raw number while a framework is on. It defaults to `true`. With `false`, every task must call the framework, so `mt` refuses a raw number and exits `1`:

```
$ mt set fix-the-signup-email-typo priority=8
error: tasks/fix-the-signup-email-typo.typ:6: priority: `8` is a manual priority but framework `ice` is strict (allow-manual = false)
```

To adopt exactly this setup without writing the keys, extend the [`mindtape:ice`](https://mlavrinenko.github.io/mindtape/packs/index.md#the-rules-in-mindtape-ice) pack. It sets `framework`, `allow-manual = false`, `required` and `example`, and the default scale and bands stay.

[Templates & slots](https://mlavrinenko.github.io/mindtape/templates/index.md) shows how `mt add` fills a framework’s inputs.

## Built-in frameworks

| Framework | Inputs | Scoring |
| --- | --- | --- |
| `ice` | `impact` number 1–10, `confidence` number 0–1, `ease` number 1–10 | `round(impact * confidence * ease * 0.09)`: Impact and ease are guesses, and confidence says how far to trust them. Confidence multiplies. A shaky guess then loses score in proportion to how shaky it is. |
| `rice` | `reach` number 0–10, `impact` number 1–5, `confidence` number 0–1, `effort` number 1–10 | `round(reach * impact * confidence / effort * 0.18)`: ICE with reach multiplied in and effort divided out. A small change that reaches every user can outrank a large one that reaches few. |
| `wsjf` | `cost_of_delay` number 0–10, `job_size` number 1–10 | `round(cost_of_delay / job_size * 0.9)`: Weighted shortest job first: value per unit of size. Of two equally valuable tasks, the smaller one ranks higher. |
| `eisenhower` | `urgent` bool, `important` bool | 🔥 `do`, 📅 `schedule`, 🤝 `delegate`, 🗑 `delete`: The four combinations of urgency and importance make four categories. The category sets the priority. The score only places it on the numeric scale. |
| `moscow` | `level` enum `must` / `should` / `could` / `wont` | 🔴 `must`, 🟠 `should`, 🟡 `could`, ⚪ `won't`: A commitment level: `must` blocks the release and `wont` records a refusal. It takes one enum, because there is nothing to compute. |

To write your own, declare `[tasks.priority.frameworks.<name>]` with its inputs, their types and bounds, and a score formula or categories. Then name it in `[tasks.priority] framework = "<name>"`, or `mt check` refuses a task that calls it with `no priority framework is configured`. `crates/mindtape/src/framework/frameworks.toml` sets the built-ins the same way, and you can override any of their keys. A task calls your framework with `framework("name", input: value, ...)`. A framework with categories instead of a formula sorts each task into a category, and each category has a fixed score on the scale.
