@cashfreepayments/agent-skills 0.0.4 → 0.0.7
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.
- package/README.md +172 -170
- package/dist/config.d.ts +14 -21
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +34 -10
- package/dist/config.js.map +1 -1
- package/dist/generators/utils.d.ts +13 -1
- package/dist/generators/utils.d.ts.map +1 -1
- package/dist/generators/utils.js +40 -5
- package/dist/generators/utils.js.map +1 -1
- package/dist/index.js +126 -76
- package/dist/index.js.map +1 -1
- package/dist/templates/auto-collect-reference.md +309 -0
- package/dist/templates/auto-collect.d.ts +3 -0
- package/dist/templates/auto-collect.d.ts.map +1 -0
- package/dist/templates/auto-collect.js +11 -0
- package/dist/templates/auto-collect.js.map +1 -0
- package/dist/templates/auto-collect.md +286 -0
- package/dist/templates/common-mistakes.d.ts +5 -0
- package/dist/templates/common-mistakes.d.ts.map +1 -0
- package/dist/templates/common-mistakes.js +12 -0
- package/dist/templates/common-mistakes.js.map +1 -0
- package/dist/templates/common-mistakes.md +714 -0
- package/dist/templates/cross-border-reference.md +240 -0
- package/dist/templates/crossBorder.d.ts +1 -0
- package/dist/templates/crossBorder.d.ts.map +1 -1
- package/dist/templates/crossBorder.js +4 -0
- package/dist/templates/crossBorder.js.map +1 -1
- package/dist/templates/crossBorder.md +238 -184
- package/dist/templates/getting-started.d.ts +5 -0
- package/dist/templates/getting-started.d.ts.map +1 -0
- package/dist/templates/getting-started.js +12 -0
- package/dist/templates/getting-started.js.map +1 -0
- package/dist/templates/getting-started.md +167 -0
- package/dist/templates/manifest.d.ts +9 -0
- package/dist/templates/manifest.d.ts.map +1 -0
- package/dist/templates/manifest.js +67 -0
- package/dist/templates/manifest.js.map +1 -0
- package/dist/templates/migrate-from-juspay-reference.md +563 -0
- package/dist/templates/migrate-from-juspay.d.ts +3 -0
- package/dist/templates/migrate-from-juspay.d.ts.map +1 -0
- package/dist/templates/migrate-from-juspay.js +11 -0
- package/dist/templates/migrate-from-juspay.js.map +1 -0
- package/dist/templates/migrate-from-juspay.md +490 -0
- package/dist/templates/migrate-from-razorpay-reference.md +530 -0
- package/dist/templates/migrate-from-razorpay.d.ts +3 -0
- package/dist/templates/migrate-from-razorpay.d.ts.map +1 -0
- package/dist/templates/migrate-from-razorpay.js +11 -0
- package/dist/templates/migrate-from-razorpay.js.map +1 -0
- package/dist/templates/migrate-from-razorpay.md +437 -0
- package/dist/templates/payment-modes.d.ts +5 -0
- package/dist/templates/payment-modes.d.ts.map +1 -0
- package/dist/templates/payment-modes.js +12 -0
- package/dist/templates/payment-modes.js.map +1 -0
- package/dist/templates/payment-modes.md +73 -0
- package/dist/templates/payouts-reference.md +408 -0
- package/dist/templates/payouts.d.ts +1 -0
- package/dist/templates/payouts.d.ts.map +1 -1
- package/dist/templates/payouts.js +4 -0
- package/dist/templates/payouts.js.map +1 -1
- package/dist/templates/payouts.md +147 -232
- package/dist/templates/pg/api-reference.md +470 -0
- package/dist/templates/pg/api.md +261 -0
- package/dist/templates/pg/disputes-reference.md +451 -0
- package/dist/templates/pg/disputes.md +270 -0
- package/dist/templates/pg/easy-split-reference.md +370 -0
- package/dist/templates/pg/easy-split.md +246 -0
- package/dist/templates/pg/go-live-reference.md +192 -0
- package/dist/templates/pg/go-live.md +301 -0
- package/dist/templates/pg/mobile-reference.md +592 -0
- package/dist/templates/pg/mobile.md +232 -0
- package/dist/templates/pg/offers-reference.md +320 -0
- package/dist/templates/pg/offers.md +279 -0
- package/dist/templates/pg/payment-links-reference.md +343 -0
- package/dist/templates/pg/payment-links.md +271 -0
- package/dist/templates/pg/refunds-reference.md +379 -0
- package/dist/templates/pg/refunds.md +239 -0
- package/dist/templates/pg/sdk-reference.md +485 -0
- package/dist/templates/pg/sdk.md +399 -0
- package/dist/templates/pg/token-vault-reference.md +331 -0
- package/dist/templates/pg/token-vault.md +250 -0
- package/dist/templates/pg/web-sdk-reference.md +399 -0
- package/dist/templates/pg/web-sdk.md +294 -0
- package/dist/templates/pg/webhooks-reference.md +297 -0
- package/dist/templates/pg/webhooks.md +399 -0
- package/dist/templates/pg-overview.d.ts +5 -0
- package/dist/templates/pg-overview.d.ts.map +1 -0
- package/dist/templates/pg-overview.js +12 -0
- package/dist/templates/pg-overview.js.map +1 -0
- package/dist/templates/pg-overview.md +35 -0
- package/dist/templates/pg.d.ts +24 -4
- package/dist/templates/pg.d.ts.map +1 -1
- package/dist/templates/pg.js +71 -6
- package/dist/templates/pg.js.map +1 -1
- package/dist/templates/secure-id-reference.md +415 -0
- package/dist/templates/secure-id.d.ts +1 -0
- package/dist/templates/secure-id.d.ts.map +1 -1
- package/dist/templates/secure-id.js +4 -0
- package/dist/templates/secure-id.js.map +1 -1
- package/dist/templates/secure-id.md +200 -173
- package/dist/templates/settlements-and-reconciliation-reference.md +420 -0
- package/dist/templates/settlements-and-reconciliation.d.ts +3 -0
- package/dist/templates/settlements-and-reconciliation.d.ts.map +1 -0
- package/dist/templates/settlements-and-reconciliation.js +11 -0
- package/dist/templates/settlements-and-reconciliation.js.map +1 -0
- package/dist/templates/settlements-and-reconciliation.md +270 -0
- package/dist/templates/subscriptions-reference.md +361 -0
- package/dist/templates/subscriptions.d.ts +1 -0
- package/dist/templates/subscriptions.d.ts.map +1 -1
- package/dist/templates/subscriptions.js +4 -0
- package/dist/templates/subscriptions.js.map +1 -1
- package/dist/templates/subscriptions.md +229 -109
- package/dist/templates/validation-and-testing.d.ts +5 -0
- package/dist/templates/validation-and-testing.d.ts.map +1 -0
- package/dist/templates/validation-and-testing.js +12 -0
- package/dist/templates/validation-and-testing.js.map +1 -0
- package/dist/templates/validation-and-testing.md +351 -0
- package/package.json +5 -4
- package/dist/templates/pg.md +0 -501
package/README.md
CHANGED
|
@@ -1,214 +1,216 @@
|
|
|
1
1
|
# Cashfree Agent Skills CLI
|
|
2
2
|
|
|
3
|
-
Add Cashfree Payments
|
|
3
|
+
Add Cashfree Payments skills to your AI coding assistant projects — everything in one command.
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
9
|
-
npx @cashfreepayments/agent-skills add pg
|
|
10
|
-
|
|
11
|
-
# Add Secure ID skills
|
|
12
|
-
npx @cashfreepayments/agent-skills add secure-id
|
|
13
|
-
|
|
14
|
-
# Add Subscriptions skills
|
|
15
|
-
npx @cashfreepayments/agent-skills add subscriptions
|
|
16
|
-
|
|
17
|
-
# Add Cross Border skills
|
|
18
|
-
npx @cashfreepayments/agent-skills add cross-border
|
|
19
|
-
|
|
20
|
-
# Add Payouts skills
|
|
21
|
-
npx @cashfreepayments/agent-skills add payouts
|
|
8
|
+
npx @cashfreepayments/agent-skills add skills
|
|
22
9
|
```
|
|
23
10
|
|
|
24
|
-

|
|
25
12
|
|
|
26
|
-
This will prompt you to select which AI coding assistants to configure
|
|
27
|
-
- **Cursor** - Creates `.cursor/skills/cashfree/<product>.md`
|
|
28
|
-
- **Claude Code** - Creates `.claude/skills/cashfree/<product>.md`
|
|
29
|
-
- **OpenCode** - Creates `.opencode/skills/cashfree/<product>.md`
|
|
30
|
-
- **VS Code Copilot** - Creates `.github/skills/cashfree/<product>.md`
|
|
31
|
-
- **Gemini CLI** - Creates `.gemini/skills/cashfree/<product>.md`
|
|
32
|
-
- **Antigravity** - Creates `.agent/skills/cashfree/<product>.md`
|
|
33
|
-
- **GitHub Copilot CLI** - Creates `.github/skills/cashfree/<product>.md`
|
|
34
|
-
- **OpenAI Codex CLI** - Creates `.codex/skills/cashfree/<product>.md`
|
|
13
|
+
This will prompt you to select which AI coding assistants to configure.
|
|
35
14
|
|
|
36
|
-
##
|
|
37
|
-
|
|
38
|
-
### Payment Gateway (PG)
|
|
39
|
-
Payment gateway integration, order creation, refunds, payment links, and webhooks.
|
|
15
|
+
## Usage
|
|
40
16
|
|
|
17
|
+
### Interactive Mode
|
|
41
18
|
```bash
|
|
42
|
-
npx @cashfreepayments/agent-skills add
|
|
19
|
+
npx @cashfreepayments/agent-skills add skills
|
|
43
20
|
```
|
|
21
|
+
You'll be prompted to select which AI assistants to configure.
|
|
44
22
|
|
|
45
|
-
###
|
|
46
|
-
Bank account verification, penny drop, UPI verification, and settlement reconciliation.
|
|
47
|
-
|
|
23
|
+
### Specify Frameworks
|
|
48
24
|
```bash
|
|
49
|
-
npx @cashfreepayments/agent-skills add
|
|
25
|
+
npx @cashfreepayments/agent-skills add skills --frameworks cursor,claude-code,gemini-cli
|
|
50
26
|
```
|
|
51
27
|
|
|
52
|
-
###
|
|
53
|
-
Recurring payments, subscription plans, authorization, and customer management.
|
|
54
|
-
|
|
28
|
+
### Custom Project Path
|
|
55
29
|
```bash
|
|
56
|
-
npx @cashfreepayments/agent-skills add
|
|
30
|
+
npx @cashfreepayments/agent-skills add skills --path /path/to/project
|
|
57
31
|
```
|
|
58
32
|
|
|
59
|
-
|
|
60
|
-
International payments, currency conversion, and cross-border transactions.
|
|
33
|
+
## What Gets Created
|
|
61
34
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
35
|
+
A single command creates all skill files + a manifest for each selected framework.
|
|
36
|
+
|
|
37
|
+
### Skills Directory Structure
|
|
38
|
+
|
|
39
|
+
Each skill is split into two files: **SKILL.md** (core happy path) and **references/REFERENCE.md** (advanced topics, full API reference, additional code examples). The AI reads SKILL.md first and pulls from REFERENCE.md only when deeper detail is needed.
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
cashfree-skills/
|
|
43
|
+
├── getting-started/
|
|
44
|
+
│ └── SKILL.md ← Setup, auth, environment config
|
|
45
|
+
├── eligible-payment-modes/
|
|
46
|
+
│ └── SKILL.md ← Check enabled payment modes for a merchant
|
|
47
|
+
├── pg/
|
|
48
|
+
│ ├── SKILL.md ← Payment Gateway overview & sub-skill index
|
|
49
|
+
│ ├── apis/
|
|
50
|
+
│ │ ├── SKILL.md ← S2S REST API integration (core flow)
|
|
51
|
+
│ │ └── references/REFERENCE.md ← Full endpoint map, idempotency, edge cases
|
|
52
|
+
│ ├── backend-sdks/
|
|
53
|
+
│ │ ├── SKILL.md ← Backend SDK (Node.js, Python, Java, Go)
|
|
54
|
+
│ │ └── references/REFERENCE.md ← Refunds, settlements, pre-auth, S2S, token vault, .NET TLS fix
|
|
55
|
+
│ ├── mobile-sdks/
|
|
56
|
+
│ │ ├── SKILL.md ← Mobile SDKs (Android, iOS, React Native, Flutter, Cordova)
|
|
57
|
+
│ │ └── references/REFERENCE.md ← Per-platform payment status verification, all SDK options
|
|
58
|
+
│ ├── webhooks/
|
|
59
|
+
│ │ ├── SKILL.md ← Webhook setup, signature verification, event bifurcation
|
|
60
|
+
│ │ └── references/REFERENCE.md ← Full webhook payload schemas for all event types
|
|
61
|
+
│ ├── go-live/
|
|
62
|
+
│ │ ├── SKILL.md ← Production checklist & go-live steps
|
|
63
|
+
│ │ └── references/REFERENCE.md ← Advanced production config & compliance details
|
|
64
|
+
│ ├── refunds/
|
|
65
|
+
│ │ ├── SKILL.md ← Refunds lifecycle, INSTANT vs STANDARD, partial/multi-refunds
|
|
66
|
+
│ │ └── references/REFERENCE.md ← Full schema, eligibility, per-language SDK code, troubleshooting
|
|
67
|
+
│ ├── disputes/
|
|
68
|
+
│ │ ├── SKILL.md ← Dispute lifecycle, accept/contest, evidence, SLAs
|
|
69
|
+
│ │ └── references/REFERENCE.md ← 24 status values, reason codes, evidence limits, per-language code
|
|
70
|
+
│ ├── payment-links/
|
|
71
|
+
│ │ ├── SKILL.md ← Hosted payment URLs, partial payments, auto-reminders
|
|
72
|
+
│ │ └── references/REFERENCE.md ← Full schema, PAYMENT_LINK_EVENT, per-language SDK code
|
|
73
|
+
│ ├── token-vault/
|
|
74
|
+
│ │ ├── SKILL.md ← RBI card tokenization, saved cards, CoF, cryptograms
|
|
75
|
+
│ │ └── references/REFERENCE.md ← Instrument + cryptogram schemas, network behaviour
|
|
76
|
+
│ ├── web-sdk/
|
|
77
|
+
│ │ ├── SKILL.md ← Cashfree.js v3 — Drop-in, Elements, SPA wiring
|
|
78
|
+
│ │ └── references/REFERENCE.md ← Full API, per-framework (React/Vue/Next/Angular), CSP
|
|
79
|
+
│ ├── easy-split/
|
|
80
|
+
│ │ ├── SKILL.md ← Marketplace splits, vendor management, static vs dynamic
|
|
81
|
+
│ │ └── references/REFERENCE.md ← Vendor KYC schema, on-demand transfer, vendor recon
|
|
82
|
+
│ └── offers/
|
|
83
|
+
│ ├── SKILL.md ← Bank/BIN offers, discounts, cashback, no-cost EMI recipe
|
|
84
|
+
│ └── references/REFERENCE.md ← payment_method filter variants, stacking rules, tenure table
|
|
85
|
+
├── secure-id/
|
|
86
|
+
│ ├── SKILL.md ← Bank account verification, PAN, GSTIN, DigiLocker
|
|
87
|
+
│ └── references/REFERENCE.md ← All 39+ API endpoints, webhook payloads, frontend SDKs
|
|
88
|
+
├── subscriptions/
|
|
89
|
+
│ ├── SKILL.md ← Recurring payments, plans, mandates, charge lifecycle
|
|
90
|
+
│ └── references/REFERENCE.md ← Cut-off timelines, mobile SDKs, full webhook payloads
|
|
91
|
+
├── cross-border/
|
|
92
|
+
│ ├── SKILL.md ← International payments & currency conversion (core flow)
|
|
93
|
+
│ └── references/REFERENCE.md ← Verification parameters, order tags, full webhook payloads
|
|
94
|
+
├── payouts/
|
|
95
|
+
│ ├── SKILL.md ← Bulk payouts, disbursements, beneficiary management
|
|
96
|
+
│ └── references/REFERENCE.md ← 2FA RSA setup, batch transfers, V1 APIs, all webhook payloads
|
|
97
|
+
├── settlements-and-reconciliation/
|
|
98
|
+
│ ├── SKILL.md ← Settlement cycle, recon APIs, UTR matching, finance ops
|
|
99
|
+
│ └── references/REFERENCE.md ← Full recon row schema, event types, sample Python reconciler
|
|
100
|
+
├── auto-collect/
|
|
101
|
+
│ ├── SKILL.md ← Virtual bank accounts, static UPI VPAs, QR codes
|
|
102
|
+
│ └── references/REFERENCE.md ← VBA schema, bank rails (Axis/ICICI/Yes), credit webhook
|
|
103
|
+
├── migrate-from-razorpay/
|
|
104
|
+
│ ├── SKILL.md ← Razorpay → Cashfree migration: concept map, 7-step cutover, code diffs
|
|
105
|
+
│ └── references/REFERENCE.md ← Endpoint map, per-language SDK rewrites, webhook payload diff, RazorpayX → Payouts
|
|
106
|
+
├── migrate-from-juspay/
|
|
107
|
+
│ ├── SKILL.md ← Juspay → Cashfree migration: orchestrator exit, session/payment_session mapping, webhook/status rewrites
|
|
108
|
+
│ └── references/REFERENCE.md ← Endpoint map, field diffs, mobile/mandate mapping, orchestrator feature checklist
|
|
109
|
+
├── validation-and-testing/
|
|
110
|
+
│ └── SKILL.md ← Post-integration validation & testing
|
|
111
|
+
└── common-mistakes/
|
|
112
|
+
└── SKILL.md ← Debugging guide: signature mismatches, IP whitelisting, mobile SDK errors, rate limits, go-live checklist
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Framework-Specific Locations
|
|
116
|
+
|
|
117
|
+
| Framework | Skills Location | Manifest File |
|
|
118
|
+
|-----------|----------------|---------------|
|
|
119
|
+
| Claude Code | `.claude/skills/cashfree-skills/` | `CLAUDE.md` (project root) |
|
|
120
|
+
| Cursor | `.cursor/cashfree-skills/` | `.cursor/rules/cashfree.mdc` |
|
|
121
|
+
| OpenCode | `.opencode/skills/cashfree-skills/` | `AGENTS.md` (project root) |
|
|
122
|
+
| VS Code Copilot | `.github/skills/cashfree-skills/` | `.github/copilot-instructions.md` |
|
|
123
|
+
| Gemini CLI | `.gemini/skills/cashfree-skills/` | `GEMINI.md` (project root) |
|
|
124
|
+
| Antigravity | `.agent/skills/cashfree-skills/` | `AGENTS.md` (project root) |
|
|
125
|
+
| GitHub Copilot CLI | `.github/skills/cashfree-skills/` | `.github/copilot-instructions.md` |
|
|
126
|
+
| OpenAI Codex CLI | `.agents/skills/cashfree-skills/` | `AGENTS.md` (project root) |
|
|
127
|
+
|
|
128
|
+
### Manifest File
|
|
129
|
+
|
|
130
|
+
The manifest is auto-generated with framework-specific paths. It tells the AI assistant:
|
|
131
|
+
1. Always read `getting-started/SKILL.md` first for new users
|
|
132
|
+
2. A skill map routing user intents to the correct skill file
|
|
133
|
+
3. After any integration code, always read `validation-and-testing/SKILL.md`
|
|
134
|
+
|
|
135
|
+
For Cursor, the manifest uses `.mdc` format with frontmatter. For all other frameworks, it's plain markdown.
|
|
65
136
|
|
|
66
|
-
|
|
67
|
-
Bulk payouts, vendor payments, and disbursement management.
|
|
137
|
+
## How AI Assistants Use Skills
|
|
68
138
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
139
|
+
1. The AI reads the manifest to understand what skills are available
|
|
140
|
+
2. Based on the user's request, it reads the matching `SKILL.md` (core happy path)
|
|
141
|
+
3. If deeper detail is needed, it reads `references/REFERENCE.md` for that skill
|
|
142
|
+
4. Uses the guidance to provide accurate, product-specific code
|
|
143
|
+
5. After integration, reads the validation skill for testing steps
|
|
72
144
|
|
|
73
|
-
|
|
145
|
+
### Example Interactions
|
|
74
146
|
|
|
75
|
-
### Interactive Mode
|
|
76
|
-
```bash
|
|
77
|
-
npx @cashfreepayments/agent-skills add pg
|
|
78
147
|
```
|
|
79
|
-
You
|
|
148
|
+
You: "I want to integrate Cashfree Payments"
|
|
149
|
+
AI: *reads manifest → getting-started/SKILL.md* → Walks through setup and API keys
|
|
80
150
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
npx @cashfreepayments/agent-skills add pg --frameworks cursor,claude-code,gemini-cli
|
|
84
|
-
```
|
|
151
|
+
You: "What payment modes can my merchant use?"
|
|
152
|
+
AI: *reads eligible-payment-modes/SKILL.md* → Shows how to check enabled methods
|
|
85
153
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
npx @cashfreepayments/agent-skills add secure-id --path /path/to/project
|
|
89
|
-
```
|
|
154
|
+
You: "Integrate Cashfree with my Express app"
|
|
155
|
+
AI: *reads pg/SKILL.md → pg/backend-sdks/SKILL.md* → Provides Node.js SDK setup
|
|
90
156
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
npx @cashfreepayments/agent-skills add pg
|
|
94
|
-
npx @cashfreepayments/agent-skills add secure-id
|
|
95
|
-
npx @cashfreepayments/agent-skills add subscriptions
|
|
96
|
-
npx @cashfreepayments/agent-skills add cross-border
|
|
97
|
-
npx @cashfreepayments/agent-skills add payouts
|
|
98
|
-
```
|
|
157
|
+
You: "How do I issue a refund or handle pre-authorization?"
|
|
158
|
+
AI: *reads pg/backend-sdks/references/REFERENCE.md* → Full refund/pre-auth API with code
|
|
99
159
|
|
|
100
|
-
|
|
160
|
+
You: "Add Cashfree to my Flutter app"
|
|
161
|
+
AI: *reads pg/SKILL.md → pg/mobile-sdks/SKILL.md* → Provides Flutter SDK integration
|
|
101
162
|
|
|
102
|
-
|
|
163
|
+
You: "How do I verify payment status from the mobile SDK callback?"
|
|
164
|
+
AI: *reads pg/mobile-sdks/references/REFERENCE.md* → Per-platform callback → backend verify flow
|
|
103
165
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
.gemini/skills/cashfree/pg.md
|
|
107
|
-
```
|
|
166
|
+
You: "Set up webhooks for payment confirmation"
|
|
167
|
+
AI: *reads pg/webhooks/SKILL.md* → Webhook handler with two-layer bifurcation by type + status
|
|
108
168
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
.cursor/skills/cashfree/pg.md
|
|
112
|
-
.cursor/skills/cashfree/secure-id.md
|
|
113
|
-
.cursor/skills/cashfree/subscriptions.md
|
|
114
|
-
.cursor/skills/cashfree/cross-border.md
|
|
115
|
-
.cursor/skills/cashfree/payouts.md
|
|
116
|
-
```
|
|
169
|
+
You: "My .NET app fails with SSL/TLS error when calling Cashfree"
|
|
170
|
+
AI: *reads pg/backend-sdks/references/REFERENCE.md* → .NET TLS 1.2 fix with ServicePointManager
|
|
117
171
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
Each skill file contains:
|
|
121
|
-
- Product-specific documentation references
|
|
122
|
-
- Common API patterns and use cases
|
|
123
|
-
- Example queries for the AI assistant
|
|
124
|
-
- Best practices for integration
|
|
125
|
-
|
|
126
|
-
### Payment Gateway (pg.md)
|
|
127
|
-
Guides your AI assistant on:
|
|
128
|
-
- Creating orders and processing payments
|
|
129
|
-
- Handling refunds and settlements
|
|
130
|
-
- Payment links and QR codes
|
|
131
|
-
- Webhook integration
|
|
132
|
-
|
|
133
|
-
### secure-id (secure-id.md)
|
|
134
|
-
Guides your AI assistant on:
|
|
135
|
-
- Bank account verification APIs
|
|
136
|
-
- Penny drop verification
|
|
137
|
-
- UPI ID verification
|
|
138
|
-
- Transaction reconciliation
|
|
139
|
-
|
|
140
|
-
### Subscriptions (subscriptions.md)
|
|
141
|
-
Guides your AI assistant on:
|
|
142
|
-
- Creating subscription plans
|
|
143
|
-
- Managing recurring payments
|
|
144
|
-
- Subscription authorization flows
|
|
145
|
-
- Customer subscription lifecycle
|
|
146
|
-
|
|
147
|
-
### Cross Border (cross-border.md)
|
|
148
|
-
Guides your AI assistant on:
|
|
149
|
-
- International payment processing
|
|
150
|
-
- Currency conversion and rates
|
|
151
|
-
- Cross-border compliance
|
|
152
|
-
- Multi-currency transactions
|
|
153
|
-
|
|
154
|
-
### Payouts (payouts.md)
|
|
155
|
-
Guides your AI assistant on:
|
|
156
|
-
- Bulk payout processing
|
|
157
|
-
- Vendor payment management
|
|
158
|
-
- Disbursement APIs
|
|
159
|
-
- Payout status tracking
|
|
160
|
-
|
|
161
|
-
## Framework-Specific Locations
|
|
162
|
-
|
|
163
|
-
| Framework | Skill Location |
|
|
164
|
-
|-----------|----------------|
|
|
165
|
-
| Cursor | `.cursor/skills/cashfree/` |
|
|
166
|
-
| Claude Code | `.claude/skills/cashfree/` |
|
|
167
|
-
| OpenCode | `.opencode/skills/cashfree/` |
|
|
168
|
-
| VS Code Copilot | `.github/skills/cashfree/` |
|
|
169
|
-
| Gemini CLI | `.gemini/skills/cashfree/` |
|
|
170
|
-
| Antigravity | `.agent/skills/cashfree/` |
|
|
171
|
-
| GitHub Copilot CLI | `.github/skills/cashfree/` |
|
|
172
|
-
| OpenAI Codex CLI | `.codex/skills/cashfree/` |
|
|
172
|
+
You: "Set up recurring subscriptions"
|
|
173
|
+
AI: *reads subscriptions/SKILL.md → subscriptions/references/REFERENCE.md* → Plan/mandate/charge flow
|
|
173
174
|
|
|
174
|
-
|
|
175
|
+
You: "I'm done coding, what should I test?"
|
|
176
|
+
AI: *reads validation-and-testing/SKILL.md* → Provides validation checklist and test data
|
|
175
177
|
|
|
176
|
-
|
|
178
|
+
You: "Build a marketplace where each order splits 85% to vendor, 10% to logistics, 5% commission"
|
|
179
|
+
AI: *reads pg/easy-split/SKILL.md → references/REFERENCE.md* → Creates vendors, adds order_splits on POST /pg/orders, sets refund_splits on refunds
|
|
177
180
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
3. Provides accurate, product-specific code examples
|
|
181
|
-
4. References correct API endpoints and parameters
|
|
181
|
+
You: "Run a 10% HDFC credit card offer + no-cost EMI on 3/6 month tenures"
|
|
182
|
+
AI: *reads pg/offers/SKILL.md → references/REFERENCE.md* → Creates two offers (DISCOUNT + NO_COST_EMI), attaches offer_id at Order Pay, validates redemption_status
|
|
182
183
|
|
|
183
|
-
|
|
184
|
+
You: "Give each dealer a virtual bank account number for monthly invoice collection"
|
|
185
|
+
AI: *reads auto-collect/SKILL.md → references/REFERENCE.md* → POST /pg/vba with remitter lock, subscribes to VBA_CREDIT webhook, reconciles by virtual_account_id
|
|
184
186
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
You: "How do I create a payment order?"
|
|
188
|
-
AI: *reads pg.md skill* → Provides order creation API code
|
|
189
|
-
```
|
|
187
|
+
You: "Send this customer a payment link for ₹5000, allow partial payments, expire in 7 days"
|
|
188
|
+
AI: *reads pg/payment-links/SKILL.md → references/REFERENCE.md* → POST /pg/links with link_partial_payments, wires PAYMENT_LINK_EVENT webhook
|
|
190
189
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
You: "Verify a bank account"
|
|
194
|
-
AI: *reads secure-id.md skill* → Provides bank verification API code
|
|
195
|
-
```
|
|
190
|
+
You: "Add save-card / OneClick checkout — RBI-compliant"
|
|
191
|
+
AI: *reads pg/token-vault/SKILL.md → references/REFERENCE.md* → save_instrument consent, INSTRUMENT_ACTIVE_WEBHOOK ingest, pay-with-instrument_id flow
|
|
196
192
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
You: "Set up a monthly subscription"
|
|
200
|
-
AI: *reads subscriptions.md skill* → Provides subscription plan creation code
|
|
201
|
-
```
|
|
193
|
+
You: "Integrate Cashfree into my Next.js app with a custom-styled card form"
|
|
194
|
+
AI: *reads pg/web-sdk/SKILL.md → references/REFERENCE.md* → Cashfree.js v3 Elements, mount cardNumber/Cvv/Expiry/Holder, backend re-verify
|
|
202
195
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
You: "How do I process an international payment?"
|
|
206
|
-
AI: *reads cross-border.md skill* → Provides cross-border payment API code
|
|
207
|
-
```
|
|
196
|
+
You: "Customer wants a partial refund on order 42 — issue ₹50 back, instant if possible"
|
|
197
|
+
AI: *reads pg/refunds/SKILL.md → pg/refunds/references/REFERENCE.md* → Creates refund via SDK, checks INSTANT eligibility, subscribes to REFUND_STATUS_WEBHOOK
|
|
208
198
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
199
|
+
You: "We got a chargeback on cf_payment_id 789 — help me respond"
|
|
200
|
+
AI: *reads pg/disputes/SKILL.md → pg/disputes/references/REFERENCE.md* → Fetches dispute, covers preferred_evidence categories, POSTs contest with evidence URLs before respond_by
|
|
201
|
+
|
|
202
|
+
You: "Match this UTR on our bank statement back to a Cashfree settlement"
|
|
203
|
+
AI: *reads settlements-and-reconciliation/SKILL.md → references/REFERENCE.md* → Calls GET /pg/settlements by UTR, walks recon events, reconciles fees/TDS
|
|
204
|
+
|
|
205
|
+
You: "Migrate my Express app from Razorpay to Cashfree"
|
|
206
|
+
AI: *reads migrate-from-razorpay/SKILL.md → migrate-from-razorpay/references/REFERENCE.md* → Maps keys/amounts/signatures, rewrites orders/checkout/webhook with Cashfree SDK, plans parallel-run cutover
|
|
214
207
|
|
|
208
|
+
You: "Replace Juspay Hypercheckout with Cashfree in my app"
|
|
209
|
+
AI: *reads migrate-from-juspay/SKILL.md → migrate-from-juspay/references/REFERENCE.md* → Maps sdk_payload/client_auth_token to payment_session_id, rewrites auth/webhooks/status handling, and calls out lost orchestration features early
|
|
210
|
+
|
|
211
|
+
You: "My Payout API keeps returning signature mismatch even though IP is whitelisted"
|
|
212
|
+
AI: *reads common-mistakes/SKILL.md* → Multiple account IP mismatch + dynamic IP explanation + fix
|
|
213
|
+
|
|
214
|
+
You: "Why isn't my webhook firing / payment not being fulfilled?"
|
|
215
|
+
AI: *reads common-mistakes/SKILL.md* → Diagnostic tree narrows to exact cause and fix
|
|
216
|
+
```
|
package/dist/config.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ export declare const FRAMEWORKS: readonly [{
|
|
|
7
7
|
}, {
|
|
8
8
|
readonly name: "Claude Code";
|
|
9
9
|
readonly value: "claude-code";
|
|
10
|
+
}, {
|
|
11
|
+
readonly name: "Codex";
|
|
12
|
+
readonly value: "codex";
|
|
10
13
|
}, {
|
|
11
14
|
readonly name: "OpenCode";
|
|
12
15
|
readonly value: "opencode";
|
|
@@ -22,29 +25,19 @@ export declare const FRAMEWORKS: readonly [{
|
|
|
22
25
|
}, {
|
|
23
26
|
readonly name: "GitHub Copilot CLI";
|
|
24
27
|
readonly value: "copilot-cli";
|
|
25
|
-
}, {
|
|
26
|
-
readonly name: "OpenAI Codex CLI";
|
|
27
|
-
readonly value: "codex";
|
|
28
28
|
}];
|
|
29
29
|
export type Framework = typeof FRAMEWORKS[number]['value'];
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Returns the path (from project root) to the cashfree-skills directory.
|
|
32
|
+
* Based on each framework's official skills convention.
|
|
32
33
|
*/
|
|
33
|
-
export declare
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}, {
|
|
43
|
-
readonly name: "Cross Border";
|
|
44
|
-
readonly value: "cross-border";
|
|
45
|
-
}, {
|
|
46
|
-
readonly name: "Payouts";
|
|
47
|
-
readonly value: "payouts";
|
|
48
|
-
}];
|
|
49
|
-
export type Product = typeof PRODUCTS[number]['value'];
|
|
34
|
+
export declare function getSkillsBasePath(framework: Framework): string;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the manifest file path (from project root) and format.
|
|
37
|
+
* Based on each framework's official manifest convention.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getManifestConfig(framework: Framework): {
|
|
40
|
+
path: string;
|
|
41
|
+
format: 'markdown' | 'mdc';
|
|
42
|
+
};
|
|
50
43
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;EASb,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;EASb,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAY9D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,GAAG,KAAK,CAAA;CAAE,CAYpG"}
|
package/dist/config.js
CHANGED
|
@@ -4,21 +4,45 @@
|
|
|
4
4
|
export const FRAMEWORKS = [
|
|
5
5
|
{ name: 'Cursor', value: 'cursor' },
|
|
6
6
|
{ name: 'Claude Code', value: 'claude-code' },
|
|
7
|
+
{ name: 'Codex', value: 'codex' },
|
|
7
8
|
{ name: 'OpenCode', value: 'opencode' },
|
|
8
9
|
{ name: 'VS Code Copilot', value: 'vscode-copilot' },
|
|
9
10
|
{ name: 'Gemini CLI', value: 'gemini-cli' },
|
|
10
11
|
{ name: 'Antigravity', value: 'antigravity' },
|
|
11
|
-
{ name: 'GitHub Copilot CLI', value: 'copilot-cli' }
|
|
12
|
-
{ name: 'OpenAI Codex CLI', value: 'codex' }
|
|
12
|
+
{ name: 'GitHub Copilot CLI', value: 'copilot-cli' }
|
|
13
13
|
];
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Returns the path (from project root) to the cashfree-skills directory.
|
|
16
|
+
* Based on each framework's official skills convention.
|
|
16
17
|
*/
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
export function getSkillsBasePath(framework) {
|
|
19
|
+
switch (framework) {
|
|
20
|
+
case "claude-code": return ".claude/skills/cashfree-skills";
|
|
21
|
+
case "cursor": return ".cursor/cashfree-skills";
|
|
22
|
+
case "opencode": return ".opencode/skills/cashfree-skills";
|
|
23
|
+
case "vscode-copilot": return ".github/skills/cashfree-skills";
|
|
24
|
+
case "copilot-cli": return ".github/skills/cashfree-skills";
|
|
25
|
+
case "gemini-cli": return ".gemini/skills/cashfree-skills";
|
|
26
|
+
case "codex": return ".agents/skills/cashfree-skills";
|
|
27
|
+
case "antigravity": return ".agent/skills/cashfree-skills";
|
|
28
|
+
default: return ".agent/skills/cashfree-skills";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns the manifest file path (from project root) and format.
|
|
33
|
+
* Based on each framework's official manifest convention.
|
|
34
|
+
*/
|
|
35
|
+
export function getManifestConfig(framework) {
|
|
36
|
+
switch (framework) {
|
|
37
|
+
case "claude-code": return { path: "CLAUDE.md", format: "markdown" };
|
|
38
|
+
case "cursor": return { path: ".cursor/rules/cashfree.mdc", format: "mdc" };
|
|
39
|
+
case "opencode": return { path: "AGENTS.md", format: "markdown" };
|
|
40
|
+
case "vscode-copilot": return { path: ".github/copilot-instructions.md", format: "markdown" };
|
|
41
|
+
case "copilot-cli": return { path: ".github/copilot-instructions.md", format: "markdown" };
|
|
42
|
+
case "gemini-cli": return { path: "GEMINI.md", format: "markdown" };
|
|
43
|
+
case "codex": return { path: "AGENTS.md", format: "markdown" };
|
|
44
|
+
case "antigravity": return { path: "AGENTS.md", format: "markdown" };
|
|
45
|
+
default: return { path: "AGENTS.md", format: "markdown" };
|
|
46
|
+
}
|
|
47
|
+
}
|
|
24
48
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;IACnC,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC7C,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACvC,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACpD,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;IAC3C,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC7C,EAAE,IAAI,EAAE,oBAAoB,EAAE,KAAK,EAAE,aAAa,EAAE;
|
|
1
|
+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D,QAAQ,SAAS,EAAE,CAAC;QAChB,KAAK,aAAa,CAAC,CAAK,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;QACzE,KAAK,QAAQ,CAAC,CAAU,OAAO,EAAE,IAAI,EAAE,4BAA4B,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;QACrF,KAAK,UAAU,CAAC,CAAQ,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;QACzE,KAAK,gBAAgB,CAAC,CAAE,OAAO,EAAE,IAAI,EAAE,iCAAiC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;QAC/F,KAAK,aAAa,CAAC,CAAK,OAAO,EAAE,IAAI,EAAE,iCAAiC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;QAC/F,KAAK,YAAY,CAAC,CAAM,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;QACzE,KAAK,OAAO,CAAC,CAAW,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;QACzE,KAAK,aAAa,CAAC,CAAK,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;QACzE,OAAO,CAAC,CAAgB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAC7E,CAAC;AACL,CAAC"}
|
|
@@ -10,5 +10,17 @@ export declare function ensureDir(dirPath: string): Promise<void>;
|
|
|
10
10
|
export declare function writeTextFile(filePath: string, content: string, overwrite?: boolean): Promise<boolean>;
|
|
11
11
|
export declare function logCreated(file: string): void;
|
|
12
12
|
export declare function logUpdated(file: string): void;
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function logSkipped(file: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a skill file at {projectPath}/{skillsBasePath}/{skillDir}/{fileName}
|
|
16
|
+
* fileName defaults to 'SKILL.md'
|
|
17
|
+
*/
|
|
18
|
+
export declare function createSkillFile(projectPath: string, skillsBasePath: string, skillDir: string, getTemplate: () => string, fileName?: string): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Creates or appends the Cashfree manifest to the framework's manifest file.
|
|
21
|
+
* If the file already contains Cashfree config, it skips.
|
|
22
|
+
* If the file exists but has no Cashfree config, it appends.
|
|
23
|
+
* If the file doesn't exist, it creates it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createManifestFile(projectPath: string, manifestPath: string, content: string): Promise<void>;
|
|
14
26
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/generators/utils.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9D;AAED,wBAAsB,aAAa,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,SAAS,UAAQ,GAClB,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED,wBAAsB,eAAe,CACjC,WAAW,EAAE,MAAM,EACnB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/generators/utils.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9D;AAED,wBAAsB,aAAa,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,SAAS,UAAQ,GAClB,OAAO,CAAC,OAAO,CAAC,CAOlB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACjC,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,MAAM,EACzB,QAAQ,SAAa,GACtB,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACpC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAqBf"}
|
package/dist/generators/utils.js
CHANGED
|
@@ -20,15 +20,50 @@ export function logCreated(file) {
|
|
|
20
20
|
export function logUpdated(file) {
|
|
21
21
|
console.log(chalk.yellow(` Updated ${file}`));
|
|
22
22
|
}
|
|
23
|
-
export
|
|
23
|
+
export function logSkipped(file) {
|
|
24
|
+
console.log(chalk.dim(` Skipped ${file} (already exists)`));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Creates a skill file at {projectPath}/{skillsBasePath}/{skillDir}/{fileName}
|
|
28
|
+
* fileName defaults to 'SKILL.md'
|
|
29
|
+
*/
|
|
30
|
+
export async function createSkillFile(projectPath, skillsBasePath, skillDir, getTemplate, fileName = 'SKILL.md') {
|
|
24
31
|
const path = await import('path');
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
await ensureDir(
|
|
32
|
+
const skillPath = path.join(projectPath, skillsBasePath, skillDir, fileName);
|
|
33
|
+
const relativePath = path.join(skillsBasePath, skillDir, fileName);
|
|
34
|
+
await ensureDir(path.dirname(skillPath));
|
|
28
35
|
const created = await writeTextFile(skillPath, getTemplate());
|
|
29
36
|
if (created) {
|
|
30
|
-
const relativePath = path.join(baseDir, 'skills', 'cashfree', `${productName}.md`);
|
|
31
37
|
logCreated(relativePath);
|
|
32
38
|
}
|
|
39
|
+
else {
|
|
40
|
+
logSkipped(relativePath);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Creates or appends the Cashfree manifest to the framework's manifest file.
|
|
45
|
+
* If the file already contains Cashfree config, it skips.
|
|
46
|
+
* If the file exists but has no Cashfree config, it appends.
|
|
47
|
+
* If the file doesn't exist, it creates it.
|
|
48
|
+
*/
|
|
49
|
+
export async function createManifestFile(projectPath, manifestPath, content) {
|
|
50
|
+
const path = await import('path');
|
|
51
|
+
const fullPath = path.join(projectPath, manifestPath);
|
|
52
|
+
await ensureDir(path.dirname(fullPath));
|
|
53
|
+
const exists = await fs.pathExists(fullPath);
|
|
54
|
+
if (exists) {
|
|
55
|
+
const existing = await fs.readFile(fullPath, 'utf8');
|
|
56
|
+
if (existing.includes('Cashfree Payments')) {
|
|
57
|
+
logSkipped(manifestPath + ' (Cashfree already configured)');
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
// Append Cashfree section to existing manifest with a separator
|
|
61
|
+
await fs.appendFile(fullPath, '\n\n---\n\n' + content);
|
|
62
|
+
logUpdated(manifestPath);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
await fs.writeFile(fullPath, content);
|
|
66
|
+
logCreated(manifestPath);
|
|
67
|
+
}
|
|
33
68
|
}
|
|
34
69
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/generators/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAe;IAC3C,MAAM,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAC/B,QAAgB,EAChB,OAAe,EACf,SAAS,GAAG,KAAK;IAEjB,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC7C,IAAI,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACtC,OAAO,CAAC,MAAM,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY;IACnC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY;IACnC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CACjC,WAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/generators/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAe;IAC3C,MAAM,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED,MA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