日本の税金計算・確定申告支援 — 所得税・消費税・e-Tax連携
╔══════════════════════════════════════════════════╗
║ ║
║ JP TAX CALC v1.0 ║
║ ║
║ ┌─────────────────────┐ ║
║ │ ┏━━━━━━━━━━━━━┓ │ ║
║ │ ┃ 確 定 申 告 ┃ │ ║
║ │ ┣━━━━━━━━━━━━━┫ │ ║
║ │ ┃ 所得税 ✓ ┃ │ ║
║ │ ┃ 消費税 ✓ ┃ │ ║
║ │ ┃ 法人税 ✓ ┃ │ ║
║ │ ┃ 住民税 ✓ ┃ │ ║
║ │ ┗━━━━━━━━━━━━━┛ │ ║
║ │ 🔢 AI計算 → 📋 e-Tax │ ║
║ └─────────────────────┘ ║
║ ║
║ ─── 税金の悩みをAIが即解決 ─── ║
║ ║
╚══════════════════════════════════════════════════╝
claude-code tax japan 確定申告 calculator
日本の税金計算・確定申告支援エージェント。所得税、消費税、法人税の計算とe-Tax連携。
Author: hanabi-jpn Version: 1.0.0 License: MIT Tags: tax, japan, accounting, e-tax, 確定申告, 消費税
JP Tax Calc handles Japanese tax calculations: income tax (所得税), consumption tax (消費税), corporate tax (法人税), and supports 確定申告 preparation. Built-in knowledge of Japanese tax law updated for 2026.
The following environment variables can be set to extend JP Tax Calc's capabilities. All are optional; the skill works fully offline without them.
| Variable | Description | Required | Default |
|---|---|---|---|
ETAX_API_KEY | e-Tax API key for direct electronic filing (e-Tax 電子申告 API) | Optional | None (manual filing mode) |
MYNUMBER_VERIFY_KEY | MyNumber verification API key for identity validation (マイナンバー照合API) | Optional | None (skip verification) |
FREEE_ACCESS_TOKEN | freee会計 OAuth access token for importing transaction data (freee連携用) | Optional | None (manual input) |
JP_TAX_YEAR | Target tax year for calculations (対象年度). Format: YYYY | Optional | Current year (e.g., 2026) |
Setup example (.env or shell):
export ETAX_API_KEY="etax_live_a1b2c3d4e5f6g7h8i9j0"
export MYNUMBER_VERIFY_KEY="mn_verify_k1l2m3n4o5p6"
export FREEE_ACCESS_TOKEN="freee_at_q1r2s3t4u5v6w7x8y9z0"
export JP_TAX_YEAR="2025" # 令和7年分の確定申告
Note:
ETAX_API_KEYrequires prior registration at e-Tax.FREEE_ACCESS_TOKENis obtained via freee's OAuth 2.0 flow. Tokens should be stored securely and never committed to version control.
When an error occurs, the skill returns a structured error object with a code, message, and suggested resolution. All error codes use the E0xx prefix.
| Code | Error | Description | Resolution |
|---|---|---|---|
E001 | Invalid income amount | The income value is negative, non-numeric, or exceeds the 64-bit integer range | Provide a positive numeric value in yen (e.g., 6000000) |
E002 | Tax year out of range | The specified JP_TAX_YEAR is before 1989 (平成元年) or more than 1 year in the future | Use a year between 1989 and the current year |
E003 | Missing required deduction docs | A deduction was claimed but the supporting document type was not specified | Add --docs flag or specify document evidence for the claimed deduction |
E004 | Invalid MyNumber format | The MyNumber (個人番号) is not a valid 12-digit number or fails the check digit algorithm | Verify the 12-digit MyNumber and re-enter |
E005 | Calculation overflow | The computed tax amount exceeds safe numeric bounds (>= 999,999,999,999 yen) | Split computation or verify input amounts are in yen (not in 万円) |
E006 | Unsupported tax type | The requested tax type is not one of: income, consumption, corporate, furusato | Use a supported tax type; run tax --help for the full list |
E007 | e-Tax API connection failed | The e-Tax API endpoint is unreachable or returned a non-200 status | Check ETAX_API_KEY, network connectivity, and e-Tax maintenance schedule |
E008 | Rate limit exceeded | Too many API requests within the allowed window (e-Tax or freee) | Wait 60 seconds and retry; consider batching requests |
E009 | Invalid deduction JSON | The --deductions JSON argument is malformed or contains unknown keys | Validate JSON syntax; run tax deductions to see valid keys |
E010 | Fiscal year mismatch | The income period does not match the target tax year | Ensure income data aligns with JP_TAX_YEAR setting |
Error response format:
{
"error": true,
"code": "E001",
"message": "Invalid income amount: value must be a positive integer in yen",
"hint": "Provide income as a whole number, e.g., tax income 6000000",
"docs": "https://www.nta.go.jp/taxes/shiraberu/taxanswer/shotoku/1400.htm"
}
You are equipped with JP Tax Calc for Japanese tax calculations and compliance.
JP_TAX_YEAR (default: current year). If the user asks about a different year, warn that rates may differ and switch context accordingly.1. 所得税計算 (Income Tax):
2. 消費税計算 (Consumption Tax):
3. 法人税計算 (Corporate Tax):
4. 確定申告支援:
5. ふるさと納税計算:
tax income <収入額> [--deductions <JSON>] — 所得税計算
tax income simulate <年収> — 年収から手取り概算
tax consumption <課税売上> <課税仕入> — 消費税計算
tax consumption --simplified <売上> <業種> — 簡易課税計算
tax corporate <所得> [--type small|large] — 法人税計算
tax furusato <年収> [--family <構成>] — ふるさと納税上限計算
tax checklist — 確定申告チェックリスト
tax deductions — 適用可能な控除一覧
tax deadline — 申告期限確認
tax compare <income> --blue vs --white — 青色vs白色比較
Below is the end-to-end processing pipeline this skill follows when a user requests a tax calculation. Every step is validated before proceeding to the next.
┌─────────────────────────────────────────────────────────────┐
│ JP Tax Calc Pipeline │
│ │
│ USER INPUT │
│ │ │
│ v │
│ ┌──────────────────────┐ │
│ │ 1. 収入情報の解析 │ 給与/事業/不動産/雑所得を分類 │
│ │ Income Parsing │ │
│ └──────────┬───────────┘ │
│ │ │
│ v │
│ ┌──────────────────────┐ │
│ │ 2. 所得金額の計算 │ 給与所得控除/必要経費を適用 │
│ │ Income Calculation │ │
│ └──────────┬───────────┘ │
│ │ │
│ v │
│ ┌──────────────────────┐ │
│ │ 3. 所得控除の適用 │ 15種類の控除を自動チェック │
│ │ Deductions │ │
│ └──────────┬───────────┘ │
│ │ │
│ v │
│ ┌──────────────────────┐ │
│ │ 4. 課税所得金額 │ 所得金額 - 所得控除 │
│ │ Taxable Income │ │
│ └──────────┬───────────┘ │
│ │ │
│ v │
│ ┌──────────────────────┐ │
│ │ 5. 税額計算 │ 累進税率表を適用 │
│ │ Tax Calculation │ │
│ └──────────┬───────────┘ │
│ │ │
│ v │
│ ┌──────────────────────┐ │
│ │ 6. 税額控除の適用 │ 住宅ローン/配当/外国税額控除 │
│ │ Tax Credits │ │
│ └──────────┬───────────┘ │
│ │ │
│ v │
│ ┌──────────────────────┐ │
│ │ 7. 復興特別所得税 │ 基準所得税額 x 2.1% │
│ │ Reconstruction Tax │ │
│ └──────────┬───────────┘ │
│ │ │
│ v │
│ ┌──────────────────────┐ │
│ │ 8. 住民税概算 │ 課税所得 x 10% + 均等割5,000円 │
│ │ Resident Tax │ │
│ └──────────┬───────────┘ │
│ │ │
│ v │
│ OUTPUT: 税額サマリー + 手取り計算 + 節税提案 │
└─────────────────────────────────────────────────────────────┘
The following table is used in Step 5 above. The agent MUST apply the correct bracket and deduction amount.
| 課税所得金額 | 税率 | 控除額 | 計算例 (課税所得500万円) |
|---|---|---|---|
| 1,000円 ~ 1,949,000円 | 5% | 0円 | -- |
| 1,950,000 ~ 3,299,000円 | 10% | 97,500円 | -- |
| 3,300,000 ~ 6,949,000円 | 20% | 427,500円 | 5,000,000 x 20% - 427,500 |
| 6,950,000 ~ 8,999,000円 | 23% | 636,000円 | -- |
| 9,000,000 ~ 17,999,000円 | 33% | 1,536,000円 | -- |
| 18,000,000 ~ 39,999,000円 | 40% | 2,796,000円 | -- |
| 40,000,000円 ~ | 45% | 4,796,000円 | -- |
Calculation formula: 所得税額 = 課税所得金額 x 税率 - 控除額
Example for 課税所得 5,000,000円:
| 給与収入 | 給与所得控除額 |
|---|---|
| ~ 1,625,000円 | 550,000円 |
| 1,625,001 ~ 1,800,000 | 収入 x 40% - 100,000円 |
| 1,800,001 ~ 3,600,000 | 収入 x 30% + 80,000円 |
| 3,600,001 ~ 6,600,000 | 収入 x 20% + 440,000円 |
| 6,600,001 ~ 8,500,000 | 収入 x 10% + 1,100,000円 |
| 8,500,001 ~ | 1,950,000円 (上限) |
When the user runs tax compare, output the following comparison. Adjust the tax amounts based on the actual income provided.
| 項目 | 青色申告 | 白色申告 |
|---|---|---|
| 特別控除額 | 最大65万円(e-Tax+電子帳簿) | なし |
| 専従者給与 | 全額経費算入可(届出必要) | 最大86万円/50万円 |
| 純損失の繰越 | 3年間繰越可能 | 不可(一部例外あり) |
| 貸倒引当金 | 個別+一括評価可 | 個別評価のみ |
| 少額減価償却資産 | 30万円未満を一括経費化 | 10万円以上は減価償却必要 |
| 記帳義務 | 複式簿記(65万円控除の場合) | 簡易簿記 |
| 決算書 | 貸借対照表 + 損益計算書 | 収支内訳書 |
| 申告の手間 | やや多い(freee等で軽減可) | 少ない |
| 節税効果 (所得500万円) | 約13万円~19.5万円の節税 | 基準(0円) |
| おすすめ対象 | 事業所得がある個人事業主 | 副業で雑所得の方 |
Node for agent: When comparing, always calculate the actual tax difference using the user's income. For example, at taxable income of 5,000,000 yen, the 650,000 yen blue return deduction saves: 650,000 x 20% (marginal rate) = 130,000 yen in income tax + 650,000 x 10% = 65,000 yen in resident tax = total savings of approximately 195,000 yen.
When the user runs tax furusato <年収>, the agent MUST produce output in the following format:
╔══════════════════════════════════════════════════════════════╗
║ ふるさと納税シミュレーション結果 ║
╠══════════════════════════════════════════════════════════════╣
║ 入力情報: ║
║ 年収: 6,000,000円 ║
║ 家族構成: 配偶者あり(配偶者控除対象), 子供1人(16歳以上) ║
║ 社会保険料: 約858,000円(年収の14.3%で概算) ║
║ ║
║ 計算結果: ║
║ ┌──────────────────────────────────────────┐ ║
║ │ 控除上限額(目安): 約 60,000円 │ ║
║ │ 自己負担額: 2,000円 │ ║
║ │ 実質お得額: 58,000円相当の返礼品 │ ║
║ │ 返礼品の価値(30%): 約18,000円分 │ ║
║ └──────────────────────────────────────────┘ ║
║ ║
║ 控除内訳: ║
║ 所得税からの控除: (60,000 - 2,000) x 20% = 11,600円 ║
║ 住民税基本分: (60,000 - 2,000) x 10% = 5,800円 ║
║ 住民税特例分: 60,000 - 2,000 - 11,600 - 5,800 ║
║ = 40,600円 ║
║ ║
║ 注意事項: ║
║ - 上限額は目安です。正確な額は各自治体・税理士に確認を。 ║
║ - ワンストップ特例: 寄附先5自治体以下なら確定申告不要 ║
║ - 確定申告する場合はワンストップ特例は適用不可 ║
╚══════════════════════════════════════════════════════════════╝
Furusato Nozei Deduction Limit Formula:
tax income 6000000 Output:┌─────────────────────────────────────────────┐
│ 所得税計算結果 │
├─────────────────────────────────────────────┤
│ 給与収入: 6,000,000円 │
│ 給与所得控除: -1,640,000円 │
│ 給与所得: 4,360,000円 │
├─────────────────────────────────────────────┤
│ 【所得控除】 │
│ 基礎控除: 480,000円 │
│ 社会保険料控除: 858,000円 (概算) │
│ 控除合計: 1,338,000円 │
├─────────────────────────────────────────────┤
│ 課税所得金額: 3,022,000円 │
│ (1,000円未満切捨て) │
├─────────────────────────────────────────────┤
│ 所得税額: 3,022,000 x 10% - 97,500 │
│ = 204,700円 │
│ 復興特別所得税: 204,700 x 2.1% = 4,298円 │
│ 所得税合計: 208,998円 │
├─────────────────────────────────────────────┤
│ 住民税 (概算): 3,022,000 x 10% + 5,000 │
│ = 307,200円 │
├─────────────────────────────────────────────┤
│ 手取り概算: 4,625,802円 │
│ (収入 - 社保 - 所得税 - 住民税) │
└─────────────────────────────────────────────┘
tax income simulate 6000000 Output:┌─────────────────────────────────────────────────────┐
│ 年収600万円 手取りシミュレーション │
├────────────────┬────────────────────────────────────┤
│ 項目 │ 金額 │
├────────────────┼────────────────────────────────────┤
│ 給与収入 │ 6,000,000円 │
│ 健康保険 │ -294,000円 (4.9%) │
│ 厚生年金 │ -549,000円 (9.15%) │
│ 雇用保険 │ -36,000円 (0.6%) │
│ 所得税 │ -208,998円 │
│ 住民税 │ -307,200円 │
├────────────────┼────────────────────────────────────┤
│ 手取り年額 │ 4,604,802円 │
│ 手取り月額 │ 383,733円 │
├────────────────┼────────────────────────────────────┤
│ 手取り率 │ 76.7% │
└────────────────┴────────────────────────────────────┘
節税ヒント:
- iDeCo (月23,000円) で年間約55,200円の節税
- ふるさと納税で約60,000円分の返礼品を実質2,000円で取得
- 医療費が10万円超なら医療費控除の申請を検討
tax consumption 30000000 18000000 Output:┌───────────────────────────────────────────────────────┐
│ 消費税計算結果 │
├───────────────────────────────────────────────────────┤
│ 【課税売上】 │
│ 課税売上高 (税抜): 30,000,000円 │
│ 売上に係る消費税額: 3,000,000円 (10%) │
│ │
│ 【課税仕入】 │
│ 課税仕入高 (税抜): 18,000,000円 │
│ 仕入に係る消費税額: 1,800,000円 (10%) │
├───────────────────────────────────────────────────────┤
│ 【本則課税 (原則課税方式)】 │
│ 納付税額: 3,000,000 - 1,800,000 = 1,200,000円 │
│ │
│ 【簡易課税との比較】(第5種: サービス業, みなし仕入率50%) │
│ 簡易課税の場合: 3,000,000 x (1 - 50%) = 1,500,000円 │
│ → 本則課税の方が 300,000円 有利 │
│ │
│ 【2割特例との比較】(インボイス経過措置) │
│ 2割特例の場合: 3,000,000 x 20% = 600,000円 │
│ → 2割特例の方が 600,000円 有利 │
│ ※ 適用要件: 免税→課税転換の場合のみ (2026年9月迄) │
├───────────────────────────────────────────────────────┤
│ 【推奨】 │
│ 2割特例が適用可能であれば最も有利です。 │
│ 適用不可の場合は本則課税を選択してください。 │
│ │
│ インボイス登録番号: 要確認 │
│ 申告期限: 2026年3月31日 │
└───────────────────────────────────────────────────────┘
tax corporate 10000000 --type small Output:┌───────────────────────────────────────────────────────┐
│ 法人税計算結果 │
│ (中小法人) │
├───────────────────────────────────────────────────────┤
│ 【法人所得】 │
│ 課税所得金額: 10,000,000円 │
│ 法人区分: 中小法人(資本金1億円以下) │
├───────────────────────────────────────────────────────┤
│ 【法人税額】 │
│ 800万円以下の部分: 8,000,000 x 15.0% = 1,200,000円 │
│ 800万円超の部分: 2,000,000 x 23.2% = 464,000円 │
│ 法人税額合計: 1,664,000円 │
├───────────────────────────────────────────────────────┤
│ 【地方法人税】 │
│ 法人税額 x 10.3%: 1,664,000 x 10.3% = 171,392円 │
├───────────────────────────────────────────────────────┤
│ 【法人事業税】(標準税率) │
│ 400万円以下: 4,000,000 x 3.5% = 140,000円 │
│ 400万超~800万: 4,000,000 x 5.3% = 212,000円 │
│ 800万円超: 2,000,000 x 7.0% = 140,000円 │
│ 事業税合計: 492,000円 │
│ 特別法人事業税: 492,000 x 37% = 182,040円 │
├───────────────────────────────────────────────────────┤
│ 【法人住民税】(東京都特別区の場合) │
│ 法人税割: 1,664,000 x 7.0% = 116,480円 │
│ 均等割: 70,000円 │
│ 住民税合計: 186,480円 │
├───────────────────────────────────────────────────────┤
│ 【税負担サマリー】 │
│ 法人税: 1,664,000円 │
│ 地方法人税: 171,392円 │
│ 法人事業税: 492,000円 │
│ 特別法人事業税: 182,040円 │
│ 法人住民税: 186,480円 │
│ ────────────────────────────── │
│ 税負担合計: 2,695,912円 │
│ 実効税率: 約27.0% │
│ 税引後利益: 7,304,088円 │
├───────────────────────────────────────────────────────┤
│ 💡 個人事業との比較: │
│ 同所得で個人の場合: 所得税+住民税+事業税 ≒ 2,474,000円 │
│ → 法人の方が約22万円多いが、役員報酬の設定次第で逆転可能 │
└───────────────────────────────────────────────────────┘
tax checklist Output:╔═══════════════════════════════════════════════════════════╗
║ 確定申告チェックリスト (2025年分) ║
║ 申告期限: 2026年3月16日 (月) ║
╠═══════════════════════════════════════════════════════════╣
║ ║
║ 【必要書類】 ║
║ ☐ 源泉徴収票 (給与所得者) ║
║ ☐ マイナンバーカード or 通知カード+本人確認書類 ║
║ ☐ 還付先の銀行口座情報 ║
║ ║
║ 【所得関連】 ║
║ ☐ 事業所得: 青色申告決算書 or 収支内訳書 ║
║ ☐ 不動産所得: 不動産収支内訳書 ║
║ ☐ 株式・配当: 年間取引報告書 ║
║ ☐ 雑所得: 収入と経費の明細 ║
║ ║
║ 【控除証明書】 ║
║ ☐ 社会保険料控除証明書 (国民年金・国保) ║
║ ☐ 生命保険料控除証明書 ║
║ ☐ 地震保険料控除証明書 ║
║ ☐ 小規模企業共済等掛金控除証明書 (iDeCo) ║
║ ☐ 住宅ローン残高証明書 (初年度は登記簿等も) ║
║ ☐ 医療費の領収書 or 医療費通知 (10万円超の場合) ║
║ ☐ ふるさと納税 寄附金受領証明書 ║
║ ║
║ 【電子申告 (e-Tax)】 ║
║ ☐ マイナンバーカード + ICカードリーダー or スマホ ║
║ ☐ 利用者識別番号 (初回のみ取得) ║
║ ☐ e-Taxソフト or 確定申告書等作成コーナー ║
║ ║
║ 【注意事項】 ║
║ ⚠ 青色申告65万円控除には e-Tax提出 が必須 ║
║ ⚠ ワンストップ特例を使った場合は確定申告で再申請が必要 ║
║ ⚠ 医療費控除のセルフメディケーション税制は通常と併用不可 ║
║ ║
╚═══════════════════════════════════════════════════════════╝
The agent stores calculation sessions locally for audit trails, year-over-year comparison, and re-use. All data is stored under the user's home directory and is never transmitted externally unless the user explicitly invokes e-Tax or freee API integration.
~/.jp-tax-calc/
├── config.yaml # User profile (family, insurance, employer, prior year data)
├── sessions/
│ ├── 2025-03-15_001.json # Each calculation session is saved with timestamp
│ ├── 2025-03-15_002.json
│ └── 2026-03-01_001.json
├── templates/
│ ├── kakutei_shinkoku.json # 確定申告 template
│ ├── furusato_sim.json # ふるさと納税 simulation template
│ └── consumption_tax.json # 消費税申告 template
├── cache/
│ ├── tax_brackets_2026.json # Current year tax brackets (auto-updated)
│ └── deduction_limits_2026.json # Deduction ceilings for current year
├── exports/
│ ├── etax_2025.xtx # e-Tax形式エクスポート
│ └── csv_2025_income.csv # CSV形式(freee/MFインポート用)
└── logs/
└── error.log # Error log for debugging (rotated monthly)
# ~/.jp-tax-calc/config.yaml
user_profile:
name: "山田太郎"
filing_type: "blue" # blue (青色) or white (白色)
business_type: "個人事業主" # or "会社員", "法人"
industry_code: 3 # 簡易課税みなし仕入率の業種番号 (1-6)