.claude/skills/compliance-manager/SKILL.md
Guardrails for edits to core/security/compliance-manager.js that preserve PCI/GDPR/PSD2/SOX/HIPAA controls (masking, encryption, SCA, consent checks, and audit logging). Use when changing compliance validators, security handling, or audit flows.
npx skillsauth add thefixer3x/onasis-gateway compliance-managerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Apply this skill when modifying core/security/compliance-manager.js.
The Compliance Manager provides:
cvv, cvv2, cvc, cvc2, cid, cav2pin, pinBlocktrack1, track2, magneticStripe*.// Must mask showing only first 6 and last 4
maskCardNumber(cardNumber) {
const cleaned = cardNumber.replace(/\D/g, '');
const first6 = cleaned.substring(0, 6);
const last4 = cleaned.substring(cleaned.length - 4);
const masked = '*'.repeat(cleaned.length - 10);
return `${first6}${masked}${last4}`;
}
// Example: 4111111111111111 -> 411111******1111
// Must use AES-256-GCM
encryptSensitiveData(data) {
const algorithm = 'aes-256-gcm'; // Do not change
const key = process.env.ENCRYPTION_KEY;
if (!key) throw new Error('ENCRYPTION_KEY is required');
// 12-byte IV is recommended for GCM
const iv = crypto.randomBytes(12);
// Prefer @onasis/security-sdk for key handling if available
// If ENCRYPTION_KEY is a passphrase, derive a 32-byte key via scrypt.
const keyBuf = (key.length === 64 && /^[0-9a-f]+$/i.test(key))
? Buffer.from(key, 'hex')
: crypto.scryptSync(key, 'onasis-gateway', 32);
const cipher = crypto.createCipheriv('aes-256-gcm', keyBuf, iv);
cipher.setAAD(Buffer.from('compliance-encryption'));
const plaintext = typeof data === 'string' ? data : JSON.stringify(data);
const ciphertext = Buffer.concat([cipher.update(plaintext, 'utf8'), cipher.final()]);
const authTag = cipher.getAuthTag();
return {
encrypted: ciphertext.toString('base64'),
iv: iv.toString('hex'),
authTag: authTag.toString('hex'),
algorithm
};
}
// Must require 2+ factors
validateSCA(data) {
const factors = [];
if (data.password || data.pin) factors.push('knowledge');
if (data.deviceId || data.token) factors.push('possession');
if (data.biometric || data.fingerprint) factors.push('inherence');
return factors.length >= 2; // PSD2 requirement
}
// Must apply all applicable protections
enforceDataHandling(serviceId, data, operation) {
let processedData = { ...data };
if (service?.compliance?.pci) {
processedData = this.applyPCIProtections(processedData, operation);
}
if (service?.compliance?.gdpr) {
processedData = this.applyGDPRProtections(processedData, operation);
}
if (service?.compliance?.psd2) {
processedData = this.applyPSD2Protections(processedData, operation);
}
return processedData;
}
// Must create audit entry for all compliance events
logAuditEntry(action, details) {
const entry = {
timestamp: new Date(),
action,
details,
id: crypto.randomUUID()
};
this.auditLog.push(entry);
this.emit('audit:logged', entry);
this.persistAuditEntry(entry); // Must persist
}
| Field | Regulation | Storage | Logging | Transmission | |-------|------------|---------|---------|--------------| | cvv, cvv2, cvc, cvc2 | PCI-DSS 3.2 | Never | Never | HTTPS only | | pin, pinBlock | PCI-DSS 3.4 | Never | Never | Encrypted | | track1, track2 | PCI-DSS 3.2 | Never | Never | Never | | magneticStripe | PCI-DSS 3.2 | Never | Never | Never | | Full card number | PCI-DSS 3.4 | Encrypted | Masked | Encrypted |
| Component | Integration Method |
|-----------|-------------------|
| Base Client | Data passed through enforceDataHandling() |
| Metrics Collector | compliance_violations_total metric |
| API Routes | Middleware for request validation |
| Database | Audit entries persisted to audit.compliance_log |
Before deploying changes:
tools
# Onasis Gateway — Agent & IDE Skill Guide > **Read this file first.** This guide is the primary reference for AI agents (Claude, Cursor, Copilot, etc.) and developers working with the Onasis Gateway API integration repository. It covers all 16 third-party API integrations, Postman MCP setup, auth patterns, environment variables, and recommended workflows. --- ## Table of Contents 1. [Overview](#overview) 2. [Postman MCP Integration](#postman-mcp-integration) 3. [16 API Integrations](#16-api
data-ai
Guardrails for edits to core/versioning/version-manager.js covering semver validation, deprecation, migrations, and compatibility rules. Use when changing version registration or migration handling.
tools
Guardrails for edits to core/abstraction/vendor-abstraction.js that preserve vendor isolation, mappings, fallback selection, and stable client-facing schemas. Use when adding/removing vendors, operations, or schema fields.
tools
Use this skill when adding new methods, tools, or schema changes to the `@lanonasis/mem-intel-sdk`. Trigger when the user wants to extend the SDK with new capabilities, add a new MCP tool to mcp-core, add a new intelligence endpoint, or migrate the behavior_patterns schema. Also trigger when the user says things like "add a new tool to the SDK", "extend mem-intel-sdk", "add behavior X to the MCP server", or "update the SDK schema." Do NOT use for general behavior pattern recording/recall — use the behavior-memory skill for that.