Skip to content

Commit 1beb08c

Browse files
committed
docs(agents): update AGENTS.md documentation
Refine and clarify agent usage instructions in AGENTS.md.
1 parent 0ae3e4a commit 1beb08c

File tree

1 file changed

+34
-66
lines changed

1 file changed

+34
-66
lines changed

AGENTS.md

Lines changed: 34 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,56 @@
11
## Core Rules
22

3-
- Current project is a Kotlin multiplatform project, always consider the multiplatform aspect, JS, WASM, Desktop JVM, Android, iOS
4-
- Current project is a Kotlin multiplatform project, always consider the multiplatform aspect, JS, WASM, Desktop JVM, Android, iOS
5-
- Current project is a Kotlin multiplatform project, always consider the multiplatform aspect, JS, WASM, Desktop JVM, Android, iOS
3+
- **Kotlin Multiplatform**: Always consider all platforms: JS, WASM, Desktop JVM, Android, iOS
4+
- **Build & Test**: Always run build and tests before completing tasks
5+
- **Preserve Intent**: If existing solution doesn't work, preserve its intent
6+
- **Module Clean**: Use `./gradlew :module:clean` instead of global clean
7+
- **Test Scripts**: Put temporary scripts under `docs/test-scripts`
8+
- **Logs**: Check `~/.autodev/logs/autodev-app.log` for debugging
69

7-
Rest:
10+
## KMP Best Practices
811

9-
- Always run the build and tests before completing a task, making sure they pass.
10-
- If an existing request/solution does not work, preserve its intent.
11-
- Do not run `./gradlew clean`. Clean only the specific module, e.g., `./gradlew :mpp-core:clean`.
12-
- Put temporary test scripts under `docs/test-scripts`.
12+
- Use `expect`/`actual` for platform-specific code, for example `Platform`
13+
- **@JsExport**: Use concrete classes (not interfaces), `Promise` (not `Flow`)
14+
- **WASM**: Avoid emoji and UTF-8 in code
15+
- **i18n**: Run `./gradlew :mpp-ui:generateI18n4kFiles`
1316

14-
## Debug
17+
## Renderer System
1518

16-
- Log save in `~/.autodev/logs/autodev-app.log`
17-
18-
## Summary
19-
20-
- Omit a summary if the problem is simple. For bug fixes, summarize as: Problem → Root Cause → Solution. Keep summary
21-
short if need. Use Mermaid for long chat only.
22-
23-
## Kotlin Multiplatform \(KMP\) Best Practices for `mpp-core` and `mpp-ui`
24-
25-
- Use `expect`/`actual` for platform-specific code \(e.g., file I/O on JVM/JS/Wasm\).
26-
- Check export first, if some functions not working well with CLI (TypeScript)
27-
- 在 Kotlin/JS 的 @JsExport 中:
28-
- Avoid `Flow`, use `Promise`
29-
- ✅ 使用具体类作为返回类型和参数类型
30-
- ❌ 避免使用接口类型(JS 端无法正确处理接口的类型转换)
31-
- For WASM platform, we should not use emoji and utf8 in code.
32-
- Use ./gradlew :mpp-ui:generateI18n4kFiles for i18n
33-
34-
## CodingAgentRenderer Implementations
35-
36-
When modifying `CodingAgentRenderer` interface, **ALL** renderer implementations must be updated:
19+
When modifying `CodingAgentRenderer`, update ALL implementations:
3720
- **Kotlin**: `DefaultCodingAgentRenderer`, `ComposeRenderer`, `JewelRenderer`, `ServerSideRenderer`, `JsRendererAdapter`
3821
- **TypeScript**: `BaseRenderer.ts`, `CliRenderer.ts`, `ServerRenderer.ts`, `TuiRenderer.ts`
39-
- **VSCode**: `mpp-vscode/src/bridge/mpp-core.ts` (VSCodeRenderer), `mpp-vscode/src/providers/chat-view.ts`
40-
- **JVM CLI**: `CodingCliRenderer` (mpp-ui/src/jvmMain/.../CodingCli.kt), `ConsoleRenderer` (mpp-ui/src/jvmMain/.../DocumentCli.kt)
41-
42-
## Design System \(Color & Theme\)
22+
- **VSCode**: `mpp-vscode/src/bridge/mpp-core.ts`, `mpp-vscode/src/providers/chat-view.ts`
23+
- **JVM CLI**: `CodingCliRenderer`, `ConsoleRenderer`
4324

44-
- **CLI/TUI (TypeScript)**: Use `mpp-ui/src/jsMain/typescript/design-system/` → Import `semanticInk` / `semanticChalk`
45-
- **Compose (Desktop/Android)**: Use `AutoDevColors` from `cc.unitmesh.devins.ui.compose.theme` → Or `MaterialTheme.colorScheme`
46-
- **DO NOT hardcode colors** \(e.g., `Color(0xFF...)` or `#hex`\). Always use design tokens for consistency across platforms.
47-
- **Docs**: See `docs/design-system-color.md` (TypeScript) and `docs/design-system-compose.md` (Kotlin Compose)
25+
## Design System
4826

49-
## AutoDev CLI Quick Test
27+
- **CLI/TUI**: Use `semanticInk`/`semanticChalk` from `mpp-ui/src/jsMain/typescript/design-system/`
28+
- **Compose**: Use `AutoDevColors` or `MaterialTheme.colorScheme`
29+
- **NO hardcoded colors** - always use design tokens
30+
- **Docs**: `docs/design-system-color.md`, `docs/design-system-compose.md`
5031

51-
1. Build MPP Core: `cd /Volumes/source/ai/autocrud && ./gradlew :mpp-core:assembleJsPackage`
52-
2. Build and run MPP CLI: `cd mpp-ui && npm run build && npm run start`
32+
## Quick Commands
5333

54-
## IntelliJ IDEA Plugin (mpp-idea)
34+
**CLI Test:**
35+
```bash
36+
./gradlew :mpp-core:assembleJsPackage
37+
cd mpp-ui && npm run build && npm run start
38+
```
5539

56-
`mpp-idea` is a standalone Gradle project with `includeBuild` dependency on parent project.
40+
**IDEA Plugin:**
5741

58-
**Build Commands:**
5942
```bash
60-
# Compile (from project root)
6143
cd mpp-idea && ../gradlew compileKotlin
62-
63-
# Run tests (JewelRendererTest uses JUnit 5, no IntelliJ Platform required)
6444
cd mpp-idea && ../gradlew test --tests "cc.unitmesh.devins.idea.renderer.JewelRendererTest"
65-
66-
# Build plugin
6745
cd mpp-idea && ../gradlew buildPlugin
6846
```
6947

70-
**Notes:**
71-
- Do NOT use `./gradlew :mpp-idea:compileKotlin` from root - use `cd mpp-idea && ../gradlew` instead
72-
- `IdeaAgentViewModelTest` requires IntelliJ Platform Test Framework
73-
- `JewelRendererTest` can run standalone with JUnit 5
74-
75-
## VSCode Plugin (mpp-vscode)
76-
77-
`mpp-vscode` is a standalone npm package with `devDependencies` on parent project.
78-
79-
## Release
48+
**Release:**
8049

81-
1. modify version in `gradle.properties`
82-
2. publish cli version: `cd mpp-ui && npm publish:remote`
83-
84-
### Desktop Compose App
85-
86-
1. publish Desktop: `git tag compose-vVersion` (same in `gradle.properties`), `git push origin compose-vVersion`
87-
2. draft release in GitHub, run gh cli: `gh release create compose-vVersion --draft`
50+
```bash
51+
# 1. Update version in gradle.properties
52+
# 2. CLI: cd mpp-ui && npm publish:remote
53+
# 3. Desktop: git tag compose-vX.X.X && git push origin compose-vX.X.X
54+
# 4. gh release create compose-vX.X.X --draft
55+
```
8856

0 commit comments

Comments
 (0)