npx skills add https://github.com/kazukinagata/shinkoku --skill income-tax根据业务所得和各种扣除计算所得税额的技能。前提是 settlement 技能已完成决算书的制作。计算结果将输入到 /e-tax 技能(Claude in Chrome)的确定申报书等制作页面。
shinkoku.config.yaml/setup 技能并结束db_path: 用于 CLI 脚本的 --db-path 参数output_dir: 进度文件等的输出目标基础目录当 config 的 db_path 为 ./shinkoku.db 且 CWD 为 时:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
/home/user/tax-2025/shinkoku tax calc-income --input /home/user/tax-2025/output/income_input.json读取设置后,读取交接文件以掌握前一步骤的结果。
.shinkoku/progress/progress-summary.md(如果存在).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-withholdingshinkoku 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 技能进行图像读取。按照技能的指示,进行双重验证(对比两个独立的读取结果)以获取结果。
结果对比: 比较两个读取结果中的 payment_amount, withheld_tax, social_insurance
一致的情况: 直接采用。报告“两个独立的读取结果一致”
不一致的情况: 向用户展示原始图像路径和两个结果,让其选择正确的:
录入后的验算(必须):
为验证 OCR 结果的一致性,核对“所得扣除额的合计额”与各细项的合计:
验算: 所得扣除额的合计额 ≟ 社会保险费等金额 ← 包含小规模企业共济等缴费(内部金额)
+ 生命保险费扣除额
+ 地震保险费扣除额
+ 配偶(特别)扣除额
+ 抚养扣除额 ← 根据人数×单价计算(特定 63 万/老人 48 万或 58 万/其他 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 技能进行图像读取。按照技能的指示,进行双重验证(对比两个独立的读取结果)以获取结果。
结果对比: 比较两个读取结果中的 annual_premium, certificate_type
一致的情况: 直接采用。报告“两个独立的读取结果一致”
不一致的情况: 向用户展示原始图像路径和两个结果,让其选择正确的:
适用医疗费扣除时,汇总明细。
通过 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
}
}
将汇总结果(total_amount - total_reimbursement)用于医疗费扣除的计算
登记从交易方收到的支付证明书的信息。
import_data.py import-payment-statement --input payment_input.json 从支付证明书 PDF/图像中提取数据当 extracted_text 为空时(图像文件或扫描 PDF),使用 /reading-payment-statement 技能进行图像读取。按照技能的指示,进行双重验证(对比两个独立的读取结果)以获取结果。
结果对比: 比较两个读取结果中的 gross_amount, withholding_tax, payer_name
一致的情况: 直接采用。报告“两个独立的读取结果一致”
不一致的情况: 向用户展示原始图像路径和两个结果,让其选择正确的:
通过 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
}
3. 将 taxable_pension_income 作为杂项所得加到 misc_income 中
4. 令和 7 年改正: 65 岁以下的最低保障额 60 万→70 万,65 岁以上的最低保障额 110 万→130 万
如果领取了退职金,则计算退职所得。
确认有无退职金
通过 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
}
3. 退职所得原则上为分离课税(退职时已源泉征收),但有时也会在确定申报时进行精算 4. 干部等的短期退职(连续工作 5 年以下)不适用 1/2 课税
副业的稿费、加密资产的出售收益、其他杂项收入。
通过 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
}
}
将合计作为杂项所得加到 total_income 中
选择综合课税的股息属于股息扣除(税额扣除)的对象。
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 / other
3. 将合计额作为 social_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_term
3. 生命保险费反映到 life_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 / other
3. 捐赠扣除的计算:
* 所得扣除 : 全部捐赠 - 2,000 日元(总所得金额的 40% 上限)
* 税额扣除(政治活动捐赠) : (捐赠 - 2,000 日元) × 30%(所得税额的 25% 上限)
* 税额扣除(认定 NPO 等) : (捐赠 - 2,000 日元) × 40%(所得税额的 25% 上限)
4. 将捐赠记录的列表传递给 calc_deductions 的 donations 参数
tax_calc.py calc-deductionsshinkoku 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-incomeshinkoku 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 时,务必将在步骤 1.14 中登记的捐赠记录列表传递给 donations 参数。
蓝色申报特别扣除的自动上限:
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-checkshinkoku 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。
━━━
事業所得・各種控除から所得税額を計算するスキル。 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
}
}
集計結果(total_amount - total_reimbursement)を医療費控除の計算に使用する
取引先から受け取った支払調書の情報を登録する。
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
}
3. taxable_pension_income を雑所得として misc_income に加算する
4. 令和7年改正: 65歳未満の最低保障額60万→70万、65歳以上の最低保障額110万→130万
退職金を受け取った場合、退職所得を計算する。
退職金の有無を確認する
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
}
3. 退職所得は原則分離課税(退職時に源泉徴収済み)だが、確定申告で精算する場合もある 4. 役員等の短期退職(勤続5年以下)は1/2課税が適用されない
副業の原稿料、暗号資産の売却益、その他の雑収入。
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
}
}
合計を雑所得として total_income に加算する
総合課税を選択した配当は配当控除(税額控除)の対象となる。
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 / other
3. 合計額を social_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_term
3. 生命保険料は life_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 / other
3. 寄附金控除の計算:
* 所得控除 : 全寄附金 - 2,000円(総所得金額の40%上限)
* 税額控除(政治活動寄附金) : (寄附金 - 2,000円) × 30%(所得税額の25%上限)
* 税額控除(認定NPO等) : (寄附金 - 2,000円) × 40%(所得税額の25%上限)
4. calc_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 パラメータで旧長期損害保険料を指定可能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: 所得税及び復興特別所得税の額(端数処理なし)寄附金控除の反映:
ふるさと納税以外の寄附金控除(ステップ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 に以下の形式で出力する:
---
step: 7
skill: income-tax
status: completed
completed_at: "{当日日付 YYYY-MM-DD}"
fiscal_year: {tax_year}
---
# 所得税計算・確定申告書作成の結果
## 所得金額の内訳
- 事業所得: {金額}円
- 給与所得: {金額}円
- 雑所得: {金額}円(該当者のみ、仮想通貨含む)
- 配当所得(総合課税): {金額}円(該当者のみ)
- 一時所得: {金額}円(該当者のみ)
- 合計所得金額: {金額}円
## 扶養親族・配偶者
- 配偶者控除/特別控除: {適用あり(控除額)/適用なし}
- 扶養控除: {適用あり(控除額、人数)/適用なし}
## iDeCo・小規模企業共済
- 小規模企業共済等掛金控除: {金額}円({iDeCo/小規模企業共済/なし})
## 医療費控除
- 適用: {あり/なし}
- 医療費控除額: {金額}円
## 事業所得の源泉徴収
- 源泉徴収税額(事業分): {金額}円
## 損失繰越控除
- 適用: {あり/なし}
- 繰越損失控除額: {金額}円
## 所得控除の内訳
| 控除項目 | 金額 |
|---------|------|
| 基礎控除 | {金額}円 |
| 社会保険料控除 | {金額}円 |
| 生命保険料控除 | {金額}円 |
| 地震保険料控除 | {金額}円 |
| 小規模企業共済等掛金控除 | {金額}円 |
| 医療費控除 | {金額}円 |
| 寄附金控除 | {金額}円 |
| 配偶者控除/特別控除 | {金額}円 |
| 扶養控除 | {金額}円 |
| 障害者控除 | {金額}円 |
| **所得控除合計** | **{金額}円** |
## 税額計算
- 課税所得金額: {金額}円
- 算出税額: {金額}円
- 税額控除(住宅ローン控除等): {金額}円
- 復興特別所得税: {金額}円
- 所得税及び復興特別所得税: {金額}円
- 源泉徴収税額(給与分): {金額}円
- 源泉徴収税額(事業分): {金額}円
- 予定納税額: {金額}円
- **申告納税額: {金額}円({納付/還付})**
## 次のステップ
/consumption-tax で消費税の計算を行う
/e-tax で確定申告書等作成コーナーに入力する(Claude in Chrome)
/submit で提出準備を行う
.shinkoku/progress/progress-summary.md を更新する(存在しない場合は新規作成):
ファイルを出力したらユーザーに以下を伝える:
.shinkoku/progress/ に保存しました。セッションが中断しても次のスキルで結果を引き継げます。」詳細なテーブル・パラメータは以下を参照:
references/form-b-fields.md — 確定申告書B様式の各欄の対応references/deduction-tables.md — 所得税速算表、配偶者控除テーブル、基礎控除テーブル、住宅ローン限度額、生命保険料控除等Weekly Installs
247
Repository
GitHub Stars
323
First Seen
Feb 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex175
cursor173
github-copilot169
opencode169
gemini-cli166
amp166
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
27,400 周安装
small_business_mutual_aid パラメータで小規模企業共済掛金を指定withheld_tax: 源泉徴収税額(給与分)business_withheld_tax: 事業所得の源泉徴収税額estimated_tax_payment: 予定納税額loss_carryforward_applied: 適用した繰越損失額tax_due: 申告納税額(= total_tax - withheld_tax - business_withheld_tax - estimated_tax_payment)