Skip to content
Back to skills

Conversation Json To Md

BSecurity

Convert chat export JSON files into multiple Markdown files (one conversation per file). Use when users ask to split AI chat logs, preserve only user-assistant Q/A, format question as heading, keep response Markdown, and normalize filenames/headings after export.

  • 18 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 26, 2026
toolspythonbash

Works with

  • claude web

Security analysis

B75/100
  • criticalAccesses sensitive system or user directories

Pro scans all 2 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add YangsonHung/awesome-agent-skills --skill conversation-json-to-md --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Conversation Json To Md?

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

Security grade badge for Conversation Json To Md
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/yangsonhung-conversation-json-to-md/badge)](https://www.skillsdirectory.com/skills/yangsonhung-conversation-json-to-md)

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: conversation-json-to-md
description: Convert chat export JSON files into multiple Markdown files (one conversation per file). Use when users ask to split AI chat logs, preserve only user-assistant Q/A, format question as heading, keep response Markdown, and normalize filenames/headings after export.
---

# Conversation JSON To MD

Convert a user-provided chat-export JSON into multiple Markdown files with consistent Q/A formatting.

## When to Use

Use this skill when the user asks for:
- Splitting one JSON chat export into many `.md` files
- One conversation per markdown file
- Keeping only question/answer content from user and assistant
- Renaming response section to `回答`
- Normalizing exported files with a second formatting pass

## Do not use

Do not use this skill for:
- Plain text transformation that does not involve JSON chat exports
- Non-conversation JSON processing tasks
- Requests requiring semantic summarization instead of structural conversion

## Instructions

1. Read the input file path provided by the user. Do not assume default file names.
2. Detect conversation/message structure automatically.
3. Export one markdown file per conversation.
4. Keep only user/assistant Q&A content.
5. Format each Q/A block as:
   - `## <question text>`
   - `### 回答`
6. Preserve answer markdown and demote answer-internal heading levels by one level.
7. Run an independent second-pass formatting check and fix naming/title structure before final delivery.

## Supported Input Structures

The bundled script supports common export formats including:
- DeepSeek/ChatGPT-like mapping tree (`mapping/root/children/fragments`)
- Qwen-like exports (`data[].chat.messages[]`, `content_list` with `phase=answer`)
- Claude web export style (`list[{ name, chat_messages: [...] }]`)
- Generic message arrays (`messages`, `history`, `conversations`, `dialog`, `turns`)
- Pair fields (`question-answer`, `prompt-response`, `input-output`)

If format detection fails, stop and ask the user for a sample snippet, then extend parsing rules.

## Run Script

```bash
python3 scripts/convert_conversations.py \
  --input /path/to/<user-provided>.json \
  --output-dir /path/to/output_md \
  --clean
```

## Output Format

Each output file uses this structure:

```md
# <conversation title>

## <user question 1>
### 回答
<assistant answer markdown>

## <user question 2>
### 回答
<assistant answer markdown>
```

## Second-Pass Formatting (Required)

After export, run a second-pass check/fix on output files:

1. Filename normalization:
- Keep title-only naming
- Remove illegal filename characters
- Resolve duplicates with ` (2)`, ` (3)`...

2. Heading normalization:
- Keep only one H1: `# <conversation title>`
- Ensure questions are H2
- Ensure responses are exactly `### 回答`

3. Body normalization:
- Keep answer body markdown
- Keep answer-internal heading demotion

4. Final verification:
- Confirm no files still violate naming or heading rules

## Validation Checklist

- File count equals detected conversation count
- No random suffixes in filenames
- No `## REQUEST` or `## RESPONSE` headers in output
- Response blocks are present as `### 回答`
- Output preserves markdown rendering correctly

Files in this skill

  • SKILL.md3.2 KB
  • scripts/convert_conversations.py21.4 KB

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.