Updated instructions
This commit is contained in:
@@ -16,7 +16,7 @@ from .base import BaseTool, ToolRequest
|
||||
|
||||
# Field descriptions to avoid duplication between Pydantic and JSON schema
|
||||
ANALYZE_FIELD_DESCRIPTIONS = {
|
||||
"files": "Files or directories to analyze (must be absolute paths)",
|
||||
"files": "Files or directories to analyze (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)",
|
||||
"prompt": "What to analyze or look for",
|
||||
"analysis_type": "Type of analysis to perform",
|
||||
"output_format": "How to format the output",
|
||||
|
||||
@@ -89,7 +89,7 @@ class ToolRequest(BaseModel):
|
||||
images: Optional[list[str]] = Field(
|
||||
None,
|
||||
description=(
|
||||
"Optional image(s) for visual context. Accepts absolute file paths or "
|
||||
"Optional image(s) for visual context. Accepts absolute file paths (must be FULL absolute paths to real files / folders - DO NOT SHORTEN) or "
|
||||
"base64 data URLs. Only provide when user explicitly mentions images. "
|
||||
"When including images, please describe what you believe each image contains "
|
||||
"(e.g., 'screenshot of error dialog', 'architecture diagram', 'code snippet') "
|
||||
@@ -955,18 +955,18 @@ When recommending searches, be specific about what information you need and why
|
||||
for file_path in request.files:
|
||||
if not os.path.isabs(file_path):
|
||||
return (
|
||||
f"Error: All file paths must be absolute. "
|
||||
f"Error: All file paths must be FULL absolute paths to real files / folders - DO NOT SHORTEN. "
|
||||
f"Received relative path: {file_path}\n"
|
||||
f"Please provide the full absolute path starting with '/'"
|
||||
f"Please provide the full absolute path starting with '/' (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)"
|
||||
)
|
||||
|
||||
# Check if request has 'path' attribute (used by review_changes tool)
|
||||
if hasattr(request, "path") and request.path:
|
||||
if not os.path.isabs(request.path):
|
||||
return (
|
||||
f"Error: Path must be absolute. "
|
||||
f"Error: Path must be FULL absolute paths to real files / folders - DO NOT SHORTEN. "
|
||||
f"Received relative path: {request.path}\n"
|
||||
f"Please provide the full absolute path starting with '/'"
|
||||
f"Please provide the full absolute path starting with '/' (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)"
|
||||
)
|
||||
|
||||
return None
|
||||
@@ -1014,7 +1014,7 @@ When recommending searches, be specific about what information you need and why
|
||||
f"MANDATORY ACTION REQUIRED: The prompt is too large for MCP's token limits (>{MCP_PROMPT_SIZE_LIMIT:,} characters). "
|
||||
"YOU MUST IMMEDIATELY save the prompt text to a temporary file named 'prompt.txt' in the working directory. "
|
||||
"DO NOT attempt to shorten or modify the prompt. SAVE IT AS-IS to 'prompt.txt'. "
|
||||
"Then resend the request with the absolute file path to 'prompt.txt' in the files parameter, "
|
||||
"Then resend the request with the absolute file path to 'prompt.txt' in the files parameter (must be FULL absolute path - DO NOT SHORTEN), "
|
||||
"along with any other files you wish to share as context. Leave the prompt text itself empty or very brief in the new request. "
|
||||
"This is the ONLY way to handle large prompts - you MUST follow these exact steps."
|
||||
),
|
||||
|
||||
@@ -23,7 +23,7 @@ CHAT_FIELD_DESCRIPTIONS = {
|
||||
"kind of response would be most helpful. The more context and detail you provide, the more "
|
||||
"valuable and targeted the response will be."
|
||||
),
|
||||
"files": "Optional files for context (must be absolute paths)",
|
||||
"files": "Optional files for context (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)",
|
||||
"images": (
|
||||
"Optional images for visual context. Useful for UI discussions, diagrams, visual problems, "
|
||||
"error screens, or architectural mockups."
|
||||
|
||||
@@ -25,7 +25,7 @@ from .base import BaseTool, ToolRequest
|
||||
|
||||
# Field descriptions to avoid duplication between Pydantic and JSON schema
|
||||
CODEREVIEW_FIELD_DESCRIPTIONS = {
|
||||
"files": "Code files or directories to review (must be absolute paths)",
|
||||
"files": "Code files or directories to review (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)",
|
||||
"prompt": (
|
||||
"User's summary of what the code does, expected behavior, constraints, and review objectives. "
|
||||
"IMPORTANT: Before using this tool, Claude should first perform its own preliminary review - "
|
||||
|
||||
@@ -63,7 +63,7 @@ class ConsensusRequest(ToolRequest):
|
||||
)
|
||||
files: Optional[list[str]] = Field(
|
||||
default_factory=list,
|
||||
description="Optional files or directories for additional context (must be absolute paths)",
|
||||
description="Optional files or directories for additional context (must be FULL absolute paths - DO NOT SHORTEN)",
|
||||
)
|
||||
images: Optional[list[str]] = Field(
|
||||
default_factory=list,
|
||||
@@ -148,7 +148,7 @@ class ConsensusTool(BaseTool):
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Optional files or directories for additional context (must be absolute paths)",
|
||||
"description": "Optional files or directories for additional context (must be FULL absolute paths - DO NOT SHORTEN)",
|
||||
},
|
||||
"images": {
|
||||
"type": "array",
|
||||
|
||||
@@ -45,10 +45,10 @@ DEBUG_FIELD_DESCRIPTIONS = {
|
||||
"contain the problematic code, or are necessary for understanding the root cause. "
|
||||
"This can include any relevant log files, error description documents, investigation documents, "
|
||||
"claude's own findings as a document, related code that may help with analysis."
|
||||
"DO NOT include every file scanned during investigation (must be absolute paths)."
|
||||
"DO NOT include every file scanned during investigation (must be FULL absolute paths - DO NOT SHORTEN)."
|
||||
),
|
||||
"error_context": "Stack trace, snippet from logs, or additional error context. For very large text you MUST instead"
|
||||
"save the context as a temporary file within the project folder and share it as an absolute file path"
|
||||
"save the context as a temporary file within the project folder and share it as a FULL absolute file path - DO NOT SHORTEN"
|
||||
"reference to the files parameter.",
|
||||
"images": "Optional images showing error screens, UI issues, logs displays, or visual debugging information",
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class PrecommitRequest(ToolRequest):
|
||||
|
||||
path: str = Field(
|
||||
...,
|
||||
description="Starting directory to search for git repositories (must be absolute path).",
|
||||
description="Starting directory to search for git repositories (must be FULL absolute paths - DO NOT SHORTEN).",
|
||||
)
|
||||
prompt: Optional[str] = Field(
|
||||
None,
|
||||
@@ -76,7 +76,7 @@ class PrecommitRequest(ToolRequest):
|
||||
)
|
||||
files: Optional[list[str]] = Field(
|
||||
None,
|
||||
description="Optional files or directories to provide as context (must be absolute paths). These files are not part of the changes but provide helpful context like configs, docs, or related code.",
|
||||
description="Optional files or directories to provide as context (must be FULL absolute paths - DO NOT SHORTEN). These files are not part of the changes but provide helpful context like configs, docs, or related code.",
|
||||
)
|
||||
images: Optional[list[str]] = Field(
|
||||
None,
|
||||
@@ -116,7 +116,7 @@ class Precommit(BaseTool):
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Starting directory to search for git repositories (must be absolute path).",
|
||||
"description": "Starting directory to search for git repositories (must be FULL absolute paths - DO NOT SHORTEN).",
|
||||
},
|
||||
"model": self.get_model_field_schema(),
|
||||
"prompt": {
|
||||
@@ -172,7 +172,7 @@ class Precommit(BaseTool):
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Optional files or directories to provide as context (must be absolute paths). These files are not part of the changes but provide helpful context like configs, docs, or related code.",
|
||||
"description": "Optional files or directories to provide as context (must be FULL absolute paths - DO NOT SHORTEN). These files are not part of the changes but provide helpful context like configs, docs, or related code.",
|
||||
},
|
||||
"images": {
|
||||
"type": "array",
|
||||
|
||||
@@ -32,12 +32,12 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
# Field descriptions to avoid duplication between Pydantic and JSON schema
|
||||
REFACTOR_FIELD_DESCRIPTIONS = {
|
||||
"files": "Code files or directories to analyze for refactoring opportunities (must be absolute paths)",
|
||||
"files": "Code files or directories to analyze for refactoring opportunities (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)",
|
||||
"prompt": "Description of refactoring goals, context, and specific areas of focus",
|
||||
"refactor_type": "Type of refactoring analysis to perform",
|
||||
"focus_areas": "Specific areas to focus on (e.g., 'performance', 'readability', 'maintainability', 'security')",
|
||||
"style_guide_examples": (
|
||||
"Optional existing code files to use as style/pattern reference (must be absolute paths). "
|
||||
"Optional existing code files to use as style/pattern reference (must be FULL absolute paths to real files / folders - DO NOT SHORTEN). "
|
||||
"These files represent the target coding style and patterns for the project."
|
||||
),
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class TestGenerationRequest(ToolRequest):
|
||||
|
||||
files: list[str] = Field(
|
||||
...,
|
||||
description="Code files or directories to generate tests for (must be absolute paths)",
|
||||
description="Code files or directories to generate tests for (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)",
|
||||
)
|
||||
prompt: str = Field(
|
||||
...,
|
||||
@@ -48,7 +48,7 @@ class TestGenerationRequest(ToolRequest):
|
||||
test_examples: Optional[list[str]] = Field(
|
||||
None,
|
||||
description=(
|
||||
"Optional existing test files or directories to use as style/pattern reference (must be absolute paths). "
|
||||
"Optional existing test files or directories to use as style/pattern reference (must be FULL absolute paths to real files / folders - DO NOT SHORTEN). "
|
||||
"If not provided, the tool will determine the best testing approach based on the code structure. "
|
||||
"For large test directories, only the smallest representative tests should be included to determine testing patterns. "
|
||||
"If similar tests exist for the code being tested, include those for the most relevant patterns."
|
||||
@@ -91,7 +91,7 @@ class TestGenerationTool(BaseTool):
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Code files or directories to generate tests for (must be absolute paths)",
|
||||
"description": "Code files or directories to generate tests for (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)",
|
||||
},
|
||||
"model": self.get_model_field_schema(),
|
||||
"prompt": {
|
||||
@@ -102,7 +102,7 @@ class TestGenerationTool(BaseTool):
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": (
|
||||
"Optional existing test files or directories to use as style/pattern reference (must be absolute paths). "
|
||||
"Optional existing test files or directories to use as style/pattern reference (must be FULL absolute paths to real files / folders - DO NOT SHORTEN). "
|
||||
"If not provided, the tool will determine the best testing approach based on the code structure. "
|
||||
"For large test directories, only the smallest representative tests will be included to determine testing patterns. "
|
||||
"If similar tests exist for the code being tested, include those for the most relevant patterns."
|
||||
|
||||
@@ -31,7 +31,7 @@ class ThinkDeepRequest(ToolRequest):
|
||||
)
|
||||
files: Optional[list[str]] = Field(
|
||||
None,
|
||||
description="Optional file paths or directories for additional context (must be absolute paths)",
|
||||
description="Optional file paths or directories for additional context (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)",
|
||||
)
|
||||
images: Optional[list[str]] = Field(
|
||||
None,
|
||||
@@ -85,7 +85,7 @@ class ThinkDeepTool(BaseTool):
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"},
|
||||
"description": "Optional file paths or directories for additional context (must be absolute paths)",
|
||||
"description": "Optional file paths or directories for additional context (must be FULL absolute paths to real files / folders - DO NOT SHORTEN)",
|
||||
},
|
||||
"images": {
|
||||
"type": "array",
|
||||
|
||||
Reference in New Issue
Block a user