taiwan-invoice-skill 2.6.4 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +49 -86
  2. package/assets/taiwan-invoice/CLAUDE.md +108 -108
  3. package/assets/taiwan-invoice/EXAMPLES.md +706 -633
  4. package/assets/taiwan-invoice/README.md +429 -426
  5. package/assets/taiwan-invoice/SKILL.md +513 -485
  6. package/assets/taiwan-invoice/data/error-codes.csv +22 -0
  7. package/assets/taiwan-invoice/data/field-mappings.csv +27 -27
  8. package/assets/taiwan-invoice/data/operations.csv +12 -11
  9. package/assets/taiwan-invoice/data/providers.csv +2 -0
  10. package/assets/taiwan-invoice/examples/ezpay-invoice-example.py +409 -0
  11. package/assets/taiwan-invoice/examples/paynow-invoice-example.py +330 -0
  12. package/assets/taiwan-invoice/references/AMEGO_API_REFERENCE.md +1115 -1115
  13. package/assets/taiwan-invoice/references/ECPAY_API_REFERENCE.md +647 -647
  14. package/assets/taiwan-invoice/references/EZPAY_API_REFERENCE.md +1084 -0
  15. package/assets/taiwan-invoice/references/PAYNOW_API_REFERENCE.md +645 -0
  16. package/assets/taiwan-invoice/references/SMILEPAY_API_REFERENCE.md +492 -492
  17. package/assets/templates/base/quick-reference.md +85 -85
  18. package/assets/templates/base/skill-content.md +508 -361
  19. package/assets/templates/platforms/agent.json +26 -26
  20. package/assets/templates/platforms/claude.json +26 -26
  21. package/assets/templates/platforms/codebuddy.json +25 -25
  22. package/assets/templates/platforms/codex.json +26 -26
  23. package/assets/templates/platforms/continue.json +25 -25
  24. package/assets/templates/platforms/copilot.json +25 -25
  25. package/assets/templates/platforms/cursor.json +26 -26
  26. package/assets/templates/platforms/gemini.json +25 -25
  27. package/assets/templates/platforms/kiro.json +25 -25
  28. package/assets/templates/platforms/opencode.json +25 -25
  29. package/assets/templates/platforms/qoder.json +25 -25
  30. package/assets/templates/platforms/roocode.json +25 -25
  31. package/assets/templates/platforms/trae.json +25 -25
  32. package/assets/templates/platforms/windsurf.json +25 -25
  33. package/package.json +59 -59
  34. package/assets/taiwan-invoice/scripts/__pycache__/core.cpython-312.pyc +0 -0
  35. package/assets/taiwan-invoice/scripts/__pycache__/generate-invoice-service.cpython-312.pyc +0 -0
  36. package/assets/taiwan-invoice/scripts/__pycache__/persist.cpython-312.pyc +0 -0
  37. package/assets/taiwan-invoice/scripts/__pycache__/recommend.cpython-312.pyc +0 -0
  38. package/assets/taiwan-invoice/scripts/__pycache__/search.cpython-312.pyc +0 -0
  39. package/assets/taiwan-invoice/scripts/__pycache__/test-invoice-amounts.cpython-312.pyc +0 -0
package/README.md CHANGED
@@ -3,14 +3,14 @@
3
3
  <h3 align="center">台灣電子發票 AI 開發技能包</h3>
4
4
 
5
5
  <p align="center">
6
- <strong>支援 ECPay 綠界 · SmilePay 速買配 · Amego 光貿</strong>
6
+ <strong>支援 ECPay 綠界 · SmilePay 速買配 · Amego 光貿 · ezPay 簡單付 · PayNow 立吉富</strong>
7
7
  </p>
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/taiwan-invoice-skill"><img src="https://img.shields.io/npm/v/taiwan-invoice-skill?style=flat-square&logo=npm" alt="npm version"></a>
11
11
  <a href="https://www.npmjs.com/package/taiwan-invoice-skill"><img src="https://img.shields.io/npm/dm/taiwan-invoice-skill?style=flat-square&label=downloads" alt="npm downloads"></a>
12
- <img src="https://img.shields.io/badge/node-%3E%3D18-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node.js">
13
- <img src="https://img.shields.io/badge/platforms-14-blue?style=flat-square" alt="14 Platforms">
12
+ <img src="https://img.shields.io/badge/providers-5-success?style=flat-square" alt="5 Providers">
13
+ <img src="https://img.shields.io/badge/AI%20platforms-14-blue?style=flat-square" alt="14 AI Platforms">
14
14
  <a href="https://github.com/Moksa1123/taiwan-ecommerce-toolkit/blob/main/LICENSE"><img src="https://img.shields.io/github/license/Moksa1123/taiwan-ecommerce-toolkit?style=flat-square" alt="License"></a>
