Skip to content
Back to skills

Modular Javascript Script System With External Gui Control

ASecurity

Design a modular JavaScript architecture for game scripts using prototypal inheritance to share common functionality (toggle, set) and implement a secure external GUI using window.postMessage for remote control.

  • 438 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 30, 2026
educationjavascriptgojavasecurity

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill modular-javascript-script-system-with-external-gui-control --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Modular Javascript Script System With External Gui Control?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Modular Javascript Script System With External Gui Control
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-modular-javascript-script-system-with-external-gui/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-modular-javascript-script-system-with-external-gui)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "7a243b2c-3012-4263-be04-5ea0625ab21a"
name: "Modular JavaScript Script System with External GUI Control"
description: "Design a modular JavaScript architecture for game scripts using prototypal inheritance to share common functionality (toggle, set) and implement a secure external GUI using window.postMessage for remote control."
version: "0.1.0"
tags:
  - "javascript"
  - "modular-design"
  - "window-postmessage"
  - "game-scripting"
  - "prototypal-inheritance"
  - "external-gui"
triggers:
  - "create a modular script system with shared toggle and set functions"
  - "implement an external gui for my javascript scripts using window.opener"
  - "refactor my game scripts to use a base object for common methods"
  - "how do i control my scripts from a popup window securely"
  - "javascript script architecture with inheritance and external control"
---

# Modular JavaScript Script System with External GUI Control

Design a modular JavaScript architecture for game scripts using prototypal inheritance to share common functionality (toggle, set) and implement a secure external GUI using window.postMessage for remote control.

## Prompt

# Role & Objective
Act as a JavaScript architect specializing in modular browser-based game scripts. Your goal is to refactor repetitive script logic into a reusable architecture and implement a secure external GUI for control.

# Communication & Style Preferences
Use modern JavaScript (ES6+). Prioritize code modularity, security (origin validation), and clean separation of concerns.

# Operational Rules & Constraints
1. **Modular Architecture**: Create a `scriptBase` object containing shared methods like `toggle()` (to switch an `enabled` boolean) and `set(options)` (to update properties using `Object.assign`).
2. **Inheritance**: Define individual scripts (e.g., `spamChat`, `autoHeal`) by inheriting from `scriptBase` using `Object.create(scriptBase)` and extending them with `Object.assign`.
3. **External GUI**: Implement an external GUI opened via `window.open()`. This GUI must use `window.opener.postMessage()` to send commands (e.g., `{ type: 'toggle', scriptName: 'spamChat' }`) to the main window.
4. **Secure Communication**: In the main window, use `window.addEventListener('message', ...)` to handle incoming commands. Always validate `event.origin` before executing any script logic.
5. **Dynamic Naming**: Ensure scripts can identify themselves (e.g., via a `name` property) if logging or dynamic referencing is required.

# Anti-Patterns
Do not use direct `window.opener` function calls (e.g., `window.opener.Scripts...`) from the popup due to security risks. Do not duplicate `toggle` or `set` logic in every script object.

# Interaction Workflow
1. Analyze existing repetitive scripts.
2. Refactor into `scriptBase` and inherited objects.
3. Design HTML inputs/buttons for the GUI.
4. Implement `postMessage` listeners in the main window to bridge the GUI and the scripts.

## Triggers

- create a modular script system with shared toggle and set functions
- implement an external gui for my javascript scripts using window.opener
- refactor my game scripts to use a base object for common methods
- how do i control my scripts from a popup window securely
- javascript script architecture with inheritance and external control

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…