Manage world permissions, namespaces, resource registration, and access control. Use when configuring world ownership, setting up authorization policies, or managing resource permissions.
Manages Dojo world permissions, namespaces, and resource registration. Use when configuring world ownership, setting up authorization policies, or granting writer access to systems and models.
/plugin marketplace add dojoengine/book/plugin install book@dojoengineThis skill is limited to using the following tools:
Manage your Dojo world's permissions, namespaces, resource registration, and access control policies.
Handles world management:
Configure permissions:
"Grant writer permission to my system"
Namespace setup:
"Create a namespace for my game"
Transfer ownership:
"Transfer world ownership to new address"
Central registry that:
Logical groupings of resources:
Two types:
Allow a system to write to models:
sozo auth grant writer \
MODEL_NAME,SYSTEM_ADDRESS \
--world WORLD_ADDRESS
Example:
# Grant actions system writer to Position model
sozo auth grant writer \
Position,0x123... \
--world 0xabc...
Transfer ownership or grant admin access:
sozo auth grant owner \
RESOURCE_NAME,NEW_OWNER_ADDRESS \
--world WORLD_ADDRESS
Remove access:
sozo auth revoke writer \
MODEL_NAME,SYSTEM_ADDRESS \
--world WORLD_ADDRESS
sozo auth create-namespace \
my_namespace \
--world WORLD_ADDRESS
# Register model to namespace
sozo auth register model \
Position \
--namespace my_namespace \
--world WORLD_ADDRESS
# Register system to namespace
sozo auth register contract \
actions \
--namespace my_namespace \
--world WORLD_ADDRESS
Grant system access to all game models:
# Actions system can write to Position
sozo auth grant writer Position,ACTIONS_ADDRESS
# Actions system can write to Health
sozo auth grant writer Health,ACTIONS_ADDRESS
# Actions system can write to Inventory
sozo auth grant writer Inventory,ACTIONS_ADDRESS
Grant admin system owner permissions:
sozo auth grant owner Position,ADMIN_SYSTEM_ADDRESS
sozo auth grant owner Config,ADMIN_SYSTEM_ADDRESS
Different systems for different aspects:
# Movement system writes to Position
sozo auth grant writer Position,MOVEMENT_SYSTEM
# Combat system writes to Health
sozo auth grant writer Health,COMBAT_SYSTEM
# Inventory system writes to Inventory
sozo auth grant writer Inventory,INVENTORY_SYSTEM
Check permissions:
#[dojo::contract]
pub mod system {
fn restricted_action(ref self: ContractState) {
let world = self.world_default();
// Only owner can call
world.assert_owner(get_caller_address());
// Or check writer
world.assert_writer(get_caller_address());
}
}
Grant permissions from system:
fn setup_permissions(ref self: ContractState) {
let world = self.world_default();
// Grant writer permission
world.grant_writer(MODEL_SELECTOR, system_address);
// Grant owner permission
world.grant_owner(RESOURCE_SELECTOR, new_owner);
}
Anyone can call:
fn spawn(ref self: ContractState) {
// No permission check - anyone can spawn
let player = get_caller_address();
world.write_model(@Position { player, x: 0, y: 0 });
}
Only world owner:
fn admin_function(ref self: ContractState) {
let world = self.world_default();
world.assert_owner(get_caller_address());
// Admin logic
}
Only authorized writers:
fn internal_update(ref self: ContractState) {
let world = self.world_default();
world.assert_writer(get_caller_address());
// Update logic
}
Check specific conditions:
fn guild_action(ref self: ContractState, guild_id: u32) {
let player = get_caller_address();
// Read player's guild membership
let member: GuildMember = world.read_model((guild_id, player));
assert(member.role >= OFFICER, 'not authorized');
// Guild logic
}
Set world information:
fn set_metadata(ref self: ContractState) {
let world = self.world_default();
world.set_metadata_uri("https://example.com/metadata.json");
}
Set model/system metadata:
world.set_resource_metadata(
MODEL_SELECTOR,
"ipfs://QmHash..."
);
Grant minimal permissions:
# ❌ Don't grant owner when writer is enough
sozo auth grant owner Position,SYSTEM_ADDRESS
# ✅ Grant only writer
sozo auth grant writer Position,SYSTEM_ADDRESS
# Check who has access to model
sozo auth list writers Position --world WORLD_ADDRESS
# Check owners
sozo auth list owners Position --world WORLD_ADDRESS
#[test]
#[should_panic(expected: ('not authorized',))]
fn test_unauthorized_access() {
let unauthorized = starknet::contract_address_const::<0x999>();
prank(world, unauthorized);
system.admin_function(); // Should panic
}
dojo-deploy skill)# 1. Deploy world
sozo migrate --name my_game
# 2. Record addresses from manifest
WORLD_ADDRESS=...
ACTIONS_ADDRESS=...
# 3. Grant permissions
sozo auth grant writer Position,$ACTIONS_ADDRESS --world $WORLD_ADDRESS
sozo auth grant writer Health,$ACTIONS_ADDRESS --world $WORLD_ADDRESS
# 4. Verify
sozo auth list writers Position --world $WORLD_ADDRESS
# 1. Deploy new system
sozo migrate --world WORLD_ADDRESS
# 2. Grant necessary permissions
sozo auth grant writer NewModel,NEW_SYSTEM_ADDRESS --world WORLD_ADDRESS
# 3. Test
sozo execute new_system test_function --world WORLD_ADDRESS
# Transfer world ownership
sozo auth transfer-ownership NEW_OWNER_ADDRESS --world WORLD_ADDRESS
After world setup:
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.