15
15
  </p>
16
16
 
@@ -26,117 +26,80 @@
26
26
  npm install -g taiwan-invoice-skill
27
27
  ```
28
28
 
29
- ---
30
-
31
- ## 使用方式
29
+ ## 快速開始
32
30
 
33
31
  ```bash
34
- # 進入專案目錄
35
32
  cd /path/to/your/project
36
33
 
37
- # 選擇你的 AI 助手
34
+ taiwan-invoice init # 互動式選擇 AI 助手
38
35
  taiwan-invoice init --ai claude # Claude Code
39
36
  taiwan-invoice init --ai cursor # Cursor
40
37
  taiwan-invoice init --ai windsurf # Windsurf
41
- taiwan-invoice init --ai copilot # GitHub Copilot
42
- taiwan-invoice init --ai antigravity # Antigravity
43
38
  taiwan-invoice init --ai all # 全部安裝
44
39
  ```
45
40
 
46
- <details>
47
- <summary>完整平台列表</summary>
41
+ 安裝完後,直接在 AI 助手用自然語言:
48
42
 
49
- ```bash
50
- taiwan-invoice init --ai kiro # Kiro (AWS)
51
- taiwan-invoice init --ai codex # Codex CLI (OpenAI)
52
- taiwan-invoice init --ai qoder # Qoder
53
- taiwan-invoice init --ai roocode # Roo Code
54
- taiwan-invoice init --ai gemini # Gemini CLI
55
- taiwan-invoice init --ai trae # Trae (ByteDance)
56
- taiwan-invoice init --ai opencode # OpenCode
57
- taiwan-invoice init --ai continue # Continue
58
- taiwan-invoice init --ai codebuddy # CodeBuddy (Tencent)
59
43
  ```
60
-
61
- </details>
44
+ 使用 ECPay 測試環境開立 B2C 發票,金額 1050 元
45
+ 建立 ezPay B2B 發票,買方統編 12345678,未稅 1000、稅 50
46
+ 為 PayNow POS 機批次取 100 個發票號碼
47
+ ```
62
48
 
63
49
  ---
64
50
 
65
- ## 其他指令
51
+ ## 5 家發票服務商
66
52
 
67
- ```bash
68
- taiwan-invoice list # 列出支援平台
69
- taiwan-invoice info # 顯示技能資訊
70
- taiwan-invoice versions # 列出可用版本
71
- taiwan-invoice update # 檢查更新
72
- ```
53
+ | 服務商 | 加密 / 認證 | 適用場景 |
54
+ |---|---|---|
55
+ | **ECPay 綠界** | AES-128-CBC + HashKey/HashIV | 市佔率最高、SDK 完整、傳統電商首選 |
56
+ | **SmilePay 速買配** | Grvc + Verify_key | 老牌穩定、整合最簡單、無 AES 門檻 |
57
+ | **Amego 光貿** | MD5 簽章 + App Key | MIG 4.0 標準、現代 RESTful |
58
+ | **ezPay 簡單付** | AES-256-CBC + 32 碼 HashKey + SHA256 | 藍新金流集團小型品牌、字軌管理、批次開立 |
59
+ | **PayNow 立吉富** | JWT Bearer Token | 金物流發票一站式、POS 機批次取號流程 |
73
60
 
74
- ### 選項
61
+ 每家附完整 Python 範例(B2C / B2B / 作廢 / 折讓)+ 反推的加密實作 + 測試帳號。
75
62
 
76
- ```bash
77
- taiwan-invoice init --force # 覆蓋現有檔案
78
- taiwan-invoice init --global # 安裝到全域目錄(所有專案共用)
79
- ```
63
+ ## 技能包內容
80
64
 
81
- ### 全域安裝
65
+ ```
66
+ taiwan-invoice/
67
+ ├── SKILL.md # AI 技能主文檔
68
+ ├── EXAMPLES.md # 完整範例集
69
+ ├── references/ # 5 份 API 規格
70
+ │ ├── ECPAY_API_REFERENCE.md
71
+ │ ├── SMILEPAY_API_REFERENCE.md
72
+ │ ├── AMEGO_API_REFERENCE.md
73
+ │ ├── EZPAY_API_REFERENCE.md # ezPay 5 本 PDF 蒸餾 1,084 行
74
+ │ └── PAYNOW_API_REFERENCE.md # PayNow JWT + POS 流程
75
+ ├── examples/ # 5 個生產級 Python 範例
76
+ └── data/ # 7 份 CSV 資料
77
+ ├── providers.csv # 5 服務商
78
+ ├── operations.csv # 11 個 API 操作
79
+ ├── error-codes.csv # 80+ 錯誤碼
80
+ └── ...
81
+ ```
82
82
 
83
- 使用 `--global` 可將技能安裝到使用者目錄,讓所有專案都能使用:
83
+ ## CLI 指令
84
84
 
85
85
  ```bash
86
- taiwan-invoice init --ai cursor --global # ~/.cursor/skills/taiwan-invoice/
87
- taiwan-invoice init --ai claude --global # ~/.claude/skills/taiwan-invoice/
88
- taiwan-invoice init --ai antigravity --global # ~/.gemini/antigravity/global_skills/taiwan-invoice/
86
+ taiwan-invoice list # 列出 AI 平台
87
+ taiwan-invoice info # 技能資訊
88
+ taiwan-invoice update # 檢查更新
89
+ taiwan-invoice init --force # 覆蓋安裝
90
+ taiwan-invoice init --global # 全域安裝
89
91
  ```
90
92
 
91
- ---
92
-
93
- ## 支援平台
94
-
95
- | 平台 | 說明 | 啟動方式 |
96
- |------|------|----------|
97
- | **Claude Code** | Anthropic 官方 CLI | `/taiwan-invoice` |
98
- | **Cursor** | AI 程式編輯器 | `/taiwan-invoice` |
99
- | **Windsurf** | Codeium 編輯器 | 自動 |
100
- | **Copilot** | GitHub Copilot | `/taiwan-invoice` |
101
- | **Antigravity** | Google AI 助手 | `/taiwan-invoice` |
102
- | **Kiro** | AWS AI 助手 | `/taiwan-invoice` |
103
- | **Codex** | OpenAI CLI | 自動 |
104
- | **Qoder** | Qodo AI 助手 | 自動 |
105
- | **RooCode** | VSCode 擴充 | `/taiwan-invoice` |
106
- | **Gemini CLI** | Google Gemini | 自動 |
107
- | **Trae** | ByteDance AI | 自動 |
108
- | **OpenCode** | 開源 AI 助手 | 自動 |
109
- | **Continue** | 開源 AI 助手 | 自動 |
110
- | **CodeBuddy** | Tencent AI | 自動 |
111
-
112
- ---
113
-
114
- ## 加值中心
115
-
116
- | 加值中心 | 驗證方式 | 特點 |
117
- |----------|----------|------|
118
- | **ECPay 綠界** | AES-128-CBC 加密 | 市佔率高,文件完整 |
119
- | **SmilePay 速買配** | URL 參數簽章 | 雙協定支援,整合簡單 |
120
- | **Amego 光貿** | MD5 簽章 (MIG 4.0) | API 設計乾淨 |
121
-
122
- ---
123
-
124
- ## 智能工具
125
-
126
- 安裝後包含以下 Python 工具(純 Python,無需外部依賴):
93
+ ## 14 個 AI 平台支援
127
94
 
