Skip to content

CorePack-AI/ucp-spec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Corepack AI - The NPM for AI Context

The Unified Context Protocol: A File-System Standard for Installable Intelligence

Author: Nikhil Rao, Founder — Corepack AI
Date: January 2026
Version: 1.0


2. Executive Summary

The Problem: Software development has entered the age of "Agentic Coding," where AI assistants (Cursor, Antigravity, Devin) operate as autonomous contributors. However, these agents are largely stateless. They lack the implicit context—architectural decisions, coding conventions, and business logic—that human engineers accumulate over years. This "Shadow Context" is currently trapped in ephemeral chat sessions or proprietary IDE databases, creating silos and forcing developers to repeatedly explain basic project constraints.

The Insight: Context is not a vector embedding; it is a dependency. Just as we declare node_modules for code dependencies, we must declare "Context Modules" for behavioral dependencies.

The Solution: The Unified Context Protocol (UCP) is an open standard for structuring AI context within the file system (.ai/). It transforms ad-hoc prompt engineering into Installable Intelligence: modular, versioned, and vendor-neutral packages of behavior that live alongside source code. This enables a new discipline we call Behavioral Architecting.

Why it Matters: UCP decouples intelligence from the tool. It enables a "Write Once, Run Anywhere" model for AI context, ensuring that an agent's understanding of a project persists across sessions, tools, and team members.


3. Problem Definition: The Context Trap

3.1 The Stateless Agent

Current Large Language Models (LLMs) are brilliant but amnesiac. When a developer starts a new session in an AI IDE, the model has zero knowledge of:

  • Why the project uses a specific folder structure.
  • The unwritten rule that "we only use Tailwind for layout."
  • The legacy debt in AuthService.ts that must not be touched.

3.2 Shadow Context

Developers compensate for this by manually maintaining "Shadow Context":

  1. Clipboard Buffers: Pasting the same "Rule: Don't use any types" instruction into every chat.
  2. Private Notions: Maintaining personal wikis of project quirks.
  3. Local Settings: Configuring .cursorrules or .vscode settings that are not shared with the team.

3.3 The Universality Gap

When context is formalized, it is often locked into proprietary formats:

  • Cursor relies on .cursorrules (Effective, but IDE-specific).
  • Antigravity uses internal session graphs (Powerful, but opaque).
  • CLI Agents rely on custom system prompts.

This fragmentation creates Ecosystem Lock-in. A team that invests heavily in configuring Cursor cannot easily switch to Antigravity without losing months of accumulated behavioral tuning. Intelligence becomes an artifact of the tool, not the project.


4. First-Principles Analysis

To solve this, we must decompose "Context" into its atomic units.

4.1 The Invariants of Context

  1. Context is Hierarchical: Some rules are global (Company Standards), some are project-wide (Tech Stack), and some are local (Component Logic).
  2. Context is Code: Behavioral instructions change over time. They require version control (git), diffing, and rollback capabilities.
  3. Context is Universal: The "truth" of a project (e.g., "This acts as a Next.js app") does not change based on which IDE you view it in.

4.2 The "Dependency" Metaphor

Software solved the "library problem" with Package Managers (NPM, Cargo, Pip).

  • Installable: npm install jquery
  • Composable: My library can depend on your library.

UCP brings this Inheritance to AI. Developers don't start from scratch. You install the base @corepackai/ucp (The Protocol), and then extend it by adding feature packs like @corepackai/nextjs. This allows for layer-cake intelligence (Base Protocol -> Stack Skills -> Team Standards).


5. Proposed Architecture: The UCP Standard

UCP is not a software product; it is a Schema. It proposes utilizing the .ai/ directory (a rising convention in the agentic ecosystem) as the standardized mounting point for this context.

5.1 The Root Structure

All context resides in a top-level .ai/ directory, mounted at the project root.

Note: While .ai/ is a generic namespace, UCP provides the strict schema for what goes inside it to ensure interoperability.

