bug-fix-tdd
Reproduce and fix bugs using TDD. Use when analyzing a bug report, writing a regression test, or applying a minimal fix. Covers…
Remediate security vulnerabilities found by Grype or pnpm audit. Use when a security scan fails, a CVE needs fixing, or you need to analyze, upgrade, override, or ignore a vulnerable dependency.
Claude Code
$ npx -y skills add stacklok/toolhive-studio --skill security-vuln-remediation --agent claude-code
Codex
$ npx skills add stacklok/toolhive-studio --skill security-vuln-remediation -a codex -y
Cursor
$ npx skills add stacklok/toolhive-studio --skill security-vuln-remediation -a cursor -y
Gemini CLI
$ npx skills add stacklok/toolhive-studio --skill security-vuln-remediation -a gemini-cli -y
GitHub Copilot
$ npx skills add stacklok/toolhive-studio --skill security-vuln-remediation -a github-copilot -y
OpenCode
$ npx skills add stacklok/toolhive-studio --skill security-vuln-remediation -a opencode -y
Windsurf
$ npx skills add stacklok/toolhive-studio --skill security-vuln-remediation -a windsurf -y
name: security-vuln-remediation description: Remediate security vulnerabilities found by Grype or pnpm audit. Use when a security scan fails, a CVE needs fixing, or you need to analyze, upgrade, override, or ignore a vulnerable dependency.
Playbook for analyzing and remediating security vulnerabilities in this Electron/Node.js project. Applies to both CI (Cursor agent in GitHub Actions) and local development.
Follow these steps in order. Stop at the first step that resolves the vulnerability.
Run both scanners and capture the output:
grype . --config .grype.yaml pnpm audit --prod --audit-level=moderate
For each finding, record:
For each vulnerable package, understand who pulls it in:
pnpm why <package-name>
Record:
Check if a patch/minor upgrade of the **direct** dependency resolves the CVE:
pnpm update <direct-dependency>
Or, if the vulnerable package is a direct dependency itself, update its version range in `package.json`.
After the change:
1. Run `pnpm install` to regenerate the lockfile 2. Re-run `grype . --config .grype.yaml` to verify the vulnerability is gone
If the upgrade resolves it, this step is complete. Move to the next vulnerability.
If no non-breaking upgrade is available, or the fix requires a major version bump of a transitive dependency that is safe to force:
Add or update an entry in the `overrides` block inside `pnpm-workspace.yaml`. You MUST follow the existing override style used in the project. Current overrides look like this:
overrides: fast-xml-parser: '>=5.5.9' lodash-es: '>=4.17.23' tar: '>=7.5.7'
Rules for overrides (follow strictly):
1. **Always use the `>=` prefix for values** — this allows future patches. Example: `'>=1.2.3'`. 2. **BEFORE writing any override, check `pnpm why <package>` for multiple major versions.** This is mandatory. If the tree contains more than one major line, an unscoped override would force ALL consumers onto the overridden version, breaking packages that expect a different major. 3. **Use a simple top-level override ONLY when one major line exists** — if every installation of the package is on the same major, a single `package: '>=fixed'` entry is safe:
some-package: '>=1.2.3'
4. **Use parent-scoped overrides when multiple majors coexist** — scope the override to the dependency path that pulls in the vulnerable version using `'parent>package'` syntax:
'parent-pkg>vulnerable-pkg': '>=2.0.1'
This only overrides `vulnerable-pkg` when required by `parent-pkg`, leaving other consumers on their compatible major. Pick the nearest direct parent that exclusively uses the vulnerable major line.
**WRONG** — never use an unscoped override when multiple majors exist:
vulnerable-pkg: '>=2.0.1'
This would force every consumer onto v2, breaking those that depend on v1.
5. **Only override actually vulnerable versions** — if `pnpm why` shows multiple major lines but only one is in the advisory's vulnerable range, override only that version's path. Do not add overrides for versions that are not vulnerable. 6. **Three valid override-key forms** — pick the most surgical one that resolves the advisory: 1. `package: '>=fixed'` — top-level, only when a single major line exists in the tree (see Rule 3). 2. `'parent>package': '>=fixed'` — parent-scoped, when multiple majors coexist and a specific parent pulls in the vulnerable major (see Rule 4). 3. `'package@versionRange': fixedVersion` — version-range-keyed, when **multiple vulnerable major lines coexist** and each needs its own targeted bump regardless of importer. The range lives in the key; the value is a fixed target version (no `>=` prefix). Example from this repo (`pnpm-workspace.yaml`):
'brace-expansion@>=4.0.0 <5.0.5': 5.0.5
'brace-expansion@>=2.0.0 <2.0.3': 2.0.3
'brace-expansion@<1.1.13': 1.1.14Prefer this form over many parent-scoped entries when the advisory spans multiple majors. Avoid it when a single-major top-level (form 1) or one `parent>package` (form 2) would do — those are easier to read.
After the change:
1. Run `pnpm install` to regenerate the lockfile 2. Re-run `grype . --config .grype.yaml` to verify the vulnerability is gone
Only if ALL of the following are true:
Add an ignore entry to `.grype.yaml`:
ignore:
- vulnerability: CVE-XXXX-XXXXX
package:
name: <package-name>
type: npm
reasonRun any Model Context Protocol (MCP) server — securely, instantly, anywhere. ToolHive is the easiest way to discover, deploy, and manage MCP servers. Launch any MCP server in a locked-down container with just a few clicks.
Reproduce and fix bugs using TDD. Use when analyzing a bug report, writing a regression test, or applying a minimal fix. Covers…
Deep links in ToolHive Studio. Use when implementing, debugging, or asking about deep link features (toolhive-gui:// protocol),…
Spin up and interact with ToolHive Studio's containerized dev environment (Xvfb + noVNC + DinD). Use when running, testing, or…
Create new AI agent skills for Claude Code, Codex, and Cursor. Use when asked to create a skill, add a new agent capability, or…
REQUIRED for editing any skill file. Ensures changes sync to Claude, Codex, and Cursor. Never edit .claude/skills/ files directly…
Verify API requests in tests. Use when testing that correct API calls are made for create, update, or delete operations. Use when…
Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki,…
Query and invoke tools on MCP servers using fastmcp list and fastmcp call. Use when you need to discover what tools a server…
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain,…
小红书内容发布技能。支持两种发布模式:(1) 上传图文模式 - 图片+短文;(2) 写长文模式 - 长篇文章+排版模板。 支持两种输入方式:用户提供完整内容和图片/图片URL,直接发布;或提供网页URL,自动提取内容和图片。…