javascript-refactoring

Refactor JavaScript code into modular .cjs scripts for gh-aw workflows.

Updated Feb 18, 2026
One-click install
npx skills add https://github.com/az9713/gh-aw --skill javascript-refactoring-az9713
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: javascript-refactoring
Source: https://github.com/az9713/gh-aw/tree/main/skills/javascript-refactoring
Command: npx skills add https://github.com/az9713/gh-aw --skill javascript-refactoring-az9713

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Refactors JavaScript code into modular, reusable .cjs scripts that can be bundled and executed inside the gh-aw workflow system.

Core Features & Use Cases

  • Standardizes a top-level .cjs script pattern that exports main without auto-running, enabling safe inline execution via the bundler.
  • Demonstrates how to structure and test utilities (shared modules) and how to wire them into the Go embed and bundling pipeline.
  • Provides concrete examples and a clear path for extending the JS tooling within pkg/workflow/js and related Go code.

Quick Start

Create a new .cjs utility in pkg/workflow/js/, write tests for it, and wire it into the bundler for inlining.

Frequently Asked Questions about javascript-refactoring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor JavaScript code into modular .cjs scripts for Go embedding?▼

To refactor JavaScript into modular .cjs scripts, you create a top-level pattern that exports main without auto-running, then wire it into Go using //go:embed directives and a GetJavaScriptSources map for bundling.

What is the standard pattern for bundling JavaScript utilities in gh-aw workflows?▼

The standard pattern for bundling JavaScript utilities requires exporting main without auto-execution, writing a corresponding test suite, and embedding the .cjs files into Go via the pkg/workflow pipeline.

How do I test shared JavaScript modules before embedding them into Go workflows?▼

You test shared JavaScript modules by creating a corresponding test suite alongside the .cjs utility in pkg/workflow/js/, ensuring the exported main function behaves correctly before wiring it into the Go bundler.

Does the Go embed pipeline require auto-running scripts to be disabled for JavaScript bundling?▼

Yes, the Go embed pipeline requires a consistent top-level .cjs pattern that exports main without auto-running, enabling safe inline execution via the bundler during the gh-aw workflow.

Why do I need to extract shared functionality into separate .cjs files for workflow bundling?▼

Extracting shared functionality into separate .cjs files standardizes your JavaScript tooling, creates reusable modules, and ensures safe modular execution when embedded and bundled inside the gh-aw workflow system.

What's the best way to structure JavaScript code for the Go embed and bundling pipeline?▼

The best way to structure JavaScript for the Go embed pipeline is placing modular .cjs scripts in pkg/workflow/js/, exporting main without auto-run, testing them, and embedding via //go:embed with a GetJavaScriptSources map.