Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions agent/subagents/env_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
## 工作目錄

```
/workspace/
/(Current Directory)/
├── repo/ # 原始碼(只讀)
├── refactor-repo/ # 你的工作區
└── memory/ # 只放 CHECKLIST.md
```

## 執行步驟

1. 建立目錄:`mkdir -p /workspace/refactor-repo && cd /workspace/refactor-repo`
1. 建立目錄:`mkdir -p ./refactor-repo && cd ./refactor-repo`
2. 檢查環境:執行版本命令確認語言環境
3. 安裝缺失:用 `apk add` 安裝系統套件
4. 初始化專案:如 `go mod init`、`npm init` 等
Expand All @@ -40,7 +40,7 @@

## 注意

- 只在 `/workspace/refactor-repo/` 工作
- 只在 `./refactor-repo/` 工作
- 不創建多餘文件
- 失敗時回報具體錯誤
"""
Expand Down
6 changes: 3 additions & 3 deletions agent/tools/bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# 全域 bash 會話狀態(模擬持久會話)
_session_state = {
"cwd": "/workspace/repo",
"cwd": ".",
"env": {},
}

Expand All @@ -23,7 +23,7 @@

範例:
- `bash(command="go test ./...")`
- `bash(command="cd /workspace/refactor-repo && go run main.go")`
- `bash(command="cd ./refactor-repo && go run main.go")`
- `bash(restart=True)` 重置會話
""".strip()

Expand Down Expand Up @@ -97,7 +97,7 @@ def bash(
# 處理重啟請求
if restart:
_session_state = {
"cwd": "/workspace/repo",
"cwd": ".",
"env": {},
}
cwd = _session_state['cwd']
Expand Down
10 changes: 5 additions & 5 deletions agent/workspace/memory/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Role definition, workflow, tool instructions, etc. are handled by system prompts
## Working Directory (Strict Compliance)

```
/workspace/
/(Current Directory)/
├── repo/ # Source code (Read-only)
├── refactor-repo/ # Refactored code (Your workspace)
├── memory/ # Memory system files
Expand All @@ -27,7 +27,7 @@ Role definition, workflow, tool instructions, etc. are handled by system prompts

### 1. CHECKLIST.md (Rapid Dashboard)

Location: `/workspace/memory/CHECKLIST.md`
Location: `./memory/CHECKLIST.md`


Format:
Expand Down Expand Up @@ -66,7 +66,7 @@ Next Steps: xxx
### bash
```
bash(command="go test ./...")
bash(command="cd /workspace/refactor-repo && go run main.go")
bash(command="cd ./refactor-repo && go run main.go")
```

### env-setup subagent
Expand All @@ -76,9 +76,9 @@ task(name="env-setup", task="Set up Go environment")

## Workflow

1. Read `/workspace/repo/` to understand the project
1. Read `./repo/` to understand the project
2. Set up environment (use env-setup)
3. Write code to `/workspace/refactor-repo/`
3. Write code to `./refactor-repo/`
4. Run tests, fix bugs
5. Update CHECKLIST.md
6. Repeat until completed
6 changes: 3 additions & 3 deletions agent/workspace/skills/go-env/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ bash(command="go run ./cmd/server")
First write to a file using `write_file`, then run it:

```
write_file("/workspace/repo/hello.go", """
write_file("./repo/hello.go", """
package main

import "fmt"
Expand All @@ -104,7 +104,7 @@ func main() {
fmt.Println("Hello, Go!")
}
""")
bash(command="go run /workspace/repo/hello.go")
bash(command="go run ./repo/hello.go")
```

## Compilation
Expand Down Expand Up @@ -181,7 +181,7 @@ bash(command="go get -u github.com/gin-gonic/gin")
Create a simple Gin web server:

```
write_file("/workspace/repo/main.go", """
write_file("./repo/main.go", """
package main

import (
Expand Down
4 changes: 2 additions & 2 deletions agent/workspace/skills/python-env/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ bash(command="python3 main.py")
First write to a file using `write_file`, then run it:

```
write_file("/workspace/repo/check_env.py", """
write_file("./repo/check_env.py", """
import sys
print(f"Python version: {sys.version}")
print(f"Python path: {sys.executable}")
""")
bash(command="python3 /workspace/repo/check_env.py")
bash(command="python3 ./repo/check_env.py")
```

### Run Tests
Expand Down
Loading