Skip to content

Commit 3ffbf44

Browse files
committed
Update prompt
1 parent 94b35e2 commit 3ffbf44

File tree

1 file changed

+65
-138
lines changed

1 file changed

+65
-138
lines changed

server/src/methods/createLinearIssue.ts

+65-138
Original file line numberDiff line numberDiff line change
@@ -33,142 +33,73 @@ export const handler = async (
3333
const space = await getSpace(spaceId)
3434

3535
const message = `
36-
You are an AI that converts user-reported issues into standardized JSON reports.
37-
[PLACEHOLDER_FOR_ISSUE_TEXT]
38-
${text}
39-
[END_PLACEHOLDER]
40-
You should:
41-
1. Recognize issues reported in any language
42-
2. Translate the content to English with high accuracy, maintaining:
43-
- Technical terms in their original form (if text contains words like "*auth*" for example, keep it as "Fix *auth*" not "Fix *authentication*")
44-
- Cultural context (e.g., Lunar New Year terms)
45-
- Emojis and expressions
46-
- Professional tone while preserving sentiment
47-
3. Maintain the standardized JSON format
48-
Structure:
49-
{
50-
"title": "Action verb + clear description of the issue (in English)",
51-
"core_components": {
52-
"issue_type": "Bug/Enhancement/UX/etc.",
53-
"component": "Affected system component",
54-
"problem": "Concise problem statement",
55-
"scope": "Impact scope"
56-
},
57-
"description": {
58-
"original": "Original user report text in original language",
59-
"english": "English translation of the report"
60-
},
61-
"labels": [
62-
// Standard labels: "bug", "enhancement", "ux", "accessibility", "crash"
63-
],
64-
"platforms": [
65-
// Platform array: "iOS", "Android", "Web", etc.
66-
],
67-
"assignees": [
68-
// Names without @ mentions
69-
],
70-
"metadata": {
71-
"character_count": "<title length>",
72-
"includes_platform": true/false,
73-
"includes_action_verb": true/false,
74-
"priority_level": "low/medium/high"
75-
}
76-
}
77-
Examples:
78-
Input 1 (English):
79-
"@Mo mobile app is crashing whenever I open direct messages with Vlad. I think this started once he sent a video."
80-
Output 1:
81-
{
82-
"title": "Fix mobile app crash on open direct message with video message",
83-
"core_components": {
84-
"issue_type": "Bug",
85-
"component": "Direct Messages",
86-
"problem": "App crashes when opening specific DM with video",
87-
"scope": "Message rendering and video handling"
88-
},
89-
"description": {
90-
"original": "@Mo mobile app is crashing whenever I open direct messages with Vlad. I think this started once he sent a video.",
91-
"english": "@Mo mobile app is crashing whenever I open direct messages with Vlad. I think this started once he sent a video."
92-
},
93-
"labels": ["bug", "crash"],
94-
"platforms": ["iOS", "Android"],
95-
"assignees": ["Mo"],
96-
"metadata": {
97-
"character_count": 56,
98-
"includes_platform": true,
99-
"includes_action_verb": true,
100-
"priority_level": "high"
36+
Convert user reports to JSON tickets with this structure:
37+
[input text]
38+
${text}
39+
[end input text]
40+
{
41+
"title": <"Specific action + target element">,
42+
"description": {
43+
"original": <"Raw input">,
44+
"english": <"Cleaned translation">
45+
},
46+
"labels": [ // "bug", "enhancement", "ux", "accessibility", "crash" ,"feature", or some other label like these],
47+
"platforms": ["iOS", "Android", "Web"],
48+
"assignees": [ // "Names from input"]
10149
}
102-
}
103-
Input 2 (Chinese):
104-
"@Ellie @Maylin 除夕的商品一樣是明天下午兩天釋出, 但是我會一直放到跟初一的商品一起下架(週四23:29)."
105-
Output 2:
106-
{
107-
"title": "Set Lunar New Year Eve products release schedule and extended end time",
108-
"analysis": {
109-
"core_components": {
110-
"issue_type": "Enhancement",
111-
"component": "Product Management",
112-
"problem": "Need to set special timing for holiday products",
113-
"scope": "Product release scheduling"
50+
51+
[Title Rules]
52+
1. Required verbs:
53+
- Add "[Feature]"
54+
- Fix "[UI/Breakage]"
55+
- Increase/Decrease "[Metric]"
56+
- Make "[Element]" [bigger/smaller/clearer]
57+
- Move "[Component]"
58+
- Change "[Behavior]"
59+
- Or common and human like verbs like the top ones
60+
61+
2. Requirements:
62+
- Include numbers when specified ("Increase timeout to 30s")
63+
- Mention integrated services ("Add Zoom to calendar")
64+
- Keep under 60 characters
65+
- Use specific terms like "increase height" instead of general terms like "make taller."
66+
67+
68+
[Examples]
69+
Input: "@Mo will do→Notion broken #noor-bugs"
70+
Output:
71+
{
72+
"title": "Add 'Will do' to Notion issue creation",
73+
"description": {
74+
"original": "@Mo it would be useful to have will do actually work here. instead Isaac has to reply to Matthew, and engage the Notion issue creator #noor-bugs",
75+
"english": "Implement 'Will do' functionality for automatic Notion issue creation instead of manual replies"
11476
},
115-
"metadata": {
116-
"character_count": 58,
117-
"includes_platform": false,
118-
"includes_action_verb": true,
119-
"priority_level": "medium"
77+
"labels": ["enhancement"],
78+
"platforms": ["Web"],
79+
"assignees": ["Mo"]
80+
}
81+
82+
Input: "Text in settings too damn small"
83+
Output:
84+
{
85+
"title": "Make settings text size 20% larger",
86+
"description": {
87+
"original": "Text in settings too damn small",
88+
"english": "Increase settings interface text size for better readability"
12089
},
121-
"task_details": {
122-
"description": {
123-
"original": "除夕的商品一樣是明天下午兩天釋出, 但是我會一直放到跟初一的商品一起下架(週四23:29).",
124-
"english": "Lunar New Year Eve products will be released tomorrow afternoon for two days, but will remain available until being taken down together with first day of New Year products (Thursday 23:29)"
125-
},
126-
"labels": [
127-
"enhancement"
128-
],
129-
"platforms": [
130-
"Web"
131-
],
132-
"assignees": [
133-
"Ellie",
134-
"Maylin"
135-
]
136-
}
90+
"labels": ["ux"],
91+
"platforms": ["Android"],
92+
"assignees": []
13793
}
138-
}
139-
Translation Guidelines:
140-
1. Context Awareness:
141-
- Understand e-commerce and streaming context
142-
- Preserve brand names (e.g., "Coach Outlet")
143-
- Maintain technical terms consistently
144-
- Keep time and date formats clear
145-
2. Cultural Elements:
146-
- Properly translate cultural references (e.g., Lunar New Year terms)
147-
- Keep appropriate level of formality
148-
- Preserve emojis and emotional context
149-
- Handle mixed language input appropriately
150-
3. Technical Accuracy:
151-
- Distinguish between meetings and streams
152-
- Understand e-commerce terminology
153-
- Maintain platform-specific terms
154-
- Keep consistent technical vocabulary
155-
4. Title Creation:
156-
- Start with action verb
157-
- Be concise but complete
158-
- Include key technical terms
159-
- Maintain professional tone
160-
Key rules:
161-
1. Accept input in any language
162-
2. Keep original text in description
163-
3. Provide accurate English translation
164-
4. Generate all analysis and titles in English
165-
5. Maintain names as they appear in original text
166-
6. Keep technical terms unchanged
167-
7. Use only standard labels: "bug", "enhancement", "ux", "accessibility", "crash"
168-
8. Remove @ symbols from assignee names
169-
9. Keep platform names standard: "iOS", "Android", "Web"
170-
Parse the provided issue and return a properly formatted JSON report following these guidelines.
171-
JUST RETURN THE JSON, NO OTHER TEXT.
94+
95+
[Processing Rules]
96+
1. Convert implied requests to explicit metrics
97+
2. Remove hashtags/internal codes
98+
3. Keep brand names in titles
99+
4. Use exact numbers from input
100+
5. Never add new fields
101+
102+
Return ONLY JSON, no other text.
172103
`
173104

174105
const response = await openaiClient?.chat.completions.create({
@@ -202,12 +133,9 @@ JUST RETURN THE JSON, NO OTHER TEXT.
202133
userId: user.id,
203134
title: jsonResponse.title,
204135
description: jsonResponse.description.original,
205-
teamId: jsonResponse.metadata.teamId,
206136
messageId: messageId,
207137
chatId: chatId,
208138
labelIds: jsonResponse.labels,
209-
assigneeId: jsonResponse.assignees[0],
210-
statusId: jsonResponse.metadata.statusId,
211139
})
212140
}
213141
} catch (error) {
@@ -234,19 +162,18 @@ type CreateIssueProps = {
234162
userId: number
235163
title: string
236164
description: string
237-
teamId: string
238165
messageId: number
239166
chatId: number
240167
labelIds: string[]
241-
assigneeId: string
242-
statusId: string
243168
}
244169

245170
const createIssueFunc = async (props: CreateIssueProps) => {
246171
const teamId = await getLinearTeams({ userId: props.userId })
247172
const teamIdValue = teamId.teams.teams.nodes[0].id
173+
248174
const labels = await getLinearIssueLabels({ userId: props.userId })
249175
const matchingLabels = labels.labels.filter((label: any) => props.labelIds.includes(label.name.toLowerCase()))
176+
250177
const linearUser = await getLinearUser({ userId: props.userId })
251178
const statuses = await getLinearIssueStatuses({ userId: props.userId })
252179
const unstarded = statuses.workflowStates.filter((status: any) => status.type === "unstarted")

0 commit comments

Comments
 (0)