Skip to content

Commit 434bbf4

Browse files
committed
chore: enhance agent communication and coding guidelines in copilot instructions
1 parent 709798a commit 434bbf4

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/copilot-instructions.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121

2222
RobotCode is a comprehensive Robot Framework toolkit that provides IDE extensions (VS Code, IntelliJ), CLI tools, and Language Server Protocol implementation. It uses Robot Framework's native parser for full compatibility while extending it with modern development tools like DAP debugging, test discovery, and multi-workspace support.
2323

24+
## Agent Communication Guidelines
25+
26+
- **Ask When Unclear:** If requirements or context are ambiguous, ask clarifying questions
27+
- **Sequential Questions:** Ask questions one at a time, allowing the user to answer each individually
28+
- **Multiple Choice Format:** When possible, provide specific options rather than open-ended questions
29+
- **Always Include "Other":** End multiple choice questions with "Other - please specify" option
30+
- **Progressive Refinement:** Start with broad questions, then get more specific based on answers
31+
- **Acknowledge Answers:** Confirm understanding before proceeding to implementation
32+
2433
## Tech Stack
2534

2635
### Core Technologies
@@ -44,6 +53,46 @@ RobotCode is a comprehensive Robot Framework toolkit that provides IDE extension
4453
- **Robot Framework:** 5.0, 6.0, 6.1, 7.0, 7.1, 7.2, 7.3
4554
- **Test Framework:** pytest with regtest2 for snapshot testing
4655

56+
## General Coding Guidelines
57+
58+
### Clean Code Principles
59+
- **Readability First:** Code is read more often than written - prioritize clarity over cleverness
60+
- **Meaningful Names:** Use descriptive names for variables, functions, and classes that express intent
61+
- **Single Responsibility:** Each function/class should have one reason to change
62+
- **Small Functions:** Keep functions focused and under 20 lines when possible
63+
- **No Magic Numbers:** Use named constants or enums instead of hardcoded values
64+
- **Avoid Deep Nesting:** Use early returns and guard clauses to reduce cyclomatic complexity
65+
66+
### Code Organization
67+
- **Consistent Structure:** Follow established patterns within each package
68+
- **Separation of Concerns:** Keep business logic separate from infrastructure code
69+
- **Interface Segregation:** Create focused interfaces rather than monolithic ones
70+
- **Dependency Inversion:** Depend on abstractions, not concrete implementations
71+
72+
### Error Handling
73+
- **Explicit Error Handling:** Use proper exception/error types and hierarchies
74+
- **Fail Fast:** Validate inputs early and provide clear error messages
75+
- **Resource Management:** Use appropriate resource cleanup patterns (try-with-resources, RAII, etc.)
76+
- **Logging:** Provide meaningful log messages at appropriate levels
77+
78+
### Documentation Standards
79+
- **Function Documentation:** All public functions/methods must have comprehensive documentation
80+
- **Type Annotations:** Use static type checking where available (TypeScript, Python type hints, etc.)
81+
- **README Files:** Each package/module should have clear usage documentation
82+
- **Inline Comments:** Explain *why*, not *what* - the code should be self-documenting
83+
84+
### Testing Requirements
85+
- **Test Coverage:** Maintain high test coverage with meaningful test cases
86+
- **Test Naming:** Use descriptive test names that explain the scenario
87+
- **Test Structure:** Organize tests clearly with setup, execution, and verification phases
88+
- **Test Independence:** Each test should be able to run in isolation
89+
90+
### Performance Considerations
91+
- **Async Patterns:** Use proper asynchronous programming patterns where applicable
92+
- **Resource Efficiency:** Minimize memory allocations and resource usage in hot paths
93+
- **Lazy Loading:** Load resources only when needed
94+
- **Caching Strategy:** Implement appropriate caching for expensive operations
95+
4796
## Architecture Patterns
4897

4998
### Package Structure

0 commit comments

Comments
 (0)