Core JavaScript fundamentals including variables, data types, operators, control flow, and basic syntax. Essential foundation for all JavaScript development.
Provides JavaScript fundamentals knowledge for variables, data types, operators, and control flow. Use when Claude needs to explain basic syntax, debug type errors, or write correct JavaScript code.
/plugin marketplace add pluginagentmarketplace/custom-plugin-javascript/plugin install javascript-developer-plugin@pluginagentmarketplace-javascriptThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/types-reference.yamlassets/variables-template.yamlreferences/GUIDE.mdreferences/QUICK-START.mdscripts/helper.pyscripts/validate-fundamentals.jsconst PI = 3.14159; // Immutable binding (preferred)
let count = 0; // Reassignable
var legacy = "avoid"; // Function-scoped (avoid)
| Type | Example | typeof |
|---|---|---|
| String | "hello" | "string" |
| Number | 42, 3.14, NaN | "number" |
| Boolean | true, false | "boolean" |
| Null | null | "object" |
| Undefined | undefined | "undefined" |
| Symbol | Symbol('id') | "symbol" |
| BigInt | 9007199254740991n | "bigint" |
| Object | {}, [], fn | "object" |
// Arithmetic
+ - * / % **
// Comparison (always use strict)
=== !== > < >= <=
// Logical
&& || !
// Nullish
?? ?.
// Assignment
= += -= *= /= ??= ||= &&=
// Early return (preferred)
function validate(input) {
if (!input) return { error: 'Required' };
if (input.length < 3) return { error: 'Too short' };
return { valid: true };
}
// Switch with exhaustive handling
function getColor(status) {
switch (status) {
case 'success': return 'green';
case 'warning': return 'yellow';
case 'error': return 'red';
default: return 'gray';
}
}
// Explicit conversion (preferred)
Number('42') // 42
String(42) // "42"
Boolean(1) // true
// Truthy values: non-zero numbers, non-empty strings, objects
// Falsy values: 0, "", null, undefined, NaN, false
// Nullish coalescing
const name = input ?? 'Guest'; // Only null/undefined
// Optional chaining
const city = user?.address?.city; // Safe navigation
// Logical assignment
config.debug ??= false; // Assign if nullish
| Error | Cause | Fix |
|---|---|---|
ReferenceError: x is not defined | Variable not declared | Check spelling, scope |
TypeError: Cannot read property | Accessing null/undefined | Use optional chaining ?. |
NaN result | Invalid number operation | Validate input types |
Unexpected true/false | Loose equality == | Use strict === |
// 1. Check type
console.log(typeof variable);
// 2. Check value
console.log(JSON.stringify(variable));
// 3. Check for null/undefined
console.log(variable === null, variable === undefined);
// 4. Use debugger
debugger;
function processNumber(value) {
if (typeof value !== 'number' || Number.isNaN(value)) {
throw new TypeError('Expected a valid number');
}
return value * 2;
}
const city = user?.address?.city ?? 'Unknown';
const callback = options.onComplete?.();
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.