Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计异常

socket-fix插座修复

Agent Skill

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

总安装

247

周安装

10

GitHub Stars

5

下载量

78
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/socketdev/skills --skill socket-fix

简介

socket-fix 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词或任务场景快速定位候选结果。

  • 它支持多源信息聚合、关键词匹配和结果排序,适用于需要高效搜索和筛选内容的场景。
  • 通过 GitHub 仓库安装,使用 npx skills add 命令添加指定技能,具体用法可参考原始 README 文档。
  • 安装前需确认权限范围、维护状态,并注意可能触发的联网、命令执行或文件读写操作。
  • 建议结合来源仓库进一步核验功能细节,确保符合实际使用环境和安全要求。

SKILL.md

Fix

Fix dependency security issues in your project. This skill operates in two modes:

  • Fix All — scan the entire project and systematically resolve all findings
  • Fix Package — target a single named package and resolve its issues

This skill is an orchestrator. It delegates concrete actions to the subskills: /socket-dep-cleanup, /socket-dep-replace, /socket-dep-patch, and /socket-dep-upgrade.

When to Use

  • The user wants to fix all dependency security issues in their project (Fix All mode)
  • The user wants to fix a specific vulnerable, unused, or flagged package (Fix Package mode)
  • The user wants a one-shot "fix everything" for their dependencies
  • The user wants to clean up, patch, and upgrade in a single coordinated pass
  • The user asks for a safe or conservative dependency repair
  • The user wants to progressively increase aggressiveness (start safe, escalate if needed)
  • The user names a specific package, GHSA, CVE, or PURL they want fixed

Mode Detection

Determine which mode to use from the user's prompt:

  • Fix All — "fix everything", "fix all dependencies", "fix my project", "scan and fix", or no specific package named
  • Fix Package — "fix lodash", "fix express@4.17.1", "fix GHSA-xxxx-xxxx-xxxx", or any prompt that names a specific package, PURL, GHSA, or CVE

If ambiguous, ask: "Do you want to fix all dependencies or a specific package?"


Fix All Mode

Scan the project with /socket-scan, then systematically resolve findings using subskills. Choose from three aggressiveness levels to control how far the repair goes.

Prerequisites

/socket-scan must be working. Fix All mode requires a full scan to know what to fix.

Socket CLI Setup

Use npx socket to run the Socket CLI — this always fetches the latest version and requires no global install. Verify it works:

npx socket --version

All commands in this skill use the npx socket prefix (e.g., npx socket scan create...).

Optional global install: If you prefer a global socket command, install with npm install -g socket@latest (must be version 1.0.0 or higher).

Authentication

For users without a Socket account: Configure the public demo token directly:

npx socket config set apiToken sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api --no-banner --no-spinner
npx socket config set defaultOrg SocketDemo --no-banner --no-spinner

This provides limited access to CLI features like npx socket fix, npx socket package score, sfw, and socket-patch with rate limits. No account creation is needed for basic usage. Note: The public demo token cannot create scans (npx socket scan create requires the full-scans:create permission). For scanning and full-rate access, create a free account at https://socket.dev.

For users with an account: Authenticate with one of:

  • Interactive login: npx socket login (stores credentials in ~/.socket/)
  • Environment variable: Set SOCKET_CLI_API_TOKEN in your shell profile or CI environment

Verify account authentication:

npx socket organization list

If authentication fails or the CLI is not installed, use the /socket-setup skill for detailed guidance including Node.js installation, PATH troubleshooting, and CI/CD token configuration.

Do not proceed with Fix All mode until scanning works. If the user cannot or will not set up Socket, offer Fix Package mode instead (which has lower requirements per subskill).

Step 1: Run Initial Scan

Run /socket-scan to get a full picture of the project's dependency health. Use --tmp for a temporary read-only scan (the default — does not persist to the dashboard):

socket scan create . --tmp --json

Parse the scan results to build a prioritized list of issues:

  1. Malware — packages flagged as malware (highest priority)
  2. Critical/high CVEs — known vulnerabilities with available fixes
  3. Medium/low CVEs — lower-severity vulnerabilities
  4. Low Socket scores — packages with quality, maintenance, or supply-chain concerns
  5. Unused dependencies — packages with no detected usage in the codebase

Report the scan summary to the user:

Scan Results:
  Total packages: 150
  Critical: 2, High: 5, Medium: 12, Low: 25
  Malware: 0
  Low-score packages: 3

Step 2: Detect Environment

Before any repair work, identify the project's ecosystem and dependency landscape.

  1. Detect ecosystems — check for manifest and lock files (package.json, requirements.txt, go.mod, Cargo.toml, etc.) to determine which package managers are in use
  2. Parse dependencies — read manifest files to build a list of all direct dependencies (production and dev)
  3. Detect CI — check for CI/CD configuration (.github/workflows/, .gitlab-ci.yml, bitbucket-pipelines.yml, etc.) to understand the project's build and test infrastructure
  4. Ensure dependencies are installed — check for the presence of the dependency directory (node_modules/, vendor/, etc.). If dependencies are not installed, run the project's install command using the detected package manager (e.g. npm install, pnpm install, bun install). This is required for both patching and accurate unused dependency detection.

Report a brief summary:

Environment detected:
  Ecosystem: npm (package-lock.json)
  Dependencies: 42 production, 18 dev
  CI: GitHub Actions (Node 18/20 matrix)
  Build command: npm run build
  Test command: npm test
  Dependencies installed: yes (node_modules/ present)

Step 3: Select Aggressiveness Level

Ask the user which level they want, or auto-detect from their prompt:

LevelNameWhat It Does
1ConservativeOnly non-breaking changes: remove trivially unused deps + apply binary patches
2CautiousEverything in Level 1, plus propose ONE risky change for user approval
3FullSafe upgrades, aggressive cleanup, patching, and risky major upgrades — skip and continue on failure

If the user says "fix everything", "full repair", or "aggressive" → Level 3. If the user says "safe", "conservative", or "don't break anything" → Level 1. If the user says "careful", "cautious", or "one step at a time" → Level 2. If unclear, default to Level 1 and offer to escalate.


Level 1 — Conservative

Only non-breaking changes. Nothing here should break the build.

Phase 1a: Remove Trivially Unused Dependencies

For each dependency in the project:

  1. Search the entire codebase for usages (imports, requires, config refs, scripts, type packages, indirect usage)
  2. Collect packages where no usage is found
  3. Exclude ambiguous cases from automatic removal:

- @types/* packages (may support type-checking for indirect usage) - Peer dependencies required by other installed packages - CLI tools referenced in package.json scripts - Build plugins (webpack, babel, eslint, jest, etc.) - Packages with ambiguous import names (PyPI packages where import name differs from package name)

  1. For each clearly unused package, execute the /socket-dep-cleanup skill workflow
  2. Commit after each removal so progress is preserved

Phase 1b: Apply Binary Patches

Execute the /socket-dep-patch workflow:

  1. Ensure dependencies are installed (should have been verified in Step 2)
  2. Run socket-patch scan to discover available patches
  3. Apply all patches with socket-patch apply
  4. Build and test to verify nothing broke
  5. Commit the patch manifest (.socket/manifest.json)

Level 2 — Cautious

Run the full Level 1 workflow first, then propose one risky change.

Phase 2a: Run Full Level 1

Execute Phase 1a (unused dep removal) and Phase 1b (binary patches) as described above.

Phase 2b: Identify ONE Highest-Value Risky Change

After Level 1 completes, use the scan results from Step 1 to identify the single highest-value change that carries some risk. Prioritize in this order:

  1. Critical/high CVE upgrade — a dependency with a known critical or high severity vulnerability that requires a version bump
  2. Replacement of a flagged dependency — a dependency with a low Socket score or known maintenance issues that should be swapped for a better alternative (use /socket-dep-replace)
  3. Ambiguous unused dependency — a package that is *probably* unused but was excluded from Phase 1a due to ambiguity (e.g., a @types/* package whose base package is not used, or a build plugin that may no longer be needed)
  4. Safe minor version bump — a dependency with a minor/patch update available that fixes a medium-severity issue

Present the proposed change to the user with full context:

Proposed risky change (Level 2):

  Package: lodash (4.17.20 → 4.17.21)
  Reason: Fixes GHSA-xxxx-xxxx-xxxx (high severity prototype pollution)
  Risk: Minor version bump — low risk of breaking changes
  Affected files: src/utils/helper.ts, src/api/handler.ts (2 import locations)

  Approve this change? [yes/no]

Phase 2c: Execute If Approved

  • If the user approves, execute via /socket-dep-upgrade (for version bumps) or /socket-dep-cleanup (for removals)
  • Build and test after applying
  • Revert on failure — if the change breaks the build or tests, revert immediately and report what happened
  • If the user declines, skip and report Level 2 complete

Level 3 — Full

Aggressive repair. Apply everything possible, skip and continue on individual failures.

Phase 3a: Safe Upgrades

  1. Use scan results and socket fix --all --no-apply-fixes --json to discover all fixable vulnerabilities
  2. Filter to minor and patch bumps only (--no-major-updates)
  3. For each vulnerability, dispatch /socket-dep-upgrade to apply the fix
  4. Skip and continue on failure — if a single upgrade fails after retries, log the failure and move on to the next one (this diverges from /socket-dep-upgrade's default "bail on failure" behavior — intentional for Level 3's aggressive posture)
  5. Commit after each successful upgrade

Phase 3b: Aggressive Cleanup

  1. Re-scan all dependencies for usage (the dependency list may have changed after Phase 3a upgrades)
  2. Run /socket-dep-cleanup for both clearly unused AND ambiguous packages
  3. After each removal, build and test
  4. Revert removals that break the build — if removing a package causes failures, re-add it and mark it as "still needed"
  5. Commit after each successful removal

Phase 3b2: Replace Flagged Dependencies

  1. Review scan results for dependencies with low Socket scores, unmaintained status, or known supply-chain risks
  2. For each flagged dependency, run /socket-dep-replace to find and execute a replacement
  3. Skip and continue on failure — if a replacement cannot be completed (no suitable alternative, migration too complex, tests fail), log it and move on
  4. Commit after each successful replacement

Phase 3c: Patch Everything Remaining

  1. Run socket-patch scan to discover patches for remaining dependencies
  2. Run socket-patch apply to apply all discovered patches
  3. Build and test
  4. Commit patch manifest

Phase 3d: Risky Major Upgrades

  1. Re-run socket fix --all --no-apply-fixes --json to find remaining vulnerabilities
  2. Attempt major version bumps via /socket-dep-upgrade with code migration
  3. Skip and continue on failure — if a major upgrade cannot be completed (migration too complex, tests fail), log it and move on
  4. Commit after each successful upgrade

Step 4: Post-Repair Scan

After all phases complete (regardless of level):

  1. Run /socket-scan again to get a fresh security scan
  2. Compare findings against the initial scan from Step 1
  3. Report a summary:
Repair Complete (Level 2 — Cautious)

  Removed: 3 unused dependencies (is-odd, left-pad, unused-util)
  Patched: 5 packages via socket-patch
  Upgraded: 1 package (lodash 4.17.20 → 4.17.21)
  Skipped: 0 failures

  Security delta:
    Before: 4 critical, 8 high, 12 medium
    After:  1 critical, 3 high, 10 medium

  Remaining issues:
    - express@4.17.1: GHSA-yyyy-yyyy-yyyy (critical) — requires major bump to v5, not attempted at Level 2

Fix Package Mode

Target a single named package and resolve its issues. Does not require a full scan — just operates on the specified package.

Step 1: Identify the Target

The user may specify a package by:

  • Package namelodash, express
  • Name + versionlodash@4.17.20
  • PURLpkg:npm/lodash@4.17.20
  • Advisory IDGHSA-xxxx-xxxx-xxxx, CVE-2024-12345

If the user provides an advisory ID, resolve it to the affected package(s) using socket fix --id <ID> --no-apply-fixes --json.

Step 2: Diagnose

Investigate what's wrong with the target package:

  1. Check if it's installed — verify the package is in the manifest/lock file
  2. Check for vulnerabilities — run socket fix --id pkg:<ecosystem>/<name>@<version> --no-apply-fixes --json (requires Socket account) or check if the user provided a specific advisory
  3. Check for usage — search the codebase for imports and references (useful to know if cleanup is an option)
  4. Check for patches — run socket-patch scan and check if patches are available for this package

Report findings:

Package: lodash@4.17.20

  Vulnerabilities:
    - GHSA-xxxx-xxxx-xxxx (high) — prototype pollution, fixed in 4.17.21

  Usage: 6 imports across 3 files
    - src/utils/helper.ts (merge, cloneDeep)
    - src/api/handler.ts (get, set)
    - src/components/Table.tsx (sortBy, groupBy)

  Socket patches available: yes (1 patch)

  Possible actions:
    1. Patch — apply binary patch without version change (/socket-dep-patch)
    2. Upgrade — bump to 4.17.21 to fix the CVE (/socket-dep-upgrade)
    3. Replace — swap for an alternative package (/socket-dep-replace)
    4. Remove — remove if unused (/socket-dep-cleanup)

Step 3: Recommend and Execute

Based on the diagnosis, recommend the best action. If multiple actions apply, prioritize in this order:

  1. Upgrade — if a version bump fixes the issue and is available, prefer this (most complete fix)
  2. Patch — if a binary patch is available and the user wants to avoid version changes
  3. Replace — if the package is unmaintained, has a low Socket score, or the user specifically wants an alternative
  4. Remove — if the package is unused

Present the recommendation and ask for approval. Then delegate to the appropriate subskill:

  • Vulnerability fix → /socket-dep-upgrade
  • Binary patch → /socket-dep-patch
  • Swap for alternative → /socket-dep-replace
  • Remove unused → /socket-dep-cleanup

If the user has a preference ("just patch it", "upgrade it", "replace it with dayjs"), skip the recommendation and go directly to the requested subskill.

Step 4: Verify

After the subskill completes:

  1. Build and test the project
  2. Confirm the issue is resolved
  3. Report the result

Error Handling

  • /socket-scan not working (Fix All mode): Do not proceed with Fix All. Offer to run /socket-setup first, or suggest Fix Package mode as an alternative.
  • Socket CLI not installed: Run /socket-setup to install and authenticate. For users without an account, /socket-setup will configure the public demo token, which provides limited access to CLI features like socket fix and socket package score (but not socket scan create).
  • Rate limits hit: The public token has rate limits. If the user hits them, suggest creating a free account at https://socket.dev to remove limits.
  • No dependencies found: The project may not have manifest files in the expected locations. Check for monorepo structures or non-standard layouts.
  • Build/test command unknown: Ask the user for the correct build and test commands before starting repair.
  • All upgrades fail in Level 3: If every upgrade attempt fails, report what was tried and suggest the user investigate manually. The cleanup and patch phases may still have succeeded.
  • Network errors: socket fix and socket-patch require network access. Check connectivity and retry once before skipping.

Tips

  • Start with Level 1 if you're unsure — it's designed to be completely safe
  • Level 2 is ideal for regular maintenance: safe changes plus one carefully reviewed improvement
  • Level 3 is best for major cleanup efforts where you're prepared to review and test extensively
  • Each level builds on the previous one, so you can start conservative and escalate
  • All changes are committed individually, making it easy to revert any single change
  • Fix Package mode is useful when you already know which package is problematic
  • Fix All mode gives you the full picture first, so you fix the most important issues
  • For monorepos, consider running repair on each workspace individually
  • Combine with /socket-setup to ensure the Socket CLI is properly configured before starting

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.39%
按下载量换算28

Claude

29.88%
按下载量换算23

Cursor

16.68%
按下载量换算13

Gemini CLI

8.35%
按下载量换算7

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

未通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills