oh-my-pi-typescript
v0.1.0
Published
TypeScript workflows for pi — test runner, error decoder, deps audit, monorepo nav, pre-commit guard, status line, /ts-review.
Readme
oh-my-pi-typescript
TypeScript workflows for pi, the
coding agent. One pi install brings three skills, two extensions, one
slash-command prompt, a settings preset, and a reproducible benchmark into
your project.
Part of the oh-my-pi reference set.
Distribution philosophy: CLI + skill files only, no MCP servers, no
wrappers around tools pi already knows (git, jq, rg, tsc, vitest).
What you get
| Type | Name | Cost | Purpose |
|------------|-------------------------|--------------------------------|------------------------------------------------------------------------------|
| skill | ts-test-runner | 573 tokens on-demand | Run a TS test suite once (non-watch). Invariants the agent keeps forgetting. |
| skill | ts-deps-audit | 664 tokens on-demand | Stateful deps audit: outdated / vulnerable / top-size. 7-craft registry. |
| skill | ts-monorepo-nav | 978 tokens on-demand | pnpm / turbo / npm-workspaces cheat sheet with the ...^N pitfall. |
| extension | ts-pre-commit-guard | always-on | Block git commit tool calls when type-check or tests would fail. |
| extension | ts-status-line | always-on | Footer status: active tsconfig + tsc version + Node runtime + engines check. |
| prompt | /ts-review | on invocation | Four-axis code review: types, side effects, tests, API surface. |
| preset | settings.json | — | compaction.keepRecentTokens: 40000, transport: "sse". |
| bench task | ts-find-bad-type | 5,238 tokens (measured) | Reproducible faux-provider benchmark. See § Measurements. |
Total token budget declared (pi.ohmypi.tokenBudget.onDemand): 2,215
tokens — the sum of the three skills when pi invokes all of them in one
turn. Extensions do not count toward the on-demand budget; they are loaded
as code at startup.
Install
# When this package is published:
pi install npm:oh-my-pi-typescript
# During development from a local checkout:
pi install -l file:./reference-packages/oh-my-pi-typescriptRequires @mariozechner/pi-coding-agent (pi's core). The five pi-bundled
cores are declared as peerDependencies: "*" so any pi ≥ 0.67 satisfies
them without a second install of pi-ai / pi-tui / typebox / etc.
Verify the install:
omp doctor # inventory skills / extensions / prompts
omp doctor -f json | jq .conflicts # 'none' on a clean setup
omp remeasure ./ --check # confirms SKILL.md budgets are in sync
omp bench ./ --runs 3 # re-run the bench task locallyUsing the resources
Skills (invoked by the agent when relevant)
pi autoloads the three SKILL.md files. You can also pull a skill
manually:
/skill:ts-test-runner
/skill:ts-deps-audit
/skill:ts-monorepo-navts-deps-audit ships a Node shebang script (scripts/ts-deps-audit)
following the terminalcp 7 craft rules
for stateful tools:
./scripts/ts-deps-audit summary # one-shot registry snapshot
./scripts/ts-deps-audit outdated --format json --top 10
./scripts/ts-deps-audit audit --severity high --lines 40 --strip-ansi
./scripts/ts-deps-audit help # craft #4: discoverable, machine-readable helpExtensions (active while pi runs)
ts-pre-commit-guardwatches everybashtool call. When the agent tries to rungit commitit first runs your project'stypecheck(orcheck:tests/check/npx tsc --noEmitfallback) andnpm test. On failure it returns{ block: true, reason: <tail of output> }so the agent sees why and can fix it in the same turn. Bypass for one call:pi --ts-pre-commit-guard-skip ....ts-status-linepopulates the footer with: the activetsconfig.json(marked with↑when discovered in an ancestor directory), the pinned TypeScript compiler version, and the current Node runtime. Whenpackage.json.engines.nodeis declared it is compared against the live Node; the status is tintedsuccesson match,warningon mismatch,dimotherwise. Disable:pi --ts-status-line-skip ....
Prompt /ts-review
/ts-review # reviews the staged diff
/ts-review packages/core/src # reviews a path or git pathspecOutput is a structured Markdown report with a severity-grouped findings
table (block / warn / note) plus a Clear section listing what was
checked and found OK — so the agent cannot fabricate findings to fill
space. See prompts/ts-review.md for the full
axis list.
Settings preset
pi.ohmypi.presets["settings.json"] recommends:
{
"compaction": { "keepRecentTokens": 40000 }, // pi default: 20000
"transport": "sse" // pi default: "sse"
}pi does not merge these automatically (silent edits to user settings are
a non-goal). omp doctor reports drift when your live
settings diverge; sync manually when you agree.
Measurements
Bench run, omp bench ./ --runs 3 --write, measured on Node 24.13:
| metric | mean | stddev | stddev % | |---------------|--------|---------|----------| | totalTokens | 5,238 | 0.00 | 0.00% | | promptTokens | 2,234 | 0.00 | 0.00% | | outputTokens | 89 | 0.00 | 0.00% | | successRate | 100.0% | — | — |
Reproducibility gate (concept-v0 §4.1): stddev(totalTokens) / mean < 5%.
Current result: 0.00%. The faux provider replays a scripted two-step
exchange so these numbers are deterministic across machines.
The task lives in bench/task-1.md with the fixture
under bench/fixtures/ts-bad-type/. Run it yourself:
omp bench ./ --runs 3 # view mean + stddev
omp bench ./ --runs 3 --write # stamp pi.ohmypi.bench.lastResultDisabling individual components
- Skill opt-out: delete or
.gitignoreitsskills/<name>/SKILL.md, or add"enableSkillCommands": falseto your pi settings to silence the/skill:namecommands entirely. - Extension opt-out:
pi --ts-pre-commit-guard-skip ...orpi --ts-status-line-skip ...for a single session; remove the entry frompi.extensionsin yourpackage.json/ settings to disable permanently. - Prompt opt-out: delete
prompts/ts-review.mdor run pi with--no-prompt-templates.
Uninstall the whole package:
pi uninstall npm:oh-my-pi-typescript # or `pi remove ...`, same commandCompatibility
- pi ≥ 0.67.68 (tested; older versions untested).
- Node ≥ 20 (extensions use top-level
for/awaitand ESM; package declares"type": "module"). - TypeScript projects with a reachable
tsconfig.json. The extensions remain inert on non-TS projects rather than erroring.
Layout
oh-my-pi-typescript/
├── package.json # pi manifest (pi.ohmypi.{category,tokenBudget,presets,bench})
├── skills/
│ ├── ts-test-runner/SKILL.md
│ ├── ts-deps-audit/{SKILL.md, scripts/ts-deps-audit, bench/task-1.md}
│ └── ts-monorepo-nav/SKILL.md
├── extensions/
│ ├── ts-pre-commit-guard/{index.ts, util.ts, test/*.test.ts}
│ └── ts-status-line/{index.ts, util.ts, test/*.test.ts}
├── prompts/
│ ├── ts-review.md
│ └── test/load.test.ts
├── bench/
│ ├── task-1.md
│ └── fixtures/ts-bad-type/src/app.ts
└── test/manifest.test.ts # schema + preset + peerDependencies pinsEach extension follows pi loader rule 2 (subdirectory with index.ts)
so helper files stay at extensions/<name>/util.ts instead of being
mis-detected as separate extensions. Run npm test from the monorepo
root to exercise 76 tests across this atom alone.
License
MIT
