Skip to content

Commit b0ed0a3

Browse files
committed
chore: add some copilot instructions
1 parent 4ce87a2 commit b0ed0a3

File tree

4 files changed

+397
-0
lines changed

4 files changed

+397
-0
lines changed

.github/copilot-instructions.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# RobotCode Development Guidelines
2+
3+
> Last Updated: 2025-01-25
4+
> Version: 1.0
5+
> Override Priority: Highest
6+
7+
<ai_meta>
8+
<parsing_rules>
9+
- Process development patterns in sequential order
10+
- Use exact patterns and templates provided
11+
- Follow MUST/ALWAYS/REQUIRED directives strictly
12+
- Never deviate from established architectural patterns
13+
</parsing_rules>
14+
<file_conventions>
15+
- encoding: UTF-8
16+
- line_endings: LF
17+
- indent: 2 spaces (Python) / 4 spaces (TypeScript)
18+
- package_structure: packages/ for Python, vscode-client/ for TypeScript
19+
</file_conventions>
20+
</ai_meta>
21+
22+
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.
23+
24+
## Tech Stack
25+
26+
### Core Technologies
27+
- **Language Server:** Python 3.8-3.13 with asyncio
28+
- **Protocol:** Language Server Protocol (LSP) + Debug Adapter Protocol (DAP)
29+
- **Parser:** Robot Framework native parser for full compatibility
30+
- **Build System:** Hatch for package management and testing
31+
32+
### VS Code Extension
33+
- **Language:** TypeScript
34+
- **Pattern:** Manager-based lifecycle with proper disposal
35+
- **Dependencies:** @vscode/test-electron, webpack, esbuild
36+
37+
### IntelliJ Plugin
38+
- **Language:** Kotlin
39+
- **Integration:** LSP4IJ for Language Server communication
40+
- **Build:** Gradle with kotlin-gradle-plugin
41+
42+
### Testing Matrix
43+
- **Python Versions:** 3.8, 3.9, 3.10, 3.11, 3.12, 3.13
44+
- **Robot Framework:** 5.0, 6.0, 6.1, 7.0, 7.1, 7.2, 7.3
45+
- **Test Framework:** pytest with regtest2 for snapshot testing
46+
47+
## Architecture Patterns
48+
49+
### Package Structure
50+
```
51+
packages/
52+
├── core/ # Base utilities and shared functionality
53+
├── language_server/ # LSP implementation for IDE integration
54+
├── debugger/ # Debug Adapter Protocol implementation
55+
├── runner/ # Enhanced Robot Framework execution tools
56+
├── analyze/ # Static code analysis and validation
57+
├── jsonrpc2/ # JSON-RPC communication layer
58+
├── plugin/ # Plugin system foundation
59+
├── repl/ # Interactive Robot Framework shell
60+
├── repl_server/ # REPL server for remote connections
61+
├── robot/ # Robot Framework integration utilities
62+
└── modifiers/ # Code transformation tools
63+
64+
vscode-client/ # VS Code extension (TypeScript)
65+
├── extension/ # Main extension code with manager pattern
66+
└── rendererLog/ # Log rendering components
67+
68+
intellij-client/ # IntelliJ/PyCharm plugin (Kotlin)
69+
├── src/main/kotlin/ # Plugin implementation via LSP4IJ
70+
└── build.gradle.kts # Gradle build configuration
71+
```
72+
73+
### Multi-Platform Support
74+
- **Python CLI:** Cross-platform command-line tools
75+
- **VS Code:** TypeScript extension with manager pattern
76+
- **IntelliJ:** Kotlin plugin via LSP4IJ bridge
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
description: Kotlin IntelliJ Plugin Development Rules for RobotCode
3+
applyTo: intellij-client/**
4+
---
5+
6+
# Kotlin IntelliJ Plugin Development Rules
7+
8+
<ai_meta>
9+
<parsing_rules>
10+
- Process XML blocks first for structured data
11+
- Execute instructions in sequential order
12+
- Use exact patterns and templates provided
13+
- Follow MUST/ALWAYS/REQUIRED directives strictly
14+
</parsing_rules>
15+
<file_conventions>
16+
- encoding: UTF-8
17+
- line_endings: LF
18+
- indent: 4 spaces
19+
- plugin_structure: intellij-client/src/main/kotlin/
20+
</file_conventions>
21+
</ai_meta>
22+
23+
## Plugin Architecture
24+
25+
### LSP4IJ Integration
26+
- **Language:** Kotlin
27+
- **Integration:** LSP4IJ for Language Server communication
28+
- **Build:** Gradle with kotlin-gradle-plugin
29+
30+
### Plugin Structure
31+
```
32+
intellij-client/
33+
├── src/main/kotlin/ # Plugin implementation via LSP4IJ
34+
└── build.gradle.kts # Gradle build configuration
35+
```
36+
37+
## Development Commands
38+
39+
### Building & Packaging
40+
```bash
41+
cd intellij-client && gradle buildPlugin # IntelliJ plugin
42+
```
43+
44+
## LSP4IJ Best Practices
45+
46+
### Language Server Communication
47+
- **IMPLEMENT** proper LSP4IJ bridge patterns
48+
- **HANDLE** multiple workspace folders with error isolation
49+
- **MAINTAIN** robust communication with RobotCode language server
50+
51+
### Multi-Platform Consistency
52+
- **ENSURE** consistent behavior with VS Code extension
53+
- **MAINTAIN** unified configuration approach
54+
- **DOCUMENT** platform-specific differences where necessary
55+
56+
## Configuration System
57+
58+
### robot.toml Integration
59+
- **SUPPORT** robot.toml parsing and profile management
60+
- **VALIDATE** configuration options consistently with other platforms
61+
- **MAINTAIN** cross-platform configuration compatibility
62+
63+
## Error Handling Standards
64+
65+
### Plugin Lifecycle
66+
- **IMPLEMENT** proper plugin lifecycle management
67+
- **HANDLE** startup and shutdown gracefully
68+
- **MANAGE** resources properly to prevent memory leaks
69+
70+
### LSP Communication
71+
- **ISOLATE** error handling per workspace
72+
- **MAINTAIN** robust communication with language server
73+
- **HANDLE** connection failures gracefully
74+
75+
---
76+
77+
*These Kotlin development rules ensure consistent, high-quality IntelliJ plugin development.*
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
description: Python Development Rules for RobotCode
3+
applyTo: **/*.py
4+
---
5+
6+
# Python Development Rules
7+
8+
<ai_meta>
9+
<parsing_rules>
10+
- Process XML blocks first for structured data
11+
- Execute instructions in sequential order
12+
- Use exact patterns and templates provided
13+
- Follow MUST/ALWAYS/REQUIRED directives strictly
14+
</parsing_rules>
15+
<file_conventions>
16+
- encoding: UTF-8
17+
- line_endings: LF
18+
- indent: 2 spaces
19+
- package_structure: packages/ directory
20+
</file_conventions>
21+
</ai_meta>
22+
23+
## Package Development
24+
25+
### Package Structure
26+
- **ALWAYS** develop in packages/ directory
27+
- **REQUIRED** follow package-based architecture
28+
- **MUST** use proper __init__.py files for package imports
29+
30+
### 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
34+
- **Docstrings:** Google style for modules, classes, and functions
35+
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+
```
48+
49+
### Code Quality
50+
```bash
51+
hatch run lint:all # All linting checks (black, isort, flake8)
52+
hatch run lint:fix # Auto-fix style issues
53+
```
54+
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+
87+
### Testing Requirements
88+
89+
### Matrix Testing
90+
- **COMPREHENSIVE** testing across Python 3.8-3.13
91+
- **MATRIX** testing with Robot Framework 5.0-7.3
92+
- **INTEGRATION** tests in tests/robotcode/ with real scenarios
93+
- **SNAPSHOT** testing with pytest regtest2
94+
95+
### Test Execution
96+
- **USE** `pytest --regtest2-reset` to update snapshots
97+
- **RUN** specific environments: `hatch run test.rf70.py311:test`
98+
- **COVERAGE** reporting with `hatch run cov`
99+
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
108+
- **ENSURE** consistent behavior across VS Code and IntelliJ
109+
- **MAINTAIN** unified configuration approach
110+
- **DOCUMENT** platform-specific differences
111+
112+
---
113+
114+
*These Python development rules ensure consistent, high-quality code across all RobotCode packages.*

0 commit comments

Comments
 (0)