oh-my-pi-typescript

TypeScript workflows for pi — test runner, error decoder, deps audit, monorepo nav, pre-commit guard, status line, /ts-review.

Package details

extensionskillprompt

Install oh-my-pi-typescript from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:oh-my-pi-typescript
Package
oh-my-pi-typescript
Version
0.1.0
Published
Apr 20, 2026
Downloads
133/mo · 9/wk
Author
jsh.itsolution
License
MIT
Types
extension, skill, prompt
Size
56.7 KB
Dependencies
0 dependencies · 5 peers
Pi manifest JSON
{
  "skills": [
    "./skills"
  ],
  "extensions": [
    "./extensions"
  ],
  "prompts": [
    "./prompts"
  ],
  "ohmypi": {
    "category": "workflow",
    "tokenBudget": {
      "alwaysOn": 0,
      "onDemand": 2215
    },
    "presets": {
      "settings.json": {
        "compaction": {
          "keepRecentTokens": 40000
        },
        "transport": "sse"
      }
    },
    "bench": {
      "tasks": [
        "./bench/task-1.md"
      ],
      "lastResult": {
        "tokens": 5238,
        "successRate": 1,
        "measuredAt": "2026-04-20T13:58:26.340Z"
      }
    }
  }
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

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-typescript

Requires @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 locally

Using 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-nav

ts-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 help

Extensions (active while pi runs)

  • ts-pre-commit-guard watches every bash tool call. When the agent tries to run git commit it first runs your project's typecheck (or check:tests / check / npx tsc --noEmit fallback) and npm 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-line populates the footer with: the active tsconfig.json (marked with when discovered in an ancestor directory), the pinned TypeScript compiler version, and the current Node runtime. When package.json.engines.node is declared it is compared against the live Node; the status is tinted success on match, warning on mismatch, dim otherwise. 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 pathspec

Output 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.lastResult

Disabling individual components

  • Skill opt-out: delete or .gitignore its skills/<name>/SKILL.md, or add "enableSkillCommands": false to your pi settings to silence the /skill:name commands entirely.
  • Extension opt-out: pi --ts-pre-commit-guard-skip ... or pi --ts-status-line-skip ... for a single session; remove the entry from pi.extensions in your package.json / settings to disable permanently.
  • Prompt opt-out: delete prompts/ts-review.md or run pi with --no-prompt-templates.

Uninstall the whole package:

pi uninstall npm:oh-my-pi-typescript    # or `pi remove ...`, same command

Compatibility

  • pi ≥ 0.67.68 (tested; older versions untested).
  • Node ≥ 20 (extensions use top-level for/await and 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 pins

Each 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