Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

web-utilities-native-js网络实用程序本机 js

Agent Skill

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

总安装

272

周安装

11

GitHub Stars

5

下载量

85
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:web-utilities-native-js(网络实用程序本机 js)
来源仓库:https://github.com/agents-inc/skills
仓库路径:skills/web-utilities-native-js
安装命令:
npx skills add https://github.com/agents-inc/skills --skill web-utilities-native-js
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/agents-inc/skills --skill web-utilities-native-js

简介

用于查找、检索和筛选相关信息,支持基于关键词或任务场景快速定位内容。

  • 适用于在 Codex、Claude、Cursor、Gemini CLI 中需要从来源线索提取信息时使用。
  • 可结合来源仓库和原始文档进一步验证其实际功能和适用场景。
  • 安装命令:npx skills add https://github.com/agents-inc/skills --skill web-utilities-native-js。
  • 安装前建议确认权限范围、维护状态及是否涉及联网、命令执行或文件读写。

SKILL.md

Native JavaScript Utility Patterns

Quick Guide: Prefer native JavaScript (ES2022-ES2025) over utility libraries. Use structuredClone for deep cloning, Object.groupBy for grouping, ES2023 immutable array methods (toSorted, toReversed, with), and ES2025 Set methods for set operations. Only reach for utility libraries when native alternatives genuinely don't exist or lack needed features (cancel/flush on debounce, deep merge with array strategies).

<critical_requirements>

CRITICAL: Before Using This Skill

All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering, import type, named constants)

(You MUST use native ES2022+ methods before considering utility libraries - check this skill first)

(You MUST use immutable array methods (toSorted, toReversed, toSpliced, with) instead of mutating methods)

(You MUST use structuredClone for deep cloning - NOT JSON.parse/JSON.stringify hacks)

(You MUST define named constants for all numeric values - NO magic numbers in utility functions)

</critical_requirements>


Auto-detection: native JavaScript utilities, lodash alternative, ES2023 array methods, toSorted, toReversed, structuredClone, Object.groupBy, Set union, Set intersection, optional chaining, nullish coalescing, at(), findLast

When to use:

  • Array manipulation (find, filter, sort, reverse, chunk, unique, group)
  • Object operations (pick, omit, merge, clone, groupBy)
  • Set operations (union, intersection, difference)
  • Deep cloning without external libraries
  • Function utilities (debounce, throttle, memoize)

When NOT to use:

  • Complex deep merge with custom array-handling strategies - use a library
  • Lazy evaluation chains over large datasets - lodash chains are optimized for this
  • Objects containing functions that need cloning - structuredClone cannot clone functions
  • Full-featured debounce/throttle with cancel, flush, leading/trailing - use a library

Key patterns covered:

  • Safe property access (optional chaining + nullish coalescing replaces _.get)
  • Immutable array operations (toSorted, toReversed, toSpliced, with)
  • Deep cloning with structuredClone (handles Map, Set, Date, circular refs)
  • Object.groupBy / Map.groupBy (ES2024 - replaces reduce-based grouping)
  • ES2025 Set methods (union, intersection, difference, symmetricDifference)
  • Object pick/omit, unique values, chunking, flattening

Detailed Resources:


Philosophy

Modern JavaScript (ES2022-ES2025) provides native alternatives for ~80% of common utility library functions. Using native methods means:

  1. Zero bundle cost - No additional bytes shipped to users
  2. Better performance - Native implementations are engine-optimized
  3. Future-proof - Standards evolve, libraries may not
  4. Simpler debugging - No library internals to step through

Key principle: Check native JavaScript first. Only use utility libraries for genuinely missing functionality.

// Native is free - no imports needed
const unique = [...new Set(items)];
const last = items.at(-1);
const sorted = items.toSorted((a, b) => a.name.localeCompare(b.name));
const cloned = structuredClone(complexObject);
const grouped = Object.groupBy(items, (item) => item.category);

ES Version Reference:

FeatureES VersionBrowser Support
Optional chaining (?.)ES2020All modern browsers
Nullish coalescing (??)ES2020All modern browsers
at() negative indexingES2022All modern browsers
toSorted, toReversed, withES2023All modern browsers
Object.groupBy, Map.groupByES2024Chrome 117+, Safari 17.4+
Set methods (union, etc.)ES2025Chrome 122+, Safari 17+

Core Patterns

Pattern 1: Safe Property Access

Optional chaining + nullish coalescing replaces _.get with zero bundle cost.

const DEFAULT_CITY = "Unknown";
const city = user?.address?.city ?? DEFAULT_CITY;
const result = service?.logger?.log?.("message"); // method call
const first = data?.items?.[0]?.name ?? "No items"; // array access

Why this matters: Handles null/undefined gracefully, type-safe with TypeScript, no runtime cost.

See examples/core.md for full patterns.


Pattern 2: Immutable Array Operations (ES2023)

Always use immutable variants - critical for reactive frameworks and shared state.

const sorted = items.toSorted((a, b) => a.price - b.price); // not .sort()
const reversed = items.toReversed(); // not .reverse()
const updated = items.with(1, newItem); // not items[1] = x
const removed = items.toSpliced(1, 1); // not .splice()

Why this matters: Mutating methods cause bugs in shared state and reactive frameworks that rely on reference equality to detect changes.

See examples/core.md for immutable update patterns.


Pattern 3: Deep Cloning with structuredClone

Replaces JSON round-trip and lodash _.cloneDeep. Handles types JSON cannot.

const cloned = structuredClone(complexObject);
// Preserves: Date, Map, Set, RegExp, ArrayBuffer, circular references
// Cannot clone: functions, DOM nodes, Error objects with custom properties

Why this matters: JSON.parse(JSON.stringify()) silently corrupts Date (becomes string), Map/Set (becomes {}), and loses undefined.

See examples/core.md for cloning patterns.


Pattern 4: Object.groupBy (ES2024)

Replaces verbose reduce-based grouping and lodash _.groupBy.

const byCategory = Object.groupBy(products, (p) => p.category);
const THRESHOLD = 100;
const byRange = Object.groupBy(items, (item) =>
  item.price >= THRESHOLD ? "expensive" : "affordable",
);
// Returns null-prototype object - use Object.hasOwn() not hasOwnProperty

Why this matters: Reduce-based grouping is verbose, error-prone (forgetting key init), and has prototype pollution risk with {}.

See examples/arrays.md for grouping patterns.


Pattern 5: ES2025 Set Methods

Native set operations replace manual filter-based implementations.

const union = setA.union(setB);
const common = setA.intersection(setB);
const diff = setA.difference(setB);
const either = setA.symmetricDifference(setB);
const isSub = setA.isSubsetOf(setB);
// Returns Set - spread to array if needed: [...setA.union(setB)]

Why this matters: Filter + includes/indexOf is O(n^2). Native Set methods are O(n).

See examples/arrays.md for set operations and pre-ES2025 fallbacks.


Pattern 6: Finding from End (ES2023)

findLast and findLastIndex replace reverse-then-find anti-pattern.

const lastError = logs.findLast((log) => log.level === "error");
const lastErrorIdx = logs.findLastIndex((log) => log.level === "error");

Why this matters: [...arr].reverse().find() creates unnecessary copy. findLast is single-pass.

See examples/core.md for findLast patterns.


<red_flags>

RED FLAGS

High Priority:

  • Using JSON.parse(JSON.stringify()) for deep clone - loses Date, Map, Set, undefined. Use structuredClone.
  • Using mutating array methods (.sort(), .reverse(), .splice()) on shared state - causes bugs in reactive frameworks. Use ES2023 immutable versions.
  • Using lodash for operations with native equivalents (_.get, _.last, _.uniq, _.groupBy) - unnecessary bundle weight.
  • Using includes() or indexOf() in loops - O(n) per check. Convert to Set first for O(1) lookups.

Medium Priority:

  • Magic numbers like arr.slice(-3) - use named constants: const RECENT_COUNT = 3.
  • Reversing arrays to find from end - use findLast() instead of [...arr].reverse().find().
  • Reduce-based grouping - use Object.groupBy() (ES2024).
  • Using arr[arr.length - 1] for last element - use arr.at(-1).

Gotchas & Edge Cases:

  • structuredClone throws on functions, DOM nodes - use manual clone if these are present.
  • Object.groupBy returns null-prototype object - no hasOwnProperty. Use Object.hasOwn().
  • Set methods return Sets, not arrays - spread to array if needed: [...setA.union(setB)].
  • toSorted() with no comparator converts elements to strings (like sort()).
  • at() returns undefined for empty arrays or out-of-bounds indices.

</red_flags>


<critical_reminders>

CRITICAL REMINDERS

All code must follow project conventions in CLAUDE.md

(You MUST use native ES2022+ methods before considering utility libraries - check this skill first)

(You MUST use immutable array methods (toSorted, toReversed, toSpliced, with) instead of mutating methods)

(You MUST use structuredClone for deep cloning - NOT JSON.parse/JSON.stringify hacks)

(You MUST define named constants for all numeric values - NO magic numbers in utility functions)

Failure to follow these rules will cause unnecessary bundle bloat and mutation bugs.

</critical_reminders>

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.37%
按下载量换算32

Claude

27.3%
按下载量换算23

Cursor

16.35%
按下载量换算14

Gemini CLI

9.43%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

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

来源信息

继续浏览同类 Skills