Code With Nathan

Kilo CLI Coding Agent

開發程式設計v0.0.9
作者:Code With Nathan更新於 2026-05-18共 11 個版本 · 最新版本釋出於 2026-02-16kilocli-coding-agent@clawhub_nathansebhastian/kilocli-coding-agent
程式碼生成指令碼工具#Coding

據 AlphaMoat 統計,截至 2026-09,Kilo CLI Coding Agent 累計下載 3,562 次、獲 3 個星標,在全部 5,078 個 AI 技能中排名第 3,072 位,在「開發程式設計」分類(577 個)中排名第 394 位。

累計安裝
126
累計下載
3562
星標
3
全站排名
#3,072
全站前 61% · 「開發程式設計」前 69%
平台累計安裝累計下載星標評論
ClawHub ↗11335623-
SkillHub ↗12635603—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

它說明如何啟動和監控非互動任務、使用 tmux 處理互動會話,並在需要時配置 GitHub CLI。代理可能修改專案檔案或建立遠端 PR;應在隔離目錄執行、檢查改動,並在推送或建立 PR 前確認。 使用限定倉庫範圍的 token,分享前清除日誌和 PR 內容中的敏感資訊。

資料釋出於 2026-10-29

可以用來做什麼

  • 啟動並跟蹤後臺編碼任務
  • 管理互動式代理會話
  • 準備程式碼審查或 PR 工作流

什麼時候用

  • 需要透過 CLI 委派編碼任務時
  • 執行前限定工作目錄與許可權;對外推送或建立 PR 前檢查並確認變更

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

說明如何在隔離目錄執行 Kilo CLI 編碼任務,並列出提交或建立 PR 前的檢查點。

月度資料趨勢

累計下載3562
2190292736642026-03 · 累計下載 22922026-05 · 累計下載 28762026-06 · 累計下載 30232026-07 · 累計下載 32952026-08 · 累計下載 34342026-09 · 累計下載 356226-0326-09
星標3
2332026-03 · 星標 22026-05 · 星標 32026-06 · 星標 32026-07 · 星標 32026-08 · 星標 32026-09 · 星標 326-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-093562—3
2026-083434+4.2%3
2026-073295+9.0%3
2026-063023+5.1%3
2026-052876—3
2026-032292—2

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

7.5 KB · ClawHub v0.0.9
---
name: kilocli-coding-agent
description: Run Kilo CLI via background process for programmatic control.
version: 0.0.9
metadata:
  openclaw:
    requires:
      env:
        - GITHUB_TOKEN
      bins:
展開全部(共 244 行)
        - kilo
        - git
        - gh
        - tmux
    primaryEnv: GITHUB_TOKEN
---
---

IMPORTANT: You need to have Kilo CLI installed and configured so OpenClaw can use it without any issue.

```sh
npm install -g @kilocode/cli
```

If you want to automate pull requests to Github, then you also need to authenticate Github CLI in your project: https://github.com/cli/cli#installation

# Coding Agent (background-first)

Use **bash background mode** for non-interactive coding work. For interactive coding sessions, use the **tmux** skill (always, except very simple one-shot prompts).

## The Pattern: workdir + background

```bash
# Create temp space for chats/scratch work
SCRATCH=$(mktemp -d)

# Start agent in target directory ("little box" - only sees relevant files)
bash workdir:$SCRATCH background:true command:"<agent command>"
# Or for project work:
bash workdir:~/project/folder background:true command:"<agent command>"
# Returns sessionId for tracking

# Monitor progress
process action:log sessionId:XXX

# Check if done  
process action:poll sessionId:XXX

# Send input (if agent asks a question)
process action:write sessionId:XXX data:"y"

# Kill if needed
process action:kill sessionId:XXX
```

**Why workdir matters:** Agent wakes up in a focused directory, doesn't wander off reading unrelated files (like your soul.md 😅).

---

## Kilo CLI

### Building/Creating (Use Autonomous mode)

```bash
bash workdir:~/project background:true command:"kilo run --auto \"Build a snake game with dark theme\""
```

### Reviewing PRs (vanilla, no flags)

