react-component-cleaner

작성자: langfuse

Use this skill to clean up a React component. Only use this skill when instructed to do so by the user.

npx skills add https://github.com/langfuse/langfuse --skill react-component-cleaner

The goal of this skill is to clean up a React component. The changes are meant to be non-breaking and auditable, therefore the instructions below should be followed carefully.

Avoid making any additional edits besides the ones instructed in this skill. If you are unsure about any of the instructions or need to do a one-off edit, ask the user for confirmation. You are allowed to invoke formatting and linting commands. If there are formatting / linting issues, do not make manual edits to reformat code, always use the fix variants of the commands.

Before starting to do any changes, audit the component you were instructed to fix by reading the react-component-guidelines skill. Do not audit the callsites of the component, these will be looked at later in the skill.

This skill references a sweepy cli tool. This can be found under https://github.com/bezbac/sweepy. Unless already available, install version v0.1.0, pinned to commit e58b55c0fb94364c12798ed16e632a5931b4eaa1: https://github.com/bezbac/sweepy/tree/e58b55c0fb94364c12798ed16e632a5931b4eaa1. Follow only that pinned commit's instructions to install it. Do this in a safe manner and comply with other security guidelines of the repository. If you are unsure about any of the instructions, ask the user for confirmation.

Now, you are ready to start cleaning up the component. Copy the contents of the component cleanup todolist verbatim into a TODO file (Use cp no manual edit) and follow the instructions in order, adding ✅ to the items you have completed. Do not commit the todo file, it is only for your reference.


Notes:

  • When moving classes into a variant, the variant must own the complete set of classes for every CSS property it changes.

    • Remove those property classes from the component's base classes.
    • Ensure exactly one variant branch supplies each property. Do not rely on cn, tailwind-merge, CSS order, or specificity to resolve conflicting classes. Prefer an exhaustive lookup table or cva variants.
  • The sweepy cli by default assumes an interactive mode, but it can be run in a non-interactive mode by passing the --yes flag. This will automatically accept all changes and is useful for automation.

  • The sweepy cli has a --dry-run flag that can be used to preview the changes that will be made without actually making them.

langfuse의 다른 스킬

clickhouse-best-practices
langfuse
ClickHouse 스키마, 쿼리 또는 구성을 검토할 때 반드시 사용해야 합니다. 권장 사항을 제공하기 전에 반드시 확인해야 하는 28개의 규칙이 포함되어 있습니다. 항상 읽어보세요…
official
skill-creator
langfuse
효과적인 스킬을 만들기 위한 가이드입니다. 사용자가 Claude의 기능을 확장하는 새 스킬을 만들거나 기존 스킬을 업데이트하려 할 때 이 스킬을 사용해야 합니다.
official
vercel-react-best-practices
langfuse
Vercel Engineering의 React 및 Next.js 성능 최적화 가이드라인입니다. 이 스킬은 React/Next.js를 작성, 검토 또는 리팩토링할 때 사용해야 합니다…
official
add-model-price
langfuse
Use when editing worker/src/constants/default-model-prices.json, packages/shared/src/server/llm/types.ts, pricing tiers, tokenizer IDs, or matchPattern regexes…
official
analyze-cloud-costs
langfuse
Metabase cost marts를 사용하여 Langfuse Cloud 인프라 비용 구조를 분석합니다. 클라우드 지출, AWS 대 ClickHouse 비용 분할, 비용…에 대해 질문받을 때 사용합니다.
official
backend-dev-guidelines
langfuse
Build or review Langfuse backend code. Use for tRPC routers, public REST APIs, BullMQ processors, services, middleware, Prisma or ClickHouse access,…
official
clickhouse-best-practices
langfuse
ClickHouse 스키마, 쿼리 또는 구성을 검토할 때 반드시 사용해야 합니다. 권장사항을 제공하기 전에 확인해야 하는 28가지 규칙이 포함되어 있습니다. 항상 읽으세요…
official
code-review
langfuse
Review Langfuse code changes for correctness, regressions, and best practices.
official