Claude Cursor GitHub Copilot Skill

preset-workspaces

Discover Preset teams and workspaces through direct Management API calls, including workspace lookup, hostnames, health/status, and read-only memberships. Use only for direct API workflows; Do not use for MCP-only work.

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download preset-io-agent-skills-plugins_preset-api-skills_skills_preset-workspaces-73d2674.zip · 2 KB
Part of preset-io/agent-skills — 28 skills

Install

skills CLI npx skills add https://github.com/preset-io/agent-skills/tree/master/plugins/preset-api-skills/skills/preset-workspaces
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install preset-io-agent-skills@llmmart
Git git clone https://github.com/preset-io/agent-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole preset-io/agent-skills collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

preset-workspaces

Use for read-only team, workspace, hostname, health, and workspace membership discovery.

Always

  • Auth and conventions come from preset-api (JWT exchange, base URLs, Rison); resolve the workspace hostname through the Management API when it is not already known.
  • Resolve workspace hostnames from Management API responses; never assume or hard-code them.
  • Keep this skill read-only.
  • Route team membership mutations, invites, roles, seat-limit checks, audit logs, and workspace lifecycle work to preset-admin.

Decision Rules

  • Treat Management API team/workspace discovery as read-only.
  • Distinguish membership listing from access change.
  • Use discovered workspace hostname and status.
  • Avoid changing access.

Workflow Order

  1. List teams and workspaces.
  2. Resolve workspace hostname and status.
  3. Describe membership boundaries.
  4. Stop before access changes.

Retrieve

  • Team/workspace listing, lookup, hostname resolution, health: references/discovery.md
  • Workspace membership listing: references/membership.md
  • API conventions and environment base URLs: load preset-api and then references/api-conventions.md.
