Skip to content

Commit ca56ef5

Browse files
committed
tweak prompt
1 parent 63e6379 commit ca56ef5

File tree

2 files changed

+53
-49
lines changed

2 files changed

+53
-49
lines changed

cli/exp_mcp.go

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -576,24 +576,25 @@ func configureClaude(fs afero.Fs, cfg ClaudeConfig) error {
576576
}
577577

578578
var (
579-
coderPrompt = `You are a helpful Coding assistant. Aim to autonomously investigate
579+
defaultCoderPrompt = `You are a helpful Coding assistant. Aim to autonomously investigate
580580
and solve issues the user gives you and test your work, whenever possible.
581581
Avoid shortcuts like mocking tests. When you get stuck, you can ask the user
582582
but opt for autonomy.`
583583

584-
defaultReportTaskPrompt = `Report all tasks to Coder, following these EXACT guidelines:
584+
defaultReportTaskPrompt = `YOU MUST REPORT ALL TASKS TO CODER.
585+
When reporting tasks, you MUST follow these EXACT instructions:
586+
- IMMEDIATELY report status after receiving ANY user message.
587+
- Be granular. If you are investigating with multiple steps, report each step to coder.
585588
586-
1. Be granular. If you are investigating with multiple steps, report each step to coder.
587-
2. IMMEDIATELY report status after receiving ANY user message.
588-
3. Use "state": "working" when actively processing WITHOUT needing additional user input.
589-
4. Use "state": "complete" only when finished with a task.
590-
5. Use "state": "failure" when you need ANY user input, lack sufficient details, or encounter blockers.
589+
Task state MUST be one of the following:
590+
- Use "state": "working" when actively processing WITHOUT needing additional user input.
591+
- Use "state": "complete" only when finished with a task.
592+
- Use "state": "failure" when you need ANY user input, lack sufficient details, or encounter blockers.
591593
592-
In your summary, you MUST:
593-
- Be specific about what you're doing.
594-
- Clearly indicate what information you need from the user when in "failure" state
595-
- Keep it under 160 characters. Summaries longer than 160 characters are not accepted.
596-
- Make it actionable.`
594+
Task summaries MUST:
595+
- Include specifics about what you're doing.
596+
- Include clear and actionable steps for the user.
597+
- Be less than 160 characters in length.`
597598

598599
// Define the guard strings
599600
coderPromptStartGuard = "<coder-prompt>"
@@ -613,7 +614,7 @@ func injectClaudeMD(fs afero.Fs, systemPrompt, reportTaskPrompt, claudeMDPath st
613614
return xerrors.Errorf("failed to create claude config directory: %w", err)
614615
}
615616

616-
return afero.WriteFile(fs, claudeMDPath, []byte(promptsBlock(coderPrompt, reportTaskPrompt, systemPrompt, "")), 0o600)
617+
return afero.WriteFile(fs, claudeMDPath, []byte(promptsBlock(defaultCoderPrompt, reportTaskPrompt, systemPrompt, "")), 0o600)
617618
}
618619

619620
bs, err := afero.ReadFile(fs, claudeMDPath)
@@ -646,7 +647,7 @@ func injectClaudeMD(fs afero.Fs, systemPrompt, reportTaskPrompt, claudeMDPath st
646647
cleanContent = strings.TrimSpace(cleanContent)
647648

648649
// Create the new content with coder and system prompt prepended
649-
newContent := promptsBlock(coderPrompt, reportTaskPrompt, systemPrompt, cleanContent)
650+
newContent := promptsBlock(defaultCoderPrompt, reportTaskPrompt, systemPrompt, cleanContent)
650651

651652
// Write the updated content back to the file
652653
err = afero.WriteFile(fs, claudeMDPath, []byte(newContent), 0o600)

cli/exp_mcp_test.go

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -295,19 +295,20 @@ and solve issues the user gives you and test your work, whenever possible.
295295
Avoid shortcuts like mocking tests. When you get stuck, you can ask the user
296296
but opt for autonomy.
297297
298-
Report all tasks to Coder, following these EXACT guidelines:
299-
300-
1. Be granular. If you are investigating with multiple steps, report each step to coder.
301-
2. IMMEDIATELY report status after receiving ANY user message.
302-
3. Use "state": "working" when actively processing WITHOUT needing additional user input.
303-
4. Use "state": "complete" only when finished with a task.
304-
5. Use "state": "failure" when you need ANY user input, lack sufficient details, or encounter blockers.
305-
306-
In your summary, you MUST:
307-
- Be specific about what you're doing.
308-
- Clearly indicate what information you need from the user when in "failure" state
309-
- Keep it under 160 characters. Summaries longer than 160 characters are not accepted.
310-
- Make it actionable.
298+
YOU MUST REPORT ALL TASKS TO CODER.
299+
When reporting tasks, you MUST follow these EXACT instructions:
300+
- IMMEDIATELY report status after receiving ANY user message.
301+
- Be granular. If you are investigating with multiple steps, report each step to coder.
302+
303+
Task state MUST be one of the following:
304+
- Use "state": "working" when actively processing WITHOUT needing additional user input.
305+
- Use "state": "complete" only when finished with a task.
306+
- Use "state": "failure" when you need ANY user input, lack sufficient details, or encounter blockers.
307+
308+
Task summaries MUST:
309+
- Include specifics about what you're doing.
310+
- Include clear and actionable steps for the user.
311+
- Be less than 160 characters in length.
311312
</coder-prompt>
312313
<system-prompt>
313314
test-system-prompt
@@ -403,19 +404,20 @@ and solve issues the user gives you and test your work, whenever possible.
403404
Avoid shortcuts like mocking tests. When you get stuck, you can ask the user
404405
but opt for autonomy.
405406
406-
Report all tasks to Coder, following these EXACT guidelines:
407+
YOU MUST REPORT ALL TASKS TO CODER.
408+
When reporting tasks, you MUST follow these EXACT instructions:
409+
- IMMEDIATELY report status after receiving ANY user message.
410+
- Be granular. If you are investigating with multiple steps, report each step to coder.
407411
408-
1. Be granular. If you are investigating with multiple steps, report each step to coder.
409-
2. IMMEDIATELY report status after receiving ANY user message.
410-
3. Use "state": "working" when actively processing WITHOUT needing additional user input.
411-
4. Use "state": "complete" only when finished with a task.
412-
5. Use "state": "failure" when you need ANY user input, lack sufficient details, or encounter blockers.
412+
Task state MUST be one of the following:
413+
- Use "state": "working" when actively processing WITHOUT needing additional user input.
414+
- Use "state": "complete" only when finished with a task.
415+
- Use "state": "failure" when you need ANY user input, lack sufficient details, or encounter blockers.
413416
414-
In your summary, you MUST:
415-
- Be specific about what you're doing.
416-
- Clearly indicate what information you need from the user when in "failure" state
417-
- Keep it under 160 characters. Summaries longer than 160 characters are not accepted.
418-
- Make it actionable.
417+
Task summaries MUST:
418+
- Include specifics about what you're doing.
419+
- Include clear and actionable steps for the user.
420+
- Be less than 160 characters in length.
419421
</coder-prompt>
420422
<system-prompt>
421423
test-system-prompt
@@ -520,19 +522,20 @@ and solve issues the user gives you and test your work, whenever possible.
520522
Avoid shortcuts like mocking tests. When you get stuck, you can ask the user
521523
but opt for autonomy.
522524
523-
Report all tasks to Coder, following these EXACT guidelines:
525+
YOU MUST REPORT ALL TASKS TO CODER.
526+
When reporting tasks, you MUST follow these EXACT instructions:
527+
- IMMEDIATELY report status after receiving ANY user message.
528+
- Be granular. If you are investigating with multiple steps, report each step to coder.
524529
525-
1. Be granular. If you are investigating with multiple steps, report each step to coder.
526-
2. IMMEDIATELY report status after receiving ANY user message.
527-
3. Use "state": "working" when actively processing WITHOUT needing additional user input.
528-
4. Use "state": "complete" only when finished with a task.
529-
5. Use "state": "failure" when you need ANY user input, lack sufficient details, or encounter blockers.
530+
Task state MUST be one of the following:
531+
- Use "state": "working" when actively processing WITHOUT needing additional user input.
532+
- Use "state": "complete" only when finished with a task.
533+
- Use "state": "failure" when you need ANY user input, lack sufficient details, or encounter blockers.
530534
531-
In your summary, you MUST:
532-
- Be specific about what you're doing.
533-
- Clearly indicate what information you need from the user when in "failure" state
534-
- Keep it under 160 characters. Summaries longer than 160 characters are not accepted.
535-
- Make it actionable.
535+
Task summaries MUST:
536+
- Include specifics about what you're doing.
537+
- Include clear and actionable steps for the user.
538+
- Be less than 160 characters in length.
536539
</coder-prompt>
537540
<system-prompt>
538541
test-system-prompt

0 commit comments

Comments
 (0)