Skip to content

Commit bd83fae

Browse files
author
Zvi Fried
committed
system prompt changes
1 parent 1437bc5 commit bd83fae

19 files changed

+100
-128
lines changed

src/mcp_as_a_judge/messaging/llm_provider.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ async def send_message(
6666
if provider.provider_type == "mcp_sampling":
6767
# MCP sampling provider with SamplingMessage objects
6868
# Type ignore because MCPSamplingProvider has send_message method
69-
response = await provider.send_message(
70-
formatted_messages, config
71-
)
69+
response = await provider.send_message(formatted_messages, config)
7270
else:
7371
# LLM API provider with universal Message objects
7472
response = await provider.send_message(formatted_messages, config)

src/mcp_as_a_judge/models.py

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from pydantic import BaseModel, Field
99

10+
from mcp_as_a_judge.constants import MAX_TOKENS
1011
from mcp_as_a_judge.models.task_metadata import TaskMetadata
1112
from mcp_as_a_judge.workflow import WorkflowGuidance
1213

@@ -176,14 +177,27 @@ class URLValidationResult(BaseModel):
176177
# Prompt variable models for type safety and validation
177178

178179

179-
class JudgeCodingPlanSystemVars(BaseModel):
180-
"""Variables for judge_coding_plan system prompt."""
180+
class SystemVars(BaseModel):
181+
"""Unified system variables for all system prompts.
182+
183+
This replaces all individual SystemVars models to reduce duplication.
184+
All system prompts use the same basic structure with response schema and token limits.
185+
"""
181186

182187
response_schema: str = Field(
183-
description="JSON schema for the expected response format"
188+
default="", description="JSON schema for the expected response format (optional)"
189+
)
190+
max_tokens: int = Field(
191+
default=MAX_TOKENS, description="Maximum tokens available for response"
192+
)
193+
task_size_definitions: str = Field(
194+
default="", description="Task size classifications and workflow routing rules (optional)"
184195
)
185196

186197

198+
199+
200+
187201
class JudgeCodingPlanUserVars(BaseModel):
188202
"""Variables for judge_coding_plan user prompt."""
189203

@@ -246,12 +260,7 @@ class JudgeCodingPlanUserVars(BaseModel):
246260
)
247261

248262

249-
class JudgeCodeChangeSystemVars(BaseModel):
250-
"""Variables for judge_code_change system prompt."""
251263

252-
response_schema: str = Field(
253-
description="JSON schema for the expected response format"
254-
)
255264

256265

257266
class JudgeCodeChangeUserVars(BaseModel):
@@ -270,12 +279,7 @@ class JudgeCodeChangeUserVars(BaseModel):
270279
)
271280

272281

273-
class ResearchValidationSystemVars(BaseModel):
274-
"""Variables for research_validation system prompt."""
275282

276-
response_schema: str = Field(
277-
description="JSON schema for the expected response format"
278-
)
279283

280284

281285
class ResearchValidationUserVars(BaseModel):
@@ -296,12 +300,7 @@ class ResearchValidationUserVars(BaseModel):
296300
)
297301

298302

299-
class WorkflowGuidanceSystemVars(BaseModel):
300-
"""Variables for build_workflow system prompt."""
301303

302-
response_schema: str = Field(
303-
description="JSON schema for the expected response format"
304-
)
305304

306305

307306
class WorkflowGuidanceUserVars(BaseModel):
@@ -325,10 +324,7 @@ class WorkflowGuidanceUserVars(BaseModel):
325324
)
326325

327326

328-
class ValidationErrorSystemVars(BaseModel):
329-
"""Variables for validation_error system prompt."""
330327

331-
# No additional variables needed for system prompt
332328

333329

334330
class ValidationErrorUserVars(BaseModel):
@@ -340,10 +336,7 @@ class ValidationErrorUserVars(BaseModel):
340336
context: str = Field(description="Additional context about the validation failure")
341337

342338

343-
class DynamicSchemaSystemVars(BaseModel):
344-
"""Variables for dynamic_schema system prompt."""
345339

346-
# No additional variables needed for system prompt
347340

348341

349342
class DynamicSchemaUserVars(BaseModel):
@@ -374,12 +367,7 @@ class ElicitationFallbackUserVars(BaseModel):
374367
)
375368

376369

377-
class ResearchRequirementsAnalysisSystemVars(BaseModel):
378-
"""Variables for research_requirements_analysis system prompt."""
379370

380-
response_schema: str = Field(
381-
description="JSON schema for the expected response format"
382-
)
383371

384372

385373
class ResearchRequirementsAnalysisUserVars(BaseModel):

src/mcp_as_a_judge/models/__init__.py

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,10 @@
2323
from .task_metadata import RequirementsVersion, TaskMetadata, TaskState
2424

2525
__all__ = [
26-
"DynamicSchemaSystemVars",
26+
"DynamicSchemaUserVars",
2727
"ElicitationFallbackUserVars",
2828
"EnhancedResponseFactory",
29-
"JudgeCodeChangeSystemVars",
3029
"JudgeCodeChangeUserVars",
31-
"JudgeCodingPlanSystemVars",
3230
"JudgeCodingPlanUserVars",
3331
"JudgeResponse",
3432
"JudgeResponseWithTask",
@@ -37,18 +35,17 @@
3735
"RequirementsVersion",
3836
"ResearchComplexityFactors",
3937
"ResearchRequirementsAnalysis",
40-
"ResearchRequirementsAnalysisSystemVars",
4138
"ResearchRequirementsAnalysisUserVars",
4239
"ResearchValidationResponse",
43-
"ResearchValidationSystemVars",
4440
"ResearchValidationUserVars",
41+
"SystemVars",
4542
"TaskAnalysisResult",
4643
"TaskCompletionResult",
4744
"TaskMetadata",
4845
"TaskState",
4946
"URLValidationResult",
47+
"ValidationErrorUserVars",
5048
"WorkflowGuidance",
51-
"WorkflowGuidanceSystemVars",
5249
"WorkflowGuidanceUserVars",
5350
]
5451

@@ -71,24 +68,18 @@
7168

7269
# Import the models we need
7370
ElicitationFallbackUserVars = models_py.ElicitationFallbackUserVars
74-
JudgeCodeChangeSystemVars = models_py.JudgeCodeChangeSystemVars
7571
JudgeCodeChangeUserVars = models_py.JudgeCodeChangeUserVars
76-
JudgeCodingPlanSystemVars = models_py.JudgeCodingPlanSystemVars
7772
JudgeCodingPlanUserVars = models_py.JudgeCodingPlanUserVars
7873
ResearchValidationResponse = models_py.ResearchValidationResponse
79-
ResearchValidationSystemVars = models_py.ResearchValidationSystemVars
8074
ResearchValidationUserVars = models_py.ResearchValidationUserVars
81-
WorkflowGuidanceSystemVars = models_py.WorkflowGuidanceSystemVars
8275
WorkflowGuidanceUserVars = models_py.WorkflowGuidanceUserVars
83-
DynamicSchemaSystemVars = models_py.DynamicSchemaSystemVars
8476
DynamicSchemaUserVars = models_py.DynamicSchemaUserVars
77+
ValidationErrorUserVars = models_py.ValidationErrorUserVars
78+
SystemVars = models_py.SystemVars
8579

8680
# Import research-related models
8781
ResearchComplexityFactors = models_py.ResearchComplexityFactors
8882
ResearchRequirementsAnalysis = models_py.ResearchRequirementsAnalysis
89-
ResearchRequirementsAnalysisSystemVars = (
90-
models_py.ResearchRequirementsAnalysisSystemVars
91-
)
9283
ResearchRequirementsAnalysisUserVars = (
9384
models_py.ResearchRequirementsAnalysisUserVars
9485
)
@@ -102,37 +93,25 @@
10293
class ElicitationFallbackUserVars(BaseModel):
10394
pass
10495

105-
class JudgeCodeChangeSystemVars(BaseModel):
106-
pass
107-
10896
class JudgeCodeChangeUserVars(BaseModel):
10997
pass
11098

111-
class JudgeCodingPlanSystemVars(BaseModel):
112-
pass
113-
11499
class JudgeCodingPlanUserVars(BaseModel):
115100
pass
116101

117102
class ResearchValidationResponse(BaseModel):
118103
pass
119104

120-
class ResearchValidationSystemVars(BaseModel):
121-
pass
122-
123105
class ResearchValidationUserVars(BaseModel):
124106
pass
125107

126-
class WorkflowGuidanceSystemVars(BaseModel):
127-
pass
128-
129108
class WorkflowGuidanceUserVars(BaseModel):
130109
pass
131110

132-
class DynamicSchemaSystemVars(BaseModel):
111+
class DynamicSchemaUserVars(BaseModel):
133112
pass
134113

135-
class DynamicSchemaUserVars(BaseModel):
114+
class SystemVars(BaseModel):
136115
pass
137116

138117
class ResearchComplexityFactors(BaseModel):

src/mcp_as_a_judge/models/enhanced_responses.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
and intelligent next-step guidance.
77
"""
88

9-
109
from pydantic import BaseModel, Field
1110

1211
from mcp_as_a_judge.models.task_metadata import TaskMetadata, TaskSize
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## Response Constraints
2+
3+
**CRITICAL: You have {{ max_tokens }} tokens maximum for your response.**
4+
5+
**Be PRECISE and MINIMALISTIC:**
6+
- Transform all information without creating overhead
7+
- Use concise, direct language
8+
- Focus on essential analysis only
9+
- Avoid verbose explanations unless critical
10+
- Prioritize actionable insights over detailed descriptions

src/mcp_as_a_judge/prompts/system/dynamic_schema.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ You are an expert UX designer and software engineer specializing in creating dyn
22

33
Your task is to generate field definitions for collecting specific information from a user through an interactive elicitation form.
44

5+
{% include 'shared/response_constraints.md' %}
6+
57
**KEY REQUIREMENTS:**
68
1. **Always provide at least 1 required field** - there must be at least one essential piece of information
79
2. **Create minimal fields based on the user query** - only generate fields that are actually needed for the specific request

src/mcp_as_a_judge/prompts/system/judge_code_change.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
You are an expert software engineering judge specializing in code review. Your role is to evaluate code changes and provide feedback on quality, security, and best practices.
44

5+
{% include 'shared/response_constraints.md' %}
6+
57
## Your Expertise
68

79
- Code quality assessment and best practices

src/mcp_as_a_judge/prompts/system/judge_coding_plan.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
You are an expert software engineering judge. Your role is to review coding plans and provide comprehensive feedback based on established software engineering best practices.
44

5+
{% include 'shared/response_constraints.md' %}
6+
57
## Your Expertise
68

79
- Deep knowledge of software architecture and design patterns

src/mcp_as_a_judge/prompts/system/research_requirements_analysis.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
You are an expert at analyzing software development tasks to determine appropriate research requirements based on task complexity, domain specialization, and implementation risk.
44

5+
{% include 'shared/response_constraints.md' %}
6+
57
## Your Expertise
68

79
- Assessing task complexity across multiple dimensions

src/mcp_as_a_judge/prompts/system/research_validation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
You are an expert at evaluating the comprehensiveness and quality of research for software development tasks.
44

5+
{% include 'shared/response_constraints.md' %}
6+
57
## Your Expertise
68

79
- Assessing research thoroughness and depth

0 commit comments

Comments
 (0)