将编码工作委托给 Manager 持有的 AI CLI 工具(Claude Code / Gemini CLI / qodercli)执行
When the Manager assigns you a task with a "## Coding CLI Mode" section in spec.md, you do not write the code yourself. Instead, you:
Check spec.md for the task. If it contains ## Coding CLI Mode, use this skill for all code changes.
Set up the workspace directory under the shared filesystem:
workspace="/root/hiclaw-fs/shared/tasks/{task-id}/workspace"
mkdir -p "$workspace"
# Clone a repo (example)
git clone <repo-url> "$workspace"
# Or copy existing code
cp -r /path/to/source "$workspace/"
Constraint: The workspace path must be under /root/hiclaw-fs/. The Manager accesses the same path via MinIO mirror.
Before sending the coding-request, push all workspace files so the Manager can access them:
mc mirror "/root/hiclaw-fs/shared/tasks/{task-id}/workspace/" \
${HICLAW_STORAGE_PREFIX}/shared/tasks/{task-id}/workspace/
Before modifying the workspace or sending a coding-request, check if the task directory is being processed:
# Sync latest state from MinIO
mc mirror "${HICLAW_STORAGE_PREFIX}/shared/tasks/{task-id}/" \
"/root/hiclaw-fs/shared/tasks/{task-id}/"
# Check for processing marker
if [ -f "/root/hiclaw-fs/shared/tasks/{task-id}/.processing" ]; then
echo "Task directory is being processed. Wait for manager to complete."
# Do NOT send coding-request yet; wait and retry
fi
If a .processing marker exists, wait for the Manager to complete their operation before sending your request.
A good prompt includes:
Example of a good prompt:
In the file `src/server/handlers/auth.go`, implement the `RefreshToken` function (currently a stub at line 142).
Requirements:
- Validate the incoming refresh_token from the request body (field name: "refresh_token")
- Look up the token in the database using `db.FindRefreshToken(ctx, token)` (already imported)
- If valid, generate a new access token with `auth.GenerateAccessToken(userID)` and return it as JSON: {"access_token": "<token>", "expires_in": 3600}
- If invalid or expired, return HTTP 401 with body: {"error": "invalid_refresh_token"}
- Follow the existing error handling pattern used in `LoginHandler` (line 89)
Do not change any other files.
Signs of a weak prompt (avoid):
coding-request: to ManagerSend in your Worker Room (or Project Room, wherever the task was assigned):
@manager:DOMAIN task-{task-id} coding-request: