---
paths:
  - "**/*.ts"
  - "**/*.tsx"
  - "**/*.js"
  - "**/*.jsx"
---
# TypeScript/JavaScript Automation in Pi

> This file extends `common/hooks.md` with TypeScript/JavaScript-specific automation guidance.

Pi extension events replace harness-specific hook configuration. Never assume formatter, lint, or task extensions are installed.

## After JavaScript or TypeScript Edits

Use the package manager and scripts established by the repository:

1. Run formatter or formatter-check commands on the affected scope when configured.
2. Run lint checks without silently auto-fixing unrelated files.
3. Run the configured TypeScript check for `.ts` and `.tsx` changes.
4. Run focused tests, then broader tests or builds when warranted.
5. Audit edited production files for stray `console.log` or debugger statements.

Do not install Prettier, ESLint, TypeScript, or another tool merely to satisfy this rule.

## Optional Extension Automation

A trusted Pi extension may automate checks using `tool_result` and may run final verification using `agent_settled`. Treat extension failures as real check failures, keep output visible, and avoid modifying files outside the requested scope.
