bulk-remove-classname

bulk-remove-classname

Removes a specified class name from HTML/JSX files using the classname-search CLI tool. Use when you need to safely remove all occurrences of a specified class name from target files.

0Sterne
0Forks
Aktualisiert 1/20/2026
SKILL.md
readonlyread-only
name
bulk-remove-classname
description

Removes a specified class name from HTML/JSX files using the classname-search CLI tool. Use when you need to safely remove all occurrences of a specified class name from target files.

Guide to Bulk Removing a Class Name

Prerequisites

Refer to the classname-search agent skill to understand how to use the classname-search CLI tool.

[!WARNING]
If the classname-search agent skill is not found, do not proceed with the work. Do not attempt to obtain information from the internet or other sources.

Required Inputs

  • A glob pattern to specify target files
  • The class name to remove

Before Proceeding

Before executing the removal, you must:

  1. Ask the user to create a backup of the target files using their preferred method (e.g., Git commit, file copy, etc.)
  2. Explain the work to the user
  3. Warn that this will remove all occurrences of the specified class name from all matching files (bulk removal)
  4. Proceed only after receiving explicit user approval

Procedure

Execute the following steps for each target class name.

1. Record the State Before Removal

1.1 Get and Record the Match Count

npx classname-search stats '<glob>' '^<class-name>$'

[!IMPORTANT]
Record the output match count (e.g., Total: 7 matches in 2 files). This will be referred to as the pre-removal count.

1.2 Save Search Results to a File (for Verification)

npx classname-search search '<glob>' '^<class-name>$' --output 'verification-<class-name>.jsonl'

This file is used for verification and troubleshooting if an error occurs during the removal process.

2. Remove the Class Name

npx classname-search remove '<glob>' '^<class-name>$'

[!IMPORTANT]
Record the removal count shown in the command output (e.g., Removed 7 matches). This will be referred to as the removal count.

3. Post-Removal Verification

3.1 Verify the Post-Removal Match Count

npx classname-search stats '<glob>' '^<class-name>$'

Record the output match count. This will be referred to as the post-removal count.

3.2 Determine Verification Result

Verification is considered successful only if both of the following conditions are met:

  1. The post-removal count is 0
  2. The pre-removal count and removal count match

If verification succeeds:

  1. Delete the verification file:
    rm 'verification-<class-name>.jsonl'
    
  2. Proceed to the next class name

If verification fails:

  • Always report to the user and stop subsequent work

Report contents:

  • Target class name
  • Pre-removal count
  • Removal count (output of replace command)
  • Post-removal match count
  • Path to verification file (verification-<class-name>.jsonl)

You Might Also Like

Related Skills

cache-components

cache-components

137Kdev-frontend

Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.

vercel avatarvercel
Holen
component-refactoring

component-refactoring

128Kdev-frontend

Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component --json` shows complexity > 50 or lineCount > 300, when the user asks for code splitting, hook extraction, or complexity reduction, or when `pnpm analyze-component` warns to refactor before testing; avoid for simple/well-structured components, third-party wrappers, or when the user explicitly wants testing without refactoring.

langgenius avatarlanggenius
Holen
web-artifacts-builder

web-artifacts-builder

47Kdev-frontend

Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.

anthropics avataranthropics
Holen
frontend-design

frontend-design

47Kdev-frontend

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.

anthropics avataranthropics
Holen
react-modernization

react-modernization

28Kdev-frontend

Upgrade React applications to latest versions, migrate from class components to hooks, and adopt concurrent features. Use when modernizing React codebases, migrating to React Hooks, or upgrading to latest React versions.

wshobson avatarwshobson
Holen
tailwind-design-system

tailwind-design-system

28Kdev-frontend

Build scalable design systems with Tailwind CSS v4, design tokens, component libraries, and responsive patterns. Use when creating component libraries, implementing design systems, or standardizing UI patterns.

wshobson avatarwshobson
Holen