luzhenqian/ai-coding-lab/invoice-generator
Claude Code and agent skill by luzhenqian/ai-coding-lab
- community
Checking that the SKILL.md file is still in the repository.
从 Excel 时间表或手动输入生成专业发票。当用户提到生成发票、创建账单、invoice、billing、开发票、时间表转发票、账单生成时使用此技能。
Install
npx vskill@latest install luzhenqian/ai-coding-lab/invoice-generatorSKILL.md
发票生成器
概述
解析 Excel/CSV 时间表数据或手动输入的账单信息,按照公司品牌模板生成专业的发票文档(Word/PDF 格式)。支持自动计算金额、税费,并确保格式统一。
使用场景
- 自由职业者按时间表生成月度发票
- 小团队给客户开具项目账单
- 从已有的 Excel 工时表快速生成发票
工作流程
执行步骤
第一步:获取输入数据
方式一:解析 Excel/CSV 文件
如果用户提供了文件,使用 scripts/parse_timesheet.py 脚本解析:
脚本会输出结构化的 JSON 数据。
方式二:手动输入
引导用户提供以下信息:
第二步:数据校验
验证以下内容:
| 检查项 | 规则 | |
|---|---|---|
| 必填字段 | 发票方名称、客户名称、至少一条明细 | |
| 数值合法性 | 数量 > 0,单价 ≥ 0,税率 0-100% | |
| 日期格式 | YYYY-MM-DD 格式 | |
| 货币一致性 | 所有金额使用同一货币单位 |
如果有问题,列出所有错误,一次性让用户修正。
第三步:金额计算
精度要求: 所有金额保留 2 位小数,使用银行家舍入法(四舍六入五成双)。
第四步:生成发票文档
使用 python-docx 生成 Word 文档,需要写一个 Python 脚本来实现。
发票模板结构:
品牌规范:
| 元素 | 规范 | |
|---|---|---|
| 主色调 | 由用户在首次使用时指定,默认 #2563EB(蓝色) | |
| 字体 | 中文用微软雅黑,英文用 Arial | |
| 标题字号 | 24pt 粗体 | |
| 正文字号 | 11pt | |
| 表头 | 主色调背景 + 白色文字 | |
| 金额 | 右对齐,千分位分隔符 | |
| Logo | 如果 assets/ 目录下有 logo 文件则使用 |
第五步:输出与确认
生成完成后,展示摘要:
发票编号规则
格式:INV-{年份}-{序号}
- 序号从 001 开始,三位数补零
- 同一年度内递增
- 如果当前目录下已有发票文件,自动读取最大序号 +1
常见问题
多币种怎么处理?
每张发票只支持一种货币。如果有多币种需求,生成多张发票。
如何自定义品牌色?
首次使用时告诉 Claude 你的品牌色(如"我们的品牌色是 #FF6B35"),后续会记住。也可以在 references/brand-config.json 中配置。
Excel 格式要求?
脚本支持以下列名(不区分大小写):
- Date / 日期
- Description / 描述 / 项目
- Hours / Quantity / 数量 / 小时
- Rate / Price / 单价
- Amount / 金额(可选,会自动计算)
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/.claude/skills/invoice-generator/SKILL.md
Popularity
- Repository stars
- 139
- Repository forks
- 20
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/luzhenqian/ai-coding-lab/invoice-generator)