Skip to content
Back to skills

As Markdown

ASecurity

Extract markdown document structure and content from mixed/embedded text (NOT for converting plain text TO markdown)

  • 10 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 6, 2026
ai-agents

Security analysis

A100/100

Scanned June 6, 2026

npx -y skills add bdambrosio/Cognitive_workbench --skill as-markdown --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of As Markdown?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for As Markdown
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bdambrosio-as-markdown/badge)](https://www.skillsdirectory.com/skills/bdambrosio-as-markdown)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: as-markdown
description: Extract markdown document structure and content from mixed/embedded text (NOT for converting plain text TO markdown)
type: prompt_augmentation
examples:
  - '{"type":"as-markdown","target":"$llm_response","element":"headers","out":"$toc"}'
---

# As Markdown

Interpret note content as markdown, automatically identifying markdown within mixed content and extracting structural elements.

## Purpose

- Extract markdown from LLM responses with noise
- Parse document structure (headers, lists, links, code)
- Extract content under specific sections
- Strip surrounding non-markdown text
- Validate markdown present

## Input Format

Accepts a Note containing markdown (clean or embedded):
- Clean markdown
- Markdown with surrounding text
- Code-fenced markdown blocks
- Mixed format responses

## Parameters

**Optional:**
- **element** - Element type: "headers", "lists", "links", "code", "section", or "all" (default)
- **section** - When element="section", specify header name to extract content under
- **all** - If true, returns array of all matching elements; if false/omitted, returns first match (default: false)

## Output Format

Returns extracted elements:
- **headers**: List of headers with levels
- **lists**: All list items (ordered and unordered)
- **links (all=false)**: First link found; (all=true): All links
- **code (all=false)**: First code block; (all=true): All code blocks
- **section**: Content under specified header
- **all**: Structured breakdown of all elements
- **Element not found**: note-null
- **Markdown not identified**: FAIL (hard error)

## Usage Examples

**Extract all structure:**
```json
{"type":"as-markdown","target":"$llm_response","out":"$structure"}
```

**Extract headers for TOC:**
```json
{"type":"as-markdown","target":"$doc","element":"headers","out":"$toc"}
```

**Extract specific section:**
```json
{"type":"as-markdown","target":"$doc","element":"section","section":"Usage","out":"$usage"}
```

**Extract first code block:**
```json
{"type":"as-markdown","target":"$response","element":"code","out":"$code"}
```

**Extract all code blocks:**
```json
{"type":"as-markdown","target":"$response","element":"code","all":true,"out":"$all_code"}
```

## Guidelines

- Strips leading/trailing non-markdown text automatically
- Element not found returns note-null (soft failure)
- No markdown identified triggers FAIL (hard failure)
- Preserves nesting for lists
- Code blocks include language identifier if present
- Default extracts first match; use `all: true` for all matches (applies to links, code)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…