Index of every page on this site: llms.txt
All skills
zazencodes avatar

/random-number-generator

@a174880
Run it yourself

Generate random numbers, dice rolls, choices, shuffles, samples and secure tokens with Python. Use for RNG requests, including random password candidates or password entropy.

Use this Skill: https://skilld.dev/gh/zazencodes/skills/random-number-generator

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈50 tokens for metadata: the name and description. ≈836 when used: this file. ≈30 more on demand in 1 file.

Description uses 2.5% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈200 characters, or 2.5%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Random Number Generator

Overview

Generate random values by running the bundled Python script from this skill. The script uses only Python's standard random and secrets modules and prints JSON by default so results are easy to parse.

Execution Rule

Run commands from this skill directory, so scripts/random_number.py resolves relative to this SKILL.md. If the shell is not already in the skill directory, change into the directory containing this file first.

Prefer Python launchers in this order:

  1. python3
  2. py -3 on Windows
  3. python only after confirming it is Python 3

If Python 3 is unavailable, tell the user that this skill requires Python 3 and do not fake a random result.

Quick Start

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

On Windows PowerShell:

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

To generate a batch of random numbers, pass the --size flag:

python3 scripts/random_number.py random-int --low 1 --high 100 --size 5

Commands

Random integer (single or batch):

python3 scripts/random_number.py random-int --low 1 --high 6 --size 5

Random float (single or batch):

python3 scripts/random_number.py random-float --low 0 --high 1 --size 5

Choices with replacement:

python3 scripts/random_number.py random-choices --population-json '["red","blue","green"]' --k 2

Weighted choices with replacement:

python3 scripts/random_number.py random-choices --population-json '["red","blue","green"]' --weights-json '[5,2,1]' --k 3

Shuffle a list:

python3 scripts/random_number.py random-shuffle --items-json '[1,2,3,4,5]'

Sample without replacement:

python3 scripts/random_number.py random-sample --population-json '["a","b","c","d"]' --k 2

Secure hex token(s):

python3 scripts/random_number.py secure-token-hex --nbytes 16 --size 3

Secure integer(s) from 0 up to but not including upper-bound:

python3 scripts/random_number.py secure-random-int --upper-bound 1000 --size 5

Choosing Secure vs Standard Randomness

Use secure-token-hex or secure-random-int for new random password candidates, tokens, invite codes, or any user request that mentions secure, cryptographic, crypto-safe, token, random password, password entropy, or password.

Do not use this skill to accept, store, transform, validate, or repeat existing passwords, API keys, bearer tokens, cookies, or credentials. Only generate new random values on direct user request.

Use the standard random commands for dice, games, simulations, sampling, shuffling, randomized examples, and everyday random selection.

JSON Input

Pass lists through JSON flags such as --population-json, --items-json, and --weights-json. In Bash, zsh, and PowerShell, wrap JSON in single quotes as shown above. For shells that do not support single quotes, escape the double quotes or use a shell that does.

Output

Default output is JSON. Examples:

[42]
[14, 82, 33, 91, 5]
["red", "green"]
["<secure-hex-output>"]

Available Script

  • scripts/random_number.py - Command-line wrapper around Python random and secrets standard-library functions. Run python3 scripts/random_number.py --help for the full interface.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts14d3 checks · Risk SAFE
  • Gen Agent Trust Hub14d

    This skill provides a secure and reliable way to generate random numbers, choices, and tokens using Python's standard library. It does not use any external dependencies, network connections, or sensitive system permissions.

  • Socket14d

    No alerts

  • Snyk14d

    Risk: LOW · No issues

Signed by skilld at a174880. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 2 weeks ago

README badge

README badge for zazencodes/skills/random-number-generator