跳到正文
cccskills
免费在 GitHub 公开

ts-performance-rules

TypeScript and JavaScript performance and code-quality rules, usable in any framework. Use when writing, reviewing, or refactoring hot paths, data-structure choices, async flows, or bundle-size-sensitive code. Triggers include "optimize this function", "too slow", "reduce allocations", "bundle size", "lazy load", "speed up imports", or general code review of utilities and services.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(25)

  • SKILL.md3.3 KB
  • rules/async-cheap-condition-before-await.md1.2 KB
  • rules/async-defer-await.md2.2 KB
  • rules/async-dependencies.md1.3 KB
  • rules/async-parallel.md650 B
  • rules/bundle-analyzable-paths.md2.3 KB
  • rules/bundle-barrel-imports.md2.7 KB
  • rules/bundle-conditional.md966 B
  • rules/bundle-defer-third-party.md924 B
  • rules/bundle-dynamic-imports.md795 B
  • rules/bundle-preload.md1.1 KB
  • rules/js-batch-dom-css.md3.2 KB
  • rules/js-cache-function-results.md1.9 KB
  • rules/js-cache-property-access.md536 B
  • rules/js-cache-storage.md1.6 KB
  • rules/js-combine-iterations.md768 B
  • rules/js-early-exit.md1.1 KB
  • rules/js-flatmap-filter.md1.4 KB
  • rules/js-hoist-regexp.md1.0 KB
  • rules/js-index-maps.md850 B
  • rules/js-length-check-first.md1.7 KB
  • rules/js-min-max-loop.md2.2 KB
  • rules/js-request-idle-callback.md2.6 KB
  • rules/js-set-map-lookups.md532 B
  • rules/js-tosorted-immutable.md1.7 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

TypeScript performance rules

A rule catalog for TypeScript/JavaScript code in this repository. Rules are framework-neutral: they apply to the CLI, the agent engines, the gateway, and the web apps. Each rule file states its impact band, an incorrect/correct pair, and the reasoning.

Derived from Vercel's react-best-practices rule catalog (MIT); the React-component-specific rules are intentionally not part of this skill.

Rule index

Plain JavaScript efficiency (js-*.md)

RuleApplies when
js-early-exitLoops keep scanning after the answer is known
js-length-check-firstCheap guards can precede expensive calls
js-set-map-lookupsArrays are scanned inside loops for membership
js-index-mapsRepeated lookups rebuild the same index
js-flatmap-filterfilter().map() (or the reverse) makes two passes
js-combine-iterationsMultiple loops over the same array can share one pass
js-hoist-regexpRegex literals or constructions sit inside hot loops
js-min-max-loopMath.min(...bigArray) style spreads blow the stack or re-scan
js-cache-function-resultsPure functions recompute the same inputs
js-cache-property-accessDeep property chains are read repeatedly in loops
js-cache-storagelocalStorage/sessionStorage reads sit in hot paths
js-batch-dom-cssDOM style reads/writes alternate and force layout thrash
js-request-idle-callbackNon-urgent work blocks interaction
js-tosorted-immutable.sort() mutates arrays that callers own

Async structure (async-*.md)

RuleApplies when
async-cheap-condition-before-awaitA cheap guard sits after an expensive await
async-defer-awaitIndependent awaits run serially for no reason
async-parallelIndependent promises could run through Promise.all
async-dependenciesA chain of awaits hides which steps truly depend on each other

Bundle size (bundle-*.md)

RuleApplies when
bundle-barrel-importsImports pull whole barrel files for one symbol
bundle-conditionalLarge dependencies load for features that are rarely enabled
bundle-defer-third-partyThird-party SDKs load eagerly at startup
bundle-dynamic-importsRare code paths could be import() splits
bundle-preloadKnown-next navigations could preload their chunks
bundle-analyzable-pathsDynamic import paths are built in ways bundlers cannot trace

How to apply

  1. Pick rules by the code's actual shape, not by keyword match alone; the impact band in each rule's frontmatter says how much it typically matters.
  2. Apply the smallest change that satisfies the rule; do not restructure working code beyond the rule's scope.
  3. For repository-specific constraints, the nearest AGENTS.md and the package's own tests win over these general rules.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

中文简介正在准备中。当前显示原文说明。

PyModel/pythinker-code292026年10月18日 更新

Use when developing in packages/agent-core-v2 (the DI × Scope agent engine) — adding or modifying a domain Service, choosing a LifecycleScope, wiring DI dependencies, splitting a domain across scopes, owning or migrating a config section, gating behavior behind an experimental flag, raising coded errors, working on the permission system, writing DI/Scope tests, porting business logic from agent-core (v1) to v2, triaging a main-branch commit against v2, or exposing a v2 domain over server-v2 while keeping the /api/v1 wire contract compatible with released clients. Self-contained guide organized by development stage (orient → design → implement → test → verify) plus align workflows for v1→v2 migration, main-branch commit triage, and server-v2 wire exposure; each file carries the rules, examples, and red lines for its step.

中文简介正在准备中。当前显示原文说明。

PyModel/pythinker-code292026年10月18日 更新

Apply an approved sub-skill grouping by moving user-specified skills into a parent bundle, with timestamped backups of every modified directory.

中文简介正在准备中。当前显示原文说明。

PyModel/pythinker-code292026年10月18日 更新

dogfood

免费

Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to "dogfood", "QA", "exploratory test", "find issues", "bug hunt", "test this app/site/platform", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.

中文简介正在准备中。当前显示原文说明。

PyModel/pythinker-code292026年10月18日 更新

electron

免费

Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include "automate Slack app", "control VS Code", "interact with Discord app", "test this Electron app", "connect to desktop app", or any task requiring automation of a native Electron application.

中文简介正在准备中。当前显示原文说明。

PyModel/pythinker-code292026年10月18日 更新

Use when generating changesets in the pythinker-code repository — deciding whether to write one, which package to list, the bump level, the wording, and the confirmation workflow.

中文简介正在准备中。当前显示原文说明。

PyModel/pythinker-code292026年10月18日 更新

查看 PyModel 的全部技能

报告此技能的问题