diff --git a/agent/subagents/env_setup.py b/agent/subagents/env_setup.py index 71bc034..457005f 100644 --- a/agent/subagents/env_setup.py +++ b/agent/subagents/env_setup.py @@ -14,7 +14,7 @@ ## 工作目錄 ``` -/workspace/ +/(Current Directory)/ ├── repo/ # 原始碼(只讀) ├── refactor-repo/ # 你的工作區 └── memory/ # 只放 CHECKLIST.md @@ -22,7 +22,7 @@ ## 執行步驟 -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` 等 @@ -40,7 +40,7 @@ ## 注意 -- 只在 `/workspace/refactor-repo/` 工作 +- 只在 `./refactor-repo/` 工作 - 不創建多餘文件 - 失敗時回報具體錯誤 """ diff --git a/agent/tools/bash.py b/agent/tools/bash.py index 39a58a0..dcc1fe3 100644 --- a/agent/tools/bash.py +++ b/agent/tools/bash.py @@ -12,7 +12,7 @@ # 全域 bash 會話狀態(模擬持久會話) _session_state = { - "cwd": "/workspace/repo", + "cwd": ".", "env": {}, } @@ -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() @@ -97,7 +97,7 @@ def bash( # 處理重啟請求 if restart: _session_state = { - "cwd": "/workspace/repo", + "cwd": ".", "env": {}, } cwd = _session_state['cwd'] diff --git a/agent/workspace/memory/AGENTS.md b/agent/workspace/memory/AGENTS.md index 8b8c180..f31a06e 100644 --- a/agent/workspace/memory/AGENTS.md +++ b/agent/workspace/memory/AGENTS.md @@ -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 @@ -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: @@ -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 @@ -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 diff --git a/agent/workspace/skills/go-env/SKILL.md b/agent/workspace/skills/go-env/SKILL.md index d48799a..64ad161 100644 --- a/agent/workspace/skills/go-env/SKILL.md +++ b/agent/workspace/skills/go-env/SKILL.md @@ -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" @@ -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 @@ -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 ( diff --git a/agent/workspace/skills/python-env/SKILL.md b/agent/workspace/skills/python-env/SKILL.md index 8560b30..310d300 100644 --- a/agent/workspace/skills/python-env/SKILL.md +++ b/agent/workspace/skills/python-env/SKILL.md @@ -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