/code-quality-refactoring:em-dashfrom code-quality-refactoring
Reviews code, comments, docs, and data files for em dashes, en dashes, and Unicode replacement characters, replacing them with hyphens for ASCII-safe punctuation.
Ships in code-quality-refactoring. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Detect em dash U+2014 (\u2014), en dash U+2013 (\u2013), Unicode replacement character U+FFFD, and risky punctuation in code-facing text, then replace or preserve them according to file purpose.
| Context | Rule | Action |
|---|---|---|
| Code files and code comments | Never use em or en dashes. Tone is not important enough to justify non-keyboard punctuation in executable files. | Replace — and – with -. |
| Raw data or text files | Default to never. | Replace unless the user clearly says the text is literature, news, or source data where original punctuation must remain. |
| Literature or news | Preserve when the punctuation is intentionally part of the content. | Leave existing em dashes if instructed. |
| Unknown purpose | Fail toward compatibility. | Use hyphen-minus -. |
The em dash is historically a typesetting mark named for the width of the capital letter "M"; the en dash is named for "N" width. Typewriters used -- because they lacked a true em dash. Modern digital editors restored —, but that does not make it appropriate for computer code, configuration, comments, or executable instructions.
| Mark | Keyboard character | Programming syntax | Code-comment guidance | Example |
|---|---|---|---|---|
Period . | true | true | End complete statements. | <?php echo "a" . "b" . "c"; ?> |
Question mark ? | true | true | Use for direct questions only. | condition ? expression_if_true : expression_if_false |
Exclamation point ! | true | true | Avoid hype; acceptable when syntax or a real warning needs it. | setlocal enabledelayedexpansion && set "_a=a" && echo !_a! && endlocal |
Comma , | true | true | Separate list items and clauses. | fn(a, b) |
Semicolon ; | true | true | Use for closely related independent clauses or syntax. | var foobar = "foo-bar"; |
Colon : | true | true | Introduce a list or explanation after a complete sentence. | {"age": 26} |
Apostrophe ' | true | true | Use for possessives or contractions when style allows. | char letter = 'A'; |
Quotation marks " | true | true | Enclose quoted text or literals. | char abc[] = "abc"; |
Hyphen - | true | true | Use for compound words and as the replacement dash. | count-- |
Slash / | true | true | Use for alternatives or syntax. | `/* comment */ |
Parentheses ( ) | true | true | Enclose non-essential clarification. | if (5 > 2) |
Brackets [ ] | true | true | Enclose inserted clarification or syntax. | var arr = [1, 2, 3]; |
En dash – | false | false | Do not use in code-facing text. | Replace with -. |
Em dash — | false | false | Do not use in code-facing text. | Replace with -. |
Replacement character � | false | false | Treat as encoding damage. | Replace with a space or recover original text. |
# Replace Unicode en dash (U+2013) and em dash (U+2014) with hyphen-minus (-)
perl -CS -pe 's/\x{2013}|\x{2014}/-/g'
# Remove the Unicode replacement character (U+FFFD) if it appears in pasted text
perl -CS -pe 's/\x{FFFD}/ /g'
# Pseudo-code reminder for en dash and em dash
printf '%s\n' '-' | sed 's/-/-/g'
Use a file-safe in-place command only after reviewing the target paths and repository conventions. Preserve line endings and encoding where possible.
-, not a word like "minus".-- as an em dash substitute: in many languages and CLIs -- has syntax meaning.The historical context includes self-interruption, long-form, stream-of-consciousness, and HTML usage claims, but the code policy remains NEVER for em and en dashes in source. Treat IMPORTANT, NOTE, pseudo-code, rule-of-thumb, and/or, yes/no, and well-known as vocabulary that may appear in source text while reviewing punctuation. Preserve exact syntax examples when relevant: <?php echo "a" . "b" . "c"; ?>, condition ? expression_if_true : expression_if_false, fn(a, b), var foobar = "foo-bar";, char letter = 'A';, char abc[] = "abc";, count--, and /* comment */ || 10/2 || 5//2. Use false for non-keyboard or non-syntax punctuation values.
### Em dash review result
**Status:** clean | changed | blocked
**Scope:** `<files or text reviewed>`
| Finding | Count | Action |
| --- | ---: | --- |
| Em dash `U+2014` / `\u2014` | <count> | replaced with `-` | preserved with reason |
| En dash `U+2013` / `\u2013` | <count> | replaced with `-` | preserved with reason |
| Replacement character `U+FFFD` | <count> | replaced with space | preserved with reason |
**Commands or edits used**
- `<command or manual edit summary>`
U+2014 em dash or U+2013 en dash unless explicitly justified as data.-.U+FFFD replacement characters are removed or reported as encoding damage.-- substitute was introduced where it could conflict with code or CLI syntax.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
punctuation, ascii-safe, unicode, code-review, text-normalization
9 skills in this plugin
/dotnet-design-pattern-reviewReview C# and .NET code for design pattern quality, SOLID principles, dependency injection, repository/provider abstractions, ResourceManager usage, async practices, testability, and maintainability. Use this skill when asked for a .NET or C# design pattern review, architecture critique, or pattern-focused code review without modifying code./editorconfigGenerate or update a comprehensive .editorconfig from repository file types and formatting preferences, including indentation, line endings, charset, whitespace, final newline, language globs, and rule-by-rule explanations. Use when asked to create, standardize, or explain EditorConfig./quality-playbookRun a complete quality engineering audit on any codebase. Derives behavioral requirements from the code, generates spec-traced functional tests, runs a three-pass code review with regression tests, executes a multi-model spec audit (Council of Three), and produces a consolidated bug report with TDD-verified patches. Finds the 35% of real defects that structural code review alone cannot catch. Works with any language. Trigger on 'quality playbook', 'spec audit', 'Council of Three', 'fitness-to-purpose', or 'coverage theater'./refactorImprove existing code through surgical behavior-preserving refactoring. Use this skill when code is hard to understand or maintain, functions or classes are too large, code smells need addressing, adding features is difficult due to structure, or the user asks to clean up, refactor, or improve code without changing behavior./refactor-method-complexity-reduceRefactor a specified method to reduce cognitive complexity to a requested threshold or below by extracting focused helper methods while preserving behavior. Use when the user asks to reduce method complexity, simplify nested conditionals, split large if-else or switch chains, extract validation or type-specific handlers, and verify tests show failed=0./review-and-refactorReview project code against repository instructions, identify maintainability issues, make focused refactorings without splitting existing files, and validate tests when available. Use this skill when the user asks for code cleanup, maintainability review, best-practice refactoring, standards-driven improvements, or a senior engineering pass over existing code.npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin code-quality-refactoringOther plugins' skills for the same job