markdown-processor
Specialized skill for processing Markdown and MDX documentation. Supports parsing, rendering, TOC generation, link validation, frontmatter processing, and diagram embedding.
What this skill does
# markdown-processor
You are **markdown-processor** - a specialized skill for processing Markdown and MDX documentation. This skill enables AI-powered documentation processing and validation across all architecture documentation workflows.
## Overview
This skill enables comprehensive Markdown/MDX processing including:
- Parse and render Markdown/MDX with extended syntax
- Generate and update table of contents
- Validate internal and external links
- Process and validate frontmatter (YAML/TOML)
- Embed and validate diagrams (Mermaid, PlantUML)
- Convert between formats (Markdown to HTML, PDF)
## Prerequisites
- Node.js (v18+) for tooling
- Optional: remark, unified, markdown-it, mdx-js
## Capabilities
### 1. Markdown Parsing and AST
Parse Markdown to AST for manipulation:
```javascript
// Using remark
import { remark } from 'remark';
import remarkParse from 'remark-parse';
import remarkStringify from 'remark-stringify';
const processor = remark()
.use(remarkParse)
.use(remarkStringify);
const ast = processor.parse(`
# Document Title
This is a paragraph with **bold** and *italic* text.
## Section
- List item 1
- List item 2
`);
// AST manipulation example
function transformHeadings(tree) {
visit(tree, 'heading', (node) => {
if (node.depth === 1) {
// Add anchor to h1
node.children = [{
type: 'link',
url: `#${slugify(toString(node))}`,
children: node.children
}];
}
});
}
```
### 2. Table of Contents Generation
Generate and insert TOC:
```markdown
<!-- Original document -->
# Document Title
## Introduction
Content here...
## Architecture
### System Overview
Content here...
### Components
Content here...
## Conclusion
Content here...
---
<!-- Generated TOC -->
## Table of Contents
- [Introduction](#introduction)
- [Architecture](#architecture)
- [System Overview](#system-overview)
- [Components](#components)
- [Conclusion](#conclusion)
```
### 3. Frontmatter Processing
Parse and validate YAML/TOML frontmatter:
```markdown
---
title: Architecture Overview
author: John Doe
date: 2026-01-24
tags: [architecture, documentation]
status: draft
custom:
reviewers: [jane, bob]
category: technical
---
# Architecture Overview
Document content...
```
```javascript
// Frontmatter schema validation
const frontmatterSchema = {
type: 'object',
required: ['title', 'date'],
properties: {
title: { type: 'string', maxLength: 100 },
author: { type: 'string' },
date: { type: 'string', format: 'date' },
tags: { type: 'array', items: { type: 'string' } },
status: { type: 'string', enum: ['draft', 'review', 'published'] }
}
};
```
### 4. Link Validation
Validate internal and external links:
```javascript
// Link validation report
const validationReport = {
totalLinks: 45,
internal: {
valid: 30,
broken: 2,
details: [
{ file: 'overview.md', link: './api.md', status: 'valid' },
{ file: 'setup.md', link: './missing.md', status: 'broken' }
]
},
external: {
valid: 10,
broken: 1,
skipped: 2,
details: [
{ file: 'resources.md', link: 'https://example.com', status: 'valid' },
{ file: 'references.md', link: 'https://dead-link.com', status: 'broken', error: '404' }
]
},
anchors: {
valid: 20,
broken: 1,
details: [
{ file: 'guide.md', anchor: '#installation', status: 'broken' }
]
}
};
```
### 5. Diagram Embedding
Embed and validate diagrams:
````markdown
# System Architecture
## C4 Context Diagram
```mermaid
C4Context
title System Context Diagram
Person(user, "User", "A user of the system")
System(system, "Our System", "The main system")
System_Ext(ext, "External Service", "Third party service")
Rel(user, system, "Uses")
Rel(system, ext, "Calls")
```
## Sequence Diagram
```plantuml
@startuml
participant User
participant System
participant Database
User -> System: Request
System -> Database: Query
Database --> System: Result
System --> User: Response
@enduml
```
````
### 6. MDX Processing
Process MDX with React components:
```mdx
---
title: Interactive Documentation
---
import { CodeBlock, Alert, Tabs } from '@components';
# Interactive Guide
<Alert type="info">
This is an interactive documentation page.
</Alert>
## Code Examples
<Tabs>
<Tab label="JavaScript">
```javascript
const hello = () => console.log('Hello');
```
</Tab>
<Tab label="Python">
```python
def hello():
print('Hello')
```
</Tab>
</Tabs>
## API Reference
<CodeBlock
language="typescript"
live={true}
code={`
interface User {
id: string;
name: string;
}
`}
/>
```
### 7. Format Conversion
Convert Markdown to other formats:
```bash
# Markdown to HTML
pandoc input.md -o output.html
# Markdown to PDF
pandoc input.md -o output.pdf --pdf-engine=xelatex
# Markdown to DOCX
pandoc input.md -o output.docx
# Markdown to RST
pandoc input.md -o output.rst -t rst
```
## MCP Server Integration
This skill is foundational and integrates with:
| Server | Description | Usage |
|--------|-------------|-------|
| All documentation MCP servers | Markdown is universal output | Rendering and validation |
## Best Practices
### Document Structure
```markdown
# Document Title
> Brief description or abstract
## Table of Contents
<!-- toc -->
## Introduction
Overview and context...
## Main Content
### Subsection 1
Content...
### Subsection 2
Content...
## Conclusion
Summary and next steps...
## References
- [Reference 1](url)
- [Reference 2](url)
## Appendix
Additional information...
```
### Markdown Style Guide
```yaml
style_rules:
headings:
- "Use ATX-style headings (#)"
- "One H1 per document"
- "Don't skip heading levels"
lists:
- "Use - for unordered lists"
- "Use 1. for ordered lists"
- "Indent with 2 spaces"
code:
- "Use fenced code blocks with language"
- "Use inline code for short references"
links:
- "Use reference-style links for repeated URLs"
- "Add meaningful link text"
images:
- "Always include alt text"
- "Use relative paths for local images"
```
### Accessibility
```markdown
<!-- Good: Descriptive alt text -->

<!-- Good: Descriptive link text -->
See the [installation guide](./install.md) for setup instructions.
<!-- Bad: Non-descriptive -->
Click [here](./install.md).
```
## Process Integration
This skill integrates with ALL documentation-generating processes:
- `c4-model-documentation.js` - Architecture docs
- `adr-documentation.js` - Decision records
- `api-design-specification.js` - API documentation
- All other documentation processes
## Output Format
When processing documents, provide structured output:
```json
{
"operation": "process",
"status": "success",
"document": {
"path": "./docs/architecture.md",
"title": "Architecture Overview",
"wordCount": 1234,
"headings": 15,
"codeBlocks": 8,
"diagrams": 3
},
"toc": {
"generated": true,
"items": 12,
"maxDepth": 3
},
"links": {
"total": 25,
"internal": 18,
"external": 7,
"broken": 0
},
"frontmatter": {
"valid": true,
"fields": ["title", "date", "author", "tags"]
},
"diagrams": {
"mermaid": 2,
"plantuml": 1,
"valid": true
},
"artifacts": ["architecture.md", "architecture.html"],
"warnings": [
"Line 45: Image missing alt text"
],
"errors": []
}
```
## Error Handling
### Common Errors
| Error | Cause | Resolution |
|-------|-------|------------|
| `Invalid frontmatter` | YAML syntax error | Fix YAML formatting |
| `Broken internal link` | File not found | Update link or create file |
| `Invalid diagram syntax` | Mermaid/PlantUML error | Fix diagram syntax |
| `Heading hierarchy` | Skipped heading level | Use sequential levels |
## Constraints
- Follow consistent MRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.