income-tax
Original:🇨🇳 Chinese
Translated
This skill should be used when users need to calculate their income tax, compute deductions, or import withholding slips. Trigger phrases include: "Calculate income tax", "Prepare final tax return", "Compute deductions", "Import withholding slip", "Income tax amount", "Calculate payment amount", "Calculate refund amount", "Table 1", "Table 2", "Tax Return Form B", "Income deduction", "Tax credit"
12installs
Sourcekazukinagata/shinkoku
Added on
NPX Install
npx skill4agent add kazukinagata/shinkoku income-taxTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Income Tax Calculation
A 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-taxLoad Settings (Run First)
- 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
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
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
- 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
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)
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
Step 1: Import Withholding Slips
If there is salary income, import data from withholding slips.
Call import_data.py import-withholding
import_data.py import-withholdingbash
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
}For Image Files: OCR Reading
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
Step 1.5: Confirm Dependent Family Member/Spouse Information
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.
Load from DB
- 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
-
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-dependentStep 1.6: Confirm iDeCo・Small Business Mutual Aid
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
For Image Files: OCR Reading
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
Step 1.7: Aggregate Medical Expense Details
If applying for medical expense deduction, aggregate the details.
Register and Aggregate Medical Expenses
- 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
Step 1.8: Withholding Tax on Business Income (Payment Statement)
Register information from payment statements received from business partners.
Import Payment Statements
- Extract data from payment statement PDFs/images using
import_data.py import-payment-statement --input payment_input.json
For Image Files: OCR Reading
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
Step 1.8.5: Register Fees for Tax Accountants, Etc.
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
Step 1.9: Confirm Loss Carryforward
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
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.
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
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 Income
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)
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)
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
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
Reflection in calc_income_tax
calc_income_taxPass 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
Step 1.11: (Not Covered) Separate Taxation
Separate taxation (Table 3 for stocks/FX) is not covered. If applicable, guide the user to consult a tax accountant.
Step 1.12: Register Breakdown of Social Insurance Premiums by Type
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
Step 1.13: Register Insurance Company Names for Insurance Policies
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
Step 1.14: Confirm Donations Other than Furusato Nozei
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
Step 2: Calculate Income Deductions
Call tax_calc.py calc-deductions
tax_calc.py calc-deductionsbash
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)
Step 3: Calculate Income Tax Amount
Call tax_calc.py calc-income
tax_calc.py calc-incomebash
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.mdStep 3.1: Sanity Check (Mandatory)
Automatically verify the results of . This step cannot be skipped.
calc-incomeCall tax_calc.py sanity-check
tax_calc.py sanity-checkbash
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: 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
Step 3.5: Register Housing Loan Deduction Details in DB (Only for Applicable Persons)
If 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.mdStep 6: Present Calculation Result Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
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
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
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・Small Business Mutual Aid
- 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
Calculate consumption tax with /consumption-tax
Enter into the Final Tax Return Preparation Corner with /e-tax (Claude in Chrome)
Prepare for submission with /submitUpdate Progress Summary
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
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
Reference Files
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
- 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