DEV Community

Cover image for I Used Claude Code to Build a KYC Spec for Indian Stock Broking ๐Ÿ‡ฎ๐Ÿ‡ณ
Rakesh Waghela
Rakesh Waghela

Posted on

I Used Claude Code to Build a KYC Spec for Indian Stock Broking ๐Ÿ‡ฎ๐Ÿ‡ณ

The Problem ๐Ÿคฏ

If you've ever tried to open a demat account in India, you know the pain โ€” PAN verification, Aadhaar e-KYC, DigiLocker consent, bank penny drop, KRA registration, CKYC upload, eSign... the list goes on.

Now imagine you're the engineer who has to build that system. You're staring at 25+ vendor APIs, 8 regulatory bodies, 454 data fields, and SEBI circulars that change every quarter.

I needed a single source of truth. Something that connects the dots between what the user sees on screen and what happens behind the scenes โ€” the API calls, the batch pipelines, the maker-checker workflows, the exchange registrations.

So I built one. With Claude Code as my co-pilot. ๐Ÿค–

What I Built ๐Ÿ“š

KYC Onboarding Specification โ€” a 57-page technical docs site covering:

  • ๐Ÿ–ฅ๏ธ 9-screen mobile-first user journey โ€” from mobile OTP to eSign in ~6 minutes
  • ๐Ÿ”Œ 25+ vendor integrations โ€” Decentro, Digio, HyperVerge, Leegality, TrackWizz, and more
  • ๐Ÿญ 8 parallel batch pipelines โ€” KRA, CKYC, NSE, BSE, MCX, CDSL, NSDL, Income
  • โœ… Maker-checker admin workflow โ€” because compliance teams don't trust automation (rightly so)
  • ๐Ÿ“‹ 454-field master dataset โ€” every field mapped to its source, validation rule, and destination
  • ๐Ÿ“œ Full SEBI/KRA/CKYC regulatory mapping โ€” current as of Feb 2026

How Claude Code Helped ๐Ÿ› ๏ธ

I didn't write this in Google Docs. I used Claude Code (Anthropic's CLI agent) to research, draft, and iterate on the entire spec.

Here's what that looked like in practice:

Research phase โ€” I'd ask Claude to deep-dive into vendor APIs. "Read the Decentro docs and map their PAN verification response to our field schema." It would search, read, cross-reference, and produce structured tables.

Drafting โ€” Each of the 57 pages went through Claude. I'd describe the screen flow or pipeline step, and Claude would draft the technical spec โ€” field mappings, API sequences, error handling, edge cases. I'd review, correct, iterate.

Regulatory cross-referencing โ€” SEBI circulars are dense. I'd feed Claude the circular text and ask "What does this mean for our KRA upload format?" Getting structured answers saved hours of lawyer-brain parsing.

The docs site itself โ€” Built with Astro Starlight. Claude scaffolded the config, created custom components (screen cards, vendor badges, async bars, status flows), wrote the CSS, and even generated the OG image programmatically.

SEO & distribution โ€” Claude set up JSON-LD structured data, robots.txt, llms.txt, IndexNow submissions to 4 search engines, Wayback Machine archival, and Cloudflare analytics. All from the terminal.

The Tech Stack ๐Ÿ—๏ธ

Layer Tool
Docs framework Astro Starlight
Hosting GitHub Pages
AI co-pilot Claude Code (Opus)
Analytics Cloudflare Web Analytics
Search indexing IndexNow + GSC + Bing + Yandex
Diagrams Hand-crafted SVG

Key Takeaway ๐Ÿ’ก

Building compliance systems is 20% code and 80% understanding the rules. The hardest part isn't the API integration โ€” it's knowing that CKYC search now returns masked numbers (since Jan 2025), or that DDPI replaced POA (since Nov 2022), or that nominee opt-out requires video verification (since Jan 2025).

An AI co-pilot doesn't replace domain expertise. But it compresses the research-to-documentation cycle from weeks to days. I went from "we need a KYC spec" to a fully published 57-page docs site in a fraction of the time it would have taken solo.

Check It Out ๐Ÿ‘€

๐Ÿ”— Live site: javajack.github.io/broking-kyc
๐Ÿ™ GitHub: github.com/javajack/broking-kyc

If you're building fintech in India โ€” especially onboarding, KYC, or compliance systems โ€” I hope this saves you some pain. PRs and feedback welcome.


I'm Rakesh Waghela, a Tech & KYC Solutions Architect. If you're building KYC or compliance systems and want to chat, find me on LinkedIn, X (@webiyo), or book a call on Topmate.

Top comments (0)