Context Engineer Protocol • AI Agent SDK
ContextEngineerProtocol: Protocol for Context Engineering agents.
ContextEngineerProtocol
Defined in the protocols module.
AI Agent
Protocol for Context Engineering agents.
Defines the interface for agents that perform codebase analysis, PRP (Product Requirements Prompt) generation, and implementation planning.
This protocol enables:
- Lightweight core with protocol definition only
- Heavy implementations in wrapper/tools
- Easy mocking for tests
Methods
analyze_codebase()
Analyze a codebase and extract patterns, structure, and conventions.
generate_prp()Generate a Product Requirements Prompt (PRP) for a feature.
create_implementation_blueprint()Create a step-by-step implementation blueprint.
aanalyze_codebase()Async version of analyze_codebase.
agenerate_prp()Async version of generate_prp.
Usage
class MockContextEngineer:
def analyze_codebase(self, path: str) -> Dict[str, Any]:
return {"project": path, "patterns": []}
def generate_prp(self, request: str, analysis: Dict = None) -> str:
return f"PRP for: {request}"
async def aanalyze_codebase(self, path: str) -> Dict[str, Any]:
return await self.analyze_codebase(path)Source
View on GitHubpraisonaiagents/agent/protocols.py at line 165