编码命令行
- 作者仓库星标 0
- 作者仓库 skills-registry
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @tomevault-io · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 需要 · Vendor-specific
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
# Sync changes from MinIO
hiclaw-sync
# Review what changed
cd /root/hiclaw-fs/shared/tasks/{task-id}/workspace
git diff # if it's a git repo
# or: check coding-cli-logs/ for CLI output
# Coding CLI Delegation
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:
1. Understand the task deeply
2. Prepare the workspace
3. Generate a precise coding prompt
4. Delegate execution to the Manager's CLI tool
5. Review the result
---
## When to Use This Skill
Check `spec.md` for the task. If it contains `## Coding CLI Mode`, use this skill for all code changes.
---
## Step-by-Step Workflow
### 1. Prepare the Workspace
Set up the workspace directory under the shared filesystem:
```bash
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.
### 2. Push Workspace to MinIO
Before sending the coding-request, push all workspace files so the Manager can access them:
```bash
mc mirror "/root/hiclaw-fs/shared/tasks/{task-id}/workspace/" \
${HICLAW_STORAGE_PREFIX}/shared/tasks/{task-id}/workspace/
```
### 2b. Check for Processing Marker
Before modifying the workspace or sending a coding-request, check if the task directory is being processed:
```bash
# 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.
### 3. Generate a High-Quality Prompt
A good prompt includes:
- **Target files**: exact paths and relevant line numbers
- **Specific changes**: describe *what* to change, not just *why*
- **Context**: existing code structure, dependencies, interfaces
- **Acceptance criteria**: how to verify the change is correct
- **Constraints**: languages, frameworks, style conventions, things NOT to change
**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):
- "Fix the auth system" (too vague)
- "Improve performance" (no specific target)
- "Add tests" (no specification of what to test or where)
### 4. Send `coding-request:` to Manager
Send in your Worker Room (or Project Room, wherever the task was assigned):
```
@manager:DOMAIN task-{task-id} coding-request:
workspace: /root/hiclaw-fs/shared/tasks/{task-id}/workspace
---PROMPT---
{your detailed coding prompt here}
---END---
```
Note: `workspace` can be any subdirectory under `/root/hiclaw-fs/`, e.g. a cloned git repo:
```
workspace: /root/hiclaw-fs/shared/tasks/{task-id}/workspace/my-repo
```
### 5. Wait for Manager's Response
The Manager will run the CLI tool and respond with either:
**Success** — `coding-result:`
```
@{your-name}:DOMAIN task-{task-id} coding-result:
CLI 工具已完成编码。请同步工作目录并 review 变更...
```
**Failure** — `coding-failed:`
```
@{your-name}:DOMAIN task-{task-id} coding-failed:
CLI 工具执行失败...你生成的提示词已保存于:/root/hiclaw-fs/shared/tasks/{task-id}/coding-prompts/
```
### 6a. On `coding-result:`
```bash
# Sync changes from MinIO
hiclaw-sync
# Review what changed
cd /root/hiclaw-fs/shared/tasks/{task-id}/workspace
git diff # if it's a git repo
# or: check coding-cli-logs/ for CLI output
```
Review the changes:
- Verify they match the task requirements
- Check for obvious errors or unintended modifications
- Run tests if applicable
Report to Manager:
```
@manager:DOMAIN task-{task-id} completed:
Changes reviewed and verified. {Brief summary of what was implemented.}
```
### 6b. On `coding-failed:`
Implement the coding task yourself using your normal approach. When done, report:
```
@manager:DOMAIN task-{task-id} completed:
Implemented manually (CLI delegation failed). {Brief summary.}
```
---
## Multiple Rounds
If one CLI delegation doesn't fully complete the task (e.g., the first run fixed the bug but tests still fail), you can send another `coding-request:` with a follow-up prompt. Sync the workspace first to get the latest state before generating the next prompt.
---
## Tips for Better Prompts
- **Be surgical**: "change line 47 from X to Y" beats "fix the login function"
- **Provide imports**: if the change requires new imports, specify them
- **Show the pattern**: reference existing code in the same file as the style guide
- **Limit scope**: tell the CLI "only modify file X, do not change tests or other files"
- **Verify command**: include how to check correctness, e.g. "run `go test ./...` to verify"
---
> Source: [agentscope-ai/HiClaw](https://github.com/agentscope-ai/HiClaw) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-23 -->
章节与文件索引
按说明文件中的顺序排列。
何时使用此技能
1. 准备工作区
2.将工作区推送到MinIO
2b.检查处理标记
3. 生成高质量的提示
文件/命令 -> spec.md · ## Coding CLI Mode · /root/hiclaw-fs/ · .processing · src/server/handlers/auth.go · RefreshToken · db.FindRefreshToken(ctx, token) · auth.GenerateAccessToken(userID)
内容校验值 -> 2c38e574c05e
当前原文的自动摘译,尚未人工审校。
何时使用此技能
检查任务的
spec.md。如果它包含## Coding CLI Mode,则对所有代码更改使用此技能。1. 准备工作区
在共享文件系统下设置工作空间目录: 约束:工作空间路径必须位于
/root/hiclaw-fs/下。 Manager通过MinIO镜像访问相同的路径。2.将工作区推送到MinIO
在发送编码请求之前,推送所有工作区文件,以便经理可以访问它们:
2b.检查处理标记
在修改工作区或发送编码请求之前,请检查任务目录是否正在处理:如果存在
.processing标记,请等待管理器完成操作后再发送您的请求。3. 生成高质量的提示
一个好的提示包括: 目标文件:确切的路径和相关行号 具体更改:描述要更改的内容,而不仅仅是原因 上下文:现有代码结构、依赖项、接口 验收标准:如何验证更改是否正确