jianshuo/claude-skills / wjs-publishing-wechat
wjs-publishing-wechat
Unverified当用户想写或发布微信公众号文章时使用——他们给出零散思路、草稿或笔记,请你润色、生成题图和解释图,或准备上传到 mp.weixin.qq.com。触发词:"写一篇微信文章"、"公众号"、"润色"、"题图"、"发公众号"、"/wjs-publishing-wechat"。
| File | Kind | Size |
|---|---|---|
| .gitignore | other | 65 B |
| .publish-manifest.json | config | 13.2 KB |
| LICENSE | other | 1.0 KB |
| README.md | markdown | 4.7 KB |
| SKILL.md | skill md | 14.2 KB |
| STYLE.md | markdown | 10.8 KB |
| prompts/cover-prompt.md | markdown | 20.6 KB |
| prompts/illustration-prompt.md | markdown | 2.8 KB |
| scripts/backfill-permalinks.pyexecutable | script | 9.3 KB |
| scripts/build-recent-articles.pyexecutable | script | 5.5 KB |
| scripts/fetch-comments-by-cookie.shexecutable | script | 12.2 KB |
| scripts/fetch-comments-via-gstack.shexecutable | script | 10.8 KB |
| scripts/fetch-comments.shexecutable | script | 5.4 KB |
| scripts/gen-cover-ai.shexecutable | script | 3.8 KB |
| scripts/gen-illustration.shexecutable | script | 3.0 KB |
| scripts/mass-send.shexecutable | script | 7.2 KB |
| scripts/open-draft-edit.shexecutable | script | 5.3 KB |
| scripts/pangu.py | script | 2.9 KB |
| scripts/update-draft-via-api.pyexecutable | script | 3.9 KB |
| scripts/upload-draft.shexecutable | script | 19.4 KB |
scripts/pangu.py
View on GitHub#!/usr/bin/env python3
"""盘古之白 — 在中文(汉字)和英文之间补一个空格。
规则:
- 只在「汉字 ↔ 含字母的英文块」边界补空格(AI、Claude Code、GPT-4、skill.md…)。
- 纯数字块(如「13万」)不补,因为用户要的是「英文」前后留白,不是数字。
- 幂等:已经有空格 / 已经隔着标点的,不会重复补。
- 不碰这些区域:fenced code(``` 块)、inline code(`...`)、
markdown 链接/图片的 URL 部分 `](...)`、裸 http(s) URL。
- 汉字旁的全角标点(,。!?「」)不补空格——因为只在汉字↔英文块触发,
全角标点不是汉字也不是英文块,天然跳过。
用法:
pangu.py <file.md> [file2.md ...] # 就地改写(幂等)
pangu.py - # 从 stdin 读、写 stdout
echo "用AI写skill" | pangu.py - # → 用 AI 写 skill
"""
import re, sys
HAN = r'一-鿿㐀-䶿'
# 一个「英文/代码块」:字母数字,允许内部连接符 . - + # / _
CHUNK = r'[A-Za-z0-9]+(?:[.\-+#/_][A-Za-z0-9]+)*'
HAS_LETTER = re.compile(r'[A-Za-z]')
_han_then_chunk = re.compile(r'([' + HAN + r'])(' + CHUNK + r')')
_chunk_then_han = re.compile(r'(' + CHUNK + r')([' + HAN + r'])')
def _space_line(line: str) -> str:
line = _han_then_chunk.sub(
lambda m: m.group(1) + (' ' + m.group(2) if HAS_LETTER.search(m.group(2)) else m.group(2)),
line)
line = _chunk_then_han.sub(
lambda m: (m.group(1) + ' ' if HAS_LETTER.search(m.group(1)) else m.group(1)) + m.group(2),
line)
return line
def _protect(line: str):
store = []
def keep(m):
store.append(m.group(0))
return f'\x00{len(store) - 1}\x00'
line = re.sub(r'`[^`]*`', keep, line) # inline code
line = re.sub(r'\]\([^)]*\)', keep, line) # ](url) of links/images
line = re.sub(r'https?://\S+', keep, line) # bare urls
return line, store
def _restore(line: str, store) -> str:
return re.sub(r'\x00(\d+)\x00', lambda m: store[int(m.group(1))], line)
def pangu(text: str) -> str:
out, in_fence = [], False
for line in text.split('\n'):
if line.lstrip().startswith('```'):
in_fence = not in_fence
out.append(line)
continue
if in_fence:
out.append(line)
continue
protected, store = _protect(line)
out.append(_restore(_space_line(protected), store))
return '\n'.join(out)
def main():
args = sys.argv[1:]
if not args:
sys.exit(__doc__)
if args == ['-']:
sys.stdout.write(pangu(sys.stdin.read()))
return
for path in args:
with open(path, encoding='utf-8') as f:
src = f.read()
new = pangu(src)
if new != src:
with open(path, 'w', encoding='utf-8') as f:
f.write(new)
print(f'pangu: {path} (changed)')
else:
print(f'pangu: {path} (no change)')
if __name__ == '__main__':
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |