Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implement PCI DSS compliance requirements for secure handling of payment card data and payment systems. Use when securing payment processing, achieving PCI compliance, or implementing payment card security measures.
.claude/skills/bilal140202-pci-compliance/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 83% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 114% | 0% |
| case-20 | ✓→✓ | = Same ✓ | 99% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 98% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 109% | 0% |
Master PCI DSS (Payment Card Industry Data Security Standard) compliance for secure payment processing and handling of cardholder data.
Level 1: > 6 million transactions/year (annual ROC required) Level 2: 1-6 million transactions/year (annual SAQ) Level 3: 20,000-1 million e-commerce transactions/year Level 4: < 20,000 e-commerce or < 1 million total transactions
python# NEVER STORE THESE PROHIBITED_DATA = { 'full_track_data': 'Magnetic stripe data', 'cvv': 'Card verification code/value', 'pin': 'PIN or PIN block' } # CAN STORE (if encrypted) ALLOWED_DATA = { 'pan': 'Primary Account Number (card number)', 'cardholder_name': 'Name on card', 'expiration_date': 'Card expiration', 'service_code': 'Service code' } class PaymentData: """Safe payment data handling.""" def __init__(self): self.prohibited_fields = ['cvv', 'cvv2', 'cvc', 'pin'] def sanitize_log(self, data): """Remove sensitive data from logs.""" sanitized = data.copy() # Mask PAN if 'card_number' in sanitized: card = sanitized['card_number'] sanitized['card_number'] = f"{card[:6]}{'*' * (len(card) - 10)}{card[-4:]}" # Remove prohibited data for field in self.prohibited_fields: sanitized.pop(field, None) return sanitized def validate_no_prohibited_storage(self, data): """Ensure no prohibited data is being stored.""" for field in self.prohibited_fields: if field in data: raise SecurityError(f"Attempting to store prohibited field: {field}")
pythonimport stripe class TokenizedPayment: """Handle payments using tokens (no card data on server).""" @staticmethod def create_payment_method_token(card_details): """Create token from card details (client-side only).""" # THIS SHOULD ONLY BE DONE CLIENT-SIDE WITH STRIPE.JS # NEVER send card details to your server """ // Frontend JavaScript const stripe = Stripe('pk_...'); const {token, error} = await stripe.createToken({ card: { number: '4242424242424242', exp_month: 12, exp_year: 2024, cvc: '123' } }); // Send token.id to server (NOT card details) """ pass @staticmethod def charge_with_token(token_id, amount): """Charge using token (server-side).""" # Your server only sees the token, never the card number stripe.api_key = "sk_..." charge = stripe.Charge.create( amount=amount, currency="usd", source=token_id, # Token instead of card details description="Payment" ) return charge @staticmethod def store_payment_method(customer_id, payment_method_token): """Store payment method as token for future use.""" stripe.Customer.modify( customer_id, source=payment_method_token ) # Store only customer_id and payment_method_id in your database # NEVER store actual card details return { 'customer_id': customer_id, 'has_payment_method': True # DO NOT store: card number, CVV, etc. }
pythonimport secrets from cryptography.fernet import Fernet class TokenVault: """Secure token vault for card data (if you must store it).""" def __init__(self, encryption_key): self.cipher = Fernet(encryption_key) self.vault = {} # In production: use encrypted database def tokenize(self, card_data): """Convert card data to token.""" # Generate secure random token token = secrets.token_urlsafe(32) # Encrypt card data encrypted = self.cipher.encrypt(json.dumps(card_data).encode()) # Store token -> encrypted data mapping self.vault[token] = encrypted return token def detokenize(self, token): """Retrieve card data from token.""" encrypted = self.vault.get(token) if not encrypted: raise ValueError("Token not found") # Decrypt decrypted = self.cipher.decrypt(encrypted) return json.loads(decrypted.decode()) def delete_token(self, token): """Remove token from vault.""" self.vault.pop(token, None)
pythonfrom cryptography.hazmat.primitives.ciphers.aead import AESGCM import os class EncryptedStorage: """Encrypt data at rest using AES-256-GCM.""" def __init__(self, encryption_key): """Initialize with 256-bit key.""" self.key = encryption_key # Must be 32 bytes def encrypt(self, plaintext): """Encrypt data.""" # Generate random nonce nonce = os.urandom(12) # Encrypt aesgcm = AESGCM(self.key) ciphertext = aesgcm.encrypt(nonce, plaintext.encode(), None) # Return nonce + ciphertext return nonce + ciphertext def decrypt(self, encrypted_data): """Decrypt data.""" # Extract nonce and ciphertext nonce = encrypted_data[:12] ciphertext = encrypted_data[12:] # Decrypt aesgcm = AESGCM(self.key) plaintext = aesgcm.decrypt(nonce, ciphertext, None) return plaintext.decode() # Usage storage = EncryptedStorage(os.urandom(32)) encrypted_pan = storage.encrypt("4242424242424242") # Store encrypted_pan in database
python# Always use TLS 1.2 or higher # Flask/Django example app.config['SESSION_COOKIE_SECURE'] = True # HTTPS only app.config['SESSION_COOKIE_HTTPONLY'] = True app.config['SESSION_COOKIE_SAMESITE'] = 'Strict' # Enforce HTTPS from flask_talisman import Talisman Talisman(app, force_https=True)
More detailed templates and worked examples live in references/details.md. Read that file for the full pattern library.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-20 | pass→pass | 15,676 | 19,353 | +23% | 1 | 1 | 0% | 2,813 | 5,608 | +99% | 0 | 0 | — |
case-01 | pass→pass | 12,346 | 12,485 | +1% | 1 | 1 | 0% | 2,148 | 4,243 | +98% | 0 | 0 | — |
case-02 | pass→pass | 12,037 | 14,190 | +18% | 1 | 1 | 0% | 2,150 | 4,490 | +109% | 0 | 0 | — |
case-03 | pass→pass | 14,100 | 13,599 | -4% | 1 | 1 | 0% | 2,533 | 4,337 | +71% | 0 | 0 | — |
case-04 | pass→pass | 13,054 | 11,391 | -13% | 1 | 1 | 0% | 2,692 | 4,238 | +57% | 0 | 0 | — |
case-05 | fail→pass | 10,452 | 9,086 | -13% | 1 | 1 | 0% | 2,115 | 3,860 | +83% | 0 | 0 | — |
case-06 | pass→pass | 11,005 | 10,726 | -3% | 1 | 1 | 0% | 2,055 | 3,940 | +92% | 0 | 0 | — |
case-07 | pass→pass | 8,137 | 7,529 | -7% | 1 | 1 | 0% | 1,427 | 3,248 | +128% | 0 | 0 | — |
case-08 | pass→pass | 15,802 | 12,865 | -19% | 1 | 1 | 0% | 3,065 | 4,124 | +35% | 0 | 0 | — |
case-09 | pass→pass | 6,938 | 3,144 | -55% | 1 | 1 | 0% | 1,389 | 2,574 | +85% | 0 | 0 | — |
case-10 | fail→pass | 9,906 | 10,397 | +5% | 1 | 1 | 0% | 1,757 | 3,768 | +114% | 0 | 0 | — |
case-11 | pass→pass | 12,569 | 12,069 | -4% | 1 | 1 | 0% | 2,198 | 4,032 | +83% | 0 | 0 | — |
case-12 | pass→pass | 5,878 | 3,892 | -34% | 1 | 1 | 0% | 1,060 | 2,588 | +144% | 0 | 0 | — |
case-13 | pass→pass | 4,656 | 4,538 | -3% | 1 | 1 | 0% | 846 | 2,636 | +212% | 0 | 0 | — |
case-14 | pass→pass | 4,907 | 6,827 | +39% | 1 | 1 | 0% | 720 | 2,847 | +295% | 0 | 0 | — |
case-15 | pass→pass | 7,830 | 5,947 | -24% | 1 | 1 | 0% | 1,212 | 2,842 | +134% | 0 | 0 | — |
case-16 | pass→pass | 14,591 | 12,112 | -17% | 1 | 1 | 0% | 2,106 | 3,816 | +81% | 0 | 0 | — |
case-17 | pass→pass | 12,897 | 12,130 | -6% | 1 | 1 | 0% | 2,077 | 3,615 | +74% | 0 | 0 | — |
case-18 | pass→pass | 18,615 | 15,861 | -15% | 1 | 1 | 0% | 3,506 | 5,163 | +47% | 0 | 0 | — |
case-19 | fail→fail | 12,910 | 10,648 | -18% | 1 | 1 | 0% | 2,546 | 4,024 | +58% | 0 | 0 | — |
case-21 | pass→pass | 16,068 | 15,750 | -2% | 1 | 1 | 0% | 2,697 | 4,821 | +79% | 0 | 0 | — |
case-22 | pass→pass | 15,245 | 16,640 | +9% | 1 | 1 | 0% | 2,754 | 4,983 | +81% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.