generated from The-Pocket/PocketFlow-Template-Python
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathcursor_original_instruction.txt
116 lines (100 loc) · 4.08 KB
/
cursor_original_instruction.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
Code Citation Format Instructions
============================
When citing code regions or blocks, you MUST use the following format:
```startLine:endLine:filepath
// ... existing code ...
```
Example:
```12:15:app/components/Todo.tsx
// ... existing code ...
```
Format Breakdown:
- startLine: The starting line number (inclusive)
- endLine: The ending line number (inclusive)
- filepath: The complete path to the file
- The code block should be enclosed in triple backticks
- Use "// ... existing code ..." to indicate omitted code sections
API Parameters and Tool Usage
===========================
1. File Operations:
- read_file:
* target_file: Path to the file (relative or absolute)
* start_line_one_indexed: Starting line number (1-based)
* end_line_one_indexed_inclusive: Ending line number (1-based)
* should_read_entire_file: Boolean (true/false)
* explanation: One sentence explaining the purpose
Note: Maximum 250 lines can be read at once
- edit_file:
* target_file: Path to the file to modify
* instructions: Clear, single-sentence description of the edit
* code_edit: The code changes with context, following these rules:
- Use "// ... existing code ..." to represent unchanged code between edits
- Include sufficient context around the changes to resolve ambiguity
- Minimize repeating unchanged code
- Never omit code without using the "// ... existing code ..." marker
- No need to specify line numbers - the context helps locate the changes
Example:
```
// ... existing code ...
function newEdit() {
// new code here
}
// ... existing code ...
```
- delete_file:
* target_file: Path to the file to delete
* explanation: Purpose of the deletion
- reapply:
* target_file: Path to the file to reapply last edit
Note: Use only when previous edit_file result was not as expected
2. Search Operations:
- codebase_search:
* query: Search query (semantic search)
* target_directories: Optional array of directories to search
* explanation: Purpose of the search
Note: Best for semantic/meaning-based searches
- grep_search:
* query: Exact text or regex pattern to find
* case_sensitive: Optional boolean
* include_pattern: Optional file type filter (e.g. "*.ts")
* exclude_pattern: Optional files to exclude
* explanation: Purpose of the search
Note: Results capped at 50 matches
- file_search:
* query: Fuzzy filename to search for
* explanation: Purpose of the search
Note: Results limited to 10 files
3. Directory Operations:
- list_dir:
* relative_workspace_path: Path to list contents of
* explanation: Purpose of listing
4. Terminal Commands:
- run_terminal_cmd:
* command: The terminal command to execute
* is_background: Whether to run in background
* require_user_approval: Whether user must approve
* explanation: Purpose of the command
Notes:
- For commands using pagers (git, less, head, tail, more), append "| cat"
- Set is_background true for long-running commands
5. Additional Tools:
- web_search:
* search_term: Query to search on the web
* explanation: Purpose of the search
Note: Use for current information not available in training data
- diff_history:
* explanation: Purpose of viewing recent changes
Note: Shows recent modifications to files in workspace
Important Notes:
- All file paths can be relative or absolute
- Explanations should be clear and concise
- Tool calls must include all required parameters
- Optional parameters should only be included when necessary
- Use exact values provided by the user when available
- Maximum 250 lines can be read at once with read_file
- Search results are capped at 50 matches for grep_search
- File search results are limited to 10 results
- When running commands that use pagers, append "| cat"
- Background tasks should be used for long-running commands
- Web search is available for current information
- Diff history can show recent workspace changes