Skip to content
Back to skills

Coding

ASecurity

Generate User Interfaces (Web, CLI, Mobile) using GenUI, HTMX, or TUI patterns.

  • 23 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 14, 2026
developmentpythonrustgophpreactnoderailsapifrontendbackend

Works with

  • cursor
  • terminal
  • cli
  • api

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned October 14, 2026

npx -y skills add andreibesleaga/GABBE --skill coding --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Coding?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Coding
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/andreibesleaga-coding-9720e7e1/badge)](https://www.skillsdirectory.com/skills/andreibesleaga-coding-9720e7e1)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ui-gen
description: Generate User Interfaces (Web, CLI, Mobile) using GenUI, HTMX, or TUI patterns.
triggers: [ui gen]
tags: [coding]
context_cost: medium
tools: [write_to_file, replace_file_content]
---
# UI Generation Skill

## Goal
Use this skill when the user asks for a User Interface, Dashboard, CLI tool, or Frontend.

## Steps
## 1. Paradigm Selection
First, determine the best paradigm based on the User's Stack and needs:

| Scenario | Recommended Paradigm |
|---|---|
| "Modern SaaS", "React", "Dashboard" | **Generative UI** (React/ShadCN/Tailwind) |
| "Internal Tool", "Go/PHP/Node Backend" | **HTMX** (Hypermedia-driven) |
| "Dev Tool", "Script", "Server Utils" | **TUI** (Bubble Tea / Ink) |
| "Quick Prototype", "Data App" | **Streamlit / Gradio** (Python) |

## 2. Generative UI Workflow (React/ShadCN)
1.  **Dependencies:** Ensure `lucide-react`, `clsx`, `tailwind-merge` are installed.
2.  **Component:** Create a single-file component if possible, or modularize if complex.
3.  **Style:** Use Tailwind CSS. Focus on "Vibe Coding" (Dark mode, gradients, glassmorphism).
4.  **Mocking:** If backend is missing, mock data inside the component.

## 3. HTMX Workflow
1.  **Route:** Create a backend route (e.g., `GET /partials/dashboard`).
2.  **Template:** Return *only* the HTML fragment (no `<html>` or `<body>` unless it's the full page).
3.  **Interactivity:** Use `hx-get`, `hx-post`, `hx-trigger`.
    *   Example: `<button hx-post="/update" hx-swap="outerHTML">Save</button>`

## 4. TUI Workflow
1.  **Library:** Use Bubble Tea (Go) or Ink (Node).
2.  **Model:** Define the State (Cursor position, Input value).
3.  **Update:** Define the Keypress handlers.
4.  **View:** Return the String representation of the UI.

## 5. Security Checklist
- [ ] **XSS Prevention:** Ensure all user input is escaped (React/Templ do this automatically).
- [ ] **Validation:** Client-side validation is UX, Server-side is Security. Do both.
- [ ] **Access Control:** UI elements should simply *not exist* if the user lacks permission.

## 6. Artifact Generation
When generating the UI, create a `UI_SPEC.md` first if the complexity is high ( > 5 components).
Otherwise, write the code directly.

## Security & Guardrails

### 1. Skill Security (UI Gen)
- **DOM-Based XSS via Props**: In "Generative UI" (Step 2), the LLM might correctly escape standard HTML bodies but incorrectly bind raw, unsanitized user input directly to sensitive DOM properties (e.g., `dangerouslySetInnerHTML`, `href`, `src`, or inline `style` objects). The agent must strictly mandate the use of framework-level safe bindings (e.g., standard React curly braces `{}`) and strictly forbid raw HTML insertion unless passed through a verified HTML sanitizer like DOMPurify.
- **Client-Side Validation Illusion**: The Security Checklist (Step 5) notes that "Client-side validation is UX, Server-side is Security." However, an LLM might generate a UI that *appears* highly secure (e.g., disabling the "Submit" button if a field is invalid) while neglecting to implement or verify the corresponding backend API constraints. The agent must explicitly tag all UI-level validation code with a warning comment stating it is strictly cosmetic and not a security perimeter.

### 2. System Integration Security
- **HTMX Route Exposure**: In the "HTMX Workflow" (Step 3), the agent creates backend routes returning HTML fragments (e.g., `GET /partials/dashboard`). If the agent fails to secure these partial routes with the exact same authentication/authorization middleware as the main application routes, an attacker can bypass the UI and directly fetch sensitive HTML fragments. The agent must mandate that all HTMX endpoints inherit the project's global security context.
- **TUI Command Injection (Terminal Escape Sequences)**: In the "TUI Workflow" (Step 4), returning the String representation of the UI can be dangerous if it includes untrusted data. An attacker might supply input containing malicious ANSI escape sequences designed to spoof terminal history, hide malicious commands, or exploit terminal emulator vulnerabilities. The agent must rigorously strip or securely escape all raw ANSI control characters from dynamic user input before rendering it in the TUI view.

### 3. LLM & Agent Guardrails
- **The "Admin Dashboard" Hallucination**: When asked to build an "Internal Tool" (Step 1), the LLM might hallucinate standard administrative features (like a "Delete All Users" button or "View Raw Passwords" table) that were never explicitly requested, simply because "Internal Tool" is heavily associated with those features in its training data. The agent must rigidly constrain UI generation to the exact components specified in the user's prompt or the `UI_SPEC.md`.
- **Third-Party CDN Hijacking**: To quickly style a prototype, the LLM might hallucinate `unpkg` or `cdnjs` script tags for libraries (like Tailwind or Alpine.js) instead of using local `npm` module imports. Pulling executable code from unpinned, external CDNs introduces a severe supply-chain risk (Subresource Integrity issues). The agent must categorically reject UI code that relies on external CDN `<script>` tags, forcing local dependency resolution.

Files in this skill

  • agent-trajectory-eval.skill.md5.7 KB
  • artisan-commands.skill.md3.7 KB
  • browser-tdd.skill.md7 KB
  • chaos-fault-injection.skill.md8.1 KB
  • ci-autofix.skill.md4.2 KB
  • clean-coder.skill.md4.5 KB
  • code-review.skill.md6.1 KB
  • debug.skill.md6.5 KB
  • documentation.skill.md7.3 KB
  • eval-driven-development.skill.md6.9 KB
  • evals/code-review.eval.yaml1 KB
  • excalidraw.skill.md3.7 KB
  • file-processing.skill.md4.3 KB
  • git-workflow.skill.md7.2 KB
  • metamorphic-testing.skill.md7.8 KB
  • mobile-dev.skill.md4.2 KB
  • nodejs-expert.skill.md1.6 KB
  • output-validation.skill.md5.4 KB
  • pbt-strategy.skill.md8 KB
  • performant-ai.skill.md3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.