Files (agent-skills)
  • examples
    • workspace_discovery.py 998 B
      def list_teams(client):
          return client.mgmt("GET", "/teams/")["payload"]
      
      
      def get_team(client, team_name):
          return client.mgmt("GET", f"/teams/{team_name}/")["payload"]
      
      
      def list_workspaces(client, team_name):
          return client.mgmt("GET", f"/teams/{team_name}/workspaces/")["payload"]
      
      
      def get_workspace(client, team_name, workspace_id):
          return client.mgmt(
              "GET",
              f"/teams/{team_name}/workspaces/{workspace_id}/",
          )["payload"]
      
      
      def get_workspace_hostname(client, team_name, workspace_title):
          for ws in list_workspaces(client, team_name):
              if ws["title"].lower() == workspace_title.lower():
                  return ws["hostname"]
          raise ValueError(f"Workspace '{workspace_title}' not found in team '{team_name}'")
      
      
      def iter_workspaces(client):
          for team in list_teams(client):
              for ws in list_workspaces(client, team["name"]):
                  yield team, ws
      
      
      def workspace_is_ready(workspace):
          return workspace["workspace_status"] == "READY"
      
  • references
    • discovery.md 2.2 KB
      # Team And Workspace Discovery Reference
      
      ## Key Concepts
      
      | Term | Description |
      |---|---|
      | Team | The top-level organizational unit in Preset. Maps to a Preset subscription. |
      | Workspace | An isolated Superset instance inside a team. |
      | Team name | Stable team identifier used in Management API paths. Returned by `GET /teams/` as `name`. |
      | Workspace hostname | Unique host of a workspace's Superset API. |
      
      Production examples use `https://api.app.preset.io/v1`. For sandbox or staging environments, set `PRESET_API_BASE` as described in `preset-api` and use that base URL for Management API calls.
      
      Reusable Python snippets live in `examples/workspace_discovery.py`; load that file only when implementation detail is needed.
      
      ## Endpoints
      
      | Goal | Method and path |
      |---|---|
      | List teams | `GET /teams/` |
      | Get one team | `GET /teams/{team_name}/` |
      | List workspaces for a team | `GET /teams/{team_name}/workspaces/` |
      | Get one workspace | `GET /teams/{team_name}/workspaces/{workspace_id}/` |
      
      Common response fields:
      
      | Field | Description |
      |---|---|
      | `name` | Stable team identifier used in subsequent API paths |
      | `title` | Human-readable team title |
      | `id` | Numeric team ID |
      | `created_on` | ISO 8601 creation timestamp |
      
      ## Workspace Fields
      
      Common response fields:
      
      | Field | Description |
      |---|---|
      | `id` | Numeric workspace ID |
      | `title` | Human-readable workspace title |
      | `hostname` | Hostname for the workspace's Superset API |
      | `workspace_status` | Status enum such as `READY`, `HIBERNATED`, `UPGRADING`, or `ERROR` |
      | `region` | Cloud region |
      
      ## Resolve Workspace Hostname By Title
      
      When a user specifies a particular team or workspace by name, filter listing results to find the matching hostname rather than assuming a specific value.
      
      ## Iterate Across All Workspaces
      
      Use this fan-out pattern only for inventory or admin tasks. For single-target user requests, resolve the specific team and workspace by name instead of scanning every workspace.
      
      ## Check Workspace Health Before Workspace API Calls
      
      Only make workspace Superset API calls when `workspace_status == "READY"`. If a workspace is hibernated, upgrading, or in error, report that state instead of assuming workspace API availability.
      
    • membership.md 1.2 KB
      # Membership Reference
      
      Use this reference for read-only workspace membership listing. Use `preset-admin` for team membership management, invite lifecycle workflows, workspace role changes, seat-limit checks, and role identifier guidance.
      
      ## List Workspace Members
      
      ```bash
      curl -s -H "Authorization: Bearer $TOKEN" \
        "https://api.app.preset.io/v1/teams/{team_name}/workspaces/{workspace_id}/memberships/?page_number=1&page_size=100" \
        | jq '.payload'
      ```
      
      ```python
      members = client.mgmt(
          "GET",
          f"/teams/{team_name}/workspaces/{workspace_id}/memberships/?page_number=1&page_size=100",
      )["payload"]
      ```
      
      Common response fields:
      
      | Field | Description |
      |---|---|
      | `user.id` | Numeric user ID |
      | `user.email` | Member email address |
      | `user.username` | Member Preset username |
      | `user.first_name` | Member first name |
      | `user.last_name` | Member last name |
      | `workspace_role.role_identifier` | Preset workspace role identifier |
      | `workspace_role.name` | Workspace role display name |
      | `workspace_role.role_name` | Workspace role name |
      | `is_role_from_group` | Whether the workspace role is inherited from a user group |
      
      The response is paginated. Use `preset-admin` before acting on any user ID or role identifier from this response.
      
  • SKILL.md 1.5 KB
    ---
    name: preset-workspaces
    description: Discover Preset teams and workspaces through direct Management API calls, including workspace lookup, hostnames, health/status, and read-only memberships. Use only for direct API workflows; Do not use for MCP-only work.
    ---
    
    # preset-workspaces
    
    Use for read-only team, workspace, hostname, health, and workspace membership discovery.
    
    ## Always
    
    - Auth and conventions come from `preset-api` (JWT exchange, base URLs, Rison); resolve the workspace hostname through the Management API when it is not already known.
    - Resolve workspace hostnames from Management API responses; never assume or hard-code them.
    - Keep this skill read-only.
    - Route team membership mutations, invites, roles, seat-limit checks, audit logs, and workspace lifecycle work to `preset-admin`.
    
    ## Decision Rules
    
    - Treat Management API team/workspace discovery as read-only.
    - Distinguish membership listing from access change.
    - Use discovered workspace hostname and status.
    - Avoid changing access.
    
    ## Workflow Order
    
    1. List teams and workspaces.
    2. Resolve workspace hostname and status.
    3. Describe membership boundaries.
    4. Stop before access changes.
    
    ## Retrieve
    
    - Team/workspace listing, lookup, hostname resolution, health: [references/discovery.md](references/discovery.md)
    - Workspace membership listing: [references/membership.md](references/membership.md)
    - API conventions and environment base URLs: load `preset-api` and then `references/api-conventions.md`.
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related