mcp-context-engineering
Version:
The intelligent context optimization system for AI coding assistants. Built with Cole's PRP methodology, Context Portal knowledge graphs, and production-ready MongoDB architecture.
1,432 lines • 59 kB
TypeScript
import { ObjectId } from 'mongodb';
import { z } from 'zod';
export declare const PRPMethodologySchema: z.ZodObject<{
research: z.ZodObject<{
codebase_analysis: z.ZodArray<z.ZodString, "many">;
external_research: z.ZodArray<z.ZodString, "many">;
documentation_urls: z.ZodArray<z.ZodString, "many">;
existing_patterns: z.ZodArray<z.ZodString, "many">;
potential_challenges: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
codebase_analysis?: string[];
external_research?: string[];
documentation_urls?: string[];
existing_patterns?: string[];
potential_challenges?: string[];
}, {
codebase_analysis?: string[];
external_research?: string[];
documentation_urls?: string[];
existing_patterns?: string[];
potential_challenges?: string[];
}>;
implementation: z.ZodObject<{
goal: z.ZodString;
business_value: z.ZodString;
technical_requirements: z.ZodArray<z.ZodString, "many">;
pseudocode: z.ZodString;
task_breakdown: z.ZodArray<z.ZodObject<{
task: z.ZodString;
order: z.ZodNumber;
dependencies: z.ZodArray<z.ZodString, "many">;
validation: z.ZodString;
}, "strip", z.ZodTypeAny, {
validation?: string;
task?: string;
order?: number;
dependencies?: string[];
}, {
validation?: string;
task?: string;
order?: number;
dependencies?: string[];
}>, "many">;
error_handling_strategy: z.ZodString;
integration_points: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
goal?: string;
business_value?: string;
technical_requirements?: string[];
pseudocode?: string;
task_breakdown?: {
validation?: string;
task?: string;
order?: number;
dependencies?: string[];
}[];
error_handling_strategy?: string;
integration_points?: string[];
}, {
goal?: string;
business_value?: string;
technical_requirements?: string[];
pseudocode?: string;
task_breakdown?: {
validation?: string;
task?: string;
order?: number;
dependencies?: string[];
}[];
error_handling_strategy?: string;
integration_points?: string[];
}>;
validation: z.ZodObject<{
syntax_checks: z.ZodArray<z.ZodString, "many">;
unit_test_commands: z.ZodArray<z.ZodString, "many">;
integration_tests: z.ZodArray<z.ZodString, "many">;
confidence_score: z.ZodNumber;
quality_checklist: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
syntax_checks?: string[];
unit_test_commands?: string[];
integration_tests?: string[];
confidence_score?: number;
quality_checklist?: string[];
}, {
syntax_checks?: string[];
unit_test_commands?: string[];
integration_tests?: string[];
confidence_score?: number;
quality_checklist?: string[];
}>;
}, "strip", z.ZodTypeAny, {
validation?: {
syntax_checks?: string[];
unit_test_commands?: string[];
integration_tests?: string[];
confidence_score?: number;
quality_checklist?: string[];
};
research?: {
codebase_analysis?: string[];
external_research?: string[];
documentation_urls?: string[];
existing_patterns?: string[];
potential_challenges?: string[];
};
implementation?: {
goal?: string;
business_value?: string;
technical_requirements?: string[];
pseudocode?: string;
task_breakdown?: {
validation?: string;
task?: string;
order?: number;
dependencies?: string[];
}[];
error_handling_strategy?: string;
integration_points?: string[];
};
}, {
validation?: {
syntax_checks?: string[];
unit_test_commands?: string[];
integration_tests?: string[];
confidence_score?: number;
quality_checklist?: string[];
};
research?: {
codebase_analysis?: string[];
external_research?: string[];
documentation_urls?: string[];
existing_patterns?: string[];
potential_challenges?: string[];
};
implementation?: {
goal?: string;
business_value?: string;
technical_requirements?: string[];
pseudocode?: string;
task_breakdown?: {
validation?: string;
task?: string;
order?: number;
dependencies?: string[];
}[];
error_handling_strategy?: string;
integration_points?: string[];
};
}>;
export declare const DecisionSchema: z.ZodObject<{
id: z.ZodString;
title: z.ZodString;
description: z.ZodString;
rationale: z.ZodString;
implementation_details: z.ZodOptional<z.ZodString>;
consequences: z.ZodArray<z.ZodString, "many">;
status: z.ZodEnum<["proposed", "accepted", "rejected", "deprecated"]>;
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
date: z.ZodDate;
workspace_id: z.ZodString;
auto_linked_progress: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
status?: "proposed" | "accepted" | "rejected" | "deprecated";
date?: Date;
id?: string;
title?: string;
description?: string;
rationale?: string;
implementation_details?: string;
consequences?: string[];
tags?: string[];
workspace_id?: string;
auto_linked_progress?: string[];
}, {
status?: "proposed" | "accepted" | "rejected" | "deprecated";
date?: Date;
id?: string;
title?: string;
description?: string;
rationale?: string;
implementation_details?: string;
consequences?: string[];
tags?: string[];
workspace_id?: string;
auto_linked_progress?: string[];
}>;
export declare const ProgressEntrySchema: z.ZodObject<{
id: z.ZodString;
task: z.ZodString;
status: z.ZodEnum<["todo", "in_progress", "completed", "blocked"]>;
progress_notes: z.ZodString;
parent_id: z.ZodOptional<z.ZodString>;
date: z.ZodDate;
workspace_id: z.ZodString;
linked_decisions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
status?: "todo" | "in_progress" | "completed" | "blocked";
date?: Date;
task?: string;
id?: string;
workspace_id?: string;
progress_notes?: string;
parent_id?: string;
linked_decisions?: string[];
}, {
status?: "todo" | "in_progress" | "completed" | "blocked";
date?: Date;
task?: string;
id?: string;
workspace_id?: string;
progress_notes?: string;
parent_id?: string;
linked_decisions?: string[];
}>;
export declare const SystemPatternSchema: z.ZodObject<{
id: z.ZodString;
pattern_name: z.ZodString;
description: z.ZodString;
usage_examples: z.ZodArray<z.ZodString, "many">;
benefits: z.ZodArray<z.ZodString, "many">;
drawbacks: z.ZodArray<z.ZodString, "many">;
implementation_details: z.ZodOptional<z.ZodString>;
workspace_id: z.ZodString;
}, "strip", z.ZodTypeAny, {
id?: string;
description?: string;
implementation_details?: string;
workspace_id?: string;
pattern_name?: string;
usage_examples?: string[];
benefits?: string[];
drawbacks?: string[];
}, {
id?: string;
description?: string;
implementation_details?: string;
workspace_id?: string;
pattern_name?: string;
usage_examples?: string[];
benefits?: string[];
drawbacks?: string[];
}>;
export declare const ContextLinkSchema: z.ZodObject<{
source_item_type: z.ZodString;
source_item_id: z.ZodString;
target_item_type: z.ZodString;
target_item_id: z.ZodString;
relationship_type: z.ZodEnum<["implements", "related_to", "depends_on", "enables", "conflicts_with", "relates_to_progress"]>;
description: z.ZodOptional<z.ZodString>;
workspace_id: z.ZodString;
timestamp: z.ZodDate;
}, "strip", z.ZodTypeAny, {
description?: string;
workspace_id?: string;
source_item_type?: string;
source_item_id?: string;
target_item_type?: string;
target_item_id?: string;
relationship_type?: "implements" | "related_to" | "depends_on" | "enables" | "conflicts_with" | "relates_to_progress";
timestamp?: Date;
}, {
description?: string;
workspace_id?: string;
source_item_type?: string;
source_item_id?: string;
target_item_type?: string;
target_item_id?: string;
relationship_type?: "implements" | "related_to" | "depends_on" | "enables" | "conflicts_with" | "relates_to_progress";
timestamp?: Date;
}>;
export declare const KnowledgeGraphSchema: z.ZodObject<{
decisions: z.ZodArray<z.ZodObject<{
id: z.ZodString;
title: z.ZodString;
description: z.ZodString;
rationale: z.ZodString;
implementation_details: z.ZodOptional<z.ZodString>;
consequences: z.ZodArray<z.ZodString, "many">;
status: z.ZodEnum<["proposed", "accepted", "rejected", "deprecated"]>;
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
date: z.ZodDate;
workspace_id: z.ZodString;
auto_linked_progress: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
status?: "proposed" | "accepted" | "rejected" | "deprecated";
date?: Date;
id?: string;
title?: string;
description?: string;
rationale?: string;
implementation_details?: string;
consequences?: string[];
tags?: string[];
workspace_id?: string;
auto_linked_progress?: string[];
}, {
status?: "proposed" | "accepted" | "rejected" | "deprecated";
date?: Date;
id?: string;
title?: string;
description?: string;
rationale?: string;
implementation_details?: string;
consequences?: string[];
tags?: string[];
workspace_id?: string;
auto_linked_progress?: string[];
}>, "many">;
progress_entries: z.ZodArray<z.ZodObject<{
id: z.ZodString;
task: z.ZodString;
status: z.ZodEnum<["todo", "in_progress", "completed", "blocked"]>;
progress_notes: z.ZodString;
parent_id: z.ZodOptional<z.ZodString>;
date: z.ZodDate;
workspace_id: z.ZodString;
linked_decisions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
status?: "todo" | "in_progress" | "completed" | "blocked";
date?: Date;
task?: string;
id?: string;
workspace_id?: string;
progress_notes?: string;
parent_id?: string;
linked_decisions?: string[];
}, {
status?: "todo" | "in_progress" | "completed" | "blocked";
date?: Date;
task?: string;
id?: string;
workspace_id?: string;
progress_notes?: string;
parent_id?: string;
linked_decisions?: string[];
}>, "many">;
system_patterns: z.ZodArray<z.ZodObject<{
id: z.ZodString;
pattern_name: z.ZodString;
description: z.ZodString;
usage_examples: z.ZodArray<z.ZodString, "many">;
benefits: z.ZodArray<z.ZodString, "many">;
drawbacks: z.ZodArray<z.ZodString, "many">;
implementation_details: z.ZodOptional<z.ZodString>;
workspace_id: z.ZodString;
}, "strip", z.ZodTypeAny, {
id?: string;
description?: string;
implementation_details?: string;
workspace_id?: string;
pattern_name?: string;
usage_examples?: string[];
benefits?: string[];
drawbacks?: string[];
}, {
id?: string;
description?: string;
implementation_details?: string;
workspace_id?: string;
pattern_name?: string;
usage_examples?: string[];
benefits?: string[];
drawbacks?: string[];
}>, "many">;
context_links: z.ZodArray<z.ZodObject<{
source_item_type: z.ZodString;
source_item_id: z.ZodString;
target_item_type: z.ZodString;
target_item_id: z.ZodString;
relationship_type: z.ZodEnum<["implements", "related_to", "depends_on", "enables", "conflicts_with", "relates_to_progress"]>;
description: z.ZodOptional<z.ZodString>;
workspace_id: z.ZodString;
timestamp: z.ZodDate;
}, "strip", z.ZodTypeAny, {
description?: string;
workspace_id?: string;
source_item_type?: string;
source_item_id?: string;
target_item_type?: string;
target_item_id?: string;
relationship_type?: "implements" | "related_to" | "depends_on" | "enables" | "conflicts_with" | "relates_to_progress";
timestamp?: Date;
}, {
description?: string;
workspace_id?: string;
source_item_type?: string;
source_item_id?: string;
target_item_type?: string;
target_item_id?: string;
relationship_type?: "implements" | "related_to" | "depends_on" | "enables" | "conflicts_with" | "relates_to_progress";
timestamp?: Date;
}>, "many">;
custom_data: z.ZodRecord<z.ZodString, z.ZodAny>;
workspace_context: z.ZodObject<{
workspace_id: z.ZodString;
project_id: z.ZodString;
active_context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
product_context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
}, "strip", z.ZodTypeAny, {
workspace_id?: string;
project_id?: string;
active_context?: Record<string, any>;
product_context?: Record<string, any>;
}, {
workspace_id?: string;
project_id?: string;
active_context?: Record<string, any>;
product_context?: Record<string, any>;
}>;
relationships: z.ZodObject<{
depends_on: z.ZodArray<z.ZodString, "many">;
enables: z.ZodArray<z.ZodString, "many">;
conflicts_with: z.ZodArray<z.ZodString, "many">;
related_patterns: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
depends_on?: string[];
enables?: string[];
conflicts_with?: string[];
related_patterns?: string[];
}, {
depends_on?: string[];
enables?: string[];
conflicts_with?: string[];
related_patterns?: string[];
}>;
}, "strip", z.ZodTypeAny, {
decisions?: {
status?: "proposed" | "accepted" | "rejected" | "deprecated";
date?: Date;
id?: string;
title?: string;
description?: string;
rationale?: string;
implementation_details?: string;
consequences?: string[];
tags?: string[];
workspace_id?: string;
auto_linked_progress?: string[];
}[];
progress_entries?: {
status?: "todo" | "in_progress" | "completed" | "blocked";
date?: Date;
task?: string;
id?: string;
workspace_id?: string;
progress_notes?: string;
parent_id?: string;
linked_decisions?: string[];
}[];
system_patterns?: {
id?: string;
description?: string;
implementation_details?: string;
workspace_id?: string;
pattern_name?: string;
usage_examples?: string[];
benefits?: string[];
drawbacks?: string[];
}[];
context_links?: {
description?: string;
workspace_id?: string;
source_item_type?: string;
source_item_id?: string;
target_item_type?: string;
target_item_id?: string;
relationship_type?: "implements" | "related_to" | "depends_on" | "enables" | "conflicts_with" | "relates_to_progress";
timestamp?: Date;
}[];
custom_data?: Record<string, any>;
workspace_context?: {
workspace_id?: string;
project_id?: string;
active_context?: Record<string, any>;
product_context?: Record<string, any>;
};
relationships?: {
depends_on?: string[];
enables?: string[];
conflicts_with?: string[];
related_patterns?: string[];
};
}, {
decisions?: {
status?: "proposed" | "accepted" | "rejected" | "deprecated";
date?: Date;
id?: string;
title?: string;
description?: string;
rationale?: string;
implementation_details?: string;
consequences?: string[];
tags?: string[];
workspace_id?: string;
auto_linked_progress?: string[];
}[];
progress_entries?: {
status?: "todo" | "in_progress" | "completed" | "blocked";
date?: Date;
task?: string;
id?: string;
workspace_id?: string;
progress_notes?: string;
parent_id?: string;
linked_decisions?: string[];
}[];
system_patterns?: {
id?: string;
description?: string;
implementation_details?: string;
workspace_id?: string;
pattern_name?: string;
usage_examples?: string[];
benefits?: string[];
drawbacks?: string[];
}[];
context_links?: {
description?: string;
workspace_id?: string;
source_item_type?: string;
source_item_id?: string;
target_item_type?: string;
target_item_id?: string;
relationship_type?: "implements" | "related_to" | "depends_on" | "enables" | "conflicts_with" | "relates_to_progress";
timestamp?: Date;
}[];
custom_data?: Record<string, any>;
workspace_context?: {
workspace_id?: string;
project_id?: string;
active_context?: Record<string, any>;
product_context?: Record<string, any>;
};
relationships?: {
depends_on?: string[];
enables?: string[];
conflicts_with?: string[];
related_patterns?: string[];
};
}>;
export declare const AgentOptimizationSchema: z.ZodObject<{
cursor: z.ZodObject<{
format: z.ZodEnum<["concise", "detailed"]>;
focus: z.ZodArray<z.ZodString, "many">;
effectiveness_score: z.ZodNumber;
preferred_sections: z.ZodArray<z.ZodString, "many">;
avoid_patterns: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
format?: "concise" | "detailed";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}, {
format?: "concise" | "detailed";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}>;
windsurf: z.ZodObject<{
format: z.ZodEnum<["step_by_step", "overview"]>;
focus: z.ZodArray<z.ZodString, "many">;
effectiveness_score: z.ZodNumber;
preferred_sections: z.ZodArray<z.ZodString, "many">;
avoid_patterns: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
format?: "step_by_step" | "overview";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}, {
format?: "step_by_step" | "overview";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}>;
claude_code: z.ZodObject<{
format: z.ZodEnum<["full_prp", "summary"]>;
focus: z.ZodArray<z.ZodString, "many">;
effectiveness_score: z.ZodNumber;
preferred_sections: z.ZodArray<z.ZodString, "many">;
avoid_patterns: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
format?: "full_prp" | "summary";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}, {
format?: "full_prp" | "summary";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}>;
generic: z.ZodObject<{
format: z.ZodLiteral<"balanced">;
focus: z.ZodArray<z.ZodString, "many">;
effectiveness_score: z.ZodNumber;
preferred_sections: z.ZodArray<z.ZodString, "many">;
avoid_patterns: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
format?: "balanced";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}, {
format?: "balanced";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}>;
}, "strip", z.ZodTypeAny, {
cursor?: {
format?: "concise" | "detailed";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
windsurf?: {
format?: "step_by_step" | "overview";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
claude_code?: {
format?: "full_prp" | "summary";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
generic?: {
format?: "balanced";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
}, {
cursor?: {
format?: "concise" | "detailed";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
windsurf?: {
format?: "step_by_step" | "overview";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
claude_code?: {
format?: "full_prp" | "summary";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
generic?: {
format?: "balanced";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
}>;
export declare const EffectivenessMetricsSchema: z.ZodObject<{
overall_success_rate: z.ZodNumber;
implementation_success_count: z.ZodNumber;
usage_count: z.ZodNumber;
last_used: z.ZodDate;
improvement_suggestions: z.ZodArray<z.ZodString, "many">;
feedback_history: z.ZodArray<z.ZodObject<{
score: z.ZodNumber;
feedback: z.ZodString;
agent_type: z.ZodString;
timestamp: z.ZodDate;
implementation_success: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
timestamp?: Date;
score?: number;
feedback?: string;
agent_type?: string;
implementation_success?: boolean;
}, {
timestamp?: Date;
score?: number;
feedback?: string;
agent_type?: string;
implementation_success?: boolean;
}>, "many">;
}, "strip", z.ZodTypeAny, {
overall_success_rate?: number;
implementation_success_count?: number;
usage_count?: number;
last_used?: Date;
improvement_suggestions?: string[];
feedback_history?: {
timestamp?: Date;
score?: number;
feedback?: string;
agent_type?: string;
implementation_success?: boolean;
}[];
}, {
overall_success_rate?: number;
implementation_success_count?: number;
usage_count?: number;
last_used?: Date;
improvement_suggestions?: string[];
feedback_history?: {
timestamp?: Date;
score?: number;
feedback?: string;
agent_type?: string;
implementation_success?: boolean;
}[];
}>;
export declare const UniversalContextPatternSchema: z.ZodObject<{
_id: z.ZodOptional<z.ZodType<ObjectId, z.ZodTypeDef, ObjectId>>;
prp_methodology: z.ZodObject<{
research: z.ZodObject<{
codebase_analysis: z.ZodArray<z.ZodString, "many">;
external_research: z.ZodArray<z.ZodString, "many">;
documentation_urls: z.ZodArray<z.ZodString, "many">;
existing_patterns: z.ZodArray<z.ZodString, "many">;
potential_challenges: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
codebase_analysis?: string[];
external_research?: string[];
documentation_urls?: string[];
existing_patterns?: string[];
potential_challenges?: string[];
}, {
codebase_analysis?: string[];
external_research?: string[];
documentation_urls?: string[];
existing_patterns?: string[];
potential_challenges?: string[];
}>;
implementation: z.ZodObject<{
goal: z.ZodString;
business_value: z.ZodString;
technical_requirements: z.ZodArray<z.ZodString, "many">;
pseudocode: z.ZodString;
task_breakdown: z.ZodArray<z.ZodObject<{
task: z.ZodString;
order: z.ZodNumber;
dependencies: z.ZodArray<z.ZodString, "many">;
validation: z.ZodString;
}, "strip", z.ZodTypeAny, {
validation?: string;
task?: string;
order?: number;
dependencies?: string[];
}, {
validation?: string;
task?: string;
order?: number;
dependencies?: string[];
}>, "many">;
error_handling_strategy: z.ZodString;
integration_points: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
goal?: string;
business_value?: string;
technical_requirements?: string[];
pseudocode?: string;
task_breakdown?: {
validation?: string;
task?: string;
order?: number;
dependencies?: string[];
}[];
error_handling_strategy?: string;
integration_points?: string[];
}, {
goal?: string;
business_value?: string;
technical_requirements?: string[];
pseudocode?: string;
task_breakdown?: {
validation?: string;
task?: string;
order?: number;
dependencies?: string[];
}[];
error_handling_strategy?: string;
integration_points?: string[];
}>;
validation: z.ZodObject<{
syntax_checks: z.ZodArray<z.ZodString, "many">;
unit_test_commands: z.ZodArray<z.ZodString, "many">;
integration_tests: z.ZodArray<z.ZodString, "many">;
confidence_score: z.ZodNumber;
quality_checklist: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
syntax_checks?: string[];
unit_test_commands?: string[];
integration_tests?: string[];
confidence_score?: number;
quality_checklist?: string[];
}, {
syntax_checks?: string[];
unit_test_commands?: string[];
integration_tests?: string[];
confidence_score?: number;
quality_checklist?: string[];
}>;
}, "strip", z.ZodTypeAny, {
validation?: {
syntax_checks?: string[];
unit_test_commands?: string[];
integration_tests?: string[];
confidence_score?: number;
quality_checklist?: string[];
};
research?: {
codebase_analysis?: string[];
external_research?: string[];
documentation_urls?: string[];
existing_patterns?: string[];
potential_challenges?: string[];
};
implementation?: {
goal?: string;
business_value?: string;
technical_requirements?: string[];
pseudocode?: string;
task_breakdown?: {
validation?: string;
task?: string;
order?: number;
dependencies?: string[];
}[];
error_handling_strategy?: string;
integration_points?: string[];
};
}, {
validation?: {
syntax_checks?: string[];
unit_test_commands?: string[];
integration_tests?: string[];
confidence_score?: number;
quality_checklist?: string[];
};
research?: {
codebase_analysis?: string[];
external_research?: string[];
documentation_urls?: string[];
existing_patterns?: string[];
potential_challenges?: string[];
};
implementation?: {
goal?: string;
business_value?: string;
technical_requirements?: string[];
pseudocode?: string;
task_breakdown?: {
validation?: string;
task?: string;
order?: number;
dependencies?: string[];
}[];
error_handling_strategy?: string;
integration_points?: string[];
};
}>;
knowledge_graph: z.ZodObject<{
decisions: z.ZodArray<z.ZodObject<{
id: z.ZodString;
title: z.ZodString;
description: z.ZodString;
rationale: z.ZodString;
implementation_details: z.ZodOptional<z.ZodString>;
consequences: z.ZodArray<z.ZodString, "many">;
status: z.ZodEnum<["proposed", "accepted", "rejected", "deprecated"]>;
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
date: z.ZodDate;
workspace_id: z.ZodString;
auto_linked_progress: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
status?: "proposed" | "accepted" | "rejected" | "deprecated";
date?: Date;
id?: string;
title?: string;
description?: string;
rationale?: string;
implementation_details?: string;
consequences?: string[];
tags?: string[];
workspace_id?: string;
auto_linked_progress?: string[];
}, {
status?: "proposed" | "accepted" | "rejected" | "deprecated";
date?: Date;
id?: string;
title?: string;
description?: string;
rationale?: string;
implementation_details?: string;
consequences?: string[];
tags?: string[];
workspace_id?: string;
auto_linked_progress?: string[];
}>, "many">;
progress_entries: z.ZodArray<z.ZodObject<{
id: z.ZodString;
task: z.ZodString;
status: z.ZodEnum<["todo", "in_progress", "completed", "blocked"]>;
progress_notes: z.ZodString;
parent_id: z.ZodOptional<z.ZodString>;
date: z.ZodDate;
workspace_id: z.ZodString;
linked_decisions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
status?: "todo" | "in_progress" | "completed" | "blocked";
date?: Date;
task?: string;
id?: string;
workspace_id?: string;
progress_notes?: string;
parent_id?: string;
linked_decisions?: string[];
}, {
status?: "todo" | "in_progress" | "completed" | "blocked";
date?: Date;
task?: string;
id?: string;
workspace_id?: string;
progress_notes?: string;
parent_id?: string;
linked_decisions?: string[];
}>, "many">;
system_patterns: z.ZodArray<z.ZodObject<{
id: z.ZodString;
pattern_name: z.ZodString;
description: z.ZodString;
usage_examples: z.ZodArray<z.ZodString, "many">;
benefits: z.ZodArray<z.ZodString, "many">;
drawbacks: z.ZodArray<z.ZodString, "many">;
implementation_details: z.ZodOptional<z.ZodString>;
workspace_id: z.ZodString;
}, "strip", z.ZodTypeAny, {
id?: string;
description?: string;
implementation_details?: string;
workspace_id?: string;
pattern_name?: string;
usage_examples?: string[];
benefits?: string[];
drawbacks?: string[];
}, {
id?: string;
description?: string;
implementation_details?: string;
workspace_id?: string;
pattern_name?: string;
usage_examples?: string[];
benefits?: string[];
drawbacks?: string[];
}>, "many">;
context_links: z.ZodArray<z.ZodObject<{
source_item_type: z.ZodString;
source_item_id: z.ZodString;
target_item_type: z.ZodString;
target_item_id: z.ZodString;
relationship_type: z.ZodEnum<["implements", "related_to", "depends_on", "enables", "conflicts_with", "relates_to_progress"]>;
description: z.ZodOptional<z.ZodString>;
workspace_id: z.ZodString;
timestamp: z.ZodDate;
}, "strip", z.ZodTypeAny, {
description?: string;
workspace_id?: string;
source_item_type?: string;
source_item_id?: string;
target_item_type?: string;
target_item_id?: string;
relationship_type?: "implements" | "related_to" | "depends_on" | "enables" | "conflicts_with" | "relates_to_progress";
timestamp?: Date;
}, {
description?: string;
workspace_id?: string;
source_item_type?: string;
source_item_id?: string;
target_item_type?: string;
target_item_id?: string;
relationship_type?: "implements" | "related_to" | "depends_on" | "enables" | "conflicts_with" | "relates_to_progress";
timestamp?: Date;
}>, "many">;
custom_data: z.ZodRecord<z.ZodString, z.ZodAny>;
workspace_context: z.ZodObject<{
workspace_id: z.ZodString;
project_id: z.ZodString;
active_context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
product_context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
}, "strip", z.ZodTypeAny, {
workspace_id?: string;
project_id?: string;
active_context?: Record<string, any>;
product_context?: Record<string, any>;
}, {
workspace_id?: string;
project_id?: string;
active_context?: Record<string, any>;
product_context?: Record<string, any>;
}>;
relationships: z.ZodObject<{
depends_on: z.ZodArray<z.ZodString, "many">;
enables: z.ZodArray<z.ZodString, "many">;
conflicts_with: z.ZodArray<z.ZodString, "many">;
related_patterns: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
depends_on?: string[];
enables?: string[];
conflicts_with?: string[];
related_patterns?: string[];
}, {
depends_on?: string[];
enables?: string[];
conflicts_with?: string[];
related_patterns?: string[];
}>;
}, "strip", z.ZodTypeAny, {
decisions?: {
status?: "proposed" | "accepted" | "rejected" | "deprecated";
date?: Date;
id?: string;
title?: string;
description?: string;
rationale?: string;
implementation_details?: string;
consequences?: string[];
tags?: string[];
workspace_id?: string;
auto_linked_progress?: string[];
}[];
progress_entries?: {
status?: "todo" | "in_progress" | "completed" | "blocked";
date?: Date;
task?: string;
id?: string;
workspace_id?: string;
progress_notes?: string;
parent_id?: string;
linked_decisions?: string[];
}[];
system_patterns?: {
id?: string;
description?: string;
implementation_details?: string;
workspace_id?: string;
pattern_name?: string;
usage_examples?: string[];
benefits?: string[];
drawbacks?: string[];
}[];
context_links?: {
description?: string;
workspace_id?: string;
source_item_type?: string;
source_item_id?: string;
target_item_type?: string;
target_item_id?: string;
relationship_type?: "implements" | "related_to" | "depends_on" | "enables" | "conflicts_with" | "relates_to_progress";
timestamp?: Date;
}[];
custom_data?: Record<string, any>;
workspace_context?: {
workspace_id?: string;
project_id?: string;
active_context?: Record<string, any>;
product_context?: Record<string, any>;
};
relationships?: {
depends_on?: string[];
enables?: string[];
conflicts_with?: string[];
related_patterns?: string[];
};
}, {
decisions?: {
status?: "proposed" | "accepted" | "rejected" | "deprecated";
date?: Date;
id?: string;
title?: string;
description?: string;
rationale?: string;
implementation_details?: string;
consequences?: string[];
tags?: string[];
workspace_id?: string;
auto_linked_progress?: string[];
}[];
progress_entries?: {
status?: "todo" | "in_progress" | "completed" | "blocked";
date?: Date;
task?: string;
id?: string;
workspace_id?: string;
progress_notes?: string;
parent_id?: string;
linked_decisions?: string[];
}[];
system_patterns?: {
id?: string;
description?: string;
implementation_details?: string;
workspace_id?: string;
pattern_name?: string;
usage_examples?: string[];
benefits?: string[];
drawbacks?: string[];
}[];
context_links?: {
description?: string;
workspace_id?: string;
source_item_type?: string;
source_item_id?: string;
target_item_type?: string;
target_item_id?: string;
relationship_type?: "implements" | "related_to" | "depends_on" | "enables" | "conflicts_with" | "relates_to_progress";
timestamp?: Date;
}[];
custom_data?: Record<string, any>;
workspace_context?: {
workspace_id?: string;
project_id?: string;
active_context?: Record<string, any>;
product_context?: Record<string, any>;
};
relationships?: {
depends_on?: string[];
enables?: string[];
conflicts_with?: string[];
related_patterns?: string[];
};
}>;
embeddings: z.ZodObject<{
methodology_vector: z.ZodArray<z.ZodNumber, "many">;
context_vector: z.ZodArray<z.ZodNumber, "many">;
query_vector: z.ZodArray<z.ZodNumber, "many">;
}, "strip", z.ZodTypeAny, {
methodology_vector?: number[];
context_vector?: number[];
query_vector?: number[];
}, {
methodology_vector?: number[];
context_vector?: number[];
query_vector?: number[];
}>;
agent_optimizations: z.ZodObject<{
cursor: z.ZodObject<{
format: z.ZodEnum<["concise", "detailed"]>;
focus: z.ZodArray<z.ZodString, "many">;
effectiveness_score: z.ZodNumber;
preferred_sections: z.ZodArray<z.ZodString, "many">;
avoid_patterns: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
format?: "concise" | "detailed";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}, {
format?: "concise" | "detailed";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}>;
windsurf: z.ZodObject<{
format: z.ZodEnum<["step_by_step", "overview"]>;
focus: z.ZodArray<z.ZodString, "many">;
effectiveness_score: z.ZodNumber;
preferred_sections: z.ZodArray<z.ZodString, "many">;
avoid_patterns: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
format?: "step_by_step" | "overview";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}, {
format?: "step_by_step" | "overview";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}>;
claude_code: z.ZodObject<{
format: z.ZodEnum<["full_prp", "summary"]>;
focus: z.ZodArray<z.ZodString, "many">;
effectiveness_score: z.ZodNumber;
preferred_sections: z.ZodArray<z.ZodString, "many">;
avoid_patterns: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
format?: "full_prp" | "summary";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}, {
format?: "full_prp" | "summary";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}>;
generic: z.ZodObject<{
format: z.ZodLiteral<"balanced">;
focus: z.ZodArray<z.ZodString, "many">;
effectiveness_score: z.ZodNumber;
preferred_sections: z.ZodArray<z.ZodString, "many">;
avoid_patterns: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
format?: "balanced";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}, {
format?: "balanced";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
}>;
}, "strip", z.ZodTypeAny, {
cursor?: {
format?: "concise" | "detailed";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
windsurf?: {
format?: "step_by_step" | "overview";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
claude_code?: {
format?: "full_prp" | "summary";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
generic?: {
format?: "balanced";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
}, {
cursor?: {
format?: "concise" | "detailed";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
windsurf?: {
format?: "step_by_step" | "overview";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
claude_code?: {
format?: "full_prp" | "summary";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
generic?: {
format?: "balanced";
focus?: string[];
effectiveness_score?: number;
preferred_sections?: string[];
avoid_patterns?: string[];
};
}>;
effectiveness_metrics: z.ZodObject<{
overall_success_rate: z.ZodNumber;
implementation_success_count: z.ZodNumber;
usage_count: z.ZodNumber;
last_used: z.ZodDate;
improvement_suggestions: z.ZodArray<z.ZodString, "many">;
feedback_history: z.ZodArray<z.ZodObject<{
score: z.ZodNumber;
feedback: z.ZodString;
agent_type: z.ZodString;
timestamp: z.ZodDate;
implementation_success: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
timestamp?: Date;
score?: number;
feedback?: string;
agent_type?: string;
implementation_success?: boolean;
}, {
timestamp?: Date;
score?: number;
feedback?: string;
agent_type?: string;
implementation_success?: boolean;
}>, "many">;
}, "strip", z.ZodTypeAny, {
overall_success_rate?: number;
implementation_success_count?: number;
usage_count?: number;
last_used?: Date;
improvement_suggestions?: string[];
feedback_history?: {
timestamp?: Date;
score?: number;
feedback?: string;
agent_type?: string;
implementation_success?: boolean;
}[];
}, {
overall_success_rate?: number;
implementation_success_count?: number;
usage_count?: number;
last_used?: Date;
improvement_suggestions?: string[];
feedback_history?: {
timestamp?: Date;
score?: number;
feedback?: string;
agent_type?: string;
implementation_success?: boolean;
}[];
}>;
metadata: z.ZodObject<{
pattern_type: z.ZodString;
complexity: z.ZodEnum<["low", "medium", "high"]>;
project_types: z.ZodArray<z.ZodString, "many">;
tech_stacks: z.ZodArray<z.ZodString, "many">;
tags: z.ZodArray<z.ZodString, "many">;
created_at: z.ZodDate;
updated_at: z.ZodDate;
version: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
tags?: string[];
pattern_type?: string;
complexity?: "low" | "medium" | "high";
project_types?: string[];
tech_stacks?: string[];
created_at?: Date;
updated_at?: Date;
version?: number;
}, {
tags?: string[];
pattern_type?: string;
complexity?: "low" | "medium" | "high";
project_types?: string[];
tech_stacks?: string[];
created_at?: Date;
updated_at?: Date;
version?: number;
}>;
}, "strip", z.ZodTypeAny, {
_id?: ObjectId;
prp_methodology?: {
validation?: {
syntax_checks?: string[];
unit_test_commands?: string[];
integration_tests?: string[];
confidence_score?: number;
quality_checklist?: string[];
};
research?: {
codebase_analysis?: string[];
external_research?: string[];
documentation_urls?: string[];
existing_patterns?: string[];
potential_challenges?: string[];
};
implementation?: {
goal?: string;
business_value?: string;
technical_requirements?: string[];
pseudocode?: string;
task_breakdown?: {
validation?: string;
task?: string;
order?: number;
dependencies?: string[];
}[];
error_handling_strategy?: string;
integration_points?: string[];
};
};
knowledge_graph?: {
decisions?: {
status?: "proposed" | "accepted" | "rejected" | "deprecated";
date?: Date;
id?: string;
title?: string;
description?: string;
rationale?: string;
implementation_details?: string;
consequences?: string[];
tags?: string[];
workspace_id?: string;
auto_linked_progress?: string[];
}[];
progress_entries?: {
status?: "todo" | "in_progress" | "completed" | "blocked";
date?: Date;
task?: string;
id?: string;
workspace_id?: string;
progress_notes?: string;
parent_