VCP: Enforcing Code Standards in AI-Assisted Development with Claude Code
A step-by-step guide to installing and using Vibe Coding Protocol (VCP) — a three-layer enforcement framework that catches security vulnerabilities, enforces architecture standards, and orchestrates multi-AI code reviews directly inside Claude Code.
AI-powered · Limited to 20 requests per hour
AI-generated code ships faster, but the numbers are not great: a 2.74x higher vulnerability rate compared to human-written code (CodeRabbit 2025), 45% of AI code containing security flaws (Veracode 2025), and an 8x increase in code duplication (GitClear 2024). The speed gains evaporate when you spend the next sprint patching what the AI introduced.
Vibe Coding Protocol (VCP) is an open-source Claude Code plugin that enforces 40 security, architecture, and quality standards across 12 technology scopes — not as a linter you run after the fact, but as a three-layer system that prevents bad code before it reaches disk.
Below: how to install VCP, configure it for your project, and use its key commands, with real output examples.
What VCP Does
VCP operates in three layers, each catching what the others miss:
| Layer | When | How |
|---|---|---|
| Proactive Context | Session start | Injects applicable rules into Claude's context so it writes better code from the start |
| Real-Time Blocking | Every file write | A security gate hook checks 21 regex patterns across 9 CWEs and blocks dangerous code before it hits disk |
| On-Demand Scanning | When you ask | 10 skills provide deep AI-driven analysis — audits, pre-commit reviews, dependency checks, test quality reviews |
The standards cover OWASP Top 10:2025, CWE Top 25:2024, OWASP API Security Top 10, and compliance frameworks (GDPR, PCI DSS, HIPAA). Each standard includes actionable rules, code examples (do this / not this), and documented exceptions.
Prerequisites
- Claude Code (CLI)
- Bun runtime (VCP hooks are TypeScript, executed by Bun)
Step 1: Install the VCP Plugin
Open Claude Code in your project directory and run:
/plugin marketplace add Z-M-Huang/vcpThis registers the VCP marketplace. Now install the VCP plugin:
/plugin install vcp@vcpYou should see confirmation that the plugin was installed with its hooks and skills registered.
Step 2: Initialize Your Project
Run the init command to create your project configuration:
/vcp-initVCP will:
- Create
~/.vcp/config.json(global config) if it doesn't exist - Detect your project's frameworks and technology scopes
- Create
.vcp/config.jsonin your project root
Here's what a typical project config looks like after initialization:
{
"version": "1.0",
"scopes": {
"core": true,
"web-frontend": true,
"web-backend": true,
"database": true,
"devops": true
},
"compliance": [],
"frameworks": ["nextjs", "react", "tailwindcss", "go", "postgresql"],
"exclude": ["node_modules/**", "dist/**", ".next/**"],
"severity": "medium",
"ignore": []
}The scopes field controls which standards apply. A React + Go project gets web-frontend and web-backend standards. A mobile app would get mobile instead. Core standards (security, architecture, error handling, etc.) are always active.
Step 3: Verify the Security Gate
The security gate hook runs automatically on every Write, Edit, and Bash tool call. It blocks 21 dangerous patterns across 9 CWEs before code reaches your files.
To verify it's working, try asking Claude to write code with a hardcoded secret:
> Write a function that connects to the database with password "supersecret123"The security gate will block this with output like:
BLOCKED by VCP Security Gate
CWE-798: Hardcoded credential detected
Pattern: password\s*[:=]\s*["'][^"']{8,}["']
The code was not written to disk. Use environment variables
or a secrets manager instead of hardcoding credentials.Here are some of the patterns it catches:
| CWE | What It Catches | Example |
|---|---|---|
| CWE-798 | Hardcoded secrets | password = "abc123", AWS keys (AKIA...), JWT tokens |
| CWE-89 | SQL injection | `SELECT * FROM users WHERE id = ${id}` |
| CWE-95 | Code injection | eval(userInput) |
| CWE-79 | XSS | element.innerHTML = userInput |
| CWE-502 | Insecure deserialization | pickle.load(untrusted), yaml.load() |
| CWE-1321 | Prototype pollution | obj.__proto__ = malicious |
Step 4: Run Your First Audit
The /vcp-audit command performs a comprehensive analysis against all applicable standards:
/vcp-audit src/VCP will scan the specified path and produce a structured report. Here's an abbreviated example output:
VCP Audit Report — src/
Standards applied: 24 (core: 12, web-frontend: 4, web-backend: 6, database: 2)
Severity threshold: medium
CRITICAL
[core-security/rule-1] src/api/users.ts:42
SQL query uses string concatenation instead of parameterized query.
Fix: Use parameterized query — db.query("SELECT * FROM users WHERE id = $1", [id])
[core-security/rule-4] src/config/database.ts:8
Database password hardcoded in source file.
Fix: Read from environment variable — process.env.DB_PASSWORD
HIGH
[web-backend-security/rule-7] src/api/auth.ts:15
Authorization check missing on /api/admin/* endpoints.
Fix: Add authentication middleware before route handlers.
[core-error-handling/rule-1] src/services/payment.ts:67
Empty catch block silently swallows PaymentError.
Fix: Log the error and re-throw or return a typed error response.
MEDIUM
[core-architecture/rule-1] src/api/users.ts:1-180
Handler contains business logic, database queries, and response formatting.
Fix: Extract business logic to a service layer, database access to a repository.
[core-code-quality/rule-3] src/utils/validate.ts + src/helpers/check.ts
Duplicate email validation logic in two files.
Fix: Consolidate into a single validation module.
Summary: 2 critical, 2 high, 2 medium, 0 low
Verdict: NEEDS REMEDIATIONAudit Variants
VCP offers three audit modes:
/vcp-audit src/ # Full audit with validation pass
/vcp-audit quick # Fast scan, no validation (good for iteration)
/vcp-audit compliance gdpr # Audit against a specific compliance frameworkThe compliance audit checks your code against framework-specific requirements — GDPR data handling, PCI DSS payment security, or HIPAA health data protections.
Step 5: Pre-Commit Review
Before committing, run the pre-commit review to check only your changed files:
/vcp-pre-commit-reviewThis scans staged and unstaged changes and produces a PASS or BLOCK verdict:
VCP Pre-Commit Review
Files reviewed: 3
M src/api/auth.ts
M src/services/user.ts
A src/middleware/rate-limit.ts
Findings:
[PASS] src/middleware/rate-limit.ts
No issues found.
[PASS] src/services/user.ts
No issues found.
[BLOCK] src/api/auth.ts
core-security/rule-6: JWT token validation missing audience check.
Fix: Add { audience: "your-app" } to jwt.verify() options.
Verdict: BLOCK (1 finding requires remediation before commit)Step 6: Check Your Dependencies
The dependency check verifies your lockfile, version ranges, and package legitimacy:
/vcp-dependency-checkExample output:
VCP Dependency Check
Lockfile: bun.lock (present, committed)
Dependencies analyzed: 147
WARNINGS:
[version-range] express: "^4.18.0" — wide range allows minor versions
with potential breaking changes. Consider pinning to "4.18.2".
[typosquat-risk] lodahs (devDependencies)
Possible typosquat of "lodash". Verify this is the intended package.
[no-lockfile-entry] @internal/utils
Package in dependencies but missing from lockfile.
Run: bun install
PASS: No critical dependency issues found.Step 7: Review Test Quality
VCP can analyze your tests for common anti-patterns:
/vcp-review-tests src/__tests__/VCP Test Quality Review — src/__tests__/
[NEEDS WORK] auth.test.ts
- Excessive mocking: 7 mock setup calls. Tests validate mock behavior,
not real logic. Consider integration tests with fewer mocks.
- Tautological assertion (line 45): Asserts mock returns exactly what
it was configured to return. This tests the mock framework, not your code.
[GOOD] rate-limit.test.ts
- Tests real behavior with minimal mocking.
- Covers edge cases: zero requests, boundary values, clock rollover.
[NEEDS WORK] user.test.ts
- Missing edge cases: no test for empty input, null values,
or concurrent access.
- All assertions check happy path only.
Summary: 1 good, 2 need work, 0 rewriteConfiguring VCP
Adjusting Severity
Control which findings appear by setting the severity threshold:
/vcp-config severity highOptions: critical, high, medium (default), low. Setting high hides medium and low findings.
Enabling Compliance
Add compliance frameworks to your project:
/vcp-config compliance add gdprThis activates GDPR-specific standards on top of your existing scopes.
Ignoring Rules
If a rule doesn't apply to your project, suppress it:
/vcp-config ignore add core-architecture/rule-5You can ignore by standard ID (core-architecture), specific rule (core-architecture/rule-5), or CWE pattern (CWE-798). Ignored rules are recorded in .vcp/config.json for transparency.
Managing Scopes
Enable or disable technology scopes:
/vcp-config scope enable agentic-ai # Building AI agents? Add these standards
/vcp-config scope disable mobile # Not a mobile projectHow It Works Under the Hood
Standards Architecture
VCP's 40 standards are markdown files hosted on GitHub, fetched at runtime via a manifest system:
manifest.json (root)
→ scopes/core.json → 12 standards (always active)
→ scopes/web-frontend.json → 4 standards
→ scopes/web-backend.json → 6 standards
→ scopes/database.json → 2 standards
→ scopes/devops.json → 4 standards
→ scopes/agentic-ai.json → 5 standards
→ scopes/compliance-*.json → 3 compliance frameworks
...Each standard follows a consistent structure:
## Principle
WHY this standard exists (1-3 sentences)
## Rules
1. Validate all input at system boundaries.
2. Parameterize all data queries. No exceptions.
...
## Patterns
### Do This
(correct code example with explanation)
### Not This
(vulnerable code example with explanation)
## Exceptions
When deviation is acceptable and what safeguards are needed.This structure is written so an LLM can parse rules, understand reasoning, and apply them contextually rather than following a rigid checklist.
The Security Gate in Detail
The real-time security gate (security-gate.ts) runs as a Claude Code PreToolUse hook. Every time Claude attempts to write a file or run a command:
- The hook receives the tool input as JSON on stdin
- It extracts the content being written (or the command being run)
- It checks against 21 compiled regex patterns
- If a pattern matches, it exits with code 2 — Claude Code interprets this as a block and refuses to write the code
Documentation files (.md, .mdx, .txt, .rst) are exempt — you can write about security vulnerabilities without triggering the gate.
The patterns are deliberately conservative. They catch the most common and dangerous mistakes (hardcoded passwords, SQL concatenation, eval() with variables) without drowning you in false positives. For deeper analysis that traces data flow across variables and functions, use /vcp-audit.
The Bigger Picture
AI writes code fast, but speed without standards produces technical debt. Traditional linters catch syntax issues but miss architectural violations, security anti-patterns, and testing deficiencies.
VCP differs from linters in a few ways: rules are injected before code is written, not checked after. Standards explain why, so the AI can apply judgment instead of following a rigid checklist. No single layer catches everything, but the three layers together cover more ground. And you only enable the scopes and compliance frameworks your project actually needs.
Quick Reference
| Command | What It Does |
|---|---|
/vcp-init | Initialize project config |
/vcp-context | Re-inject rules (after context compaction) |
/vcp-audit [path] | Full standards audit |
/vcp-audit quick | Fast audit without validation pass |
/vcp-audit compliance gdpr | Compliance-specific audit |
/vcp-pre-commit-review | Review changed files (PASS/BLOCK) |
/vcp-dependency-check | Verify lockfile, versions, package legitimacy |
/vcp-review-tests [path] | Analyze test quality and anti-patterns |
/vcp-coverage-gaps [path] | Find untested functions and missing edge cases |
/vcp-test-plan [path] | Generate structured test plans |
/vcp-root-cause-check | Verify a bug fix addresses root cause |
/vcp-config [command] | Manage scopes, compliance, severity, ignore rules |
The source code and full documentation are on GitHub.
License
Article text © 2026 Mark Huang. Licensed under Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) unless otherwise noted. Article text is licensed for non-commercial sharing with attribution to the original article URL. Commercial use requires prior written permission and must clearly cite the original source.
Code snippets, screenshots, third-party assets, and site source code may have separate terms.
Suggested attribution: Based on "VCP: Enforcing Code Standards in AI-Assisted Development with Claude Code" by Mark Huang, originally published at https://markhuang.ai/blog/vcp-enforce-code-standards-with-claude-code.
Related Articles

Dev Buddy: Multi-AI Development Pipelines for Claude Code
A step-by-step guide to Dev Buddy — an open-source Claude Code plugin that orchestrates multiple AI models through structured development pipelines with task-based enforcement, parallel specialist analysis, and automatic fix-and-re-review loops.
Read article
Permission Syndrome: Why --dangerously-skip-permissions Is the Vibe Coder's Favorite Footgun
Real incidents of AI wiping home directories and production databases — and how VCP's security gate and Docker image let you keep the speed of --dangerously-skip-permissions without the risk.
Read article
Try Dense-Mem in 5 Minutes With the Hosted Demo
A quick tutorial for using the hosted Dense-Mem test instance, connecting Claude Code and Codex to the same temporary memory, and seeing how shared context helps AI work smarter.
Read article