スキル一覧に戻る

jahro-commands

jahro-console
更新日 2 days ago
5 閲覧
12
12
GitHubで表示
メタgeneral

について

このスキルはC# Unityクラスを分析し、ランタイムデバッグコマンドやチート用の適切な`[JahroCommand]`属性を自動生成します。適切なメソッドを特定し、RegisterObjectパターンを含む正確な構文を追加し、コマンドをグループごとに整理します。Unityプロジェクトでコンソールコマンド、ランタイムチート、またはデバッグアクションを実装する際にご利用ください。

クイックインストール

Claude Code

推奨
メイン
npx skills add jahro-console/unity-agent-skills -a claude-code
プラグインコマンド代替
/plugin add https://github.com/jahro-console/unity-agent-skills
Git クローン代替
git clone https://github.com/jahro-console/unity-agent-skills.git ~/.claude/skills/jahro-commands

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Jahro Commands

Help users add runtime-callable debug commands to Unity code using Jahro's [JahroCommand] attribute system.

Workflow

  1. Analyze the user's code — identify methods that are good command candidates
  2. Generate correct [JahroCommand] attributes with proper syntax
  3. Add registration if needed (instance methods require RegisterObject)
  4. VERIFY — "Enter Play Mode, press ~, check the Commands tab"

Analyzing Code for Command Candidates

When the user shares a class, identify methods worth exposing as commands:

Good candidates:

  • Public methods that change game state (damage, heal, spawn, teleport, reset)
  • Methods used for testing and tuning (set difficulty, add currency, skip level)
  • Diagnostic methods (print stats, dump state, force GC)
  • Methods with simple parameter types (int, float, bool, string, Vector2, Vector3, enum)

Skip these:

  • Unity lifecycle methods (Update, Start, Awake, OnEnable, OnDisable, OnDestroy)
  • Private implementation details the developer wouldn't want to call manually
  • Methods with complex parameter types (custom classes, interfaces, delegates)
  • Property getters/setters (use [JahroWatch] for monitoring instead)

Attribute Syntax

[JahroCommand("command-name", "GroupName", "Short description of what it does")]

Constructor: [JahroCommand(string name, string group, string description)]

All parameters are optional. Defaults: name = method name, group = "Default", description = "".

Naming conventions

  • Command name: kebab-case ("spawn-enemy", "add-gold", "set-difficulty")
  • Group name: PascalCase or Title Case ("Cheats", "Spawning", "Game")
  • Description: Imperative, concise ("Spawn enemy at position", "Add gold to player")

Complete example

using JahroConsole;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
    public float health = 100f;

    [JahroCommand("heal", "Player", "Restore health by amount")]
    public void Heal(float amount) { health = Mathf.Min(health + amount, 100f); }

    [JahroCommand("teleport", "Player", "Teleport to position")]
    public void Teleport(Vector3 position) { transform.position = position; }

    [JahroCommand("reset-pos", "Player", "Reset to origin")]
    public void ResetPosition() { transform.position = Vector3.zero; }

    void OnEnable()  => Jahro.RegisterObject(this);
    void OnDisable() => Jahro.UnregisterObject(this);
}

Registration Pattern

Instance methods — require RegisterObject

Any non-static method with [JahroCommand] needs the owning object registered so Jahro can invoke it:

void OnEnable()  => Jahro.RegisterObject(this);
void OnDisable() => Jahro.UnregisterObject(this);

This same call also registers [JahroWatch] attributes on the class. If the class already has RegisterObject (e.g., for watchers), do not add a second call.

Read references/common-patterns.md for the full lifecycle pattern and anti-patterns.

Static methods — no registration needed

Static methods are discovered via assembly scanning:

public class DebugCommands
{
    [JahroCommand("restart-level", "Game", "Restart current level")]
    public static void RestartLevel()
    {
        UnityEngine.SceneManagement.SceneManager.LoadScene(0);
    }
}

Decision guide

Method typeNeeds RegisterObject?Why
public void Foo() (instance)YesJahro needs the object reference to call it
public static void Foo()NoCalled on the class, discovered via assembly scan
public void Foo() on a class that already has RegisterObjectNo extra workAlready registered

Supported Parameter Types

Commands accept these parameter types:

TypeText Mode inputVisual Mode input
int42Number field
float3.14Decimal field
booltrue / falseToggle switch
stringhello worldText field
Vector21.5 2.0X/Y fields
Vector310 2.5 -7X/Y/Z fields
enum (any)Hard (name)Dropdown selector

Maximum 3 parameters per command. For full type details, read references/api-reference.md.

Command Overloads

Same command name with different parameter signatures:

[JahroCommand("spawn-enemy", "Spawning", "Spawn one enemy at position")]
public void SpawnEnemy(Vector3 position) { /* ... */ }

[JahroCommand("spawn-enemy", "Spawning", "Spawn N enemies")]
public void SpawnEnemy(int count) { /* ... */ }

Text Mode resolves the correct overload by parameter count and type conversion.

Return Values

Commands that return string display the result in the console log:

[JahroCommand("get-pos", "Debug", "Print player position")]
public static string GetPlayerPosition()
{
    return $"Position: {Player.Instance.transform.position}";
}

