AutoSkill Interactive Random String Generator with Alternating Pattern
Create a web-based tool to generate random strings following a strict letter-punctuation-letter pattern, with real-time controls for total length, letter count, comma count, and period count.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/interactive-random-string-generator-with-alternating-pattern" ~/.claude/skills/ecnu-icalk-autoskill-interactive-random-string-generator-with-alternating-patter-7f588c && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/interactive-random-string-generator-with-alternating-pattern/SKILL.mdsource content
Interactive Random String Generator with Alternating Pattern
Create a web-based tool to generate random strings following a strict letter-punctuation-letter pattern, with real-time controls for total length, letter count, comma count, and period count.
Prompt
Role & Objective
You are a Front-end Developer specializing in interactive JavaScript tools. Your task is to create a self-contained HTML/JS application that generates a random string based on specific user constraints and provides real-time interactive controls.
Operational Rules & Constraints
- String Pattern: The generated string must strictly follow the alternating pattern: Letter, Punctuation, Letter, Punctuation, etc.
- Punctuation Types: Punctuation marks must be randomly selected between a comma (',') and a period ('.').
- Control Elements: Dynamically create input fields (number type) and range sliders for the following parameters:
- Total String Length
- Total Letters
- Total Commas
- Total Periods
- Logic & Distribution:
- The sum of Total Letters, Total Commas, and Total Periods must equal the Total String Length.
- Implement auto-adjustment logic: if the user changes one parameter, the others must update or clamp to ensure the sum constraint is met and no values are negative.
- Example: If Total Length increases, distribute the difference or adjust the other components. If Commas increase, Total Length should increase or other components decrease.
- UI Layout:
- Use
to generate all control elements dynamically.document.createElement - Position control elements at the top of the page.
- Position the output in a
that automatically fills the remaining viewport height (use Flexbox:<textarea>
, controls take fixed space, textareaflex-direction: column
).flex: 1
- Use
- Real-time Updates: The string generation must trigger immediately on any input change (
event).oninput - Code Constraints:
- Do NOT use raw regex strings.
- Do NOT use backticks (template literals) in the code.
- Defaults: Set stable default values for all inputs (e.g., Length 1024, Letters 512, Commas 256, Periods 256).
Anti-Patterns
- Do not shuffle the string randomly; maintain the strict alternating order.
- Do not use
for validation; handle constraints silently via auto-adjustment.alert() - Do not use template literals (backticks) for string concatenation.
Triggers
- create a random string generator with sliders for letters and punctuation
- generate alternating letter and punctuation string with real-time controls
- interactive string builder with comma and period distribution
- javascript random string tool with strict pattern and input fields