AgentSkillsCN

pit-tax-reporter

在 src/ 中添加或修改报表时,使用此功能来实现并重构波兰个人所得税申报表及其相关的解析与聚合逻辑。同时,也可用于规范经纪商的 CSV/XML 输入、调整汇率的使用与缓存,或更新测试以确保完整报表输出的正确性。

SKILL.md
--- frontmatter
name: pit-tax-reporter
description: Implement and refactor Polish PIT tax reporters and related parsing/aggregation logic. Use when adding or modifying reporters in src/, normalizing broker CSV/XML input, adjusting exchange-rate usage/caching, or updating tests to assert full report outputs.

Pit Tax Reporter

Overview

Build reporter changes safely by preserving tax semantics and verifying full outputs. Use this workflow for IB, IB Flex Query, Schwab, Revolut, Coinbase, Raw, and shared tax models.

Workflow

  1. Confirm target behavior before editing:
  • Expected output is TaxReport and TaxRecord values by year.
  • Required CLI/report table behavior if app flow is touched.
  1. Normalize inputs deterministically:
  • Parse dates, currencies, and numeric values explicitly.
  • Handle malformed rows by dropping/raising consistently.
  1. Keep financial semantics explicit:
  • Preserve FIFO matching and per-year aggregation rules.
  • Keep exchange-rate lookups and cache behavior consistent.
  1. Prefer focused refactors:
  • Reduce duplication without changing external behavior.
  • Keep reporter responsibilities clear and testable.
  1. Test with full-output assertions:
  • Compare full dataframes/tax reports, not selected fields.
  • Mock cross-module dependencies when unit-testing a module.
  1. Run quality gates:
  • uv run pytest -q
  • pre-commit run --all-files

Output Standard

Provide:

  • Behavior summary.
  • Exact files changed.
  • Test evidence (pytest + pre-commit results).
  • Any assumptions or unresolved data-contract questions.

References

Use references/reporter-checklist.md for implementation and testing checks.