joopjs 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,151 @@
1
+ ---
2
+ description: Rules for using joopjs — enterprise financial SDK
3
+ globs: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
4
+ alwaysApply: true
5
+ ---
6
+
7
+ # JoopJS SDK Rules for Cursor
8
+
9
+ **Author:** Kundan Singh
10
+
11
+ This project uses **joopjs** — a framework-agnostic TypeScript SDK for enterprise financial apps. Apply these rules whenever you generate or suggest code that involves joopjs.
12
+
13
+ ## Import Rules
14
+
15
+ Always import from the package root or named sub-paths:
16
+ ```ts
17
+ // Correct
18
+ import { JoopDigitalWalletService, JoopAuthService } from 'joopjs';
19
+ import { JoopGcmService } from 'joopjs/encryption';
20
+
21
+ // Wrong — never import from internal paths
22
+ import { JoopDigitalWalletService } from 'joopjs/src/banking/digital-wallet.service';
23
+ ```
24
+
25
+ Available sub-paths: `auth`, `encryption`, `banking`, `security`, `api`, `core`, `session`, `device`, `observability`, `theme`, `i18n`, `ui`, `forms`, `router`, `state`, `workers`, `workflow`, `sync`, `platform`, `cache`, `network`, `analytics`, `validation`, `utilities`, `pwa`, `native-bridge`, `deeplink`, `react`, `angular`, `vue`, `india`.
26
+
27
+ ## Service Instantiation
28
+
29
+ All services are plain classes with no dependencies:
30
+ ```ts
31
+ const wallet = new JoopDigitalWalletService();
32
+ const auth = new JoopAuthService();
33
+ const loans = new JoopLoanServicingService();
34
+ const gcm = new JoopGcmService();
35
+ ```
36
+
37
+ Create them once at module/app level and share as singletons. No `@Injectable`, no DI container needed.
38
+
39
+ ## Observables — Critical Rules
40
+
41
+ ```ts
42
+ // Subscribe
43
+ const unsub = service.someEvent$().subscribe(value => { /* handler */ });
44
+
45
+ // Emit (from inside a service or your own subject)
46
+ mySubject.next(value); // CORRECT
47
+ mySubject.emit(value); // WRONG — will throw
48
+
49
+ // Read current value (BehaviorSubject only)
50
+ const current = myBehaviorSubject.getValue();
51
+
52
+ // Unsubscribe
53
+ unsub(); // call the returned function — not .unsubscribe()
54
+
55
+ // Do NOT use RxJS operators
56
+ service.alert$().pipe(map(x => x)) // WRONG — not RxJS
57
+ ```
58
+
59
+ ## Data Types
60
+
61
+ - Amounts: `number` (no Money class or BigDecimal)
62
+ - Currencies: ISO-4217 string literal — `'USD'`, `'EUR'`, `'AED'`, `'INR'`
63
+ - Timestamps: Unix epoch milliseconds as `number` — `Date.now()`, never `new Date()`
64
+ - All IDs: `string`
65
+
66
+ ## Error Handling
67
+
68
+ Services throw `Error` objects on invalid operations. Always use try/catch:
69
+ ```ts
70
+ try {
71
+ const result = await service.doSomething();
72
+ } catch (error) {
73
+ console.error(error.message);
74
+ }
75
+ ```
76
+
77
+ ## Reference Formats
78
+
79
+ Auto-generated reference numbers follow predictable patterns:
80
+ - Loans: `LN-YYYY-000001`
81
+ - FX Forwards: `FWD-YYYY-000001`
82
+ - Journal Entries: `JE-YYYY-000001`
83
+ - Standing Orders: `SO-YYYY-000001`
84
+ - Remittances: `RMT-YYYY-000001`
85
+
86
+ ## Framework Integration
87
+
88
+ ### React
89
+ ```tsx
90
+ useEffect(() => {
91
+ const unsub = service.event$().subscribe(handleEvent);
92
+ return unsub; // cleanup on unmount
93
+ }, []);
94
+ ```
95
+
96
+ ### Angular
97
+ ```ts
98
+ // Bridge to RxJS for async pipe
99
+ const myObs$ = new Observable(observer => {
100
+ const unsub = joopSubject.subscribe(v => observer.next(v));
101
+ return () => unsub();
102
+ });
103
+ ```
104
+
105
+ ### Vue
106
+ ```ts
107
+ onMounted(() => { unsub = service.event$().subscribe(handleEvent); });
108
+ onUnmounted(() => unsub?.());
109
+ ```
110
+
111
+ ## Key Services Quick Reference
112
+
113
+ | Use Case | Service | Key Methods |
114
+ |----------|---------|-------------|
115
+ | Digital wallet | `JoopDigitalWalletService` | `createWallet`, `topUp`, `pay`, `transfer`, `getBalance`, `balance$` |
116
+ | Loan management | `JoopLoanServicingService` | `createLoan`, `recordPayment`, `getSchedule`, `getOutstandingBalance` |
117
+ | FX forwards | `JoopFxForwardService` | `setSpotRate`, `createForward`, `settleForward`, `getMarkToMarket` |
118
+ | Mutual funds | `JoopMutualFundService` | `registerFund`, `invest`, `redeem`, `updateNav`, `createSip`, `executeSip` |
119
+ | Sanctions | `JoopSanctionsScreeningService` | `loadList`, `screen`, `hit$` |
120
+ | AML | `JoopAmlService` | `addRule`, `checkTransaction`, `alert$` |
121
+ | Auth | `JoopAuthService` | `login`, `logout`, `refresh`, `getCurrentUser`, `session$` |
122
+ | JWT | `JoopJwtService` | `sign`, `verify`, `decode`, `revoke` |
123
+ | Encryption | `JoopGcmService` | `generateKey`, `encrypt`, `decrypt` |
124
+ | Key exchange | `JoopX25519Service` | `generateKeyPair`, `deriveSharedSecret`, `deriveAesKey` |
125
+ | Double-entry | `JoopLedgerService` | `addAccount`, `postEntry`, `getBalance`, `getTrialBalance` |
126
+ | Reconciliation | `JoopReconciliationService` | `createSession`, `autoMatch`, `manualMatch`, `getSummary` |
127
+
128
+ ---
129
+
130
+ ## What Gets Published to npm
131
+
132
+ Controlled by `"files"` in `package.json` — acts as an allowlist. Only these two are included:
133
+
134
+ | Published to npm | Never published |
135
+ |-----------------|----------------|
136
+ | `dist/` — ESM + CJS + `.d.ts` for all 34 sub-paths | `src/` — TypeScript source |
137
+ | `CHANGELOG.md` — release history | `tests/` — test suite |
138
+ | | `scripts/` — release automation |
139
+ | | `playground/` — Vite demo app |
140
+ | | `.claude/` — Claude skills |
141
+ | | `.cursor/` — these Cursor rules |
142
+ | | `.windsurf/` — Windsurf rules |
143
+ | | `GEMINI.md`, `AGENTS.md` — AI tool instructions |
144
+ | | `tsup.config.ts`, `vitest.config.ts`, `tsconfig.json` |
145
+
146
+ Source code, AI rules, and dev tooling are **never** published to npm.
147
+
148
+ Verify the tarball contents before any publish:
149
+ ```bash
150
+ npm pack --dry-run
151
+ ```
@@ -0,0 +1,141 @@
1
+ # GitHub Copilot Instructions — JoopJS SDK
2
+
3
+ **Author:** Kundan Singh
4
+
5
+ This workspace uses **joopjs** (`npm install joopjs`), a framework-agnostic TypeScript SDK for enterprise financial applications.
6
+
7
+ ## Always Follow These Rules
8
+
9
+ ### Imports
10
+ - Import everything from `'joopjs'` (single entry point), or from sub-paths like `'joopjs/auth'`, `'joopjs/encryption'`
11
+ - Never import from internal paths like `'joopjs/src/...'` or `'joopjs/dist/...'`
12
+
13
+ ### Service instantiation
14
+ - All services are plain classes: `const svc = new JoopXxxService();`
15
+ - No dependency injection or Angular `@Injectable` needed
16
+ - Create one instance per module/app (treat as singletons)
17
+
18
+ ### Reactive observables
19
+ - Use `.subscribe(callback)` — returns an unsubscribe function, call it to stop listening
20
+ - Emit values with `.next(value)` — **never** `.emit(value)`
21
+ - Read current value with `.getValue()` on JoopBehaviorSubject
22
+ - Do NOT use RxJS operators (`.pipe()`, `.map()`, etc.) — these are not RxJS Observables
23
+
24
+ ### Data conventions
25
+ - Amounts: plain `number`, never a Money class
26
+ - Currencies: ISO-4217 string (`'USD'`, `'EUR'`, `'AED'`)
27
+ - Timestamps: Unix epoch milliseconds (`number`), never `Date` objects
28
+ - IDs: pass as `string`
29
+
30
+ ### Error handling
31
+ - All services throw standard `Error` on invalid input
32
+ - Wrap service calls in `try/catch`
33
+
34
+ ---
35
+
36
+ ## Common Completions to Suggest
37
+
38
+ ### Digital Wallet
39
+ ```ts
40
+ import { JoopDigitalWalletService } from 'joopjs';
41
+ const wallet = new JoopDigitalWalletService();
42
+ const w = wallet.createWallet('user-001', { currency: 'USD', label: 'Primary' });
43
+ wallet.topUp(w.id, 500);
44
+ wallet.pay(w.id, 50, 'merchant-id', 'description');
45
+ const bal = wallet.getBalance(w.id);
46
+ wallet.balance$().subscribe(({ walletId, balance }) => { /* update UI */ });
47
+ ```
48
+
49
+ ### Auth + JWT
50
+ ```ts
51
+ import { JoopAuthService, JoopJwtService } from 'joopjs';
52
+ const auth = new JoopAuthService();
53
+ const jwt = new JoopJwtService({ secret: process.env.JWT_SECRET!, expiryMs: 3600_000 });
54
+ const session = await auth.login(email, password);
55
+ const token = jwt.sign({ userId: session.userId, role: 'user' });
56
+ ```
57
+
58
+ ### AES-GCM Encryption
59
+ ```ts
60
+ import { JoopGcmService } from 'joopjs';
61
+ const gcm = new JoopGcmService();
62
+ const key = await gcm.generateKey();
63
+ const enc = await gcm.encrypt(sensitiveData, key);
64
+ const dec = await gcm.decrypt(enc.ciphertext, key, enc.iv);
65
+ ```
66
+
67
+ ### Loan Servicing
68
+ ```ts
69
+ import { JoopLoanServicingService } from 'joopjs';
70
+ const loans = new JoopLoanServicingService();
71
+ const loan = loans.createLoan({ borrowerName, borrowerId, principalAmount, annualInterestRatePercent, tenureMonths, currency: 'USD' });
72
+ loans.recordPayment(loan.id, loan.emiAmount);
73
+ const schedule = loans.getSchedule(loan.id);
74
+ ```
75
+
76
+ ### Sanctions Screening
77
+ ```ts
78
+ import { JoopSanctionsScreeningService } from 'joopjs';
79
+ const sanctions = new JoopSanctionsScreeningService();
80
+ sanctions.loadList('ofac', entities);
81
+ const result = sanctions.screen({ name: customerName, country: customerCountry });
82
+ if (result.status !== 'clear') { /* block or escalate */ }
83
+ ```
84
+
85
+ ### Mutual Fund SIP
86
+ ```ts
87
+ import { JoopMutualFundService } from 'joopjs';
88
+ const mf = new JoopMutualFundService();
89
+ const sip = mf.createSip(fundId, investorId, monthlyAmount, 'monthly', Date.now());
90
+ mf.executeSip(sip.id);
91
+ ```
92
+
93
+ ---
94
+
95
+ ## TypeScript Types (prefix `Joop*`)
96
+
97
+ ```ts
98
+ // Auth
99
+ JoopAuthUser, JoopAuthSession, JoopAuthToken
100
+
101
+ // Banking
102
+ JoopWallet, JoopWalletTransaction, JoopWalletTxnType
103
+ JoopLoanAccount, JoopInstallment, JoopLoanAccountStatus
104
+ JoopFxForward, JoopForwardType, JoopForwardStatus
105
+ JoopLedgerAccount, JoopJournalEntry, JoopTrialBalance
106
+
107
+ // Finance
108
+ JoopMutualFund, JoopFundHolding, JoopSip, JoopSipStatus, JoopFundCategory
109
+
110
+ // Security
111
+ JoopSanctionsEntity, JoopScreeningResult, JoopSanctionMatchType
112
+ JoopAmlAlert, JoopCompliancePolicy
113
+ ```
114
+
115
+ All types are exported from `'joopjs'`.
116
+
117
+ ---
118
+
119
+ ## What Gets Published to npm
120
+
121
+ Controlled by `"files"` in `package.json` — acts as an allowlist. Only these two are included:
122
+
123
+ | Published to npm | Never published |
124
+ |-----------------|----------------|
125
+ | `dist/` — ESM + CJS + `.d.ts` for all 34 sub-paths | `src/` — TypeScript source |
126
+ | `CHANGELOG.md` — release history | `tests/` — test suite |
127
+ | | `scripts/` — release automation |
128
+ | | `playground/` — Vite demo app |
129
+ | | `.claude/` — Claude skills |
130
+ | | `.cursor/` — Cursor rules |
131
+ | | `.windsurf/` — Windsurf rules |
132
+ | | `GEMINI.md`, `AGENTS.md` — AI tool instructions |
133
+ | | `.github/copilot-instructions.md` — this file |
134
+ | | `tsup.config.ts`, `vitest.config.ts`, `tsconfig.json` |
135
+
136
+ Source code, AI rules, and dev tooling are **never** published to npm.
137
+
138
+ Verify the tarball contents before any publish:
139
+ ```bash
140
+ npm pack --dry-run
141
+ ```
@@ -0,0 +1,222 @@
1
+ # JoopJS SDK Rules for Windsurf Cascade
2
+
3
+ **Author:** Kundan Singh
4
+
5
+ This project uses **joopjs** — a framework-agnostic TypeScript SDK for building enterprise financial applications.
6
+
7
+ ## Package Information
8
+
9
+ - **Package name:** `joopjs`
10
+ - **Install:** `npm install joopjs`
11
+ - **Version:** 2.0.0
12
+ - **Compatibility:** Any TypeScript/JavaScript project — React, Angular, Vue, Node.js, plain TS
13
+
14
+ ---
15
+
16
+ ## Core Conventions
17
+
18
+ ### All imports come from `'joopjs'`
19
+
20
+ ```ts
21
+ import {
22
+ JoopAuthService,
23
+ JoopDigitalWalletService,
24
+ JoopLoanServicingService,
25
+ JoopMutualFundService,
26
+ JoopSanctionsScreeningService,
27
+ JoopGcmService,
28
+ JoopX25519Service,
29
+ JoopSubject,
30
+ JoopBehaviorSubject,
31
+ } from 'joopjs';
32
+ ```
33
+
34
+ Or use sub-path imports for tree-shaking: `'joopjs/auth'`, `'joopjs/encryption'`, `'joopjs/banking'`, etc.
35
+
36
+ ### Services are plain class instances
37
+
38
+ ```ts
39
+ // Good
40
+ const wallet = new JoopDigitalWalletService();
41
+
42
+ // Bad — no DI framework needed
43
+ @Injectable() class MyService { constructor(private wallet: JoopDigitalWalletService) {} }
44
+ ```
45
+
46
+ ---
47
+
48
+ ## Reactive Pattern (Non-RxJS)
49
+
50
+ ```ts
51
+ // Subscribe — returns unsubscribe function
52
+ const stop = service.change$().subscribe(value => handleChange(value));
53
+
54
+ // Emit
55
+ subject.next(newValue); // CORRECT
56
+ subject.emit(newValue); // WILL THROW — wrong method name
57
+
58
+ // Cleanup
59
+ stop();
60
+
61
+ // BehaviorSubject current value
62
+ const val = behaviorSubject.getValue();
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Data Types
68
+
69
+ | Concept | Type | Example |
70
+ |---------|------|---------|
71
+ | Money amount | `number` | `5000.00` |
72
+ | Currency | `string` (ISO-4217) | `'USD'`, `'AED'` |
73
+ | Timestamp | `number` (epoch ms) | `Date.now()` |
74
+ | Duration | `number` (ms) | `7 * 86_400_000` |
75
+ | ID | `string` | `'u-001'` |
76
+
77
+ ---
78
+
79
+ ## Domain Services Reference
80
+
81
+ ### Banking
82
+
83
+ ```ts
84
+ // Digital Wallet
85
+ const w = wallet.createWallet(userId, { currency: 'USD' });
86
+ wallet.topUp(w.id, amount);
87
+ wallet.pay(w.id, amount, merchantId, description);
88
+ wallet.transfer(w.id, toWalletId, amount);
89
+ wallet.freeze(w.id) / wallet.unfreeze(w.id) / wallet.close(w.id);
90
+ wallet.balance$().subscribe(({ walletId, balance }) => { });
91
+
92
+ // Loans
93
+ const loan = loans.createLoan({ borrowerName, borrowerId, principalAmount, annualInterestRatePercent, tenureMonths, currency });
94
+ loans.recordPayment(loan.id, amount); // interest-first allocation
95
+ const schedule = loans.getSchedule(loan.id); // JoopInstallment[]
96
+
97
+ // FX Forwards
98
+ fx.setSpotRate('USD', 'EUR', 0.92);
99
+ const fwd = fx.createForward({ type: 'sell', baseCurrency, quoteCurrency, notionalAmount, contractRate, maturityDate });
100
+ fx.settleForward(fwd.id, spotRateAtSettlement); // returns { pnl }
101
+
102
+ // Ledger
103
+ ledger.addAccount(code, name, 'asset' | 'liability' | 'equity' | 'revenue' | 'expense');
104
+ ledger.postEntry(description, [{ accountCode, debit, credit }, ...]);
105
+ ledger.getTrialBalance(); // { isBalanced, totalDebits, totalCredits }
106
+ ```
107
+
108
+ ### Finance
109
+
110
+ ```ts
111
+ // Mutual Funds
112
+ mf.registerFund({ id, name, category: 'equity'|'debt'|'hybrid'|'index'|'etf', currentNav, currency });
113
+ mf.invest(fundId, investorId, amount);
114
+ mf.redeem(fundId, investorId, units);
115
+ const sip = mf.createSip(fundId, investorId, amount, 'monthly'|'weekly'|'quarterly', startDate);
116
+ mf.executeSip(sip.id);
117
+
118
+ // Budget
119
+ budget.createBudget({ name, period: 'monthly', currency, startDate });
120
+ budget.addCategory(budgetId, { name, limit });
121
+ budget.recordSpend(budgetId, categoryId, amount, description);
122
+
123
+ // Portfolio
124
+ portfolio.createPortfolio({ name, currency, userId });
125
+ portfolio.addHolding(portfolioId, { symbol, name, quantity, avgCostPrice, currentPrice, assetClass });
126
+ portfolio.updatePrice(portfolioId, symbol, newPrice);
127
+ ```
128
+
129
+ ### Security
130
+
131
+ ```ts
132
+ // Sanctions Screening
133
+ sanctions.loadList('ofac' | 'un' | 'eu' | 'uk' | 'custom', entities);
134
+ const result = sanctions.screen({ name, country? });
135
+ // result.status: 'clear' | 'hit' | 'review'
136
+ // result.matches[]: [{ entity, matchType: 'exact'|'alias'|'fuzzy', score }]
137
+ sanctions.hit$().subscribe(hit => { }); // only fires on non-clear results
138
+
139
+ // AML
140
+ aml.addRule({ id, name, type, threshold, currency, action: 'flag'|'block', enabled });
141
+ const alert = aml.checkTransaction({ id, amount, currency, type, userId, timestamp });
142
+ // null = passes; JoopAmlAlert = flagged/blocked
143
+
144
+ // Risk Engine
145
+ risk.addFactor({ key, weight, transform? });
146
+ const score = risk.evaluate(signals); // { total: [0-1], level: 'low'|'medium'|'high'|'critical' }
147
+ ```
148
+
149
+ ### Auth & Encryption
150
+
151
+ ```ts
152
+ // Auth
153
+ const session = await auth.login(email, password);
154
+ await auth.logout(session.sessionId);
155
+ auth.session$().subscribe(session => { /* null = logged out */ });
156
+
157
+ // JWT
158
+ const token = jwt.sign({ userId, role }, secret);
159
+ const claims = jwt.verify(token, secret); // null if invalid/expired
160
+
161
+ // AES-GCM
162
+ const key = await gcm.generateKey();
163
+ const { ciphertext, iv } = await gcm.encrypt(plaintext, key);
164
+ const decrypted = await gcm.decrypt(ciphertext, key, iv);
165
+
166
+ // X25519 Key Exchange
167
+ const keys = x25519.generateKeyPair();
168
+ const shared = x25519.deriveSharedSecret(myPrivKey, theirPubKey);
169
+ const aesKey = await x25519.deriveAesKey(shared); // use with gcm.encrypt()
170
+ ```
171
+
172
+ ---
173
+
174
+ ## Error Handling Pattern
175
+
176
+ ```ts
177
+ try {
178
+ const result = loans.createLoan({ ... });
179
+ } catch (err) {
180
+ if (err instanceof Error) {
181
+ // All joopjs errors are standard Error with descriptive messages
182
+ console.error(err.message);
183
+ }
184
+ }
185
+ ```
186
+
187
+ ---
188
+
189
+ ## When Cascade Generates JoopJS Code
190
+
191
+ Always:
192
+ 1. Use `new JoopXxxService()` — no DI
193
+ 2. Call `.next(value)` to emit — never `.emit(value)`
194
+ 3. Use `number` for amounts and timestamps
195
+ 4. Wrap service calls in `try/catch`
196
+ 5. Store the unsubscribe function from `.subscribe()` and call it to clean up
197
+ 6. Use ISO-4217 strings for currency — `'USD'`, not `USD` (no enum)
198
+
199
+ ---
200
+
201
+ ## What Gets Published to npm
202
+
203
+ Controlled by `"files"` in `package.json` — acts as an allowlist. Only these two are included:
204
+
205
+ | Published to npm | Never published |
206
+ |-----------------|----------------|
207
+ | `dist/` — ESM + CJS + `.d.ts` for all 34 sub-paths | `src/` — TypeScript source |
208
+ | `CHANGELOG.md` — release history | `tests/` — test suite |
209
+ | | `scripts/` — release automation |
210
+ | | `playground/` — Vite demo app |
211
+ | | `.claude/` — Claude skills |
212
+ | | `.cursor/` — Cursor rules |
213
+ | | `.windsurf/` — these Windsurf rules |
214
+ | | `GEMINI.md`, `AGENTS.md` — AI tool instructions |
215
+ | | `tsup.config.ts`, `vitest.config.ts`, `tsconfig.json` |
216
+
217
+ Source code, AI rules, and dev tooling are **never** published to npm.
218
+
219
+ Verify the tarball contents before any publish:
220
+ ```bash
221
+ npm pack --dry-run
222
+ ```
package/CHANGELOG.md CHANGED
@@ -8,10 +8,16 @@ Versioning follows [Semantic Versioning](https://semver.org/).
8
8
 
9
9
  ---
10
10
 
11
+ ## [2.0.6] — 2026-06-22
12
+
13
+ ### Changed
14
+ - Release 2.0.6
15
+
11
16
  ## Version History
12
17
 
13
18
  | Version | Codename | New Services | Tests | Total Tests | Sub-paths Added |
14
19
  |---|---|---|---|---|---|
20
+ | [2.0.5](#205--ai-rules-setup) | AI Rules Setup | — | — | **2168** | — |
15
21
  | [2.0.0](#200--vue-composables) | Vue Composables | — | +39 | **1080** | `vue` |
16
22
  | [1.9.0](#190--banking-depth) | Banking Depth | 4 | +100 | **1041** | — |
17
23
  | [1.8.0](#180--framework-bindings) | Framework Bindings | — | +25 | 941 | `react`, `angular` |
@@ -67,6 +73,52 @@ Versioning follows [Semantic Versioning](https://semver.org/).
67
73
 
68
74
  ---
69
75
 
76
+ ## [2.0.5] — AI Rules Setup
77
+
78
+ **0 new services · 0 new tests · 2168 tests total · DX release**
79
+
80
+ ### Added
81
+
82
+ - **`npx joopjs setup-ai`** — one-command AI assistant setup for consumers. Copies joopjs-aware rules into the user's project so that Claude Code, Cursor, Windsurf, GitHub Copilot, Gemini CLI, and Codex all understand the joopjs API out of the box.
83
+
84
+ - **`scripts/setup-ai.mjs`** — the setup script, published as the `joopjs` bin entry. Copies consumer-facing rules from `node_modules/joopjs/` to the correct locations in the user's project. Skips existing files by default; `--force` flag overwrites. Prints a post-install summary with the exact CLAUDE.md skill lines to add.
85
+
86
+ - **`ai-rules/`** — new directory included in the npm package. Contains consumer-only versions of `GEMINI.md` and `AGENTS.md` (usage guide only, no library-dev content).
87
+
88
+ - **Consumer AI rules** included in the npm package for the first time:
89
+ - `.claude/skills/` — 7 consumer skills: `setup`, `banking`, `finance`, `security`, `auth`, `encryption`, `observables`
90
+ - `.cursor/rules/joopjs.mdc` — Cursor rule (auto-applied to all `.ts` / `.tsx` / `.js` files)
91
+ - `.windsurf/rules/joopjs.md` — Windsurf Cascade rule
92
+ - `.github/copilot-instructions.md` — GitHub Copilot instructions
93
+ - `ai-rules/GEMINI.md` — Gemini CLI consumer guide
94
+ - `ai-rules/AGENTS.md` — Codex / OpenAI Agents consumer guide
95
+
96
+ - **Library-dev skills** (not published to npm) — 4 new Claude Code skills for library contributors:
97
+ - `/dev-build` — dev environment, build commands, tsup config, dist structure
98
+ - `/dev-testing` — Vitest commands, test conventions, writing tests for new services
99
+ - `/dev-contributing` — full checklist for adding a service or sub-path, code conventions
100
+ - `/dev-release` — local and CI release flow, preflight checks, CHANGELOG format
101
+
102
+ - **Cursor dev rules** (`.cursor/rules/dev-contributing.mdc`) and **Windsurf dev rules** (`.windsurf/rules/dev-contributing.md`) — development-focused rule files for library contributors using Cursor or Windsurf.
103
+
104
+ - **`GEMINI.md`** and **`AGENTS.md`** at project root — library-dev guides for Gemini CLI and Codex contributors.
105
+
106
+ ### Changed
107
+
108
+ - `package.json` `"files"` — extended to include `ai-rules/`, `scripts/setup-ai.mjs`, the 7 consumer Claude skills, `.cursor/rules/joopjs.mdc`, `.windsurf/rules/joopjs.md`, and `.github/copilot-instructions.md`.
109
+ - `package.json` `"bin"` — added `"joopjs": "scripts/setup-ai.mjs"` enabling `npx joopjs setup-ai`.
110
+ - `README.md` — added **AI Assistant Setup** section immediately after Install; npm badge updated to v2.0.5.
111
+
112
+ ### User workflow
113
+
114
+ ```bash
115
+ npm install joopjs
116
+ npx joopjs setup-ai # first time
117
+ npx joopjs setup-ai --force # after upgrading joopjs
118
+ ```
119
+
120
+ ---
121
+
70
122
  ## [2.0.0] — Vue Composables
71
123
 
72
124
  **0 new core services · 39 new tests · 1080 tests total · 90 test files · 1 new sub-path**
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Enterprise-grade, framework-agnostic TypeScript SDK for financial applications.**
4
4
 
5
- [![npm version](https://img.shields.io/badge/npm-v2.0.2-blue)](https://www.npmjs.com/package/joopjs)
5
+ [![npm version](https://img.shields.io/badge/npm-v2.0.5-blue)](https://www.npmjs.com/package/joopjs)
6
6
  [![license](https://img.shields.io/badge/license-MIT-green)](./LICENSE)
7
7
  [![node](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org)
8
8
  [![tests](https://img.shields.io/badge/tests-2168%20passed-success)](#)
@@ -22,6 +22,7 @@ JoopJS provides 80+ production-ready services covering banking, finance, securit
22
22
  ## Table of Contents
23
23
 
24
24
  - [Install](#install)
25
+ - [AI Assistant Setup](#ai-assistant-setup)
25
26
  - [Quick Start](#quick-start)
26
27
  - [Service Catalogue](#service-catalogue)
27
28
  - [Banking](#banking-26-services)
@@ -60,6 +61,33 @@ No mandatory peer dependencies — React / Angular / Vue bindings are opt-in.
60
61
 
61
62
  ---
62
63
 
64
+ ## AI Assistant Setup
65
+
66
+ JoopJS ships rules for all major AI coding tools. One command sets them up in your project:
67
+
68
+ ```bash
69
+ npx joopjs setup-ai
70
+ ```
71
+
72
+ This copies joopjs-aware rules so that **Claude Code**, **Cursor**, **Windsurf**, **GitHub Copilot**, **Gemini CLI**, and **Codex** all understand the joopjs API — correct imports, service patterns, observable rules, and data types.
73
+
74
+ | Tool | What gets copied |
75
+ |------|-----------------|
76
+ | Claude Code | `.claude/skills/joopjs-*.md` — 7 skills (setup, banking, finance, security, auth, encryption, observables) |
77
+ | Cursor | `.cursor/rules/joopjs.mdc` — auto-applied to all `.ts` / `.tsx` / `.js` files |
78
+ | Windsurf | `.windsurf/rules/joopjs.md` — loaded by Cascade automatically |
79
+ | GitHub Copilot | `.github/copilot-instructions.md` |
80
+ | Gemini CLI | `GEMINI.md` |
81
+ | Codex / OpenAI | `AGENTS.md` |
82
+
83
+ ```bash
84
+ npx joopjs setup-ai --force # overwrite after upgrading joopjs
85
+ ```
86
+
87
+ > **Claude Code users:** after running, the command output shows the exact skill lines to add to your `CLAUDE.md`.
88
+
89
+ ---
90
+
63
91
  ## Quick Start
64
92
 
65
93
  ### 1. Initialise