Commands Skill — AI-Generated Runtime Commands

Without this skill, AI assistants guess at [JahroCommand] syntax and consistently get the constructor parameter order wrong, skip RegisterObject for instance methods, or invent overloads that don't exist. The commands skill provides exact attribute signatures, registration patterns, and code templates.

What the skill does

When you ask your AI to add debug commands to a class, it:

  1. Determines whether commands should be static (standalone) or instance-based (on a MonoBehaviour)
  2. Generates [JahroCommand] attributes with the correct parameter order: name, group, description
  3. Adds RegisterObject/UnregisterObject lifecycle for instance commands
  4. Handles dynamic registration with the correct generic overloads
  5. Organizes commands into groups for the Visual Mode browser

Example prompts

"Add debug commands to my PlayerController"

"Create cheats for god mode, teleport, and spawn enemies"

"Register a dynamic command that changes the time scale"

"Add commands to test in-app purchases without real transactions"

What the AI generates

Static commands — for utilities that don't need a specific object:

using JahroConsole;
using UnityEngine;
 
public class GameCheats
{
    [JahroCommand("god-mode", "Cheats", "Toggle invincibility")]
    public static void GodMode(bool enable)
    {
        PlayerStats.Invincible = enable;
    }
 
    [JahroCommand("set-timescale", "Debug", "Change game speed")]
    public static void SetTimeScale(float scale)
    {
        Time.timeScale = Mathf.Clamp(scale, 0f, 10f);
    }
 
    [JahroCommand("tp", "Cheats", "Teleport player to position")]
    public static void Teleport(Vector3 position)
    {
        Player.Instance.transform.position = position;
    }
}

Instance commands — for methods that need a specific MonoBehaviour:

public class EnemySpawner : MonoBehaviour
{
    void OnEnable() => Jahro.RegisterObject(this);
    void OnDisable() => Jahro.UnregisterObject(this);
 
    [JahroCommand("spawn-wave", "Spawning", "Spawn a wave of enemies")]
    public void SpawnWave(int count)
    {
        for (int i = 0; i < count; i++)
            SpawnEnemy(GetRandomSpawnPoint());
    }
}

Dynamic commands — for runtime-created commands:

Jahro.RegisterCommand<float>("set-volume", "Audio", "Set master volume",
    (volume) => AudioListener.volume = Mathf.Clamp01(volume));

Key patterns the skill enforces

PatternWhat the AI does
Parameter orderAlways name, group, description — never swapped
Static vs instanceUses static for standalone; adds RegisterObject for MonoBehaviour methods
NamingKebab-case names (spawn-enemy, not Spawn Enemy)
LifecyclePairs RegisterObject in OnEnable with UnregisterObject in OnDisable
Dynamic overloadsUses RegisterCommand<T>, RegisterCommand<T1,T2>, RegisterCommand<T1,T2,T3> — the actual API, not guessed signatures

Verification

After the AI generates commands:

  1. Enter Play Mode and press ~ to open the Jahro console
  2. Type the command name — autocomplete should show it
  3. Switch to Visual Mode and verify commands appear in their assigned groups
  4. For instance commands, verify the object is registered (check for the command after the object's OnEnable fires)

Frequently Asked Questions

Why does my AI generate commands with the wrong parameter order? Without the skill loaded, AI assistants guess at [JahroCommand] constructor arguments. The skill provides the exact signature: name, group, description — in that order.

Can the AI generate commands for an existing class without refactoring it? Yes. The AI adds [JahroCommand] attributes to existing methods or creates new static utility methods, depending on your prompt. It avoids restructuring code you didn't ask it to change.

What happens if the AI generates instance commands without RegisterObject? The commands compile but never appear in the console. The skill explicitly checks for this and always pairs instance commands with the registration lifecycle.

Last updated: April 2, 2026