Skip to content

Commit 05c88d0

Browse files
karanb192karanb192
authored andcommitted
itr-wala: file Indian ITR (AY 2026-27) with a deterministic tax engine
Agent skill for Claude Code / Codex CLI / Gemini CLI. All tax arithmetic runs in a golden-tested stdlib-Python engine (both regimes, 87A incl. marginal relief, 111A/112A/112/VDA, surcharge caps + marginal relief, 234A/B/C/F); a strict validator rejects unknown keys and PAN-shaped strings and cross-checks totals against Form 16/26AS/AIS. The LLM only extracts, interviews, and explains. 28 golden tests, adversarially verified pre-launch.
0 parents  commit 05c88d0

26 files changed

Lines changed: 4256 additions & 0 deletions

.agents/skills

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../skills

.claude-plugin/marketplace.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "itr-wala",
3+
"owner": {
4+
"name": "Karan Bansal",
5+
"email": "karan@karanbansal.in",
6+
"url": "https://github.com/karanb192"
7+
},
8+
"metadata": {
9+
"description": "itr-wala - file Indian income tax returns from your terminal"
10+
},
11+
"plugins": [
12+
{
13+
"name": "itr-wala",
14+
"description": "File your Indian ITR (AY 2026-27): reads Form 16/AIS, deterministic tax engine for both regimes, reconciles TDS, walks you through the e-filing portal. You always pay/submit/e-verify yourself.",
15+
"source": "./",
16+
"strict": false,
17+
"skills": ["./skills/itr-wala"],
18+
"category": "productivity",
19+
"tags": ["india", "tax", "itr", "finance"]
20+
}
21+
]
22+
}

.claude-plugin/plugin.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
3+
"name": "itr-wala",
4+
"displayName": "ITR Wala",
5+
"description": "File your Indian income tax return (ITR) from your terminal - deterministic tax engine, both regimes, AY 2026-27.",
6+
"author": {
7+
"name": "Karan Bansal",
8+
"url": "https://karanbansal.in"
9+
},
10+
"homepage": "https://github.com/karanb192/itr-wala",
11+
"repository": "https://github.com/karanb192/itr-wala",
12+
"license": "MIT",
13+
"keywords": ["itr", "india", "income-tax", "tax-filing", "form-16", "ais", "regime-comparison"]
14+
}

.github/workflows/tests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
golden-tests:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: ["3.9", "3.12"]
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- name: Run golden test suite
19+
run: python3 skills/itr-wala/scripts/test_tax_engine.py
20+
- name: Run validator test suite
21+
run: python3 skills/itr-wala/scripts/test_validate_income.py
22+
- name: Property fuzz (seeded, deterministic)
23+
run: python3 skills/itr-wala/scripts/fuzz_engine.py --cases 3000 --seed 42
24+
- name: Validate example income.json
25+
run: |
26+
python3 skills/itr-wala/scripts/validate_income.py skills/itr-wala/assets/example-income.json
27+
python3 skills/itr-wala/scripts/tax_engine.py skills/itr-wala/assets/example-income.json > /dev/null

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Never commit anyone's tax documents or generated filings
2+
itr-wala-workspace/
3+
*AIS*
4+
*26AS*
5+
*Form16*
6+
*form16*
7+
*TIS*
8+
*Challan*
9+
*ACK*
10+
*.ack
11+
income.json
12+
computation.json
13+
computation.txt
14+
filing-pack.md
15+
16+
# OS / editor noise
17+
.DS_Store
18+
__pycache__/
19+
*.pyc
20+
.vscode/
21+
.idea/

