cs-policy
Verify code compliance with policies and standards: HIPAA, SOC2, PCI-DSS, custom style guides. Validate policy file integrity with cryptographic verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Verify code compliance with policies and standards: HIPAA, SOC2, PCI-DSS, custom style guides. Validate policy file integrity with cryptographic verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Analyze code structure: parse functions, classes, imports, and complexity metrics. Use to understand a file or project without reading the source code directly.
Extract a specific function, class, or method from a file using Code Scalpel. Use when you need to show a symbol without reading the entire file—saves 95% of context.
Map project architecture: discover modules, build call graphs, visualize structure, trace critical paths. Complete architecture overview with dependency flows.
Safe refactoring workflow: find all usages, trace dependencies, simulate changes, generate baseline tests, then apply with backup. Behavior-preserving refactor.
Full security audit: detect local vulnerabilities, cross-file taint flows, CVEs in dependencies, and polyglot sink patterns. Complete security scan pipeline.
Install and verify the Code Scalpel MCP server. Checks if codescalpel is already installed in Claude Code, runs `claude mcp add` if needed, and confirms connection by fetching capabilities.
| name | cs-policy |
| description | Verify code compliance with policies and standards: HIPAA, SOC2, PCI-DSS, custom style guides. Validate policy file integrity with cryptographic verification. |
| allowed-tools | ["mcp__codescalpel__validate_paths","mcp__codescalpel__code_policy_check","mcp__codescalpel__verify_policy_integrity"] |
| preamble-tier | 1 |
Check your code against regulatory standards, style guides, and custom policies. Verify policy files are authentic using cryptographic signatures.
/cs-policy
/cs-policy src/ --standards HIPAA,SOC2
/cs-policy . --rules company-style-guide.yaml
For healthcare applications handling protected health information (PHI):
For cloud/SaaS providers:
For applications handling credit card data:
Define your own compliance rules in YAML:
rules:
no_hardcoded_secrets:
description: "Never hardcode passwords, API keys, or tokens"
patterns:
- '["'\'']password["'\'']'
- 'PRIVATE_KEY'
- 'API_KEY.*=.*["'\'']'
severity: critical
require_docstrings:
description: "All public functions must have docstrings"
file_patterns: ["*.py"]
severity: warning
Checks that all files referenced in policies are accessible. Prevents false negatives from missing or mounted files.
Scans your codebase for violations:
Cryptographically verify policy files haven't been tampered with:
Results organized by:
Compliance Report
CRITICAL (3 violations):
✗ src/api/auth.py:45 — Hardcoded password
✗ src/config.py:12 — API key in source code
✗ src/utils.py:89 — Unencrypted database credential
HIGH (5 violations):
✗ src/services/payment.py — Missing docstring
✗ src/models/user.py — SQL injection risk
[...]
Policy Integrity: ✓ Valid (signed 2026-03-20)
✅ Before releasing to production ✅ Preparing for compliance audits ✅ During code review (check for policy violations) ✅ Setting team standards ✅ Onboarding new developers (verify they follow rules) ✅ Regular compliance sweeps
For each violation:
/cs-extract to view the code/cs-refactor to fix it safely/cs-policy to confirmExample:
# Find violations
/cs-policy src/api/
# View and fix the code
/cs-extract src/api/auth.py function authenticate
# Refactor safely
/cs-refactor src/api/auth.py function authenticate
# Verify it's fixed
/cs-policy src/api/
| Feature | Community | Pro | Enterprise |
|---|---|---|---|
| Basic code policy check | ✓ | ✓ | ✓ |
| HIPAA/SOC2/PCI-DSS rules | ✓ | ✓ | |
| Custom policy files | ✓ | ||
| Policy integrity verification | ✓ | ✓ | ✓ |
| Compliance reporting | ✓ | ✓ |
/cs-policy to scan/cs-refactorSee CLAUDE.md for the complete compliance workflow.