repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

docs/automation.md

Raw

Automation guide

Task selection, task authoring, and Git hook setup for pi-ext. The always-loaded rules remain in AGENTS.md.

Task discovery

Run mise tasks --all to list root and extension-local tasks. Use monorepo-root paths when referring to tasks from automation or documentation:

Task-name groups and wildcards select tasks; they do not create dependencies or ordering. Use mise task info <task> for task details, mise tasks deps <task> for declared dependency edges, and mise run --dry-run <task> to inspect execution. Run mise tasks validate after changing the root config. Run mise -C extensions/<name> tasks validate after changing an extension config.

Choosing tasks

Need Command
Install exact locked dependencies mise run //:install
Regenerate package-lock.json mise run //:lock
Format the repository mise run //:fmt
Verify repository formatting and lint mise run //:lint
Run the complete test suite once mise run //:test
Run one extension's tests mise run //extensions/<name>:test
Lint one extension mise run //extensions/<name>:lint
Typecheck and statically check one extension mise run //extensions/<name>:check
Typecheck and statically check all extensions mise run //:check
Run all benchmarks sequentially mise run //:bench
Run all browser E2E suites mise run //:e2e
Run the release gate mise run //:ci

Use mise run //:test -- extensions/<name> and mise run //:build -- <name> only when implementing a local task or diagnosing its root delegate. Normal agent workflows should use the extension-local task names.

Root operation tasks are //:list, //:changelog, //:readme, //:release-plan, //:release-prepare, and //:publish. Invoke one with mise run, passing extension names after --, for example mise run //:readme -- angel.

Task authoring

Use depends for prerequisites so Mise can deduplicate shared work and schedule independent dependencies concurrently. Use structured task references instead of spawning nested Mise processes:

run = [{ task = "//:test", args = ["extensions/angel"] }]

A run array is sequential. Use { tasks = ["check", "lint"] } for an explicit parallel stage inside that sequence. Structured task references execute their own dependencies but do not appear as edges in mise tasks deps. Use a nested mise run command only when a required CLI scheduler option, such as --jobs 1, has no structured-task equivalent.

Do not set raw = true unless a task requires stdin. Raw tasks serialize against other tasks and disable output redaction.

Git hook setup

Hooks are managed through mise generate git-pre-commit. Reinstall them with mise generate git-pre-commit --write, then mise generate git-pre-commit --hook pre-push --task pre-push --write. The pre-commit and pre-push tasks in mise.toml define their execution.

Markdown source
File outline
# Automation guide

Task selection, task authoring, and Git hook setup for `pi-ext`.
The always-loaded rules remain in [AGENTS.md](../AGENTS.md).

## Task discovery

Run `mise tasks --all` to list root and extension-local tasks.
Use monorepo-root paths when referring to tasks from automation or documentation:

- `//:test` addresses a root task.
- `//extensions/angel:test` addresses an extension task.
- `//extensions/...:bench` selects a task across matching extension config roots.

Task-name groups and wildcards select tasks; they do not create dependencies or ordering.
Use `mise task info <task>` for task details, `mise tasks deps <task>` for declared dependency edges, and `mise run --dry-run <task>` to inspect execution.
Run `mise tasks validate` after changing the root config.
Run `mise -C extensions/<name> tasks validate` after changing an extension config.

## Choosing tasks

| Need | Command |
| --- | --- |
| Install exact locked dependencies | `mise run //:install` |
| Regenerate `package-lock.json` | `mise run //:lock` |
| Format the repository | `mise run //:fmt` |
| Verify repository formatting and lint | `mise run //:lint` |
| Run the complete test suite once | `mise run //:test` |
| Run one extension's tests | `mise run //extensions/<name>:test` |
| Lint one extension | `mise run //extensions/<name>:lint` |
| Typecheck and statically check one extension | `mise run //extensions/<name>:check` |
| Typecheck and statically check all extensions | `mise run //:check` |
| Run all benchmarks sequentially | `mise run //:bench` |
| Run all browser E2E suites | `mise run //:e2e` |
| Run the release gate | `mise run //:ci` |

Use `mise run //:test -- extensions/<name>` and `mise run //:build -- <name>` only when implementing a local task or diagnosing its root delegate.
Normal agent workflows should use the extension-local task names.

Root operation tasks are `//:list`, `//:changelog`, `//:readme`, `//:release-plan`, `//:release-prepare`, and `//:publish`.
Invoke one with `mise run`, passing extension names after `--`, for example `mise run //:readme -- angel`.

## Task authoring

Use `depends` for prerequisites so Mise can deduplicate shared work and schedule independent dependencies concurrently.
Use structured task references instead of spawning nested Mise processes:

```toml
run = [{ task = "//:test", args = ["extensions/angel"] }]
```

A `run` array is sequential.
Use `{ tasks = ["check", "lint"] }` for an explicit parallel stage inside that sequence.
Structured task references execute their own dependencies but do not appear as edges in `mise tasks deps`.
Use a nested `mise run` command only when a required CLI scheduler option, such as `--jobs 1`, has no structured-task equivalent.

Do not set `raw = true` unless a task requires stdin.
Raw tasks serialize against other tasks and disable output redaction.

## Git hook setup

Hooks are managed through `mise generate git-pre-commit`.
Reinstall them with `mise generate git-pre-commit --write`, then `mise generate git-pre-commit --hook pre-push --task pre-push --write`.
The `pre-commit` and `pre-push` tasks in [mise.toml](../mise.toml) define their execution.