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.
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
- Receive multi-line text and an implicit instruction (from the user's prompt) identifying the prefix type to remove.
- 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:~#').
- 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.
- 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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?