reading-withholding
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese源泉徴収票 画像読み取り
Withholding Tax Slip Image Reading
源泉徴収票の画像を読み取り、構造化データとして返すスキル。
A skill that reads images of withholding tax slips and returns them as structured data.
画像読み取り方法
Image Reading Method
推奨: デュアル検証(並列2コンテキスト)
Recommended: Dual Verification (Parallel Two Contexts)
精度を高めるため、同じ画像を2つの独立したコンテキストで並列に読み取り、結果を照合する。
-
2つの独立した読み取りを実行する: サブエージェントが使える環境では、2つのサブエージェントを並列で起動し、それぞれ独立に画像を読み取る。 各サブエージェントには以下の「基本ルール」と「出力フォーマット」をプロンプトとして渡し、画像ファイルパスを指定する。
-
結果照合: 両方の読み取り結果から主要フィールド(金額等)を比較する。
-
一致の場合: そのまま採用。「2つの独立した読み取りで結果が一致しました」と報告する。
-
不一致の場合: ユーザーに元画像パスと両方の結果を提示し、正しい方を選択してもらう:
- 差異のあるフィールドを明示する
- A を採用 / B を採用 / 手動入力 の3択を提示する
To improve accuracy, read the same image in parallel using two independent contexts and cross-verify the results.
-
Execute two independent readings: In an environment where sub-agents are available, launch two sub-agents in parallel to read the image independently. Pass the following "Basic Rules" and "Output Format" as prompts to each sub-agent, and specify the image file path.
-
Result cross-verification: Compare key fields (such as amounts) from both reading results.
-
If results match: Adopt the result as-is. Report "Results matched in two independent readings."
-
If results do not match: Present the original image path and both results to the user, and ask them to select the correct one:
- Clearly indicate fields with discrepancies
- Offer three options: Adopt A / Adopt B / Manual input
フォールバック(サブエージェント非対応の場合)
Fallback (When Sub-Agents Are Not Supported)
サブエージェントが利用できない環境では、以下の手順で読み取る:
- 画像ファイルを直接 Read ツールで読み取る
- 以下の「基本ルール」と「出力フォーマット」に従ってデータを抽出する
- 抽出結果をユーザーに提示し、必ず目視確認を依頼する
⚠ デュアル検証が利用できないため、必ずユーザーに目視確認を依頼してください。
In environments where sub-agents are unavailable, follow these steps to read the image:
- Directly read the image file using the Read tool
- Extract data according to the following "Basic Rules" and "Output Format"
- Present the extraction results to the user and always request visual confirmation
⚠ Since dual verification is not available, be sure to request visual confirmation from the user.
基本ルール
Basic Rules
- 画像ファイルは Read ツールで読み取る(Claude Vision が自動的に画像を認識する)
- 金額は必ず int(円単位の整数)で返す。カンマや「円」は除去する
- 日付は YYYY-MM-DD 形式で返す
- 和暦は西暦に変換する(令和7年 → 2025、令和6年 → 2024、平成31年 → 2019)
- 読み取れないフィールドは UNKNOWN(文字列)または 0(金額)とする
- 複数ファイルを渡された場合は全て順に処理してまとめて返す
- Read image files using the Read tool (Claude Vision automatically recognizes images)
- Always return amounts as int (integer in yen). Remove commas and the "yen" character
- Return dates in YYYY-MM-DD format
- Convert Japanese calendar years to Western calendar (Reiwa 7 → 2025, Reiwa 6 → 2024, Heisei 31 → 2019)
- For unreadable fields, use UNKNOWN (string) or 0 (amount)
- If multiple files are provided, process all sequentially and return the combined results
出力フォーマット
Output Format
画像を読み取り、以下の形式で返す:
---WITHHOLDING_DATA---
payer_name: 支払者名
payment_amount: 支払金額(int)
withheld_tax: 源泉徴収税額(int)
social_insurance: 社会保険料等の金額(int)
life_insurance_deduction: 生命保険料の控除額(int)
earthquake_insurance_deduction: 地震保険料の控除額(int)
housing_loan_deduction: 住宅借入金等特別控除の額(int)
life_insurance_detail:
general_new: 一般の新保険料(int)
general_old: 一般の旧保険料(int)
medical_care: 介護医療保険料(int)
annuity_new: 個人年金の新保険料(int)
annuity_old: 個人年金の旧保険料(int)
---END---Read the image and return it in the following format:
---WITHHOLDING_DATA---
payer_name: Payer Name
payment_amount: Payment Amount (int)
withheld_tax: Withheld Tax Amount (int)
social_insurance: Social Insurance Premiums, etc. (int)
life_insurance_deduction: Life Insurance Premium Deduction (int)
earthquake_insurance_deduction: Earthquake Insurance Premium Deduction (int)
housing_loan_deduction: Special Deduction for Housing Loans, etc. (int)
life_insurance_detail:
general_new: General New Insurance Premiums (int)
general_old: General Old Insurance Premiums (int)
medical_care: Long-term Care Medical Insurance Premiums (int)
annuity_new: Personal Pension New Insurance Premiums (int)
annuity_old: Personal Pension Old Insurance Premiums (int)
---END---抽出のポイント
Extraction Points
- 「支払金額」欄(給与収入の総額)を最優先で抽出する
- 「源泉徴収税額」欄を正確に読み取る
- 「社会保険料等の金額」欄を読み取る
- 生命保険料控除は新旧制度・3区分(一般/介護医療/個人年金)の内訳を確認する
- 地震保険料控除・住宅ローン控除は記載がある場合のみ抽出する
- 支払者の名称(会社名)を抽出する
- 記載がない項目は 0 とする
- Prioritize extracting the "Payment Amount" column (total salary income)
- Accurately read the "Withheld Tax Amount" column
- Read the "Social Insurance Premiums, etc." column
- For life insurance premium deductions, check the breakdown of new/old systems and 3 categories (general/long-term care medical/personal pension)
- Extract earthquake insurance premium deductions and housing loan deductions only if they are listed
- Extract the payer's name (company name)
- Set unlisted items to 0
複数ファイルの処理
Processing Multiple Files
複数のファイルパスが指示された場合:
- Glob ツールでファイル一覧を取得する(パターンが指示された場合)
- 各ファイルを Read ツールで順に読み取る
- 全ファイルの結果をまとめて返す(各結果の前にファイル名を記載する)
undefinedWhen multiple file paths are specified:
- Use the Glob tool to retrieve the file list (if a pattern is specified)
- Read each file sequentially using the Read tool
- Return the combined results of all files (include the file name before each result)
undefinedfile1.jpg
file1.jpg
---WITHHOLDING_DATA---
...
---END---
---WITHHOLDING_DATA---
...
---END---
file2.jpg
file2.jpg
---WITHHOLDING_DATA---
...
---END---
undefined---WITHHOLDING_DATA---
...
---END---
undefined