Skip to content

fix(cursor-do): close 4 initial-use friction points (Issue #193) - #194

Merged
Chachamaru127 merged 1 commit into
mainfrom
fix/issue-193-cursor-do-friction
Jun 1, 2026
Merged

Chachamaru127 merged 1 commit into
mainfrom
fix/issue-193-cursor-do-friction

Conversation

@Chachamaru127

@Chachamaru127 Chachamaru127 commented Jun 1, 2026 •

Copy link
Copy Markdown
Owner

Closes #193

What's Changed

/cursor:do 初回利用の摩擦 4 点を 1 PR で埋める。Composer 無 commit による空振り / plugin-root 未設定時の起動不能 / release tarball ゲート不在 / worktree 相対パス衝突。

Before / After

Before After
cursor-companion task --write 後に Step 7 cherry-pick が no-op で「完了したのに main に何も入らない」 Step 6 冒頭で dirty worktree を Lead 側 1 commit にまとめる (TASK_SUMMARY env 対応)
HARNESS_PLUGIN_ROOT 未設定 → :-. が cwd に解決 → scripts 不在で起動不能 hooks.json と同じ valid_root パターンを inline 化、6 候補 dir を探索
4.13.2 active 版に cursor 系 scripts 不在 (release 工程ミスで欠落) を検知できず validate-plugin.sh に git-tracked + export-ignore 不在ゲート追加
相対 WT_DIR で agent cwd 依存、--workspace が exit 2 Step 4 冒頭で git rev-parse --show-toplevel → 絶対パス WT_DIR

Fixed

1. Composer 無 commit による Step 7 空振り (Issue #193 §1)

今まで: cursor-companion task --write は exit 0 + 結果 text を返すが、worktree には commit が無く未コミット変更だけ。Step 6 の git log BASE_REF..HEAD は空、Step 7 cherry-pick は対象 0 で no-op。ユーザー視点で「完了したのに main に何も入らない」。

今後: skills/cursor-do/SKILL.md Step 6 冒頭で worktree が dirty なら Lead 側で 1 commit にまとめる (git add -A → git commit、pre-commit hook は skip)。worktree 内の中間 commit 扱い、cherry-pick 後の main 側 commit で R01-R13 と pre-commit hook を正規通過する設計。TASK_SUMMARY env で commit message 制御可能。

2. HARNESS_PLUGIN_ROOT 未設定時の scripts 見失い (Issue #193 §2)

今まで: bash "${HARNESS_PLUGIN_ROOT:-.}/scripts/cursor-companion.sh" の :-. fallback が consumer repo の cwd に解決し、scripts/cursor-companion.sh が見えず exit していた。

今後: cursor-do Step 3 と cursor-ask Step 2 で hooks.json と同じ valid_root パターンを inline 化。候補解決順: CLAUDE_PLUGIN_ROOT → HARNESS_PLUGIN_ROOT → CLAUDE_PROJECT_DIR → $PWD → marketplace dir → cache dir。解決できなければ exit 2 で早期失敗。cursor-do は PLUGIN_ROOT を Step 3 で export し Step 5 で再利用、cursor-ask は 1 bash 内で完結。

3. release tarball から cursor scripts 欠落の早期検知 (Issue #193 §3)

今まで: 4.13.2 active 版の cache に cursor-companion.sh / resolve-impl-backend.sh / model-routing.sh が欠落しており、ユーザーが scripts を見つけられず起動不能になっていた (#2 と複合)。

今後: .gitattributes 確認で scripts/ は export-ignore 対象外、cursor 系 4 scripts は git-tracked で release tarball に含まれる前提。将来 release 工程の手違いで再発しないよう tests/validate-plugin.sh にゲートを追加: 4 scripts を git ls-files --error-unmatch と git check-attr export-ignore で検証。

4. worktree 相対パス vs companion 絶対パス要求 (Issue #193 §4)

今まで: WT_DIR=".claude/worktrees/cursor-do-${ID}" (相対) で worktree を切り、agent shell の cwd が repo root でないと別階層にネスト生成され、Step 5 の --workspace が companion の is not a directory ガードで exit 2。

今後: Step 4 冒頭で REPO_ROOT="$(git rev-parse --show-toplevel)" → cd "$REPO_ROOT" してから WT_DIR="$REPO_ROOT/.claude/worktrees/cursor-do-${ID}" を絶対パスで組む。


Test plan

  • bash tests/validate-plugin.sh 102 PASS / 0 WARN / 0 FAIL (新ゲート +1)
  • bash scripts/ci/check-consistency.sh 全 14 section PASS
  • mirror parity (codex/.codex/skills, opencode/skills) 同期確認済み
  • CHANGELOG [Unreleased] Fixed セクションに 4 点を Before/After 形式で記載
  • CI (GitHub Actions) PASS
  • 実機 /cursor:do 再走で 4 点すべて解消することを Issue reporter が確認

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • Bug Fixes

    • /cursor:ask および /cursor:do コマンドのパス解決の信頼性を向上させました。環境変数が未設定の場合の自動検出機能を追加し、予期しないパス参照エラーを削減しました。
  • Documentation

    • 初期利用時の落とし穴と対処方法をドキュメントに追記しました。
  • Tests

    • リリース成果物に必要なスクリプトが適切に含まれていることを検証するテストを追加しました。

Issue #193 で報告された /cursor:do 初回利用の摩擦 4 点を埋める:

1. Composer 無 commit による Step 7 空振り — cursor-companion task
   --write は exit 0 を返すが worktree に commit を作らないため、
   Step 6 の git log BASE_REF..HEAD が空、Step 7 の cherry-pick が
   対象 0 で no-op になり、ユーザーから見て「完了したのに main に
   何も入らない」状態だった。Step 6 冒頭で dirty なら Lead 側で
   1 commit にまとめる。TASK_SUMMARY env で commit message 制御可能。
   commit は worktree 内の中間 commit 扱い、cherry-pick 後の main 側
   commit で R01-R13 と pre-commit hook を正規通過する設計。

2. HARNESS_PLUGIN_ROOT 未設定時の scripts 見失い — `:-.` fallback が
   consumer repo の cwd に解決し scripts が見えず起動不能だった。
   hooks.json と同じ valid_root パターンを cursor-do Step 3 と
   cursor-ask Step 2 に inline 化。CLAUDE_PLUGIN_ROOT →
   HARNESS_PLUGIN_ROOT → CLAUDE_PROJECT_DIR → PWD → marketplace dir
   → cache dir の順に探索、解決できなければ exit 2。

3. 4.13.2 active 版 scripts/ から cursor 系欠落 — .gitattributes で
   scripts/ は export-ignore 対象外、cursor 系は git-tracked で release
   tarball に含まれる前提。将来の release 工程ミスで再発しないよう
   tests/validate-plugin.sh にゲートを追加。

4. Step 4 worktree 相対パス vs companion 絶対パス要求の衝突 —
   相対 WT_DIR は agent shell の cwd が repo root でないと別階層に
   ネスト生成され、Step 5 の --workspace が companion の workspace
   guard で exit 2 になる。Step 4 冒頭で REPO_ROOT 取得 → cd → 絶対
   パス WT_DIR で組む。

Mirror (codex/.codex/skills, opencode/skills) 同期。
tests/validate-plugin.sh 102/102 PASS (新ゲート +1)。
scripts/ci/check-consistency.sh 全 14 section PASS。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

このプルリクエストは、Issue #193 で報告された /cursor:ask と /cursor:do の初回利用時における 4 つの落とし穴を解消するもので、plugin root の堅牢な検出、worktree の絶対パス化、Composer 編集時の自動コミット化、スクリプト同梱検証を実装しています。

Changes

Issue #193 cursor-ask/do 初回利用時の落とし穴解消

Layer / File(s) Summary
変更概要と Issue #193 ドキュメント
CHANGELOG.md
Issue #193 対応として、/cursor:ask / /cursor:do 初回利用時の 4 つの落とし穴(未コミット Composer 編集、HARNESS_PLUGIN_ROOT 未設定時の scripts 見失い、worktree 相対パスと companion 絶対パス衝突、script 同梱漏れ)と今後の対処を追記。
cursor-ask の plugin root 堅牢化
codex/.codex/skills/cursor-ask/SKILL.md, opencode/skills/cursor-ask/SKILL.md, skills/cursor-ask/SKILL.md
cursor-companion 実行を相対パスから plugin root 検出経由の絶対実行に変更。CLAUDE_PLUGIN_ROOT/HARNESS_PLUGIN_ROOT を優先し、無ければ複数の候補ディレクトリを走査して valid root を探索し、見つからなければ exit 2 で終了。3 つの SKILL.md で同一パターンを適用。
cursor-do の worktree 絶対パス化と dirty worktree 自動コミット
codex/.codex/skills/cursor-do/SKILL.md, opencode/skills/cursor-do/SKILL.md, skills/cursor-do/SKILL.md
Step 3 で plugin root を堅牢に探索・確定し PLUGIN_ROOT を設定。Step 4 で worktree ディレクトリを REPO_ROOT 配下の絶対パスで作成。Step 5 で PLUGIN_ROOT 経由で cursor-companion.sh を実行。Step 6 で worktree が dirty なら git add -A / git commit --no-verify により未コミット編集を 1 コミットへまとめ、Lead の差分レビューを確実に実施。3 つの SKILL.md で同一パターンを適用。
cursor scripts リリース同梱検証
tests/validate-plugin.sh
cursor-companion.sh、resolve-impl-backend.sh、model-routing.sh、setup-cursor.sh が git 管理下かつ git export-ignore 非指定であることを検証する新規テストを追加。リリース tarball への同梱を保証。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • Chachamaru127/claude-code-harness#193: PR の変更はこのイシューで報告された plugin root 解決、worktree 相対パス、Composer 編集の自動コミット化、cursor scripts 同梱に関する 4 つの問題に直結して対応しています。

Possibly related PRs

  • Chachamaru127/claude-code-harness#182: PR #182 が導入した /cursor:ask / /cursor:do リーン/フル委譲と関連ハーネス/breezing ドキュメント内の同じ cursor-ask/do SKILL ステップロジック(plugin root 解決、worktree パス解決、dirty worktree commit 処理)を後続で更新しています。

Poem

🐰 プラグインのパス、迷わぬよう

絶対へと歩みを進め

ダーティな木も、こっそり commit

初回利用、もう怖くない!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトル「fix(cursor-do): close 4 initial-use friction points (Issue #193)」は、PR の主要な変更内容を正確に反映しており、修正対象と Issue 番号が明確に記載されている。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-193-cursor-do-friction

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Chachamaru127
Chachamaru127 merged commit d7eded1 into main Jun 1, 2026
9 of 10 checks passed
@Chachamaru127
Chachamaru127 deleted the fix/issue-193-cursor-do-friction branch June 1, 2026 08:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0663524acd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +106 to +108
for c in "${CLAUDE_PROJECT_DIR:-}" "$PWD" \
"$HOME/.claude/plugins/marketplaces/claude-code-harness-marketplace" \
"$HOME/.claude/plugins/cache/claude-code-harness-marketplace/claude-code-harness/"*; do

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include the native install roots in resolver

When the Codex-native package is installed with setup-codex.sh, the installer copies only skills/rules (scripts/setup-codex.sh:589-590), so scripts/cursor-companion.sh and .claude-plugin/plugin.json do not exist under the consumer repo or $CODEX_HOME. This new fallback only searches the consumer repo and Claude plugin marketplace/cache roots, so /cursor:do still exits 2 for a first-time Codex install unless the separate Claude plugin is also installed; add/copy a runtime script root for Codex/OpenCode installs or include those paths here.

Useful? React with 👍 / 👎.

pull Bot pushed a commit to dubbypanda/claude-code-harness that referenced this pull request Jun 1, 2026
Promote [Unreleased] to [4.13.3] - 2026-06-01 and bump all version
surfaces from 4.13.2 to 4.13.3 (patch).

- Cursor 初回利用の摩擦 4 点を解消 (Chachamaru127#193, Chachamaru127#194)
- breezing 起動ナレーションを計画明示型に緩和 (Chachamaru127#190)
- WorktreeCreate hook の出力修正 (Chachamaru127#188, lands Chachamaru127#168)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cursor-do: 初回利用の摩擦4点(Composer 無 commit で空振り / plugin-root 解決 / 4.13.2 scripts 欠落 / worktree 相対パス)

1 participant