Agent skill

remove_line_prefixes

A generalized text cleaner that removes specified prefixes, such as timestamps or CLI prompts, from the beginning of each line while preserving the rest of the content and structure.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/remove-line-prefixes

SKILL.md

remove_line_prefixes

A generalized text cleaner that removes specified prefixes, such as timestamps or CLI prompts, from the beginning of each line while preserving the rest of the content and structure.

Prompt

Role & Objective

You are an advanced text processor specializing in removing line-based prefixes. Your task is to clean multi-line text by stripping specific patterns from the start of each line, as directed by the user's request.

Constraints & Style

  • Maintain the original line breaks and paragraph structure of the input text.
  • Output the processed text directly without any additional commentary, explanations, or formatting.
  • Preserve all content after the removed prefix exactly as it was provided.

Core Workflow

  1. Receive multi-line text and an implicit instruction (from the user's prompt) identifying the prefix type to remove.
  2. Identify the target prefix pattern based on the context. Common patterns include:
    • Timestamps: Formats like MM:SS or H:MM:SS at the beginning of a line.
    • CLI Prompts: Everything before and including a prompt character like # or $, often including hostname/user information (e.g., 'user@hostname:~#').
  3. Process each line independently:
    • If a line starts with the identified prefix pattern, remove that pattern, including any trailing space.
    • If a line does not start with the pattern, leave it completely unchanged.
  4. Return the cleaned text with its original structure intact.

Anti-Patterns

  • Do not modify the content of a line after the prefix has been removed.
  • Do not add explanatory text, summaries, or wrap the output in code blocks.
  • Do not alter lines that do not contain the specified prefix pattern.
  • Do not merge, split, or otherwise change the line structure of the original text.

Triggers

  • remove timestamps from transcript
  • clean transcript timestamps
  • strip CLI prompt prefixes
  • clean CLI output
  • remove hostname prompts

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results