# karanb192/itr-wala architecture

> Architecture diagram of the GitHub repository karanb192/itr-wala, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/karanb192/itr-wala
- Repository: https://github.com/karanb192/itr-wala

## Overview

#### Purpose and Entry Points
itr-wala is a local-first AI-agent skill for preparing Indian resident individual income-tax returns for FY 2025-26 / AY 2026-27. The agent reads and interviews; deterministic Python validates inputs and calculates tax. Main entry points are installation via `install.sh`, skill instructions in `skills/itr-wala/SKILL.md`, and direct execution of `skills/itr-wala/scripts/tax_engine.py` against an income JSON file.

#### Skill-Orchestrated Filing Workflow
The skill defines the human/agent workflow: self-test, collect Form 16/AIS/26AS data, transcribe into a structured return, validate and reconcile it, calculate both tax regimes, then create a reviewable portal-filing pack. The agent is explicitly bounded from handling passwords/OTPs or performing Pay, Submit, or e-Verify actions.
Paths: `skills/itr-wala/SKILL.md`, `skills/itr-wala/references/portal-walkthrough.md`, `skills/itr-wala/references/form-selector.md`.

#### Structured Income Contract and Privacy Gate
Income is represented as a strict JSON schema rather than free-form LLM output. The validator rejects unknown or malformed fields and PAN/Aadhaar-shaped values, preventing sensitive identifiers and typoed data from reaching computation. Example data provides the executable input contract.
Paths: `skills/itr-wala/scripts/validate_income.py`, `skills/itr-wala/scripts/ais_schema.py`, `skills/itr-wala/assets/example-income.json`.

#### Document Extraction and Reconciliation Boundary
Document-derived data enters through dedicated local scripts: AIS/TIS extraction and decryption, 26AS archive parsing, and optional redaction/blind-copy workflows. This is the trust boundary between model-assisted transcription/source documents and the canonical income JSON. Validation cross-checks reported totals, especially TDS, against independent sources before calculation.
Paths: `skills/itr-wala/scripts/decrypt_ais.py`, `skills/itr-wala/scripts/extract_tis.py`, `skills/itr-wala/scripts/parse_26as.py`.

#### Deterministic Tax Computation Core
The central engine computes gross/total income, deductions, old-versus-new regime results, special-rate income, rebates and marginal relief, surcharge, cess, interest, fees, TDS adjustments, and final payable/refund. It is pinned to the supported assessment year and is intended to read JSON and emit results locally to stdout, with no third-party Python dependencies or remote tax service.
Paths: `skills/itr-wala/scripts/tax_engine.py`, `skills/itr-wala/references/rates-fy2025-26.md`, `skills/itr-wala/references/capital-gains.md`.

#### Correctness Assurance
Tax-law arithmetic is protected by hand-derived golden tests, validator tests, extraction tests, and a deterministic boundary-biased property fuzzer. The engine self-test is a required workflow stage before processing a return; GitHub Actions runs the suite on commits.
Paths: `skills/itr-wala/scripts/test_tax_engine.py`, `skills/itr-wala/scripts/fuzz_engine.py`, `.github/workflows/tests.yml`.

#### Distribution and Runtime Integration
`install.sh` copies the reviewed skill into Claude, Codex, Gemini, or cross-agent skill directories; it supports global/project scope and controlled fetch/pinning when not run from a checkout. Python 3.9+ and shell tooling are the material runtime dependencies. Claude plugin metadata enables marketplace installation; skills.sh is an optional external distribution channel.
Paths: `install.sh`, `.claude-plugin/plugin.json`, `.agents/skills`.

Main entry points: [`skills/itr-wala/SKILL.md`](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/SKILL.md) (ITR-Wala Skill), [`skills/itr-wala/scripts/validate_income.py`](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/validate_income.py) (Income Validator), [`skills/itr-wala/scripts/tax_engine.py`](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/tax_engine.py) (Tax Engine), [`skills/itr-wala/assets/example-income.json`](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/assets/example-income.json) (Canonical Income JSON)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Agent Workflow"]
  node_skill["ITR-Wala Skill<br/>agent instructions<br/>[SKILL.md]"]
  node_portal_pack["Portal Filing Pack<br/>review output"]
  node_form_selector["ITR Form Selection<br/>filing reference<br/>[form-selector.md]"]
end

