Skip to content

Conversation

@xingyaoww
Copy link
Contributor

Summary

This PR adds comprehensive documentation on how users can customize system prompts using the AgentContext class in the OpenHands SDK.

Changes

  • Added a new "Customizing System Prompts" section to sdk/guides/skill.mdx
  • Documented the system_message_suffix and user_message_suffix parameters in detail
  • Explained how these suffixes work in combination with skills (both repo skills and triggered skills)
  • Provided practical examples for common use cases:
    • Development environment context
    • Conversation guidelines
    • Multi-repository context
  • Added best practices for using message suffixes effectively

Context

After examining the AgentContext implementation in the software-agent-sdk repository, I found that it provides flexible ways to customize prompts through:

  1. system_message_suffix: Adds custom instructions to the system prompt (always active)
  2. user_message_suffix: Adds instructions to every user message

The documentation now clearly explains:

  • What each suffix type does
  • When to use each one
  • How they interact with skills
  • Real-world examples of effective usage
  • Best practices to avoid common pitfalls

Related

This documentation is based on the implementation in:

  • openhands-sdk/openhands/sdk/context/agent_context.py
  • Example: examples/01_standalone_sdk/03_activate_skill.py

@xingyaoww can click here to continue refining the PR

- Document system_message_suffix and user_message_suffix for appending to prompts
- Add section on replacing entire system prompt with custom Jinja2 templates
- Explain system_prompt_filename (relative and absolute paths)
- Document system_prompt_kwargs for passing variables to custom templates
- Keep documentation compact and focused on key features
@xingyaoww xingyaoww force-pushed the add-system-prompt-customization-docs branch from 20fc88f to e41adb9 Compare November 21, 2025 15:13
@xingyaoww xingyaoww marked this pull request as ready for review November 21, 2025 15:21
@xingyaoww xingyaoww requested a review from enyst as a code owner November 21, 2025 15:21
Removed example of message suffixes from AgentContext section.
@xingyaoww xingyaoww merged commit 9cf000f into main Nov 21, 2025
2 checks passed
@xingyaoww xingyaoww deleted the add-system-prompt-customization-docs branch November 21, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants