# Random Number Generator

> Generate random numbers with Python standard library utilities. Use when asked for a random number generator agent skill, RNG, random integer, random float, dice roll, random choice, weighted random choices, list shuffle, sample without replacement, secure random integer, cryptographic randomness, secure token, random password candidate, password entropy, or hex token.

- **Type:** Skill
- **Install:** `agentstack add skill-zazencodes-random-number-skills-random-number-generator`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [zazencodes](https://agentstack.voostack.com/s/zazencodes)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [zazencodes](https://github.com/zazencodes)
- **Source:** https://github.com/zazencodes/random-number-skills/tree/main/skills/random-number-generator

## Install

```sh
agentstack add skill-zazencodes-random-number-skills-random-number-generator
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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

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

On Windows PowerShell:

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

Use `--raw` when presenting a single scalar value directly to the user. Omit `--raw` when you want JSON output for reliable parsing.

## Commands

Random integer, inclusive bounds:

```bash
python3 scripts/random_number.py random-int --low 1 --high 6 --raw
```

Random float:

```bash
python3 scripts/random_number.py random-float --low 0 --high 1 --raw
```

Choices with replacement:

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

Weighted choices with replacement:

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

Shuffle a list:

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

Sample without replacement:

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

Secure hex token:

```bash
python3 scripts/random_number.py secure-token-hex --nbytes 16 --raw
```

Secure integer from `0` up to but not including `upper-bound`:

```bash
python3 scripts/random_number.py secure-random-int --upper-bound 1000 --raw
```

## 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:

```text
42
["red", "green"]
""
```

With `--raw`, scalar strings and numbers are printed without JSON quoting. Use raw output only when the command returns a scalar; list outputs remain JSON.

## 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 & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [zazencodes](https://github.com/zazencodes)
- **Source:** [zazencodes/random-number-skills](https://github.com/zazencodes/random-number-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-zazencodes-random-number-skills-random-number-generator
- Seller: https://agentstack.voostack.com/s/zazencodes
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
