Skip to content

Commit ebce77a

Browse files
Fix issue #5155: [Resolver] Could we get a .md of tips for the .openhands_instructions file? (#5163)
Co-authored-by: Graham Neubig <[email protected]>
1 parent f4a2df8 commit ebce77a

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

docs/modules/usage/how-to/github-action.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,53 @@ To customize the default macro (`@openhands-agent`):
4343

4444
1. [Create a repository variable](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#creating-configuration-variables-for-a-repository) named `OPENHANDS_MACRO`
4545
2. Assign the variable a custom value
46+
47+
## Writing Effective .openhands_instructions Files
48+
49+
The `.openhands_instructions` file is a file that you can put in the root directory of your repository to guide OpenHands in understanding and working with your repository effectively. Here are key tips for writing high-quality instructions:
50+
51+
### Core Principles
52+
53+
1. **Concise but Informative**: Provide a clear, focused overview of the repository that emphasizes the most common actions OpenHands will need to perform.
54+
55+
2. **Repository Structure**: Explain the key directories and their purposes, especially highlighting where different types of code (e.g., frontend, backend) are located.
56+
57+
3. **Development Workflows**: Document the essential commands for:
58+
- Building and setting up the project
59+
- Running tests
60+
- Linting and code quality checks
61+
- Any environment-specific requirements
62+
63+
4. **Testing Guidelines**: Specify:
64+
- Where tests are located
65+
- How to run specific test suites
66+
- Any testing conventions or requirements
67+
68+
### Example Structure
69+
70+
```markdown
71+
# Repository Overview
72+
[Brief description of the project]
73+
74+
## General Setup
75+
- Main build command
76+
- Development environment setup
77+
- Pre-commit checks
78+
79+
## Backend
80+
- Location and structure
81+
- Testing instructions
82+
- Environment requirements
83+
84+
## Frontend
85+
- Setup prerequisites
86+
- Build and test commands
87+
- Environment variables
88+
89+
## Additional Guidelines
90+
- Code style requirements
91+
- Special considerations
92+
- Common workflows
93+
```
94+
95+
For a real-world example, refer to the [OpenHands repository's .openhands_instructions](https://github.com/All-Hands-AI/OpenHands/blob/main/.openhands_instructions).

0 commit comments

Comments
 (0)