[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M755Z0V33CS5EVEQ5C0QQN64":3,"skill-same:01M755Z0V33CS5EVEQ5C0QQN64":55},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":13,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M755Z0V33CS5EVEQ5C0QQN64","snyk-fix",null,"Complete security remediation workflow. Scans code for vulnerabilities using Snyk, \nfixes them, validates the fix, and optionally creates a PR. Supports both single-issue\nand batch mode for multiple vulnerabilities. Use this skill when:\n- User asks to fix security vulnerabilities\n- User mentions \"snyk fix\", \"security fix\", or \"remediate vulnerabilities\"\n- User wants to fix a specific CVE, Snyk ID, or vulnerability type (XSS, SQL injection, path traversal, etc.)\n- User wants to upgrade a vulnerable dependency\n- User asks to \"fix all\" vulnerabilities or \"fix all high\u002Fcritical\" issues (batch mode)","ASoudy\u002FAGS","ASoudy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F40639702?v=4","01M74G5NTCW8MWDNRTAF303PA1","01M74G5NTZXSE6T0GZR5BCB6V0",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FASoudy\u002FAGS\u002Fblob\u002Fmain\u002Fclaude_skills_libraries\u002Fsnyk-fix\u002Fcommand_directives\u002Fsynchronous_remediation\u002Fskills\u002Fsnyk-fix\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: snyk-fix\ndescription: |\n  Complete security remediation workflow. Scans code for vulnerabilities using Snyk, \n  fixes them, validates the fix, and optionally creates a PR. Supports both single-issue\n  and batch mode for multiple vulnerabilities. Use this skill when:\n  - User asks to fix security vulnerabilities\n  - User mentions \"snyk fix\", \"security fix\", or \"remediate vulnerabilities\"\n  - User wants to fix a specific CVE, Snyk ID, or vulnerability type (XSS, SQL injection, path traversal, etc.)\n  - User wants to upgrade a vulnerable dependency\n  - User asks to \"fix all\" vulnerabilities or \"fix all high\u002Fcritical\" issues (batch mode)\nallowed-tools: \"mcp_snyk_snyk_code_scan mcp_snyk_snyk_sca_scan mcp_snyk_snyk_breakability_check mcp_snyk_snyk_auth mcp_snyk_snyk_send_feedback Read Write Edit Bash Grep\"\nlicense: Apache-2.0\ncompatibility: |\n  Requires Snyk MCP server connection and authenticated Snyk account.\n  GitHub CLI (gh) required for PR creation. Git repository required.\n  Supports SAST for 20+ languages and SCA for all major package managers.\nmetadata:\n  author: Snyk\n  version: 1.1.0\n---\n\n# Snyk Fix (All-in-One)\n\nComplete security remediation workflow: Parse → Scan → Analyze → Fix → Validate → Summary → (Optional) PR\n\n**Modes**:\n- **Single Mode** (default): Fix one vulnerability type at a time (all instances in same file)\n- **Batch Mode**: Fix multiple vulnerabilities in priority order (triggered by \"all\", \"batch\", severity filter, or count)\n\n---\n\n## Phase 1: Input Parsing\n\nParse user input to extract:\n- **mode**: Single (default) or Batch\n- **scan_type**: `code`, `sca`, or `both` (inferred from context)\n- **target_vulnerability**: Specific issue ID, CVE, package name, file, or vuln type\n- **target_path**: File or directory (defaults to project root)\n- **severity_filter** \u002F **max_fixes**: For batch mode (default max: 20)\n\n### Mode & Scan Type Detection\n\n| Signal | Mode | Scan Type |\n|--------|------|-----------|\n| \"all\", severity filter, count (\"top 5\"), or \"batch\" | Batch | both |\n| Specific vuln ID, single type, file reference, or no batch indicators | Single (default) | — |\n| Explicit \"code\"\u002F\"sast\"\u002F\"static\" | — | code |\n| Explicit \"sca\"\u002F\"dependency\"\u002F\"package\"\u002Fpackage manager name | — | sca |\n| `SNYK-` or `CVE-` ID provided | — | both |\n| Vulnerability type (XSS, SQL injection, path traversal, etc.) or file reference | — | code |\n| Package name reference | — | sca |\n| No hints | — | both (highest priority issue) |\n\n---\n\n## Phase 1B: Batch Mode Planning (Skip if Single Mode)\n\n1. Run both `mcp_snyk_snyk_code_scan` and `mcp_snyk_snyk_sca_scan` on project root.\n2. Filter by user-specified severity, type, path, or count.\n3. Group by vulnerability type (same ID + file for code; same package for SCA). Sort Critical → High → Medium → Low; within same priority, prefer issues with available fixes.\n4. Display fix plan as a numbered table (index, type, severity, target, instance count) with estimated file\u002Fpackage changes. **Wait for user confirmation before proceeding.**\n   - If user says \"adjust\": allow plan modification.\n5. Execute fixes in order (Phase 3 or 4 per item → Phase 5 validate → track result). On failure: stop if `stop_on_failure=true`, else continue.\n6. Proceed to Phase 6B after all attempts.\n\n**Batch limits**: max 20 vulnerabilities, max 15 files modified, max 3 fix attempts per item.\n\n---\n\n## Phase 2: Discovery\n\n### Step 2.1: Run Scan(s)\n\nInvoke scans with the target path. Examples:\n\n```\n# Code scan\nmcp_snyk_snyk_code_scan:\n  path: \"\u002Fabsolute\u002Fpath\u002Fto\u002Fproject\"   # or subdirectory for targeted scans\n\n# SCA scan\nmcp_snyk_snyk_sca_scan:\n  path: \"\u002Fabsolute\u002Fpath\u002Fto\u002Fproject\"   # always project root (manifest location)\n```\n\n- Code: `mcp_snyk_snyk_code_scan` on target path\n- SCA: `mcp_snyk_snyk_sca_scan` on project root\n- Both: run in parallel\n\n### Step 2.2: Select Target\n- If user specified: find matching issue. If not found: report and STOP.\n- If not specified: select highest priority type using: Critical+exploit > Critical > High+exploit > High > Medium > Low. Prefer issues with available fixes.\n\n### Step 2.3: Group Instances (Code Only)\nAfter selecting vulnerability type, collect ALL instances of that same Snyk ID in the same file. Fix all of them together.\n\n### Step 2.4: Document Target\nDisplay a brief summary: type (Code\u002FSCA), ID, severity, title, and for Code — instance count + file\u002Fline table; for SCA — package, fix version, dependency path.\n\n### Step 2.5: Check for Fix Path (SCA Only)\n\n**⚠️ If the scan results do not report any fix version or upgrade path for the selected SCA vulnerability, do NOT proceed to Phase 4.** The agent must not attempt to discover or invent a fix on its own when Snyk has no recommended remediation.\n\nInstead, produce a **No Fix Available Report** and STOP:\n\n```\n## No Fix Available\n\n| Vulnerability | [Title] |\n|---------------|---------|\n| **ID** | [Snyk Issue ID] |\n| **Severity** | [Critical \u002F High \u002F Medium \u002F Low] |\n| **Package** | [package@current_version] |\n| **Dependency Path** | [direct \u002F transitive via X → Y → Z] |\n\n### Why No Fix Was Applied\nSnyk does not report a fix version or upgrade path for this vulnerability.\nThe agent will not attempt to resolve issues where no known fix exists.\n\n### Alternatives to Consider\n- Monitor for a future fix release from the package maintainer\n- Evaluate replacing the package with a maintained alternative\n- Apply a manual workaround if the vulnerability context allows it\n- Accept the risk and document in your security policy\n```\n\nAfter producing this report:\n- Send `mcp_snyk_snyk_send_feedback` with `fixedExistingIssuesCount: 0`\n- Do NOT make any file changes\n- STOP\n\n---\n\n## Phase 3: Remediation (Code Vulnerabilities)\n\n### Step 3.1: Understand\nRead all vulnerable locations. Identify type (SQL injection, XSS, path traversal, command injection, sensitive data exposure, hardcoded secrets, crypto issues, etc.). Review Snyk's remediation guidance.\n\n### Step 3.2: Plan\nDocument: vulnerability type, root cause, fix approach, security mechanism, instance count.\n\nCommon patterns:\n- SQL Injection → parameterized queries\n- Command Injection → input validation + escaping or avoid shell\n- Path Traversal → canonicalize + validate against allowed base\n- XSS → output encoding\u002Fsanitization for context\n- Hardcoded Secrets → move to env vars \u002F secrets manager\n\n### Step 3.3: Apply Fix to ALL Instances\n- Fix from bottom to top of file (avoid line number shifts)\n- Minimal change; use standard library\u002Fframework security features\n- Create shared helper if 3+ instances share identical fix pattern\n- Add security-relevant comments where non-obvious\n- Do NOT refactor unrelated code or change business logic\n\n---\n\n## Phase 4: Remediation (SCA Vulnerabilities)\n\n**Skip to Phase 5 if this is a Code vulnerability (already handled in Phase 3).**\n\n### Step 4.1: Determine Remediation Strategy\n\nAnalyze the dependency path and determine which strategy applies. Exactly one of these three strategies must be selected before proceeding:\n\n**Strategy A — Direct Upgrade**\nThe vulnerable package is a direct dependency in the project manifest. Upgrade it to a version where the vulnerability is fixed.\n\n**Strategy B — Parent Upgrade**\nThe vulnerable package is a transitive dependency. A newer version of the direct (parent) dependency pulls in a fixed version of the transitive. Upgrade the parent.\n\n**Strategy C — Transitive Fix**\nThe vulnerable package is a transitive dependency, but no available version of the parent pulls in a fixed transitive. Resolve the transitive to a fixed version using the lowest-impact mechanism available in the ecosystem.\n\n#### How to choose:\n\n1. Is the vulnerable package declared directly in the project manifest?\n   - **Yes** → **Strategy A**\n   - **No** → Continue to step 2\n\n2. Identify the direct dependency (parent) that pulls in the vulnerable transitive. Does any available version of the parent resolve the vulnerable transitive to a fixed version?\n   - **Yes** → **Strategy B** (upgrade the parent)\n   - **No** → **Strategy C** (transitive fix)\n\nIf the application directly imports or uses the transitive dependency (not just via the parent), note this — it affects breaking change analysis for Strategy C.\n\nDocument the chosen strategy:\n```\n## Remediation Strategy\n- **Strategy**: [A: Direct Upgrade | B: Parent Upgrade | C: Transitive Fix]\n- **Target package to change**: [package@current → package@target]\n- **Parent dependency** (if B\u002FC): [parent@current]\n- **Manifest file**: [path to manifest]\n```\n\n### Step 4.2: Breaking Change Assessment\n\n**⚠️ ALWAYS run `mcp_snyk_snyk_breakability_check` BEFORE applying any changes.** If the tool is unavailable, errors out, or does not return a LOW\u002FMEDIUM\u002FHIGH risk level, proceed to Step 4.2a.\n\nCall `mcp_snyk_snyk_breakability_check` with the package that will actually change in the manifest:\n\n| Strategy | Check breakability on |\n|----------|----------------------|\n| A (Direct Upgrade) | The direct dependency being upgraded |\n| B (Parent Upgrade) | The parent dependency being upgraded |\n| C (Transitive Fix) | The transitive dependency being resolved to a new version |\n\n#### Breakability Decision Tree\n\nThe breakability result (LOW \u002F MEDIUM \u002F HIGH) is a general likelihood assessment — it is not a confirmation of actual breakage in this specific project. Use the result to determine the next action.\n\n**Interactive vs. autonomous execution**: when a human is in the loop (interactive session), present trade-offs and ask for confirmation at HIGH risk. When running autonomously (background agent, no human available), the agent must evaluate the same evidence a human would — vulnerability severity, breaking change risk, breaking change details — make the decision itself, and **document its reasoning** in the output. An autonomous agent must never block waiting for input that will not come.\n\n**Strategy A (Direct Upgrade) and Strategy B (Parent Upgrade):**\n\n| Risk | Action |\n|------|--------|\n| **LOW** | Auto-apply the upgrade. Proceed to Step 4.4. |\n| **MEDIUM** | Auto-apply the upgrade. Document the breaking change summary and reasoning in the remediation summary. |\n| **HIGH** | **Interactive**: present the full trade-off (vulnerability details, breaking change summary, exact proposed changes) and ask the user whether to proceed. **Autonomous**: evaluate the full trade-off, decide whether to apply or produce a Full Advisory (Phase 4a), and document the reasoning. |\n\n**Strategy B → fallback to C:** If Strategy B gets a HIGH breakability result and the decision (user or agent) is to not proceed, fall back to Strategy C. Re-run `mcp_snyk_snyk_breakability_check` on the transitive version jump and follow the Strategy C decision tree below.\n\n**Strategy C (Transitive Fix):**\n\n| Risk | Action |\n|------|--------|\n| **LOW** | Auto-apply the fix. Proceed to Step 4.4. |\n| **MEDIUM** | Auto-apply the upgrade. Document the breaking change summary and reasoning in the remediation summary. |\n| **HIGH** | **Interactive**: present the full trade-off and ask the user whether to proceed. If the vulnerability is **Critical severity with a known exploit**, emphasize the urgency. **Autonomous**: evaluate the full trade-off, decide whether to apply or produce a Full Advisory (Phase 4a), and document the reasoning. |\n\n### Step 4.2a: Breakability Fallback — Semver + Usage Analysis\n\n**This step activates when `mcp_snyk_snyk_breakability_check` is unavailable (tool not found, errors out, times out) OR returns a response without a LOW\u002FMEDIUM\u002FHIGH risk level** (e.g., \"no additional breakability context available\"). If breakability returned a valid risk level, skip this step entirely.\n\nWhen breakability data is unavailable, derive a substitute risk level by combining **semver distance** and **codebase usage**:\n\n1. **Determine the semver distance** between the current version and the target version:\n   - **Patch** bump (e.g., 1.2.3 → 1.2.5): lowest inherent risk\n   - **Minor** bump (e.g., 1.2.3 → 1.3.0): moderate inherent risk\n   - **Major** bump (e.g., 1.2.3 → 2.0.0): highest inherent risk\n\n2. **Search the codebase for direct usages of the package being upgraded.** Look for imports, requires, includes, or other dependency references using patterns appropriate to the project's language and ecosystem. The agent determines the correct search patterns based on the ecosystem — do not use hardcoded patterns.\n\n3. **Combine both signals to derive a substitute risk level:**\n\n| Semver Distance | No direct usage | Light usage | Heavy \u002F complex usage |\n|-----------------|-----------------|-------------|----------------------|\n| **Patch** | LOW | LOW | LOW |\n| **Minor** | LOW | MEDIUM | MEDIUM |\n| **Major** | HIGH | HIGH | HIGH |\n\n4. **Feed the substitute risk level into the same Breakability Decision Tree from Step 4.2.** No separate code path — the same thresholds and actions apply.\n\n**Important**: when a substitute risk level is used, note this in the remediation summary (Phase 6) so the user knows the risk assessment was derived from codebase analysis, not from breakability data.\n\n### Step 4.3: Version Selection\n\nWhen multiple versions fix the vulnerability, do NOT blindly pick the lowest version number. Optimize for:\n\n1. Fixes the target vulnerability\n2. Lowest breakability risk (run `mcp_snyk_snyk_breakability_check` on candidates if needed)\n3. Lowest version number (tiebreaker only)\n\n### Step 4.4: Apply Fix\n\n**Only reach this step if the breakability decision allows it (auto-apply or user\u002Fagent confirmed).**\n\n**Strategy A (Direct Upgrade):**\nUpdate the version in the manifest and run the ecosystem's install command (`npm install pkg@version`, `yarn upgrade`, `go get`, `pip install`, `mvn dependency:resolve`, etc.). Preserve file formatting and comments.\n\n**Strategy B (Parent Upgrade):**\nUpdate the parent dependency version in the manifest and run the ecosystem's install command. After installation, verify that the resolved transitive is now the fixed version.\n\n**Strategy C (Transitive Fix):**\nUse the lowest-impact mechanism that makes the resolver choose a fixed version of the transitive. The exact mechanism is ecosystem-dependent — do not assume one universal ordering.\n\n1. **Resolver-only update first**: Refresh the lockfile or run the ecosystem's update\u002Fresolve command for the vulnerable package. This is appropriate when the fixed version is already allowed by the existing constraints.\n2. **If that fails**, inspect the ecosystem and repo layout, then choose the appropriate native resolver-control mechanism: top-level constraint\u002Fdeclaration, central dependency-management entry, force\u002Foverride\u002Fresolution, exclusion, or replacement.\n3. **Prefer the narrowest effective scope.** Use a stronger override\u002Fforce\u002Freplace only when a normal declaration or narrower exclusion cannot make the resolver choose the fixed version.\n4. **Hard pin only as a last resort.**\n\n#### Reference: common install\u002Fresolve commands\n\n| Package Manager | Command |\n|-----------------|---------|\n| npm (major upgrade) | `npm install \u003Cpkg>@\u003Cversion>` |\n| npm (minor\u002Fpatch) | `npm install` |\n| yarn | `yarn install` or `yarn upgrade \u003Cpkg>@\u003Cversion>` |\n| pip | `pip install -r requirements.txt` |\n| maven | `mvn dependency:resolve` |\n\nThis table is not exhaustive — use the appropriate command for the project's ecosystem.\n\n**If installation fails:**\n- If sandbox\u002Fpermission issue: retry with elevated permissions\n- If dependency conflict: try a different version or note as unfixable\n- Revert manifest changes if resolution completely fails\n- Document the failure reason\n\n---\n\n## Phase 4a: Full Advisory — SCA No-Apply Path\n\n**Enter this phase when the decision is to NOT apply an SCA fix** — whether because the user declined, or because the agent (in autonomous mode) determined the risk outweighs the benefit.\n\nProduce an advisory instead of making changes.\n\n### Advisory Output Format\n\n```\n## Security Advisory — Manual Action Required\n\n### Vulnerability\n- **ID**: [Snyk Issue ID]\n- **Severity**: [Critical | High | Medium | Low]\n- **Package**: [vulnerable_package@current_version]\n- **Title**: [vulnerability title]\n\n### Why This Was Not Auto-Applied\n[1-2 sentences: e.g., \"The required transitive fix from pkg@1.0 to pkg@2.0 has a HIGH\nbreaking change risk. The changelog indicates removed APIs and changed default behavior\nthat may affect consumers.\"]\n\n### Breaking Change Details\n[Summary from mcp_snyk_snyk_breakability_check — what changed between versions, which APIs were\nremoved\u002Frenamed\u002Fmodified, migration notes if available]\n\n### Exact Changes Required\nTo apply this fix manually, make the following changes:\n\n**1. Manifest change** ([path\u002Fto\u002Fmanifest]):\n[Exact content to add or modify — the override\u002Fresolution entry or version bump]\n\n**2. Regenerate lockfile**:\n[Exact command to run]\n\n**3. Validate**:\n[Command to re-run SCA scan and tests]\n\n### Alternatives\n- Wait for [parent_package] to release a version that includes the fixed transitive\n- Evaluate replacing [vulnerable_package] with an alternative\n- Accept the risk and document in your security policy\n```\n\n**After producing the advisory:**\n- Do NOT make any file changes\n- Do NOT proceed to Phase 5\n- Send `mcp_snyk_snyk_send_feedback` with `fixedExistingIssuesCount: 0`\n- STOP\n\n---\n\n## Phase 5: Validation\n\n### Step 5.1: Re-run Scan\nRun same scan as Phase 2 (using identical `path` parameter). Verify ALL targeted instances are resolved.\n\n**For Code vulnerabilities - If any instances still present:**\n- Review the fix attempt for that specific instance\n- Try alternative approach\n- Maximum 3 total attempts per instance, then report partial success\u002Ffailure\n- If new vulnerabilities introduced: fix them (iterate, max 3 total). If unable to produce clean fix: revert ALL changes and report failure\n\n**For SCA vulnerabilities - If vulnerability still present:**\n- Check if lockfile was properly updated\n- Try explicit version install using the package manager's exact-version syntax\n- Maximum 3 attempts, then STOP and report failure\n\n**If NEW vulnerabilities introduced by an SCA upgrade:**\n- **New severity LOWER than fixed**: Accept (net security improvement)\n- **New severity EQUAL OR HIGHER**: Try an alternative version. Run `mcp_snyk_snyk_breakability_check` on each candidate before attempting — do not blindly try higher versions without assessing their risk. Up to 3 iterations.\n- If no clean version exists: Revert and report as unfixable\n\n### Step 5.1a: Additional Issues Fixed (SCA Only)\nCompare pre\u002Fpost scan. Record all additional vulnerabilities resolved by the upgrade (ID, severity, title).\n\n### Step 5.2: Run Tests\nRun project tests (`npm test`, `pytest`, etc.).\n\n*For Code vulnerabilities:*\n- On failure: prefer adjusting fix over changing tests; only modify tests for legitimate behavioral changes. Max 2 attempts.\n\n*For SCA vulnerabilities:*\n- On failure: prefer adjusting code to match the new API over downgrading. Apply mechanical fixes only (renamed imports, signature changes). Max 2 attempts.\n\n### Step 5.3: Run Linting\nRun project linter if configured; fix any formatting issues introduced.\n\n---\n\n## Phase 6: Summary & PR Prompt\n\n### Step 6.1: Display Summary\n\nDisplay a concise remediation summary including:\n- Vulnerability ID, severity, title, CWE (code) or package upgrade (SCA)\n- Instance\u002Ffix count and per-instance status (✅ Fixed \u002F ⚠️ Partial \u002F ❌ Failed)\n- \"What Was Fixed\": 2–3 plain-English sentences, no code snippets\n- Validation table: Snyk re-scan, build, lint, tests (✅\u002F⚠️\u002F❌)\n- For SCA: strategy (Direct\u002FParent\u002FTransitive), breaking change risk (LOW\u002FMEDIUM\u002FHIGH), risk source (Breakability Check \u002F Codebase Usage Analysis), breaking change summary, and list additional issues fixed by the upgrade\n\nEnd with a visually separated PR prompt:\n```\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n## Should I create a PR for this fix? (yes \u002F no)\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n```\n\n### Step 6.2: Send Feedback\n```\nmcp_snyk_snyk_send_feedback:\n  fixedExistingIssuesCount: [total issues fixed]\n  preventedIssuesCount: 0\n  path: [absolute project path]\n```\n\n### Step 6.3: Wait for User Response\n**IMPORTANT**: Do NOT proceed until the user explicitly confirms.\n\n---\n\n## Phase 6B: Batch Summary (Batch Mode Only)\n\n### Step 6B.1: Summary\nDisplay overall results (attempted\u002Ffixed\u002Fpartial\u002Ffailed\u002Fskipped), breakdown by severity (fixed vs remaining), detailed per-item results for code and SCA vulns, files modified, validation results, and a table of issues NOT fixed with reasons.\n\nEnd with:\n```\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n## Should I create a single PR for all these fixes? (yes \u002F no)\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n```\n\n### Step 6B.2: Send Batch Feedback\n```\nmcp_snyk_snyk_send_feedback:\n  path: [project root]\n  fixedExistingIssuesCount: [total across all vulns]\n  preventedIssuesCount: 0\n```\n\n### Step 6B.3: Batch PR\nBranch: `fix\u002Fsecurity-batch-YYYYMMDD` or `fix\u002Fsecurity-critical-high-batch`.\nDefault: single commit with all changes (offer per-vuln commits if user prefers).\nPR body: summary table of code fixes (vuln, file, CWE, severity), dependency upgrades (package, old→new, CVEs fixed), validation checklist, note that each fix was validated independently.\n\n---\n\n## Phase 7: Create PR (If Confirmed)\n\n### Step 7.1: Check Git Status\n```bash\ngit status\n```\nVerify uncommitted changes exist and are security-fix related. If none: report and STOP.\n\n### Step 7.2: Create Branch\nFormat: `fix\u002Fsecurity-\u003Cidentifier>` (e.g., `fix\u002Fsecurity-SNYK-JS-LODASH-1018905`, `fix\u002Fsecurity-cwe-79-xss`, `fix\u002Fsecurity-path-traversal-server`).\n```bash\ngit checkout -b fix\u002Fsecurity-\u003Cidentifier>\n```\n\n### Step 7.3: Stage and Commit\nStage only security-fix related files. Do NOT stage unrelated changes, IDE files, or build artifacts.\n```bash\ngit add \u003Cfiles>\ngit commit -m \"fix(security): \u003Cdescription>\n\nResolves: [Snyk ID or CVE]\nSeverity: [Critical\u002FHigh\u002FMedium\u002FLow]\"\n```\n\n### Step 7.4: Push and Create PR\n```bash\ngit push -u origin fix\u002Fsecurity-\u003Cidentifier>\ngh pr create --title \"Security: \u003Ctitle>\" --body \"\u003Cbody>\" --base main\n```\nDo NOT use `--label` flags.\n\nPR body should include: vulnerability details (ID, severity, type), changes made, files changed, and validation checklist (Snyk scan passes, tests pass, no new vulnerabilities introduced).\n\n### Step 7.5: Output Confirmation\nDisplay PR URL, branch, title, and next steps (review, request reviews, merge when approved).\n\n---\n\n## Error Handling\n\n| Situation | Action |\n|-----------|--------|\n| Auth error | Run `mcp_snyk_snyk_auth`, retry once; if still failing STOP |\n| Scan timeout\u002Ffailure | Retry once; if still failing STOP and report |\n| Vulnerability not found | Report clearly and STOP — do not guess or fix something else |\n| Unfixable code vuln | Add TODO comment with context; report with manual remediation suggestions; no partial\u002Fbroken fixes |\n| SCA — no fix available | Follow Step 2.5. Produce the No Fix Available Report and STOP |\n| SCA — fix declined or skipped | Clean exit — produce Full Advisory (Phase 4a) if not already shown, send feedback with `fixedExistingIssuesCount: 0`, STOP |\n| Partial success (code) | Keep successful fixes; add TODO for unfixed instances; report partial success with breakdown |\n| Not a git repo | STOP — cannot create PR |\n| Branch already exists | Generate unique branch name with timestamp |\n| gh not authenticated | Suggest `gh auth login` |\n\n**Rollback triggers** (revert ALL changes if):\n- Cannot produce clean code fix after 3 attempts (or new vulnerabilities introduced)\n- Tests fail and cannot be reasonably fixed after 2 mechanical fix attempts\n- Fix would require changing business logic\n- Dependency resolution completely fails\n\n---\n\n## Constraints\n\n**Single Mode**: Fix one vulnerability TYPE per run (all instances). Minimal changes only. No new vulnerabilities. Tests must pass. No scope creep or refactoring. Always prompt for PR.\n\n**SCA-specific (Single and Batch)**:\n- **Breakability gates all SCA fixes** — Do NOT apply any SCA upgrade without first running `mcp_snyk_snyk_breakability_check` and following the risk-based decision tree\n- **Confirmation for HIGH risk** — In interactive sessions, HIGH risk fixes require explicit user confirmation. MEDIUM auto-applies with documented reasoning. See Step 4.2.\n- **Version selection considers breakability** — When multiple versions fix a vulnerability, prefer lowest breakability risk, not just lowest version number\n- **No fix path means no fix attempt** — See Step 2.5\n\n**Batch Mode adds**: User must approve plan before starting. Max 20 vulnerabilities, 15 files. Validate each fix before proceeding. Partial success allowed. Single PR for all batch fixes (unless user requests otherwise).\n\n---\n\n## Completion Checklist\n\n**Single Mode**: vulnerability documented → fix path verified for SCA (or No Fix Available Report) → remediation strategy determined for SCA (A\u002FB\u002FC) → breaking change assessment for SCA → fix applied (or Full Advisory) → re-scan clean → tests pass → summary shown → Snyk feedback sent → **PR prompt asked** (if fix applied) → PR created if confirmed.\n\n**Batch Mode**: full scan done → plan shown and approved → all items attempted → each fix validated → results tracked → batch summary shown → Snyk feedback sent → **PR prompt asked** → single PR created if confirmed.\n","# Snyk Fix (All-in-One)\n\nComplete security remediation workflow: Parse → Scan → Analyze → Fix → Validate → Summary → (Optional) PR\n\n**Modes**:\n- **Single Mode** (default): Fix one vulnerability type at a time (all instances in same file)\n- **Batch Mode**: Fix multiple vulnerabilities in priority order (triggered by \"all\", \"batch\", severity filter, or count)\n\n---\n\n## Phase 1: Input Parsing\n\nParse user input to extract:\n- **mode**: Single (default) or Batch\n- **scan_type**: `code`, `sca`, or `both` (inferred from context)\n- **target_vulnerability**: Specific issue ID, CVE, package name, file, or vuln type\n- **target_path**: File or directory (defaults to project root)\n- **severity_filter** \u002F **max_fixes**: For batch mode (default max: 20)\n\n### Mode & Scan Type Detection\n\n| Signal | Mode | Scan Type |\n|--------|------|-----------|\n| \"all\", severity filter, count (\"top 5\"), or \"batch\" | Batch | both |\n| Specific vuln ID, single type, file reference, or no batch indicators | Single (default) | — |\n| Explicit \"code\"\u002F\"sast\"\u002F\"static\" | — | code |\n| Explicit \"sca\"\u002F\"dependency\"\u002F\"package\"\u002Fpackage manager name | — | sca |\n| `SNYK-` or `CVE-` ID provided | — | both |\n| Vulnerability type (XSS, SQL injection, path traversal, etc.) or file reference | — | code |\n| Package name reference | — | sca |\n| No hints | — | both (highest priority issue) |\n\n---\n\n## Phase 1B: Batch Mode Planning (Skip if Single Mode)\n\n1. Run both `mcp_snyk_snyk_code_scan` and `mcp_snyk_snyk_sca_scan` on project root.\n2. Filter by user-specified severity, type, path, or count.\n3. Group by vulnerability type (same ID + file for code; same package for SCA). Sort Critical → High → Medium → Low; within same priority, prefer issues with available fixes.\n4. Display fix plan as a numbered table (index, type, severity, target, instance count) with estimated file\u002Fpackage changes. **Wait for user confirmation before proceeding.**\n   - If user says \"adjust\": allow plan modification.\n5. Execute fixes in order (Phase 3 or 4 per item → Phase 5 validate → track result). On failure: stop if `stop_on_failure=true`, else continue.\n6. Proceed to Phase 6B after all attempts.\n\n**Batch limits**: max 20 vulnerabilities, max 15 files modified, max 3 fix attempts per item.\n\n---\n\n## Phase 2: Discovery\n\n### Step 2.1: Run Scan(s)\n\nInvoke scans with the target path. Examples:\n\n```\n# Code scan\nmcp_snyk_snyk_code_scan:\n  path: \"\u002Fabsolute\u002Fpath\u002Fto\u002Fproject\"   # or subdirectory for targeted scans\n\n# SCA scan\nmcp_snyk_snyk_sca_scan:\n  path: \"\u002Fabsolute\u002Fpath\u002Fto\u002Fproject\"   # always project root (manifest location)\n```\n\n- Code: `mcp_snyk_snyk_code_scan` on target path\n- SCA: `mcp_snyk_snyk_sca_scan` on project root\n- Both: run in parallel\n\n### Step 2.2: Select Target\n- If user specified: find matching issue. If not found: report and STOP.\n- If not specified: select highest priority type using: Critical+exploit > Critical > High+exploit > High > Medium > Low. Prefer issues with available fixes.\n\n### Step 2.3: Group Instances (Code Only)\nAfter selecting vulnerability type, collect ALL instances of that same Snyk ID in the same file. Fix all of them together.\n\n### Step 2.4: Document Target\nDisplay a brief summary: type (Code\u002FSCA), ID, severity, title, and for Code — instance count + file\u002Fline table; for SCA — package, fix version, dependency path.\n\n### Step 2.5: Check for Fix Path (SCA Only)\n\n**⚠️ If the scan results do not report any fix version or upgrade path for the selected SCA vulnerability, do NOT proceed to Phase 4.** The agent must not attempt to discover or invent a fix on its own when Snyk has no recommended remediation.\n\nInstead, produce a **No Fix Available Report** and STOP:\n\n```\n## No Fix Available\n\n| Vulnerability | [Title] |\n|---------------|---------|\n| **ID** | [Snyk Issue ID] |\n| **Severity** | [Critical \u002F High \u002F Medium \u002F Low] |\n| **Package** | [package@current_version] |\n| **Dependency Path** | [direct \u002F transitive via X → Y → Z] |\n\n### Why No Fix Was Applied\nSnyk does not report a fix version or upgrade path for this vulnerability.\nThe agent will not attempt to resolve issues where no known fix exists.\n\n### Alternatives to Consider\n- Monitor for a future fix release from the package maintainer\n- Evaluate replacing the package with a maintained alternative\n- Apply a manual workaround if the vulnerability context allows it\n- Accept the risk and document in your security policy\n```\n\nAfter producing this report:\n- Send `mcp_snyk_snyk_send_feedback` with `fixedExistingIssuesCount: 0`\n- Do NOT make any file changes\n- STOP\n\n---\n\n## Phase 3: Remediation (Code Vulnerabilities)\n\n### Step 3.1: Understand\nRead all vulnerable locations. Identify type (SQL injection, XSS, path traversal, command injection, sensitive data exposure, hardcoded secrets, crypto issues, etc.). Review Snyk's remediation guidance.\n\n### Step 3.2: Plan\nDocument: vulnerability type, root cause, fix approach, security mechanism, instance count.\n\nCommon patterns:\n- SQL Injection → parameterized queries\n- Command Injection → input validation + escaping or avoid shell\n- Path Traversal → canonicalize + validate against allowed base\n- XSS → output encoding\u002Fsanitization for context\n- Hardcoded Secrets → move to env vars \u002F secrets manager\n\n### Step 3.3: Apply Fix to ALL Instances\n- Fix from bottom to top of file (avoid line number shifts)\n- Minimal change; use standard library\u002Fframework security features\n- Create shared helper if 3+ instances share identical fix pattern\n- Add security-relevant comments where non-obvious\n- Do NOT refactor unrelated code or change business logic\n\n---\n\n## Phase 4: Remediation (SCA Vulnerabilities)\n\n**Skip to Phase 5 if this is a Code vulnerability (already handled in Phase 3).**\n\n### Step 4.1: Determine Remediation Strategy\n\nAnalyze the dependency path and determine which strategy applies. Exactly one of these three strategies must be selected before proceeding:\n\n**Strategy A — Direct Upgrade**\nThe vulnerable package is a direct dependency in the project manifest. Upgrade it to a version where the vulnerability is fixed.\n\n**Strategy B — Parent Upgrade**\nThe vulnerable package is a transitive dependency. A newer version of the direct (parent) dependency pulls in a fixed version of the transitive. Upgrade the parent.\n\n**Strategy C — Transitive Fix**\nThe vulnerable package is a transitive dependency, but no available version of the parent pulls in a fixed transitive. Resolve the transitive to a fixed version using the lowest-impact mechanism available in the ecosystem.\n\n#### How to choose:\n\n1. Is the vulnerable package declared directly in the project manifest?\n   - **Yes** → **Strategy A**\n   - **No** → Continue to step 2\n\n2. Identify the direct dependency (parent) that pulls in the vulnerable transitive. Does any available version of the parent resolve the vulnerable transitive to a fixed version?\n   - **Yes** → **Strategy B** (upgrade the parent)\n   - **No** → **Strategy C** (transitive fix)\n\nIf the application directly imports or uses the transitive dependency (not just via the parent), note this — it affects breaking change analysis for Strategy C.\n\nDocument the chosen strategy:\n```\n## Remediation Strategy\n- **Strategy**: [A: Direct Upgrade | B: Parent Upgrade | C: Transitive Fix]\n- **Target package to change**: [package@current → package@target]\n- **Parent dependency** (if B\u002FC): [parent@current]\n- **Manifest file**: [path to manifest]\n```\n\n### Step 4.2: Breaking Change Assessment\n\n**⚠️ ALWAYS run `mcp_snyk_snyk_breakability_check` BEFORE applying any changes.** If the tool is unavailable, errors out, or does not return a LOW\u002FMEDIUM\u002FHIGH risk level, proceed to Step 4.2a.\n\nCall `mcp_snyk_snyk_breakability_check` with the package that will actually change in the manifest:\n\n| Strategy | Check breakability on |\n|----------|----------------------|\n| A (Direct Upgrade) | The direct dependency being upgraded |\n| B (Parent Upgrade) | The parent dependency being upgraded |\n| C (Transitive Fix) | The transitive dependency being resolved to a new version |\n\n#### Breakability Decision Tree\n\nThe breakability result (LOW \u002F MEDIUM \u002F HIGH) is a general likelihood assessment — it is not a confirmation of actual breakage in this specific project. Use the result to determine the next action.\n\n**Interactive vs. autonomous execution**: when a human is in the loop (interactive session), present trade-offs and ask for confirmation at HIGH risk. When running autonomously (background agent, no human available), the agent must evaluate the same evidence a human would — vulnerability severity, breaking change risk, breaking change details — make the decision itself, and **document its reasoning** in the output. An autonomous agent must never block waiting for input that will not come.\n\n**Strategy A (Direct Upgrade) and Strategy B (Parent Upgrade):**\n\n| Risk | Action |\n|------|--------|\n| **LOW** | Auto-apply the upgrade. Proceed to Step 4.4. |\n| **MEDIUM** | Auto-apply the upgrade. Document the breaking change summary and reasoning in the remediation summary. |\n| **HIGH** | **Interactive**: present the full trade-off (vulnerability details, breaking change summary, exact proposed changes) and ask the user whether to proceed. **Autonomous**: evaluate the full trade-off, decide whether to apply or produce a Full Advisory (Phase 4a), and document the reasoning. |\n\n**Strategy B → fallback to C:** If Strategy B gets a HIGH breakability result and the decision (user or agent) is to not proceed, fall back to Strategy C. Re-run `mcp_snyk_snyk_breakability_check` on the transitive version jump and follow the Strategy C decision tree below.\n\n**Strategy C (Transitive Fix):**\n\n| Risk | Action |\n|------|--------|\n| **LOW** | Auto-apply the fix. Proceed to Step 4.4. |\n| **MEDIUM** | Auto-apply the upgrade. Document the breaking change summary and reasoning in the remediation summary. |\n| **HIGH** | **Interactive**: present the full trade-off and ask the user whether to proceed. If the vulnerability is **Critical severity with a known exploit**, emphasize the urgency. **Autonomous**: evaluate the full trade-off, decide whether to apply or produce a Full Advisory (Phase 4a), and document the reasoning. |\n\n### Step 4.2a: Breakability Fallback — Semver + Usage Analysis\n\n**This step activates when `mcp_snyk_snyk_breakability_check` is unavailable (tool not found, errors out, times out) OR returns a response without a LOW\u002FMEDIUM\u002FHIGH risk level** (e.g., \"no additional breakability context available\"). If breakability returned a valid risk level, skip this step entirely.\n\nWhen breakability data is unavailable, derive a substitute risk level by combining **semver distance** and **codebase usage**:\n\n1. **Determine the semver distance** between the current version and the target version:\n   - **Patch** bump (e.g., 1.2.3 → 1.2.5): lowest inherent risk\n   - **Minor** bump (e.g., 1.2.3 → 1.3.0): moderate inherent risk\n   - **Major** bump (e.g., 1.2.3 → 2.0.0): highest inherent risk\n\n2. **Search the codebase for direct usages of the package being upgraded.** Look for imports, requires, includes, or other dependency references using patterns appropriate to the project's language and ecosystem. The agent determines the correct search patterns based on the ecosystem — do not use hardcoded patterns.\n\n3. **Combine both signals to derive a substitute risk level:**\n\n| Semver Distance | No direct usage | Light usage | Heavy \u002F complex usage |\n|-----------------|-----------------|-------------|----------------------|\n| **Patch** | LOW | LOW | LOW |\n| **Minor** | LOW | MEDIUM | MEDIUM |\n| **Major** | HIGH | HIGH | HIGH |\n\n4. **Feed the substitute risk level into the same Breakability Decision Tree from Step 4.2.** No separate code path — the same thresholds and actions apply.\n\n**Important**: when a substitute risk level is used, note this in the remediation summary (Phase 6) so the user knows the risk assessment was derived from codebase analysis, not from breakability data.\n\n### Step 4.3: Version Selection\n\nWhen multiple versions fix the vulnerability, do NOT blindly pick the lowest version number. Optimize for:\n\n1. Fixes the target vulnerability\n2. Lowest breakability risk (run `mcp_snyk_snyk_breakability_check` on candidates if needed)\n3. Lowest version number (tiebreaker only)\n\n### Step 4.4: Apply Fix\n\n**Only reach this step if the breakability decision allows it (auto-apply or user\u002Fagent confirmed).**\n\n**Strategy A (Direct Upgrade):**\nUpdate the version in the manifest and run the ecosystem's install command (`npm install pkg@version`, `yarn upgrade`, `go get`, `pip install`, `mvn dependency:resolve`, etc.). Preserve file formatting and comments.\n\n**Strategy B (Parent Upgrade):**\nUpdate the parent dependency version in the manifest and run the ecosystem's install command. After installation, verify that the resolved transitive is now the fixed version.\n\n**Strategy C (Transitive Fix):**\nUse the lowest-impact mechanism that makes the resolver choose a fixed version of the transitive. The exact mechanism is ecosystem-dependent — do not assume one universal ordering.\n\n1. **Resolver-only update first**: Refresh the lockfile or run the ecosystem's update\u002Fresolve command for the vulnerable package. This is appropriate when the fixed version is already allowed by the existing constraints.\n2. **If that fails**, inspect the ecosystem and repo layout, then choose the appropriate native resolver-control mechanism: top-level constraint\u002Fdeclaration, central dependency-management entry, force\u002Foverride\u002Fresolution, exclusion, or replacement.\n3. **Prefer the narrowest effective scope.** Use a stronger override\u002Fforce\u002Freplace only when a normal declaration or narrower exclusion cannot make the resolver choose the fixed version.\n4. **Hard pin only as a last resort.**\n\n#### Reference: common install\u002Fresolve commands\n\n| Package Manager | Command |\n|-----------------|---------|\n| npm (major upgrade) | `npm install \u003Cpkg>@\u003Cversion>` |\n| npm (minor\u002Fpatch) | `npm install` |\n| yarn | `yarn install` or `yarn upgrade \u003Cpkg>@\u003Cversion>` |\n| pip | `pip install -r requirements.txt` |\n| maven | `mvn dependency:resolve` |\n\nThis table is not exhaustive — use the appropriate command for the project's ecosystem.\n\n**If installation fails:**\n- If sandbox\u002Fpermission issue: retry with elevated permissions\n- If dependency conflict: try a different version or note as unfixable\n- Revert manifest changes if resolution completely fails\n- Document the failure reason\n\n---\n\n## Phase 4a: Full Advisory — SCA No-Apply Path\n\n**Enter this phase when the decision is to NOT apply an SCA fix** — whether because the user declined, or because the agent (in autonomous mode) determined the risk outweighs the benefit.\n\nProduce an advisory instead of making changes.\n\n### Advisory Output Format\n\n```\n## Security Advisory — Manual Action Required\n\n### Vulnerability\n- **ID**: [Snyk Issue ID]\n- **Severity**: [Critical | High | Medium | Low]\n- **Package**: [vulnerable_package@current_version]\n- **Title**: [vulnerability title]\n\n### Why This Was Not Auto-Applied\n[1-2 sentences: e.g., \"The required transitive fix from pkg@1.0 to pkg@2.0 has a HIGH\nbreaking change risk. The changelog indicates removed APIs and changed default behavior\nthat may affect consumers.\"]\n\n### Breaking Change Details\n[Summary from mcp_snyk_snyk_breakability_check — what changed between versions, which APIs were\nremoved\u002Frenamed\u002Fmodified, migration notes if available]\n\n### Exact Changes Required\nTo apply this fix manually, make the following changes:\n\n**1. Manifest change** ([path\u002Fto\u002Fmanifest]):\n[Exact content to add or modify — the override\u002Fresolution entry or version bump]\n\n**2. Regenerate lockfile**:\n[Exact command to run]\n\n**3. Validate**:\n[Command to re-run SCA scan and tests]\n\n### Alternatives\n- Wait for [parent_package] to release a version that includes the fixed transitive\n- Evaluate replacing [vulnerable_package] with an alternative\n- Accept the risk and document in your security policy\n```\n\n**After producing the advisory:**\n- Do NOT make any file changes\n- Do NOT proceed to Phase 5\n- Send `mcp_snyk_snyk_send_feedback` with `fixedExistingIssuesCount: 0`\n- STOP\n\n---\n\n## Phase 5: Validation\n\n### Step 5.1: Re-run Scan\nRun same scan as Phase 2 (using identical `path` parameter). Verify ALL targeted instances are resolved.\n\n**For Code vulnerabilities - If any instances still present:**\n- Review the fix attempt for that specific instance\n- Try alternative approach\n- Maximum 3 total attempts per instance, then report partial success\u002Ffailure\n- If new vulnerabilities introduced: fix them (iterate, max 3 total). If unable to produce clean fix: revert ALL changes and report failure\n\n**For SCA vulnerabilities - If vulnerability still present:**\n- Check if lockfile was properly updated\n- Try explicit version install using the package manager's exact-version syntax\n- Maximum 3 attempts, then STOP and report failure\n\n**If NEW vulnerabilities introduced by an SCA upgrade:**\n- **New severity LOWER than fixed**: Accept (net security improvement)\n- **New severity EQUAL OR HIGHER**: Try an alternative version. Run `mcp_snyk_snyk_breakability_check` on each candidate before attempting — do not blindly try higher versions without assessing their risk. Up to 3 iterations.\n- If no clean version exists: Revert and report as unfixable\n\n### Step 5.1a: Additional Issues Fixed (SCA Only)\nCompare pre\u002Fpost scan. Record all additional vulnerabilities resolved by the upgrade (ID, severity, title).\n\n### Step 5.2: Run Tests\nRun project tests (`npm test`, `pytest`, etc.).\n\n*For Code vulnerabilities:*\n- On failure: prefer adjusting fix over changing tests; only modify tests for legitimate behavioral changes. Max 2 attempts.\n\n*For SCA vulnerabilities:*\n- On failure: prefer adjusting code to match the new API over downgrading. Apply mechanical fixes only (renamed imports, signature changes). Max 2 attempts.\n\n### Step 5.3: Run Linting\nRun project linter if configured; fix any formatting issues introduced.\n\n---\n\n## Phase 6: Summary & PR Prompt\n\n### Step 6.1: Display Summary\n\nDisplay a concise remediation summary including:\n- Vulnerability ID, severity, title, CWE (code) or package upgrade (SCA)\n- Instance\u002Ffix count and per-instance status (✅ Fixed \u002F ⚠️ Partial \u002F ❌ Failed)\n- \"What Was Fixed\": 2–3 plain-English sentences, no code snippets\n- Validation table: Snyk re-scan, build, lint, tests (✅\u002F⚠️\u002F❌)\n- For SCA: strategy (Direct\u002FParent\u002FTransitive), breaking change risk (LOW\u002FMEDIUM\u002FHIGH), risk source (Breakability Check \u002F Codebase Usage Analysis), breaking change summary, and list additional issues fixed by the upgrade\n\nEnd with a visually separated PR prompt:\n```\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n## Should I create a PR for this fix? (yes \u002F no)\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n```\n\n### Step 6.2: Send Feedback\n```\nmcp_snyk_snyk_send_feedback:\n  fixedExistingIssuesCount: [total issues fixed]\n  preventedIssuesCount: 0\n  path: [absolute project path]\n```\n\n### Step 6.3: Wait for User Response\n**IMPORTANT**: Do NOT proceed until the user explicitly confirms.\n\n---\n\n## Phase 6B: Batch Summary (Batch Mode Only)\n\n### Step 6B.1: Summary\nDisplay overall results (attempted\u002Ffixed\u002Fpartial\u002Ffailed\u002Fskipped), breakdown by severity (fixed vs remaining), detailed per-item results for code and SCA vulns, files modified, validation results, and a table of issues NOT fixed with reasons.\n\nEnd with:\n```\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n## Should I create a single PR for all these fixes? (yes \u002F no)\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n```\n\n### Step 6B.2: Send Batch Feedback\n```\nmcp_snyk_snyk_send_feedback:\n  path: [project root]\n  fixedExistingIssuesCount: [total across all vulns]\n  preventedIssuesCount: 0\n```\n\n### Step 6B.3: Batch PR\nBranch: `fix\u002Fsecurity-batch-YYYYMMDD` or `fix\u002Fsecurity-critical-high-batch`.\nDefault: single commit with all changes (offer per-vuln commits if user prefers).\nPR body: summary table of code fixes (vuln, file, CWE, severity), dependency upgrades (package, old→new, CVEs fixed), validation checklist, note that each fix was validated independently.\n\n---\n\n## Phase 7: Create PR (If Confirmed)\n\n### Step 7.1: Check Git Status\n```bash\ngit status\n```\nVerify uncommitted changes exist and are security-fix related. If none: report and STOP.\n\n### Step 7.2: Create Branch\nFormat: `fix\u002Fsecurity-\u003Cidentifier>` (e.g., `fix\u002Fsecurity-SNYK-JS-LODASH-1018905`, `fix\u002Fsecurity-cwe-79-xss`, `fix\u002Fsecurity-path-traversal-server`).\n```bash\ngit checkout -b fix\u002Fsecurity-\u003Cidentifier>\n```\n\n### Step 7.3: Stage and Commit\nStage only security-fix related files. Do NOT stage unrelated changes, IDE files, or build artifacts.\n```bash\ngit add \u003Cfiles>\ngit commit -m \"fix(security): \u003Cdescription>\n\nResolves: [Snyk ID or CVE]\nSeverity: [Critical\u002FHigh\u002FMedium\u002FLow]\"\n```\n\n### Step 7.4: Push and Create PR\n```bash\ngit push -u origin fix\u002Fsecurity-\u003Cidentifier>\ngh pr create --title \"Security: \u003Ctitle>\" --body \"\u003Cbody>\" --base main\n```\nDo NOT use `--label` flags.\n\nPR body should include: vulnerability details (ID, severity, type), changes made, files changed, and validation checklist (Snyk scan passes, tests pass, no new vulnerabilities introduced).\n\n### Step 7.5: Output Confirmation\nDisplay PR URL, branch, title, and next steps (review, request reviews, merge when approved).\n\n---\n\n## Error Handling\n\n| Situation | Action |\n|-----------|--------|\n| Auth error | Run `mcp_snyk_snyk_auth`, retry once; if still failing STOP |\n| Scan timeout\u002Ffailure | Retry once; if still failing STOP and report |\n| Vulnerability not found | Report clearly and STOP — do not guess or fix something else |\n| Unfixable code vuln | Add TODO comment with context; report with manual remediation suggestions; no partial\u002Fbroken fixes |\n| SCA — no fix available | Follow Step 2.5. Produce the No Fix Available Report and STOP |\n| SCA — fix declined or skipped | Clean exit — produce Full Advisory (Phase 4a) if not already shown, send feedback with `fixedExistingIssuesCount: 0`, STOP |\n| Partial success (code) | Keep successful fixes; add TODO for unfixed instances; report partial success with breakdown |\n| Not a git repo | STOP — cannot create PR |\n| Branch already exists | Generate unique branch name with timestamp |\n| gh not authenticated | Suggest `gh auth login` |\n\n**Rollback triggers** (revert ALL changes if):\n- Cannot produce clean code fix after 3 attempts (or new vulnerabilities introduced)\n- Tests fail and cannot be reasonably fixed after 2 mechanical fix attempts\n- Fix would require changing business logic\n- Dependency resolution completely fails\n\n---\n\n## Constraints\n\n**Single Mode**: Fix one vulnerability TYPE per run (all instances). Minimal changes only. No new vulnerabilities. Tests must pass. No scope creep or refactoring. Always prompt for PR.\n\n**SCA-specific (Single and Batch)**:\n- **Breakability gates all SCA fixes** — Do NOT apply any SCA upgrade without first running `mcp_snyk_snyk_breakability_check` and following the risk-based decision tree\n- **Confirmation for HIGH risk** — In interactive sessions, HIGH risk fixes require explicit user confirmation. MEDIUM auto-applies with documented reasoning. See Step 4.2.\n- **Version selection considers breakability** — When multiple versions fix a vulnerability, prefer lowest breakability risk, not just lowest version number\n- **No fix path means no fix attempt** — See Step 2.5\n\n**Batch Mode adds**: User must approve plan before starting. Max 20 vulnerabilities, 15 files. Validate each fix before proceeding. Partial success allowed. Single PR for all batch fixes (unless user requests otherwise).\n\n---\n\n## Completion Checklist\n\n**Single Mode**: vulnerability documented → fix path verified for SCA (or No Fix Available Report) → remediation strategy determined for SCA (A\u002FB\u002FC) → breaking change assessment for SCA → fix applied (or Full Advisory) → re-scan clean → tests pass → summary shown → Snyk feedback sent → **PR prompt asked** (if fix applied) → PR created if confirmed.\n\n**Batch Mode**: full scan done → plan shown and approved → all items attempted → each fix validated → results tracked → batch summary shown → Snyk feedback sent → **PR prompt asked** → single PR created if confirmed.\n",{"name":5,"license":14,"metadata":23,"description":26,"allowed-tools":27,"compatibility":28},{"author":24,"version":25},"Snyk","1.1.0","Complete security remediation workflow. Scans code for vulnerabilities using Snyk, \nfixes them, validates the fix, and optionally creates a PR. Supports both single-issue\nand batch mode for multiple vulnerabilities. Use this skill when:\n- User asks to fix security vulnerabilities\n- User mentions \"snyk fix\", \"security fix\", or \"remediate vulnerabilities\"\n- User wants to fix a specific CVE, Snyk ID, or vulnerability type (XSS, SQL injection, path traversal, etc.)\n- User wants to upgrade a vulnerable dependency\n- User asks to \"fix all\" vulnerabilities or \"fix all high\u002Fcritical\" issues (batch mode)\n","mcp_snyk_snyk_code_scan mcp_snyk_snyk_sca_scan mcp_snyk_snyk_breakability_check mcp_snyk_snyk_auth mcp_snyk_snyk_send_feedback Read Write Edit Bash Grep","Requires Snyk MCP server connection and authenticated Snyk account.\nGitHub CLI (gh) required for PR creation. Git repository required.\nSupports SAST for 20+ languages and SCA for all major package managers.\n","main","cd1d94757d590093507ef8ac26299eab8bc20478","claude_skills_libraries\u002Fsnyk-fix\u002Fcommand_directives\u002Fsynchronous_remediation\u002Fskills\u002Fsnyk-fix","https:\u002F\u002Fgithub.com\u002FASoudy\u002FAGS","https:\u002F\u002Fgithub.com\u002FASoudy","2026-05-23 09:43:12",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add ASoudy\u002FAGS --skill snyk-fix",{"tool":41,"command":42},"bunx","bunx skills add ASoudy\u002FAGS --skill snyk-fix",{"tool":44,"command":45},"pnpm","pnpm dlx skills add ASoudy\u002FAGS --skill snyk-fix","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FASoudy\u002FAGS\u002Fblob\u002Fmain\u002Fclaude_skills_libraries\u002Fsnyk-fix\u002Fcommand_directives\u002Fsynchronous_remediation\u002Fskills\u002Fsnyk-fix\u002FSKILL.md",true,[49],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"README.md","REFERENCE","参考文档",2490,"https:\u002F\u002Fgithub.com\u002FASoudy\u002FAGS\u002Fblob\u002Fmain\u002Fclaude_skills_libraries\u002Fsnyk-fix\u002Fcommand_directives\u002Fsynchronous_remediation\u002Fskills\u002Fsnyk-fix\u002FREADME.md",[56,64,71,78,85,92],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":18},"01M756BTEVC407T0QR8S420JWD","web-typography","Select, pair, and implement typefaces for web projects. Use when the user mentions \"font pairing\", \"which typeface\", \"line height\", \"responsive typography\", \"web font loading\", \"type hierarchy\", \"variable fonts\", \"FOUT\u002FFOIT\", or \"typographic scale\". Also trigger when choosing between system fonts and web fonts, optimizing font loading performance, or designing readable long-form content layouts. Covers readability evaluation, CSS implementation, and performance optimization. For overall UI design systems, see refactoring-ui. For dramatic typographic experiences, see top-design.","MIT","https:\u002F\u002Fgithub.com\u002FASoudy\u002FAGS\u002Fblob\u002Fmain\u002Fclaude_skills_libraries\u002Fwondelai-product-strategy\u002Fweb-typography\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M756B4RYF2CB17C33X6ZJQT5","ux-heuristics","Evaluate and improve interface usability using heuristic analysis. Use when the user mentions \"usability audit\", \"UX review\", \"users are confused\", \"heuristic evaluation\", \"form usability\", \"navigation problems\", \"Nielsen heuristics\", \"cognitive walkthrough\", or \"usability testing\". Also trigger when reviewing a design for usability issues, improving form completion rates, or evaluating information architecture and navigation. Covers Nielsens 10 heuristics, severity ratings, and information architecture. For visual design fixes, see refactoring-ui. For conversion-focused audits, see cro-methodology.","https:\u002F\u002Fgithub.com\u002FASoudy\u002FAGS\u002Fblob\u002Fmain\u002Fclaude_skills_libraries\u002Fwondelai-product-strategy\u002Fux-heuristics\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M756ANVFT0T6BAPV6Y93EPR6","traction-eos","Implement the Entrepreneurial Operating System (EOS) to align vision and execution across a company. Use when the user mentions \"EOS\", \"V\u002FTO\", \"quarterly rocks\", \"Level 10 meetings\", \"accountability chart\", \"IDS process\", \"Entrepreneurial Operating System\", or \"business operating system\". Also trigger when a growing company needs meeting structure, goal-setting frameworks, or a systematic approach to solving recurring organizational issues. Covers the six EOS components: Vision, People, Data, Issues, Process, Traction. For team motivation design, see drive-motivation. For lean experimentation, see lean-startup.","https:\u002F\u002Fgithub.com\u002FASoudy\u002FAGS\u002Fblob\u002Fmain\u002Fclaude_skills_libraries\u002Fwondelai-product-strategy\u002Ftraction-eos\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M756A7NZZMNJN9KZ33QGFHV6","top-design","Create award-winning, immersive web experiences at the level of Awwwards-featured agencies. Use when the user mentions \"premium website\", \"portfolio site\", \"scroll animations\", \"Awwwards quality\", \"brand experience\", \"cinematic web design\", \"parallax storytelling\", or \"agency-quality site\". Also trigger when building landing pages that need to impress, designing creative portfolios, or elevating a standard website to a memorable digital experience. Covers dramatic typography, purposeful motion, scroll-based composition, and performance-optimized animation. For foundational UI, see refactoring-ui. For type selection, see web-typography.","https:\u002F\u002Fgithub.com\u002FASoudy\u002FAGS\u002Fblob\u002Fmain\u002Fclaude_skills_libraries\u002Fwondelai-product-strategy\u002Ftop-design\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M7569J5G1NXM3RR194D52SGB","system-design","Design scalable distributed systems using structured approaches for load balancing, caching, database scaling, and message queues. Use when the user mentions \"system design\", \"scale this\", \"high availability\", \"rate limiter\", \"design a URL shortener\", \"system design interview\", \"capacity planning\", or \"distributed architecture\". Also trigger when estimating infrastructure requirements, choosing between microservices and monoliths, or designing for millions of concurrent users. Covers common system designs and back-of-the-envelope estimation. For data fundamentals, see ddia-systems. For resilience, see release-it.","https:\u002F\u002Fgithub.com\u002FASoudy\u002FAGS\u002Fblob\u002Fmain\u002Fclaude_skills_libraries\u002Fwondelai-product-strategy\u002Fsystem-design\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":60,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":18},"01M75691MJKE6PBA1EC398EKQT","storybrand-messaging","Clarify brand messaging using narrative structure that positions the customer as hero. Use when the user mentions \"brand message\", \"website copy\", \"elevator pitch\", \"one-liner\", \"messaging isnt resonating\", \"brand script\", \"StoryBrand framework\", or \"customer as hero\". Also trigger when rewriting homepage copy, crafting email nurture sequences, or creating consistent messaging across sales collateral and marketing materials. Covers landing page copy, marketing collateral, and consistent communication. For memorable messaging, see made-to-stick. For product positioning, see obviously-awesome.","https:\u002F\u002Fgithub.com\u002FASoudy\u002FAGS\u002Fblob\u002Fmain\u002Fclaude_skills_libraries\u002Fwondelai-product-strategy\u002Fstorybrand-messaging\u002FSKILL.md",[],[]]