This skill should be used when the user needs to calculate their income tax (所得税), compute deductions, or import withholding slips. Trigger phrases include: "所得税を計算", "確定申告書を作成", "控除を計算", "源泉徴収票を取り込む", "所得税額", "納付額を計算", "還付額を計算", "第一表", "第二表", "申告書B", "所得控除", "税額控除".
事業所得・各種控除から所得税額を計算するスキル。
settlement スキルで決算書の作成が完了していることを前提とする。
計算結果は /e-tax スキル(Claude in Chrome)で確定申告書等作成コーナーに入力する。
shinkoku.config.yaml を Read ツールで読み込む/setup スキルの実行を案内して終了するdb_path: CLI スクリプトの --db-path 引数に使用output_dir: 進捗ファイル等の出力先ベースディレクトリconfig の db_path が ./shinkoku.db で CWD が /home/user/tax-2025/ の場合:
shinkoku tax calc-income --input /home/user/tax-2025/output/income_input.json設定の読み込み後、引継書ファイルを読み込んで前ステップの結果を把握する。
.shinkoku/progress/progress-summary.md を Read ツールで読み込む(存在する場合).shinkoku/progress/06-settlement.md.shinkoku/progress/02-assess.md.shinkoku/progress/05-furusato.md所得税計算を開始する前に以下を確認する:
uv run shinkoku profile --config {config_path} で config から納税者情報を取得する
所得税計算を開始する前に、以下の項目がすべて確認済みであることを検証する。 config・引継書に記載がない項目は、ユーザーに直接確認してから先に進む。
estimated_tax_payment パラメータに正しい値を設定できるまで進まない給与所得がある場合、源泉徴収票からデータを取り込む。
import_data.py import-withholding の呼び出しshinkoku import import-withholding --input withholding_input.json
入力 JSON:
{
"file_path": "path/to/withholding_slip.pdf"
}
出力:
{
"payer_name": "支払者名",
"payment_amount": 5000000,
"deduction_amount": 3560000,
"income_tax_withheld": 100000,
"social_insurance": 700000,
"life_insurance": 50000,
"spouse_deduction": 0
}
extracted_text が空の場合(画像ファイルまたはスキャン PDF)、画像の読み取りは /reading-withholding スキルを使用する。
スキルの指示に従い、デュアル検証(2つの独立した読み取り結果の照合)を行って結果を取得する。
結果照合: 両方の読み取り結果から payment_amount, withheld_tax, social_insurance を比較する
一致の場合: そのまま採用。「2つの独立した読み取りで結果が一致しました」と報告
不一致の場合: ユーザーに元画像パスと両方の結果を提示し、正しい方を選択してもらう:
取り込み後の検算(必須):
OCR 結果の整合性を検証するため、「所得控除の額の合計額」と各内訳の合計を照合する:
検算: 所得控除の額の合計額 ≟ 社会保険料等の金額 ← 小規模企業共済等掛金を含む(内数)
+ 生命保険料の控除額
+ 地震保険料の控除額
+ 配偶者(特別)控除の額
+ 扶養控除額 ← 人数×単価から算出(特定63万/老人48万or58万/その他38万)
+ 障害者控除 ← 人数×単価から算出(一般27万/特別40万/同居特別75万)
+ 寡婦控除(27万)またはひとり親控除(35万) ← 該当時
+ 勤労学生控除(27万) ← 該当時
+ 基礎控除の額 ← 源泉徴収票の記載額を使用。未記載なら所得と年度から算出
注意:
「(うち小規模企業共済等掛金の額)」は社会保険料等の金額の内数。別途加算すると二重計上になる
扶養控除・障害者控除は金額欄ではなく人数欄で記載されるため、人数×単価で算出する
基礎控除の額は源泉徴収票に記載があればその値を使う。未記載の場合は合計所得と年度に応じて算出する(令和7・8年は特例加算あり、令和9年以降は一律58万)
一致の場合: 各フィールドの OCR 精度が確認できたものとして採用する
不一致の場合: 差額を明示し、どのフィールドが誤読の可能性があるかユーザーに提示する。元画像と突き合わせて修正する
その他の確認事項:
所得控除の計算前に、扶養親族の情報を収集する。 まず DB に登録済みのデータを確認し、不足があれば追加入力する。
ledger.py get-spouse --db-path DB_PATH で配偶者情報を取得する(登録済みの場合)ledger.py list-dependents --db-path DB_PATH で扶養親族のリストを取得する(登録済みの場合)配偶者: 配偶者の有無と年間所得金額を確認する
ledger.py set-spouse --db-path DB_PATH --input spouse.json で DB に登録する扶養親族: 以下の情報を収集する
ledger.py add-dependent --db-path DB_PATH --input dependent.json で各人を DB に登録するマイナンバーの収集(申告書B第二表に記載が必要):
事業専従者の確認:
障害者控除: 扶養親族に障害がある場合
重要: 16歳未満の扶養親族も必ず登録する
16歳未満の子供は扶養控除の対象外だが、以下の理由で申告書への記載が必要:
ledger.py add-dependent で登録する際、16歳未満でもスキップせずに登録すること。
掛金払込証明書がある場合は import_data.py import-deduction-certificate で取り込むことができる。
extracted_text が空の場合(画像ファイルまたはスキャン PDF)、画像の読み取りは /reading-deduction-cert スキルを使用する。
スキルの指示に従い、デュアル検証(2つの独立した読み取り結果の照合)を行って結果を取得する。
結果照合: 両方の読み取り結果から annual_premium, certificate_type を比較する
一致の場合: そのまま採用。「2つの独立した読み取りで結果が一致しました」と報告
不一致の場合: ユーザーに元画像パスと両方の結果を提示し、正しい方を選択してもらう:
医療費控除を適用する場合、明細を集計する。
ledger.py list-medical-expenses --db-path DB_PATH --input query.json で登録済み医療費明細を取得するledger.py add-medical-expense --db-path DB_PATH --input medical.json で登録する:
{
"fiscal_year": 2025,
"detail": {
"date": "2025-03-15",
"patient_name": "山田太郎",
"medical_institution": "ABC病院",
"amount": 150000,
"insurance_reimbursement": 0,
"description": null
}
}
取引先から受け取った支払調書の情報を登録する。
import_data.py import-payment-statement --input payment_input.json で支払調書PDF/画像からデータを抽出するextracted_text が空の場合(画像ファイルまたはスキャン PDF)、画像の読み取りは /reading-payment-statement スキルを使用する。
スキルの指示に従い、デュアル検証(2つの独立した読み取り結果の照合)を行って結果を取得する。
結果照合: 両方の読み取り結果から gross_amount, withholding_tax, payer_name を比較する
一致の場合: そのまま採用。「2つの独立した読み取りで結果が一致しました」と報告
不一致の場合: ユーザーに元画像パスと両方の結果を提示し、正しい方を選択してもらう:
ledger.py add-business-withholding --db-path DB_PATH --input withholding.json で取引先別の源泉徴収情報を登録する:
{
"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 として所得税計算に使用する税理士・弁護士等に報酬を支払っている場合、報酬明細を登録する。
ledger.py list-professional-fees --db-path DB_PATH --input query.json で登録済みの税理士等報酬を確認するledger.py add-professional-fee --db-path DB_PATH --input fee.json で登録する:
{
"fiscal_year": 2025,
"detail": {
"payer_address": "支払者住所",
"payer_name": "税理士名",
"fee_amount": 300000,
"expense_deduction": 0,
"withheld_tax": 30630
}
}
business_withheld_tax に合算する前年以前に事業で損失が発生し、青色申告している場合、繰越控除を適用できる。
ledger.py list-loss-carryforward --db-path DB_PATH --input query.json で登録済みの繰越損失を確認するledger.py add-loss-carryforward --db-path DB_PATH --input loss.json で登録する:
{
"fiscal_year": 2025,
"detail": {
"loss_year": 2023,
"amount": 500000
}
}
loss_carryforward_amount として所得税計算に使用する事業所得・給与所得以外の総合課税の所得を確認・登録する。
公的年金等の収入がある場合、年金控除を計算して雑所得を求める。
uv run shinkoku tax calc-pension --input pension_input.json で公的年金等控除を計算する:
uv run shinkoku tax calc-pension --input pension_input.json
入力 JSON:
{
"pension_income": 2000000,
"is_over_65": true,
"other_income": 0
}
出力:
{
"pension_income": 2000000,
"deduction_amount": 1100000,
"taxable_pension_income": 900000,
"other_income_adjustment": 0
}
taxable_pension_income を雑所得として misc_income に加算する退職金を受け取った場合、退職所得を計算する。
uv run shinkoku tax calc-retirement --input retirement_input.json で退職所得を計算する:
uv run shinkoku tax calc-retirement --input retirement_input.json
入力 JSON:
{
"severance_pay": 10000000,
"years_of_service": 20,
"is_officer": false,
"is_disability_retirement": false
}
出力:
{
"severance_pay": 10000000,
"retirement_income_deduction": 8000000,
"taxable_retirement_income": 1000000,
"half_taxation_applied": true
}
副業の原稿料、暗号資産の売却益、その他の雑収入。
ledger.py list-other-income --db-path DB_PATH --input query.json で登録済み雑所得を確認するledger.py add-other-income --db-path DB_PATH --input other_income.json で登録する:
{
"fiscal_year": 2025,
"detail": {
"income_type": "miscellaneous",
"description": "収入の内容",
"revenue": 500000,
"expenses": 50000,
"withheld_tax": 51050,
"payer_name": "支払者名"
}
}
暗号資産の売却益は雑所得(総合課税)として申告する。
ledger.py list-crypto-income --db-path DB_PATH --input query.json で登録済み仮想通貨所得を確認するledger.py add-crypto-income --db-path DB_PATH --input crypto.json で取引所別に登録する:
{
"fiscal_year": 2025,
"detail": {
"exchange_name": "取引所名",
"gains": 300000,
"expenses": 10000
}
}
総合課税を選択した配当は配当控除(税額控除)の対象となる。
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 で登録する保険満期金、懸賞金等の一時的な所得。
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 で登録するcalc_income_tax への反映上記のその他所得は以下のパラメータで calc_income_tax に渡す:
misc_income: 雑所得合計(仮想通貨含む)dividend_income_comprehensive: 配当所得(総合課税選択分)one_time_income: 一時所得の収入金額(1/2 計算は内部で実施)other_income_withheld_tax: その他所得の源泉徴収税額合計分離課税(株式・FX の第三表)は対象外。該当する場合は税理士への相談を案内する。
所得控除の内訳書に種別ごとの記載が必要なため、社会保険料を種別別に登録する。
社会保険料の控除証明書がある場合は 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.json で種別ごとに登録する:
{
"fiscal_year": 2025,
"detail": {
"insurance_type": "national_health",
"name": "保険者名",
"amount": 300000
}
}
insurance_type: national_health / national_pension / national_pension_fund / nursing_care / labor_insurance / othersocial_insurance として控除計算に使用する所得控除の内訳書に保険会社名の記載が必要なため、保険契約を登録する。
控除証明書の画像・PDFがある場合は import_data.py import-deduction-certificate で取り込むことができる。
取り込み後、抽出データに基づいて ledger.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.json で登録する:
{
"fiscal_year": 2025,
"detail": {
"policy_type": "life_general_new",
"company_name": "保険会社名",
"premium": 80000
}
}
policy_type: life_general_new / life_general_old / life_medical_care / life_annuity_new / life_annuity_old / earthquake / old_long_termlife_insurance_detail パラメータに、地震保険料は earthquake_insurance_premium に反映する政治活動寄附金、認定NPO法人、公益社団法人等への寄附金を確認する。
ledger.py list-donations --db-path DB_PATH --input query.json で登録済み寄附金を確認するledger.py add-donation --db-path DB_PATH --input donation.json で登録する:
{
"fiscal_year": 2025,
"detail": {
"donation_type": "npo",
"recipient_name": "寄附先名",
"amount": 50000,
"date": "2025-06-01",
"receipt_number": null
}
}
donation_type: political / npo / public_interest / specified / othercalc_deductions の donations パラメータに寄附金レコードのリストを渡すtax_calc.py calc-deductions の呼び出しshinkoku tax calc-deductions --input deductions_input.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):
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)tax_credits: 税額控除の一覧(housing_loan_credit, political_donation_credit, npo_donation_credit)total_income_deductions: 所得控除合計total_tax_credits: 税額控除合計各控除の確認事項:
life_insurance_detail パラメータで5区分の保険料を指定:
general_new: 一般(新制度)、general_old: 一般(旧制度)medical_care: 介護医療(新制度のみ)annuity_new: 個人年金(新制度)、annuity_old: 個人年金(旧制度)old_long_term_insurance_premium パラメータで旧長期損害保険料を指定可能small_business_mutual_aid パラメータで小規模企業共済掛金を指定tax_calc.py calc-income の呼び出しshinkoku tax calc-income --input income_input.json
入力 JSON (IncomeTaxInput):
{
"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: 所得控除合計taxable_income: 課税所得金額(1,000円未満切り捨て)income_tax_base: 算出税額total_tax_credits: 税額控除合計income_tax_after_credits: 税額控除後reconstruction_tax: 復興特別所得税(基準所得税額 x 2.1%)total_tax: 所得税及び復興特別所得税の額(端数処理なし)withheld_tax: 源泉徴収税額(給与分)business_withheld_tax: 事業所得の源泉徴収税額estimated_tax_payment: 予定納税額loss_carryforward_applied: 適用した繰越損失額tax_due: 申告納税額(= total_tax - withheld_tax - business_withheld_tax - estimated_tax_payment)寄附金控除の反映:
ふるさと納税以外の寄附金控除(ステップ1.14で登録)は、calc_deductions の結果に含まれている。
calc_income_tax は内部で calc_deductions を呼び出すため、以下のパラメータが正しく渡されていれば自動的に反映される:
furusato_nozei: ふるさと納税の寄附金合計calc_deductions の donations パラメータ経由で計算される所得税計算前に calc_deductions を個別に呼び出す場合は、donations パラメータにステップ1.14で登録した寄附金レコードのリストを必ず渡すこと。
青色申告特別控除の自動キャップ:
blue_return_deduction は config の値をそのまま渡してよい。計算エンジンが事業利益を上限として自動キャップする(租特法25条の2)。
結果の effective_blue_return_deduction と warnings を必ず確認すること。
計算結果の確認:
effective_blue_return_deduction を確認し、自動調整があれば warnings の内容を表示する所得税の速算表・配偶者控除テーブル・住宅ローン限度額等は references/deduction-tables.md を参照。
calc-income の結果を自動検証する。このステップはスキップ不可。
tax_calc.py sanity-check の呼び出しshinkoku tax sanity-check --input sanity_input.json
入力 JSON:
{
"input": { ... },
"result": { ... }
}
input: ステップ3で calc-income に渡した IncomeTaxInputresult: ステップ3で calc-income から返された IncomeTaxResult出力 (TaxSanityCheckResult):
passed: true/falseitems: チェック項目のリスト(severity, code, message)error_count: エラー件数warning_count: 警告件数住宅ローン控除(初年度)を適用する場合、詳細情報を DB に登録する。
ledger.py add-housing-loan-detail --db-path DB_PATH --input housing.json で住宅ローン控除の明細を登録する:
{
"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, // 不動産番号(13桁)を入力すると登記事項証明書の添付省略可(令和3年度改正)
"application_submitted": false
}
}
住宅区分別の年末残高上限テーブルは references/deduction-tables.md を参照。
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
所得税の計算結果(令和○年分)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
■ 所得金額(総合課税)
事業所得: ○○○,○○○円
給与所得: ○○○,○○○円
雑所得: ○○○,○○○円(該当者のみ)
配当所得: ○○○,○○○円(総合課税分、該当者のみ)
一時所得: ○○○,○○○円(該当者のみ)
合計所得金額: ○○○,○○○円
■ 所得控除
社会保険料控除: ○○○,○○○円
生命保険料控除: ○○,○○○円
基礎控除: 480,000円
[その他の控除...]
所得控除合計: ○○○,○○○円
■ 税額計算
課税所得金額: ○○○,○○○円
算出税額: ○○○,○○○円
税額控除: ○○,○○○円
復興特別所得税: ○,○○○円
所得税及び復興特別所得税: ○○○,○○○円
源泉徴収税額: ○○○,○○○円
予定納税額: ○○,○○○円
---------------------------------
申告納税額: ○○,○○○円(納付 / 還付)
■ 次のステップ:
→ /consumption-tax で消費税の計算を行う
→ /e-tax で確定申告書等作成コーナーに入力する(Claude in Chrome)
→ /submit で提出準備を行う
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
サマリー提示後、以下のファイルを Write ツールで出力する。 これにより、セッションの中断や Compact が発生しても次のステップで結果を引き継げる。
.shinkoku/progress/07-income-tax.md に以下の形式で出力する:
---