Skip to content

feat(v3.2.50): slash commands runtime 有効化 (E-2) - #206

Merged
Kensan196948G merged 1 commit into
mainfrom
feat/v3.2.50-commands-runtime-activation
Apr 20, 2026
Merged

Kensan196948G merged 1 commit into
mainfrom
feat/v3.2.50-commands-runtime-activation

Conversation

@Kensan196948G

@Kensan196948G Kensan196948G commented Apr 20, 2026 •

Copy link
Copy Markdown
Owner

v3.2.49 (E-1) と同パターン。Claude/templates/claudeos/commands/ の 39 ファイル全体を .claude/commands/ にも配置し、slash command として runtime 有効化。Local / SSH 両対応。

Summary by CodeRabbit

  • New Features
    • スラッシュコマンド機能をサポートしました。プロジェクト環境でスラッシュコマンド用のテンプレートが自動的に同期・初期化されます。

## 背景

v3.2.44 で .claude/claudeos/commands/ に 39 ファイル配置、v3.2.49 で agents を
.claude/agents/ に runtime 有効化したが、commands は Start-ClaudeCode が個別に
6 ファイル (cron-* / work-time-* / session-info) のみ .claude/commands/ に deploy
していた。残 33 ファイル (build-fix / code-review / refactor-clean / verify /
plan / tdd / sessions / 等) は reference のみだった。

本 PR で 39 ファイル全体を .claude/commands/ にも配置し、slash command として
runtime 有効化する。

## 変更

Local / SSH 両モードで agents (E-1) と同パターンで commands 追加。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 20, 2026 02:05
@coderabbitai

coderabbitai Bot commented Apr 20, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

ウォークスルー

このPRは、スラッシュコマンド用の新しいテンプレートサブディレクトリを同期するために2つのPowerShellスクリプトを修正します。TemplateSyncManager.ps1内のSync-LauncherClaudeGlobalConfigに.claude/commandsテンプレートディレクトリの同期呼び出しを追加し、Start-ClaudeCode.ps1ではリモートホスト上でこのディレクトリを作成してファイルをコピーするSSHステップを追加します。

変更内容

コホート / ファイル(s) 概要
テンプレート同期マネージャー
scripts/lib/TemplateSyncManager.ps1
Sync-LauncherClaudeGlobalConfig関数にClaude\templates\claudeos\commandsディレクトリを.claude\commandsに同期するためのSync-ProjectTemplateDirectory呼び出しを追加。
ClaudeCode起動スクリプト
scripts/main/Start-ClaudeCode.ps1
リモートホスト上で.claude/commandsディレクトリを作成し、claudeos/commandsから全ファイルをコピーするSSH実行ステップを追加。成功時は実行時ログメッセージを出力。

推定コードレビュー労力

🎯 2 (Simple) | ⏱️ ~10 分

関連の可能性があるPR

推奨レビュアー

  • Copilot

ポエム

