SuperAPI AI Directory

settlement

General & other

View repository

Updated 10-15 20:06

About this skill

Year-End Closing Adjustments and Financial Statement Preparation (Year-End Settlement)

A skill for registering year-end closing adjusting journal entries at the end of the fiscal year and checking the trial balance, profit and loss statement, and balance sheet. It assumes that the entry of daily journal entries has been completed with the journal skill.

Loading Settings (Execute First)

  1. shinkoku.config.yaml Read with the Read tool
  2. If the file does not exist, /setup guide the user to run the skill and exit
  3. Understand the setting values, and convert relative paths to absolute paths based on the CWD:
    • db_path: CLI script's --db-path used for arguments
    • output_dir: Base directory for output such as progress files
    • Each directory: Used when referencing files

Path Resolution Example

config の db_path が ./shinkoku.db、output_dir が ./output で CWD が /home/user/tax-2025/ In the case of:

  • ledger.py trial-balance --db-path /home/user/tax-2025/shinkoku.db --input query.json
  • shinkoku ledger bs --db-path /home/user/tax-2025/shinkoku.db --input query.json

Loading Progress Information

After loading the settings, load the handover file to understand the results of the previous step.

  1. .shinkoku/progress/progress-summary.md Read with the Read tool (if it exists)
  2. Read the following handover documents with the Read tool (if they exist):
    • .shinkoku/progress/04-journal.md
    • .shinkoku/progress/02-assess.md
  3. Use the loaded information in subsequent steps (avoid re-asking the user)
  4. If the file does not exist, skip it and confirm the necessary information directly with the user

Basic Policy

  • Confirm that journal entry input with the journal skill has been completed before starting
  • Check account balances in the trial balance and determine the necessity of year-end closing adjusting journal entries
  • Calculate depreciation based on the rules in references/depreciation-rules.md
  • Always confirm year-end closing adjusting journal entries with the user before registering them
  • Finally, verify that the balance sheet is balanced

Confirmation of Preconditions

Before starting the year-end closing process, confirm the following:

  1. Whether daily journal entries have been completed: Prompt the user to check whether there are any unrecorded transactions
  2. Fiscal year: Confirm the target year (e.g., January 1, 2025 - December 31, 2025)
  3. Type of blue return: 650,000 yen deduction (double-entry bookkeeping + e-Tax/electronic bookkeeping preservation), 550,000 yen deduction (double-entry bookkeeping + paper submission), 100,000 yen deduction (simple bookkeeping)
  4. Confirmation of the previous year's final tax return: Confirm the following from the assess results or the previous year's tax return
    • Whether there is prepaid tax and the amount (advance payment of income tax)
    • Whether there is a carryover deduction for net loss
    • The previous year's ending balance (whether it matches the current year's beginning balance)
    • The previous year's accumulated depreciation (if there are fixed assets)

* If the previous year's data has not been confirmed, first confirm it with the assess skill, or ask the user to present the previous year's final tax return.

0-1. Confirmation and Setting of Beginning Balance

  1. ledger.py ob-list --db-path DB --fiscal-year YEAR Confirm whether the beginning balance has been set with
  2. If not set, confirm the following with the user:
    • Is it the first year of business? (→ No opening balance, skip)
    • Have them present the closing column of the previous year's tax return (the balance sheet in the blue return financial statements)
    • For images/PDFs, read with OCR
  3. The previous year's closing balance is ob-set-batch register in bulk with
  4. After registration,ob-list check the contents with and obtain the user's approval

Step 1: Check the trial balance

ledger.py trial-balance call of

shinkoku ledger trial-balance --db-path DB_PATH --input query.json

Input JSON:

{
  "fiscal_year": 2025
}

Output:

  • accounts: Debit total, credit total, and balance for each account
  • total_debit: Debit total
  • total_credit: Credit total

Check items:

  1. Whether the debit total and credit total match
  2. Whether each account's balance is reasonable (presence of negative balances)
  3. If the following accounts have balances, year-end adjustments are required:
    • Advances paid (1060) → Settle and transfer to the appropriate account
    • Advances received (2060) → Confirm the details and transfer
    • Consumption tax paid in advance (1090) / Consumption tax payable (2070) → Reflect the consumption tax calculation result

Step 2: Register year-end adjustment journal entries

Confirm and process the following year-end adjustment items in order. Each journal entry is ledger.py add-journal --db-path DB_PATH --input journal.json register with.

2-1. Recording depreciation expense

If fixed assets (1100–1160) have balances, record depreciation expense.

Calling the calculation tool:

shinkoku tax calc-depreciation --input depreciation_input.json

For the straight-line method:

{
  "method": "straight_line",
  "acquisition_cost": 300000,
  "useful_life": 4,
  "business_use_ratio": 100,
  "months": 12
}

For the declining-balance method:

{
  "method": "declining_balance",
  "acquisition_cost": 300000,
  "book_value": 200000,
  "useful_life": 4,
  "declining_rate": 500,
  "business_use_ratio": 100,
  "months": 12
}

Registering the journal entry:

借方: 減価償却費(5200) / 貸方: 該当の固定資産科目
金額: 計算された償却額
  • For useful lives, refer to references/depreciation-rules.md
  • If the business use start date is mid-period, calculate on a monthly proration basis
  • For lump-sum depreciable assets (1160), record 1/3 of the acquisition cost (3-year equal depreciation)
  • If there is household allocation, record only the amount multiplied by the business use ratio

2-2. Valuation of inventory

If there is inventory at year-end, record the inventory amount.

Registering inventory data

First, ledger.py list-inventory --db-path DB_PATH --input query.json Check the inventory data already registered with. If not registered, ledger.py set-inventory --db-path DB_PATH --input inventory.json register the beginning and ending inventory amounts with:

{
  "fiscal_year": 2025,
  "detail": {
    "period": "ending",
    "amount": 200000,
    "method": "cost",
    "details": "品目の明細等"
  }
}

Registering inventory journal entries

期末棚卸仕訳:
借方: 棚卸資産(1030) / 貸方: 仕入(5001)  金額: 期末棚卸高

期首棚卸仕訳(翌期首に自動振替する場合の備忘):
借方: 仕入(5001) / 貸方: 棚卸資産(1030)  金額: 期首棚卸高
  • Confirm the year-end inventory quantity and unit price with the user
  • Confirm the valuation method (last purchase cost method, etc.)
  • Calculation of cost of sales: Beginning inventory + Purchases - Ending inventory
  • The registered inventory data is ledger.py pl automatically reflected in and the blue return financial statements PDF

2-3. Recording accrued expenses

Record expenses that have been incurred as of the fiscal year-end but are unpaid.

借方: 該当の費用科目 / 貸方: 未払費用(2031)
  • December rent (if paid the following month)
  • December communication and utility costs
  • Unpaid portion of social insurance premiums

2-4. Recording prepaid expenses

If the following period's portion has already been paid in the current period, transfer it to prepaid expenses.

借方: 前払費用(1041) / 貸方: 該当の費用科目
  • The portion of the annual insurance premium corresponding to the following period
  • The portion of the annual subscription fee corresponding to the following period

2-5. Confirmation of accounts receivable and accounts payable

  • Confirm that the accounts receivable (1010) balance matches the list of uncollected invoices
  • Confirm that the accounts payable (2001) balance matches the list of unpaid suppliers
  • If there are uncollectible accounts receivable, consider transferring them to bad debt expense (5260)

