claude-tap: Skill for Claude Code

.agents/skills/js-in-html-testing/SKILL.md

js-in-html-testing is a skill for Claude Code from liaohch3/claude-tap. It costs 25 tokens per session (858 once invoked), scanned A, original, MIT.

A two-part testing approach for JavaScript placed directly inside HTML files. It combines fast Python tests for calculations with Playwright tests that open a real browser and check the page.

In plain words
What is it for?
Use it to test navigation, button states, overlays, keyboard actions, and other browser behavior in standalone HTML tools.
Why use it?
It catches both incorrect program logic and problems that only appear when users click, type, use the keyboard, or interact with the page.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: installed under .agents/ (shared by several agents).

This is liaohch3/claude-tap's own configuration. It tells Claude Code how to work on claude-tap itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-tap configures →

About the project

claude-tap is a local proxy and trace viewer for AI coding agents, recording and displaying their API requests, prompts, tool calls, responses, context, and token usage. It helps developers inspect and compare agent runs from tools such as Claude Code, Codex CLI, Gemini CLI, Cursor CLI, and others, while the catalogue skills and instruction support work with the project.

liaohch3/claude-tap · 3,177 stars · on GitHub

Reuse

Borrowing it

Nothing to install: this file belongs to liaohch3/claude-tap. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/liaohch3/claude-tap/main/.agents/skills/js-in-html-testing/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/liaohch3/claude-tap

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for js-in-html-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/liaohch3/claude-tap/js-in-html-testing.svg)](https://agentmods.dev/skills/liaohch3/claude-tap/js-in-html-testing)
Your own site
<a href="https://agentmods.dev/skills/liaohch3/claude-tap/js-in-html-testing"><img src="https://agentmods.dev/badge/skills/liaohch3/claude-tap/js-in-html-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 858 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.00858
Opus 5 $0.00013 $0.00429
Sonnet 5 $0.00005 $0.00172
Haiku 4.5 $0.00003 $0.00086

Measured 8d ago against content hash d6391de81352, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

js-in-html-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/js-in-html-testing/SKILL.md · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

JS-in-HTML Two-Layer Testing Strategy

For JavaScript logic embedded in HTML files (e.g., diff navigation in viewer.html), use a two-layer testing approach.

Layer 1: Python Unit Tests (fast algorithm verification)

Replicate core JS algorithms in Python and verify correctness via pytest.

Best for: pure computation logic, state decisions, matching algorithms — anything that doesn't depend on the DOM.

Example: tests/test_diff_matching.py

# Replicate JS findPrevSameModel / findNextSameModel
def find_diff_parent_by_prefix(entries, idx): ...


def find_next_by_prefix(entries, idx): ...


# Replicate JS updateNavButtons state computation
def compute_nav_button_states(entries, cur_idx):
    prev_idx = find_diff_parent_by_prefix(entries, cur_idx)
    ...
    return (prev_enabled, next_enabled)

Advantages: fast (0.02s), no browser dependency, integrates with existing pytest setup.

Layer 2: Playwright Browser Integration Tests (DOM interaction verification)

Generate HTML with test data embedded, open it in real Chromium via Playwright, and verify DOM state and user interactions.

Best for: button disabled states, overlay show/hide, keyboard events, click navigation, etc.

Example: tests/test_nav_browser.py

Building test HTML

def _build_test_html():
    from claude_tap.viewer import VIEWER_SCRIPT_ANCHOR, _read_viewer_template

    template = _read_viewer_template()
    records = [json.dumps(e) for e in TEST_ENTRIES]
    data_js = "const EMBEDDED_TRACE_DATA = [\n" + ",\n".join(records) + "\n];\n"
    # Inject data into template
    return template.replace(
        VIEWER_SCRIPT_ANCHOR,
        f"<script>\n{data_js}</script>\n{VIEWER_SCRIPT_ANCHOR}",
        1,
    )

Playwright fixture

@pytest.fixture(scope="module")
def browser_page(html_file):
    from playwright.sync_api import sync_playwright

    pw = sync_playwright().start()
    browser = pw.chromium.launch(headless=True)
    page = browser.new_page()
    page.goto(f"file://{html_file}")
    page.wait_for_selector(".sidebar-item", timeout=5000)
    yield page
    browser.close()
    pw.stop()

Read the full file on GitHub · 124 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 124 lines · 25 tokens per session scan A d6391de81352

Subscribe to this mod's changes

js-in-html-testing is a skill published in the GitHub repository liaohch3/claude-tap (3,177 stars, last pushed 13d ago), licensed MIT. It adds 25 tokens to every session and 858 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

prodtest

Senior-QA test pass on a newly implemented feature. Detects the project's real test stack, writes unit and functional/integration tests, then drives the running app with Playwright for end-to-end coverage, saving screenshots to a gitignored folder for human review. Asks upfront whether found bugs should be fixed or…

nazmulnahid-git/Ai-Stack · 90 tokens

chrome-ext-testing

This skill should be used when writing or setting up tests for a Chrome extension. Trigger when: "test chrome extension", "extension unit test", "extension e2e test", "Vitest extension", "Playwright extension", "@webext-core/fake-browser", "test content script", "test service worker", "test messaging", "test storage"…

RadOrigin-LLC/RAD-Claude-Skills · 101 tokens

ui-test

Runs UI tests described in plain English by driving real Chrome via the Claude-in-Chrome extension. Covers end-to-end flows (clicks, forms, assertions), visual checks (screenshot + optional baseline diff), accessibility (axe-core), performance (Web Vitals + light Lighthouse-style metrics), and an interactive --debug…

mostafa-drz/claude-skills · 190 tokens

playwright-stability

Make a Playwright E2E suite stable and realistic — kill flaky tests and authenticate like a real user via storageState (login once, reuse). Use when E2E tests are flaky, slow, re-login in every test, mock auth instead of using it, or when hardening a suite before relying on it.

LFTPadilla/agent-dev-kit · 70 tokens

audit-ui-e2e

Runs a beginner-mind end-to-end UI audit of any running app — local dev server, staging, production, or a specific URL. Drives Chrome through every interactive element on the target surface, collects structured findings (severity, category, where, symptom, impact, repro, triage), and hands the result off to…

mostafa-drz/claude-skills · 152 tokens

capture-screens

Automatically navigates a web app using Playwright MCP and captures context-aware named screenshots at each product feature state. Names each file semantically based on context (e.g., checkout-payment-form-filled.png). Outputs a manifest.json mapping filenames to descriptions and a summary report. Use when documenting…

mostafa-drz/claude-skills · 101 tokens