repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

AGENTS.md

Raw

Pi Extensions Workspace

Monorepo for Pi extensions. Extensions live in extensions/*.

Build System

mise is the singular interface. mise.toml is the source of truth.

Tasks

Task Command Description
List mise run list List extensions
Format mise run fmt Format repo
Lint mise run lint Verify formatting and lint
Test mise run test Run tests
E2E browsers mise run install-e2e-browsers Install Playwright E2E browsers
E2E review mise run e2e-diff-review Run diff-review headless browser E2E
Check mise run check Static extension checks
CI mise run ci Release gate (lint + test + check)
Changelog mise run changelog -- {name} Generate changelog for extension
README mise run readme -- {name} Generate/update README for extension
Demo mise run demo -- {name} Record demo GIFs
Release plan mise run release-plan -- {name} Preview release artifacts
Prepare mise run release-prepare -- {name} Generate release artifacts
Publish mise run publish -- {name} Publish prepared release artifacts
Goal expect mise run goal-expect [--idea] Run goal expect test

Invariant

mise run ci must pass before pushing. No exceptions.

Use mise run ... for listed repo tasks. Do not bypass mise when a task exists.

Escalation

If the build system itself (mise.toml, scripts, or tooling) blocks progress, escalate to a human. Do not work around mise or add ad-hoc scripts.

Tool Widget Rendering

Tool widgets must match Pi built-ins: compact by default, expanded details on app.tools.expand (ctrl+o by default). Collapsed renderResult output may show status, counts, paths, IDs, and tiny bounded summaries only. Full content, previews, snippets, verbose logs, structured bodies, and per-result lists require expanded === true. Expansion hints must use keyHint("app.tools.expand", "to expand"); do not use legacy expandTools.

Cross-platform Requirements

All extensions must work on Windows, macOS, and Linux. Do not add OS-scoped extensions. Do not rely on shell-specific helpers such as which, bash, sed, grep, or /tmp when Node APIs can do the job. If an extension uses platform tools, check their availability when the extension loads. Notify missing required tools with warning severity. Notify missing optional tools with info severity. Tests for platform-tool behavior must exercise the real extension/tool path with controlled fake binaries on PATH, not only mocked helpers.

Markdown Style

Use one sentence per line for prose. Keep existing semantic line breaks unless rewording the sentence. Let dprint handle Markdown/YAML structure; do not manually reflow paragraphs for visual width only.

Git Hooks

Managed via mise generate git-pre-commit. To reinstall after clone: mise generate git-pre-commit --write && mise generate git-pre-commit --hook pre-push --task pre-push --write.

Troubleshooting

If mise run tasks fail with command-not-found errors, run mise doctor. Common causes: mise not activated, shims missing, tool binary name mismatch.

Markdown source
File outline
# Pi Extensions Workspace

Monorepo for Pi extensions.
Extensions live in `extensions/*`.

## Build System

`mise` is the singular interface.
`mise.toml` is the source of truth.

### Tasks

| Task         | Command                              | Description                          |
| ------------ | ------------------------------------ | ------------------------------------ |
| List         | `mise run list`                      | List extensions                      |
| Format       | `mise run fmt`                       | Format repo                          |
| Lint         | `mise run lint`                      | Verify formatting and lint           |
| Test         | `mise run test`                      | Run tests                            |
| E2E browsers | `mise run install-e2e-browsers`      | Install Playwright E2E browsers      |
| E2E review   | `mise run e2e-diff-review`           | Run diff-review headless browser E2E |
| Check        | `mise run check`                     | Static extension checks              |
| CI           | `mise run ci`                        | Release gate (lint + test + check)   |
| Changelog    | `mise run changelog -- {name}`       | Generate changelog for extension     |
| README       | `mise run readme -- {name}`          | Generate/update README for extension |
| Demo         | `mise run demo -- {name}`            | Record demo GIFs                     |
| Release plan | `mise run release-plan -- {name}`    | Preview release artifacts            |
| Prepare      | `mise run release-prepare -- {name}` | Generate release artifacts           |
| Publish      | `mise run publish -- {name}`         | Publish prepared release artifacts   |
| Goal expect  | `mise run goal-expect [--idea]`      | Run goal expect test                 |

### Invariant

`mise run ci` must pass before pushing.
No exceptions.

Use `mise run ...` for listed repo tasks.
Do not bypass mise when a task exists.

### Escalation

If the build system itself (`mise.toml`, scripts, or tooling) blocks progress,
escalate to a human.
Do not work around `mise` or add ad-hoc scripts.

## Tool Widget Rendering

Tool widgets must match Pi built-ins: compact by default, expanded details on `app.tools.expand` (`ctrl+o` by default).
Collapsed `renderResult` output may show status, counts, paths, IDs, and tiny bounded summaries only.
Full content, previews, snippets, verbose logs, structured bodies, and per-result lists require `expanded === true`.
Expansion hints must use `keyHint("app.tools.expand", "to expand")`; do not use legacy `expandTools`.

## Cross-platform Requirements

All extensions must work on Windows, macOS, and Linux.
Do not add OS-scoped extensions.
Do not rely on shell-specific helpers such as `which`, `bash`, `sed`, `grep`, or `/tmp` when Node APIs can do the job.
If an extension uses platform tools, check their availability when the extension loads.
Notify missing required tools with warning severity.
Notify missing optional tools with info severity.
Tests for platform-tool behavior must exercise the real extension/tool path with controlled fake binaries on `PATH`, not only mocked helpers.

## Markdown Style

Use one sentence per line for prose.
Keep existing semantic line breaks unless rewording the sentence.
Let `dprint` handle Markdown/YAML structure; do not manually reflow paragraphs for
visual width only.

## Git Hooks

- `pre-commit` — runs `fmt` + `lint` + `test`
- `pre-push` — runs full `ci`

Managed via `mise generate git-pre-commit`.
To reinstall after clone:
`mise generate git-pre-commit --write && mise generate git-pre-commit --hook
pre-push --task pre-push --write`.

## Troubleshooting

If `mise run` tasks fail with command-not-found errors, run `mise doctor`.
Common causes:
mise not activated, shims missing, tool binary name mismatch.