Skip to main content

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.

설치로 이동

소스 정보

저장소
zazencodes/random-number-skills
최근 소스 활동
2026년 8월 17일 15:19
감지된 SKILL.md 언어
영어
스타
1
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
random-number-generator
description
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.
license
MIT
# 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 ``` On Windows PowerShell: ```powershell py -3 scripts/random_number.py random-int --low 1 --high 100 ``` To generate a batch of random numbers, pass the `--size` flag: ```bash python3 scripts/random_number.py random-int --low 1 --high 100 --size 5 ``` ## Commands Random integer (single or batch): ```bash python3 scripts/random_number.py random-int --low 1 --high 6 --size 5 ``` Random float (single or batch): ```bash python3 scripts/random_number.py random-float --low 0 --high 1 --size 5 ``` 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(s): ```bash python3 scripts/random_number.py secure-token-hex --nbytes 16 --size 3 ``` Secure integer(s) from `0` up to but not including `upper-bound`: ```bash 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: ```text [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.
GitHub에서 보기