income-tax
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese所得税計算(Income Tax Calculation)
Income Tax Calculation
事業所得・各種控除から所得税額を計算するスキル。
settlement スキルで決算書の作成が完了していることを前提とする。
計算結果は スキル(Claude in Chrome)で確定申告書等作成コーナーに入力する。
/e-taxA skill for calculating income tax from business income and various deductions.
This skill assumes that the settlement skill has already completed the preparation of financial statements.
The calculation results are entered into the Final Tax Return Preparation Corner using the skill (Claude in Chrome).
/e-tax設定の読み込み(最初に実行)
Load Settings (Run First)
- を Read ツールで読み込む
shinkoku.config.yaml - ファイルが存在しない場合は スキルの実行を案内して終了する
/setup - 設定値を把握し、相対パスは CWD を基準に絶対パスに変換する:
- : CLI スクリプトの
db_path引数に使用--db-path - : 進捗ファイル等の出力先ベースディレクトリ
output_dir - 各ディレクトリ: ファイル参照時に使用
- Load using the Read tool
shinkoku.config.yaml - If the file does not exist, guide the user to run the skill and exit
/setup - Understand the configuration values, and convert relative paths to absolute paths based on the CWD:
- : Used for the
db_pathargument of CLI scripts--db-path - : Base directory for outputting progress files, etc.
output_dir - Each directory: Used when referencing files
パス解決の例
Example of Path Resolution
config の が で CWD が の場合:
db_path./shinkoku.db/home/user/tax-2025/shinkoku tax calc-income --input /home/user/tax-2025/output/income_input.json
If in the config is and the CWD is :
db_path./shinkoku.db/home/user/tax-2025/shinkoku tax calc-income --input /home/user/tax-2025/output/income_input.json
進捗情報の読み込み
Load Progress Information
設定の読み込み後、引継書ファイルを読み込んで前ステップの結果を把握する。
- を Read ツールで読み込む(存在する場合)
.shinkoku/progress/progress-summary.md - 以下の引継書を Read ツールで読み込む(存在する場合):
.shinkoku/progress/06-settlement.md.shinkoku/progress/02-assess.md.shinkoku/progress/05-furusato.md
- 読み込んだ情報を以降のステップで活用する(ユーザーへの再質問を避ける)
- ファイルが存在しない場合はスキップし、ユーザーに必要情報を直接確認する
After loading the settings, load the handover files to understand the results of the previous steps.
- Load using the Read tool (if it exists)
.shinkoku/progress/progress-summary.md - Load the following handover files using the Read tool (if they exist):
.shinkoku/progress/06-settlement.md.shinkoku/progress/02-assess.md.shinkoku/progress/05-furusato.md
- Utilize the loaded information in subsequent steps (avoid re-asking the user)
- If the files do not exist, skip this step and directly confirm the necessary information with the user
基本方針
Basic Guidelines
- settlement スキルで青色申告決算書が完成しているか確認してから開始する
- 所得の計算 → 控除の計算 → 税額の計算 の順序で進める
- 各ステップの計算結果をユーザーに提示し、確認を得る
- references/form-b-fields.md の各欄に正しく値を設定する
- 端数処理ルールを厳守する:
- 課税所得: 1,000円未満切捨て(国税通則法118条)
- 復興特別所得税: 1円未満切捨て(復興財源確保法13条)
- ㊺ 所得税及び復興特別所得税の額: 端数処理なし
- 申告納税額(納付の場合のみ): 100円未満切捨て(国税通則法119条)
- 還付金: 1円単位・切捨てなし(国税通則法120条)
- Start only after confirming that the blue tax return financial statements have been completed with the settlement skill
- Proceed in the order of income calculation → deduction calculation → tax amount calculation
- Present the calculation results of each step to the user and obtain confirmation
- Correctly set values in each field of references/form-b-fields.md
- Strictly adhere to rounding rules:
- Taxable income: Round down amounts less than 1,000 yen (National Tax Act Article 118)
- Reconstruction Special Income Tax: Round down amounts less than 1 yen (Reconstruction Resource Securement Act Article 13)
- ㊺ Amount of Income Tax and Reconstruction Special Income Tax: No rounding
- Declared tax amount (only for payment cases): Round down amounts less than 100 yen (National Tax Act Article 119)
- Refund amount: In 1-yen units, no rounding down (National Tax Act Article 120)
前提条件の確認
Precondition Confirmation
所得税計算を開始する前に以下を確認する:
- 青色申告決算書が完成しているか: settlement スキルの出力を確認する
- 納税者プロファイルの読み込み: で config から納税者情報を取得する
skills/setup/scripts/profile.py get-taxpayer- 氏名・住所・税務署名 → 確定申告書等作成コーナーへの入力に使用
- 寡婦/ひとり親・障害者・勤労学生の状態 → 人的控除の計算に使用
- 事業所得以外の所得: 給与所得・雑所得・配当所得・一時所得等がある場合は情報を収集する
- 源泉徴収票: 給与所得がある場合は取り込みを案内する
- 各種控除の適用状況: 適用可能な控除を網羅的に確認する
- 予定納税額: assess で確認済みの予定納税額を取得する
- 未確認の場合は、前年の確定申告書(㊺欄)から判定する
- 予定納税額は源泉徴収税額とは別に管理する
- 分離課税の確認: 株式・FX の分離課税(第三表)は対象外。該当する場合は税理士への相談を案内する
Confirm the following before starting income tax calculation:
- Are blue tax return financial statements completed?: Check the output of the settlement skill
- Load taxpayer profile: Retrieve taxpayer information from the config using
skills/setup/scripts/profile.py get-taxpayer- Name, address, tax signature → Used for input into the Final Tax Return Preparation Corner
- Status of widow/single parent, disabled person, working student → Used for calculating personal deductions
- Income other than business income: Collect information if there is salary income, miscellaneous income, dividend income, temporary income, etc.
- Withholding slips: Guide the user to import them if there is salary income
- Application status of various deductions: comprehensively confirm applicable deductions
- Estimated tax payment amount: Obtain the estimated tax payment amount confirmed by assess
- If not confirmed, guide the user to determine it from the previous year's final tax return (column ㊺)
- Manage the estimated tax payment amount separately from the withholding tax amount
- Confirmation of separate taxation: Separate taxation for stocks/FX (Table 3) is not covered. If applicable, guide the user to consult a tax accountant
必須確認チェックリスト(スキップ不可)
Mandatory Confirmation Checklist (Cannot Be Skipped)
所得税計算を開始する前に、以下の項目がすべて確認済みであることを検証する。
config・引継書に記載がない項目は、ユーザーに直接確認してから先に進む。
- 家族構成: 配偶者の有無・扶養親族の有無を確認済みか?
- 未確認 → ユーザーに確認し、ステップ1.5 で詳細を登録する
- 確認済み(該当なし)→ ステップ1.5 をスキップ可
- 住宅ローン控除: 適用有無を確認済みか?
- 未確認 → ユーザーに確認する
- 適用あり(初年度)→ ステップ3.7 で明細書を作成する
- 予定納税: 有無・金額を確認済みか?
- 未確認 → 前年の確定申告書(㊺欄)から判定するようユーザーに確認する
- 金額未確定 → パラメータに正しい値を設定できるまで進まない
estimated_tax_payment
Before starting income tax calculation, verify that all of the following items have been confirmed.
For items not described in the config or handover files, confirm directly with the user before proceeding.
- Family composition: Has the presence of a spouse and dependent family members been confirmed?
- Unconfirmed → Confirm with the user and register details in Step 1.5
- Confirmed (not applicable) → Step 1.5 can be skipped
- Housing loan deduction: Has the applicability been confirmed?
- Unconfirmed → Confirm with the user
- Applicable (first year) → Prepare a detailed statement in Step 3.7
- Estimated tax payment: Has the presence and amount been confirmed?
- Unconfirmed → Guide the user to determine it from the previous year's final tax return (column ㊺)
- Amount unconfirmed → Do not proceed until the correct value can be set in the parameter
estimated_tax_payment
ステップ1: 源泉徴収票の取り込み
Step 1: Import Withholding Slips
給与所得がある場合、源泉徴収票からデータを取り込む。
If there is salary income, import data from withholding slips.
import_data.py import-withholding
の呼び出し
import_data.py import-withholdingCall import_data.py import-withholding
import_data.py import-withholdingbash
shinkoku import import-withholding --input withholding_input.json入力 JSON:
json
{
"file_path": "path/to/withholding_slip.pdf"
}出力:
json
{
"payer_name": "支払者名",
"payment_amount": 5000000,
"deduction_amount": 3560000,
"income_tax_withheld": 100000,
"social_insurance": 700000,
"life_insurance": 50000,
"spouse_deduction": 0
}bash
shinkoku import import-withholding --input withholding_input.jsonInput JSON:
json
{
"file_path": "path/to/withholding_slip.pdf"
}Output:
json
{
"payer_name": "Payer Name",
"payment_amount": 5000000,
"deduction_amount": 3560000,
"income_tax_withheld": 100000,
"social_insurance": 700000,
"life_insurance": 50000,
"spouse_deduction": 0
}画像ファイルの場合: OCR 読み取り
For Image Files: OCR Reading
extracted_text/reading-withholding結果照合: 両方の読み取り結果から , , を比較する
payment_amountwithheld_taxsocial_insurance一致の場合: そのまま採用。「2つの独立した読み取りで結果が一致しました」と報告
不一致の場合: ユーザーに元画像パスと両方の結果を提示し、正しい方を選択してもらう:
- 差異のあるフィールドを明示する
- A を採用 / B を採用 / 手動入力 の3択を AskUserQuestion で提示する
取り込み後の検算(必須):
OCR 結果の整合性を検証するため、「所得控除の額の合計額」と各内訳の合計を照合する:
検算: 所得控除の額の合計額 ≟ 社会保険料等の金額 ← 小規模企業共済等掛金を含む(内数)
+ 生命保険料の控除額
+ 地震保険料の控除額
+ 配偶者(特別)控除の額
+ 扶養控除額 ← 人数×単価から算出(特定63万/老人48万or58万/その他38万)
+ 障害者控除 ← 人数×単価から算出(一般27万/特別40万/同居特別75万)
+ 寡婦控除(27万)またはひとり親控除(35万) ← 該当時
+ 勤労学生控除(27万) ← 該当時
+ 基礎控除の額 ← 源泉徴収票の記載額を使用。未記載なら所得と年度から算出注意:
-
「(うち小規模企業共済等掛金の額)」は社会保険料等の金額の内数。別途加算すると二重計上になる
-
扶養控除・障害者控除は金額欄ではなく人数欄で記載されるため、人数×単価で算出する
-
基礎控除の額は源泉徴収票に記載があればその値を使う。未記載の場合は合計所得と年度に応じて算出する(令和7・8年は特例加算あり、令和9年以降は一律58万)
-
一致の場合: 各フィールドの OCR 精度が確認できたものとして採用する
-
不一致の場合: 差額を明示し、どのフィールドが誤読の可能性があるかユーザーに提示する。元画像と突き合わせて修正する
その他の確認事項:
- 複数の勤務先がある場合は各社分を取り込む
- 年末調整済みの控除を確認し、追加控除の有無を判定する
If is empty (image file or scanned PDF), use the skill to read the image.
Follow the skill's instructions to perform dual verification (comparison of two independent reading results) to obtain the result.
extracted_text/reading-withholdingResult Comparison: Compare , , from both reading results
payment_amountwithheld_taxsocial_insuranceIf matching: Adopt as-is. Report "Results matched in two independent readings"
If not matching: Present the original image path and both results to the user, and ask them to select the correct one:
- Clearly indicate fields with discrepancies
- Present three options via AskUserQuestion: Adopt A / Adopt B / Manual input
Verification After Import (Mandatory):
To verify the consistency of OCR results, compare the "Total amount of income deductions" with the sum of each breakdown:
Verification: Total amount of income deductions ≟ Amount of social insurance premiums, etc. ← Includes small business mutual aid premiums (internal amount)
+ Deduction amount for life insurance premiums
+ Deduction amount for earthquake insurance premiums
+ Amount of spouse (special) deduction
+ Dependent deduction amount ← Calculated from number of people × unit price (630,000 yen for specified/480,000 or 580,000 yen for elderly/380,000 yen for others)
+ Disabled person deduction ← Calculated from number of people × unit price (270,000 yen for general/400,000 yen for special/750,000 yen for cohabiting special)
+ Widow deduction (270,000 yen) or single parent deduction (350,000 yen) ← If applicable
+ Working student deduction (270,000 yen) ← If applicable
+ Amount of basic deduction ← Use the amount stated on the withholding slip. If not stated, calculate from income and fiscal yearNotes:
-
"(Including amount of small business mutual aid premiums)" is an internal amount of the amount of social insurance premiums, etc. Adding it separately will result in double counting
-
Dependent deductions and disabled person deductions are stated in the number of people column, not the amount column, so calculate from number of people × unit price
-
For the amount of basic deduction, use the value stated on the withholding slip if available. If not stated, calculate according to total income and fiscal year (special addition for Reiwa 7 and 8, uniform 580,000 yen from Reiwa 9 onwards)
-
If matching: Adopt as the OCR accuracy of each field has been confirmed
-
If not matching: Clearly indicate the difference, present to the user which fields may have been misread, and correct by cross-checking with the original image
Other Confirmation Items:
- If there are multiple employers, import each one
- Confirm deductions already adjusted at year-end, and determine if there are additional deductions
ステップ1.5: 扶養親族・配偶者情報の確認
Step 1.5: Confirm Dependent Family Member/Spouse Information
所得控除の計算前に、扶養親族の情報を収集する。
まず DB に登録済みのデータを確認し、不足があれば追加入力する。
Collect information on dependent family members before calculating income deductions.
First, check data already registered in the DB, and add input if there are deficiencies.
DB からの読み込み
Load from DB
- で配偶者情報を取得する(登録済みの場合)
ledger.py get-spouse --db-path DB_PATH - で扶養親族のリストを取得する(登録済みの場合)
ledger.py list-dependents --db-path DB_PATH
- Retrieve spouse information using (if registered)
ledger.py get-spouse --db-path DB_PATH - Retrieve a list of dependent family members using (if registered)
ledger.py list-dependents --db-path DB_PATH
未登録の場合の確認項目
Confirmation Items If Not Registered
-
配偶者: 配偶者の有無と年間所得金額を確認する
- 所得48万円以下 → 配偶者控除(38万円)
- 所得48万円超133万円以下 → 配偶者特別控除(段階的)
- 納税者の所得が1,000万円超 → 配偶者控除なし
- 確認後 で DB に登録する
ledger.py set-spouse --db-path DB_PATH --input spouse.json
-
扶養親族: 以下の情報を収集する
- 氏名、続柄、生年月日、年間所得、障害の有無、同居の有無
- 16歳未満: 扶養控除なし(児童手当対象)
- 16歳以上: 一般扶養38万円
- 19歳以上23歳未満: 特定扶養63万円
- 70歳以上: 老人扶養48万円(同居58万円)
- 確認後 で各人を DB に登録する
ledger.py add-dependent --db-path DB_PATH --input dependent.json
-
マイナンバーの収集(申告書B第二表に記載が必要):
- 配偶者のマイナンバー(12桁)
- 扶養親族(16歳以上)全員のマイナンバー
- 16歳未満の子供のマイナンバー(住民税に関する事項の記載に必要)
- 取扱注意: DB に保存するが、ツール出力やログには表示しない
-
事業専従者の確認:
- 配偶者が青色事業専従者として給与を受けている場合 → 配偶者控除の対象外
- 扶養親族が青色事業専従者・白色事業専従者の場合 → 扶養控除の対象外
- 該当する場合は控除計算から除外し、ユーザーに明示する
-
障害者控除: 扶養親族に障害がある場合
- 一般障害者: 27万円、特別障害者: 40万円、同居特別障害者: 75万円
重要: 16歳未満の扶養親族も必ず登録する
16歳未満の子供は扶養控除の対象外だが、以下の理由で申告書への記載が必要:
- 住民税の非課税限度額の判定(扶養人数に16歳未満も含む)
- 住民税の均等割の非課税判定
- 申告書B第二表「住民税に関する事項 - 16歳未満の扶養親族」欄への記載
ledger.py add-dependent-
Spouse: Confirm the presence of a spouse and annual income amount
- Income ≤ 480,000 yen → Spouse deduction (380,000 yen)
- Income > 480,000 yen and ≤ 1,330,000 yen → Special spouse deduction (graduated)
- Taxpayer's income > 10,000,000 yen → No spouse deduction
- After confirmation, register in the DB using
ledger.py set-spouse --db-path DB_PATH --input spouse.json
-
Dependent family members: Collect the following information
- Name, relationship, date of birth, annual income, presence of disability, presence of cohabitation
- Under 16 years old: Not eligible for dependent deduction (target of child allowance)
- 16 years old or older: General dependent deduction (380,000 yen)
- 19 years old or older and under 23 years old: Specified dependent deduction (630,000 yen)
- 70 years old or older: Elderly dependent deduction (480,000 yen for non-cohabiting/580,000 yen for cohabiting)
- After confirmation, register each person in the DB using
ledger.py add-dependent --db-path DB_PATH --input dependent.json
-
Collect My Number (required for entry in Tax Return Form B Table 2):
- Spouse's My Number (12 digits)
- My Number of all dependent family members aged 16 or older
- My Number of children under 16 years old (required for entry in "Matters related to resident tax" section)
- Handling note: Save in DB, but do not display in tool output or logs
-
Confirmation of business exclusive employees:
- If the spouse receives salary as a blue business exclusive employee → Not eligible for spouse deduction
- If dependent family members are blue business exclusive employees or white business exclusive employees → Not eligible for dependent deduction
- If applicable, exclude from deduction calculation and clearly inform the user
-
Disabled person deduction: If dependent family members have disabilities
- General disabled person: 270,000 yen, Special disabled person: 400,000 yen, Cohabiting special disabled person: 750,000 yen
Important: Be sure to register dependent family members under 16 years old
Although children under 16 are not eligible for dependent deductions, they need to be stated in the tax return for the following reasons:
- Determination of the non-taxable limit for resident tax (dependent count includes those under 16)
- Non-taxable determination of the uniform tax for resident tax
- Entry in the "Matters related to resident tax - Dependent family members under 16" column of Tax Return Form B Table 2
When registering with , do not skip even if under 16 years old.
ledger.py add-dependentステップ1.6: iDeCo・小規模企業共済の確認
Step 1.6: Confirm iDeCo・Small Business Mutual Aid
掛金払込証明書がある場合は で取り込むことができる。
import_data.py import-deduction-certificate- iDeCo(個人型確定拠出年金)の年間掛金を確認する
- 小規模企業共済等掛金払込証明書から金額を確認
- 全額が所得控除(上限: 自営業者は年額81.6万円)
- 小規模企業共済の掛金がある場合も同様に確認する
If there is a premium payment certificate, it can be imported using .
import_data.py import-deduction-certificate- Confirm the annual contribution for iDeCo (Individual-type Defined Contribution Pension)
- Confirm the amount from the small business mutual aid premium payment certificate
- Full amount is eligible for income deduction (upper limit: 816,000 yen per year for self-employed individuals)
- Similarly confirm if there are contributions for small business mutual aid
画像ファイルの場合: OCR 読み取り
For Image Files: OCR Reading
extracted_text/reading-deduction-cert結果照合: 両方の読み取り結果から , を比較する
annual_premiumcertificate_type一致の場合: そのまま採用。「2つの独立した読み取りで結果が一致しました」と報告
不一致の場合: ユーザーに元画像パスと両方の結果を提示し、正しい方を選択してもらう:
- 差異のあるフィールドを明示する
- A を採用 / B を採用 / 手動入力 の3択を AskUserQuestion で提示する
If is empty (image file or scanned PDF), use the skill to read the image.
Follow the skill's instructions to perform dual verification (comparison of two independent reading results) to obtain the result.
extracted_text/reading-deduction-certResult Comparison: Compare , from both reading results
annual_premiumcertificate_typeIf matching: Adopt as-is. Report "Results matched in two independent readings"
If not matching: Present the original image path and both results to the user, and ask them to select the correct one:
- Clearly indicate fields with discrepancies
- Present three options via AskUserQuestion: Adopt A / Adopt B / Manual input
ステップ1.7: 医療費明細の集計
Step 1.7: Aggregate Medical Expense Details
医療費控除を適用する場合、明細を集計する。
If applying for medical expense deduction, aggregate the details.
医療費の登録・集計
Register and Aggregate Medical Expenses
- で登録済み医療費明細を取得する
ledger.py list-medical-expenses --db-path DB_PATH --input query.json - 未登録の医療費がある場合は で登録する:
ledger.py add-medical-expense --db-path DB_PATH --input medical.jsonjson{ "fiscal_year": 2025, "detail": { "date": "2025-03-15", "patient_name": "山田太郎", "medical_institution": "ABC病院", "amount": 150000, "insurance_reimbursement": 0, "description": null } } - 集計結果(total_amount - total_reimbursement)を医療費控除の計算に使用する
- Retrieve registered medical expense details using
ledger.py list-medical-expenses --db-path DB_PATH --input query.json - If there are unregistered medical expenses, register them using :
ledger.py add-medical-expense --db-path DB_PATH --input medical.jsonjson{ "fiscal_year": 2025, "detail": { "date": "2025-03-15", "patient_name": "Taro Yamada", "medical_institution": "ABC Hospital", "amount": 150000, "insurance_reimbursement": 0, "description": null } } - Use the aggregated result (total_amount - total_reimbursement) to calculate the medical expense deduction
ステップ1.8: 事業所得の源泉徴収(支払調書)
Step 1.8: Withholding Tax on Business Income (Payment Statement)
取引先から受け取った支払調書の情報を登録する。
Register information from payment statements received from business partners.
支払調書の取り込み
Import Payment Statements
- で支払調書PDF/画像からデータを抽出する
import_data.py import-payment-statement --input payment_input.json
- Extract data from payment statement PDFs/images using
import_data.py import-payment-statement --input payment_input.json
画像ファイルの場合: OCR 読み取り
For Image Files: OCR Reading
extracted_text/reading-payment-statement結果照合: 両方の読み取り結果から , , を比較する
gross_amountwithholding_taxpayer_name一致の場合: そのまま採用。「2つの独立した読み取りで結果が一致しました」と報告
不一致の場合: ユーザーに元画像パスと両方の結果を提示し、正しい方を選択してもらう:
- 差異のあるフィールドを明示する
- A を採用 / B を採用 / 手動入力 の3択を AskUserQuestion で提示する
- で取引先別の源泉徴収情報を登録する:
ledger.py add-business-withholding --db-path DB_PATH --input withholding.jsonjson{ "fiscal_year": 2025, "detail": { "client_name": "取引先名", "gross_amount": 1000000, "withholding_tax": 102100 } } - で登録済み情報を確認する
ledger.py list-business-withholding --db-path DB_PATH --input query.json - 源泉徴収税額の合計を として所得税計算に使用する
business_withheld_tax
If is empty (image file or scanned PDF), use the skill to read the image.
Follow the skill's instructions to perform dual verification (comparison of two independent reading results) to obtain the result.
extracted_text/reading-payment-statementResult Comparison: Compare , , from both reading results
gross_amountwithholding_taxpayer_nameIf matching: Adopt as-is. Report "Results matched in two independent readings"
If not matching: Present the original image path and both results to the user, and ask them to select the correct one:
- Clearly indicate fields with discrepancies
- Present three options via AskUserQuestion: Adopt A / Adopt B / Manual input
- Register withholding tax information by business partner using :
ledger.py add-business-withholding --db-path DB_PATH --input withholding.jsonjson{ "fiscal_year": 2025, "detail": { "client_name": "Business Partner Name", "gross_amount": 1000000, "withholding_tax": 102100 } } - Confirm registered information using
ledger.py list-business-withholding --db-path DB_PATH --input query.json - Use the total withholding tax amount as for income tax calculation
business_withheld_tax
ステップ1.8.5: 税理士等報酬の登録
Step 1.8.5: Register Fees for Tax Accountants, Etc.
税理士・弁護士等に報酬を支払っている場合、報酬明細を登録する。
- で登録済みの税理士等報酬を確認する
ledger.py list-professional-fees --db-path DB_PATH --input query.json - 未登録の場合は で登録する:
ledger.py add-professional-fee --db-path DB_PATH --input fee.jsonjson{ "fiscal_year": 2025, "detail": { "payer_address": "支払者住所", "payer_name": "税理士名", "fee_amount": 300000, "expense_deduction": 0, "withheld_tax": 30630 } } - 源泉徴収税額は に合算する
business_withheld_tax
If fees are paid to tax accountants, lawyers, etc., register the fee details.
- Confirm registered fees for tax accountants, etc. using
ledger.py list-professional-fees --db-path DB_PATH --input query.json - If unregistered, register using :
ledger.py add-professional-fee --db-path DB_PATH --input fee.jsonjson{ "fiscal_year": 2025, "detail": { "payer_address": "Payer Address", "payer_name": "Tax Accountant Name", "fee_amount": 300000, "expense_deduction": 0, "withheld_tax": 30630 } } - Add the withholding tax amount to
business_withheld_tax
ステップ1.9: 損失繰越の確認
Step 1.9: Confirm Loss Carryforward
前年以前に事業で損失が発生し、青色申告している場合、繰越控除を適用できる。
- で登録済みの繰越損失を確認する
ledger.py list-loss-carryforward --db-path DB_PATH --input query.json - 未登録の場合は で登録する:
ledger.py add-loss-carryforward --db-path DB_PATH --input loss.jsonjson{ "fiscal_year": 2025, "detail": { "loss_year": 2023, "amount": 500000 } } - 繰越損失の合計を として所得税計算に使用する
loss_carryforward_amount
If a business loss occurred in previous years and a blue tax return was filed, carryforward deduction can be applied.
- Confirm registered loss carryforwards using
ledger.py list-loss-carryforward --db-path DB_PATH --input query.json - If unregistered, register using :
ledger.py add-loss-carryforward --db-path DB_PATH --input loss.jsonjson{ "fiscal_year": 2025, "detail": { "loss_year": 2023, "amount": 500000 } } - Use the total loss carryforward amount as for income tax calculation
loss_carryforward_amount
ステップ1.10: その他の所得の確認(雑所得・配当所得・一時所得・年金所得・退職所得)
Step 1.10: Confirm Other Income (Miscellaneous, Dividend, Temporary, Pension, Retirement)
事業所得・給与所得以外の総合課税の所得を確認・登録する。
Confirm and register income subject to comprehensive taxation other than business income and salary income.
公的年金等の雑所得
Miscellaneous Income from Public Pensions, Etc.
公的年金等の収入がある場合、年金控除を計算して雑所得を求める。
- 年金収入の有無を確認する
- で公的年金等控除を計算する:
skills/income-tax/scripts/tax_calc.py calc-pension入力 JSON:bashshinkoku tax calc-pension --input pension_input.json出力:json{ "pension_income": 2000000, "is_over_65": true, "other_income": 0 }json{ "pension_income": 2000000, "deduction_amount": 1100000, "taxable_pension_income": 900000, "other_income_adjustment": 0 } - を雑所得として
taxable_pension_incomeに加算するmisc_income - 令和7年改正: 65歳未満の最低保障額60万→70万、65歳以上の最低保障額110万→130万
If there is income from public pensions, etc., calculate the pension deduction to obtain miscellaneous income.
- Confirm if there is pension income
- Calculate the public pension, etc. deduction using :
skills/income-tax/scripts/tax_calc.py calc-pensionInput JSON:bashshinkoku tax calc-pension --input pension_input.jsonOutput:json{ "pension_income": 2000000, "is_over_65": true, "other_income": 0 }json{ "pension_income": 2000000, "deduction_amount": 1100000, "taxable_pension_income": 900000, "other_income_adjustment": 0 } - Add to
taxable_pension_incomeas miscellaneous incomemisc_income - Reiwa 7 revision: Minimum guarantee amount increased from 600,000 to 700,000 yen for under 65, from 1,100,000 to 1,300,000 yen for 65 and over
退職所得
Retirement Income
退職金を受け取った場合、退職所得を計算する。
- 退職金の有無を確認する
- で退職所得を計算する:
skills/income-tax/scripts/tax_calc.py calc-retirement入力 JSON:bashshinkoku tax calc-retirement --input retirement_input.json出力:json{ "severance_pay": 10000000, "years_of_service": 20, "is_officer": false, "is_disability_retirement": false }json{ "severance_pay": 10000000, "retirement_income_deduction": 8000000, "taxable_retirement_income": 1000000, "half_taxation_applied": true } - 退職所得は原則分離課税(退職時に源泉徴収済み)だが、確定申告で精算する場合もある
- 役員等の短期退職(勤続5年以下)は1/2課税が適用されない
If retirement pay is received, calculate retirement income.
- Confirm if there is retirement pay
- Calculate retirement income using :
skills/income-tax/scripts/tax_calc.py calc-retirementInput JSON:bashshinkoku tax calc-retirement --input retirement_input.jsonOutput:json{ "severance_pay": 10000000, "years_of_service": 20, "is_officer": false, "is_disability_retirement": false }json{ "severance_pay": 10000000, "retirement_income_deduction": 8000000, "taxable_retirement_income": 1000000, "half_taxation_applied": true } - Retirement income is generally subject to separate taxation (withholding tax already deducted at retirement), but may be settled in the final tax return in some cases
- Short-term retirement for officers, etc. (less than 5 years of service) is not eligible for half taxation
雑所得(miscellaneous)
Miscellaneous Income
副業の原稿料、暗号資産の売却益、その他の雑収入。
- で登録済み雑所得を確認する
ledger.py list-other-income --db-path DB_PATH --input query.json - 未登録の収入がある場合は で登録する:
ledger.py add-other-income --db-path DB_PATH --input other_income.jsonjson{ "fiscal_year": 2025, "detail": { "income_type": "miscellaneous", "description": "収入の内容", "revenue": 500000, "expenses": 50000, "withheld_tax": 51050, "payer_name": "支払者名" } } - 雑所得 = 収入 - 経費(特別控除なし)
Side business manuscript fees, cryptocurrency sales profits, other miscellaneous income.
- Confirm registered miscellaneous income using
ledger.py list-other-income --db-path DB_PATH --input query.json - If there is unregistered income, register using :
ledger.py add-other-income --db-path DB_PATH --input other_income.jsonjson{ "fiscal_year": 2025, "detail": { "income_type": "miscellaneous", "description": "Content of income", "revenue": 500000, "expenses": 50000, "withheld_tax": 51050, "payer_name": "Payer Name" } } - Miscellaneous income = Revenue - Expenses (no special deduction)
仮想通貨(暗号資産)
Virtual Currency (Cryptocurrency)
暗号資産の売却益は雑所得(総合課税)として申告する。
- で登録済み仮想通貨所得を確認する
ledger.py list-crypto-income --db-path DB_PATH --input query.json - 未登録の場合は で取引所別に登録する:
ledger.py add-crypto-income --db-path DB_PATH --input crypto.jsonjson{ "fiscal_year": 2025, "detail": { "exchange_name": "取引所名", "gains": 300000, "expenses": 10000 } } - 合計を雑所得として total_income に加算する
Cryptocurrency sales profits are declared as miscellaneous income (comprehensive taxation).
- Confirm registered virtual currency income using
ledger.py list-crypto-income --db-path DB_PATH --input query.json - If unregistered, register by exchange using :
ledger.py add-crypto-income --db-path DB_PATH --input crypto.jsonjson{ "fiscal_year": 2025, "detail": { "exchange_name": "Exchange Name", "gains": 300000, "expenses": 10000 } } - Add the total to as miscellaneous income
total_income
配当所得(総合課税選択分)
Dividend Income (Comprehensive Taxation Selection)
総合課税を選択した配当は配当控除(税額控除)の対象となる。
- で
ledger.py list-other-income --db-path DB_PATH --input query.jsonを確認するincome_type: "dividend_comprehensive" - 未登録の場合は で登録する
ledger.py add-other-income --db-path DB_PATH --input dividend.json - 配当控除: 課税所得1,000万以下の部分 → 配当の10%、超える部分 → 5%
Dividends for which comprehensive taxation is selected are eligible for dividend deduction (tax credit).
- Confirm using
income_type: "dividend_comprehensive"ledger.py list-other-income --db-path DB_PATH --input query.json - If unregistered, register using
ledger.py add-other-income --db-path DB_PATH --input dividend.json - Dividend deduction: 10% of dividends for taxable income up to 10,000,000 yen, 5% for amounts exceeding that
一時所得
Temporary Income
保険満期金、懸賞金等の一時的な所得。
- で
ledger.py list-other-income --db-path DB_PATH --input query.jsonを確認するincome_type: "one_time" - 未登録の場合は で登録する
ledger.py add-other-income --db-path DB_PATH --input one_time.json - 一時所得 = max(0, (収入 - 経費 - 特別控除50万円)) × 1/2
Temporary income such as insurance maturity proceeds, prize money, etc.
- Confirm using
income_type: "one_time"ledger.py list-other-income --db-path DB_PATH --input query.json - If unregistered, register using
ledger.py add-other-income --db-path DB_PATH --input one_time.json - Temporary income = max(0, (Revenue - Expenses - Special deduction of 500,000 yen)) × 1/2
calc_income_tax
への反映
calc_income_taxReflection in calc_income_tax
calc_income_tax上記のその他所得は以下のパラメータで に渡す:
calc_income_tax- : 雑所得合計(仮想通貨含む)
misc_income - : 配当所得(総合課税選択分)
dividend_income_comprehensive - : 一時所得の収入金額(1/2 計算は内部で実施)
one_time_income - : その他所得の源泉徴収税額合計
other_income_withheld_tax
Pass the above other income to with the following parameters:
calc_income_tax- : Total miscellaneous income (including virtual currency)
misc_income - : Dividend income (comprehensive taxation selection)
dividend_income_comprehensive - : Revenue amount of temporary income (1/2 calculation is performed internally)
one_time_income - : Total withholding tax amount for other income
other_income_withheld_tax
ステップ1.11: (対象外)分離課税
Step 1.11: (Not Covered) Separate Taxation
分離課税(株式・FX の第三表)は対象外。該当する場合は税理士への相談を案内する。
Separate taxation (Table 3 for stocks/FX) is not covered. If applicable, guide the user to consult a tax accountant.
ステップ1.12: 社会保険料の種別別内訳の登録
Step 1.12: Register Breakdown of Social Insurance Premiums by Type
所得控除の内訳書に種別ごとの記載が必要なため、社会保険料を種別別に登録する。
社会保険料の控除証明書がある場合は で取り込むことができる。
import_data.py import-deduction-certificate- で登録済み項目を確認する
ledger.py list-social-insurance-items --db-path DB_PATH --input query.json - 未登録の場合は で種別ごとに登録する:
ledger.py add-social-insurance-item --db-path DB_PATH --input insurance.jsoninsurance_type: national_health / national_pension / national_pension_fund / nursing_care / labor_insurance / otherjson{ "fiscal_year": 2025, "detail": { "insurance_type": "national_health", "name": "保険者名", "amount": 300000 } } - 合計額を として控除計算に使用する
social_insurance
Since the breakdown of income deductions requires entry by type, register social insurance premiums by type.
If there is a deduction certificate for social insurance premiums, it can be imported using .
import_data.py import-deduction-certificate- Confirm registered items using
ledger.py list-social-insurance-items --db-path DB_PATH --input query.json - If unregistered, register by type using :
ledger.py add-social-insurance-item --db-path DB_PATH --input insurance.jsoninsurance_type: national_health / national_pension / national_pension_fund / nursing_care / labor_insurance / otherjson{ "fiscal_year": 2025, "detail": { "insurance_type": "national_health", "name": "Insurer Name", "amount": 300000 } } - Use the total amount as for deduction calculation
social_insurance
ステップ1.13: 保険契約の保険会社名の登録
Step 1.13: Register Insurance Company Names for Insurance Policies
所得控除の内訳書に保険会社名の記載が必要なため、保険契約を登録する。
控除証明書の画像・PDFがある場合は で取り込むことができる。
取り込み後、抽出データに基づいて で登録する。
import_data.py import-deduction-certificateledger.py add-insurance-policy- で登録済み項目を確認する
ledger.py list-insurance-policies --db-path DB_PATH --input query.json - 未登録の場合は で登録する:
ledger.py add-insurance-policy --db-path DB_PATH --input policy.jsonpolicy_type: life_general_new / life_general_old / life_medical_care / life_annuity_new / life_annuity_old / earthquake / old_long_termjson{ "fiscal_year": 2025, "detail": { "policy_type": "life_general_new", "company_name": "保険会社名", "premium": 80000 } } - 生命保険料は パラメータに、地震保険料は
life_insurance_detailに反映するearthquake_insurance_premium
Since the breakdown of income deductions requires entry of insurance company names, register insurance policies.
If there are images/PDFs of deduction certificates, they can be imported using .
After import, register using based on the extracted data.
import_data.py import-deduction-certificateledger.py add-insurance-policy- Confirm registered items using
ledger.py list-insurance-policies --db-path DB_PATH --input query.json - If unregistered, register using :
ledger.py add-insurance-policy --db-path DB_PATH --input policy.jsonpolicy_type: life_general_new / life_general_old / life_medical_care / life_annuity_new / life_annuity_old / earthquake / old_long_termjson{ "fiscal_year": 2025, "detail": { "policy_type": "life_general_new", "company_name": "Insurance Company Name", "premium": 80000 } } - Reflect life insurance premiums in the parameter, and earthquake insurance premiums in
life_insurance_detailearthquake_insurance_premium
ステップ1.14: ふるさと納税以外の寄附金の確認
Step 1.14: Confirm Donations Other than Furusato Nozei
政治活動寄附金、認定NPO法人、公益社団法人等への寄附金を確認する。
- で登録済み寄附金を確認する
ledger.py list-donations --db-path DB_PATH --input query.json - 未登録の場合は で登録する:
ledger.py add-donation --db-path DB_PATH --input donation.jsondonation_type: political / npo / public_interest / specified / otherjson{ "fiscal_year": 2025, "detail": { "donation_type": "npo", "recipient_name": "寄附先名", "amount": 50000, "date": "2025-06-01", "receipt_number": null } } - 寄附金控除の計算:
- 所得控除: 全寄附金 - 2,000円(総所得金額の40%上限)
- 税額控除(政治活動寄附金): (寄附金 - 2,000円) × 30%(所得税額の25%上限)
- 税額控除(認定NPO等): (寄附金 - 2,000円) × 40%(所得税額の25%上限)
- の
calc_deductionsパラメータに寄附金レコードのリストを渡すdonations
Confirm donations to political activity contributions, certified NPO corporations, public interest incorporated associations, etc.
- Confirm registered donations using
ledger.py list-donations --db-path DB_PATH --input query.json - If unregistered, register using :
ledger.py add-donation --db-path DB_PATH --input donation.jsondonation_type: political / npo / public_interest / specified / otherjson{ "fiscal_year": 2025, "detail": { "donation_type": "npo", "recipient_name": "Recipient Name", "amount": 50000, "date": "2025-06-01", "receipt_number": null } } - Calculation of donation deduction:
- Income deduction: Total donations - 2,000 yen (upper limit of 40% of total income amount)
- Tax credit (political activity donations): (Donations - 2,000 yen) × 30% (upper limit of 25% of income tax amount)
- Tax credit (certified NPOs, etc.): (Donations - 2,000 yen) × 40% (upper limit of 25% of income tax amount)
- Pass the list of donation records to the parameter of
donationscalc_deductions
ステップ2: 所得控除の計算
Step 2: Calculate Income Deductions
tax_calc.py calc-deductions
の呼び出し
tax_calc.py calc-deductionsCall tax_calc.py calc-deductions
tax_calc.py calc-deductionsbash
shinkoku tax calc-deductions --input deductions_input.json入力 JSON:
json
{
"total_income": 5000000,
"social_insurance": 700000,
"life_insurance_premium": 80000,
"earthquake_insurance_premium": 30000,
"medical_expenses": 200000,
"furusato_nozei": 50000,
"housing_loan_balance": 0,
"spouse_income": null,
"ideco_contribution": 276000,
"dependents": [],
"fiscal_year": 2025,
"housing_loan_detail": null,
"donations": null
}出力 (DeductionsResult):
- : 所得控除の一覧(basic_deduction, social_insurance_deduction, life_insurance_deduction, earthquake_insurance_deduction, ideco_deduction, medical_deduction, furusato_deduction, donation_deduction, spouse_deduction, dependent_deduction, disability_deduction)
income_deductions - : 税額控除の一覧(housing_loan_credit, political_donation_credit, npo_donation_credit)
tax_credits - : 所得控除合計
total_income_deductions - : 税額控除合計
total_tax_credits
各控除の確認事項:
- 基礎控除: 合計所得金額に応じた段階的控除(令和7年分の改正を反映、132万以下=95万)
- 社会保険料控除: 国民年金・国民健康保険・その他の年間支払額
- 生命保険料控除: 新旧制度 × 3区分(一般/介護医療/個人年金)で計算する
- パラメータで5区分の保険料を指定:
life_insurance_detail- : 一般(新制度)、
general_new: 一般(旧制度)general_old - : 介護医療(新制度のみ)
medical_care - : 個人年金(新制度)、
annuity_new: 個人年金(旧制度)annuity_old
- 各区分の上限: 新制度 40,000円 / 旧制度 50,000円 / 合算上限 40,000円
- 3区分合計の上限: 120,000円
- 源泉徴収票に生命保険料5区分の記載がある場合はそのまま使用する
- 地震保険料控除: 地震保険(上限5万円)+ 旧長期損害保険(上限1.5万円)、合算上限5万円
- パラメータで旧長期損害保険料を指定可能
old_long_term_insurance_premium
- 小規模企業共済等掛金控除: 3サブタイプ個別追跡
- iDeCo(個人型確定拠出年金)
- 小規模企業共済
- 心身障害者扶養共済
- パラメータで小規模企業共済掛金を指定
small_business_mutual_aid
- 医療費控除: 支払額から保険金等の補填額を差し引き、10万円(または所得の5%)を超える部分
- セルフメディケーション税制との選択適用: OTC医薬品の購入額 - 12,000円(上限 88,000円)
- 医療費控除とセルフメディケーションは併用不可。有利な方を選択する
- 配偶者控除/特別控除: 配偶者の所得に応じて段階的に控除額が変動
- 扶養控除: 年齢区分に応じた控除額(一般38万/特定63万/老人48万or58万)
- 障害者控除: 障害の程度に応じた控除額
- 人的控除(config の納税者情報から自動判定):
- 寡婦控除: 27万円(所得500万以下)
- ひとり親控除: 35万円(所得500万以下)
- 障害者控除(本人): 一般 27万円 / 特別 40万円
- 勤労学生控除: 27万円(所得75万以下)
- ふるさと納税: 寄附金 − 2,000円(確定申告ではワンストップ特例分も含める)
- 住宅ローン控除: 住宅区分別の年末残高上限と控除率0.7%(令和4年以降入居)
bash
shinkoku tax calc-deductions --input deductions_input.jsonInput JSON:
json
{
"total_income": 5000000,
"social_insurance": 700000,
"life_insurance_premium": 80000,
"earthquake_insurance_premium": 30000,
"medical_expenses": 200000,
"furusato_nozei": 50000,
"housing_loan_balance": 0,
"spouse_income": null,
"ideco_contribution": 276000,
"dependents": [],
"fiscal_year": 2025,
"housing_loan_detail": null,
"donations": null
}Output (DeductionsResult):
- : List of income deductions (basic_deduction, social_insurance_deduction, life_insurance_deduction, earthquake_insurance_deduction, ideco_deduction, medical_deduction, furusato_deduction, donation_deduction, spouse_deduction, dependent_deduction, disability_deduction)
income_deductions - : List of tax credits (housing_loan_credit, political_donation_credit, npo_donation_credit)
tax_credits - : Total income deductions
total_income_deductions - : Total tax credits
total_tax_credits
Confirmation Items for Each Deduction:
- Basic deduction: Graduated deduction according to total income amount (reflects Reiwa 7 revision, 950,000 yen for up to 1,320,000 yen)
- Social insurance premium deduction: Annual payment amount for national pension, national health insurance, etc.
- Life insurance premium deduction: Calculated using new/old systems × 3 categories (general/long-term care medical/individual annuity)
- Specify insurance premiums for 5 categories with the parameter:
life_insurance_detail- : General (new system),
general_new: General (old system)general_old - : Long-term care medical (new system only)
medical_care - : Individual annuity (new system),
annuity_new: Individual annuity (old system)annuity_old
- Upper limit for each category: 40,000 yen for new system / 50,000 yen for old system / 40,000 yen for combined total
- Upper limit for total of 3 categories: 120,000 yen
- If the withholding slip states the 5 categories of life insurance premiums, use them as-is
- Specify insurance premiums for 5 categories with the
- Earthquake insurance premium deduction: Earthquake insurance (upper limit 50,000 yen) + Old long-term damage insurance (upper limit 15,000 yen), combined upper limit 50,000 yen
- Can specify old long-term damage insurance premiums with the parameter
old_long_term_insurance_premium
- Can specify old long-term damage insurance premiums with the
- Small business mutual aid premium deduction: Track 3 subtypes individually
- iDeCo (Individual-type Defined Contribution Pension)
- Small business mutual aid
- Mutual aid for supporting persons with disabilities
- Specify small business mutual aid premiums with the parameter
small_business_mutual_aid
- Medical expense deduction: Amount exceeding 100,000 yen (or 5% of income) after subtracting insurance benefits, etc.
- Optional application with self-medication tax system: OTC drug purchase amount - 12,000 yen (upper limit 88,000 yen)
- Medical expense deduction and self-medication cannot be used together. Select the more advantageous one
- Spouse deduction/special deduction: Deduction amount varies gradually according to spouse's income
- Dependent deduction: Deduction amount according to age category (380,000 yen for general/630,000 yen for specified/480,000 or 580,000 yen for elderly)
- Disabled person deduction: Deduction amount according to disability level
- Personal deductions (automatically determined from taxpayer information in config):
- Widow deduction: 270,000 yen (income up to 5,000,000 yen)
- Single parent deduction: 350,000 yen (income up to 5,000,000 yen)
- Disabled person deduction (self): 270,000 yen for general / 400,000 yen for special
- Working student deduction: 270,000 yen (income up to 750,000 yen)
- Furusato Nozei: Donations − 2,000 yen (includes one-stop special case in final tax return)
- Housing loan deduction: Upper limit of year-end balance by housing category and deduction rate of 0.7% (for move-in from Reiwa 4 onwards)
ステップ3: 所得税額の計算
Step 3: Calculate Income Tax Amount
tax_calc.py calc-income
の呼び出し
tax_calc.py calc-incomeCall tax_calc.py calc-income
tax_calc.py calc-incomebash
shinkoku tax calc-income --input income_input.json入力 JSON (IncomeTaxInput):
json
{
"fiscal_year": 2025,
"salary_income": 5000000,
"business_revenue": 3000000,
"business_expenses": 1000000,
"blue_return_deduction": 650000,
"social_insurance": 700000,
"life_insurance_premium": 80000,
"earthquake_insurance_premium": 30000,
"medical_expenses": 0,
"furusato_nozei": 50000,
"housing_loan_balance": 0,
"spouse_income": null,
"ideco_contribution": 276000,
"withheld_tax": 100000,
"business_withheld_tax": 30000,
"estimated_tax_payment": 0,
"loss_carryforward_amount": 0
}出力 (IncomeTaxResult):
- : 給与所得控除後の金額
salary_income_after_deduction - : 事業所得
business_income - : 合計所得金額(繰越損失適用後)
total_income - : 所得控除合計
total_income_deductions - : 課税所得金額(1,000円未満切り捨て)
taxable_income - : 算出税額
income_tax_base - : 税額控除合計
total_tax_credits - : 税額控除後
income_tax_after_credits - : 復興特別所得税(基準所得税額 x 2.1%)
reconstruction_tax - : 所得税及び復興特別所得税の額(端数処理なし)
total_tax - : 源泉徴収税額(給与分)
withheld_tax - : 事業所得の源泉徴収税額
business_withheld_tax - : 予定納税額
estimated_tax_payment - : 適用した繰越損失額
loss_carryforward_applied - : 申告納税額(= total_tax - withheld_tax - business_withheld_tax - estimated_tax_payment)
tax_due
寄附金控除の反映:
ふるさと納税以外の寄附金控除(ステップ1.14で登録)は、 の結果に含まれている。
は内部で を呼び出すため、以下のパラメータが正しく渡されていれば自動的に反映される:
calc_deductionscalc_income_taxcalc_deductions- : ふるさと納税の寄附金合計
furusato_nozei - 政治活動寄附金・認定NPO等の税額控除は の
calc_deductionsパラメータ経由で計算されるdonations
所得税計算前に を個別に呼び出す場合は、 パラメータにステップ1.14で登録した寄附金レコードのリストを必ず渡すこと。
calc_deductionsdonations青色申告特別控除の自動キャップ:
blue_return_deductioneffective_blue_return_deductionwarnings計算結果の確認:
- 合計所得金額の内訳を表示する
- を確認し、自動調整があれば
effective_blue_return_deductionの内容を表示するwarnings - 繰越損失が適用されている場合はその額を明示する
- 所得税の速算表の適用が正しいか確認する
- 復興特別所得税が正しく加算されているか確認する
- 源泉徴収税額(給与分 + 事業分)が正しく控除されているか確認する
- 予定納税額が正しく控除されているか確認する
- 最終的な納付額(または還付額)を明示する
所得税の速算表・配偶者控除テーブル・住宅ローン限度額等は を参照。
references/deduction-tables.mdbash
shinkoku tax calc-income --input income_input.jsonInput JSON (IncomeTaxInput):
json
{
"fiscal_year": 2025,
"salary_income": 5000000,
"business_revenue": 3000000,
"business_expenses": 1000000,
"blue_return_deduction": 650000,
"social_insurance": 700000,
"life_insurance_premium": 80000,
"earthquake_insurance_premium": 30000,
"medical_expenses": 0,
"furusato_nozei": 50000,
"housing_loan_balance": 0,
"spouse_income": null,
"ideco_contribution": 276000,
"withheld_tax": 100000,
"business_withheld_tax": 30000,
"estimated_tax_payment": 0,
"loss_carryforward_amount": 0
}Output (IncomeTaxResult):
- : Amount after salary income deduction
salary_income_after_deduction - : Business income
business_income - : Total income amount (after applying loss carryforward)
total_income - : Total income deductions
total_income_deductions - : Taxable income amount (round down amounts less than 1,000 yen)
taxable_income - : Calculated tax amount
income_tax_base - : Total tax credits
total_tax_credits - : After tax credits
income_tax_after_credits - : Reconstruction Special Income Tax (base income tax amount x 2.1%)
reconstruction_tax - : Amount of Income Tax and Reconstruction Special Income Tax (no rounding)
total_tax - : Withholding tax amount (salary portion)
withheld_tax - : Withholding tax amount for business income
business_withheld_tax - : Estimated tax payment amount
estimated_tax_payment - : Amount of loss carryforward applied
loss_carryforward_applied - : Declared tax amount (= total_tax - withheld_tax - business_withheld_tax - estimated_tax_payment)
tax_due
Reflection of Donation Deduction:
Donation deductions other than Furusato Nozei (registered in Step 1.14) are included in the results of .
Since internally calls , they will be reflected automatically if the following parameters are passed correctly:
calc_deductionscalc_income_taxcalc_deductions- : Total donations for Furusato Nozei
furusato_nozei - Tax credits for political activity donations and certified NPOs, etc. are calculated via the parameter of
donationscalc_deductions
If is called individually before calculating income tax, be sure to pass the list of donation records registered in Step 1.14 to the parameter.
calc_deductionsdonationsAutomatic Capping of Blue Tax Return Special Deduction:
You can pass the config value directly as . The calculation engine automatically caps it at the business profit limit (Tax Special Measures Act Article 25-2).
Be sure to check and in the results.
blue_return_deductioneffective_blue_return_deductionwarningsConfirmation of Calculation Results:
- Display the breakdown of total income amount
- Check , and display the contents of
effective_blue_return_deductionif there was automatic adjustmentwarnings - If loss carryforward was applied, clearly indicate the amount
- Confirm that the income tax quick calculation table was applied correctly
- Confirm that the Reconstruction Special Income Tax was added correctly
- Confirm that the withholding tax amount (salary + business portion) was deducted correctly
- Confirm that the estimated tax payment amount was deducted correctly
- Clearly indicate the final payment amount (or refund amount)
For the income tax quick calculation table, spouse deduction table, housing loan limit, life insurance premium deduction, etc., refer to .
references/deduction-tables.mdステップ3.1: サニティチェック(必須)
Step 3.1: Sanity Check (Mandatory)
calc-incomeAutomatically verify the results of . This step cannot be skipped.
calc-incometax_calc.py sanity-check
の呼び出し
tax_calc.py sanity-checkCall tax_calc.py sanity-check
tax_calc.py sanity-checkbash
shinkoku tax sanity-check --input sanity_input.json入力 JSON:
json
{
"input": { ... },
"result": { ... }
}- : ステップ3で
inputに渡した IncomeTaxInputcalc-income - : ステップ3で
resultから返された IncomeTaxResultcalc-income
出力 (TaxSanityCheckResult):
- : true/false
passed - : チェック項目のリスト(severity, code, message)
items - : エラー件数
error_count - : 警告件数
warning_count
bash
shinkoku tax sanity-check --input sanity_input.jsonInput JSON:
json
{
"input": { ... },
"result": { ... }
}- : IncomeTaxInput passed to
inputin Step 3calc-income - : IncomeTaxResult returned from
resultin Step 3calc-income
Output (TaxSanityCheckResult):
- : true/false
passed - : List of check items (severity, code, message)
items - : Number of errors
error_count - : Number of warnings
warning_count
結果に応じた対応
Response According to Results
- error > 0: 計算結果に問題があります。エラー内容を確認し、入力を修正してステップ3を再実行してください
- warning > 0: 警告内容をユーザーに提示し、確認してから続行してください
- passed = true: 問題なし。次のステップに進む
- error > 0: There is a problem with the calculation results. Check the error details, correct the input, and re-run Step 3
- warning > 0: Present the warning contents to the user, and continue after confirmation
- passed = true: No issues. Proceed to the next step
ステップ3.5: 住宅ローン控除明細の DB 登録(該当者のみ)
Step 3.5: Register Housing Loan Deduction Details in DB (Only for Applicable Persons)
住宅ローン控除(初年度)を適用する場合、詳細情報を DB に登録する。
- で住宅ローン控除の明細を登録する:
ledger.py add-housing-loan-detail --db-path DB_PATH --input housing.jsonjson{ "fiscal_year": 2025, "detail": { "housing_type": "new_custom", "housing_category": "certified", "move_in_date": "2024-03-15", "year_end_balance": 30000000, "is_new_construction": true, "is_childcare_household": false, "has_pre_r6_building_permit": false, "purchase_date": "2024-01-20", "purchase_price": 40000000, "total_floor_area": 8000, "residential_floor_area": 8000, "property_number": null, "application_submitted": false } }
住宅区分別の年末残高上限テーブルは を参照。
references/deduction-tables.mdIf applying for housing loan deduction (first year), register detailed information in the DB.
- Register housing loan deduction details using :
ledger.py add-housing-loan-detail --db-path DB_PATH --input housing.jsonjson{ "fiscal_year": 2025, "detail": { "housing_type": "new_custom", "housing_category": "certified", "move_in_date": "2024-03-15", "year_end_balance": 30000000, "is_new_construction": true, "is_childcare_household": false, "has_pre_r6_building_permit": false, "purchase_date": "2024-01-20", "purchase_price": 40000000, "total_floor_area": 8000, "residential_floor_area": 8000, "property_number": null, "application_submitted": false } }
For the table of year-end balance limits by housing category, refer to .
references/deduction-tables.mdステップ6: 計算結果サマリーの提示
Step 6: Present Calculation Result Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
所得税の計算結果(令和○年分)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
■ 所得金額(総合課税)
事業所得: ○○○,○○○円
給与所得: ○○○,○○○円
雑所得: ○○○,○○○円(該当者のみ)
配当所得: ○○○,○○○円(総合課税分、該当者のみ)
一時所得: ○○○,○○○円(該当者のみ)
合計所得金額: ○○○,○○○円
■ 所得控除
社会保険料控除: ○○○,○○○円
生命保険料控除: ○○,○○○円
基礎控除: 480,000円
[その他の控除...]
所得控除合計: ○○○,○○○円
■ 税額計算
課税所得金額: ○○○,○○○円
算出税額: ○○○,○○○円
税額控除: ○○,○○○円
復興特別所得税: ○,○○○円
所得税及び復興特別所得税: ○○○,○○○円
源泉徴収税額: ○○○,○○○円
予定納税額: ○○,○○○円
---------------------------------
申告納税額: ○○,○○○円(納付 / 還付)
■ 次のステップ:
→ /consumption-tax で消費税の計算を行う
→ /e-tax で確定申告書等作成コーナーに入力する(Claude in Chrome)
→ /submit で提出準備を行う
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Income Tax Calculation Results (Reiwa ○)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
■ Income Amount (Comprehensive Taxation)
Business Income: ○○○,○○○ Yen
Salary Income: ○○○,○○○ Yen
Miscellaneous Income: ○○○,○○○ Yen (Only for applicable persons)
Dividend Income: ○○○,○○○ Yen (Comprehensive taxation portion, only for applicable persons)
Temporary Income: ○○○,○○○ Yen (Only for applicable persons)
Total Income Amount: ○○○,○○○ Yen
■ Income Deductions
Social Insurance Premium Deduction: ○○○,○○○ Yen
Life Insurance Premium Deduction: ○○,○○○ Yen
Basic Deduction: 480,000 Yen
[Other Deductions...]
Total Income Deductions: ○○○,○○○ Yen
■ Tax Calculation
Taxable Income Amount: ○○○,○○○ Yen
Calculated Tax Amount: ○○○,○○○ Yen
Tax Credits: ○○,○○○ Yen
Reconstruction Special Income Tax: ○,○○○ Yen
Income Tax and Reconstruction Special Income Tax: ○○○,○○○ Yen
Withholding Tax Amount: ○○○,○○○ Yen
Estimated Tax Payment Amount: ○○,○○○ Yen
---------------------------------
Declared Tax Amount: ○○,○○○ Yen (Payment / Refund)
■ Next Steps:
→ Calculate consumption tax with /consumption-tax
→ Enter into the Final Tax Return Preparation Corner with /e-tax (Claude in Chrome)
→ Prepare for submission with /submit
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━引継書の出力
Output Handover Files
サマリー提示後、以下のファイルを Write ツールで出力する。
これにより、セッションの中断や Compact が発生しても次のステップで結果を引き継げる。
After presenting the summary, output the following files using the Write tool.
This allows results to be carried over to the next step even if the session is interrupted or compacted.
ステップ別ファイルの出力
Output Step-by-Step Files
.shinkoku/progress/07-income-tax.md---
step: 7
skill: income-tax
status: completed
completed_at: "{当日日付 YYYY-MM-DD}"
fiscal_year: {tax_year}
---Output to in the following format:
.shinkoku/progress/07-income-tax.md---
step:7
skill: income-tax
status: completed
completed_at: "{Current date YYYY-MM-DD}"
fiscal_year: {tax_year}
---所得税計算・確定申告書作成の結果
Results of Income Tax Calculation and Final Tax Return Preparation
所得金額の内訳
Breakdown of Income Amount
- 事業所得: {金額}円
- 給与所得: {金額}円
- 雑所得: {金額}円(該当者のみ、仮想通貨含む)
- 配当所得(総合課税): {金額}円(該当者のみ)
- 一時所得: {金額}円(該当者のみ)
- 合計所得金額: {金額}円
- Business Income: {Amount} Yen
- Salary Income: {Amount} Yen
- Miscellaneous Income: {Amount} Yen (Only for applicable persons, including virtual currency)
- Dividend Income (Comprehensive Taxation): {Amount} Yen (Only for applicable persons)
- Temporary Income: {Amount} Yen (Only for applicable persons)
- Total Income Amount: {Amount} Yen
扶養親族・配偶者
Dependent Family Members/Spouse
- 配偶者控除/特別控除: {適用あり(控除額)/適用なし}
- 扶養控除: {適用あり(控除額、人数)/適用なし}
- Spouse Deduction/Special Deduction: {Applicable (deduction amount)/Not applicable}
- Dependent Deduction: {Applicable (deduction amount, number of people)/Not applicable}
iDeCo・小規模企業共済
iDeCo・Small Business Mutual Aid
- 小規模企業共済等掛金控除: {金額}円({iDeCo/小規模企業共済/なし})
- Small Business Mutual Aid Premium Deduction: {Amount} Yen ({iDeCo/Small Business Mutual Aid/None})
医療費控除
Medical Expense Deduction
- 適用: {あり/なし}
- 医療費控除額: {金額}円
- Applicable: {Yes/No}
- Medical Expense Deduction Amount: {Amount} Yen
事業所得の源泉徴収
Withholding Tax on Business Income
- 源泉徴収税額(事業分): {金額}円
- Withholding Tax Amount (Business Portion): {Amount} Yen
損失繰越控除
Loss Carryforward Deduction
- 適用: {あり/なし}
- 繰越損失控除額: {金額}円
- Applicable: {Yes/No}
- Loss Carryforward Deduction Amount: {Amount} Yen
所得控除の内訳
Breakdown of Income Deductions
| 控除項目 | 金額 |
|---|---|
| 基礎控除 | {金額}円 |
| 社会保険料控除 | {金額}円 |
| 生命保険料控除 | {金額}円 |
| 地震保険料控除 | {金額}円 |
| 小規模企業共済等掛金控除 | {金額}円 |
| 医療費控除 | {金額}円 |
| 寄附金控除 | {金額}円 |
| 配偶者控除/特別控除 | {金額}円 |
| 扶養控除 | {金額}円 |
| 障害者控除 | {金額}円 |
| 所得控除合計 | {金額}円 |
| Deduction Item | Amount |
|---|---|
| Basic Deduction | {Amount} Yen |
| Social Insurance Premium Deduction | {Amount} Yen |
| Life Insurance Premium Deduction | {Amount} Yen |
| Earthquake Insurance Premium Deduction | {Amount} Yen |
| Small Business Mutual Aid Premium Deduction | {Amount} Yen |
| Medical Expense Deduction | {Amount} Yen |
| Donation Deduction | {Amount} Yen |
| Spouse Deduction/Special Deduction | {Amount} Yen |
| Dependent Deduction | {Amount} Yen |
| Disabled Person Deduction | {Amount} Yen |
| Total Income Deductions | {Amount} Yen |
税額計算
Tax Calculation
- 課税所得金額: {金額}円
- 算出税額: {金額}円
- 税額控除(住宅ローン控除等): {金額}円
- 復興特別所得税: {金額}円
- 所得税及び復興特別所得税: {金額}円
- 源泉徴収税額(給与分): {金額}円
- 源泉徴収税額(事業分): {金額}円
- 予定納税額: {金額}円
- 申告納税額: {金額}円({納付/還付})
- Taxable Income Amount: {Amount} Yen
- Calculated Tax Amount: {Amount} Yen
- Tax Credits (Housing Loan Deduction, etc.): {Amount} Yen
- Reconstruction Special Income Tax: {Amount} Yen
- Income Tax and Reconstruction Special Income Tax: {Amount} Yen
- Withholding Tax Amount (Salary Portion): {Amount} Yen
- Withholding Tax Amount (Business Portion): {Amount} Yen
- Estimated Tax Payment Amount: {Amount} Yen
- Declared Tax Amount: {Amount} Yen ({Payment/Refund})
次のステップ
Next Steps
/consumption-tax で消費税の計算を行う
/e-tax で確定申告書等作成コーナーに入力する(Claude in Chrome)
/submit で提出準備を行う
undefinedCalculate consumption tax with /consumption-tax
Enter into the Final Tax Return Preparation Corner with /e-tax (Claude in Chrome)
Prepare for submission with /submit
undefined進捗サマリーの更新
Update Progress Summary
.shinkoku/progress/progress-summary.md- YAML frontmatter: fiscal_year、last_updated(当日日付)、current_step: income-tax
- テーブル: 全ステップの状態を更新(income-tax を completed に)
- 次のステップの案内を記載
Update (create new if it does not exist):
.shinkoku/progress/progress-summary.md- YAML frontmatter: fiscal_year, last_updated (current date), current_step: income-tax
- Table: Update the status of all steps (set income-tax to completed)
- Describe guidance for next steps
出力後の案内
Guidance After Output
ファイルを出力したらユーザーに以下を伝える:
- 「引継書を に保存しました。セッションが中断しても次のスキルで結果を引き継げます。」
.shinkoku/progress/ - 次のステップの案内
After outputting the files, inform the user of the following:
- "Handover files have been saved to . Results can be carried over to the next skill even if the session is interrupted."
.shinkoku/progress/ - Guidance for next steps
Additional Resources
Additional Resources
Reference Files
Reference Files
詳細なテーブル・パラメータは以下を参照:
- — 確定申告書B様式の各欄の対応
references/form-b-fields.md - — 所得税速算表、配偶者控除テーブル、基礎控除テーブル、住宅ローン限度額、生命保険料控除等
references/deduction-tables.md
For detailed tables and parameters, refer to the following:
- — Correspondence of each column in Final Tax Return Form B
references/form-b-fields.md - — Income tax quick calculation table, spouse deduction table, basic deduction table, housing loan limit, life insurance premium deduction, etc.
references/deduction-tables.md
免責事項
Disclaimer
- この計算は一般的な所得税の計算ロジックに基づく
- 分離課税(株式・FX)は対象外 — 第三表の計算は行わない
- 白色申告(収支内訳書)は対象外
- 不動産所得、譲渡所得(不動産売却等)、退職所得は現時点で未対応
- 最終的な申告内容は税理士等の専門家に確認することを推奨する
- This calculation is based on general income tax calculation logic
- Separate taxation (stocks/FX) is not covered — Calculation for Table 3 is not performed
- White tax return (income and expenditure statement) is not covered
- Real estate income, transfer income (real estate sales, etc.), retirement income are not currently supported
- It is recommended to confirm the final declaration contents with a professional such as a tax accountant