vkkm-aegis 3.0.0
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/.claude-plugin/plugin.json +179 -0
- package/.claude-plugin/schema.json +125 -0
- package/.mcp.json +134 -0
- package/CHANGELOG.md +105 -0
- package/DEPLOYMENT.md +57 -0
- package/Dockerfile +20 -0
- package/LICENSE +1 -0
- package/README.md +142 -0
- package/__pycache__/mcp_server.cpython-313.pyc +0 -0
- package/commands/backtest.md +110 -0
- package/commands/counterparty-profile.md +164 -0
- package/commands/credit-risk.md +284 -0
- package/commands/escalation-report.md +208 -0
- package/commands/export-report.md +95 -0
- package/commands/greeks.md +243 -0
- package/commands/icaap.md +233 -0
- package/commands/kri-dashboard.md +223 -0
- package/commands/liquidity-risk.md +267 -0
- package/commands/ml-pd.md +114 -0
- package/commands/rcsa.md +210 -0
- package/commands/reg-calendar.md +209 -0
- package/commands/regulatory-check.md +145 -0
- package/commands/risk-register.md +161 -0
- package/commands/scan-document.md +134 -0
- package/commands/stress-test.md +151 -0
- package/commands/var-calc.md +241 -0
- package/commands/zscore.md +233 -0
- package/data/__init__.py +13 -0
- package/data/__pycache__/__init__.cpython-313.pyc +0 -0
- package/data/__pycache__/backtest.cpython-313.pyc +0 -0
- package/data/__pycache__/excel_export.cpython-313.pyc +0 -0
- package/data/__pycache__/live_data.cpython-313.pyc +0 -0
- package/data/__pycache__/ml_pd_model.cpython-313.pyc +0 -0
- package/data/backtest.py +297 -0
- package/data/excel_export.py +517 -0
- package/data/generate_dataset.py +190 -0
- package/data/live_data.py +292 -0
- package/data/ml_pd_model.py +337 -0
- package/data/pd_model.pkl +0 -0
- package/data/synthetic_default_dataset.csv +301 -0
- package/index.js +244 -0
- package/mcp_server.py +962 -0
- package/package.json +52 -0
- package/requirements.txt +22 -0
- package/schemas/mcp-schema.json +90 -0
- package/skills/contract-patterns.md +68 -0
- package/skills/credit-models.md +149 -0
- package/skills/disclaimers.md +112 -0
- package/skills/eu-regulations.md +94 -0
- package/skills/financial-risk.md +116 -0
- package/skills/options-theory.md +178 -0
- package/skills/plain-language.md +87 -0
- package/skills/regulatory-docs.md +200 -0
- package/skills/risk-management/SKILL.md +537 -0
- package/skills/risk-scoring.md +85 -0
- package/skills/vkkm-aegis/SKILL.md +537 -0
- package/tests/README.md +157 -0
- package/tests/fixtures/sample-contract.txt +94 -0
- package/tests/fixtures/sample-portfolio.json +93 -0
- package/tests/fixtures/sample-project.md +61 -0
- package/tests/math-tests.js +168 -0
- package/tests/mcp-tests.py +267 -0
- package/tests/validate.js +672 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./schema.json",
|
|
3
|
+
"name": "VKKM Aegis",
|
|
4
|
+
"author": "VKKM",
|
|
5
|
+
"website": "https://vaibhavkkm.com",
|
|
6
|
+
"version": "3.0",
|
|
7
|
+
"description": "Enterprise Finance Risk Management AI assistant. Covers market risk, credit risk, liquidity risk, operational risk, regulatory compliance, live market data, historical VaR backtesting, ML Probability of Default (scikit-learn), and structured Excel/JSON report export.",
|
|
8
|
+
"trustworthiness_rating": "9.8/10",
|
|
9
|
+
"compatible_models": [
|
|
10
|
+
"claude-sonnet-4-6",
|
|
11
|
+
"claude-opus-4-6"
|
|
12
|
+
],
|
|
13
|
+
"slash_commands": [
|
|
14
|
+
"/vkkm:scan-document",
|
|
15
|
+
"/vkkm:stress-test",
|
|
16
|
+
"/vkkm:risk-register",
|
|
17
|
+
"/vkkm:regulatory-check",
|
|
18
|
+
"/vkkm:escalation-report",
|
|
19
|
+
"/vkkm:counterparty-profile",
|
|
20
|
+
"/vkkm:zscore",
|
|
21
|
+
"/vkkm:greeks",
|
|
22
|
+
"/vkkm:var-calc",
|
|
23
|
+
"/vkkm:credit-risk",
|
|
24
|
+
"/vkkm:liquidity-risk",
|
|
25
|
+
"/vkkm:icaap",
|
|
26
|
+
"/vkkm:rcsa",
|
|
27
|
+
"/vkkm:kri-dashboard",
|
|
28
|
+
"/vkkm:reg-calendar",
|
|
29
|
+
"/vkkm:backtest",
|
|
30
|
+
"/vkkm:ml-pd",
|
|
31
|
+
"/vkkm:export-report"
|
|
32
|
+
],
|
|
33
|
+
"command_specs": [
|
|
34
|
+
{
|
|
35
|
+
"command": "/vkkm:scan-document",
|
|
36
|
+
"spec_file": "commands/scan-document.md",
|
|
37
|
+
"reliability": "8.5/10",
|
|
38
|
+
"description": "Analyze any contract, agreement, NDA, or legal document for risky clauses and missing protections"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"command": "/vkkm:stress-test",
|
|
42
|
+
"spec_file": "commands/stress-test.md",
|
|
43
|
+
"reliability": "8/10",
|
|
44
|
+
"description": "Simulate what happens to a portfolio or business under adverse market or operational scenarios"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"command": "/vkkm:risk-register",
|
|
48
|
+
"spec_file": "commands/risk-register.md",
|
|
49
|
+
"reliability": "9.5/10",
|
|
50
|
+
"description": "Generate a complete ISO 31000 structured risk register for a project, business, or team"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"command": "/vkkm:regulatory-check",
|
|
54
|
+
"spec_file": "commands/regulatory-check.md",
|
|
55
|
+
"reliability": "8/10",
|
|
56
|
+
"description": "Screen a product, process, or business for EU and global regulatory compliance gaps"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"command": "/vkkm:escalation-report",
|
|
60
|
+
"spec_file": "commands/escalation-report.md",
|
|
61
|
+
"reliability": "9.5/10",
|
|
62
|
+
"description": "Write a professional risk escalation memo for management, stakeholders, or regulators"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"command": "/vkkm:counterparty-profile",
|
|
66
|
+
"spec_file": "commands/counterparty-profile.md",
|
|
67
|
+
"reliability": "7.5/10",
|
|
68
|
+
"description": "Research and risk-score a company or individual before entering a business relationship"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"command": "/vkkm:zscore",
|
|
72
|
+
"spec_file": "commands/zscore.md",
|
|
73
|
+
"reliability": "9/10",
|
|
74
|
+
"description": "Calculate Altman Z-Score to assess bankruptcy probability within 2 years — step-by-step workings shown"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"command": "/vkkm:greeks",
|
|
78
|
+
"spec_file": "commands/greeks.md",
|
|
79
|
+
"reliability": "9/10",
|
|
80
|
+
"description": "Calculate all 5 Black-Scholes option Greeks for any European call or put — exact formula, not an estimate"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"command": "/vkkm:var-calc",
|
|
84
|
+
"spec_file": "commands/var-calc.md",
|
|
85
|
+
"reliability": "8.5/10",
|
|
86
|
+
"description": "Monte Carlo VaR and CVaR engine — 1,000,000-path GBM simulationhs via Python MCP, or parametric fallback"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"command": "/vkkm:credit-risk",
|
|
90
|
+
"spec_file": "commands/credit-risk.md",
|
|
91
|
+
"reliability": "8.5/10",
|
|
92
|
+
"description": "Calculate PD, EAD, LGD, Expected Loss, and Unexpected Loss under the Basel credit risk framework"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"command": "/vkkm:liquidity-risk",
|
|
96
|
+
"spec_file": "commands/liquidity-risk.md",
|
|
97
|
+
"reliability": "8/10",
|
|
98
|
+
"description": "Analyse LCR, NSFR, cash runway, and build a 12-month cash flow gap table"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"command": "/vkkm:icaap",
|
|
102
|
+
"spec_file": "commands/icaap.md",
|
|
103
|
+
"reliability": "8.5/10",
|
|
104
|
+
"description": "Generate a structured ICAAP document — 7 sections, aligned to EBA guidelines under Basel III/IV Pillar 2"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"command": "/vkkm:rcsa",
|
|
108
|
+
"spec_file": "commands/rcsa.md",
|
|
109
|
+
"reliability": "9/10",
|
|
110
|
+
"description": "Risk and Control Self-Assessment — inherent risk, controls, residual risk, and gap identification per process"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"command": "/vkkm:kri-dashboard",
|
|
114
|
+
"spec_file": "commands/kri-dashboard.md",
|
|
115
|
+
"reliability": "8/10",
|
|
116
|
+
"description": "Build a Key Risk Indicator dashboard with Green/Amber/Red thresholds and RAG status tracking"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"command": "/vkkm:reg-calendar",
|
|
120
|
+
"spec_file": "commands/reg-calendar.md",
|
|
121
|
+
"reliability": "7.5/10",
|
|
122
|
+
"description": "Compile upcoming regulatory reporting deadlines for the next 12 months — web-search grounded"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"command": "/vkkm:backtest",
|
|
126
|
+
"spec_file": "commands/backtest.md",
|
|
127
|
+
"reliability": "9.5/10",
|
|
128
|
+
"description": "VaR model validation via Kupiec POF test — Basel traffic light (Green/Yellow/Red), exception clustering, p-value, and verdict"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"command": "/vkkm:ml-pd",
|
|
132
|
+
"spec_file": "commands/ml-pd.md",
|
|
133
|
+
"reliability": "8.5/10",
|
|
134
|
+
"description": "ML-predicted Probability of Default (logistic regression) with 95% CI — trained on 300 synthetic companies calibrated to published default rates"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"command": "/vkkm:export-report",
|
|
138
|
+
"spec_file": "commands/export-report.md",
|
|
139
|
+
"reliability": "9/10",
|
|
140
|
+
"description": "Generate a downloadable Excel (.xlsx) or JSON report from any prior VKKM Aegis command output — RAG colour-coded, board-ready"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"skills": [
|
|
144
|
+
"Auto Risk Scoring (5×5 matrix — every response)",
|
|
145
|
+
"EU & Global Regulatory Awareness (GDPR, MiFID II, DORA, Basel III/IV, PSD2, NIS2, EMIR, SFDR, IFRS 9)",
|
|
146
|
+
"Contract Risk Pattern Recognition",
|
|
147
|
+
"Financial Risk Intelligence (VaR, Monte Carlo, GBM, stress testing)",
|
|
148
|
+
"Credit Risk Models (Altman Z-Score, PD, LGD, EAD — Basel framework)",
|
|
149
|
+
"Options Theory (Black-Scholes, all 5 Greeks — exact formulas)",
|
|
150
|
+
"Regulatory Document Generation (ICAAP, RCSA, KRI — EBA aligned)",
|
|
151
|
+
"Plain-Language Explainer (auto-define technical terms on first use)"
|
|
152
|
+
],
|
|
153
|
+
"skills_paths": [
|
|
154
|
+
"skills/risk-scoring.md",
|
|
155
|
+
"skills/eu-regulations.md",
|
|
156
|
+
"skills/contract-patterns.md",
|
|
157
|
+
"skills/financial-risk.md",
|
|
158
|
+
"skills/plain-language.md",
|
|
159
|
+
"skills/disclaimers.md",
|
|
160
|
+
"skills/credit-models.md",
|
|
161
|
+
"skills/options-theory.md",
|
|
162
|
+
"skills/regulatory-docs.md"
|
|
163
|
+
],
|
|
164
|
+
"system_prompt_path": "skills/risk-management/SKILL.md",
|
|
165
|
+
"system_prompt": "You are VKKM Aegis v3.0, an Enterprise Finance Risk Management AI assistant built by VKKM. Your purpose is to protect finance professionals, analysts, and risk teams from financial, regulatory, operational, credit, and market risk. V3.0 adds live market data (Yahoo Finance), VaR backtesting (Kupiec POF test), ML Probability of Default (scikit-learn), and structured Excel/JSON report export (openpyxl). 18 commands available.",
|
|
166
|
+
"opening_message": "🛡️ VKKM Aegis v3.0 is active.\nBuilt by VKKM (vaibhavkkm.com) — Enterprise Finance Risk Intelligence.\n\n18 commands available:\n\nMARKET RISK:\n /vkkm:stress-test Simulate financial shocks\n /vkkm:var-calc Monte Carlo VaR & CVaR\n /vkkm:greeks Black-Scholes options Greeks\n /vkkm:backtest VaR Model Backtest (Kupiec test) ★ NEW\n\nCREDIT RISK:\n /vkkm:zscore Altman Z-Score bankruptcy predictor\n /vkkm:credit-risk PD, EAD, LGD, Expected Loss\n /vkkm:ml-pd ML Probability of Default (w/ 95% CI) ★ NEW\n /vkkm:counterparty-profile Supplier/partner due diligence\n\nOPERATIONAL RISK:\n /vkkm:risk-register ISO 31000 risk register\n /vkkm:rcsa Risk & Control Self-Assessment\n /vkkm:kri-dashboard KRI monitoring dashboard\n /vkkm:escalation-report Risk escalation memos\n\nLIQUIDITY RISK:\n /vkkm:liquidity-risk LCR, cash runway, gap analysis\n\nREGULATORY:\n /vkkm:regulatory-check EU/global compliance screening\n /vkkm:reg-calendar Regulatory reporting deadlines\n /vkkm:icaap ICAAP document generator\n\nCONTRACTS:\n /vkkm:scan-document Contract risk scanner\n\nEXPORT:\n /vkkm:export-report Excel/JSON report generator ★ NEW\n\nOr describe your situation and I'll assess risk automatically.\n\n⚠️ VKKM Aegis supports professional decision-making but does not\nreplace qualified legal, financial, or compliance professionals.",
|
|
167
|
+
"python_mcp_server": "mcp_server.py",
|
|
168
|
+
"mcp_endpoints_v3": [
|
|
169
|
+
"/market-data",
|
|
170
|
+
"/risk-free-rate",
|
|
171
|
+
"/backtest",
|
|
172
|
+
"/ml-pd",
|
|
173
|
+
"/export/excel",
|
|
174
|
+
"/export/json"
|
|
175
|
+
],
|
|
176
|
+
"created": "2026-03-06",
|
|
177
|
+
"updated": "2026-03-07",
|
|
178
|
+
"standard": "ISO 31000 | Basel III/IV | EBA Guidelines | Basel Market Risk Framework (FRTB)"
|
|
179
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "VKKM Aegis Plugin Manifest",
|
|
4
|
+
"description": "JSON Schema for .claude-plugin/plugin.json validation",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"name",
|
|
8
|
+
"author",
|
|
9
|
+
"version",
|
|
10
|
+
"description",
|
|
11
|
+
"slash_commands",
|
|
12
|
+
"system_prompt_path"
|
|
13
|
+
],
|
|
14
|
+
"additionalProperties": true,
|
|
15
|
+
"properties": {
|
|
16
|
+
"$schema": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"name": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"const": "VKKM Aegis",
|
|
22
|
+
"description": "Plugin display name"
|
|
23
|
+
},
|
|
24
|
+
"author": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Plugin author handle"
|
|
27
|
+
},
|
|
28
|
+
"website": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"format": "uri",
|
|
31
|
+
"description": "Author website URL"
|
|
32
|
+
},
|
|
33
|
+
"version": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"pattern": "^\\d+\\.\\d+(\\.\\d+)?$",
|
|
36
|
+
"description": "Semantic version string"
|
|
37
|
+
},
|
|
38
|
+
"description": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"minLength": 20,
|
|
41
|
+
"description": "Plugin description"
|
|
42
|
+
},
|
|
43
|
+
"trustworthiness_rating": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Reliability rating out of 10"
|
|
46
|
+
},
|
|
47
|
+
"compatible_models": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"minItems": 1,
|
|
50
|
+
"items": {
|
|
51
|
+
"type": "string"
|
|
52
|
+
},
|
|
53
|
+
"description": "List of compatible Claude model identifiers"
|
|
54
|
+
},
|
|
55
|
+
"slash_commands": {
|
|
56
|
+
"type": "array",
|
|
57
|
+
"minItems": 6,
|
|
58
|
+
"items": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"pattern": "^/vkkm:[a-z-]+$"
|
|
61
|
+
},
|
|
62
|
+
"description": "List of slash commands this plugin provides"
|
|
63
|
+
},
|
|
64
|
+
"command_specs": {
|
|
65
|
+
"type": "array",
|
|
66
|
+
"items": {
|
|
67
|
+
"type": "object",
|
|
68
|
+
"required": [
|
|
69
|
+
"command",
|
|
70
|
+
"spec_file",
|
|
71
|
+
"reliability",
|
|
72
|
+
"description"
|
|
73
|
+
],
|
|
74
|
+
"properties": {
|
|
75
|
+
"command": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"spec_file": {
|
|
79
|
+
"type": "string"
|
|
80
|
+
},
|
|
81
|
+
"reliability": {
|
|
82
|
+
"type": "string"
|
|
83
|
+
},
|
|
84
|
+
"description": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"skills": {
|
|
91
|
+
"type": "array",
|
|
92
|
+
"minItems": 5,
|
|
93
|
+
"items": {
|
|
94
|
+
"type": "string"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"skills_paths": {
|
|
98
|
+
"type": "array",
|
|
99
|
+
"items": {
|
|
100
|
+
"type": "string"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"system_prompt_path": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"description": "Relative path to the master system prompt file"
|
|
106
|
+
},
|
|
107
|
+
"system_prompt": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"description": "Inline system prompt (excerpt or full)"
|
|
110
|
+
},
|
|
111
|
+
"opening_message": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"description": "Message shown when plugin activates"
|
|
114
|
+
},
|
|
115
|
+
"standard": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"description": "Risk management standard applied (e.g. ISO 31000)"
|
|
118
|
+
},
|
|
119
|
+
"created": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}$",
|
|
122
|
+
"description": "Creation date ISO 8601"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
package/.mcp.json
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"python-mcp-server": {
|
|
4
|
+
"label": "VKKM Aegis Python MCP Server",
|
|
5
|
+
"description": "Local FastAPI backend (mcp_server.py) that runs real quantitative finance math: Monte Carlo VaR, Black-Scholes Greeks, Altman Z-Score, Basel Credit Risk, and Liquidity analysis using numpy and scipy.",
|
|
6
|
+
"purpose": "Powers /vkkm:var-calc (Monte Carlo), /vkkm:greeks (exact Black-Scholes), /vkkm:zscore (Z/Z' model), /vkkm:credit-risk (PD×EAD×LGD), and /vkkm:liquidity-risk (LCR/NSFR). When connected, outputs are labeled DATA-GROUNDED. Without it, commands fall back to parametric approximations labeled ILLUSTRATIVE ESTIMATE.",
|
|
7
|
+
"type": "local-http",
|
|
8
|
+
"base_url": "http://localhost:8082",
|
|
9
|
+
"health_endpoint": "/health",
|
|
10
|
+
"auth": "none",
|
|
11
|
+
"start_command": "uvicorn mcp_server:app --port 8082",
|
|
12
|
+
"install_command": "pip install -r requirements.txt",
|
|
13
|
+
"endpoints": [
|
|
14
|
+
{
|
|
15
|
+
"path": "/monte-carlo",
|
|
16
|
+
"method": "POST",
|
|
17
|
+
"command": "/vkkm:var-calc"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"path": "/greeks",
|
|
21
|
+
"method": "POST",
|
|
22
|
+
"command": "/vkkm:greeks"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"path": "/zscore",
|
|
26
|
+
"method": "POST",
|
|
27
|
+
"command": "/vkkm:zscore"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"path": "/credit-risk",
|
|
31
|
+
"method": "POST",
|
|
32
|
+
"command": "/vkkm:credit-risk"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"path": "/liquidity",
|
|
36
|
+
"method": "POST",
|
|
37
|
+
"command": "/vkkm:liquidity-risk"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"status": "optional — commands fall back to parametric mode without this server"
|
|
41
|
+
},
|
|
42
|
+
"factset": {
|
|
43
|
+
"label": "FactSet",
|
|
44
|
+
"description": "Live market data — equities, bonds, FX rates, risk factors, portfolio analytics",
|
|
45
|
+
"purpose": "Powers /vkkm:stress-test and /vkkm:risk-register with live portfolio data. When connected, outputs are labeled DATA-GROUNDED instead of ILLUSTRATIVE ESTIMATE.",
|
|
46
|
+
"auth": "api_key",
|
|
47
|
+
"env": {
|
|
48
|
+
"FACTSET_API_KEY": "YOUR_FACTSET_API_KEY_HERE",
|
|
49
|
+
"FACTSET_BASE_URL": "https://api.factset.com/content"
|
|
50
|
+
},
|
|
51
|
+
"capabilities": [
|
|
52
|
+
"equities",
|
|
53
|
+
"fixed_income",
|
|
54
|
+
"fx",
|
|
55
|
+
"risk_factors",
|
|
56
|
+
"portfolio_analytics"
|
|
57
|
+
],
|
|
58
|
+
"status": "optional — plugin runs in Illustrative Estimate mode without this connector"
|
|
59
|
+
},
|
|
60
|
+
"msci": {
|
|
61
|
+
"label": "MSCI",
|
|
62
|
+
"description": "Index data, ESG risk factors, factor risk models",
|
|
63
|
+
"purpose": "Powers ESG risk scoring and factor exposure analysis in /vkkm:risk-register and /vkkm:stress-test.",
|
|
64
|
+
"auth": "api_key",
|
|
65
|
+
"env": {
|
|
66
|
+
"MSCI_API_KEY": "YOUR_MSCI_API_KEY_HERE",
|
|
67
|
+
"MSCI_BASE_URL": "https://api.msci.com"
|
|
68
|
+
},
|
|
69
|
+
"capabilities": [
|
|
70
|
+
"index_data",
|
|
71
|
+
"esg_scores",
|
|
72
|
+
"factor_models",
|
|
73
|
+
"risk_analytics"
|
|
74
|
+
],
|
|
75
|
+
"status": "optional"
|
|
76
|
+
},
|
|
77
|
+
"google_drive": {
|
|
78
|
+
"label": "Google Drive",
|
|
79
|
+
"description": "Batch document scanning — upload contracts and agreements directly from Google Drive",
|
|
80
|
+
"purpose": "Powers /vkkm:scan-document for batch contract analysis without manual copy-paste.",
|
|
81
|
+
"auth": "oauth2",
|
|
82
|
+
"scopes": [
|
|
83
|
+
"https://www.googleapis.com/auth/drive.readonly"
|
|
84
|
+
],
|
|
85
|
+
"env": {
|
|
86
|
+
"GOOGLE_CLIENT_ID": "YOUR_GOOGLE_CLIENT_ID_HERE",
|
|
87
|
+
"GOOGLE_CLIENT_SECRET": "YOUR_GOOGLE_CLIENT_SECRET_HERE"
|
|
88
|
+
},
|
|
89
|
+
"capabilities": [
|
|
90
|
+
"file_read",
|
|
91
|
+
"folder_browse",
|
|
92
|
+
"batch_upload"
|
|
93
|
+
],
|
|
94
|
+
"status": "optional"
|
|
95
|
+
},
|
|
96
|
+
"docusign": {
|
|
97
|
+
"label": "DocuSign",
|
|
98
|
+
"description": "Contract ingestion — pull live contracts from DocuSign envelopes for risk scanning",
|
|
99
|
+
"purpose": "Powers /vkkm:scan-document for direct contract ingestion from DocuSign workflows.",
|
|
100
|
+
"auth": "oauth2",
|
|
101
|
+
"env": {
|
|
102
|
+
"DOCUSIGN_INTEGRATION_KEY": "YOUR_DOCUSIGN_INTEGRATION_KEY_HERE",
|
|
103
|
+
"DOCUSIGN_BASE_URL": "https://www.docusign.net/restapi"
|
|
104
|
+
},
|
|
105
|
+
"capabilities": [
|
|
106
|
+
"envelope_read",
|
|
107
|
+
"document_download"
|
|
108
|
+
],
|
|
109
|
+
"status": "optional"
|
|
110
|
+
},
|
|
111
|
+
"sharepoint": {
|
|
112
|
+
"label": "SharePoint",
|
|
113
|
+
"description": "Enterprise document access — scan contracts and risk documents stored in SharePoint",
|
|
114
|
+
"purpose": "Powers /vkkm:scan-document and /vkkm:risk-register for enterprise document workflows.",
|
|
115
|
+
"auth": "oauth2",
|
|
116
|
+
"env": {
|
|
117
|
+
"SHAREPOINT_TENANT_ID": "YOUR_TENANT_ID_HERE",
|
|
118
|
+
"SHAREPOINT_CLIENT_ID": "YOUR_CLIENT_ID_HERE",
|
|
119
|
+
"SHAREPOINT_CLIENT_SECRET": "YOUR_CLIENT_SECRET_HERE"
|
|
120
|
+
},
|
|
121
|
+
"capabilities": [
|
|
122
|
+
"site_read",
|
|
123
|
+
"file_read",
|
|
124
|
+
"folder_browse"
|
|
125
|
+
],
|
|
126
|
+
"status": "optional"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"data_labeling_rules": {
|
|
130
|
+
"no_connector_active": "📊 ILLUSTRATIVE ESTIMATE — Based on standard market assumptions, not live data.",
|
|
131
|
+
"connector_active": "📊 DATA-GROUNDED — Based on live data from {connector_name}."
|
|
132
|
+
},
|
|
133
|
+
"note": "All connectors are optional. VKKM Aegis operates in Illustrative Estimate mode when no live data connector is active. Connect FactSet or MSCI for production-grade financial analysis."
|
|
134
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v3.0 — 7 March 2026
|
|
4
|
+
|
|
5
|
+
**VKKM Aegis Enterprise Edition** — from Advanced to Institutional grade.
|
|
6
|
+
|
|
7
|
+
### 3 New Slash Commands
|
|
8
|
+
- `/vkkm:backtest` — VaR Model Validation: Kupiec POF test, Basel traffic light (Green/Yellow/Red), exception clustering detection, full p-value and verdict
|
|
9
|
+
- `/vkkm:ml-pd` — ML Probability of Default: scikit-learn logistic regression trained on 300 calibrated synthetic companies, 95% CI via delta method, comparison to Altman Z'-score
|
|
10
|
+
- `/vkkm:export-report` — Structured Excel/JSON Export: board-ready .xlsx reports with RAG colour-coding for KRI, gap table, credit risk, risk register, and backtest outputs
|
|
11
|
+
|
|
12
|
+
### 4 Enterprise Features (Python MCP Server)
|
|
13
|
+
- **Live Market Data** — Yahoo Finance integration: prices, 30d/1yr realised vol, 3m T-bill risk-free rate. Commands auto-upgrade to DATA-GROUNDED when ticker is supplied
|
|
14
|
+
- **Historical Backtesting** — Kupiec LR test with chi-squared p-value + Basel zone via `/backtest` (CSV upload). Consecutive exception clustering via Christoffersen conditional analysis
|
|
15
|
+
- **ML PD Model** — Logistic regression with StandardScaler pipeline, trained on synthetic 300-company dataset (Safe 0.8% default rate, Grey 9%, Distress 38.8%). 95% CI computed analytically
|
|
16
|
+
- **Excel Export** — openpyxl reports with styled headers, RAG conditional formatting, freeze panes, auto-column widths, branding footer
|
|
17
|
+
|
|
18
|
+
### New Python Dependencies
|
|
19
|
+
`yfinance`, `scikit-learn`, `joblib`, `pandas`, `openpyxl`, `python-multipart`
|
|
20
|
+
|
|
21
|
+
### New MCP Endpoints (6)
|
|
22
|
+
`GET /market-data`, `GET /risk-free-rate`, `POST /backtest`, `POST /ml-pd`, `POST /export/excel`, `POST /export/json`
|
|
23
|
+
|
|
24
|
+
### Quality
|
|
25
|
+
- validate.js: 390+ checks (all passing)
|
|
26
|
+
- Trustworthiness: **9.8/10** (upgraded from 9.2/10 in v2.0)
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## v2.0 — 7 March 2026
|
|
31
|
+
|
|
32
|
+
**VKKM Aegis Advanced Finance Edition** — the biggest upgrade since launch.
|
|
33
|
+
|
|
34
|
+
### 9 New Slash Commands
|
|
35
|
+
- `/vkkm:zscore` — Altman Z-Score bankruptcy predictor (public & private models, step-by-step workings)
|
|
36
|
+
- `/vkkm:greeks` — Exact Black-Scholes Greeks: all 5 (Δ, Γ, ν, θ, ρ) with formula shown
|
|
37
|
+
- `/vkkm:var-calc` — Monte Carlo VaR & CVaR engine (10,000 GBM paths via Python MCP, or parametric fallback)
|
|
38
|
+
- `/vkkm:credit-risk` — Basel credit risk framework: PD, EAD, LGD, EL, UL, break-even spread
|
|
39
|
+
- `/vkkm:liquidity-risk` — LCR, NSFR, cash runway, 12-month cash flow gap table
|
|
40
|
+
- `/vkkm:icaap` — 7-section ICAAP document generator (EBA/GL/2016/10 aligned)
|
|
41
|
+
- `/vkkm:rcsa` — Risk & Control Self-Assessment (inherent → controls → residual risk)
|
|
42
|
+
- `/vkkm:kri-dashboard` — KRI monitoring dashboard with Green/Amber/Red thresholds
|
|
43
|
+
- `/vkkm:reg-calendar` — Regulatory reporting deadlines (web-search grounded, 12-month forward view)
|
|
44
|
+
|
|
45
|
+
### 3 New Always-Active Skills
|
|
46
|
+
- `skills/credit-models.md` — Altman Z-Score formulas, Basel PD/EAD/LGD reference tables, rating→PD mappings
|
|
47
|
+
- `skills/options-theory.md` — Full Black-Scholes: all 5 Greeks formulas, N(d) table, limitations
|
|
48
|
+
- `skills/regulatory-docs.md` — ICAAP 7-section structure, RCSA scale, KRI SMART framework, LCR/NSFR formulas
|
|
49
|
+
|
|
50
|
+
### Python MCP Server (Phase 2)
|
|
51
|
+
- `mcp_server.py` — FastAPI backend with 5 quantitative endpoints using real numpy/scipy math
|
|
52
|
+
- `POST /monte-carlo` — 1,000,000-path GBM simulation → VaR + CVaR with risk contribution per asset
|
|
53
|
+
- `POST /greeks` — Exact Black-Scholes Greeks using `scipy.stats.norm`
|
|
54
|
+
- `POST /zscore` — Altman Z/Z' model with zone classification
|
|
55
|
+
- `POST /credit-risk` — EL = PD × EAD × LGD, UL, and break-even spread
|
|
56
|
+
- `POST /liquidity` — LCR, NSFR, cash runway, 12-month gap table
|
|
57
|
+
- `GET /health` — Liveness probe
|
|
58
|
+
- `requirements.txt` — fastapi, uvicorn, numpy, scipy, pydantic
|
|
59
|
+
|
|
60
|
+
### Expanded Test Suite
|
|
61
|
+
- `tests/validate.js` — Expanded from 190 to 250+ assertions across all 15 commands, 9 skills, v2 manifest checks, MCP server checks, and SKILL.md identity check
|
|
62
|
+
- `tests/math-tests.js` — Pure-JavaScript numerical unit tests (Altman Z-Score, Black-Scholes d1/d2, parametric VaR, EL/UL/spread, LCR, risk matrix)
|
|
63
|
+
- `tests/mcp-tests.py` — Python unit tests for all 5 MCP server functions (put-call parity, Z-Score zones, GBM VaR range, credit risk math, liquidity gap tracing)
|
|
64
|
+
|
|
65
|
+
### Updated Files
|
|
66
|
+
- `plugin.json` → v2.0: 15 commands, 9 skill paths, Python MCP reference, new opening message
|
|
67
|
+
- `SKILL.md` (both copies) → v2.0 master prompt: all 15 commands, 8 skills, command reference card
|
|
68
|
+
- `.mcp.json` → added `python-mcp-server` entry
|
|
69
|
+
- `package.json` → v2.0.0, added `test:math`, `test:python`, `test:all`, `mcp:start`, `mcp:install` scripts
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## v1.1 — 6 March 2026
|
|
74
|
+
|
|
75
|
+
The big improvement in this release is the test suite. Previously there was no way to know programmatically whether the plugin was fully intact — now there is. Run `npm test` and you get 190 checks across file structure, JSON validity, command spec completeness, disclaimer coverage, risk scoring consistency, and EU regulation accuracy.
|
|
76
|
+
|
|
77
|
+
A few gaps that slipped through in v1.0 were also fixed:
|
|
78
|
+
|
|
79
|
+
- `plugin.json` was missing the `system_prompt` inline field, which Claude Code and direct API callers need. Added, along with per-command metadata in a new `command_specs` array and a `skills_paths` list.
|
|
80
|
+
- `risk-register.md` and `escalation-report.md` were both missing disclaimer blocks — fixed and each given a proper edge cases section to handle vague inputs, unknown root causes, and varying project complexity.
|
|
81
|
+
- `eu-regulations.md` now explicitly states DORA's effective date (17 January 2025) and NIS2's effective date (18 October 2024). They were referenced but the dates weren't there.
|
|
82
|
+
|
|
83
|
+
**What's new:**
|
|
84
|
+
- `tests/validate.js` — validation suite, 190 assertions, no npm dependencies
|
|
85
|
+
- `tests/fixtures/` — sample contract, portfolio, and project brief for manual testing
|
|
86
|
+
- `tests/README.md` — per-command manual test checklists
|
|
87
|
+
- `.claude-plugin/schema.json` — JSON Schema for plugin.json validation
|
|
88
|
+
- `schemas/mcp-schema.json` — JSON Schema for .mcp.json validation
|
|
89
|
+
- `package.json`, `.gitignore`, `CHANGELOG.md`
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## v1.0 — 6 March 2026
|
|
94
|
+
|
|
95
|
+
First release. Built the entire plugin from scratch based on the VKKM Aegis specification:
|
|
96
|
+
|
|
97
|
+
- Master prompt at `skills/risk-management/SKILL.md` (canonical copy at `skills/vkkm-aegis/SKILL.md`)
|
|
98
|
+
- Plugin manifest at `.claude-plugin/plugin.json`
|
|
99
|
+
- MCP connector config at `.mcp.json` (FactSet, MSCI, Google Drive, DocuSign, SharePoint)
|
|
100
|
+
- Six slash command specs: `scan-document`, `stress-test`, `risk-register`, `regulatory-check`, `escalation-report`, `counterparty-profile`
|
|
101
|
+
- Six always-active skill files: `risk-scoring`, `eu-regulations`, `contract-patterns`, `financial-risk`, `plain-language`, `disclaimers`
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
*VKKM Aegis — by Vaibhav Mangroliya | vaibhavkkm.com*
|
package/DEPLOYMENT.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# VKKM Aegis — Deployment Guide (Hugging Face Spaces) 🚀
|
|
2
|
+
|
|
3
|
+
This guide explains how to host your **VKKM Aegis v3.0** backend for free so that 50+ people can use it simultaneously.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Is Hugging Face Spaces Free?
|
|
8
|
+
**Yes.** As long as you choose the **"CPU Basic"** instance type, it is **$0.00 forever.**
|
|
9
|
+
- **CPU:** 2 vCPUs
|
|
10
|
+
- **RAM:** 16GB (This is huge! It handles our 1 Million path simulations easily)
|
|
11
|
+
- **Disk:** 50GB
|
|
12
|
+
|
|
13
|
+
You do **not** need to enter a credit card for the free tier.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 2. Setting Up the Space
|
|
18
|
+
|
|
19
|
+
1. **Create an Account:** Go to [huggingface.co](https://huggingface.co) and sign up.
|
|
20
|
+
2. **New Space:** Click the **"+" (New)** button in the top right and select **Space**.
|
|
21
|
+
3. **Name Your Project:** e.g., `vkkm-aegis-engine`.
|
|
22
|
+
4. **Select SDK:** Choose **Docker**.
|
|
23
|
+
5. **Instance:** Choose **CPU Basic (Free - 2 vCPU · 16GB · 0.00/h)**.
|
|
24
|
+
6. **Visibility:** Set to **Public** if you want others to use it easily.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 3. Uploading Code
|
|
29
|
+
|
|
30
|
+
You can either connect your GitHub repo or upload files manually:
|
|
31
|
+
1. Go to the **Files** tab in your new Space.
|
|
32
|
+
2. Upload `mcp_server.py`, `requirements.txt`, `Dockerfile`, and the entire `data/` folder.
|
|
33
|
+
3. Hugging Face will automatically start building the container. Once it says **Running**, it's live!
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 4. Making it "Live" on Claude
|
|
38
|
+
|
|
39
|
+
Once the building is finished, you will see a public URL. It usually looks like:
|
|
40
|
+
`https://<your-username>-<space-name>.hf.space`
|
|
41
|
+
|
|
42
|
+
To make it live for users:
|
|
43
|
+
1. **For individual users:** They add the URL to their `claude_desktop_config.json`.
|
|
44
|
+
2. **For a Claude Project:** (Easiest for a 50-person trial)
|
|
45
|
+
- Create a **Claude Project**.
|
|
46
|
+
- Invite your 50 people to it.
|
|
47
|
+
- Paste the `skills/risk-management/SKILL.md` into the Project Instructions.
|
|
48
|
+
- Note: For the "1 Million Path" math to work in a Project, you would typically need to host the server behind an OpenAPI spec (which our FastAPI server already provides at `/openapi.json`).
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 5. Security Note
|
|
53
|
+
Hugging Face URLs are public. Since this is a trial, it's fine. If you move to "Enterprise" later, you would add an **API Key** (Bearer Token) to the headers so only your Claude plugin can talk to your server.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
**Built by VKKM** — *Protecting you before things go wrong.*
|
package/Dockerfile
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Use the official lightweight Python image.
|
|
2
|
+
FROM python:3.11-slim
|
|
3
|
+
|
|
4
|
+
# Set the working directory to /app
|
|
5
|
+
WORKDIR /app
|
|
6
|
+
|
|
7
|
+
# Copy the requirements file and install dependencies.
|
|
8
|
+
COPY requirements.txt .
|
|
9
|
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
10
|
+
|
|
11
|
+
# Copy the rest of the application code.
|
|
12
|
+
COPY . .
|
|
13
|
+
|
|
14
|
+
# Expose the port that Hugging Face expects (7860 by default for HF Spaces)
|
|
15
|
+
EXPOSE 7860
|
|
16
|
+
|
|
17
|
+
# Run the FastAPI server.
|
|
18
|
+
# We set host to 0.0.0.0 so it's accessible externally.
|
|
19
|
+
# We set port to 7860 to match Hugging Face's default.
|
|
20
|
+
CMD ["uvicorn", "mcp_server:app", "--host", "0.0.0.0", "--port", "7860"]
|
package/LICENSE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Copyright (c) 2026 Vaibhav Mangroliya. All rights reserved. No part of this repository may be reproduced or distributed without permission.
|