[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BWJNEG66YCDEFQ6C9ZDWMH":3,"skill-same:01M7BWJNEG66YCDEFQ6C9ZDWMH":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7BWJNEG66YCDEFQ6C9ZDWMH","pci-compliance",null,"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.","YYC-Cube\u002FYYC3-Knowledge-Base","YYC-Cube","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235006543?v=4","01M79J2PH4SWD2X0825X6PN748","yyc3","01M79J2PHVK3F6ZBYT8K2SCZCW",1,"MIT","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Plugin-插件协议\u002FYYC3-Plugin-插件协议-plugins-claude\u002Fpayment-processing\u002Fskills\u002Fpci-compliance\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: pci-compliance\ndescription: 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.\n---\n\n# PCI Compliance\n\nMaster PCI DSS (Payment Card Industry Data Security Standard) compliance for secure payment processing and handling of cardholder data.\n\n## When to Use This Skill\n\n- Building payment processing systems\n- Handling credit card information\n- Implementing secure payment flows\n- Conducting PCI compliance audits\n- Reducing PCI compliance scope\n- Implementing tokenization and encryption\n- Preparing for PCI DSS assessments\n\n## PCI DSS Requirements (12 Core Requirements)\n\n### Build and Maintain Secure Network\n\n1. Install and maintain firewall configuration\n2. Don't use vendor-supplied defaults for passwords\n\n### Protect Cardholder Data\n\n3. Protect stored cardholder data\n4. Encrypt transmission of cardholder data across public networks\n\n### Maintain Vulnerability Management\n\n5. Protect systems against malware\n6. Develop and maintain secure systems and applications\n\n### Implement Strong Access Control\n\n7. Restrict access to cardholder data by business need-to-know\n8. Identify and authenticate access to system components\n9. Restrict physical access to cardholder data\n\n### Monitor and Test Networks\n\n10. Track and monitor all access to network resources and cardholder data\n11. Regularly test security systems and processes\n\n### Maintain Information Security Policy\n\n12. Maintain a policy that addresses information security\n\n## Compliance Levels\n\n**Level 1**: > 6 million transactions\u002Fyear (annual ROC required)\n**Level 2**: 1-6 million transactions\u002Fyear (annual SAQ)\n**Level 3**: 20,000-1 million e-commerce transactions\u002Fyear\n**Level 4**: \u003C 20,000 e-commerce or \u003C 1 million total transactions\n\n## Data Minimization (Never Store)\n\n```python\n# NEVER STORE THESE\nPROHIBITED_DATA = {\n    'full_track_data': 'Magnetic stripe data',\n    'cvv': 'Card verification code\u002Fvalue',\n    'pin': 'PIN or PIN block'\n}\n\n# CAN STORE (if encrypted)\nALLOWED_DATA = {\n    'pan': 'Primary Account Number (card number)',\n    'cardholder_name': 'Name on card',\n    'expiration_date': 'Card expiration',\n    'service_code': 'Service code'\n}\n\nclass PaymentData:\n    \"\"\"Safe payment data handling.\"\"\"\n\n    def __init__(self):\n        self.prohibited_fields = ['cvv', 'cvv2', 'cvc', 'pin']\n\n    def sanitize_log(self, data):\n        \"\"\"Remove sensitive data from logs.\"\"\"\n        sanitized = data.copy()\n\n        # Mask PAN\n        if 'card_number' in sanitized:\n            card = sanitized['card_number']\n            sanitized['card_number'] = f\"{card[:6]}{'*' * (len(card) - 10)}{card[-4:]}\"\n\n        # Remove prohibited data\n        for field in self.prohibited_fields:\n            sanitized.pop(field, None)\n\n        return sanitized\n\n    def validate_no_prohibited_storage(self, data):\n        \"\"\"Ensure no prohibited data is being stored.\"\"\"\n        for field in self.prohibited_fields:\n            if field in data:\n                raise SecurityError(f\"Attempting to store prohibited field: {field}\")\n```\n\n## Tokenization\n\n### Using Payment Processor Tokens\n\n```python\nimport stripe\n\nclass TokenizedPayment:\n    \"\"\"Handle payments using tokens (no card data on server).\"\"\"\n\n    @staticmethod\n    def create_payment_method_token(card_details):\n        \"\"\"Create token from card details (client-side only).\"\"\"\n        # THIS SHOULD ONLY BE DONE CLIENT-SIDE WITH STRIPE.JS\n        # NEVER send card details to your server\n\n        \"\"\"\n        \u002F\u002F Frontend JavaScript\n        const stripe = Stripe('pk_...');\n\n        const {token, error} = await stripe.createToken({\n            card: {\n                number: '4242424242424242',\n                exp_month: 12,\n                exp_year: 2024,\n                cvc: '123'\n            }\n        });\n\n        \u002F\u002F Send token.id to server (NOT card details)\n        \"\"\"\n        pass\n\n    @staticmethod\n    def charge_with_token(token_id, amount):\n        \"\"\"Charge using token (server-side).\"\"\"\n        # Your server only sees the token, never the card number\n        stripe.api_key = \"sk_...\"\n\n        charge = stripe.Charge.create(\n            amount=amount,\n            currency=\"usd\",\n            source=token_id,  # Token instead of card details\n            description=\"Payment\"\n        )\n\n        return charge\n\n    @staticmethod\n    def store_payment_method(customer_id, payment_method_token):\n        \"\"\"Store payment method as token for future use.\"\"\"\n        stripe.Customer.modify(\n            customer_id,\n            source=payment_method_token\n        )\n\n        # Store only customer_id and payment_method_id in your database\n        # NEVER store actual card details\n        return {\n            'customer_id': customer_id,\n            'has_payment_method': True\n            # DO NOT store: card number, CVV, etc.\n        }\n```\n\n### Custom Tokenization (Advanced)\n\n```python\nimport secrets\nfrom cryptography.fernet import Fernet\n\nclass TokenVault:\n    \"\"\"Secure token vault for card data (if you must store it).\"\"\"\n\n    def __init__(self, encryption_key):\n        self.cipher = Fernet(encryption_key)\n        self.vault = {}  # In production: use encrypted database\n\n    def tokenize(self, card_data):\n        \"\"\"Convert card data to token.\"\"\"\n        # Generate secure random token\n        token = secrets.token_urlsafe(32)\n\n        # Encrypt card data\n        encrypted = self.cipher.encrypt(json.dumps(card_data).encode())\n\n        # Store token -> encrypted data mapping\n        self.vault[token] = encrypted\n\n        return token\n\n    def detokenize(self, token):\n        \"\"\"Retrieve card data from token.\"\"\"\n        encrypted = self.vault.get(token)\n        if not encrypted:\n            raise ValueError(\"Token not found\")\n\n        # Decrypt\n        decrypted = self.cipher.decrypt(encrypted)\n        return json.loads(decrypted.decode())\n\n    def delete_token(self, token):\n        \"\"\"Remove token from vault.\"\"\"\n        self.vault.pop(token, None)\n```\n\n## Encryption\n\n### Data at Rest\n\n```python\nfrom cryptography.hazmat.primitives.ciphers.aead import AESGCM\nimport os\n\nclass EncryptedStorage:\n    \"\"\"Encrypt data at rest using AES-256-GCM.\"\"\"\n\n    def __init__(self, encryption_key):\n        \"\"\"Initialize with 256-bit key.\"\"\"\n        self.key = encryption_key  # Must be 32 bytes\n\n    def encrypt(self, plaintext):\n        \"\"\"Encrypt data.\"\"\"\n        # Generate random nonce\n        nonce = os.urandom(12)\n\n        # Encrypt\n        aesgcm = AESGCM(self.key)\n        ciphertext = aesgcm.encrypt(nonce, plaintext.encode(), None)\n\n        # Return nonce + ciphertext\n        return nonce + ciphertext\n\n    def decrypt(self, encrypted_data):\n        \"\"\"Decrypt data.\"\"\"\n        # Extract nonce and ciphertext\n        nonce = encrypted_data[:12]\n        ciphertext = encrypted_data[12:]\n\n        # Decrypt\n        aesgcm = AESGCM(self.key)\n        plaintext = aesgcm.decrypt(nonce, ciphertext, None)\n\n        return plaintext.decode()\n\n# Usage\nstorage = EncryptedStorage(os.urandom(32))\nencrypted_pan = storage.encrypt(\"4242424242424242\")\n# Store encrypted_pan in database\n```\n\n### Data in Transit\n\n```python\n# Always use TLS 1.2 or higher\n# Flask\u002FDjango example\napp.config['SESSION_COOKIE_SECURE'] = True  # HTTPS only\napp.config['SESSION_COOKIE_HTTPONLY'] = True\napp.config['SESSION_COOKIE_SAMESITE'] = 'Strict'\n\n# Enforce HTTPS\nfrom flask_talisman import Talisman\nTalisman(app, force_https=True)\n```\n\n## Access Control\n\n```python\nfrom functools import wraps\nfrom flask import session\n\ndef require_pci_access(f):\n    \"\"\"Decorator to restrict access to cardholder data.\"\"\"\n    @wraps(f)\n    def decorated_function(*args, **kwargs):\n        user = session.get('user')\n\n        # Check if user has PCI access role\n        if not user or 'pci_access' not in user.get('roles', []):\n            return {'error': 'Unauthorized access to cardholder data'}, 403\n\n        # Log access attempt\n        audit_log(\n            user=user['id'],\n            action='access_cardholder_data',\n            resource=f.__name__\n        )\n\n        return f(*args, **kwargs)\n\n    return decorated_function\n\n@app.route('\u002Fapi\u002Fpayment-methods')\n@require_pci_access\ndef get_payment_methods():\n    \"\"\"Retrieve payment methods (restricted access).\"\"\"\n    # Only accessible to users with pci_access role\n    pass\n```\n\n## Audit Logging\n\n```python\nimport logging\nfrom datetime import datetime\n\nclass PCIAuditLogger:\n    \"\"\"PCI-compliant audit logging.\"\"\"\n\n    def __init__(self):\n        self.logger = logging.getLogger('pci_audit')\n        # Configure to write to secure, append-only log\n\n    def log_access(self, user_id, resource, action, result):\n        \"\"\"Log access to cardholder data.\"\"\"\n        entry = {\n            'timestamp': datetime.utcnow().isoformat(),\n            'user_id': user_id,\n            'resource': resource,\n            'action': action,\n            'result': result,\n            'ip_address': request.remote_addr\n        }\n\n        self.logger.info(json.dumps(entry))\n\n    def log_authentication(self, user_id, success, method):\n        \"\"\"Log authentication attempt.\"\"\"\n        entry = {\n            'timestamp': datetime.utcnow().isoformat(),\n            'user_id': user_id,\n            'event': 'authentication',\n            'success': success,\n            'method': method,\n            'ip_address': request.remote_addr\n        }\n\n        self.logger.info(json.dumps(entry))\n\n# Usage\naudit = PCIAuditLogger()\naudit.log_access(user_id=123, resource='payment_methods', action='read', result='success')\n```\n\n## Security Best Practices\n\n### Input Validation\n\n```python\nimport re\n\ndef validate_card_number(card_number):\n    \"\"\"Validate card number format (Luhn algorithm).\"\"\"\n    # Remove spaces and dashes\n    card_number = re.sub(r'[\\s-]', '', card_number)\n\n    # Check if all digits\n    if not card_number.isdigit():\n        return False\n\n    # Luhn algorithm\n    def luhn_checksum(card_num):\n        def digits_of(n):\n            return [int(d) for d in str(n)]\n\n        digits = digits_of(card_num)\n        odd_digits = digits[-1::-2]\n        even_digits = digits[-2::-2]\n        checksum = sum(odd_digits)\n        for d in even_digits:\n            checksum += sum(digits_of(d * 2))\n        return checksum % 10\n\n    return luhn_checksum(card_number) == 0\n\ndef sanitize_input(user_input):\n    \"\"\"Sanitize user input to prevent injection.\"\"\"\n    # Remove special characters\n    # Validate against expected format\n    # Escape for database queries\n    pass\n```\n\n## PCI DSS SAQ (Self-Assessment Questionnaire)\n\n### SAQ A (Least Requirements)\n\n- E-commerce using hosted payment page\n- No card data on your systems\n- ~20 questions\n\n### SAQ A-EP\n\n- E-commerce with embedded payment form\n- Uses JavaScript to handle card data\n- ~180 questions\n\n### SAQ D (Most Requirements)\n\n- Store, process, or transmit card data\n- Full PCI DSS requirements\n- ~300 questions\n\n## Compliance Checklist\n\n```python\nPCI_COMPLIANCE_CHECKLIST = {\n    'network_security': [\n        'Firewall configured and maintained',\n        'No vendor default passwords',\n        'Network segmentation implemented'\n    ],\n    'data_protection': [\n        'No storage of CVV, track data, or PIN',\n        'PAN encrypted when stored',\n        'PAN masked when displayed',\n        'Encryption keys properly managed'\n    ],\n    'vulnerability_management': [\n        'Anti-virus installed and updated',\n        'Secure development practices',\n        'Regular security patches',\n        'Vulnerability scanning performed'\n    ],\n    'access_control': [\n        'Access restricted by role',\n        'Unique IDs for all users',\n        'Multi-factor authentication',\n        'Physical security measures'\n    ],\n    'monitoring': [\n        'Audit logs enabled',\n        'Log review process',\n        'File integrity monitoring',\n        'Regular security testing'\n    ],\n    'policy': [\n        'Security policy documented',\n        'Risk assessment performed',\n        'Security awareness training',\n        'Incident response plan'\n    ]\n}\n```\n","# PCI Compliance\n\nMaster PCI DSS (Payment Card Industry Data Security Standard) compliance for secure payment processing and handling of cardholder data.\n\n## When to Use This Skill\n\n- Building payment processing systems\n- Handling credit card information\n- Implementing secure payment flows\n- Conducting PCI compliance audits\n- Reducing PCI compliance scope\n- Implementing tokenization and encryption\n- Preparing for PCI DSS assessments\n\n## PCI DSS Requirements (12 Core Requirements)\n\n### Build and Maintain Secure Network\n\n1. Install and maintain firewall configuration\n2. Don't use vendor-supplied defaults for passwords\n\n### Protect Cardholder Data\n\n3. Protect stored cardholder data\n4. Encrypt transmission of cardholder data across public networks\n\n### Maintain Vulnerability Management\n\n5. Protect systems against malware\n6. Develop and maintain secure systems and applications\n\n### Implement Strong Access Control\n\n7. Restrict access to cardholder data by business need-to-know\n8. Identify and authenticate access to system components\n9. Restrict physical access to cardholder data\n\n### Monitor and Test Networks\n\n10. Track and monitor all access to network resources and cardholder data\n11. Regularly test security systems and processes\n\n### Maintain Information Security Policy\n\n12. Maintain a policy that addresses information security\n\n## Compliance Levels\n\n**Level 1**: > 6 million transactions\u002Fyear (annual ROC required)\n**Level 2**: 1-6 million transactions\u002Fyear (annual SAQ)\n**Level 3**: 20,000-1 million e-commerce transactions\u002Fyear\n**Level 4**: \u003C 20,000 e-commerce or \u003C 1 million total transactions\n\n## Data Minimization (Never Store)\n\n```python\n# NEVER STORE THESE\nPROHIBITED_DATA = {\n    'full_track_data': 'Magnetic stripe data',\n    'cvv': 'Card verification code\u002Fvalue',\n    'pin': 'PIN or PIN block'\n}\n\n# CAN STORE (if encrypted)\nALLOWED_DATA = {\n    'pan': 'Primary Account Number (card number)',\n    'cardholder_name': 'Name on card',\n    'expiration_date': 'Card expiration',\n    'service_code': 'Service code'\n}\n\nclass PaymentData:\n    \"\"\"Safe payment data handling.\"\"\"\n\n    def __init__(self):\n        self.prohibited_fields = ['cvv', 'cvv2', 'cvc', 'pin']\n\n    def sanitize_log(self, data):\n        \"\"\"Remove sensitive data from logs.\"\"\"\n        sanitized = data.copy()\n\n        # Mask PAN\n        if 'card_number' in sanitized:\n            card = sanitized['card_number']\n            sanitized['card_number'] = f\"{card[:6]}{'*' * (len(card) - 10)}{card[-4:]}\"\n\n        # Remove prohibited data\n        for field in self.prohibited_fields:\n            sanitized.pop(field, None)\n\n        return sanitized\n\n    def validate_no_prohibited_storage(self, data):\n        \"\"\"Ensure no prohibited data is being stored.\"\"\"\n        for field in self.prohibited_fields:\n            if field in data:\n                raise SecurityError(f\"Attempting to store prohibited field: {field}\")\n```\n\n## Tokenization\n\n### Using Payment Processor Tokens\n\n```python\nimport stripe\n\nclass TokenizedPayment:\n    \"\"\"Handle payments using tokens (no card data on server).\"\"\"\n\n    @staticmethod\n    def create_payment_method_token(card_details):\n        \"\"\"Create token from card details (client-side only).\"\"\"\n        # THIS SHOULD ONLY BE DONE CLIENT-SIDE WITH STRIPE.JS\n        # NEVER send card details to your server\n\n        \"\"\"\n        \u002F\u002F Frontend JavaScript\n        const stripe = Stripe('pk_...');\n\n        const {token, error} = await stripe.createToken({\n            card: {\n                number: '4242424242424242',\n                exp_month: 12,\n                exp_year: 2024,\n                cvc: '123'\n            }\n        });\n\n        \u002F\u002F Send token.id to server (NOT card details)\n        \"\"\"\n        pass\n\n    @staticmethod\n    def charge_with_token(token_id, amount):\n        \"\"\"Charge using token (server-side).\"\"\"\n        # Your server only sees the token, never the card number\n        stripe.api_key = \"sk_...\"\n\n        charge = stripe.Charge.create(\n            amount=amount,\n            currency=\"usd\",\n            source=token_id,  # Token instead of card details\n            description=\"Payment\"\n        )\n\n        return charge\n\n    @staticmethod\n    def store_payment_method(customer_id, payment_method_token):\n        \"\"\"Store payment method as token for future use.\"\"\"\n        stripe.Customer.modify(\n            customer_id,\n            source=payment_method_token\n        )\n\n        # Store only customer_id and payment_method_id in your database\n        # NEVER store actual card details\n        return {\n            'customer_id': customer_id,\n            'has_payment_method': True\n            # DO NOT store: card number, CVV, etc.\n        }\n```\n\n### Custom Tokenization (Advanced)\n\n```python\nimport secrets\nfrom cryptography.fernet import Fernet\n\nclass TokenVault:\n    \"\"\"Secure token vault for card data (if you must store it).\"\"\"\n\n    def __init__(self, encryption_key):\n        self.cipher = Fernet(encryption_key)\n        self.vault = {}  # In production: use encrypted database\n\n    def tokenize(self, card_data):\n        \"\"\"Convert card data to token.\"\"\"\n        # Generate secure random token\n        token = secrets.token_urlsafe(32)\n\n        # Encrypt card data\n        encrypted = self.cipher.encrypt(json.dumps(card_data).encode())\n\n        # Store token -> encrypted data mapping\n        self.vault[token] = encrypted\n\n        return token\n\n    def detokenize(self, token):\n        \"\"\"Retrieve card data from token.\"\"\"\n        encrypted = self.vault.get(token)\n        if not encrypted:\n            raise ValueError(\"Token not found\")\n\n        # Decrypt\n        decrypted = self.cipher.decrypt(encrypted)\n        return json.loads(decrypted.decode())\n\n    def delete_token(self, token):\n        \"\"\"Remove token from vault.\"\"\"\n        self.vault.pop(token, None)\n```\n\n## Encryption\n\n### Data at Rest\n\n```python\nfrom cryptography.hazmat.primitives.ciphers.aead import AESGCM\nimport os\n\nclass EncryptedStorage:\n    \"\"\"Encrypt data at rest using AES-256-GCM.\"\"\"\n\n    def __init__(self, encryption_key):\n        \"\"\"Initialize with 256-bit key.\"\"\"\n        self.key = encryption_key  # Must be 32 bytes\n\n    def encrypt(self, plaintext):\n        \"\"\"Encrypt data.\"\"\"\n        # Generate random nonce\n        nonce = os.urandom(12)\n\n        # Encrypt\n        aesgcm = AESGCM(self.key)\n        ciphertext = aesgcm.encrypt(nonce, plaintext.encode(), None)\n\n        # Return nonce + ciphertext\n        return nonce + ciphertext\n\n    def decrypt(self, encrypted_data):\n        \"\"\"Decrypt data.\"\"\"\n        # Extract nonce and ciphertext\n        nonce = encrypted_data[:12]\n        ciphertext = encrypted_data[12:]\n\n        # Decrypt\n        aesgcm = AESGCM(self.key)\n        plaintext = aesgcm.decrypt(nonce, ciphertext, None)\n\n        return plaintext.decode()\n\n# Usage\nstorage = EncryptedStorage(os.urandom(32))\nencrypted_pan = storage.encrypt(\"4242424242424242\")\n# Store encrypted_pan in database\n```\n\n### Data in Transit\n\n```python\n# Always use TLS 1.2 or higher\n# Flask\u002FDjango example\napp.config['SESSION_COOKIE_SECURE'] = True  # HTTPS only\napp.config['SESSION_COOKIE_HTTPONLY'] = True\napp.config['SESSION_COOKIE_SAMESITE'] = 'Strict'\n\n# Enforce HTTPS\nfrom flask_talisman import Talisman\nTalisman(app, force_https=True)\n```\n\n## Access Control\n\n```python\nfrom functools import wraps\nfrom flask import session\n\ndef require_pci_access(f):\n    \"\"\"Decorator to restrict access to cardholder data.\"\"\"\n    @wraps(f)\n    def decorated_function(*args, **kwargs):\n        user = session.get('user')\n\n        # Check if user has PCI access role\n        if not user or 'pci_access' not in user.get('roles', []):\n            return {'error': 'Unauthorized access to cardholder data'}, 403\n\n        # Log access attempt\n        audit_log(\n            user=user['id'],\n            action='access_cardholder_data',\n            resource=f.__name__\n        )\n\n        return f(*args, **kwargs)\n\n    return decorated_function\n\n@app.route('\u002Fapi\u002Fpayment-methods')\n@require_pci_access\ndef get_payment_methods():\n    \"\"\"Retrieve payment methods (restricted access).\"\"\"\n    # Only accessible to users with pci_access role\n    pass\n```\n\n## Audit Logging\n\n```python\nimport logging\nfrom datetime import datetime\n\nclass PCIAuditLogger:\n    \"\"\"PCI-compliant audit logging.\"\"\"\n\n    def __init__(self):\n        self.logger = logging.getLogger('pci_audit')\n        # Configure to write to secure, append-only log\n\n    def log_access(self, user_id, resource, action, result):\n        \"\"\"Log access to cardholder data.\"\"\"\n        entry = {\n            'timestamp': datetime.utcnow().isoformat(),\n            'user_id': user_id,\n            'resource': resource,\n            'action': action,\n            'result': result,\n            'ip_address': request.remote_addr\n        }\n\n        self.logger.info(json.dumps(entry))\n\n    def log_authentication(self, user_id, success, method):\n        \"\"\"Log authentication attempt.\"\"\"\n        entry = {\n            'timestamp': datetime.utcnow().isoformat(),\n            'user_id': user_id,\n            'event': 'authentication',\n            'success': success,\n            'method': method,\n            'ip_address': request.remote_addr\n        }\n\n        self.logger.info(json.dumps(entry))\n\n# Usage\naudit = PCIAuditLogger()\naudit.log_access(user_id=123, resource='payment_methods', action='read', result='success')\n```\n\n## Security Best Practices\n\n### Input Validation\n\n```python\nimport re\n\ndef validate_card_number(card_number):\n    \"\"\"Validate card number format (Luhn algorithm).\"\"\"\n    # Remove spaces and dashes\n    card_number = re.sub(r'[\\s-]', '', card_number)\n\n    # Check if all digits\n    if not card_number.isdigit():\n        return False\n\n    # Luhn algorithm\n    def luhn_checksum(card_num):\n        def digits_of(n):\n            return [int(d) for d in str(n)]\n\n        digits = digits_of(card_num)\n        odd_digits = digits[-1::-2]\n        even_digits = digits[-2::-2]\n        checksum = sum(odd_digits)\n        for d in even_digits:\n            checksum += sum(digits_of(d * 2))\n        return checksum % 10\n\n    return luhn_checksum(card_number) == 0\n\ndef sanitize_input(user_input):\n    \"\"\"Sanitize user input to prevent injection.\"\"\"\n    # Remove special characters\n    # Validate against expected format\n    # Escape for database queries\n    pass\n```\n\n## PCI DSS SAQ (Self-Assessment Questionnaire)\n\n### SAQ A (Least Requirements)\n\n- E-commerce using hosted payment page\n- No card data on your systems\n- ~20 questions\n\n### SAQ A-EP\n\n- E-commerce with embedded payment form\n- Uses JavaScript to handle card data\n- ~180 questions\n\n### SAQ D (Most Requirements)\n\n- Store, process, or transmit card data\n- Full PCI DSS requirements\n- ~300 questions\n\n## Compliance Checklist\n\n```python\nPCI_COMPLIANCE_CHECKLIST = {\n    'network_security': [\n        'Firewall configured and maintained',\n        'No vendor default passwords',\n        'Network segmentation implemented'\n    ],\n    'data_protection': [\n        'No storage of CVV, track data, or PIN',\n        'PAN encrypted when stored',\n        'PAN masked when displayed',\n        'Encryption keys properly managed'\n    ],\n    'vulnerability_management': [\n        'Anti-virus installed and updated',\n        'Secure development practices',\n        'Regular security patches',\n        'Vulnerability scanning performed'\n    ],\n    'access_control': [\n        'Access restricted by role',\n        'Unique IDs for all users',\n        'Multi-factor authentication',\n        'Physical security measures'\n    ],\n    'monitoring': [\n        'Audit logs enabled',\n        'Log review process',\n        'File integrity monitoring',\n        'Regular security testing'\n    ],\n    'policy': [\n        'Security policy documented',\n        'Risk assessment performed',\n        'Security awareness training',\n        'Incident response plan'\n    ]\n}\n```\n",{"name":5,"description":7},"main","87afe6ce96220accf50a345dea46784c8c9f210e","YYC3-Plugin-插件协议\u002FYYC3-Plugin-插件协议-plugins-claude\u002Fpayment-processing\u002Fskills\u002Fpci-compliance",0,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base","https:\u002F\u002Fkb.yyc3.top\u002F","https:\u002F\u002Fgithub.com\u002FYYC-Cube","万象归元于云枢 | 深栈智启新纪元","2026-11-10 10:37:32",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill pci-compliance",{"tool":39,"command":40},"bunx","bunx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill pci-compliance",{"tool":42,"command":43},"pnpm","pnpm dlx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill pci-compliance","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Plugin-插件协议\u002FYYC3-Plugin-插件协议-plugins-claude\u002Fpayment-processing\u002Fskills\u002Fpci-compliance\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7CTDWHERCXPQCP0K03A86AS","vercel-sandbox","Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include \"Vercel Sandbox browser\", \"microVM Chrome\", \"agent-browser in sandbox\", \"browser automation on Vercel\", or any task requiring Chrome in a Vercel Sandbox.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fvercel-sandbox\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7CTD8D2BNJY54S65M47HEJA","slack","Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include \"check my Slack\", \"what channels have unreads\", \"send a message to\", \"search Slack for\", \"extract from Slack\", \"find who said\", or any task requiring programmatic Slack interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fslack\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7CTCSSB8ZP3Q58C3YZDZK1W","electron","Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include \"automate Slack app\", \"control VS Code\", \"interact with Discord app\", \"test this Electron app\", \"connect to desktop app\", or any task requiring automation of a native Electron application.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Felectron\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7CTCBJY76688V4DCZGWFHGQ","dogfood","Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to \"dogfood\", \"QA\", \"exploratory test\", \"find issues\", \"bug hunt\", \"test this app\u002Fsite\u002Fplatform\", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fdogfood\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7CTC4H0FFGVEAQR9PA4GA1A","agent-browser","Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fagent-browser\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7CTBKVFYBG78FDSABSDJTTQ","shadcn","Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn\u002Fui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for \"shadcn init\", \"create an app with --preset\", \"switch to --preset\", and for building a design system or applying a DESIGN.md or brand spec to shadcn\u002Fui.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-UI-界面组件\u002FYYC3-UI-界面组件-ui\u002Fskills\u002Fshadcn\u002FSKILL.md",[],[]]