128
- ```bash
129
- # BM25 搜索引擎 - 搜索錯誤碼、欄位映射、稅務規則
130
- python scripts/search.py "10000016" --domain error
95
+ Claude Code · Cursor · Windsurf · Antigravity · GitHub Copilot · Kiro · Codex · Qoder · Roo Code · Gemini · Trae · OpenCode · Continue · CodeBuddy
131
96
 
132
- # 加值中心推薦系統 - 根據需求推薦服務商
133
- python scripts/recommend.py "電商 高交易量 穩定"
97
+ ## 相關套件
134
98
 
135
- # 代碼生成器 - 生成 TypeScript/Python 服務模組
136
- python scripts/generate-invoice-service.py ECPay --output ts
137
- ```
99
+ 本套件是 **[Taiwan E-Commerce Toolkit](https://github.com/Moksa1123/taiwan-ecommerce-toolkit)** 的一部分:
138
100
 
139
- ---
101
+ - [taiwan-payment-skill](https://www.npmjs.com/package/taiwan-payment-skill) — 10 家金流(ECPay / NewebPay / PAYUNi / SmilePay / PChomePay / ezPay / PayNow / Shopline / LINE Pay / TapPay)
102
+ - [taiwan-logistics-skill](https://www.npmjs.com/package/taiwan-logistics-skill) — 7 家物流(含 HCT 新竹物流直連)
140
103
 
141
104
  ## 授權
142
105
 
@@ -1,108 +1,108 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Project Overview
6
-
7
- Taiwan Invoice Skill is an AI-powered toolkit for Taiwan E-Invoice integration, providing API documentation, code examples, and scripts for major invoice platforms (ECPay, SmilePay, Amego). It works as a skill/workflow for AI coding assistants (Claude Code, Windsurf, Cursor, etc.).
8
-
9
- ## Available Scripts
10
-
11
- ```bash
12
- # Test API connectivity
13
- python3 taiwan-invoice/scripts/test_connection.py <platform>
14
-
15
- # Validate invoice data
16
- python3 taiwan-invoice/scripts/validate_invoice.py <json_file>
17
-
18
- # Generate invoice code
19
- python3 taiwan-invoice/scripts/generate_code.py <platform> <language>
20
- ```
21
-
22
- **Supported Platforms:** `ecpay`, `smilepay`, `amego`
23
-
24
- ## Architecture
25
-
26
- ```
27
- taiwan-invoice/ # Source of Truth
28
- ├── SKILL.md # Main skill documentation
29
- ├── EXAMPLES.md # Code examples and patterns
30
- ├── references/ # API documentation
31
- │ ├── ecpay-api.md
32
- │ ├── smilepay-api.md
33
- │ └── amego-api.md
34
- └── scripts/ # Utility scripts
35
- ├── test_connection.py
36
- ├── validate_invoice.py
37
- └── generate_code.py
38
-
39
- cli/ # CLI installer (taiwan-invoice-skill on npm)
40
- ├── src/
41
- │ ├── commands/init.ts # Install command with template generation
42
- │ ├── utils/template.ts # Template rendering engine
43
- │ ├── utils/github.ts # GitHub release downloads
44
- │ └── utils/extract.ts # ZIP extraction utilities
45
- └── assets/ # Bundled assets
46
- ├── taiwan-invoice/ # Copy of taiwan-invoice/
47
- └── templates/
48
- ├── base/ # Base templates (skill-content.md)
49
- └── platforms/ # Platform configs (14 platforms)
50
-
51
- .claude/skills/taiwan-invoice/ # Claude Code skill (generated by CLI)
52
- ```
53
-
54
- ## Sync Rules
55
-
56
- **Source of Truth:** `taiwan-invoice/`
57
-
58
- When modifying files:
59
-
60
- 1. **Skill Content** - Edit in `taiwan-invoice/`:
61
- - `SKILL.md` - Main documentation
62
- - `EXAMPLES.md` - Code examples
63
- - `references/*.md` - API documentation
64
- - `scripts/*.py` - Utility scripts
65
-
66
- 2. **Templates** - Edit in `cli/assets/templates/`:
67
- - `base/skill-content.md` - Common skill content
68
- - `platforms/*.json` - Platform-specific configs (14 platforms)
69
-
70
- 3. **CLI Assets** - Run sync before publishing:
71
- ```bash
72
- cp -r taiwan-invoice/* cli/assets/taiwan-invoice/
73
- ```
74
-
75
- 4. **Reference Folders** - No manual sync needed. The CLI generates these from templates during `taiwan-invoice init`.
76
-
77
- ## Supported AI Platforms
78
-
79
- | Platform | Folder | Install Type |
80
- |-------------|-------------|--------------|
81
- | Claude Code | `.claude` | full |
82
- | Cursor | `.cursor` | full |
83
- | Windsurf | `.windsurf` | full |
84
- | Antigravity | `.agent` | full |
85
- | Copilot | `.github` | full |
86
- | Kiro | `.kiro` | full |
87
- | Codex | `.codex` | full |
88
- | Qoder | `.qoder` | full |
89
- | Roo Code | `.roo` | full |
90
- | Gemini | `.gemini` | full |
91
- | Trae | `.trae` | full |
92
- | OpenCode | `.opencode` | full |
93
- | Continue | `.continue` | full |
94
- | CodeBuddy | `.codebuddy`| full |
95
-
96
- ## Prerequisites
97
-
98
- - Node.js 18+ (for CLI)
99
- - Python 3.x (for scripts, no external dependencies)
100
-
101
- ## Git Workflow
102
-
103
- Never push directly to `main`. Always:
104
-
105
- 1. Create a new branch: `git checkout -b feat/...` or `fix/...`
106
- 2. Commit changes
107
- 3. Push branch: `git push -u origin <branch>`
108
- 4. Create PR: `gh pr create`
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ Taiwan Invoice Skill is an AI-powered toolkit for Taiwan E-Invoice integration, providing API documentation, code examples, and scripts for major invoice platforms (ECPay, SmilePay, Amego). It works as a skill/workflow for AI coding assistants (Claude Code, Windsurf, Cursor, etc.).
8
+
9
+ ## Available Scripts
10
+
11
+ ```bash
12
+ # Test API connectivity
13
+ python3 taiwan-invoice/scripts/test_connection.py <platform>
14
+
15
+ # Validate invoice data
16
+ python3 taiwan-invoice/scripts/validate_invoice.py <json_file>
17
+
18
+ # Generate invoice code
19
+ python3 taiwan-invoice/scripts/generate_code.py <platform> <language>
20
+ ```
21
+
22
+ **Supported Platforms:** `ecpay`, `smilepay`, `amego`
23
+
24
+ ## Architecture
25
+
26
+ ```
27
+ taiwan-invoice/ # Source of Truth
28
+ ├── SKILL.md # Main skill documentation
29
+ ├── EXAMPLES.md # Code examples and patterns
30
+ ├── references/ # API documentation
31
+ │ ├── ecpay-api.md
32
+ │ ├── smilepay-api.md
33
+ │ └── amego-api.md
34
+ └── scripts/ # Utility scripts
35
+ ├── test_connection.py
36
+ ├── validate_invoice.py
37
+ └── generate_code.py
38
+
39
+ cli/ # CLI installer (taiwan-invoice-skill on npm)
40
+ ├── src/
41
+ │ ├── commands/init.ts # Install command with template generation
42
+ │ ├── utils/template.ts # Template rendering engine
43
+ │ ├── utils/github.ts # GitHub release downloads
44
+ │ └── utils/extract.ts # ZIP extraction utilities
45
+ └── assets/ # Bundled assets
46
+ ├── taiwan-invoice/ # Copy of taiwan-invoice/
47
+ └── templates/
48
+ ├── base/ # Base templates (skill-content.md)
49
+ └── platforms/ # Platform configs (14 platforms)
50
+
51
+ .claude/skills/taiwan-invoice/ # Claude Code skill (generated by CLI)
52
+ ```
53
+
54
+ ## Sync Rules
55
+
56
+ **Source of Truth:** `taiwan-invoice/`
57
+
58
+ When modifying files:
59
+
60
+ 1. **Skill Content** - Edit in `taiwan-invoice/`:
61
+ - `SKILL.md` - Main documentation
62
+ - `EXAMPLES.md` - Code examples
63
+ - `references/*.md` - API documentation
64
+ - `scripts/*.py` - Utility scripts
65
+
66
+ 2. **Templates** - Edit in `cli/assets/templates/`:
67
+ - `base/skill-content.md` - Common skill content
68
+ - `platforms/*.json` - Platform-specific configs (14 platforms)
69
+
70
+ 3. **CLI Assets** - Run sync before publishing:
71
+ ```bash
72
+ cp -r taiwan-invoice/* cli/assets/taiwan-invoice/
73
+ ```
74
+
75
+ 4. **Reference Folders** - No manual sync needed. The CLI generates these from templates during `taiwan-invoice init`.
76
+
77
+ ## Supported AI Platforms
78
+
79
+ | Platform | Folder | Install Type |
80
+ |-------------|-------------|--------------|
81
+ | Claude Code | `.claude` | full |
82
+ | Cursor | `.cursor` | full |
83
+ | Windsurf | `.windsurf` | full |
84
+ | Antigravity | `.agent` | full |
85
+ | Copilot | `.github` | full |
86
+ | Kiro | `.kiro` | full |
87
+ | Codex | `.codex` | full |
88
+ | Qoder | `.qoder` | full |
89
+ | Roo Code | `.roo` | full |
90
+ | Gemini | `.gemini` | full |
91
+ | Trae | `.trae` | full |
92
+ | OpenCode | `.opencode` | full |
93
+ | Continue | `.continue` | full |
94
+ | CodeBuddy | `.codebuddy`| full |
95
+
96
+ ## Prerequisites
97
+
98
+ - Node.js 18+ (for CLI)
99
+ - Python 3.x (for scripts, no external dependencies)
100
+
101
+ ## Git Workflow
102
+
103
+ Never push directly to `main`. Always:
104
+
105
+ 1. Create a new branch: `git checkout -b feat/...` or `fix/...`
106
+ 2. Commit changes
107
+ 3. Push branch: `git push -u origin <branch>`
108
+ 4. Create PR: `gh pr create`