Token导航 LogoToken导航

Agent Skill · 研究检索

ts-reuse-review(ts 重用审查)

ts-reuse-review 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

ts-reuse-review 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 67,439。

总安装 245周安装 10GitHub Stars 4下载 79核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ts-reuse-review(ts 重用审查)
来源仓库:https://github.com/trancong12102/agentskills
仓库路径:skills/ts-reuse-review
安装命令:
npx skills add https://github.com/trancong12102/agentskills --skill ts-reuse-review
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/trancong12102/agentskills --skill ts-reuse-review

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

ts-reuse-review 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。适用于代码复用审查、模式识别和技术方案调研等研究检索类任务。

通过 GitHub 仓库安装,使用 npx skills add 命令添加指定技能。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/ts-reuse-review

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/trancong12102/agentskills --skill ts-reuse-rev…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

ts-reuse-review 怎么安装?

在终端执行 npx skills add https://github.com/trancong12102/agentskills --skill ts-reuse-review。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

ts-reuse-review 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

ts-reuse-review 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

ts-reuse-review 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

ts-reuse-review 用的人多吗?

公开数据是累计安装 245 次,近一周安装 10 次,下载 79 次,GitHub 4 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

ts-reuse-review 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
ts-reuse-review

ts 重用审查 · 本页

2454需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

TS Reuse Review

Scans a TypeScript/JavaScript diff for code that reinvents existing utilities. Reports a prioritized list of reuse opportunities — external libs (es-toolkit, date-fns, zod), ES2020+ native APIs, installed project libs (effect, remeda, ts-pattern, etc.), and already-existing internal helpers. Never applies edits.

Prerequisites

  • ripgrep — used for internal helper search. Install: brew install ripgrep or cargo install ripgrep.
  • ast-grep — structural pattern matching. Install: npm i -g @ast-grep/cli or brew install ast-grep.

If ast-grep is missing, fall back to ripgrep-only detection and flag the degraded mode in the report header. Do not abort.

Workflow

Do not read script source code. Run scripts directly and use --help for usage. Scripts live under scripts/ relative to this skill's directory.

Step 1: Determine review scope

If the scope is not already clear from the invocation, use AskUserQuestion:

  • Uncommitted changes (default) — staged, unstaged, and untracked TS/JS files
  • Branch diff — current branch vs a base branch
  • Specific commit — one changeset by SHA

Extract the list of changed .ts, .tsx, .js, .jsx, .mjs, .cjs files. Skip *.d.ts, generated files under **/dist/**, **/build/**, **/.next/**, **/node_modules/**, and test fixtures under **/fixtures/**.

Step 2: Detect installed project libraries

Run scripts/detect-libs.sh to scan package.json (plus workspace packages/*/package.json if monorepo) for relevant libs. It returns a JSON-ish list of installed libs grouped by domain:

  • general utils: es-toolkit, lodash-es, ramda, remeda, radash
  • date: date-fns, dayjs, luxon
  • schema: zod, valibot, yup, superstruct, arktype
  • async/effects: effect, neverthrow, rxjs, ts-pattern
  • http/query: ky, ofetch, axios, @tanstack/react-query, swr
  • collections: immer, immutable

The output decides the "prefer" tier for Step 5. Fixed targets (es-toolkit, date-fns, zod) stay in the catalog even when not installed — the report suggests installing them.

Step 3: Extract changed code regions

For each changed file, get the new-side hunks via git diff and keep only added or modified lines. Discard pure deletions and context. Store as {file, startLine, endLine, content} for pattern scanning.

Step 4: Run pattern scan

Run scripts/run-patterns.sh <file1> [<file2>...] on each changed file. The wrapper runs all rules in scripts/patterns/ with the correct language per extension (TypeScript for.ts/.js/.mjs/.cjs, Tsx for.tsx/.jsx — ast-grep has separate parsers). Only keep matches whose line range overlaps the changed region.

The catalog is ~80 rules grouped into 14 categories (collection shape, timing/async, equality/clone, date, schema, effect-specific, web runtime, node APIs, native supersedes, correctness bugs, React hooks, event/pub-sub, i18n, stringly). Load references/rule-categories.md when you need to understand which rules fire for a diff or are adding new rules.

If ast-grep is unavailable, fall back to the ripgrep heuristic patterns embedded in each rule's fallback_regex metadata field and mark matches as confidence: low.

Step 5: Cross-reference against catalogs

Load the references relevant to the hits from Step 4 — do not load every file:

Always load (catalog core):

  • references/external-libs.md — fixed external catalog (es-toolkit + date-fns + zod).
  • references/native-apis.md — ES2020+ through ES2025 natives (immutable array variants, Object.hasOwn, Promise.withResolvers, URL.canParse, Set operations, Iterator helpers).
  • references/project-libs.md — dynamic handling of installed libs from Step 2.

Load on match (progressive disclosure):

  • references/react-patterns.md — diff touches .tsx / .jsx files.
  • references/effect-patterns.md — effect in installed deps.
  • references/node-vs-web.md — wrangler.toml, vercel.json edge config, deno.json, or a file under workers/ / edge/ / functions/ is in the diff.
  • references/testing-patterns.md — diff includes test files AND vitest or jest is installed.
  • references/zod-patterns.md — any zod-family rule fires (email-regex, regex-uuid, regex-ipv4, regex-iso-datetime, zod-discriminated-union, url-validate-try, manual-schema-guard) and zod/valibot/yup/arktype is installed.
  • references/query-patterns.md — react-fetch-useeffect rule fires OR any of @tanstack/react-query / swr / @reduxjs/toolkit/query is installed.
  • references/form-patterns.md — react-hook-form / formik / @tanstack/react-form / @conform-to/react installed AND diff contains a React form component.
  • references/immer-immutability.md — nested-spread-update rule fires OR immer / use-immer / mutative installed.

This progressive-disclosure approach keeps the skill under the per-invocation context budget even as the catalog grows.

For each pattern match:

  1. If the primary replacement lives in a native API, recommend the native (highest priority — zero deps).
  2. Else if an installed project lib (from Step 2) has a canonical match, recommend that lib's import. Example: effect installed → prefer Effect.retry over es-toolkit retry.
  3. Else if a fixed external lib matches (es-toolkit/date-fns/zod), recommend the import and — if the lib is not installed — suggest bun add es-toolkit (or npm/pnpm equivalent detected from the lockfile).
  4. Drop the match if none apply.

Step 6: Internal helper dedup check

Before emitting any external replacement, run scripts/scan-internal-utils.sh <fn-name-candidates> to grep workspace util directories (src/**/utils/**, src/**/lib/**, packages/*/src/**, shared/**, common/**) for existing helpers with matching names or call signatures.

If a matching internal helper exists, replace the external recommendation with use existing: <path>:<line>. This prevents suggesting a new import when the project already has the util.

Step 7: Emit report

Output format — load references/output-format.md for the full template. Summary:

ts-reuse-review findings:

<P?>  <file>:<line>
      pattern: <short description>
      replace: <suggested replacement>
      confidence: high|medium|low
      why: <trigger source — catalog entry, installed lib, native API, internal helper>

summary: <N> findings (<breakdown by priority>)

Priority levels:

  • P1 — clear reinvention, replacement is a one-line import swap, reduces ≥5 lines.
  • P2 — reinvention but replacement changes the shape slightly (named args vs positional, different null handling).
  • P3 — stylistic preference (native vs lib, one lib vs another already installed).
  • Drop matches below P3 threshold to keep signal high.

End the report. Do not apply edits. Do not open files for modification.

Rules

  • Report only — Never invoke Edit, Write, or NotebookEdit. Output is text findings; the user or a downstream skill decides whether to apply changes. This makes the skill safe to run in parallel with other reviewers.
  • Scope to changed regions — Matches outside added/modified hunks are noise. Do not flag pre-existing code the user did not touch in this diff.
  • Prefer native > installed-lib > fixed-catalog — Order preserves dependency minimalism. A native API suggestion beats an es-toolkit suggestion even when es-toolkit is installed.
  • Check internal helpers before suggesting externals — A workspace that already has utils/chunk.ts should not be told to import chunk from es-toolkit. Reuse trumps install.
  • Suggest install only when the fixed-catalog lib is missing and no native/internal alternative exists — Avoid noisy "install es-toolkit" spam when a one-liner native works.
  • Do not flag trivial wrappers — A 3-line helper around a native call is not a reuse violation unless it duplicates an installed lib's behavior. Minimum threshold: reinvention ≥5 lines OR exact signature match to a catalog entry.
  • Merge duplicate findings per file — If the same reinvention appears on multiple lines of one file, collapse to one finding listing all line numbers.
  • Confidence calibration — high when ast-grep structural match + catalog signature match; medium when regex-only match or catalog signature match only; low when fallback regex heuristic or ambiguous shape.
  • Language scope — TS/JS only — Skip .py, .rs, .go, .md, .json, .yml. Extension enforcement happens in Step 1.
  • Never mutate workspace state — No writes to package.json, no bun install execution. Install suggestions are text-only.

平台分布

Codex

34.42%
按下载量换算27

Claude

29.9%
按下载量换算24

Cursor

22.3%
按下载量换算18

Gemini CLI

11.19%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills