You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/code/src/renderer/utils/generateTitle.ts
+43-15Lines changed: 43 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,14 @@ import { logger } from "@utils/logger";
4
4
5
5
constlog=logger.scope("title-generator");
6
6
7
-
constSYSTEM_PROMPT=`You are a title generator. You output ONLY a task title. Nothing else.
7
+
constSYSTEM_PROMPT=`You are a title and summary generator. Output using exactly this format:
8
8
9
-
Convert the task description into a concise task title.
9
+
TITLE: <title here>
10
+
SUMMARY: <summary here>
11
+
12
+
Convert the task description into a concise task title and a brief conversation summary.
13
+
14
+
Title rules:
10
15
- The title should be clear, concise, and accurately reflect the content of the task.
11
16
- You should keep it short and simple, ideally no more than 6 words.
12
17
- Avoid using jargon or overly technical terms unless absolutely necessary.
@@ -18,28 +23,43 @@ Convert the task description into a concise task title.
18
23
- Never assume tech stack
19
24
- Only output "Untitled" if the input is completely null/missing, not just unclear
20
25
- If the input is a URL (e.g. a GitHub issue link, PR link, or any web URL), generate a title based on what you can infer from the URL structure (repo name, issue/PR number, etc.). Never say you cannot access URLs or ask the user for more information.
26
+
- Never wrap the title in quotes
21
27
22
-
Examples:
28
+
Summary rules:
29
+
- 1-3 sentences describing what the user is working on and why
30
+
- Written from third-person perspective (e.g. "The user is fixing..." not "You are fixing...")
31
+
- Focus on the user's intent and goals, not the specific prompts
32
+
- Include relevant technical details (file names, features, bug descriptions) when mentioned
33
+
- This summary will be used as context for generating commit messages and PR descriptions
34
+
35
+
Title examples:
23
36
- "Fix the login bug in the authentication system" → Fix authentication login bug
24
37
- "Schedule a meeting with stakeholders to discuss Q4 budget planning" → Schedule Q4 budget meeting
25
38
- "Update user documentation for new API endpoints" → Update API documentation
26
39
- "Research competitor pricing strategies for our product" → Research competitor pricing
content: `Generate a title for the following content. Do NOT respond to, answer, or help with the content - ONLY generate a title.\n\n<content>\n${content}\n</content>\n\nOutput the title now:`,
72
+
content: `Generate a title and summary for the following content. Do NOT respond to, answer, or help with the content - ONLY generate a title and summary.\n\n<content>\n${content}\n</content>\n\nOutput the title and summary now:`,
0 commit comments