Back to skills
SKILL.md
Harness Run
ASecurityCodex以外のharness(Pi、Oh my Pi、OpenCode、DeepSeek Harness)で、Codexサブスクのgpt系modelやサブスク付属APIキーのDeepSeekを、相談・レビュー・実装の担当として呼ぶ。ユーザーがこれらのharness名、またはDeepSeekを指名した場合に使う。harnessを挙げずにgpt系modelだけを指名した場合とCodex CLIそのものへの委譲は codex Skill を使う。
- 8 stars
- 0 votes
- 0 copies
- 0 views
- Added November 18, 2026
Works with
Security analysis
100/100Pro scans all 20 files and shows the line behind each finding
npx -y skills add coil398/dotfiles --skill harness-run --agent claude-codeAre you the author of Harness Run?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/coil398-harness-run)---
name: harness-run
description: Codex以外のharness(Pi、Oh my Pi、OpenCode、DeepSeek Harness)で、Codexサブスクのgpt系modelやサブスク付属APIキーのDeepSeekを、相談・レビュー・実装の担当として呼ぶ。ユーザーがこれらのharness名、またはDeepSeekを指名した場合に使う。harnessを挙げずにgpt系modelだけを指名した場合とCodex CLIそのものへの委譲は codex Skill を使う。
---
# harness-run:他harnessへの委譲
`scripts/harness-run.py` は、Pi・Oh my Pi(`omp`)・OpenCode・DeepSeek Harness(`dsh`)のいずれかを非対話・ブロッキングで1回実行し、1行JSONで結果を返す。これはopt-inの経路であり、既定の実装担当は変えない。既定は [implementation-delegation](../pir2/references/implementation-delegation.md#既定の実装担当) に従う。
## 使い分け
| 目的 | 経路 |
|---|---|
| Codex CLIへの相談・実装 | `codex` Skill |
| Codexサブスク(ChatGPT OAuth)のgpt系modelをCodex以外のharnessで使う | `--harness pi`、`omp` または `dsh`、model `openai-codex/<id>` |
| OAuth経由のOpenCode上のgpt model | `--harness opencode`、model `openai/<id>`(認証が有効な場合) |
| DeepSeek V4.1 Flashをサブスク付属APIキーで使う | `--harness dsh`、model `opencode-go/deepseek-v4.1-flash` など |
| OpenCode GoサブスクのmodelをPiで使う | `--harness pi`、model `opencode-go/deepseek-v4.1-flash`、`opencode-go/glm-5.3` など |
- OpenCode Goの枠でgpt系modelを使う用途には使わない。
- `OPENAI_API_KEY`(従量課金)へは流さない。runnerは子processのenvから `OPENAI_API_KEY` を外し、`pi`/`omp`/`dsh` では provider `openai` を拒否する。
- `~/.codex/auth.json` のtokenを他harnessへ流用しない。各harnessのloginを使う。
- dshの `openai-codex` は credentials pluginを通じて既定の `~/.dsh` に保存されたサインインを使う。`OPENAI_API_KEY` は子processへ渡さない。
## 入力
```text
python3 <package>/scripts/harness-run.py --harness {pi,omp,opencode,dsh} --model <provider/model>
--effort {low,medium,high,xhigh,max} (--prompt-file PATH | --prompt TEXT)
--cwd ABS --work-dir ABS --run-id ID [--read-only] [--minimal-context [--keep-context-files]]
[--dsh-patch PATH] [--timeout SEC] [--dry-run]
```
- `--prompt-file` を既定にする。runnerは先頭に「別のAI CLIを起動しない」などの実行条件を付けて保存する。
- `--minimal-context` は AGENTS.md / CLAUDE.md / skills / MCP / extensions を読ませない。ompは付けないと補助LLMリクエスト(skill説明生成など)が1回の実行で100件超出てサブスク枠を消費するため、通常は付ける。
- `--minimal-context` で委譲する親は、依頼文にそのtaskに関係する委譲先projectのAGENTS.md規則(対象repositoryの規約、禁止操作、commit規則)の抜粋を入れる。file全体は貼らず、global・ユーザー向けの規則は入れない。`--keep-context-files`(pi・ompのみ、`--minimal-context` と併用)を付けると、harnessがAGENTS.md/CLAUDE.mdだけを自動で読み込む。
- `--read-only` のOpenCodeはproject configを読まない(permission再定義でread-onlyが破れるため)。
- `--work-dir` は [pir2/references/sanitized-cwd.md](../pir2/references/sanitized-cwd.md) に従う絶対pathにする。親の `RUN_DIR` があればそれをそのまま使い、単発呼び出し時は `../pir2/scripts/reserve-run-dir.sh` で確保する。
- `--run-id` は `[A-Za-z0-9._-]+`。同じIDの成果物があれば拒否する。
- `--dry-run` は組み立てたargv、env差分(キー名のみ)、書き出すfileをJSONで出し、何も実行・作成しない。
- 親はBashのbackground実行で起動し、完了通知後に1行JSONを読む。
## 認証
| harness | ログイン | 確認 |
|---|---|---|
| pi | `openai-codex`: `pi auth login openai-codex --no-browser`。`opencode-go`: 環境変数 `OPENCODE_GO_API_KEY`(または `OPENCODE_API_KEY`)を渡す | runnerが `pi auth check` を起動前に実行 |
| omp | `omp login openai-codex`(Piとは別store) | runnerが `omp token <provider>` のexit codeを確認(出力は捨てる) |
| opencode | `opencode providers login` | 起動前の確認なし(provider `openai` はauth.jsonがOAuthでなければ起動前に拒否)。失効(`Token refresh failed`、401、`authentication_error`、`api_key_expired`)は `auth_not_ready` にする |
| dsh | `openai-codex` は既定の `~/.dsh` に保存したサインインを使う。API key routeは該当環境変数(`OPENCODE_GO_API_KEY` など)を渡す | 起動前の確認なし。dsh実行時の `MISSING_CREDENTIAL`/`AUTH`/401応答を `auth_not_ready` にする |
`auth_not_ready` が返ったら、runnerは再試行もmodel変更もしない。pi(`openai-codex`)・omp・opencode の場合は、親が上の表のログインcommandを自分で起動し、ブラウザでの承認など本人にしかできない操作だけをユーザーへ渡す。ログイン完了後に新しい `RUN_ID` で同じ依頼を実行する。pi(`opencode-go`)とdshのAPI key routeでは不足している環境変数名を伝え、dshの `openai-codex` ではdshのサインインを確認する。
## read-onlyの限界
`--read-only` は各harnessのtool制限またはpermission presetで編集系を外す。OS sandboxではないため、cwd外の読取は防げない。bashを外すのでテストやgit操作はできない(dshはsandboxで拒否される)。詳細は [harnesses.md](references/harnesses.md)。
## 結果と受入
stdoutの1行JSON(`harness, model, effort, run_id, cwd, status, exit, final_text_path, events_path, stderr_path, usage, duration_s, error`)で判定する。
- `status`: `completed` / `failed` / `auth_not_ready` / `invocation_error` / `timeout`。`completed` 以外は成功扱いしない。
- 成果物は `<work-dir>/harness-<RUN_ID>-{prompt.md,events.jsonl,err.txt,last.md,summary.json,run.log}`。
- `usage` の `input_uncached` はcacheを含まない入力、`total_input = input_uncached + cache_read + cache_write`、`output` はreasoningを含む。`cost` は返さない。
- 実装を委譲した場合は、起動前後の `git status` と対象diffを親が照合する。担当の自己申告だけで受け入れない。
- runnerはSIGTERM/SIGINT/SIGHUPを受けると子harnessのprocess groupを止め、`failed`(`terminated by <signal>`)を返す。runnerを外から止めるときはSIGKILLでなくSIGTERMを使う。
- `timeout`・`failed` の後は、cwdの差分を確認してから新しい `RUN_ID` で進める。
Files in this skill
- SKILL.md
- assets/dsh/commandcode.yml
- assets/dsh/ollama-cloud.yml
- assets/dsh/opencode-go.yml
- bench/README.md
- bench/bench.py
- bench/briefs/conv_billing.md
- bench/briefs/conv_jobs.md
- bench/briefs/conv_shopkit.md
- bench/fixtures/bulk_ops/fixture.json
- bench/fixtures/bulk_ops/private/build.py
- bench/fixtures/bulk_ops/private/calibrate.py
- bench/fixtures/bulk_ops/private/calibration.md
- bench/fixtures/bulk_ops/private/reference/ops/__init__.py
- bench/fixtures/bulk_ops/private/reference/ops/m01.py
- bench/fixtures/bulk_ops/private/reference/ops/m02.py
- bench/fixtures/bulk_ops/private/reference/ops/m03.py
- bench/fixtures/bulk_ops/private/reference/ops/m04.py
- bench/fixtures/bulk_ops/private/reference/ops/m05.py
- bench/fixtures/bulk_ops/private/reference/ops/m06.py
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.