Groups

From agent0ai/space-agent · View interactive version

Groups is an AI agent skill from the GitHub repository agent0ai/space-agent. Explain and manage group membership, manager inheritance, special groups, and canonical group.yaml storage as an admin.

How to use this skill

Skill file

Use this skill for group creation, membership changes, manager changes, or explaining how _all and _admin work.

Canonical Group Tree

Do not write group membership into arbitrary files. group.yaml is the contract.

Special Groups

Canonical group.yaml Fields

Meaning:

Manager inheritance is separate from membership inheritance. Do not treat included_* as manager fields or vice versa.

Create A Group

Runtime-created groups belong in L1, not L0.

const groupId = "team-red";

return await space.api.fileWrite({
  files: [
    { path: `L1/${groupId}/` },
    { path: `L1/${groupId}/mod/` },
    {
      path: `L1/${groupId}/group.yaml`,
      content: space.utils.yaml.stringify({
        included_groups: [],
        included_users: [],
        managing_groups: [],
        managing_users: []
      })
    }
  ]
});

Update Membership Or Managers

Read, parse, normalize, then write group.yaml.

const path = "L1/team-red/group.yaml";
const current = await space.api.fileRead(path);
const config = space.utils.yaml.parse(current.content || "");

config.included_users = [...new Set([...(config.included_users || []), "alice"])].sort();
config.managing_users = [...new Set([...(config.managing_users || []), "alice"])].sort();

return await space.api.fileWrite(path, space.utils.yaml.stringify(config));

Use the same pattern for included_groups and managing_groups.

Grant Or Remove Admin Access

The canonical way to grant admin access is to edit L1/_admin/group.yaml:

Example:

const path = "L1/_admin/group.yaml";
const current = await space.api.fileRead(path);
const config = space.utils.yaml.parse(current.content || "");
config.included_users = [...new Set([...(config.included_users || []), "alice"])].sort();
return await space.api.fileWrite(path, space.utils.yaml.stringify(config));

Mental Model

CLI Reference

Backend equivalents exist for operators outside the browser:

From the overlay agent, prefer logical app-file edits through space.api.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.