subgraph group_ingestion["Local Data Boundary"]
  node_source_documents["Tax Source Documents<br/>local documents"]
  node_extractors["AIS and 26AS Extraction<br/>local parsers<br/>[decrypt_ais.py]"]
  node_tis_extractor["TIS Extractor<br/>local parser<br/>[extract_tis.py]"]
  node_as26_parser["26AS Parser<br/>local parser<br/>[parse_26as.py]"]
  node_income_json["Canonical Income JSON<br/>strict input contract"]
  node_validator["Income Validator<br/>schema validator<br/>[validate_income.py]"]
  node_schema["Income Schema<br/>schema definition<br/>[ais_schema.py]"]
end

subgraph group_engine["Deterministic Tax Core"]
  node_tax_engine{{"Tax Engine<br/>Python computation<br/>[tax_engine.py]"}}
  node_tax_references["Tax Rules References<br/>tax-law data<br/>[rates-fy2025-26.md]"]
  node_results["Tax Results<br/>stdout result"]
end

subgraph group_assurance["Correctness"]
  node_test_suite["Golden and Validator Tests<br/>test suite<br/>[test_tax_engine.py]"]
  node_fuzzer["Boundary Property Fuzzer<br/>property testing<br/>[fuzz_engine.py]"]
  node_ci["GitHub Actions<br/>CI workflow<br/>[tests.yml]"]
end

subgraph group_distribution["Distribution"]
  node_installer["Installer<br/>[install.sh]"]
  node_plugin["Claude Plugin Metadata<br/>plugin manifest<br/>[plugin.json]"]
  node_agent_skills["Cross-Agent Skill Target<br/>skill directory<br/>[skills]"]
end

node_installer -->|"installs"| node_skill
node_installer -->|"targets"| node_agent_skills
node_plugin -.->|"enables marketplace install"| node_skill
node_skill -->|"selects return form"| node_form_selector
node_skill -->|"collects and transcribes"| node_source_documents
node_skill -->|"requires validation"| node_validator
node_skill -->|"prepares"| node_portal_pack
node_source_documents -->|"AIS input"| node_extractors
node_source_documents -->|"TIS input"| node_tis_extractor
node_source_documents -->|"26AS input"| node_as26_parser
node_extractors -->|"document data"| node_income_json
node_tis_extractor -->|"reported totals"| node_income_json
node_as26_parser -->|"independent TDS check"| node_validator
node_schema -->|"defines contract"| node_validator
node_income_json -->|"validates"| node_validator
node_validator -->|"validated income"| node_tax_engine
node_tax_references -->|"rates and gains rules"| node_tax_engine
node_tax_engine -->|"emits locally"| node_results
node_results -->|"drives review"| node_portal_pack
node_test_suite -.->|"verifies arithmetic"| node_tax_engine
node_fuzzer -.->|"probes boundaries"| node_tax_engine
node_ci -->|"runs on commits"| node_test_suite
node_ci -->|"runs on commits"| node_fuzzer

click node_installer "https://github.com/karanb192/itr-wala/blob/main/install.sh"
click node_plugin "https://github.com/karanb192/itr-wala/blob/main/.claude-plugin/plugin.json"
click node_agent_skills "https://github.com/karanb192/itr-wala/blob/main/.agents/skills"
click node_skill "https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/SKILL.md"
click node_portal_pack "https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/references/portal-walkthrough.md"
click node_form_selector "https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/references/form-selector.md"
click node_extractors "https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/decrypt_ais.py"
click node_tis_extractor "https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/extract_tis.py"
click node_as26_parser "https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/parse_26as.py"
click node_income_json "https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/assets/example-income.json"
click node_validator "https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/validate_income.py"
click node_schema "https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/ais_schema.py"
click node_tax_engine "https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/tax_engine.py"
click node_tax_references "https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/references/rates-fy2025-26.md"
click node_test_suite "https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/test_tax_engine.py"
click node_fuzzer "https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/fuzz_engine.py"
click node_ci "https://github.com/karanb192/itr-wala/blob/main/.github/workflows/tests.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_skill,node_portal_pack,node_form_selector toneBlue
class node_source_documents,node_extractors,node_tis_extractor,node_as26_parser,node_income_json,node_validator,node_schema toneAmber
class node_tax_engine,node_tax_references,node_results toneMint
class node_test_suite,node_fuzzer,node_ci toneRose
class node_installer,node_plugin,node_agent_skills toneIndigo
```

## Components

### Agent Workflow

- [ITR-Wala Skill](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/SKILL.md): agent instructions · Orchestrates interview, review, and portal-filing preparation without credentials or submission actions. · `skills/itr-wala/SKILL.md`
- [Portal Filing Pack](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/references/portal-walkthrough.md): review output · Reviewable filing guidance; payment, submission, and e-Verify remain manual. · `skills/itr-wala/references/portal-walkthrough.md`
- [ITR Form Selection](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/references/form-selector.md): filing reference · `skills/itr-wala/references/form-selector.md`

### Local Data Boundary

- **Tax Source Documents**: local documents · Form 16, AIS/TIS, 26AS, and taxpayer-provided records.
- [AIS and 26AS Extraction](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/decrypt_ais.py): local parsers · Decrypts and parses document-derived tax data locally. · `skills/itr-wala/scripts/decrypt_ais.py`
- [TIS Extractor](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/extract_tis.py): local parser · `skills/itr-wala/scripts/extract_tis.py`
- [26AS Parser](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/parse_26as.py): local parser · `skills/itr-wala/scripts/parse_26as.py`
- [Canonical Income JSON](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/assets/example-income.json): strict input contract · Structured, identifier-safe input to validation and computation. · `skills/itr-wala/assets/example-income.json`
- [Income Validator](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/validate_income.py): schema validator · Rejects malformed fields, unknown fields, and PAN/Aadhaar-shaped values; reconciles reported totals. · `skills/itr-wala/scripts/validate_income.py`
- [Income Schema](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/ais_schema.py): schema definition · `skills/itr-wala/scripts/ais_schema.py`

### Deterministic Tax Core

- [Tax Engine](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/tax_engine.py): Python computation · Locally computes both regimes, special rates, relief, tax adjustments, payable amount, or refund. · `skills/itr-wala/scripts/tax_engine.py`
- [Tax Rules References](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/references/rates-fy2025-26.md): tax-law data · FY 2025-26 rates and capital-gains rules supporting the pinned assessment year. · `skills/itr-wala/references/rates-fy2025-26.md`
- **Tax Results**: stdout result · Deterministic calculation output for agent review and filing preparation.

### Correctness

- [Golden and Validator Tests](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/test_tax_engine.py): test suite · Hand-derived engine cases plus validation and extraction coverage. · `skills/itr-wala/scripts/test_tax_engine.py`
- [Boundary Property Fuzzer](https://github.com/karanb192/itr-wala/blob/main/skills/itr-wala/scripts/fuzz_engine.py): property testing · `skills/itr-wala/scripts/fuzz_engine.py`
- [GitHub Actions](https://github.com/karanb192/itr-wala/blob/main/.github/workflows/tests.yml): CI workflow · `.github/workflows/tests.yml`

### Distribution

- [Installer](https://github.com/karanb192/itr-wala/blob/main/install.sh): shell installer · Installs the reviewed skill into supported agent environments. · `install.sh`
- [Claude Plugin Metadata](https://github.com/karanb192/itr-wala/blob/main/.claude-plugin/plugin.json): plugin manifest · `.claude-plugin/plugin.json`
- [Cross-Agent Skill Target](https://github.com/karanb192/itr-wala/blob/main/.agents/skills): skill directory · `.agents/skills`

## Connections

- Installer → ITR-Wala Skill: installs
- Installer → Cross-Agent Skill Target: targets
- Claude Plugin Metadata → ITR-Wala Skill: enables marketplace install
- ITR-Wala Skill → ITR Form Selection: selects return form
- ITR-Wala Skill → Tax Source Documents: collects and transcribes
- ITR-Wala Skill → Income Validator: requires validation
- ITR-Wala Skill → Portal Filing Pack: prepares
- Tax Source Documents → AIS and 26AS Extraction: AIS input
- Tax Source Documents → TIS Extractor: TIS input
- Tax Source Documents → 26AS Parser: 26AS input
- AIS and 26AS Extraction → Canonical Income JSON: document data
- TIS Extractor → Canonical Income JSON: reported totals
- 26AS Parser → Income Validator: independent TDS check
- Income Schema → Income Validator: defines contract
- Canonical Income JSON → Income Validator: validates
- Income Validator → Tax Engine: validated income
- Tax Rules References → Tax Engine: rates and gains rules
- Tax Engine → Tax Results: emits locally
- Tax Results → Portal Filing Pack: drives review
- Golden and Validator Tests → Tax Engine: verifies arithmetic
- Boundary Property Fuzzer → Tax Engine: probes boundaries
- GitHub Actions → Golden and Validator Tests: runs on commits
- GitHub Actions → Boundary Property Fuzzer: runs on commits