**⚠️ CRITICAL: Never review PRs in OpenClaw's own project folder!**
- Either use the project where the PR is submitted (if it's NOT ~/Projects/openclaw)
- Or clone to a temp folder first

```bash
# Option 1: Review in the actual project (if NOT OpenClaw)
bash workdir:~/Projects/some-other-repo background:true command:"kilo run \"Review current branch against main branch\""

# Option 2: Clone to temp folder for safe review (REQUIRED for OpenClaw PRs!)
REVIEW_DIR=$(mktemp -d)
git clone https://github.com/openclaw/openclaw.git $REVIEW_DIR
cd $REVIEW_DIR && gh pr checkout 130
bash workdir:$REVIEW_DIR background:true command:"kilo run \"Review current branch against main branch\""
# Clean up after: rm -rf $REVIEW_DIR

# Option 3: Use git worktree (keeps main intact)
git worktree add /tmp/pr-130-review pr-130-branch
bash workdir:/tmp/pr-130-review background:true command:"kilo run \"Review current branch against main branch\""
```

**Why?** Checking out branches in the running OpenClaw repo can break the live instance!

### Batch PR Reviews (parallel army!)
```bash
# Fetch all PR refs first
git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*'

# Deploy the army - one Kilo CLI per PR!
bash workdir:~/project background:true command:"kilo run \"Review PR #86. git diff origin/main...origin/pr/86\""
bash workdir:~/project background:true command:"kilo run \"Review PR #87. git diff origin/main...origin/pr/87\""
bash workdir:~/project background:true command:"kilo run \"Review PR #95. git diff origin/main...origin/pr/95\""
# ... repeat for all PRs

# Monitor all
process action:list

# Get results and post to GitHub
process action:log sessionId:XXX
gh pr comment <PR#> --body "<review content>"
```

### Tips for PR Reviews
- **Fetch refs first:** `git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*'`
- **Use git diff:** Tell Kilo CLI to use `git diff origin/main...origin/pr/XX`
- **Don't checkout:** Multiple parallel reviews = don't let them change branches
- **Post results:** Use `gh pr comment` to post reviews to GitHub

---

## tmux (interactive sessions)

Use the tmux skill for interactive coding sessions (always, except very simple one-shot prompts). Prefer bash background mode for non-interactive runs.

---

## Parallel Issue Fixing with git worktrees + tmux

For fixing multiple issues in parallel, use git worktrees (isolated branches) + tmux sessions:

```bash
# 1. Clone repo to temp location
cd /tmp && git clone [email protected]:user/repo.git repo-worktrees
cd repo-worktrees

# 2. Create worktrees for each issue (isolated branches!)
git worktree add -b fix/issue-78 /tmp/issue-78 main
git worktree add -b fix/issue-99 /tmp/issue-99 main

# 3. Set up tmux sessions
SOCKET="${TMPDIR:-/tmp}/kilo-fixes.sock"
tmux -S "$SOCKET" new-session -d -s fix-78
tmux -S "$SOCKET" new-session -d -s fix-99

# 4. Launch Kilo CLI in each (after npm install!)
tmux -S "$SOCKET" send-keys -t fix-78 "cd /tmp/issue-78 && npm install && kilo run 'Fix issue #78: <description>. Commit and push.'" Enter
tmux -S "$SOCKET" send-keys -t fix-99 "cd /tmp/issue-99 && npm install && kilo run 'Fix issue #99: <description>. Commit and push.'" Enter

# 5. Monitor progress
tmux -S "$SOCKET" capture-pane -p -t fix-78 -S -30
tmux -S "$SOCKET" capture-pane -p -t fix-99 -S -30

# 6. Check if done (prompt returned)
tmux -S "$SOCKET" capture-pane -p -t fix-78 -S -3 | grep -q "❯" && echo "Done!"

# 7. Create PRs after fixes
cd /tmp/issue-78 && git push -u origin fix/issue-78
gh pr create --repo user/repo --head fix/issue-78 --title "fix: ..." --body "..."

# 8. Cleanup
tmux -S "$SOCKET" kill-server
git worktree remove /tmp/issue-78
git worktree remove /tmp/issue-99
```

**Why worktrees?** Each Kilo CLI works in isolated branch, no conflicts. Can run 5+ parallel fixes!

**Why tmux over bash background?** Kilo CLI is interactive — needs TTY for proper output. tmux provides persistent sessions with full history capture.

---

## ⚠️ Rules

1. **Respect tool choice** — if user asks for Kilo CLI, use Kilo CLI. NEVER offer to build it yourself!
2. **Be patient** — don't kill sessions because they're "slow"
3. **Monitor with process:log** — check progress without interfering
4. **--full-auto for building** — auto-approves changes
5. **vanilla for reviewing** — no special flags needed
6. **Parallel is OK** — run many Kilo CLI processes at once for batch work
7. **NEVER start Kilo CLI in ~/openclaw/** — it'll read your soul docs and get weird ideas about the org chart! Use the target project dir or /tmp for blank slate chats
8. **NEVER checkout branches in ~/Projects/openclaw/** — that's the LIVE OpenClaw instance! Clone to /tmp or use git worktree for PR reviews

---

## PR Template (The Razor Standard)

When submitting PRs to external repos, use this format for quality & maintainer-friendliness:

````markdown
## Original Prompt
[Exact request/problem statement]

## What this does
[High-level description]

**Features:**
- [Key feature 1]
- [Key feature 2]

**Example usage:**
```bash
# Example
command example
```

## Feature intent (maintainer-friendly)
[Why useful, how it fits, workflows it enables]

## Prompt history (timestamped)
- YYYY-MM-DD HH:MM UTC: [Step 1]
- YYYY-MM-DD HH:MM UTC: [Step 2]

## How I tested
**Manual verification:**
1. [Test step] - Output: `[result]`
2. [Test step] - Result: [result]

**Files tested:**
- [Detail]
- [Edge cases]

## Session logs (implementation)
- [What was researched]
- [What was discovered]
- [Time spent]

## Implementation details
**New files:**
- `path/file.ts` - [description]

**Modified files:**
- `path/file.ts` - [change]

**Technical notes:**
- [Detail 1]
- [Detail 2]

---
````

**Key principles:**
1. Human-written description (no AI slop)
2. Feature intent for maintainers
3. Timestamped prompt history
4. Session logs if using Kilo CLI agent

「開發程式設計」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。