Skip to content

chore: Add helper script for generated skill files#1295

Merged
hatayama merged 4 commits into
v3-betafrom
feature/refresh-neighbor-game-skills-script
Jun 9, 2026
Merged

chore: Add helper script for generated skill files#1295
hatayama merged 4 commits into
v3-betafrom
feature/refresh-neighbor-game-skills-script

Conversation

@hatayama

@hatayama hatayama commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a POSIX shell script for refreshing generated uloop skill files in neighboring Unity game projects.
  • Clarify that this is run directly as a script; it is not an agent Skill that needs installation.

User Impact

  • Maintainers can run scripts/refresh-neighbor-game-skills.sh directly instead of reconstructing the previous temporary /tmp helper.
  • The script refreshes .claude/skills and .agents/skills in each target project, commits generated skill-file changes locally, removes Library only after Unity has stopped, and relaunches Unity.

Changes

  • Add scripts/refresh-neighbor-game-skills.sh as an executable POSIX shell helper.
  • Auto-discover sibling cli-loop-* Unity projects, or accept explicit --project paths.
  • Support --dry-run and --uloop-root for safer previews and non-default checkouts.

Verification

  • sh -n scripts/refresh-neighbor-game-skills.sh
  • scripts/refresh-neighbor-game-skills.sh --help
  • git diff --cached --check

Keep the one-off workflow for refreshing generated skills in sibling Unity projects available as a repository script instead of a temporary /tmp skill.
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@hatayama, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 16 minutes and 56 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 39f34af2-dc96-4800-a2c0-e02e7bc2479d

📥 Commits

Reviewing files that changed from the base of the PR and between 0227b69 and dc09ff1.

📒 Files selected for processing (1)
  • scripts/refresh-neighbor-game-skills.sh
📝 Walkthrough

Walkthrough

A new shell script automates refreshing Unity uloop skills across sibling projects. It parses CLI arguments, discovers and validates target projects, validates git state, gracefully shuts down running Unity instances with escalation to force-kill, installs skills via uloop, conditionally commits changes, removes build artifacts, and relaunches Unity.

Changes

Neighbor Game Skills Refresh Script

Layer / File(s) Summary
Script setup and helper utilities
scripts/refresh-neighbor-game-skills.sh
Shebang, strict mode, global configuration, temp file cleanup trap, and reusable helpers for logging, error handling, and command execution with dry-run mode support.
Unity process discovery and control
scripts/refresh-neighbor-game-skills.sh
Find running Unity instances, check liveness, send graceful quit via macOS UI scripting, force-kill after timeout, wait for exit with bounded waits, and assert full shutdown.
Project target discovery and validation
scripts/refresh-neighbor-game-skills.sh
Validate and collect project roots from CLI, auto-discover sibling cli-loop projects, locate uloop binary from CLI or git root, enforce expected sibling count.
Git state validation and graceful shutdown
scripts/refresh-neighbor-game-skills.sh
Check .claude/skills and .agents/skills for uncommitted changes, execute graceful quit with timeout and escalation to force-kill, assert Unity has stopped.
Skill installation, commit, and cleanup cycle
scripts/refresh-neighbor-game-skills.sh
Run uloop skills install for Claude and Agents, stage and conditionally commit changes (with dry-run support), remove Library directory with safety checks, launch Unity via launch-unity.
Main execution and orchestration
scripts/refresh-neighbor-game-skills.sh
Parse CLI arguments, resolve uloop root, discover and validate projects, ensure launch-unity availability, log execution plan, verify skill directory cleanliness, and sequence the 4-phase refresh workflow across all projects.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: Add helper script for generated skill files' accurately summarizes the main change—adding a new shell script for refreshing skill files.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about the script's purpose, functionality, user impact, and verification steps.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refresh-neighbor-game-skills-script

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.

@hatayama hatayama changed the title chore: Add helper for refreshing neighboring game skills chore: Add helper script for generated skill files Jun 9, 2026
Clarify that the helper is a local development script and summarize the workflow it performs before any executable logic runs.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/refresh-neighbor-game-skills.sh`:
- Around line 10-13: The signal handlers currently trap INT/TERM only to run
cleanup, which consumes the signal and lets the script continue; change the
traps so INT and TERM run cleanup then exit with a non-zero status (e.g., exit 1
or 130) while keeping the EXIT trap for cleanup; implement either a small
on_signal wrapper (on_signal -> cleanup; exit 1) and trap that for INT/TERM, or
change the INT/TERM trap to invoke cleanup followed by a non-zero exit,
referencing the existing cleanup function and the trap lines.
- Around line 134-145: The append_project function currently appends
project_root unconditionally causing duplicate canonical roots; before printing
to project_file, check whether project_root is already present (e.g., grep -Fxq
"$project_root" "$project_file" || printf …) or maintain an in-memory array/set
of seen roots and only append if not seen, using the existing project_root and
project_file variables to perform the membership test; ensure project_file
exists or create it first and update append_project to skip duplicates to
guarantee unique canonical project roots.
- Around line 52-56: The awk substring check for "-projectPath" can accidentally
match prefixes; in scripts/refresh-neighbor-game-skills.sh (inside the awk
filter used by quit_unity/force_kill_unity) replace the index($0, "-projectPath
" project) > 0 test with a regex match that enforces an exact "-projectPath"
token followed by the project path and then a separator or end-of-line (e.g. use
match($0, "-projectPath[[:space:]]+" project "([[:space:]]|$)") > 0) so only the
Unity instance launched with that exact -projectPath is selected. Ensure you
update the awk condition in the same pipeline where
Unity.app/Contents/MacOS/Unity is checked.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e3171f87-43e7-4481-bbe7-8bd0462cd89e

📥 Commits

Reviewing files that changed from the base of the PR and between 476b2da and 937751a.

📒 Files selected for processing (1)
  • scripts/refresh-neighbor-game-skills.sh

Comment thread scripts/refresh-neighbor-game-skills.sh Outdated
Comment thread scripts/refresh-neighbor-game-skills.sh
Comment thread scripts/refresh-neighbor-game-skills.sh
Exit on interrupt signals, match Unity project paths exactly when resolving Editor PIDs, and reject duplicate project roots before running the refresh workflow.

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread scripts/refresh-neighbor-game-skills.sh Outdated

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

Re-trigger cubic

Treat Unity process arguments with a trailing slash after -projectPath as the same canonical project while keeping prefix paths excluded.
@hatayama hatayama merged commit 1125db9 into v3-beta Jun 9, 2026
5 checks passed
@hatayama hatayama deleted the feature/refresh-neighbor-game-skills-script branch June 9, 2026 05:06
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.

2 participants