X is

From x-cmd/skill · View interactive version

X is is an AI agent skill from the GitHub repository x-cmd/skill. Value validation and environment detection tool for Shell scripts. Validates input types (integers, floats, IPs), compares file ages, detects runtime environments (TTY, WSL, Termux, Cygwin). Supports batch checking with exit code 0 success / 1 failure. Trigger when user needs to validate input types

How to use this skill

Skill file

x is - Value & Environment Validation

x is is x-cmd's value validation tool for checking if values or environment states meet specific criteria. Supports batch checking multiple values, ideal for robust Shell scripting.

Prerequisites

  1. Load x-cmd before use:

```bash

. ~/.x-cmd.root/X

```

Core Usage

Subcommands

Type

| Command | Description |

|---------|-------------|

| int | Integer check, batch supported |

| float | Float check (must contain decimal point) |

| positive | Positive integer (≥0) |

| negative | Negative integer (<0) |

| minmax | Range check [MIN,MAX] |

Compare

| Command | Description |

|---------|-------------|

| eq | Multiple values equal |

| within | First value in candidate list |

| in | Colon-separated list member check |

| in- | Dash-separated list |

| in_ | Underscore-separated list |

| in/ | Slash-separated list |

| in\| | Pipe-separated list |

Network

| Command | Description |

|---------|-------------|

| ip | IPv4 address check |

File

| Command | Description |

|---------|-------------|

| newest | File newer than others (glob supported) |

| oldest | File older than others (glob supported) |

Variable

| Command | Description |

|---------|-------------|

| unset | Variable is unset |

Environment

| Command | Description |

|---------|-------------|

| interactive | Interactive session |

| interactive_tty | stdin is interactive TTY |

| interactiveshell | Shell is interactive |

| repl | REPL mode |

| stdout2tty | stdout outputs to TTY |

| wsl | WSL environment |

| cygwin | Cygwin environment |

| msys | MSYS/MinGW environment |

| gitbash | Git Bash environment |

| termux | Termux environment |

| ish | iSH environment |

Suitability

| Command | Description |

|---------|-------------|

| suitable_pkg | Suitable for package installation |

| suitable_advise_env | Suitable for advise feature |

| suitable_advise_repl | Suitable for advise REPL |

Practical Examples

Batch Type Validation

x is int 1 2 3 4 5 && echo "All integers"
x is float 3.14 -2.5 .5 && echo "All floats"

Environment Conditional Branch

x is interactive && echo "Interactive session" || echo "Script mode"
x is wsl && echo "WSL environment" || echo "Not WSL"
x is termux && echo "Termux environment"

File Status Check

x is newest build.tar.gz src/*.c lib/*.h || echo "Rebuild needed"

Variable Cleanup Verification

x is unset TEMP_VAR1 TEMP_VAR2 && echo "Temp variables cleaned"

Script Pre-flight Check

x is suitable_pkg || { echo "Environment not suitable"; exit 1; }

Design Principles

Get Help

x is --help
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.