About this project
Context Engineering Protocol (CEP) is a framework of portable AI coding-agent skills that prepares ground-truth context before any generation task begins, replacing ad-hoc repo scanning with a structured produce-consume pipeline.
Core mechanism:
ult-context-generate runs an explicit gap → conflict → staleness state machine over four source categories — code graph, requirements, organizational conventions, and external specs — then gates the assembled package behind a human-approval step. Every claim is source-attributed and content-hashed. Unresolved conflicts block approval; staleness warnings are surfaced but non-blocking.
Key skills in the repository:
- ult-context-generate: Assembles context packages via gap/conflict/staleness checks, producing source-attributed output consumable by downstream skills.
- ult-codegraph: Builds codebase knowledge graphs with graphify for cross-file relationship queries before touching code.
- compiling-project-guidelines: Compiles scattered guideline sources into a single scope-aware COMPILED-GUIDELINES.md.
- ult-repo-layout: Registers and validates path slots via .layout-slots.yaml markers so relocation requires no SKILL.md edits.
- ult-institutional-memory-distill: Trip-wire layer that distills PRs, design docs, and postmortems into a persistent decision ledger and surfaces prior-rejected paths to a human before a package approval closes.
- ult-cep-retrofit: Brings existing third-party skill libraries under this protocol by inserting idempotent pointers without rewriting library instructions.
- ult-autoscaffold-content: Generates real starter content for What-L2/How-L2 layers once paths are resolved, with resumable CONTEXT.md generation and a CEP-INDEX.md router for large repos.
- ult-cep-wizard: Browser-based wizard for guided repo setup, layout discovery, and skill library retrofit workflows.
- demo-consume-context / demo-write-user-stories: Reference implementations demonstrating the produce/consume/tag loop end-to-end.
Runtime support:
Native SKILL.md execution in Claude Code with one-click plugin install from the marketplace. GitHub Copilot access via .prompt.md wrappers generated from SKILL.md frontmatter. Cursor rules exported as .cursor/rules/*.mdc files with agent-requested activation. OpenAI Codex integration through a root AGENTS.md index table.
Measured outcomes from case studies:
Retrieval cost reductions ranged from 5.6x to 36.8x fewer tokens per query across real-world repositories including Open5GS, FastAPI, and Textual. A telecom protocol clause lookup showed approximately 797x token reduction replacing an 8,500-line RFC read. Hallucination-suppression results showed zero invented concepts across dual-codebase runs where an ungrounded assistant had previously invented the same hallucinated concept twice in unrelated repositories.
Installation:
Clone the repository and run install.sh or install.ps1 with a target project path and optional --init-project flag to scaffold a starter context-config.yaml. Runtime scoping via --runtime controls which adapter files are installed: claude, copilot, cursor, codex, or both. Run python catalog/export_adapters.py --check to validate generated files and --write to regenerate after edits.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.