optimize skill: private-by-default, sketch theme, references docs

- publish_xhs.py: 默认改为仅自己可见(is_private=True),--private 改为 --public 标志
- render_xhs.py: 默认主题从 default 改为 sketch
- SKILL.md: 重构为精简规范格式,引用 references/params.md
- references/params.md: 新增完整参数参考文档(渲染/发布/Markdown格式)
- README.md: 顶部添加一句话 Agent 安装指引,更新项目结构说明

Made-with: Cursor
This commit is contained in:
ZhangJia
2026-03-09 12:28:51 +08:00
parent 9c4419bbe1
commit 88b9c019a7
5 changed files with 240 additions and 169 deletions

View File

@@ -155,7 +155,7 @@ class LocalPublisher:
return None
def publish(self, title: str, desc: str, images: List[str],
is_private: bool = False, post_time: str = None) -> Dict[str, Any]:
is_private: bool = True, post_time: str = None) -> Dict[str, Any]:
"""发布图文笔记"""
print(f"\n🚀 准备发布笔记(本地模式)...")
print(f" 📌 标题: {title}")
@@ -268,7 +268,7 @@ class ApiPublisher:
return None
def publish(self, title: str, desc: str, images: List[str],
is_private: bool = False, post_time: str = None) -> Dict[str, Any]:
is_private: bool = True, post_time: str = None) -> Dict[str, Any]:
"""发布图文笔记"""
print(f"\n🚀 准备发布笔记API 模式)...")
print(f" 📌 标题: {title}")
@@ -317,15 +317,15 @@ def main():
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog='''
示例:
# 基本用法
# 基本用法(默认仅自己可见)
python publish_xhs.py -t "我的标题" -d "正文内容" -i cover.png card_1.png card_2.png
# 公开发布
python publish_xhs.py -t "我的标题" -d "正文内容" -i *.png --public
# 使用 API 模式
python publish_xhs.py -t "我的标题" -d "正文内容" -i *.png --api-mode
# 设为私密笔记
python publish_xhs.py -t "我的标题" -d "正文内容" -i *.png --private
# 定时发布
python publish_xhs.py -t "我的标题" -d "正文内容" -i *.png --post-time "2024-12-01 10:00:00"
'''
@@ -347,9 +347,9 @@ def main():
help='图片文件路径(可以多个)'
)
parser.add_argument(
'--private',
'--public',
action='store_true',
help='是否设为私密笔记'
help='公开发布(默认为仅自己可见)'
)
parser.add_argument(
'--post-time',
@@ -393,7 +393,7 @@ def main():
print(f" 📌 标题: {args.title}")
print(f" 📝 描述: {args.desc}")
print(f" 🖼️ 图片: {valid_images}")
print(f" 🔒 私密: {args.private}")
print(f" 🔒 私密: {not args.public}")
print(f" ⏰ 定时: {args.post_time or '立即发布'}")
print(f" 📡 模式: {'API' if args.api_mode else '本地'}")
print("\n✅ 验证通过,可以发布")
@@ -414,7 +414,7 @@ def main():
title=args.title,
desc=args.desc,
images=valid_images,
is_private=args.private,
is_private=not args.public,
post_time=args.post_time
)
except Exception as e:

View File

@@ -669,8 +669,8 @@ def main():
parser.add_argument(
'--theme', '-t',
choices=AVAILABLE_THEMES,
default='default',
help='排版主题(默认: default'
default='sketch',
help='排版主题(默认: sketch'
)
parser.add_argument(
'--mode', '-m',