AGENTS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# itr-wala
2+
3+
Agent skill for filing Indian income tax returns (ITR), FY 2025-26 / AY 2026-27.
4+
5+
- The skill lives at `skills/itr-wala/SKILL.md` (Agent Skills standard -
6+
works in Claude Code, Codex CLI, and Gemini CLI). Codex discovers it
7+
automatically inside this repo via `.agents/skills`.
8+
- All tax arithmetic is done by `skills/itr-wala/scripts/tax_engine.py`
9+
(stdlib-only Python, golden-tested). Agents must never compute tax figures
10+
themselves - see the Iron Rules in SKILL.md.
11+
- Run the test suite before changing the engine:
12+
`python3 skills/itr-wala/scripts/test_tax_engine.py`
13+
- Rates are pinned to AY 2026-27. A new assessment year means updating the
14+
constants block in `tax_engine.py`, the reference docs, and the golden
15+
tests together.

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Contributing
2+
3+
Thanks for wanting to make Indian tax filing less painful. Contributions of every size are welcome, from a typo in a portal note to next year's rate tables. A few rules keep this tool trustworthy; everything else is fair game.
4+
5+
## Ground rules
6+
7+
1. **The engine stays deterministic and dependency-free.** `tax_engine.py` and `validate_income.py` are stdlib-only Python 3.9+. No pip installs, ever. That is what lets anyone run them anywhere and read every line.
8+
2. **Every rupee change ships with a test.** If your PR changes any computed figure, add a golden test to `test_tax_engine.py` with the expected value derived by hand from the statute, and cite the section plus a source link in the PR description. The test comes from the law, never from the engine's own output.
9+
3. **The LLM never does arithmetic.** Everything in `SKILL.md` and `references/` must keep computation inside the scripts. If you find prose that invites the model to calculate anything itself, that is a bug worth an issue on its own.
10+
4. **No real tax data, anywhere.** No real PAN, Aadhaar, names, or figures from an actual return in issues, PRs, or test fixtures. Start from `skills/itr-wala/assets/example-income.json` and change only what you need. The validator rejects PAN-shaped and Aadhaar-shaped strings by design; do not work around it.
11+
12+
## Running the tests
13+
14+
From the repo root:
15+
16+
```bash
17+
python3 skills/itr-wala/scripts/test_tax_engine.py # golden tests, hand-derived expected values
18+
python3 skills/itr-wala/scripts/test_validate_income.py # input validator suite
19+
python3 skills/itr-wala/scripts/fuzz_engine.py # property-based fuzzer (seeded, deterministic)
20+
```
21+
22+
All three must pass. CI runs them on Python 3.9 and 3.12, plus a 3,000-case fuzz sweep, on every push and PR.
23+
24+
## What help is most wanted
25+
26+
- **Wrong-rate or wrong-interest reports.** Top priority in season. Open an issue with a minimal `income.json` repro and what the figure should be, with the section of the Act.
27+
- **Portal walkthrough fixes.** `references/portal-walkthrough.md` rots fastest because the e-filing portal changes without notice. Quote the file and line you are correcting.
28+
- **Coverage gaps.** RSU/ESPP and Schedule FA, the s.112 property indexation option, revised returns, native Windows support. Check the README roadmap before starting something big, and open an issue first for anything that touches the engine.
29+
- **Next year.** When the Finance Act changes rates, the constants block in `tax_engine.py`, the reference docs, and the golden tests all move together in one PR.
30+
31+
## Style
32+
33+
Match what is already there: plain Python, no type-annotation ceremony, comments only where the statute forces something non-obvious. Reference docs are written for an agent to read mid-filing, so keep them terse and factual.

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Karan Bansal
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
Portions of the reference material (portal field notes, AIS SFT-code
16+
classification) are adapted from the MIT-licensed file-itr project
17+
(https://github.com/shivprime94/file-itr), Copyright (c) 2026 file-itr
18+
contributors.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26+
SOFTWARE.

README.md

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# itr-wala
2+
3+
[![tests](https://github.com/karanb192/itr-wala/actions/workflows/tests.yml/badge.svg)](https://github.com/karanb192/itr-wala/actions/workflows/tests.yml)
4+
5+
**File your Indian income tax return from your terminal. No CA, no ₹3,000 fee, no 3 hours on the portal. Every rupee of tax math computed by tested code, not by an LLM.**
6+
7+
**AY 2026-27 deadlines: ITR-1/2 → 31 July 2026 · ITR-3/4 (non-audit) → 31 August 2026.**
8+
9+
```
10+
# Claude Code
11+
/plugin marketplace add karanb192/itr-wala
12+
/plugin install itr-wala@itr-wala
13+
14+
# Or the plain-skill route (Claude by default; also: -s codex, -s gemini, -s all)
15+
curl -fsSL https://raw.githubusercontent.com/karanb192/itr-wala/main/install.sh | bash
16+
```
17+
18+
Prefer not to pipe curl into bash? Good instinct. Clone the repo, read `install.sh` (~80 lines), then run it.
19+
20+
![itr-wala demo: golden tests pass, income validates against document totals, both regimes computed - ₹42,811 found](demo/demo.gif)
21+
22+
Then open your agent and say **"file my ITR"**. Hand it your Form 16 and AIS. It does the rest - except the three things only you should ever do: **pay, submit, e-verify**.
23+
24+
## Why this exists
25+
26+
Every AI-tax demo you saw this season had the same silent flaw: **the model was doing the arithmetic.** LLMs are magnificent at reading a Form 16 and terrible at applying s.87A marginal relief. One transposed digit and your "free filing" costs you a tax notice.
27+
28+
itr-wala splits the work the way it should be split:
29+
30+
| The AI does | Deterministic Python does |
31+
|---|---|
32+
| Reads your Form 16, AIS, broker P&L | Every slab, rebate, surcharge, cess calculation |
33+
| Interviews you for missed deductions | Old vs new regime comparison |
34+
| Explains every number in plain language | 87A marginal relief, 111A/112A/VDA special rates |
35+
| Walks you through the portal | 234A/B/C interest, 234F late fee |
36+
| | Schema validation that rejects typo'd inputs |
37+
| | Cross-checks your TDS against 26AS/AIS totals |
38+
39+
The math is defended in three layers, all shipped in the repo and run in CI on every commit:
40+
41+
1. **47 golden tests** - every expected value hand-derived from the statute first: the 87A rebate cliff and its marginal relief, capital-gains exemption ordering, s.71 loss set-off, the surcharge tiers (including the exclusive-income tests for the 25%/37% slabs and the 15% ceiling on capital-gains tax), and 234A/B/C/F interest down to the month-counting and challan-date edge cases.
42+
2. **A 104-test suite for the input validator** - the gate that rejects malformed, mistyped, or PAN-bearing inputs before they can reach the engine.
43+
3. **A property-based fuzzer** (`scripts/fuzz_engine.py`) - generates thousands of randomized, boundary-biased returns and asserts invariants the law implies: more income can never mean less tax in the new regime, cess is exactly 4%, rounding follows s.288A/288B, recommendations match the cheaper legal option. Seeded and deterministic; CI replays 3,000 cases on every commit, and 350,000+ were swept before release.
44+
45+
The skill runs the golden suite in front of you before touching your return:
46+
47+
```
48+
$ python3 skills/itr-wala/scripts/test_tax_engine.py
49+
...............................................
50+
Ran 47 tests in 0.002s
51+
OK
52+
```
53+
54+
(Installed as a plugin and can't find the path? Just ask the agent to "run the itr-wala self-test".)
55+
56+
If your CA can show you their test suite, hire them.
57+
58+
These layers exist because they catch real bugs. Hand-deriving every scenario caught an early build that denied surcharge marginal relief on capital-gains-heavy incomes, and the fuzzer caught a one-in-350,000 floating-point rounding edge where ₹52,880 more salary computed ₹10 less tax. Both are fixed and pinned as regression tests. That find-fix-pin loop is the thing a prompt-only tax tool cannot run.
59+
60+
## What a session looks like
61+
62+
1. **Self-test** - the engine proves its math before you trust it.
63+
2. **Documents** - drop Form 16 + AIS (JSON) into a folder; it tells you exactly where to download each one.
64+
3. **Extract & validate** - every number transcribed verbatim into `income.json`, then a strict validator cross-checks totals against your documents. Unknown key? Rejected. TDS doesn't match 26AS? Flagged.
65+
4. **Deduction hunt** - a proactive interview (80C, 80D, NPS, HRA, home loan…), because the portal will never ask you.
66+
5. **Both regimes, computed** - a comparison table with the exact rupee savings. The regime gap is routinely five figures; this table is where it shows up.
67+
6. **Filing pack** - every portal field mapped to its value, in order, plus the final payable/refund figure the portal must match to the rupee.
68+
7. **The portal, together** - it narrates each schedule; you type. It never sees your password or OTP. You alone click Pay, Submit, and e-Verify.
69+
70+
## The artifact you actually share
71+
72+
Real output, reproducible from the bundled (fictional) example - `python3 skills/itr-wala/scripts/tax_engine.py skills/itr-wala/assets/example-income.json`:
73+
74+
```
75+
Income-tax computation - FY 2025-26 (AY 2026-27)
76+
================================================================
77+
[NEW REGIME]
78+
Gross total income 26,06,700
79+
Total income 25,06,700
80+
TOTAL TAX 3,00,350
81+
NET PAYABLE (-ve=refund) 720
82+
83+
[OLD REGIME]
84+
Gross total income 22,09,300
85+
Total income 18,74,300
86+
TOTAL TAX 3,39,730
87+
NET PAYABLE (-ve=refund) 43,530
88+
89+
================================================================
90+
RECOMMENDED: NEW regime (saves Rs. 42,811)
91+
```
92+
93+
## Privacy, honestly
94+
95+
- The **Python scripts run entirely on your machine**. Tax math never leaves.
96+
- Documents you ask the AI to read are **processed by the model** - that part does leave your machine, like anything you paste into an AI tool. The skill tells you this up front and invites you to **redact PAN/Aadhaar/account numbers first**: they're not needed for computation, and that's enforced as a mechanism, not a plea - **the validator rejects any input file containing a PAN-shaped or Aadhaar-shaped string**.
97+
- A generated `.gitignore` keeps tax documents out of your repos.
98+
- Built by someone who [files his own taxes with it](https://karanbansal.in) - and who happens to do security for a living (DEFCON/OWASP speaker, Head of AI at an application-security company).
99+
100+
## What it covers (and refuses)
101+
102+
**In scope (AY 2026-27, resident individuals):** salary (multiple employers, retirement exemptions like gratuity and leave encashment in both regimes), house property including s.71 loss set-off, equity/MF capital gains (111A/112A/112, grandfathering-aware exemption ordering), debt MF, crypto/VDA, lottery and online-game winnings (115BB/115BBJ), interest & dividends, family pension with the s.57(iia) deduction, s.89 arrears relief, presumptive income (44AD/ADA basics), all Chapter VI-A deductions, both regimes, surcharge with marginal relief, advance-tax interest computed to actual challan dates, late fees, belated returns (including the s.115BAC(6) rule that locks belated filers out of the old regime - it will tell you, not let you find out from a notice), ITR-1/2/3/4 form selection.
103+
104+
**Out of scope - it will say so and point you to a CA rather than guess:** non-residents/RNOR, F&O and intraday, audit cases, foreign tax credit (Form 67/DTAA), ESOP deferral, the property indexation option, buyback capital-loss entries, agricultural income above ₹5,000. Partial coverage is computed honestly; the rest is never silently approximated.
105+
106+
**Hard boundaries, always:** never your password or OTP, never clicks Pay/Submit/e-Verify, never fabricates a deduction. Lowest *legal* tax.
107+
108+
## FAQ
109+
110+
**Can I trust an LLM with my taxes?**
111+
No - that's the point. You're trusting a tested Python engine with the math and an LLM with reading PDFs and explaining things, which are the two things each is actually good at. Run the test suite yourself.
112+
113+
**But the LLM still reads the documents - what if it misreads a number?**
114+
True, and worth being precise about: transcription is the one step the model touches, so a misread digit is the residual risk. That's why every figure is cross-checked against *independent* documents (Form 16 vs 26AS vs AIS - a single-document misread fails validation), recorded next to its source citation, and shown to you in the filing pack before anything is filed. If the model misreads and every cross-check misses it, you'll see the wrong number *with its citation* - not a hidden one.
115+
116+
**Why not just use ClearTax/Quicko/a CA?**
117+
Use whatever you trust. This is for people who'd rather review every number themselves than pay ₹3,000+ to hope someone else did. The filing pack it generates is also a great ₹0 first draft to hand a CA for a cheap review.
118+
119+
**Is this allowed?**
120+
Yes. You prepare your own return and file it yourself on the government portal - same as using the portal's own forms, just with better preparation. This tool never submits anything on your behalf.
121+
122+
**What happens next year?**
123+
Rates live in one constants block, pinned to AY 2026-27, with the test suite enforcing them. The skill refuses to compute other years rather than silently using stale slabs. New Finance Act → one PR → tests updated.
124+
125+
**Windows?**
126+
WSL works today; native Windows paths are on the roadmap. macOS and Linux are first-class.
127+
128+
## Install options
129+
130+
| Tool | How |
131+
|---|---|
132+
| Claude Code (recommended - updates with `/plugin marketplace update itr-wala`) | `/plugin marketplace add karanb192/itr-wala``/plugin install itr-wala@itr-wala` |
133+
| Claude Code (plain skill) | `curl -fsSL https://raw.githubusercontent.com/karanb192/itr-wala/main/install.sh \| bash` |
134+
| OpenAI Codex CLI | `… \| bash -s codex` (installs to `~/.agents/skills` + `~/.codex/skills`; invoke with `$itr-wala`) |
135+
| Gemini CLI | `… \| bash -s gemini` |
136+
| Everything | `… \| bash -s all` |
137+
138+
Requirements: `python3` 3.9+ (stdlib only - zero pip installs), `git` for the curl installer.
139+
140+
## Roadmap
141+
142+
- Generate the **offline-utility upload JSON** against the official published schema (upload one file instead of typing 20 schedules)
143+
- RSU/ESPP + Schedule FA depth (the most underserved, highest-anxiety segment)
144+
- Revised-return (s.139(5)) workflow through 31 Mar 2027 - belated returns already work, so this repo doesn't expire on Aug 1
145+
- Native Windows installer · one-click `.skill` bundle for Claude desktop
146+
147+
## Contributing
148+
149+
This is meant to be a community tool. Rates change every Finance Act, portal notes rot mid-season, and edge cases surface all year. PRs and issues are welcome - see [CONTRIBUTING.md](CONTRIBUTING.md). The one hard rule: any change to a tax figure ships with a hand-derived test and its statutory source.
150+
151+
## Found a bug?
152+
153+
It's filing season - bug reports get priority, wrong-rate reports get top priority.
154+
155+
- **Computation bug:** open an issue with a *minimal* `income.json` that reproduces it. Start from `skills/itr-wala/assets/example-income.json` and change only what's needed. **Never paste your real numbers, documents, PAN, or portal screenshots with identifiers.** The validator refuses PAN-shaped strings for exactly this reason.
156+
- **Doc/portal-flow bug:** quote the reference file and line; the portal changes often and field notes rot fastest.
157+
158+
## Credits
159+
160+
- [shivprime94/file-itr](https://github.com/shivprime94/file-itr) (MIT) - the first Indian ITR skill; its hard-won portal field notes and AIS SFT-code research informed our reference docs. This project's thesis is different (deterministic engine + validators + tests vs. pure prompting), but they walked first.
161+
- [robbalian/claude-tax-filing](https://github.com/robbalian/claude-tax-filing) - proved the scripts-not-vibes pattern for US returns.
162+
- [anthropics/skills](https://github.com/anthropics/skills) - the skill-structure conventions this follows.
163+
164+
## License
165+
166+
MIT - see [LICENSE](LICENSE). Reference material adapted from the MIT-licensed [file-itr](https://github.com/shivprime94/file-itr).
167+
168+
## Disclaimer
169+
170+
itr-wala is open-source software, not a chartered accountant, and nothing here is professional tax advice. It computes with tested code and shows you everything, but **you** review, you file, and responsibility for your return stays with you. When in doubt, hand the generated filing pack to a CA - it's built for exactly that.
171+
172+
---
173+
174+
*Found it useful? Send it to the friend who still hasn't filed. ⭐*

demo/demo.gif

352 KB
Loading

0 commit comments

Comments
 (0)