🐰 カギカッコのコマンドたち、
リモートの奥へそっと舞い降り、
.claude/commandsの扉を開く—
テンプレート同期の優雅なダンス、
🌙✨ スクリプトが夜に輝く

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは、スラッシュコマンドのランタイム有効化という変更内容を正確かつ簡潔に要約している。ファイルリストや曖昧な用語を避け、主要な変更が明確に伝わる。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 feat/v3.2.50-commands-runtime-activation

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/main/Start-ClaudeCode.ps1`:
- Around line 459-464: The SSH copy/mkdir block suppresses stderr and has no
failure branch, so failures enabling .claude/commands are silent; modify the
block that calls $sshExeForMkdir (the command that runs "mkdir -p
'$linuxProject/.claude/commands' && cp -rf ...") to stop swallowing stderr
(remove or capture the redirections to 2>/dev/null and 2>$null) and add an else
branch that logs the failure using Write-Error or similar (include $LASTEXITCODE
and the captured stderr/output) instead of only calling Write-Ok on success;
ensure the new failure log mirrors the Agent Teams pattern so command-enable
failures are observable.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cb40e95d-2a51-492e-95f2-674d08f4be2f

📥 Commits

Reviewing files that changed from the base of the PR and between a1c4b5d and e2163f3.

📒 Files selected for processing (2)
  • scripts/lib/TemplateSyncManager.ps1
  • scripts/main/Start-ClaudeCode.ps1
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Agent
  • GitHub Check: PSScriptAnalyzer
  • GitHub Check: test-and-validate
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New PR: 0
File: Claude/templates/claude/CLAUDE.md:0-0
Timestamp: 2026-04-19T01:11:42.497Z
Learning: Applies to Claude/templates/claude/**/*.{js,ts,tsx,jsx,py,java,go,rb,php,cs,cpp,c,h,hpp,sh,sql} : All code comments must be in English; documentation and explanations should be in Japanese
📚 Learning: 2026-04-19T01:11:42.497Z
Learnt from: CR
Repo: Kensan196948G/ClaudeCode-StartUpTools-New PR: 0
File: Claude/templates/claude/CLAUDE.md:0-0
Timestamp: 2026-04-19T01:11:42.497Z
Learning: Applies to Claude/templates/claude/.claude/claudeos/**/* : Store project-specific configurations and scripts in .claude/claudeos directory following structure: agents, skills, commands, rules, hooks, scripts, contexts, examples, mcp-configs, and kernel documentation

Applied to files:

  • scripts/lib/TemplateSyncManager.ps1
🔇 Additional comments (1)
scripts/lib/TemplateSyncManager.ps1 (1)

187-191: 実装方針は問題ありません。

.claude/commands への同期追加により、Local 側の slash commands runtime 有効化が既存の Agent Teams パターンと揃っており、意図が明確です。

Comment on lines +459 to +464
# v3.2.50 (E-2): slash commands を runtime 有効化 (39 ファイル)
& $sshExeForMkdir -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new -o ControlMaster=no `
$linuxHost "mkdir -p '$linuxProject/.claude/commands' && cp -rf '$linuxProject/.claude/claudeos/commands/.' '$linuxProject/.claude/commands/' 2>/dev/null" 2>$null
if ($LASTEXITCODE -eq 0) {
Write-Ok ".claude/commands/ activated (39 slash commands runtime)"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

SSH 側の commands 有効化失敗がサイレントになります。

このブロックは失敗時の else が無く、stderr も抑制しているため、39 commands の runtime 有効化失敗を検知できません。Agent Teams と同様に失敗ログを出してください。

🔧 修正案(失敗時の可観測性を追加)
         & $sshExeForMkdir -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new -o ControlMaster=no `
             $linuxHost "mkdir -p '$linuxProject/.claude/commands' && cp -rf '$linuxProject/.claude/claudeos/commands/.' '$linuxProject/.claude/commands/' 2>/dev/null" 2>$null
         if ($LASTEXITCODE -eq 0) {
             Write-Ok ".claude/commands/ activated (39 slash commands runtime)"
+        } else {
+            Write-Warn ".claude/commands/ activation exit=$LASTEXITCODE — slash commands は reference のみ"
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# v3.2.50 (E-2): slash commands を runtime 有効化 (39 ファイル)
& $sshExeForMkdir -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new -o ControlMaster=no `
$linuxHost "mkdir -p '$linuxProject/.claude/commands' && cp -rf '$linuxProject/.claude/claudeos/commands/.' '$linuxProject/.claude/commands/' 2>/dev/null" 2>$null
if ($LASTEXITCODE -eq 0) {
Write-Ok ".claude/commands/ activated (39 slash commands runtime)"
}
# v3.2.50 (E-2): slash commands を runtime 有効化 (39 ファイル)
& $sshExeForMkdir -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new -o ControlMaster=no `
$linuxHost "mkdir -p '$linuxProject/.claude/commands' && cp -rf '$linuxProject/.claude/claudeos/commands/.' '$linuxProject/.claude/commands/' 2>/dev/null" 2>$null
if ($LASTEXITCODE -eq 0) {
Write-Ok ".claude/commands/ activated (39 slash commands runtime)"
} else {
Write-Warn ".claude/commands/ activation exit=$LASTEXITCODE — slash commands は reference のみ"
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/main/Start-ClaudeCode.ps1` around lines 459 - 464, The SSH copy/mkdir
block suppresses stderr and has no failure branch, so failures enabling
.claude/commands are silent; modify the block that calls $sshExeForMkdir (the
command that runs "mkdir -p '$linuxProject/.claude/commands' && cp -rf ...") to
stop swallowing stderr (remove or capture the redirections to 2>/dev/null and
2>$null) and add an else branch that logs the failure using Write-Error or
similar (include $LASTEXITCODE and the captured stderr/output) instead of only
calling Write-Ok on success; ensure the new failure log mirrors the Agent Teams
pattern so command-enable failures are observable.

Copilot AI 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.

Pull request overview

This PR enables Claude Code slash commands at runtime by ensuring the full Claude/templates/claudeos/commands/ set is also present under the runtime-discovery path .claude/commands/ for both local and SSH workflows (following the v3.2.49 E-1 pattern).

Changes:

  • (SSH) Copy .claude/claudeos/commands into .claude/commands on the remote host during startup.
  • (Local) Sync Claude/templates/claudeos/commands into <project>/.claude/commands during global config sync.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
scripts/main/Start-ClaudeCode.ps1 Adds remote runtime activation step to mirror commands from .claude/claudeos/commands to .claude/commands.
scripts/lib/TemplateSyncManager.ps1 Adds local template sync so .claude/commands is populated from Claude/templates/claudeos/commands.

& $sshExeForMkdir -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new -o ControlMaster=no `
$linuxHost "mkdir -p '$linuxProject/.claude/commands' && cp -rf '$linuxProject/.claude/claudeos/commands/.' '$linuxProject/.claude/commands/' 2>/dev/null" 2>$null
if ($LASTEXITCODE -eq 0) {
Write-Ok ".claude/commands/ activated (39 slash commands runtime)"
Comment on lines +459 to +463
# v3.2.50 (E-2): slash commands を runtime 有効化 (39 ファイル)
& $sshExeForMkdir -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new -o ControlMaster=no `
$linuxHost "mkdir -p '$linuxProject/.claude/commands' && cp -rf '$linuxProject/.claude/claudeos/commands/.' '$linuxProject/.claude/commands/' 2>/dev/null" 2>$null
if ($LASTEXITCODE -eq 0) {
Write-Ok ".claude/commands/ activated (39 slash commands runtime)"
Comment on lines +187 to +191
# v3.2.50 (E-2): slash commands を runtime 有効化 (39 ファイル)
Sync-ProjectTemplateDirectory `
-TemplateDir (Join-Path $StartupRoot 'Claude\templates\claudeos\commands') `
-TargetDir (Join-Path $ProjectDir '.claude\commands') `
-Label '.claude/commands'
@Kensan196948G
Kensan196948G merged commit 714e47e into main Apr 20, 2026
8 checks passed
@Kensan196948G
Kensan196948G deleted the feat/v3.2.50-commands-runtime-activation branch April 20, 2026 02:08
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