Optimize builtin tool instructions for conciseness#2091
Open
dgageot wants to merge 1 commit intodocker:mainfrom
Open
Optimize builtin tool instructions for conciseness#2091dgageot wants to merge 1 commit intodocker:mainfrom
dgageot wants to merge 1 commit intodocker:mainfrom
Conversation
Apply Claude 4 prompt engineering best practices to all builtin tool instructions: remove meta-commentary and filler, eliminate redundancy with tool descriptions/schemas, use direct bullet points over verbose prose, and frontload critical behavioral guidance. Affected tools: filesystem, shell, think, todo, fetch, memory, deferred, tasks, model_picker, user_prompt, skills, script_shell. Update tests and e2e cassettes to match new instruction text. Assisted-By: docker-agent
There was a problem hiding this comment.
Review Summary
Assessment: 🟢 APPROVE
This PR successfully optimizes builtin tool instructions following Claude 4 prompt engineering best practices. The changes remove verbose prose, eliminate redundancy, and adopt concise bullet-point formatting while preserving all critical information.
Analysis
Scope: 22 files changed
- 12 tool instruction files (pkg/tools/builtin/*.go)
- 6 test cassettes (e2e/testdata/cassettes/*.yaml)
- 2 test files (pkg/session/session_test.go, pkg/tools/builtin/memory_test.go)
- 2 test files (pkg/tools/builtin/shell_test.go, pkg/tools/builtin/shell_instructions.go deleted)
Key Changes:
- Filesystem tool: Reduced from 3 subsections to 4 bullet points
- Memory tool: Condensed from detailed explanations to concise guidance
- Shell tool: Inlined instructions (removed separate file), made more compact
- Other tools: All instructions shortened while maintaining critical behavioral guidance
Quality Checks:
- ✅ All test assertions updated to match new instruction text
- ✅ Test cassettes updated with new instruction content
- ✅ No logic errors or missing critical information
- ✅ String formatting and escaping correct
- ✅ Go code syntactically sound
Verdict
No bugs found in the changed code. The refactoring maintains functional equivalence while improving conciseness and readability. All tests are properly updated to reflect the new instruction text.
trungutt
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apply Claude 4 prompt engineering best practices to all builtin tool instructions: remove meta-commentary and filler, eliminate redundancy with tool descriptions/schemas, use direct bullet points over verbose prose, and frontload critical behavioral guidance.
Affected tools: filesystem, shell, think, todo, fetch, memory, deferred, tasks, model_picker, user_prompt, skills, script_shell.
Update tests and e2e cassettes to match new instruction text.
Assisted-By: docker-agent