2-6. Confirmation of owner's account

  • Owner's draw (1200): Total of personal use from business funds
  • Owner's contribution (3010): Total of business use from personal funds
  • These are not offset at settlement (they are carried forward to owner's capital at the beginning of the following period)

Step 2.7: Registering the breakdown of rent

If rent is recorded for the business, register the breakdown (attached documentation for the blue return financial statements).

ledger.py add-rent-detail call of

shinkoku ledger add-rent-detail --db-path DB_PATH --input rent.json

Input JSON:

{
  "fiscal_year": 2025,
  "detail": {
    "property_type": "自宅兼事務所",
    "usage": "自宅兼事務所",
    "landlord_name": "賃貸先の名称",
    "landlord_address": "賃貸先の住所",
    "monthly_rent": 100000,
    "annual_rent": 1200000,
    "deposit": 0,
    "business_ratio": 50
  }
}

Check items:

  • If the home is also used as an office, is the business-use ratio set appropriately?
  • Is annual rent = monthly rent × number of months paid correct?
  • If there are multiple properties, register all of them

Step 3: Generating financial statements

After all settlement adjusting entries have been registered, generate the financial statements.

3-1. Confirmation of the profit and loss statement (ledger.py pl)

shinkoku ledger pl --db-path DB_PATH --input query.json

Input JSON:

{
  "fiscal_year": 2025
}

Output:

  • revenue: Breakdown and total of revenue
  • expenses: Breakdown and total of expenses
  • net_income: Net income for the current period (total revenue - total expenses)

Check items:

  • Does the sales amount match the actual results?
  • Are each of the expense accounts reasonable? (Are there any accounts that are abnormally large or small?)
  • Confirm the amount of income before the blue return special deduction

3-2. Confirmation of the balance sheet (ledger.py bs)

shinkoku ledger bs --db-path DB_PATH --input query.json

Input JSON:

{
  "fiscal_year": 2025
}

Output:

  • assets: Breakdown and total of assets
  • liabilities: Breakdown and total of liabilities
  • equity: Breakdown and total of net assets

Check items:

  • Is total assets = total liabilities + total net assets? (Balance check)
  • Do the cash and deposit balances match the actual balances?
  • Is the book value of fixed assets the amount after depreciation?

Step 4: Presenting the settlement results summary

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
決算結果サマリー(令和○年分)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

■ 損益計算書
  売上高:         ○○○,○○○円
  売上原価:       ○○○,○○○円
  経費合計:       ○○○,○○○円
  青色申告特別控除前の所得: ○○○,○○○円

■ 貸借対照表
  資産合計:       ○○○,○○○円
  負債合計:       ○○○,○○○円
  純資産合計:     ○○○,○○○円
  貸借差額:       0円(一致)

■ 決算整理仕訳: N件
  - 減価償却費: ○○○,○○○円
  - 棚卸調整:   ○○○,○○○円
  - 未払計上:   ○○○,○○○円

■ 次のステップ:
  → /income-tax で所得税の計算を行う
  → /consumption-tax で消費税の計算を行う
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Output of the handover document

After presenting the summary, output the following files using the Write tool. This allows the results to be carried over to the next step even if the session is interrupted or compaction occurs.

Output of step-by-step files

.shinkoku/progress/06-settlement.md Output in the following format to:

---
step: 6
skill: settlement
status: completed
completed_at: "{当日日付 YYYY-MM-DD}"
fiscal_year: {tax_year}
---

# 決算整理・決算書作成の結果

## 損益計算書(PL)サマリー

- 売上高: {金額}円
- 売上原価: {金額}円
- 経費合計: {金額}円
- 青色申告特別控除前の所得: {金額}円

## 貸借対照表(BS)サマリー

- 資産合計: {金額}円
- 負債合計: {金額}円
- 純資産合計: {金額}円
- 貸借差額: {金額}円(一致/不一致)

## 決算整理仕訳の一覧

| 内容 | 借方科目 | 貸方科目 | 金額 |
|------|---------|---------|------|
| {減価償却費等} | {科目名} | {科目名} | {金額}円 |
(減価償却、地代家賃按分、棚卸調整、未払計上等を記載)

## 次のステップ

/income-tax で所得税の計算を行う
/consumption-tax で消費税の計算を行う

Updating the progress summary

.shinkoku/progress/progress-summary.md Update (create new if it does not exist):

  • YAML frontmatter: fiscal_year, last_updated (current date), current_step: settlement
  • Table: Update the status of all steps (set settlement to completed)
  • Describe guidance for the next step

Guidance after output

After outputting the file, tell the user the following:

  • "I saved the handover document to .shinkoku/progress/ . Even if the session is interrupted, the results can be carried over to the next skill."
  • Guidance for the next step