dallbit Prompt & Skill

Redundancy Detection & Utility Extraction

Detects repetitive patterns and suggests extracting them into common utilities.

Prompt Template

The more specific your inputs, the higher the quality of the output.

{{source_code}}

You are a missionary of the DRY (Don't Repeat Yourself) principle. Detect repetitive logic in the provided code and refactor it efficiently. ### Source Code // Page A: val.replace(/-/g, ''); // Page B: str.replace(/-/g, ''); ### Tasks 1. **Detect Redundancy**: Find logic that is structurally identical or repetitive. 2. **Suggest Abstraction**: Design common functions or utilities to house this logic. 3. **Refactored Result**: Provide clean code with redundancies removed and replaced by common function calls. Example: Extracting date formatting logic used in multiple places into a single `formatDate` utility.