stream-formatter
LLM streaming output formatter with auto buffer, format correction, sentence break optimization, markdown rendering, improve chat UX
Best use case
stream-formatter is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
LLM streaming output formatter with auto buffer, format correction, sentence break optimization, markdown rendering, improve chat UX
Teams using stream-formatter should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/stream-formatter/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How stream-formatter Compares
| Feature / Agent | stream-formatter | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
LLM streaming output formatter with auto buffer, format correction, sentence break optimization, markdown rendering, improve chat UX
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
AI Agents for Startups
Explore AI agent skills for startup validation, product research, growth experiments, documentation, and fast execution with small teams.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
SKILL.md Source
# ✨ 流式输出格式化器
## 核心亮点
1. 🚀 **实时流式优化**:边输出边修复,不需要等待大模型返回完成,延迟<10ms
2. 📝 **自动格式修复**:自动修复Markdown格式错误、不完整的代码块、链接、列表等
3. 💬 **智能断句**:按完整句子输出,避免输出半个单词或半句话,大幅提升阅读体验
4. 🚫 **去重处理**:自动去除大模型重复输出的内容,避免混乱
## 🎯 适用场景
- 所有对话类Agent、聊天机器人
- 实时内容生成场景
- Markdown内容流式渲染
- 提升用户交互体验的所有场景
## 📝 参数说明
| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| action | string | 是 | 操作类型:init/process/reset |
| options | object | 否 | 初始化配置项 |
| chunk | string | 否 | process操作必填,大模型返回的流式块 |
| flush | boolean | 否 | process操作可选,是否强制输出所有缓冲区内容 |
## 💡 开箱即用示例
### 基础用法
```typescript
// 初始化
await skills.streamFormatter({ action: "init" });
// 处理流式输出
for await (const chunk of llm.streamResponse) {
const result = await skills.streamFormatter({
action: "process",
chunk: chunk.text
});
if (result.output) {
sendToUser(result.output); // 只输出完整的句子
}
}
// 最后强制刷新缓冲区
const final = await skills.streamFormatter({
action: "process",
chunk: "",
flush: true
});
if (final.output) {
sendToUser(final.output);
}
```
### 自定义配置
```typescript
await skills.streamFormatter({
action: "init",
options: {
buffer_size: 20,
format_markdown: true,
fix_incomplete_sentences: true
}
});
```
## 🔧 技术实现说明
- 轻量级缓冲区设计,内存占用<1KB
- 支持中英文双语标点识别,断句准确率95%+
- 内置常见Markdown格式错误修复规则
- 零外部依赖,不影响流式输出性能Related Skills
wechat-formatter
Render article markdown into WeChat-style HTML as an independent executor. Use when Codex needs公众号排版预览, WeChat HTML output, or a publishable HTML artifact generated from an article markdown draft.
citation-formatter
Use when formatting references for journal submission, converting between citation styles (APA, MLA, Vancouver, Chicago), generating bibliographies for manuscripts, or ensuring consistent reference formatting. Automatically formats citations and bibliographies in 1000+ academic styles. Ensures reference accuracy, completeness, and compliance with journal requirements. Supports batch conversion and integration with reference managers.
MuseStream Skill
AI music generation and streaming. Give the user a shareable player URL — music generates and plays continuously in their browser. All songs are saved to a local library.
amap-maps-streamableHTTP
Auto-generated skill for amap-maps-streamableHTTP tools via OneKey Gateway.
structs-streaming
Connects to the GRASS real-time event system via NATS WebSocket. Use when you need real-time game updates, want to react to events as they happen, need to monitor raids or attacks, watch for player creation, track fleet movements, or build event-driven tools. GRASS is the fastest way to know what's happening in the galaxy.
livestream-script-generator
直播带货脚本生成,话术设计、节奏把控、互动环节、促单技巧。适合直播主播、电商运营、MCN 机构。
---
name: article-factory-wechat
humanizer
Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.
find-skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
tavily-search
Use Tavily API for real-time web search and content extraction. Use when: user needs real-time web search results, research, or current information from the web. Requires Tavily API key.
baidu-search
Search the web using Baidu AI Search Engine (BDSE). Use for live information, documentation, or research topics.
agent-autonomy-kit
Stop waiting for prompts. Keep working.