harness-setup
Harness Setup is an integrated initialization skill for new Claude Code projects that generates essential configuration files (CLAUDE.md, Plans.md, hooks, settings), configures CI/CD pipelines, installs Codex CLI tools, sets up agent configurations, and synchronizes skill mirrors. Use this when starting a new project, establishing harness infrastructure, integrating memory systems, or updating agent and CI/CD configurations, but avoid loading it during implementation, code review, release, or planning phases.
git clone --depth 1 https://github.com/Chachamaru127/claude-code-harness /tmp/harness-setup && cp -r /tmp/harness-setup/opencode/skills/harness-setup ~/.claude/skills/harness-setupSKILL.md
# Harness Setup
Harness の統合セットアップスキル。
以下の旧スキルを統合:
- `setup` — 統合セットアップハブ
- `harness-init` — プロジェクト初期化
- `harness-update` — Harness アップデート
- `maintenance` — ファイル整理・クリーンアップ
## Quick Reference
| サブコマンド | 動作 |
|------------|------|
| `/harness-setup init` | 新規プロジェクト初期化(CLAUDE.md + Plans.md + hooks + sync + doctor)|
| `/harness-setup ci` | CI/CD パイプライン設定 |
| `/harness-setup codex` | Codex CLI インストール・設定 |
| `/harness-setup harness-mem` | harness-mem 統合・メモリ設定 |
| `/harness-setup mirrors` | skills/ → 公開 mirror bundle 更新 |
| `/harness-setup agents` | agents/ エージェント設定 |
| `/harness-setup localize` | CLAUDE.md ルールのローカライズ |
> **Built-in slash discovery (CC 2.1.108+)**:
> `/init` のような built-in slash command も発見される。
> Harness 固有の bootstrap が必要な時だけ `/harness-setup init` と使い分ける。
> **Claude Code setup guidance (CC 2.1.120+)**:
> MCP `alwaysLoad`、`${CLAUDE_EFFORT}`、`claude plugin prune`、`claude project purge`、
> `ANTHROPIC_BEDROCK_SERVICE_TIER`、`claude_code.skill_activated.invocation_trigger`、
> Windows PowerShell primary shell、forked skills / subagents の deferred tools は
> `docs/claude-code-setup-mcp-telemetry-provider.md` を正本として扱う。
> **Codex plugin workflows**:
> Codex `/goal` と `Plans.md` を二重管理しない。
> plugin-bundled hooks は opt-in、external agent import は ownership 明記、
> MultiAgentV2 / `agents.max_threads = 8` は上限として扱い、
> sticky environments / app-server artifacts は safe default を優先する。
> Codex `0.130.0` stable の `codex remote-control`、large thread pagination、
> selected-environment `view_image`、live app-server config refresh、
> accurate turn diffs、plugin details bundled hooks、sharing discoverability controls は
> `docs/codex-plugin-workflows-policy.md` を正本として扱う。
> 詳細は `docs/codex-plugin-workflows-policy.md` を参照。
## サブコマンド詳細
### init — プロジェクト初期化
新規プロジェクトに Harness を導入する。
**生成ファイル**:
```
project/
├── CLAUDE.md # プロジェクト設定
├── Plans.md # タスク管理(空テンプレート)
├── .claude/
│ ├── settings.json # Claude Code 設定
│ └── hooks.json # フック設定(Go バイナリ)
└── hooks/
├── pre-tool.sh # 薄いシム(→ core/src/index.ts)
└── post-tool.sh # 薄いシム(→ core/src/index.ts)
```
**フロー**:
1. プロジェクト種別を検出(Node.js/Python/Go/Rust/その他)
2. 最小限の CLAUDE.md を生成
3. Plans.md テンプレートを生成
4. hooks.json を配置
5. **Go バイナリ検証**: `harness version` でバイナリが利用可能か確認(v4.0 以降 Node.js 不要)
6. **プラグインファイル同期**: `harness sync` で `.claude-plugin/` 配下のファイルを最新に同期
7. **ヘルスチェック**: `harness doctor` で全チェック項目をパス。問題があれば修正案を提示
### Go バイナリ検証
```bash
# バイナリの存在と動作を確認
harness version
# 例: harness v4.0.0 (go1.22.0, darwin/arm64)
```
v4.0 以降、Harness のコアエンジンは Go バイナリに移行した。
Node.js は不要。バイナリは `bin/harness`(または PATH 上の `harness`)を使用する。
### プラグインファイル同期
```bash
# .claude-plugin/ 配下のファイルを最新に同期
harness sync
# 同期内容の確認のみ(変更なし)
harness sync --dry-run
```
`harness sync` は skills/ の SSOT から各 mirror(codex/.codex/skills/、opencode/skills/)へ
変更を伝播させる。init 後に必ず実行すること。
### ヘルスチェック
```bash
# 全チェック項目を実行
harness doctor
```
`harness doctor` は以下を確認する:
| チェック項目 | 内容 |
|------------|------|
| バイナリ | `harness version` が正常に返るか |
| プラグイン設定 | `.claude-plugin/plugin.json` の形式が正しいか |
| hooks 配置 | hooks が正しいパスに存在するか |
| mirror 同期 | skills/ と mirror の内容が一致しているか |
| CLAUDE.md | 必須セクションが存在するか |
問題が検出された場合は修正コマンドを提示する。
### ci — CI/CD 設定
GitHub Actions ワークフローを設定する。
```yaml
# .github/workflows/ci.yml 生成例
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm test
```
### codex — Codex CLI 設定
```bash
# インストール確認(Codex CLI は Node.js ベース。Harness 本体とは別物)
which codex || npm install -g @openai/codex
# タイムアウトコマンド確認(macOS)
TIMEOUT=$(command -v timeout || command -v gtimeout || echo "")
# macOS の場合: brew install coreutils
```
> **注意**: Harness v4.0 本体(`harness` コマンド)は Node.js 不要の Go バイナリ。
> Codex CLI(`codex` コマンド)は別ツールであり、引き続き Node.js が必要。
### Codex provider / model metadata policy (0.123.0+ / 0.130.0)
Codex `0.123.0` 以降の provider / model guidance と、Codex `0.130.0` stable の Bedrock `aws login` guidance は
`docs/codex-provider-setup-policy.md` を正本として扱う。
要点:
- Bedrock を使う場合は、Codex built-in provider の `amazon-bedrock` を使う。
- AWS profile は user / project の Codex config で `[model_providers.amazon-bedrock.aws]` に置く。
- AWS console-login credentials from `aws login` profiles は AWS 側の profile material として扱う。
- Harness は AWS credential、console-login cache、provider endpoint を書き込まない。
- Harness の配布用 Codex config には `model = "gpt-5.4"` を setup default として固定しない。
- Harness の配布用 Codex config には `model_provider = "amazon-bedrock"` も setup default として固定しない。
- `gpt-5.4` は Codex 本体の current model metadata として扱い、古い `gpt-5.2-codex` などを推奨 sample として残さない。
- Claude Code 側の `CLAUDE_CODE_USE_BEDROCK` / `ANTHROPIC_DEFAULT_*` / `modelOverrides` guidance と、Codex の `model_provider = "amazon-bedrock"` は混ぜない。
Bedrock を使う user / project だけが、必要に応じて次を追加する:
```toml
model_provider = "amazon-bedrock"
[model_providers.amazon-bedrock.aws]
profile = "codex-bedrock"
```
Claude Code 側の provider / MCP / telemetry guidance は
`docs/claude-code-setup-mcp-telemetry-provider.md` を参照する。
特に `ANTHROPIC_BEDROCK_SERVICE_TIER` は Bedrock 利用者の provider 環境だけで扱い、
Harness の plugin default / template / shared project settings には入れない。
### Codex app-server / plugin workflow policy (0.130.0)
Codex `0.130.0` stable (`rust-v0.130.0`, published `2026-05-08T23:09:55Z`) の app-server / plugin workflow guidance は
`docs/codex-plugin-workflows-policy.md` を正本として扱う。
要点:
- `codex remote-control` は headless remotely controllable app-server の明示起動 entrypoint。Harness setup は remote-control defaults を config に書かない。
- App-server clients can page large threads。長い loop / Breezing transcript は必要な page 範囲を確認する。
- `view_image` は multi-environment session の selected environments 経由で file を解決できる。artifact report には environment / workdir を添える。
- Live app-server threads pick up config changes without restart。ただし secret / provider / hook policy の変更は diff と verification で扱う。
- Turn diffs stay accurate across `apply_patch` including parexecutor が返した advisor-request.v1 に対して方針だけ返す非実行 advisor
sprint-contract と review artifact を基準に verdict を返す read-only reviewer
実装、preflight 自己点検、検証、commit 準備を 1 タスク単位で進める統合ワーカー
Browser automation through the repo agent-browser CLI. Explicit helper for navigation, forms, screenshots, scraping, and web-app checks. Prefer Browser Use or Playwright when available. Do NOT load for: sharing URLs, embedding links, or editing screenshot files.
Explicit helper for authentication and payment implementation with Clerk, Supabase Auth, or Stripe. Do NOT load for: general UI work, database design, or non-auth features.
Team execution mode — backward-compatible alias for harness-work with team orchestration. Composer/composer 2.5 maps to the cursor backend.
Validates brainstormed ideas with Cursor PM, updates Plans.md, then handoff back. Cursor ↔ Claude Code 2-Agent workflow support. Use when user mentions Cursor PM handoff, 2-agent plan validation, CC-Cursor round trip, or brainstorm review. Do NOT load for: implementation work, single-agent tasks, or direct coding.
Quality guardrail for Claude/Codex update integration. Detects doc-only Feature Table additions and requires implementation or explicit planning. Internal use only.