Dynamic Command Registration

For commands created at runtime instead of compile time. Use when wrapping external APIs, creating commands from data, or in non-MonoBehaviour systems.

// No parameters
Jahro.RegisterCommand("clear-cache", "Maintenance", "Clear local cache",
    () => PlayerPrefs.DeleteAll());

// One typed parameter
Jahro.RegisterCommand<int>("add-gold", "Cheats", "Add gold",
    amount => Player.Gold += amount);

// Two parameters
Jahro.RegisterCommand<int, float>("set-stats", "Tuning", "Set health and speed",
    (health, speed) => { Player.Health = health; Player.Speed = speed; });

Parameter order for dynamic registration: (name, description, groupName, callback). This differs from the attribute order (name, group, description).

Register command on existing object method:

var mgr = FindObjectOfType<GameManager>();
Jahro.RegisterCommand("restart", "Game", "Restart level",
    mgr, nameof(GameManager.RestartLevel));

Cleanup:

Jahro.UnregisterCommand("clear-cache");
Jahro.UnregisterCommand("restart", "Game");

Read references/api-reference.md for all RegisterCommand overloads (0-3 generic parameters).

Command Organization

Group naming strategy

Organize commands by functional area:

"Player"    — heal, teleport, reset, set-speed
"Spawning"  — spawn-enemy, spawn-wave, clear-enemies
"Cheats"    — god-mode, add-gold, unlock-all
"Game"      — restart-level, set-difficulty, skip-level
"Debug"     — dump-state, gc-collect, toggle-fps

Visual Mode vs Text Mode

Commands work in both modes automatically. Consider the target audience:

  • Text Mode — fast for developers who know command names. Autocomplete helps. Vector3 entered as 10 2.5 -7.
  • Visual Mode — browsable groups with descriptions, form-based parameter input. Touch-friendly on mobile. Enum parameters render as dropdown selectors.

When designing commands for QA (non-developers), prefer:

  • Simple parameter types (bool, enum, int) over Vector3
  • Descriptive names and descriptions
  • Logical groups that match QA workflows

Favorites and Recent

Users can star frequently-used commands for quick access. The last 10 executed commands always appear in the Recent section. Command names and groups help discoverability — be descriptive.

Contextual Awareness

When you see these patterns in user code, proactively suggest:

Pattern in codeSuggestion
[JahroCommand] already presentOffer improvements (better groups, descriptions, missing commands)
OnGUI() with GUI.Button debug commandsMigrate to [JahroCommand] — Visual Mode replaces the button UI
Public methods that modify game stateSuggest exposing as commands
Custom command parser (string → command)Migrate to Jahro's typed command system

Verification

After generating commands, always include:

Verify: Enter Play Mode → press ~ → switch to the Commands tab (or Visual Mode). Confirm your commands appear in the correct groups. Try executing one to confirm it works.

If commands don't appear, suggest the jahro-troubleshooting skill — common causes: missing RegisterObject, wrong assembly selected, JAHRO_DISABLE active.

GitHub リポジトリ

jahro-console/unity-agent-skills
パス: skills/jahro-commands
0
agent-skillsai-assistantai-codingclaude-codecursordebugging

関連スキル

content-collections

メタ

このスキルは、Content Collections(Markdown/MDXファイルを型安全なデータコレクションに変換するTypeScriptファーストのツール)の本番環境でテストされた設定を提供します。Zodバリデーションによる型安全性を実現し、ブログ、ドキュメントサイト、コンテンツ重視のVite + Reactアプリケーション構築時にご利用ください。Viteプラグインの設定、MDXコンパイルから、デプロイ最適化、スキーマバリデーションまで、すべてを網羅しています。

スキルを見る

polymarket

メタ

このスキルは、開発者がPolymarket予測市場プラットフォームを活用したアプリケーション構築を可能にします。API統合による取引や市場データの取得に加え、WebSocketを介したリアルタイムデータストリーミングにより、ライブ取引や市場活動を監視できます。取引戦略の実装や、ライブ市場更新を処理するツールの作成にご利用ください。

スキルを見る

creating-opencode-plugins

メタ

このスキルは、開発者がコマンド、ファイル、LSP操作など25種類以上のイベントタイプにフックするOpenCodeプラグインを作成することを支援します。JavaScript/TypeScriptモジュール向けに、プラグイン構造、イベントAPI仕様、および実装パターンを提供します。カスタムイベント駆動ロジックでOpenCode AIアシスタントのライフサイクルをインターセプト、監視、または拡張する必要がある場合にご利用ください。

スキルを見る

sglang

メタ

SGLangは、高性能なLLMサービングフレームワークであり、RadixAttentionプレフィックスキャッシュを活用したJSON、正規表現、エージェントワークフロー向けの高速で構造化された生成を特長とします。特にプレフィックスが繰り返されるタスクにおいて、大幅に高速な推論を実現し、複雑な構造化出力やマルチターン対話に最適です。制約付きデコードが必要な場合や、広範なプレフィックス共有を伴うアプリケーションを構築する場合は、vLLMなどの代替案ではなくSGLangを選択してください。

スキルを見る