Skip to content

Commit ad6495b

Browse files
committed
chore: update agent communication guidelines and Python development instructions for clarity and consistency for github copilot
1 parent 65b0912 commit ad6495b

File tree

3 files changed

+21
-91
lines changed

3 files changed

+21
-91
lines changed

.github/copilot-instructions.md

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,45 +23,18 @@ RobotCode is a comprehensive Robot Framework toolkit that provides IDE extension
2323

2424
## Agent Communication Guidelines
2525

26-
### When to Ask vs. Implement Directly
26+
### Core Rules
2727

28-
- **ALWAYS ASK when multiple valid approaches exist:** Present specific options and wait for user choice
29-
- **ALWAYS ASK when requirements are incomplete:** Don't make assumptions about missing details
30-
- **IMPLEMENT DIRECTLY only when:** Requirements are clear and there's one obvious correct approach
31-
- **STOP and ASK if unsure:** Better to ask than to implement the wrong solution
28+
- **REVIEW/ANALYZE/CHECK/EXAMINE:** READ-ONLY operations. Provide analysis and feedback, NEVER make changes
29+
- **IMPLEMENT/ADD/CREATE/FIX/CHANGE:** Implementation required. Ask for clarification if multiple approaches exist
30+
- **IMPROVE/OPTIMIZE/REFACTOR:** Always ask for specific approach before implementing
3231

33-
### Question Format Rules
32+
### Communication Flow
3433

35-
- **Wait for Response:** NEVER implement after asking - always wait for the user's explicit choice
36-
- **Specific Options:** Provide concrete alternatives, not vague descriptions
37-
- **Number Options:** Use "1), 2), 3)" format for easy selection
38-
- **Always Include "Other":** End with "4) Other approach - please describe what you have in mind"
39-
- **One Question at a Time:** Ask one focused question, get answer, then proceed or ask next question
40-
41-
### Implementation Flow
42-
43-
1. **Analyze Request:** Is this clear and unambiguous?
44-
2. **If Unclear:** Ask specific question with numbered options and STOP
45-
3. **Wait for Answer:** Do not proceed until user responds
46-
4. **Confirm Understanding:** "I understand you want option X. I'll implement..."
47-
5. **Then Implement:** Only after explicit user choice
48-
49-
### Example Interaction Pattern
50-
51-
```
52-
User: "Add error handling to the function"
53-
54-
Agent: "I see several approaches for error handling. Which would you prefer?
55-
56-
1) Try-catch blocks with specific exception types
57-
2) Return Result<T, Error> pattern with error types
58-
3) Simple boolean return with logging
59-
4) Other approach - please describe what you have in mind
60-
61-
Please let me know which option you'd like me to implement."
62-
63-
[WAIT FOR USER RESPONSE - DO NOT IMPLEMENT YET]
64-
```
34+
1. **Recognize Intent:** Review request vs. Implementation request?
35+
2. **For Reviews:** Analyze and suggest, but don't change anything
36+
3. **For Implementation:** Ask numbered options if unclear, wait for response, then implement
37+
4. **Question Format:** Use "A), B), C), D), ..." format, always end with "Other approach"
6538

6639
## Tech Stack
6740

.github/instructions/python-development.instructions.md

Lines changed: 11 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -28,83 +28,39 @@ applyTo: **/*.py
2828
- **MUST** use proper __init__.py files for package imports
2929

3030
### Code Style Standards
31-
- **Formatting:** Follow Black code style with line length 88
32-
- **Imports:** isort with profile=black
33-
- **Type Hints:** Required for all public APIs
31+
- **Formatting:** we use ruff for formatting
32+
- **Type Hints:** Required for all APIs
3433
- **Docstrings:** Google style for modules, classes, and functions
34+
- **linting:** use ruff for static analysis and mypy for type checking
3535

36-
### Environment Setup
37-
```bash
38-
hatch run install-packages # Install all packages in development mode
39-
```
40-
41-
### Testing Commands
42-
```bash
43-
hatch run test.rf70:test # Test with Robot Framework 7.0
44-
hatch run test.rf70.py311:test # Specific Python + RF combination
45-
hatch run cov # Run with coverage reporting
46-
pytest --regtest2-reset # Update test snapshots
47-
```
4836

4937
### Code Quality
5038
```bash
5139
hatch run lint:all # All linting checks (black, isort, flake8)
5240
hatch run lint:fix # Auto-fix style issues
5341
```
5442

55-
## CLI Error Handling Pattern
56-
57-
**REQUIRED** pattern for all CLI tools:
58-
```python
59-
try:
60-
result = execute_command()
61-
except Exception as e:
62-
app.error(f"Failed to execute: {e}")
63-
```
64-
65-
## Package-Specific Guidelines
66-
67-
### Core Package (`packages/core/`)
68-
- **Base utilities and shared functionality**
69-
- **MUST** be importable by all other packages
70-
- **NO** dependencies on other RobotCode packages
71-
72-
### Language Server (`packages/language_server/`)
73-
- **LSP implementation for IDE integration**
74-
- **ALWAYS** use asyncio patterns
75-
- **REQUIRED** proper error isolation per workspace
76-
77-
### Debugger (`packages/debugger/`)
78-
- **Debug Adapter Protocol implementation**
79-
- **MUST** handle multi-workspace scenarios
80-
- **REQUIRED** proper session management
81-
82-
### Runner (`packages/runner/`)
83-
- **Enhanced Robot Framework execution tools**
84-
- **ALWAYS** use Robot Framework native parser
85-
- **REQUIRED** configuration via robot.toml
86-
8743
### Testing Requirements
8844

45+
### Python Interpreter
46+
- **ask your tools** wich python interpreter to use for the project/workspace
47+
8948
### Matrix Testing
9049
- **COMPREHENSIVE** testing across Python 3.8-3.13
9150
- **MATRIX** testing with Robot Framework 5.0-7.3
9251
- **INTEGRATION** tests in tests/robotcode/ with real scenarios
9352
- **SNAPSHOT** testing with pytest regtest2
9453

9554
### Test Execution
55+
56+
**IMPORTANT**use the correct Python environment selected in your IDE
57+
58+
- **USE** `pytest .` to run unit tests,
9659
- **USE** `pytest --regtest2-reset` to update snapshots
9760
- **RUN** specific environments: `hatch run test.rf70.py311:test`
9861
- **COVERAGE** reporting with `hatch run cov`
9962

100-
## Configuration System
101-
102-
### robot.toml Configuration
103-
- **IMPLEMENT** robot.toml parsing throughout CLI and language server
104-
- **SUPPORT** profile management and inheritance
105-
- **VALIDATE** configuration options
106-
107-
### Multi-Platform Consistency
63+
## Multi-Platform Consistency
10864
- **ENSURE** consistent behavior across VS Code and IntelliJ
10965
- **MAINTAIN** unified configuration approach
11066
- **DOCUMENT** platform-specific differences

hatch.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ features = ["all"]
142142
typing = "mypy --no-incremental --cache-dir /dev/null {args:.}"
143143
style = ["ruff check .", "ruff format --diff ."]
144144
all = ["style", "typing"]
145+
fix = ["ruff check --fix .", "ruff format ."]
145146

146147
[envs.lint.overrides]
147148
platform.windows.scripts = [

0 commit comments

Comments
 (0)