text-formatter
3
总安装量
3
周安装量
#55174
全站排名
安装命令
npx skills add https://github.com/prorise-cool/prorise-claude-skills --skill text-formatter
Agent 安装分布
opencode
2
gemini-cli
2
antigravity
2
claude-code
2
windsurf
2
codex
2
Skill 文档
Text Formatter
Transform and optimize text content with intelligent structure analysis. Output format: BBCode + Markdown hybrid optimized for forum publishing.
Architecture Overview
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â Text Formatter Architecture (BBCode + MD Mode) â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
â â
â Phase 1: Input Collection â æ¥æ¶ææ¬/æä»¶ â
â â â
â Phase 2: Content Analysis â åæç»æãè¯å« Callout/Admonition â
â â â
â Phase 3: Format Transform â 转æ¢ä¸º BBCode+MD æ ¼å¼ â
â â â
â Phase 4: Output & Preview â ä¿åæä»¶ + é¢è§ â
â â
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Key Design Principles
- Single Format Output: BBCode + Markdown hybrid (forum optimized)
- Pixel-Based Sizing: size=150/120/100/80 (not 1-7 levels)
- Forum Compatibility: Only use widely-supported BBCode tags
- Markdown Separators: Use
---for horizontal rules (not[hr]) - No Alignment Tags:
[align]not supported, avoid usage
Format Specification
Supported BBCode Tags
| Tag | Usage | Example |
|---|---|---|
[size=N] |
Font size (pixels) | [size=120]Title[/size] |
[color=X] |
Text color (hex/name) | [color=#2196F3]Blue[/color] æ [color=blue] |
[b] |
Bold | [b]Bold text[/b] |
[i] |
Italic | [i]Italic[/i] |
[s] |
Strikethrough | [s]deleted[/s] |
[u] |
Underline | [u]underlined[/u] |
[quote] |
Quote block | [quote]Content[/quote] |
[code] |
Code block | [code]code[/code] |
[img] |
Image | [img]url[/img] |
[url] |
Link | [url=link]text[/url] |
[list] |
List container | [list][*]item[/list] |
[spoiler] |
Collapsible content | [spoiler=æ é¢]éèå
容[/spoiler] |
HTML to BBCode Conversion
| HTML Input | BBCode Output |
|---|---|
<mark>é«äº®</mark> |
[color=yellow]é«äº®[/color] |
<u>ä¸å线</u> |
[u]ä¸å线[/u] |
<details><summary>æ é¢</summary>å
容</details> |
[spoiler=æ é¢]å
容[/spoiler] |
Unsupported Tags (Avoid!)
| Tag | Reason | Alternative |
|---|---|---|
[align] |
Not rendered | Remove or use default left |
[hr] |
Shows as text | Use Markdown --- |
<div> |
HTML not supported | Use BBCode only |
[table] |
Limited support | Use list or code block |
Size Hierarchy (Pixels)
| Element | Size | Color | Usage |
|---|---|---|---|
| Main Title | 150 | #2196F3 | Document title |
| Section Title | 120 | #2196F3 | Major sections (## H2) |
| Subsection | 100 | #333 | Sub-sections (### H3) |
| Normal Text | (default) | – | Body content |
| Notes/Gray | 80 | gray | Footnotes, metadata |
Color Palette
| Color | Hex | Semantic Usage |
|---|---|---|
| Blue | #2196F3 | Titles, links, info |
| Green | #4CAF50 | Success, tips, features |
| Orange | #FF9800 | Warnings, caution |
| Red | #F44336 | Errors, danger, important |
| Purple | #9C27B0 | Examples, code |
| Gray | gray | Notes, metadata |
Mandatory Prerequisites
Read before execution:
| Document | Purpose | Priority |
|---|---|---|
| specs/format-rules.md | Format conversion rules | P0 |
| specs/element-mapping.md | Element type mappings | P1 |
| specs/callout-types.md | Callout/Admonition types | P1 |
Execution Flow
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
â Phase 1: Input Collection â
â - Ask: paste text OR file path â
â - Output: input-config.json â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
â Phase 2: Content Analysis â
â - Detect structure: headings, lists, code blocks, tables â
â - Identify Callouts/Admonitions (>[!type]) â
â - Output: analysis.json â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
â Phase 3: Format Transform â
â - Apply BBCode + MD rules from specs/format-rules.md â
â - Convert elements with pixel-based sizes â
â - Use Markdown --- for separators â
â - Output: formatted content â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ¤
â Phase 4: Output & Preview â
â - Save to .bbcode.txt file â
â - Display preview â
â - Output: final file â
ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
Callout/Admonition Support
æ¯æ Obsidian 飿 ¼ç Callout è¯æ³ï¼è½¬æ¢ä¸º BBCode quoteï¼
> [!NOTE]
> è¿æ¯ä¸ä¸ªæç¤ºä¿¡æ¯
> [!WARNING]
> è¿æ¯ä¸ä¸ªè¦åä¿¡æ¯
转æ¢ç»æï¼
[quote]
[size=100][color=#2196F3][b]ð æ³¨æ[/b][/color][/size]
è¿æ¯ä¸ä¸ªæç¤ºä¿¡æ¯
[/quote]
| Type | Color | Icon |
|---|---|---|
| NOTE/INFO | #2196F3 | ð |
| TIP/HINT | #4CAF50 | ð¡ |
| SUCCESS | #4CAF50 | â |
| WARNING/CAUTION | #FF9800 | â ï¸ |
| DANGER/ERROR | #F44336 | â |
| EXAMPLE | #9C27B0 | ð |
Directory Setup
const timestamp = new Date().toISOString().slice(0,10).replace(/-/g, '');
const workDir = `.workflow/.scratchpad/text-formatter-${timestamp}`;
Bash(`mkdir -p "${workDir}"`);
Output Structure
.workflow/.scratchpad/text-formatter-{date}/
âââ input-config.json # è¾å
¥é
ç½®
âââ analysis.json # å
容åæç»æ
âââ output.bbcode.txt # BBCode+MD è¾åº
Reference Documents
| Document | Purpose |
|---|---|
| phases/01-input-collection.md | æ¶éè¾å ¥å 容 |
| phases/02-content-analysis.md | åæå å®¹ç»æ |
| phases/03-format-transform.md | æ ¼å¼è½¬æ¢ |
| phases/04-output-preview.md | è¾åºåé¢è§ |
| specs/format-rules.md | æ ¼å¼è½¬æ¢è§å |
| specs/element-mapping.md | å ç´ æ å°è¡¨ |
| specs/callout-types.md | Callout ç±»åå®ä¹ |
| templates/bbcode-template.md | BBCode æ¨¡æ¿ |