.ai/
├── context/
│   └── @my-org/       # Scoped by Organization
│       └── my-pack/   # Scoped by Pack
│           ├── active/  # PLAN.md
│           └── archive/
└── modules/
    └── @corepackai/
        └── nextjs/    # Installed Packs

5.2 Context Modules ("Packs")

A "Pack" is the atomic unit of distribution. It is a directory containing:

  1. rules.md: The System Prompt instructions (e.g., "Prefer Functional Components").
  2. generators/: Templates for creating new files (e.g., "New Page Component").
  3. knowledge/: Static documentation or Q&A pairs (e.g., "The auth flow diagram").

5.3 The Protocol Lifecycle

  1. Mount: The Agent scans .ai/ on startup.
  2. Resolve: It reads modules/ to ingest installed behaviors.
  3. Align: It reads context/active/PLAN.md to understand the current objective.
  4. Execute: All generated code traverses the constraints defined in the Modules.

6. Comparative Analysis

Feature .txt / Clipboard Proprietary Rules (Cursor/Windsurf) Vector RAG Databases UCP (Unified Context Protocol)
Portability High (Copy/Paste) Low (Tool Locked) Low (Database Locked) High (Git Native)
Structure None Low (Flat Lists) Opaque (Embeddings) High (Modular/Hierarchical)
Collaboration Hard Medium (Shared Repo) Hard (Server Access) Native (Pull Requests)
Determinism Low Medium Variable High (Explicit Files)
Maintenance Impossible Manual Complex Automated (CLI)

Key Distinction: Vector RAG is probabilistic (guessing what is relevant). UCP is deterministic (explicitly stating what is relevant). UCP does not replace RAG; it organizes the source material that RAG indexes.


7. Risks & Limitations

7.1 Human Overhead (The "Homework" Fallacy)

Risk: It may seem like UCP requires developers to manually maintain documentation. Reality: The Human Drives; The Agent Writes. Human involvement does not disappear; it shifts to Guidance. Agents can get lost. The developer's role is to "Steer" the agent back to the UCP rails (e.g., adding a global rule to "Always check .ai/ context") and to correct course when the plan drifts. The file system serves as the shared steering wheel.

7.2 Context Window Limits

Risk: Installing too many Packs can overflow an Agent's context window. Mitigation: Motherboard Architecture. UCP acts as a "Context Motherboard" where small, focused packs are docked. Agents don't read the whole world; they mount specific skills locally. A "Context Engine" (whether form Corepackai or a competitor) simply routes the query to the correct docked module, ensuring efficiency.

7.3 Standard Fragmentation

Risk: Tools may implement UCP differently. Mitigation: Progressive Complexity. We begin with the "lowest common denominator": Text Files (.md). This ensures zero-friction adoption. However, UCP is designed to evolve. Future versions will introduce Runtime Logic (Context Servers) to optimize retrieval speed for high-performance agents, while keeping the file system as the fallback source of truth.


9. Conclusion: The Context Economy

The current approach to AI context—siloed, ephemeral, and proprietary—is a bottleneck. We cannot build an open ecosystem on closed memories.

The Unified Context Protocol proposes a decoupled future:

  1. The Interface (UCP): The standard PCIe slot for intelligence.
  2. The Pack Economy: Everything is a modular unit.
    • Context Engines: The "Motherboards" that run the system (e.g., CorepackAI, Custom Runners).
    • Feature Packs: The "Skills" (e.g., Use Next.js, Deploy to Vercel).
    • Knowledge Packs: The "Data" (e.g., Company Documentation, API Specs).

We are not just building a tool; we are targeting an Economy. By standardizing the interface, we invite a market where specialized engines and high-value knowledge compete on merit, while the protocol remains universal.


Author

Nikhil Rao — Founder, Corepack AI

Building tools that bridge human intent and autonomous execution.


Don't just prompt. Publish.

About

The Unified Context Protocol (UCP): A file-system standard for installable AI intelligence.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors