javascript-modern/SKILL.md
Modern JavaScript (ES6+) patterns for PHP+JavaScript SaaS apps: modules, async/await, destructuring, Proxy/Reflect, generators, WeakMap/WeakSet, optional chaining, error handling, and performance patterns. Use when writing JavaScript for web...
npx skillsauth add peterbamuhigire/skills-web-dev javascript-modernInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
javascript-modern or would be better handled by a more specific companion skill.SKILL.md first, then load only the referenced deep-dive files that are necessary for the task.Expert-level ES6+ patterns for PHP+JavaScript SaaS developers. Assumes fluency with variables, loops, and functions.
JavaScript belongs in its own .js files. PHP only emits a <script src="..."> tag or passes config via a single JSON data attribute. No <?php echo $var ?> scattered through JS files.
<!-- PHP emits one data attribute — no inline JS -->
<div id="app-config"
data-config='<?= json_encode($config, JSON_HEX_APOS) ?>'
data-user='<?= json_encode(['id' => $user->id, 'role' => $user->role]) ?>'>
</div>
// assets/js/app.js — reads config cleanly from its own file
const config = JSON.parse(document.getElementById('app-config').dataset.config);
const user = JSON.parse(document.getElementById('app-config').dataset.user);
// assets/js/modules/user-table.js
const UserTable = (() => {
let tableInstance = null; // private — unreachable from outside
function init(config) { tableInstance = new DataTable('#users-table', config); }
function refresh() { tableInstance?.ajax.reload(); }
return { init, refresh }; // public API only
})();
export default UserTable;
// Named exports for shared utilities: assets/js/core/utils.js
export function debounce(fn, delay) { /* ... */ }
export function throttle(fn, limit) { /* ... */ }
Extended guidance for javascript-modern was moved to references/skill-deep-dive.md to keep this entrypoint compact and fast to load.
Use that deep dive for:
2. Async/Await — The Right Patterns3. Production-Grade Fetch Wrapper4. Destructuring — Beyond the Basics5. Optional Chaining and Nullish Coalescing6. Generators for Pagination / Lazy Data7. WeakMap for Private Data and DOM Metadata8. Proxy for Validation and Reactivity9. Error Handling Strategy10. Event Delegation (Performance Pattern)11. Debounce and Throttle12. LocalStorage with Expiry13. const/letand Arrow Functionthis``data-ai
Use when adding AI-powered analytics to a SaaS platform — semantic search over business data, natural language queries, trend detection, anomaly alerts, and AI-generated insights for dashboards. Covers embeddings, NL2SQL, and per-tenant analytics...
data-ai
Design AI-powered analytics dashboards — what metrics to show, how to display AI predictions and confidence, drill-down patterns, KPI cards, trend visualisation, AI Insights panels, export design, and role-based dashboard variants. Invoke when...
development
Use when designing, building, reviewing, or upgrading production software systems that must be secure, performant, maintainable, scalable, and user-centered. Apply before writing specs, code, architecture, APIs, databases, mobile apps, SaaS platforms, or ERP systems.
development
Professional web app UI using commercial templates (Tabler/Bootstrap 5) with strong frontend design direction when needed. Use for CRUD interfaces, dashboards, admin panels with SweetAlert2, DataTables, Flatpickr. Clone seeder-page.php, use...