# Mindtape

Tasks as code. A tracker in your repo, one Typst file per task, checked against your own rules. Write rules in `.mindtape/config.toml`, and `mt check` runs them over every task and commit.

[Get started](https://mlavrinenko.github.io/mindtape/quickstart/index.md) · [How it works](https://mlavrinenko.github.io/mindtape/concepts/index.md)

Here's a real task.

source · throttle-failed-logins-per-ip.typ

````typ
#import "@local/mindtape:0.5.0": *
#show: task.with(
  title: "Throttle failed logins per IP",
  kind: "feat",
  priority: ice(impact: 7, confidence: 0.7, ease: 4),
  status: proposed(2026, 9, 28),
  estimate: (src-files: 2),
  tags: ("stateless",),
  links: depends-on("add-redis-client.typ"),
)

== AS-IS
Login answers as fast as a script can guess, with no limit per IP.

+ Run `for i in $(seq 50); do curl -so /dev/null -w '%{http_code} ' -d user=ada -d password=x localhost:8080/login; done`.
+ 🔴 It prints `401` fifty times. A script can guess passwords as fast as the server answers.

== TO-BE
- 🟢 After 10 failed logins from one IP in 10 minutes, `/login` returns `429` with a `Retry-After` header.

```sh
$ for i in $(seq 11); do curl -so /dev/null -w '%{http_code} ' -d user=ada -d password=x localhost:8080/login; done
401 401 401 401 401 401 401 401 401 401 429
$ curl -si -d user=ada -d password=x localhost:8080/login | grep -i '^retry-after:'
retry-after: 600
```

== Changes
- `src/auth/limiter.rs`, new: count failures per IP in Redis, each count expiring after 10 minutes.
- `src/auth/login.rs`: ask the limiter before checking the password, and record each failure.

== Alternatives
- A counter in process memory. Each replica would count on its own, so three replicas would allow 30 tries.

== Out of scope
- Locking accounts by username, which needs its own unlock flow.
````

And here’s how `mt ls` lists it, with the rest of the backlog.

terminal

```
$ mt ls
SLUG#  STATUS    READY       PRIORITY  DUE         TITLE
zpz    proposed  ▶ ready     🔴 red    2026-10-02  Index the orders by customer
qre    wip       ▶ ready     🟡 amber              Reject expired sessions on token refresh
05c    proposed  ▶ ready     🟡 amber  2026-10-05  Rotate the JWT signing key
ygv    proposed  ▶ ready     🟡 amber  2026-10-03  Document the webhook retry policy
re8    proposed  ▶ ready     🟡 amber              Add a Redis client to the app state
8f7    wip       ▶ ready     🟡 amber              Harden session tokens
4ze    proposed  ▶ ready     🟢 green  2026-10-20  Replace the deprecated search client
9ds    proposed  🔒 blocked  🟡 amber              Verify webhooks with the acme-pay SDK
2q0    proposed  🔒 blocked  🟢 green              Throttle failed logins per IP

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

The same file also typesets as a document.

## Bring your own rules

No rule is hardcoded in Mindtape. Every check is a few lines of config, either yours or from the `mindtape:tasks` pack that ships alongside. Here’s what `mt` says when a task breaks one.

| Recipe | What it does | What `mt` prints |
| --- | --- | --- |
| [Split oversized tasks](https://mlavrinenko.github.io/mindtape/split-oversized-tasks/index.md) | Cap how many source files a task may touch when it takes judgment, so a big design gets split before it’s filed. | `error: <new task from template 'task'>:2: rules.judgment-stays-small: split the decision from the mechanical edits, so each task plans 5 source files or fewer` |
| [Require a task shape](https://mlavrinenko.github.io/mindtape/require-a-task-shape/index.md) | Refuse a task that doesn’t say where it starts, what done looks like and which files change. | `error: missing required slots: 'to-be', 'changes', 'out-of-scope'` |
| [Start titles with a verb](https://mlavrinenko.github.io/mindtape/start-titles-with-a-verb/index.md) | Refuse a task whose title doesn’t start with a verb, so each line of a list says what the task does. | `error: <new task from template 'task'>:2: rules.start-title-with-verb: start the title with an imperative verb` |
| [Tie work to your goals](https://mlavrinenko.github.io/mindtape/tie-work-to-goals/index.md) | Make every task say how it serves your goals, and refuse one that helps none of them. | `error: <new task from template 'task'>:4: rules.goals: the task helps no goal; if nothing justifies it, cancel it` |
| [Limit work in progress](https://mlavrinenko.github.io/mindtape/limit-work-in-progress/index.md) | Allow one milestone and one task in progress, and refuse to start a task before the tasks it depends on are done. | `error: tasks/add-redis-client.typ:2: rules.one-task: finish the task in progress before you start another` |
| [Wait on upstream](https://mlavrinenko.github.io/mindtape/wait-on-upstream/index.md) | Hold a task until a command says the release it needs has landed, and free it the moment it has. | `error: status requires an unblocked task: 'wip'` |
| [Trace commits to tasks](https://mlavrinenko.github.io/mindtape/trace-commits-to-tasks/index.md) | Refuse a commit that doesn’t point at a task, then ask which tasks changed a file before you edit it. | `error: .git/COMMIT_EDITMSG: commits.rules.name-task-in-refs-trailer: name the task this commit works on in a` `Refs: <stem>` `footer` |

## The elephant in the room: Typst vs Markdown + frontmatter

Why pick [Typst](https://typst.app/) over Markdown to power a local task tracker? Here are a few reasons.

1. **Language server autocompletion.** `task` declares every field as a named parameter, so your editor completes field names and flags a misspelled one.
2. **Shared helpers.** `#import` your own Typst module to fill tasks the way you like.
3. **Computed fields.** Fill a field with an expression, like `due: release - duration(days: 14)`. Change `release` in your shared module, and every deadline changes.
4. **Links that don’t rot.** A link is a path `mt check` resolves, so a dead one fails the check. `mt mv` renames a task and rewrites every link to it.
5. **Custom validators.** Bring your own checks by writing a Typst function. See [Self-validating tasks](https://mlavrinenko.github.io/mindtape/self-validating-tasks/index.md).

[tinymist](https://myriad-dreamin.github.io/tinymist/) helps with autocompletion and highlights issues:

tinymist 0.14.10 · `tasks/fix-the-login-redirect.typ`

```typ
#import "@local/mindtape:0.4.0": *

#show: task.with(
  titel: "Fix the login redirect",
  status: proposed(2026, 7, 6),
  
)

A signed-in user who opens the sign-in page lands on the form again.
```

Fields offered at line 6: `assignee`, `difficulty`, `due`, `estimate`, `id`, `kind`, `links`, `priority`, `recur`, `reviewed`, `start`, `tags`, `title`, `waits-on`.

- error at `tasks/fix-the-login-redirect.typ:4:3`: unexpected argument: titel

## For people and for agents

`mt ls` prints a table for you to read, and JSON, CSV or a bare list of paths for scripts. When `mt` refuses a command, it exits non-zero and says what to fix, so an agent can read the error and correct its own work. See [For AI agents](https://mlavrinenko.github.io/mindtape/agents/index.md) to drive `mt` from one.
