generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 480
Expand file tree
/
Copy pathAGENTS.md.example
More file actions
95 lines (65 loc) · 2.66 KB
/
AGENTS.md.example
File metadata and controls
95 lines (65 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# AGENTS.md - AutoDev Project Guidelines
This file provides guidance for AI coding agents working on the AutoDev project.
## Project Overview
AutoDev is an open-source AI-powered coding assistant plugin for JetBrains IDEs. It provides intelligent code generation, refactoring, and analysis capabilities.
## Technology Stack
- **Language**: Kotlin
- **Platform**: JetBrains Platform SDK
- **Build Tool**: Gradle
- **Testing**: JUnit 4/5
## Coding Standards
### Kotlin Style Guide
- Follow the official Kotlin coding conventions
- Use meaningful variable and function names
- Prefer immutability: use `val` over `var` when possible
- Use data classes for simple data holders
- Leverage Kotlin's null safety features
### Architecture Patterns
- **Services**: Use `@Service` annotation for project-level and application-level services
- **Extensions**: Implement extension points for pluggable functionality
- **UI Components**: Separate UI logic from business logic
- **Async Operations**: Use Kotlin coroutines for asynchronous tasks
### File Organization
- Place core functionality in `core/src/main/kotlin/cc/unitmesh/devti/`
- Place language-specific extensions in `java/`, `kotlin/`, etc.
- Place tests in corresponding `src/test/` directories
- Keep files under 300 lines when possible
## Common Patterns
### Reading Files
```kotlin
import cc.unitmesh.devti.bridge.knowledge.lookupFile
import cc.unitmesh.devti.mcp.host.readText
val file = project.lookupFile("path/to/file")
val content = file?.readText()
```
### Creating Services
```kotlin
@Service(Service.Level.PROJECT)
class MyService(private val project: Project) {
// Service implementation
}
```
### Using Settings
```kotlin
import cc.unitmesh.devti.settings.coder.coderSetting
val teamPromptsDir = project.coderSetting.state.teamPromptsDir
```
## Testing Guidelines
- Write unit tests for all new functionality
- Use `BasePlatformTestCase` for tests requiring IntelliJ platform
- Mock external dependencies when appropriate
- Ensure tests are deterministic and isolated
## Important Notes
- Always use `runReadAction` for read operations on PSI/VFS
- Always use `runWriteAction` for write operations on PSI/VFS
- Use `runInEdt` for UI operations
- Handle exceptions gracefully and provide meaningful error messages
## Refactoring Preferences
- Prefer incremental refactoring over large rewrites
- Extract logic into testable components
- Keep backward compatibility when possible
- Update tests when refactoring
## Resources
- [IntelliJ Platform SDK Documentation](https://plugins.jetbrains.com/docs/intellij/)
- [Kotlin Documentation](https://kotlinlang.org/docs/)
- [Project Repository](https://github.com/unit-mesh/auto-dev)