convert-to-devto
Skill27 starsChanged 48 days agoMITView on GitHub
Converts Markdown content into the format required for Dev.to publication, ensuring correct YAML frontmatter, headers, liquid tags, and inline formatting. Use when the user asks to format or convert an existing blog post or Markdown file for Dev.to.
- Reads credentials
In this repository8 other files it gives its agents.
The file
Show its rules and text
We split this skill into the rules it gives an agent
27 rules. About 0 are common, 15 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
If the first heading of the document is not at H1, fix it.
- Distinctive: line 17
Do not start a list immediately after a heading, without a blank line.
- Distinctive: line 19
Remove any lines that match the pattern "<User Name> highlighted".
- Very specific: line 22
Look for triple-backtick code blocks that are missing a language identifier.
- Distinctive: line 38
Should be converted to this: ~~~markdown Code sample:
- Very specific: line 46
Remove Unnecessary Escapes: Look for escape characters that are not required.
- Very specific: line 52
Look for strings in the text (NOT inside existing code blocks or links) that appear to be variables (snake_case) or file paths.
- Very specific: line 55
Ensure bold _variables_ or _paths_ are properly single-quoted and surrounded by bold markers.
- Distinctive: line 58
Always ensure these variables and paths are properly closed.
- Distinctive: line 66
Frontmatter Check: Ensure valid YAML frontmatter exists at the top.
- Distinctive: line 67
Ensure the frontmatter follows strict YAML syntax.
- Distinctive: line 68
Use double quotes for string values that might contain special characters (like dates or TITLES).
- Distinctive: line 69
If missing, create it.
- Distinctive: line 70
Ensure the following keys exist (add with placeholders/defaults if missing):
- Very specific: line 78
If the user or repository specifies a public GitHub repository for media assets (e.g.
- Distinctive: line 81
If no repository or base URL is supplied, leave existing URLs intact or keep relative paths for manual review.
- Distinctive: line 83
If a Twitter or YouTube link is part of a sentence, extract it to its own line (preceded and followed by a blank line) and then convert it …
- Distinctive: line 86
DO NOT convert GitHub links to liquid tags.
- Distinctive: line 87
DO NOT convert YouTube links that appear inside URL bullet lists or reference sections (such as "Useful Links and References", "Project …
- Very specific: line 97
If a standard backtick block (
toml or `ini ) renders with the language name displayed literally at the top, convert it to a tilde block … - Very specific: line 99
Before passing Markdown to Redcarpet::Markdown, Forem's MarkdownProcessor::Parser pre-processes all code spans and fenced code blocks using …
- Very specific: line 112
Symptom on DEV.to: Every subsequent fenced code block in the post breaks — rendering
yaml as a stray backtick, an empty grey code pill, … - Very specific: line 114
NEVER: write triple backticks inside an inline code span (never write
suggestion,suggestion , orsuggestion `` - Very specific: line 115
Ensure every inline code span on every line uses strictly balanced single backticks (
code) with no stray or nested backticks inside. - Very specific: line 116
Always place a blank line immediately before an opening code fence (
lang ) and immediately after a closing code fence (). - Very specific: line 119
Mandatory Fix: Keep each numbered list item (1.
- Distinctive: line 137
Do not include any conversational preamble.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are an expert technical editor. Your goal is to "fix" the supplied markdown content so that it is suitable for a Dev.to post.
Apply the following rules to the supplied content:
- Insert a blank line after all markdown headings: In the raw md, any heading should have a blank line after it, before the content. If the first heading of the document is not at H1, fix it. Do not start a list immediately after a heading, without a blank line.
- Remove User Highlights:
Remove any lines that match the pattern "
<User Name>highlighted". These artifacts often appear in exports from other platforms. - Fix Code Blocks:
Look for triple-backtick code blocks that are missing a language identifier.
Examine the code inside and add the correct language prefix (e.g.,
python,bash,javascript, etc.). - Preserve spacing inside any fenced blocks.
Handle Nested Code Blocks: The content may contain a fenced markdown block that in turn contains nested code blocks, e.g. markdown that contains a bash script sample. In this scenario, the outer markdown block should be converted from triple-backticks to triple-tildes. E.g. this:
Code sample: ```bash some codeShould be converted to this: ~~~markdown Code sample: ```bash some code- Remove Unnecessary Escapes: Look for escape characters that are not required.
E.g.
code\_styleguidesshould becode_styleguides. E.g. **Summarize Files** -> Summarize Files. E.g. file_reader_agent should be file_reader_agent.- Dollar signs (
\$->$): DEV.to's underlyingRedcarpetMarkdown parser does NOT treat$as an escapable Markdown character (unlike KaTeX/LaTeX environments). Writing\$0.02in prose renders literally with the backslash (\$0.02). Strip all\$escapes in prose so currency amounts appear cleanly as$0.02.
- Dollar signs (
- Format Inline Variables:
Look for strings in the text (NOT inside existing code blocks or links) that appear to be variables (snake_case) or file paths.
Wrap them in single backticks so they render as inline code.
E.g. file_reader_agent ->
file_reader_agent - Ensure bold variables or paths are properly single-quoted and surrounded by bold markers.
E.g. Generate llms.txt -> Generate
llms.txtE.g. file_reader_agent ->file_reader_agentAlways ensure these variables and paths are properly closed. - Fix Image Captions:
Convert split image/caption styling to standard Markdown image syntax. E.g.
- Before fixing: Image: untitled My Caption
- After fixing: Image: My Caption
- Frontmatter Check: Ensure valid YAML frontmatter exists at the top.
- Ensure the frontmatter follows strict YAML syntax.
- Use double quotes for string values that might contain special characters (like dates or TITLES).
- If missing, create it.
- Ensure the following keys exist (add with placeholders/defaults if missing):
title: Extract from the first H1 or use "TODO: Title"published: falsedate:current datetime in the format yyyy-mm-dd HH:mm:ss UTCtags: todo1, todo2canonical_url: "TODO"cover_image: "TODO"
- Optional Image Hosting Conversion (Raw GitHub / jsDelivr CDN):
- If the user or repository specifies a public GitHub repository for media assets (e.g.
--repo user/repo --branch main), convert relative local image paths (e.g.) to public hosted CDN or raw GitHub URLs:- CDN format (recommended):
https://cdn.jsdelivr.net/gh/<user>/<repo>@<branch>/<path/to/media/foo.png> - Raw GitHub format:
https://raw.githubusercontent.com/<user>/<repo>/<branch>/<path/to/media/foo.png>
- CDN format (recommended):
- If no repository or base URL is supplied, leave existing URLs intact or keep relative paths for manual review.
- If the user or repository specifies a public GitHub repository for media assets (e.g.
- Liquid Tags: Convert standalone Twitter and YouTube links to Dev.to Liquid tags.
- If a Twitter or YouTube link is part of a sentence, extract it to its own line (preceded and followed by a blank line) and then convert it to a Liquid tag.
- Twitter/X:
https://twitter.com/user/status/123orx.com/...->{% twitter 123 %} - Exceptions:
- DO NOT convert GitHub links to liquid tags; keep them as standard links.
- DO NOT convert YouTube links that appear inside URL bullet lists or reference sections (such as "Useful Links and References", "Project Demo & Portfolio", etc.). Keep them as standard Markdown links (e.g.
- [FinSavant YouTube Demo](https://www.youtube.com/watch?v=zs_IRUxIx4E)) to avoid interrupting link lists with large embeds.
- YouTube:
https://youtube.com/watch?v=123oryoutu.be/123->{% youtube 123 %}
- Check heading structure: The post title should only be in the front matter
title. It should not be repeated in the markdown content. Subsequently, all top-level headings in the md content should be H2 (##). Ensure that sub-headings are at the appropriate level. For example, any H1 headings in the provided markdown content should be converted to H2, and all subsequent heading levels (H2, H3, etc) should be demoted accordingly to maintain a logical hierarchy. - Liquid/Jekyll Escaping, Backticks, & Forem's
CODE_BLOCKS_REGEXParser:- Do NOT use
{% raw %}or{% endraw %}tags around or inside code blocks. DEV.to does not support therawLiquid tag in user posts, and including them will trigger aLiquid syntax error: Unknown tag 'endraw'page rendering crash. - Inside standard fenced code blocks (using either triple-backticks
```or triple-tildes~~~), DEV.to natively disables Liquid compilation. Write all YAML or code snippets containing double curly braces (like${{ secrets.GEMINI_API_KEY }}) exactly as-is, without any escaping. - If a standard backtick block (
```tomlor```ini) renders with the language name displayed literally at the top, convert it to a tilde block (e.g.~~~tomlor~~~~toml) to bypass the highlighting parser glitch. - CRITICAL — Never Put Multiple Backticks Inside Inline Code Spans (Forem
CODE_BLOCKS_REGEXBug): Before passing Markdown toRedcarpet::Markdown, Forem'sMarkdownProcessor::Parserpre-processes all code spans and fenced code blocks using a lazy multiline regex:
Because# From forem/app/services/markdown_processor/parser.rb: CODE_BLOCKS_REGEX = /(~{3}|`{3}|`{2}|`)[\s\S]*?\1/ def escape_liquid_tags_in_codeblock(code_tag_content) code_tag_content.gsub(CODE_BLOCKS_REGEX) do |code| "{% raw %}#{code}{% endraw %}" end endCODE_BLOCKS_REGEXonly has branches for~{3},`{3},`{2}, and`(with **no{4}branch** and[\s\S]*?` matching across newlines!), any inline code span containing triple backticks or an uneven/mismatched backtick sequence will corrupt the entire rest of the article:- Failure Example: Writing
` ```suggestion `(5 backticks:1 + 3 + 1) causesCODE_BLOCKS_REGEXto match the 1st backtick with the first backtick of```(1to1). Then, the remaining two backticks () open a **2-backtick (` `{2} `) multiline match** that completely ignores the single closing backtick after `suggestion` and scans dozens of lines down the page until it consumes the first two backticks of your next```yaml `` fenced code block! - Symptom on DEV.to: Every subsequent fenced code block in the post breaks — rendering
```yamlas a stray backtick, an empty grey code pill, and plain text (` [ ] yaml) followed by unformatted YAML/bash code leaking into paragraph text. - Mandatory Fix:
- NEVER write triple backticks inside an inline code span (never write
` ```suggestion `,suggestion `` ``, or ```` ````suggestion). Instead, refer to the fence identifier cleanly as`suggestion`blocks (or`yaml`blocks) in prose. - Ensure every inline code span on every line uses strictly balanced single backticks (
`code`) with no stray or nested backticks inside. - Always place a blank line immediately before an opening code fence (
```lang) and immediately after a closing code fence (```).
- NEVER write triple backticks inside an inline code span (never write
- Failure Example: Writing
- Do NOT use
- Ordered List (
1.,2.) Continuation & Preventing List Resets in Redcarpet:- DEV.to's
RedcarpetMarkdown parser breaks an<ol>list and restarts subsequent numbered items back at1.whenever an ordered list item contains a blank line followed by an unindented or 3-space-indented paragraph (or when list item text drops to a new unindented line). - Mandatory Fix: Keep each numbered list item (
1. **Heading:** Text...,2. **Heading:** Text...) as a single contiguous paragraph on the same line (without blank lines between paragraphs inside a list item), or indent continuation paragraphs/blocks by strictly 4 spaces soRedcarpetpreserves the<ol>sequence (1.,2.,3.,4.).
- DEV.to's
- Replace Medium Embedly / Datawrapper
<iframe>Blocks with Native Markdown Tables:- Medium exports Datawrapper tables as
<iframe src="https://cdn.embedly.com/widgets/media.html?...datawrapper...">blocks because Medium does not support Markdown tables. - DEV.to strips raw
<iframe>embeds and natively renders Markdown tables. Whenever converting a Medium export that contains a Datawrapper<iframe>, replace it with the original native Markdown table from the source.mddraft.
- Medium exports Datawrapper tables as
- Adapt the "Before You Go" Call-to-Action for Dev.to:
- DEV.to uses multi-reactions (❤️ 🦄 🤯 🙌 🔥) and bookmarks (🔖) rather than Medium's claps (👏) and email subscribe bell (🔔).
- Whenever the post contains the Medium "Before You Go" section, replace it with the Dev.to variant:
## Before You Go - **Please share** 📢 this with anyone that you think will be interested. It might help them, and it really helps me! - Please **drop some reactions** ❤️ 🦄 🔥 (you can pick more than one!) and **bookmark** 🔖 this post! - Please **leave a comment** 💬. Interaction is good! - **Add a star** ⭐ on my repos! - **Follow** 👉 me here on Dev.to, so you don’t miss my content.
Output ONLY the final, fixed markdown content. Do not include any conversational preamble. Do not wrap in additional tags.
<input_markdown> {{args}} </input_markdown>
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

