generate-schema

generate-schema is a command for coding agents from authzed/authzed-marketplace. It costs 14 tokens per session (2,093 once invoked), scanned A, original, Apache-2.0.

A command that turns a written permission model into a SpiceDB schema file. SpiceDB is a system for defining and checking who can access resources.

In plain words
What is it for?
Use it when you have a permission-model.md document and need a .zed schema for SpiceDB. It helps model resources, relationships, permissions, hierarchies, and special access rules.
Why use it?
It removes the need to rewrite permission rules by hand in SpiceDB's schema format. It also runs a schema check after generating the file.

Command

Part of the spicedb-dev plugin — 7 skills, 15 commands, 3 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/authzed/authzed-marketplace/generate-schema
Clone the repo
git clone --depth 1 https://github.com/authzed/authzed-marketplace

Or install spicedb-dev, the plugin that ships this one along with the rest of its 7 skills, 15 commands, 3 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for generate-schema

README.md
[![agentmods](https://agentmods.dev/badge/commands/authzed/authzed-marketplace/generate-schema.svg)](https://agentmods.dev/commands/authzed/authzed-marketplace/generate-schema)
Your own site
<a href="https://agentmods.dev/commands/authzed/authzed-marketplace/generate-schema"><img src="https://agentmods.dev/badge/commands/authzed/authzed-marketplace/generate-schema.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,093 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00014 $0.02093
Opus 5 $0.00007 $0.01046
Sonnet 5 $0.00003 $0.00419
Haiku 4.5 $0.00001 $0.00209

Measured 4d ago against content hash 77b8d3b802a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

generate-schema scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

spicedb-dev/commands/generate-schema.md · 303 lines

How it starts

The opening of the file, as written. The whole thing — 303 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generate SpiceDB Schema

Convert a permission model document to a SpiceDB schema (.zed file). After generation, automatically trigger the schema-validator agent to check the schema.

Progress Tracking

Before starting, use TaskCreate to create a task for each step. Use TaskUpdate to mark each task in_progress when starting and completed when done.

Process

Step 1: Locate Permission Model

If the user provided a model file path, use that. Otherwise:

  1. Look for permission-model.md in the current directory
  2. If not found, ask user for the model file location
  3. If no model exists, suggest running /spicedb-dev:design-model first

Step 2: Parse Permission Model

Read the permission model document and extract:

  • Resource definitions with their relations
  • Permission definitions with their expressions
  • Hierarchical relationships
  • Any special patterns (caveats, wildcards, etc.)

Step 3: Select a Reference Example

Before writing the schema from scratch, identify the closest matching example in skills/spicedb-schema-design/examples/ and use it as a starting point or cross-reference.

Pattern matching guide:

Permission model contains... Start from
Simple writer/reader or owner/viewer roles basic-rebac.yaml
IP allowlists, rate limits, time-based access caveats.yaml
Groups with parent/child hierarchies docs-style-sharing.yaml
SaaS subscription plans gating features entitlements.yaml
Orgs, teams, repos with multiple role levels github.yaml or github-style.zed
Platform-level superuser or admin bypass superuser.yaml
Users defining their own roles at runtime user-defined-roles.yaml
Roles with scoped inheritance across resource hierarchy google-iam.yaml
Multi-tenant SaaS with tenant isolation multi-tenant-saas.zed
Google Docs-style sharing google-docs-style.zed
AI agents acting on behalf of a user ai-agents.yaml
Schema tested across multiple independent validation files multiple-validation-files/ (directory, not a modeling pattern)

Read the full file on GitHub · 303 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 303 lines · 14 tokens per session scan A 77b8d3b802a4

Subscribe to this mod's changes

generate-schema is a command published in the GitHub repository authzed/authzed-marketplace (2 stars, last pushed 8d ago), licensed Apache-2.0. It adds 14 tokens to every session and 2,093 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.