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:
- Determines whether commands should be static (standalone) or instance-based (on a
MonoBehaviour) - Generates
[JahroCommand]attributes with the correct parameter order:name,group,description - Adds
RegisterObject/UnregisterObjectlifecycle for instance commands - Handles dynamic registration with the correct generic overloads
- 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
| Pattern | What the AI does |
|---|---|
| Parameter order | Always name, group, description — never swapped |
| Static vs instance | Uses static for standalone; adds RegisterObject for MonoBehaviour methods |
| Naming | Kebab-case names (spawn-enemy, not Spawn Enemy) |
| Lifecycle | Pairs RegisterObject in OnEnable with UnregisterObject in OnDisable |
| Dynamic overloads | Uses RegisterCommand<T>, RegisterCommand<T1,T2>, RegisterCommand<T1,T2,T3> — the actual API, not guessed signatures |
Verification
After the AI generates commands:
- Enter Play Mode and press
~to open the Jahro console - Type the command name — autocomplete should show it
- Switch to Visual Mode and verify commands appear in their assigned groups
- For instance commands, verify the object is registered (check for the command after the object's
OnEnablefires)
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.
Related
- Commands Documentation — full
[JahroCommand]reference - Watcher Skill — AI-generated variable monitoring (often used alongside commands)
- Visual Mode — how commands appear in the visual browser
- Agent Skills Overview — all 8 skills
- Install Agent Skills — setup instructions