name: type-check description: Run this after finishing edits to .ts files to catch and fix type errors in the current package and its dependents.
Type Check
Context
- Refer to
AGENTS.mdto identify dependencies between packages.
Step 1: Current Package
- Identify Package: Determine
pkg_namefrom the modified.tsfile paths. - Run & Fix: Execute
pnpm *pkg_name* types. - Loop: If errors occur, fix them and re-run until the current package passes.
Step 2: Dependent Packages
- Identify Dependents: Check
AGENTS.mdfor any packages that depend onpkg_name. - Verify Downstream: For each affected dependent package (
dep_pkg):- Execute
pnpm *dep_pkg* types. - Fix: If your changes in
pkg_namebroke types indep_pkg, navigate todep_pkgand fix the call sites. - Loop: Repeat until all affected packages pass.
- Execute
Step 3: Reporting
- Provide a summary of all packages checked and any cross-package fixes applied.
- If a fix in a dependent package requires a complex architectural change, stop and ask the user.
Usage Note
Strictly target .ts files. Do not run for other file types.