Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    secure web components craft

    1

    Build and audit dependency-free, secure-by-default Web Components using native browser APIs and OWASP standards.

    Free

    5.0 (1 review)
    secure web components craft

    secure web components craft

    Example session with this skill installed

    Audit this custom element for security issues and lifecycle leaks:

    class MyInput extends HTMLElement {
      connectedCallback() {
        this.innerHTML = `<div><input type="text"></div>`;
      }
    }
    
    • Read your context and instructions
    • Compiled the secure web components

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Modern web development often trades security for convenience, pulling in heavy frameworks that introduce supply-chain vulnerabilities and XSS risks. This skill enforces a "platform-first" approach to build native Custom Elements that are secure by default, dependency-free, and performant.

    What it does

    Enforce Zero Dependencies by leveraging native APIs like Shadow DOM, ElementInternals, and MutationObserver without runtime libraries. Audit Injection Risks by scanning for innerHTML or insertAdjacentHTML usage and replacing them with safe textContent and template cloning. Secure Component Internals using closed Shadow DOM for sensitive data like passwords or tokens to prevent external script access. Manage Lifecycle Safety ensuring every listener, observer, and timer is correctly torn down via AbortController in the disconnectedCallback. Implement Form Association using ElementInternals to create accessible, secure form controls that participate in native browser validation.

    How it works

    1. Analyze existing code to identify non-native dependencies, unsafe DOM manipulations, or lifecycle memory leaks.
    2. Refactor to Native Standards by converting framework-specific logic into vanilla Custom Elements with scoped styling via CSSStyleSheet.
    3. Run Audit Mode to generate a structured report covering injection, secret leakage in events, and fail-secure defaults.
    4. Validate Security Constraints such as CSP-safe styling and URL allowlisting for outbound fetches or redirects.

    Frameworks & tools

    This skill focuses on vanilla JavaScript/TypeScript using the Web Components specifications (Custom Elements, Shadow DOM, HTML Templates). It utilizes browser-native APIs including SubtleCrypto, ElementInternals, and AbortController.

    Why this beats prompting it yourself

    Most generic LLMs default to suggesting React or lit-html for components, which introduces unnecessary weight and audit surface. This skill is hard-coded with specific OWASP-aligned security patterns, like preventing secret leakage in composed events and enforcing closed shadow roots for sensitive inputs, which are often overlooked in standard prompts.

    Use cases

    • Refactoring a legacy React component into a portable, zero-dependency utility.
    • Auditing a library of internal UI components for XSS and memory leaks.
    • Building a secure, masked payment input that hides its value from the light DOM.
    • Creating a design system that works across any tech stack without a build step.

    Known limitations

    Does not support legacy browsers without native Custom Element support (no polyfill generation). Assumes a modern environment supporting ES6+ and native Shadow DOM.

    No support for legacy browsers lacking native Shadow DOM or Custom Elements. Logic assumes modern environment (ES6+). Build steps are limited to TypeScript compilation only.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    5.0
    1 review
    5
    1
    4
    0
    3
    0
    2
    0
    1
    0

    Trust & safety

    Security scan

    Security scan passed 18 days ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Network Access
    Listed18 days ago

    What's inside

    Frequently Asked Questions

    This skill focuses on "Platform-First" development, eliminating external dependencies and supply-chain risks by using native Shadow DOM and ElementInternals to create secure, self-contained components.

    The skill is designed for use with any AI agent that supports JavaScript or TypeScript code generation, including ChatGPT, Claude, and local IDE assistants like GitHub Copilot or Cursor.

    No complex setup is required; once activated, the skill provides immediate guidance on refactoring existing code or generating new, OWASP-compliant components directly in your workflow.

    You will receive the core logic for the secure web component agent, including predefined security audit patterns, refactoring templates, and best practices for native API implementation.

    Yes, the skill is capable of scanning your existing Custom Elements to identify vulnerabilities like unsafe 'innerHTML' usage and proposing secure, 'textContent'-based alternatives.

    This skill targets modern web standards (ES6+); it does not generate polyfills or support legacy browsers like Internet Explorer that lack native Custom Element support.

    New in Frontend & Web Apps