Skip to content

feat(adk): improve skill middleware prompt for better LLM understanding#724

Merged
hi-pender merged 3 commits intomainfrom
feat/skill_prompt
Jan 29, 2026
Merged

feat(adk): improve skill middleware prompt for better LLM understanding#724
hi-pender merged 3 commits intomainfrom
feat/skill_prompt

Conversation

@hi-pender
Copy link
Contributor

Summary

This PR optimizes the skill middleware prompts to improve LLM understanding and consistency.

Changes

1. Use English XML tags in Chinese prompts

  • Changed Chinese XML tags (e.g., <技能>, <名称>) to English tags (<skill>, <name>)
  • This improves LLM parsing and maintains technical consistency
  • Removed duplicate toolDescriptionTemplateChinese variable since it's now identical to the English version

2. Use "Skill" terminology in Chinese prompts

  • Replaced "技能" with "Skill" throughout Chinese prompts
  • Added "Skill(技能)" explanation on first occurrence for clarity
  • Maintains terminology consistency with the actual tool name

3. Clarify skill name usage

  • Updated instruction to explicitly state: "Use the exact string inside <name> tag as the skill name"
  • This helps when skill names contain special characters or paths

4. Add relative path conversion guidance

  • Added clear instruction about converting relative paths to absolute paths using the base directory
  • Moved this guidance to tool description (decoupled from skill content)

5. Remove product-specific rules

  • Removed "Do not use this tool for built-in CLI commands" rule
  • This rule was specific to certain products and not applicable to the generic skill middleware

Files Changed

  • adk/middlewares/skill/prompt.go: Updated prompts and removed duplicate template
  • adk/middlewares/skill/skill.go: Simplified renderToolDescription function

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.79%. Comparing base (0077549) to head (100b626).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #724      +/-   ##
==========================================
+ Coverage   81.77%   81.79%   +0.01%     
==========================================
  Files         129      129              
  Lines       12419    12416       -3     
==========================================
  Hits        10156    10156              
+ Misses       1508     1504       -4     
- Partials      755      756       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hi-pender hi-pender merged commit d970d34 into main Jan 29, 2026
19 checks passed
@hi-pender hi-pender deleted the feat/skill_prompt branch January 29, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants