---
title: "Core concepts"
description: "How organizations, repos, and the extension registry fit together in Forge."
---

> Documentation Index
> Fetch the complete documentation index at: https://buildrforge.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Core concepts

Forge separates shared tenant administration from version-controlled operational data. An organization has two shared parts that are not versioned: the **org** itself and the **registry** of published extension versions. Below them sits a flat set of **repos**. Every repo is an independent version-controlled database, and extensions carry shared standards and behavior between them.

## System pieces

The data model has five distinct pieces:

| Piece | Versioned | What it holds |
| --- | --- | --- |
| Org | No | Members, groups, policies, third-party connections, OAuth clients, and the list of repos |
| Registry | No, but every entry is immutable | Releases and prereleases of extensions from repos in the org |
| Repo | Yes, one commit DAG each | Custom models, custom fields, records, tag families, tags, CI checks, README, agent instructions and skills, extension source files, and installation pins |
| Extension | Yes, by release | Custom models, tag families, CI checks, tools, schedules, triggers, webhooks, workflows, third-party connection requirements, and browser UI |
| Installation | The release pin and schedule settings are versioned, and runtime state is not | Which release a repo runs on `main`, which of its schedules are on, its connection bindings, its webhook subscriptions, and its schedule, trigger, webhook, and workflow runs |

## Organizations

An org is the top-level tenant boundary. Forge keeps org state outside any commit history for a security reason: reverting a commit or creating a branch must never undo a revoked membership or restore a deleted credential.

An org manages five shared resources:

- **Members**: An org's owners bypass its policies. Every other member does what the org's [policies](https://buildrforge.com/docs/permissions/) allow; a member who joins a new org in no group joins its default group, `Editors`, and gets its Editor policy, which reads the org, its member list, its registry, and its providers, and works on the records and branches of every repo. Changing schema, publishing or installing extensions, calling tools, running automations, managing connections, and the org's own actions, such as creating repos, renaming the org, or adding members, take a policy of their own, which a new org gives only its `Admins` group. The person who creates an org owns it and starts in `Admins`; a new org's third group, `Viewers`, only reads. Only an owner makes another member an owner.
- **Groups**: A group is a named set of the org's members, such as Finance, HR, or Project managers. A job role such as "project manager" is a group too, while owning the org is not. Groups don't nest, and a group's name is unique in the org regardless of case, so `Finance` and `finance` can't both exist. Any member whom a policy allows `readGroups`—every starter group in a new org—can read the groups, who is in each, and which groups a member is in. Org owners, and members whom a policy allows `manageGroups`, create, rename, and delete groups and add or remove their members. Only members of the org can join its groups: removing someone from the org removes them from its groups, and deleting a group ends every membership in it and frees its name. Forge keeps deleted groups and ended memberships as a record of who was in each group and when.
- **Repos**: The org keeps a flat list of repos. Repos have no parent-child hierarchy, and there is no special template or org-level database.
- **Connections and OAuth clients**: Third-party credentials, such as a Linear or Stripe OAuth grant or an API token, live in the org so that the team connects a service once and binds that connection to individual repos. Whoever asks for a connection names its `audience`: `org` lets every member use it, and a `user` connection is for the person who connected it alone.
- **The extension registry**: Every commit that changes an extension publishes it, and the org registry records the immutable version. Any repo in the org can inspect or install a release.

```sh
# Create an organization
forge orgs create-org --data '{"name":"Acme Corp"}'

# List members of the organization
forge orgs list-members --org "$ORG"

# Put a member in a group
forge groups create-group --org "$ORG" --data '{"name":"Finance"}'
forge groups create-group-member --org "$ORG" --group "$GROUP" --data '{"user_id":"'"$USER_ID"'"}'

# Create a repo inside the organization
forge repos create-repo --org "$ORG" --data '{"name":"North America Operations","idempotency_key":"na-ops-creation-1"}'
```

Each org has a lowercase `slug` (such as `acme-corp`), which serves as its subdomain (`acme-corp.onforge.com`) and URL path (`/orgs/acme-corp`). `create-org` derives `slug` from `name` unless `slug` is given, and `forge orgs update-org` updates `name`, `slug`, or both (`name` alone renames the org without moving its `slug`).

To retry a repo creation safely, pass the same `idempotency_key`. Reusing a key as the same creator while the repo still has that `name` and `description` returns the repo that the first call created, whereas reusing it with a `name` or `description` that differs from the repo's current values fails with `RepoCreationConflict`. A repo name or derived slug that another repo in the org already holds (archived or not) fails with `RepoNameTaken` or `RepoSlugTaken`.

## Repos

Each repo is its own database, and Forge applies a repo's writes one at a time, so two commits to a repo never interleave.

Who reads and writes a repo's records and schema is a policy over `read` on the repo and the actions on its models. The Editor policy a new org ships lets every member of its `Editors` group work in every repo, and an org or repo policy narrows that, down to single records. [Permissions](https://buildrforge.com/docs/permissions/) explains how policies decide.

A single repo can hold any combination of five things:

- **Business records**: The rows of custom models, such as orders, invoices, vendors, employees, or budgets, along with their tag memberships and file attachments.
- **Repo-owned schema and checks**: Custom models, custom fields, tag families, tags, and CI checks created directly for that repo.
- **Extension source**: Declarations of extensions, their schema and tag families, and their TypeScript and UI source files, which each commit publishes to the org's registry.
- **Extension installations**: Pins to releases from the registry, which copy the extension's schema and tag families into the repo.
- **README and agent guidance**: A Markdown README (`forge repo-readme`) that explains what the repo holds and how changes land, plus `AGENTS.md` files and agent skills (`forge agent-instructions` and `forge agent-skills`) that tell an agent how to work in the repo. Each extension the repo defines or installs can carry its own instructions and skills too, all versioned like the rest of the repo. A repo also has an unversioned one-line `description` (up to 280 characters), set on `create-repo` or `update-repo`.

### Archived repos

Someone with `update` on a repo, such as an org owner, archives it when the team no longer works in it. An archived repo keeps all of its data and history and answers every read, but it takes no writes: commits, branches, records, schema, and installations all fail with `RepoArchived`. It also runs none of its extensions' tools, including its schedules. A workflow run writes to its repo until it ends, so nobody can archive a repo while any of its runs is queued, running, or waiting: the archive fails with `RepoWorkflowRunsActive` until the runs end or a member terminates them. The repo records who archived it and when, as `archived_by_id` and `archived_at`. Unarchiving the repo, which takes `update` on it too, makes it writable again and clears both.

An archived repo drops out of `forge repos list-repos`, which lists archived repos instead when passed `--archived`. Extensions that the repo publishes keep their names, and repos that installed one of their releases keep running and updating it, but no other repo can install one of them until the repo is unarchived.

```sh
forge repos update-repo --repo "$REPO" --data '{"archived":true}'
forge repos list-repos --org "$ORG" --archived
forge repos update-repo --repo "$REPO" --data '{"archived":false}'
```

## The registry

The registry is the org-wide catalog of published extension versions. Any member of the org can browse the registry's releases and inspect them, even if that user can't read the repo that published the extension.

Every entry in the registry follows semantic versioning and is permanent:

- Every commit that changes an extension adds a version to the registry, along with its build and its catalog of custom models, tag families, CI checks, tools, schedules, triggers, webhooks, workflows, providers, requirements, and whether it has a UI.
- A commit to `main` that raises the extension's version above its latest release adds a release, `MAJOR.MINOR.PATCH`, which any repo in the org can install (unless the extension declares `kind: "service"`, which runs only in the repo that defines it). Each release must be strictly higher than the extension's latest release.
- Every other commit adds a prerelease, `MAJOR.MINOR.PATCH-pre.<commit>`, which only the repo that defines the extension runs. The registry lists only releases to other repos, and `forge registry get-extension-version` refuses a prerelease.
- Every extension publishes under its qualified name, `<repo slug>.<name>` (such as `acme-standards.procurement`), so two repos in the org can publish extensions with the same local name. The registry keeps each qualified name for the repo that first published it, including a prerelease, and refuses another repo's publication under that name with `ExtensionNameTaken`.

Source: https://buildrforge.com/docs/introduction/index.mdx
