Js modern

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Js modern is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Write modern JavaScript and TypeScript — ES6+ features, async/await, modules, destructuring, optional chaining, TypeScript types, and modern tooling. Use when writing JavaScript/TypeScript for BigCommerce themes, apps, or headless storefronts.

How to use this skill

Skill file

Modern JavaScript & TypeScript

Before writing code

Fetch live docs: Web-search site:developer.mozilla.org javascript for MDN JavaScript reference. Check https://www.typescriptlang.org/docs/ for TypeScript documentation.

ES6+ Features

Arrow Functions

Concise function syntax with lexical this:

Template Literals

String interpolation and multi-line strings:

Destructuring

Extract values from objects/arrays:

Spread / Rest

Modules (ES Modules)

Optional Chaining & Nullish Coalescing

Async Patterns

Promises

Async/Await

Fetch API

const response = await fetch(url, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(data),
});
const result = await response.json();

TypeScript

Type Annotations

Interfaces

interface Product {
  id: number;
  name: string;
  price: number;
  variants?: Variant[];
}

Type Utilities

Generics

function fetchResource<T>(url: string): Promise<T> {
  return fetch(url).then(res => res.json());
}
const product = await fetchResource<Product>('/api/products/1');

Enums

enum OrderStatus {
  Pending = 'pending',
  Shipped = 'shipped',
  Completed = 'completed',
}

Discriminated Unions

type ApiResponse<T> =
  | { status: 'success'; data: T }
  | { status: 'error'; message: string };

Modern Array Methods

For BigCommerce Specifically

Stencil Theme JS

Catalyst / Next.js

App Development

Best Practices

Fetch MDN and TypeScript docs for exact syntax, browser compatibility, and new features before implementing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.