Agent skill · software engineering · github

batch-files

Expert-level Windows batch file (.bat/.cmd) skill for writing, debugging, and maintaining CMD scripts. Use when asked to "create a batch file", "write a .bat script", "automate a Windows task", "CMD scripting", "batch automation", "scheduled task script", "Windows shell script", or when working with .bat/.cmd files in the workspace. Covers cmd.exe syntax, environment variables, control flow, string processing, error handling, and integration with system tools.

Why this skill is useful

Provides specific commands and patterns for batch file scripting that the AI wouldn't reliably generate on its own.

What it needs

About 11k tokens when loaded. Last updated 2026-08-07. 37,534 stars on the source repository.

What this skill does

Batch Files A comprehensive skill for creating, editing, debugging, and maintaining Windows batch files (.bat/.cmd) using cmd.exe. Applies to CLI tool development, system administration automation, scheduled tasks, file operations scripting, and PATH-based executable scripts. When to Use This Skill Creating or editing .bat or .cmd files Automating Windows tasks (file operations, deployments, backups) Building CLI tools intended for a bin/ folder on PATH Writing scheduled task scripts (SCHTASKS, Task Scheduler) Debugging batch script issues (variable expansion, error levels, quoting) Integrating batch scripts with external tools (curl, git, Node.js, Python) Scaffolding new batch-based projects with structured templates Prerequisites Windows NT-based OS (Windows 7 or later) cmd.exe (built-in) Optional: a bin/ directory on PATH for distributing scripts as commands Optional: PATHEXT configured to include .BAT;.CMD (default on Windows) Command Interpretation cmd.exe processes each line through four stages in order: 1. Variable substitution — %VAR% tokens are replaced with environment variable values. %0–%9 reference batch arguments. % expands to all arguments. 2. Quoting and escaping — Caret ^ escapes special characters (& < > ^). Quotation marks prevent interpretation of enclosed special characters. In batch files, %% yields a literal %. 3. Syntax parsing — Lines are split into pipelines ( ), compound commands (&, &&, ), and parenthesized groups ( ). 4. Redirection — > overwrites, >> appends, < reads input, 2> redirects stderr, 2>&1 merges stderr into stdout, >NUL discards output. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills github/batch-files

View the source on GitHub

Browse the @skills marketplace