Random Number Generator Agent Skill

June 25, 2026 · View on GitHub

skills.sh

A random number generator agent skill for Claude Code, Codex, and other agents that support the Agent Skills format.

It gives agents a small, reliable Python standard-library CLI for random integers, floats, choices, weighted choices, shuffles, samples, secure integers, and secure hex tokens for random password candidates.

Installation

npx skills add zazencodes/random-number-skills --skill random-number-generator

What It Provides

  • random-int - random integer with inclusive lower and upper bounds
  • random-float - random float between two bounds
  • random-choices - choices with replacement, optionally weighted
  • random-shuffle - shuffled copy of a list
  • random-sample - unique sample without replacement
  • secure-token-hex - cryptographically secure hex token for random password candidates
  • secure-random-int - cryptographically secure integer below an exclusive upper bound

The bundled script uses only Python's standard random, secrets, json, and argparse modules. No MCP server, package install, API key, or network access is required after the skill is installed.

Example Agent Requests

Generate a random number from 1 to 100.
Roll a d20.
Pick 3 weighted winners from this list.
Shuffle this list.
Generate a secure 16-byte hex token.
Generate a random password candidate.

Direct CLI Examples

These commands are what the agent runs from the skill directory:

python3 scripts/random_number.py random-int --low 1 --high 100 --raw
python3 scripts/random_number.py random-choices --population-json '["red","blue","green"]' --k 2
python3 scripts/random_number.py secure-token-hex --nbytes 16 --raw

On Windows, agents can use:

py -3 scripts/random_number.py random-int --low 1 --high 100 --raw

Requirements

  • Python 3
  • An agent or installer that supports Agent Skills directories with SKILL.md

Deploy

Run the local checks before publishing:

python3 -m unittest discover -s tests
uvx snyk-agent-scan@latest scan skills/random-number-generator --print-errors
gh skill publish --dry-run

Set SNYK_TOKEN before running the Snyk Agent Scan. Expected clean output looks like this, with no issues after the scan tree:

Snyk Agent Scan v0.5.12

● Scanning skills found 1 skill

└── random-number-generator
    ├── instruction SKILL.md
    └── script      random_number.py

Publish with a version tag:

gh skill publish --tag vX.Y.Z

gh skill publish validates the skill and creates the GitHub release. See gh skill publish --help or the GitHub CLI manual for current flags.

Commit Messages

Use Conventional Commits with short, imperative subjects:

docs: add Snyk scan docs
fix: validate sample output

License

MIT