Files
lyxy-document/README.md
lanyuanxiaoyao c35bbc90b5 docs: 优化 skill 文档并添加更新原则
优化 skill/SKILL.md 遵循 Claude Skill 构建指南:
- 重写 YAML frontmatter,添加触发词和 compatibility 字段
- 新增 Purpose、When to Use、Quick Reference、Workflow 章节
- 说明双路径执行策略(lyxy-runner-python 优先,回退主机 Python)
- 修正依赖说明,使用具体 pip 包名

在 README.md 中添加 Skill 文档规范章节,明确更新原则
新增 openspec/specs/skill-documentation/ 规范文件
2026-03-08 18:43:07 +08:00

97 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# lyxy-document
统一文档解析工具 - 将 DOCX、XLSX、PPTX、PDF、HTML/URL 转换为 Markdown
## 开发环境
- 使用 uv 管理依赖,禁用主机 Python
- 依赖声明pyproject.toml
- 安装uv sync
## 项目结构
```
scripts/ # 核心代码
├── core/ # 核心模块解析调度、异常、Markdown 工具)
├── readers/ # 格式阅读器
└── utils/ # 工具函数
tests/ # 测试
openspec/ # 规范文档
skill/ # SKILL 文档
```
## 开发工作流
```bash
# 运行测试
uv run pytest
# 代码格式化
uv run black .
uv run isort .
# 类型检查
uv run mypy .
```
## 代码规范
- 语言:仅中文(交流、注释、文档、代码)
- 模块文件150-300 行
- 错误处理:自定义异常 + 清晰信息 + 位置上下文
- Git 提交:类型: 简短描述feat/fix/refactor/docs/style/test/chore
## Skill 文档规范
skill/SKILL.md 面向 AI 用户,必须遵循 Claude Skill 构建指南的最佳实践:
### YAML frontmatter
- **name**: kebab-case 格式
- **description**: 包含功能说明、触发词、文件类型、典型任务
- **license**: MIT
- **metadata**: 包含 version、author
- **compatibility**: 说明 Python 版本要求和依赖情况
### 文档章节结构
1. **Purpose**: 说明统一入口和双路径执行策略
2. **When to Use**: 典型场景和触发词列表(中英文、文件扩展名)
3. **Quick Reference**: 命令参数表格
4. **Workflow**: 4 步工作流程(检测环境、识别类型、执行解析、输出结果)
5. **使用示例**: 各文档类型的基本用法和高级用法
6. **错误处理**: 常见错误及解决方案
7. **References**: 指向项目文档的链接
### 双路径执行策略
- **优先**: 使用 lyxy-runner-python skill自动管理依赖
- **回退**: 主机 Python 环境(需手动安装依赖)
### 依赖说明
- 必须使用具体的 pip 包名
- 不能使用 lyxy-document[xxx] 形式(发布时没有 pyproject.toml
- 按文档类型分组说明
## 解析器架构
### DOCX
docling、unstructured、pypandoc-binary、MarkItDown、python-docx、XML
### XLSX
docling、unstructured、MarkItDown、pandas、XML
### PPTX
docling、unstructured、MarkItDown、python-pptx、XML
### PDFOCR 优先)
docling OCR、unstructured OCR、docling、unstructured、MarkItDown、pypdf
### HTML/URL
trafilatura、domscribe、MarkItDown、html2text
## 许可证
MIT License