HCP (Human-Code-AI Protocol) v2.0

Context as Code

Git-Native Context Management for AI Projects

HCP is an open protocol for managing AI context in software projects using Git. Treat context as versionable, structured code. Validated by SPDD industry frameworks.

✅ SPDD Framework Validated43+ Projects5 IDE IntegrationsMIT License

What is HCP?

Solve the "context drift" problem by treating AI context as versionable code

HCP Hybrid Architecture

❌ Without HCP

  • • Lost context between sessions
  • • Repeated explanations to AI
  • • No version control for decisions
  • • Spec-code drift
  • • Tribal knowledge loss

✅ With HCP

  • • Persistent, git-native context
  • • AI reads structured .procontext/
  • • Decisions tracked and versionable
  • • Context = Code (always in sync)
  • • Knowledge preserved in repo

Industry & Academic Validation

HCP is empirically backed by SPDD (Structured Prompt-Driven Development) frameworks

Haletheia Evolution Timeline

Convergencia Industrial y Académica

HCP converge con las metodologías más avanzadas de desarrollo de software: desde Knowledge-Driven Development (KDD) hasta Specification-Driven Development (SDD) y Structured Prompt-Driven Development (SPDD) de Martin Fowler.

Convergencia KDD, SDD, SPDD - Evolución hacia AI Engineering

KDD → SDD → SPDD Convergence

Specification-Driven Development (SDD) - Evolución desde TDD

Specification-Driven Development (SDD)

SDD Quality Gates - Workflow de validación continua

SDD Quality Gates Workflow

Click images to enlarge · Multiple perspectives converge in Context Engineering

"Prompts must transition from informal conversational text into structured, versionable, and testable engineering artifacts, deeply integrated with the software lifecycle."
— Formal SPDD (Structured Prompt-Driven Development) Papers

HCP extends the academic SPDD foundation by adding robust context management, predictable lifecycle states (RPI+C), and the strict VERIFY workflow required for enterprise compliance.

Our architecture provides the verifiable infrastructure necessary to meet the standards of the EU AI Act.

HCP Hierarchy: Skills → Patterns → Roles → Vibes

The HCP Hierarchy

🔧

SKILLS (Base)

56 atomic operations: clarify-first, debug-memory-leak, etc.

🧩

PATTERNS

23 composable strategies: Multi-Agent, Context Engineering

👤

ROLES

Agents with focused profiles for review and synthesis

⚙️

OPERATING MODES

Abstraction levels: Exploration, Design, Refactor, Audit

RPI+V+C State

Each state has its purpose:
RESEARCH → Explore codebase, gather context
PLAN → Design approach, identify patterns
IMPLEMENT → Execute with skills
VERIFY → Test, validate, review
CAPTURE → Document learnings
HCP State Machine: RPI+V+C

Core Concepts

Four fundamental patterns that make HCP work

.procontext/ Structure

Structured directory hierarchy for features, planning, decisions, learnings, and sessions

.procontext/
├── 01-features/
├── 02-planning/
├── 03-decisions/
├── 04-learnings/
└── 06-sessions/
View Specification →

Lifecycle States (RPI+C)

Research → Planning → Implementation → Completed states for features

Track feature progress explicitly in STATUS.md files

View Patterns →

VERIFY Workflow

Validation → Evidence → Review → Iterate → Finalize → Yank pattern

Ensure quality through structured validation gates

View Patterns →

Context Inheritance

Hierarchical context propagation from project to feature level

DRY principle applied to AI context management

View Patterns →

Who Uses HCP?

From enterprises to solo developers

🏢 Enterprises

Banking, Healthcare, Legal — Context compliance, decision traceability, audit trails

ComplianceAudit Trails

🚀 Startups

Fast iteration with AI agents, persistent context, no knowledge loss on pivots

SpeedAgility

👨‍💻 Developers

Multi-project workflows, AI pair programming, context management across sessions

ProductivityWorkflow

🏗️ Architects

ADRs, design docs, architectural decisions tracked and versioned

DocumentationDesign

By the Numbers

Production-ready and battle-tested

43+
Projects in Production
5 min
Setup Time
5
IDE Integrations
Open
MIT License

Validated in Production

8+ months. 43 real projects. Measured results.

-33%
Onboarding time for new engineers on AI-heavy projects
-75%
Repeated context questions between sessions
43
Projects validated across Python, Java, Rust, TypeScript stacks

HCP just launched publicly. Be among the first to adopt it and share your results.

Get Started in 5 Minutes

Setup HCP in your project right now

1

Clone and Initialize

git clone https://github.com/haletheia/human-code-ai-protocol
cd your-project
hcp init
2

Edit Project Context

Add your project's context to .procontext/README.md

# Project Context
Stack: Node.js, PostgreSQL, Docker
Architecture: Microservices
Conventions: ESLint, Prettier
3

Configure Your IDE

Set up HCP integration in Cursor, Windsurf, Cline, Aider, or Codex

See integrations guide for IDE-specific setup

4

Start Coding with AI

Your AI now has persistent context automatically. Create features, document decisions, track learnings.

HCP + MCP Integration Flow

HCP + MCP Integration

HCP provides context, MCP provides tools. Together they create more capable agents.

HCP Context MCP Bridge Agent
.procontext/ stdio / HTTP Tool Calls
session.md Available Tools Parallel exec
memory/ Git, Web, DB State tracking

Works With HALETHEIA Security Stack

HCP integrates seamlessly with the full security ecosystem

HCP Toolkit Architecture Diagram
  • 🛡️ Sentinel: Validate dependencies before AI writes code
  • aronly: Optimize token costs (60-90% savings)
  • 🎮 babuino: Execute AI-generated code safely in sandbox

Ready to eliminate context drift?

Join 43+ projects using HCP in production. Setup in 5 minutes.

Zoomed image