typescript-compile-check-resilient-fallback
Screenshots
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "typescript-compile-check-resilient-fallback" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-811fb83115c910bcf35de35c14a65ab6d78d2d79b3a100adba350109d8562cb6. Verify the upstream source and version against https://github.com/HKUDS/OpenSpace before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
A resilient workflow to run TypeScript compile checks (tsc --noEmit), gracefully falling back when npx or direct binary invocation fails, and distinguishing preexisting errors from newly introduced ones.
Introduction source: third_party · HKUDS · 0.0.1 Reference
SkillPi interpretation
- Tasks
- A resilient workflow for running TypeScript compile checks (tsc --noEmit) that falls back gracefully when npx or direct binary invocations fail, and distinguishes pre-existing errors from newly introduced ones.
- Testing
- Not tested
Browse files
Frontmatter
name: typescript-compile-check-resilient-fallback
description: A resilient workflow for running TypeScript compile checks (tsc --noEmit) that falls back gracefully when npx or direct binary invocations fail, and distinguishes pre-existing errors from newly introduced ones.TypeScript Compile-Check Resilient Fallback
Use this workflow whenever you need to verify that TypeScript files compile
cleanly after creating or modifying them, especially in environments where
npx or direct ./node_modules/.bin/tsc invocations may return unexpected
errors.
Step 1 — Attempt Primary Invocation
Run the compile check with run_shell using the standard approach:
npx tsc --noEmit
or, if you already know the project root:
./node_modules/.bin/tsc --noEmit
Evaluate the result:
- If it exits cleanly (exit code 0, no unexpected output) → done.
- If it exits with TypeScript diagnostic errors → proceed to Step 3.
- If it exits with an unknown / tool-level error (e.g.,
npxnot found, permission denied, spawn error, unclear non-zero exit unrelated to TS diagnostics) → proceed to Step 2.
Step 2 — Fallback via shell_agent
When the primary invocation fails with an unknown error, delegate to
shell_agent so it can resolve environment issues automatically:
Task: "From the project directory
<PROJECT_DIR>, runnode node_modules/typescript/bin/tsc --noEmitand report all TypeScript diagnostic errors."
Example shell_agent task string:
From /path/to/project, run:
node node_modules/typescript/bin/tsc --noEmit
Capture the full stdout/stderr output and return it.
shell_agent will handle PATH issues, working-directory changes, and
retry on transient failures automatically.
Step 3 — Filter Pre-Existing Errors
TypeScript projects frequently have pre-existing errors in files you did not touch. To avoid false regressions:
- Identify the baseline error count for the project (e.g., determined at task start or documented in task context). A common baseline is 11 pre-existing errors in unrelated files.
- Collect the full diagnostic list from tsc output.
- Filter to keep only errors whose file path matches a file you created or modified in this task.
- Evaluate:
- Zero errors in your new/modified files → ✅ no regression introduced.
- One or more errors in your new/modified files → ❌ fix them before proceeding.
Filtering heuristic (pseudocode)
all_errors = parse_tsc_output(tsc_stdout)
my_files = [list of files created/modified in this task]
new_errors = [e for e in all_errors if e.file in my_files]
if len(new_errors) == 0:
print("✅ No new TypeScript errors introduced.")
else:
for err in new_errors:
print(f"❌ {err.file}:{err.line} — {err.message}")
raise Exception("Fix TypeScript errors before continuing.")
Step 4 — Fix and Re-Run
If new errors are found:
- Fix the errors in your file(s).
- Repeat from Step 1.
Decision Tree Summary
run_shell: npx tsc --noEmit
│
├─ clean exit ──────────────────────────────► ✅ Done
│
├─ TS diagnostic errors ────────────────────► Step 3 (filter)
│
└─ unknown/tool error
│
└─ shell_agent: node .../tsc --noEmit
│
├─ TS diagnostic errors ────► Step 3 (filter)
└─ clean exit ──────────────► ✅ Done
Notes
- Always run tsc from the project root (where
tsconfig.jsonlives). - The
node node_modules/typescript/bin/tscinvocation is the most portable fallback because it bypassesnpx, shell PATH lookups, and binary permission issues entirely. - When the baseline error count is unknown, run tsc before making any changes and record the count; that becomes your baseline.
- Only report/act on errors in files you own; never attempt to fix pre-existing errors in third-party or unrelated project files unless explicitly asked.
Current listing version
0.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决 TypeScript 项目修改后编译验证的常见工程痛点
- 具备完整的降级机制和错误过滤逻辑,实用性强
Highlights
- 触发描述清晰完整,覆盖多种调用方式和异常场景
Areas to improve
-
缺少显式 When to Use 章节 Reported severity: Minor
文档开头已描述使用场景,但未使用标准章节标题
Recommendation: 建议增加显式的 'When to Use' 章节以提升规范性
Highlights
- 步骤划分清晰,包含决策树和伪代码示例
- frontmatter 完整,结构易于理解
Highlights
- 工具调用路径明确,覆盖主要异常场景
- 具备降级机制和错误过滤,执行流程健壮
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 3, 10, 20, 32, 104
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.