agentleFS
derailed-dashderailed-dash/dazbo-agent-skills/skills/convert-to-devto/SKILL.md

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

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
  1. Distinctive:

    If the first heading of the document is not at H1, fix it.

    line 16
  2. Distinctive:

    Do not start a list immediately after a heading, without a blank line.

    line 17
  3. Distinctive:

    Remove any lines that match the pattern "<User Name> highlighted".

    line 19
  4. Very specific:

    Look for triple-backtick code blocks that are missing a language identifier.

    line 22
  5. Distinctive:

    Should be converted to this: ~~~markdown Code sample:

    line 38
  6. Very specific:

    Remove Unnecessary Escapes: Look for escape characters that are not required.

    line 46
  7. Very specific:

    Look for strings in the text (NOT inside existing code blocks or links) that appear to be variables (snake_case) or file paths.

    line 52
  8. Very specific:

    Ensure bold _variables_ or _paths_ are properly single-quoted and surrounded by bold markers.

    line 55
  9. Distinctive:

    Always ensure these variables and paths are properly closed.

    line 58
  10. Distinctive:

    Frontmatter Check: Ensure valid YAML frontmatter exists at the top.

    line 66
  11. Distinctive:

    Ensure the frontmatter follows strict YAML syntax.

    line 67
  12. Distinctive:

    Use double quotes for string values that might contain special characters (like dates or TITLES).

    line 68
  13. Distinctive:

    If missing, create it.

    line 69
  14. Distinctive:

    Ensure the following keys exist (add with placeholders/defaults if missing):

    line 70
  15. Very specific:

    If the user or repository specifies a public GitHub repository for media assets (e.g.

    line 78
  16. Distinctive:

    If no repository or base URL is supplied, leave existing URLs intact or keep relative paths for manual review.

    line 81
  17. Distinctive:

    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 …

    line 83
  18. Distinctive:

    DO NOT convert GitHub links to liquid tags.

    line 86
  19. Distinctive:

    DO NOT convert YouTube links that appear inside URL bullet lists or reference sections (such as "Useful Links and References", "Project …

    line 87
  20. Very specific:

    If a standard backtick block ( toml or `ini ) renders with the language name displayed literally at the top, convert it to a tilde block …

    line 97
  21. Very specific:

    Before passing Markdown to Redcarpet::Markdown, Forem's MarkdownProcessor::Parser pre-processes all code spans and fenced code blocks using …

    line 99
  22. Very specific:

    Symptom on DEV.to: Every subsequent fenced code block in the post breaks — rendering yaml as a stray backtick, an empty grey code pill, …

    line 112
  23. Very specific:

    NEVER: write triple backticks inside an inline code span (never write suggestion , suggestion , or suggestion ` `

    line 114
  24. Very specific:

    Ensure every inline code span on every line uses strictly balanced single backticks ( code ) with no stray or nested backticks inside.

    line 115
  25. Very specific:

    Always place a blank line immediately before an opening code fence ( lang ) and immediately after a closing code fence ( ).

    line 116
  26. Very specific:

    Mandatory Fix: Keep each numbered list item (1.

    line 119
  27. Distinctive:

    Do not include any conversational preamble.

    line 137

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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:

  1. 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.
  2. Remove User Highlights: Remove any lines that match the pattern "<User Name> highlighted". These artifacts often appear in exports from other platforms.
  3. 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.).
  4. Preserve spacing inside any fenced blocks.
  5. 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 code
    
    Should be converted to this:
    ~~~markdown
    Code sample:
    ```bash
    some code
  6. Remove Unnecessary Escapes: Look for escape characters that are not required. E.g. code\_styleguides should be code_styleguides. E.g. **Summarize Files** -> Summarize Files. E.g. file_reader_agent should be file_reader_agent.
    • Dollar signs (\$ -> $): DEV.to's underlying Redcarpet Markdown parser does NOT treat $ as an escapable Markdown character (unlike KaTeX/LaTeX environments). Writing \$0.02 in prose renders literally with the backslash (\$0.02). Strip all \$ escapes in prose so currency amounts appear cleanly as $0.02.
  7. 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
  8. Ensure bold variables or paths are properly single-quoted and surrounded by bold markers. E.g. Generate llms.txt -> Generate llms.txt E.g. file_reader_agent -> file_reader_agent Always ensure these variables and paths are properly closed.
  9. Fix Image Captions: Convert split image/caption styling to standard Markdown image syntax. E.g.
  10. 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: false
      • date: current datetime in the format yyyy-mm-dd HH:mm:ss UTC
      • tags: todo1, todo2
      • canonical_url: "TODO"
      • cover_image: "TODO"
  11. 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. ![Alt](media/foo.png)) 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>
    • If no repository or base URL is supplied, leave existing URLs intact or keep relative paths for manual review.
  12. 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/123 or x.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=123 or youtu.be/123 -> {% youtube 123 %}
  13. 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.
  14. Liquid/Jekyll Escaping, Backticks, & Forem's CODE_BLOCKS_REGEX Parser:
    • Do NOT use {% raw %} or {% endraw %} tags around or inside code blocks. DEV.to does not support the raw Liquid tag in user posts, and including them will trigger a Liquid 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 (```toml or ```ini) renders with the language name displayed literally at the top, convert it to a tilde block (e.g. ~~~toml or ~~~~toml) to bypass the highlighting parser glitch.
    • CRITICAL — Never Put Multiple Backticks Inside Inline Code Spans (Forem CODE_BLOCKS_REGEX Bug): Before passing Markdown to Redcarpet::Markdown, Forem's MarkdownProcessor::Parser pre-processes all code spans and fenced code blocks using a lazy multiline regex:
      # 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
      end
      Because CODE_BLOCKS_REGEX only 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) causes CODE_BLOCKS_REGEX to match the 1st backtick with the first backtick of ``` (1 to 1). 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 ```yaml as a stray backtick, an empty grey code pill, and plain text (` [ ] yaml) followed by unformatted YAML/bash code leaking into paragraph text.
      • Mandatory Fix:
        1. 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.
        2. Ensure every inline code span on every line uses strictly balanced single backticks (`code`) with no stray or nested backticks inside.
        3. Always place a blank line immediately before an opening code fence (```lang) and immediately after a closing code fence (```).
  15. Ordered List (1., 2.) Continuation & Preventing List Resets in Redcarpet:
    • DEV.to's Redcarpet Markdown parser breaks an <ol> list and restarts subsequent numbered items back at 1. 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 so Redcarpet preserves the <ol> sequence (1., 2., 3., 4.).
  16. 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 .md draft.
  17. 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>

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.