More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Repair Shell Argument & Quoting Bugs

    1

    Repair Shell Argument & Quoting Bugs is a bounded ToolForge Labs workflow.

    $1

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Repair Shell Argument & Quoting Bugs

    Repair Shell Argument & Quoting Bugs

    Example session with this skill installed

    My Node.js script is failing to delete files with spaces in their names on Windows. It works on Mac. Here is the snippet: exec(rm -rf ${path}) where path comes from a user.

    • Read your context and instructions
    • Compiled the repair shell argument

    I have analyzed the snippet. The issue stems from using a template literal with exec, which invokes a shell. On Windows, rm -rf is not a native command, and the shell (cmd.exe or PowerShell) handles spaces and quotes differently than POSIX shells. Furthermore, passing raw user input to a shell string is a command injection risk.

    Diagnostic and Repair

    The code currently relies on shell-level parsing, which fails when path contains spaces because the shell interprets the space as an argument delimiter. I recommend switching to execFile or spawn to pass arguments directly as an array, bypassing the shell's quoting logic entirely. This also resolves the security risk.

    const { execFile } = require('child_process');
    const path = require('path');
    
    /**
     * Repairs the file deletion logic to be cross-platform and space-safe.
     * Uses direct argv passing instead of shell interpolation.
     */
    function safeDelete(targetPath) {
      // Map 'rm -rf' behavior to platform-specific commands if necessary,
      // but better to use a library like 'fs-extra' or Node's 'fs.rmSync'.
      // If we must use a subprocess:
      const isWin = process.platform === 'win32';
      
      if (isWin) {
        // Windows: use 'rmdir' for directories or 'del' for files via cmd
        // Or better, use the direct node fs API to avoid shell quirks
        return execFile('cmd.exe', ['/c', 'rd', '/s', '/q', targetPath]);
      } else {
        // POSIX: pass targetPath as a single array element
        return execFile('rm', ['-rf', targetPath]);
      }
    }
    

    Deterministic Test Plan

    To verify this fix, we use a local fixture with a complex filename:

    const assert = require('assert');
    const fs = require('fs');
    
    // Test: Filename with spaces and special characters
    const complexPath = './temp directory with "quotes" and spaces';
    if (!fs.existsSync(complexPath)) fs.mkdirSync(complexPath);
    
    safeDelete(complexPath, (err) => {
      assert.strictEqual(err, null, 'Should delete path with spaces without error');
      assert.strictEqual(fs.existsSync(complexPath), false, 'Path should be removed');
    });
    

    Next steps

    1. Replace all exec() calls involving variables with execFile() or spawn().
    2. Implement a path normalization step using path.resolve() to ensure absolute paths are used.
    3. Consider using fs.rm (Node 14.14+) for a native, non-process approach to deletion.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Repair Shell Argument & Quoting Bugs is a bounded ToolForge Labs workflow. Diagnose and repair process invocation, argv construction, shell-vs-direct execution, quoting, escaping, spaces, Unicode, environment expansion, and platform command differences. Works from full repositories or partial context such as snippets, logs, configuration, traces, and architecture notes. Produces concrete repair patterns and focused deterministic tests while preserving existing product/security policy. It works from a full repository or partial evidence such as snippets, logs, configuration, traces, tickets, and architecture notes. The skill preserves existing product and security policy, separates verified facts from assumptions, avoids invented execution claims, and produces concrete repair or review steps with focused deterministic validation or traceable evidence.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.

    Cannot verify production systems, external services, or facts that are not present in supplied evidence. With partial context it returns bounded diagnosis/review, explicit assumptions, and a deterministic validation plan rather than claiming successful execution.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 2 months ago

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    Use a clean branch or a controlled review workspace. Supply repository files, logs, traces, configuration, or evidence needed for the task. Review all patches/findings before merge or operational action; keep production credentials and destructive production actions out of the workflow.

    Listed2 months ago
    Updated9 days ago

    What's inside

    Frequently Asked Questions

    This skill addresses common but complex failures in shell execution, including incorrect quoting, improper escaping of special characters, space handling in file paths, and platform-specific syntax differences between environments like Bash and PowerShell.

    No, it is highly flexible; it can analyze full repositories or work with limited context such as error logs, CI/CD traces, configuration snippets, or even architecture notes to identify the root cause.

    The skill is designed to produce repair patterns that strictly adhere to your existing security policies, ensuring that fixes for argument injection or quoting bugs do not introduce new vulnerabilities.

    You receive a bounded ToolForge Labs workflow that generates concrete repair patterns and focused, deterministic tests to verify the fix across different operating systems.

    This skill is compatible with major AI agent frameworks and can be integrated into DevOps pipelines to automate the debugging of shell-related failures in automated tasks.

    New in Agents & Orchestration