Mas lets the clients of a site edit its content (texts, images, articles) from the Mas dashboard, without access to the code or the server. The site stays yours: Mas never touches its design, it only writes data the site reads.
A repository opts in with mas.cms.json at its root. It declares what can be edited:
- pages: fixed content, one JSON file each (
content/home.json): titles, texts, images, lists; - collections: entries the client adds and deletes (articles, news, projects, recipes…), stored in the repository or in a Supabase table.
Mas reads mas.cms.json from the deployed branch on every edit (never from the browser), builds the
forms from it, checks every value against it, and writes only what it declares.
{
"$schema": "https://raw.githubusercontent.com/SyanCode/Mas/main/schema/mas.cms.schema.json",
"pages": [{
"id": "home", "label": "Home page", "file": "content/home.json",
"fields": [
{ "key": "title", "type": "text", "label": "Title", "max": 80, "required": true },
{ "key": "intro", "type": "markdown" },
{ "key": "hero", "type": "image", "dir": "public/uploads", "url": "/uploads" }
]
}],
"collections": [{
"id": "articles", "label": "Articles", "item_label": "Article", "dir": "content/articles",
"fields": [
{ "key": "title", "type": "text", "max": 120 },
{ "key": "date", "type": "date", "required": true },
{ "key": "cover", "type": "image", "dir": "public/uploads", "url": "/uploads" },
{ "key": "excerpt", "type": "textarea", "max": 300 },
{ "key": "body", "type": "markdown" }
]
}]
}With content/home.json and content/articles/index.json (holding []) committed, the site is
Mas compatible: the repository gets the badge in Apps → New app, and once the app is deployed
an administrator gives the client access from the CMS card of the app.
The $schema line is optional: it gives completion and checks in VS Code and other editors.
| Key | Type | |
|---|---|---|
pages |
list of pages, at most 50 | |
collections |
list of collections, at most 20 | |
$schema |
string | ignored by Mas |
At least one page or one collection. ids are unique across pages and collections.
{ "id": "home", "label": "Home page", "description": "Shown above the form", "file": "content/home.json",
"fields": [ … ] }| Key | Required | |
|---|---|---|
id |
yes | letters, digits, _ and -, starts with a letter or _ |
file |
yes | .json file in the repository, relative path |
fields |
yes | 1 to 100 fields |
label |
name shown to the client (default: the id) | |
description |
text shown above the form |
The file holds one JSON object. Mas only changes the keys of the declared fields: other keys are kept as they are, so the file can hold things the client must not edit. A missing file is created on the first save.
{ "id": "articles", "label": "Articles", "item_label": "Article", "dir": "content/articles",
"fields": [ … ] }| Key | Default | |
|---|---|---|
id |
required | as for pages |
fields |
required | 1 to 100 fields; slug is reserved |
storage |
"git" |
"git" (files in the repository) or "supabase" (a table) |
dir |
required with git |
folder of the entries |
table |
the id (- → _) |
table name with supabase: a-z, 0-9, _ |
label |
the id | name in the menu |
item_label |
"Entry" |
name of one entry (“+ Add article”) |
description |
text above the list | |
title_field |
first text field |
names each entry, gives its address; always required |
sort_field |
first date field |
the list is newest first on it (a date, number or text field) |
index_fields |
every field but markdown |
what the list contains (git: index.json) |
max_entries |
1000 | at most 1000 |
drafts |
false |
entries get a status: published, draft or scheduled (below); git storage only |
Each entry has a slug: its address, made from the title (Été à Paris ! → ete-a-paris,
ete-a-paris-2 when taken) or typed by the client when creating it (a-z, 0-9, dashes, 80
characters at most). It never changes afterwards, so links keep working.
Every change is one commit on the deployed branch, which redeploys the site. Mas writes:
<dir>/<slug>.json: the entry,{ "slug": "ete-a-paris", "title": "…", "body": "…", … };<dir>/index.json: every entry, newest first, withslugand theindex_fields(no markdown body), rewritten in the same commit.
dir holds only the entries of this collection (no page file, no other collection inside). Commit
<dir>/index.json holding [] at the start, so the site builds before the first entry. Entries
added by hand in the folder show up in the CMS and enter index.json at the next publication.
Reading them, at build time:
// Next.js (app router), Astro, Vite…
import articles from "@/content/articles/index.json"; // [{ slug, title, date, cover, excerpt }, …]
const latest = articles.slice(0, 3); // home page section
// app/blog/[slug]/page.tsx
export const generateStaticParams = () => articles.map((a) => ({ slug: a.slug }));
const article = (await import(`@/content/articles/${slug}.json`)).default;<?php
$articles = json_decode(file_get_contents(__DIR__ . "/content/articles/index.json"), true);
$article = json_decode(file_get_contents(__DIR__ . "/content/articles/" . basename($_GET["slug"]) . ".json"), true);A plain static site can fetch("/content/articles/index.json") when that folder is served.
With "drafts": true, the back-office lets the client save an entry as a draft, publish it, or
schedule it for a date. Mas stores status (and publish_at, UTC, for scheduled entries) in the
entry file and in index.json. Your site shows an entry only when its status is "published"
(entries written before drafts were enabled have no status: treat them as published):
const visible = articles.filter((a) => (a.status ?? "published") === "published");A scheduled entry is published by Mas at its date (a commit, so a redeploy): the site must rebuild
on push, as for every other change. Drafts are not available for storage: "supabase" (rows are
online at once).
The collection is a table of a Supabase project: a publication is online at once (no commit, no rebuild), and the site can filter, paginate and search.
- Which project: the one in the app's environment (
SUPABASE_URLandSUPABASE_SERVICE_ROLE_KEY, added by Connect Supabase or set by hand for supabase.com), otherwise the Supabase deployed by Mas on the server. The service_role key stays in Mas. - The table:
slug(primary key), one column per field,created_at,updated_at. Column types:textfor text-like fields and images,date,double precision(orbigintwithinteger),boolean,jsonbfor lists. Row level security: anyone may read, only Mas writes. The CMS card shows the SQL; for the Supabase of the server, Create the table runs it. Run it again after adding fields: it adds the missing columns. - Field keys are column names: lowercase letters, digits and
_; notcreated_atorupdated_at. - Images go to the public Storage bucket
mas-cms, under<collection id>/; fields keep their full public URL (dirandurlof image fields are ignored).
Reading it with the anon key, at request time (or with revalidation):
import { createClient } from "@supabase/supabase-js";
const supabase = createClient(process.env.NEXT_PUBLIC_SUPABASE_URL, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY);
const { data: latest } = await supabase.from("articles")
.select("slug, title, date, cover, excerpt").order("date", { ascending: false }).limit(3);
const { data: article } = await supabase.from("articles").select("*").eq("slug", slug).single();{ "key": "title", "type": "text", "label": "Title", "help": "Shown in the browser tab",
"placeholder": "My site", "required": true, "max": 80 }Every field takes key (required, unique in its page: letters, digits, _, -), type (default
text), label (default: the key), help, placeholder and required.
| Type | Stored as | Options | Accepted values |
|---|---|---|---|
text |
string | min, max (default 200) |
one line |
textarea |
string | min, max (default 2000) |
several lines |
markdown |
string | min, max (default 20000) |
markdown; render it with your own library |
number |
number or null |
min, max, integer |
|
boolean |
true / false |
||
select |
string | options: ["a", "b"] or [{ "value": "a", "label": "A" }], or options_from (below) |
one of the values |
url |
string | https://…, http://…, /page, #anchor, mailto:, tel: |
|
email |
string | an email address | |
date |
string | YYYY-MM-DD |
|
color |
string | #rrggbb |
|
image |
string (URL) | dir, url, max_kb |
an uploaded image |
list |
array of objects | fields, min_items, max_items (default 50, at most 200), item_label |
An empty field is stored as "", null (number), false (boolean) or [] (list). In a list,
an optional key the client never filled stays absent, so the site may test for it. Lists hold
objects of the other types: no list inside a list, and nested objects are not editable.
Control characters are refused.
A select can take its choices from a list of a page, so the client adds a category without
touching mas.cms.json:
{ "id": "categories", "label": "Categories", "file": "content/categories.json", "fields": [
{ "key": "items", "type": "list", "item_label": "Category", "fields": [
{ "key": "value", "type": "text", "label": "Identifier", "required": true },
{ "key": "label", "type": "text", "label": "Name shown" } ] } ] }{ "key": "category", "type": "select", "required": true,
"options_from": { "page": "categories", "list": "items", "value": "value", "label": "label" } }Mas reads the page on the published branch: a category saved there is offered at once. options
can stay as a fallback, used while the list is empty. The site reads content/categories.json
for the names.
dir is the folder of the repository where Mas commits uploads, url the same folder as the
deployed site serves it. The value saved is url + / + a fresh file name (photo-3fa9c2.webp).
| Site | dir |
url |
|---|---|---|
Next.js, Vite, Astro, Nuxt (served from public/) |
public/uploads (default) |
/uploads (default) |
| static or PHP site served from the root | uploads |
/uploads |
static site served from site/ |
site/uploads |
/uploads |
PNG, JPEG, GIF, WebP and AVIF are accepted, checked by their content (no SVG: it can carry
scripts); max_kb defaults to 2048 (at most 8192). The dashboard shrinks big photos before sending
them. An image path already in the file stays accepted; the client cannot type an arbitrary path.
- paths outside the repository, absolute paths,
..,.git/,.github/,mas.cms.jsonitself; - content files that are not
.json; unknown field types; duplicate ids, keys or files; - values that do not fit the field (length, type, choices, links other than the ones above);
- a save made on an old version: when the file (or row) changed since the client opened it, the client is asked to reload instead of overwriting.
A wrong mas.cms.json shows its error in the CMS card of the app and as invalid mas.cms.json
in the repository list; the client sees nothing until it is fixed.
- Every text or image the client should change comes from a JSON file (pages) or a collection, not from the components. Keep layout, styles and code-only settings out of these files.
- One page per screen or shared block (
content/home.json,content/contact.json,content/footer.json), keys incamelCaseorsnake_case, values the site renders directly. - Repeated blocks (services, team, FAQ) are
listfields; articles and anything with its own page are collections. - Images in the folder the site serves (
public/uploadsfor most frameworks). mas.cms.jsonat the root with$schema; commit the JSON files with today's content, andindex.jsonholding[]for each git collection.- The site builds (git storage) or queries Supabase (supabase storage) with these files only.
Mas can also write mas.cms.json for you: the CMS card of an app lists the JSON files of the
repository and guesses the fields of the ones you pick.
The Mas repository is a Claude Code plugin marketplace. Install the plugin once:
/plugin marketplace add SyanCode/Mas
/plugin install mas-cms@mas
Then, in the project of a site, ask:
Rends ce site compatible Mas
or /mas-cms:make-compatible. Claude moves the editable content into JSON files, writes
mas.cms.json following this reference, wires the site to read them and checks the result. Add
what you want in plain words: “avec un blog stocké dans Supabase”, “les 3 derniers articles sur
l'accueil”.
Without the plugin, one line is enough:
Read https://raw.githubusercontent.com/SyanCode/Mas/main/docs/cms.md and make this site Mas compatible.
Clients (and administrators) open /cms on the Mas dashboard. It is a classic admin: a sidebar with the site's collections and pages, and
- a dashboard: visits (page views, visitors) of the last 7 days, an entries summary per collection, recent activity and the next scheduled publication;
- collections as searchable, sortable lists with status filters and quick publish / unpublish / delete actions; a two-column editor with a Publish box (status, date, address, note) and a Markdown preview;
- a media library of the images in the folders of the
imagefields: upload, search, copy the path, delete (refused while a page or entry uses the image); - statistics (from the nginx logs, no cookie), with a dotted world map of visitors by country (an administrator enables it once: Mas downloads the free DB-IP Country Lite file, and keeps only a country code per visitor, never an address; "IP Geolocation by DB-IP", CC BY 4.0), a history of who changed what, and for administrators the users (editors, the sites they can change, password and 2FA resets).
Add one line to the site and Mas counts what visitors click, still without cookie or stored address:
<script defer src="https://your-mas-domain/t.js"></script>
<a href="/reservation" data-mas-goal="book">Book a table</a> <!-- a click is a goal -->
<form action="/contact" data-mas-goal="contact">…</form> <!-- a submit is a goal -->tel: and mailto: links count on their own (tel, mailto); mas("name") sends a goal from
your own script. The statistics show, per goal, the clicks, the visitors who did it and the
conversion rate (visitors who reached the goal ÷ visitors). The visitor is the same anonymous
daily hash the access logs use, so no cookie is needed; Do Not Track is respected. Needs the Mas
dashboard to be reachable from your visitors' browsers (it receives POST /t/e).
Cookie banner in the sidebar configures a consent pop-up (position, theme, accent colour, texts, which cookie categories the site uses, link to the privacy policy, how long a choice is kept) with a live preview. The site adds one line:
<script defer src="https://your-mas-domain/cookies.js"></script>-
Equal choices: Reject all and Accept all have the same weight; Customize opens one switch per category. Texts are built in for fr, en, es and de (the page's
lang). -
Hold back what sets cookies until the visitor agrees; the banner starts it on consent:
<script type="text/plain" data-mas-consent="analytics" src="https://…"></script> <iframe data-mas-consent="marketing" data-src="https://www.youtube.com/embed/…"></iframe>
Categories:
analytics,marketing,preferences. -
In your code:
masConsent.has("analytics"),masConsent.on(fn), themas:consentevent;masConsent.open()or any element withdata-mas-cookie-settingsreopens the choices. Google Consent Mode is updated automatically whengtagexists. -
Where the choice lives: a
mas_consentcookie on the site itself. Mas only counts the decisions per day (accepted, rejected, customized): no identifier, no address.
Mas's own conversion script and visit statistics use no cookie and need no banner; the banner is for the cookies of the other tools the site loads. It is a technical tool: the legal text (and whether your use needs consent) stays yours.
Compliance in the sidebar shows a GDPR / ePrivacy audit of the live site, run by Mas after every publication (so after every CMS change) and again every week, since third-party services can change without a release. It reads the public pages like a visitor and reports, each with a fix:
- trackers and embeds (Google Analytics / Tag Manager, Meta Pixel, ads, YouTube, Maps, Google Fonts…) that load before consent, and tracking cookies set on the first visit;
- the consent banner: present (Mas or a known CMP), not switched off, linked to a privacy policy;
- legal pages: privacy policy and legal notice (mentions légales / Impressum) linked and reachable, with their usual content (controller, purposes, retention, rights, authority; publisher, registration number, host); terms of sale for shops;
- forms that collect personal data without information, or over
http://; - HTTPS, redirect, HSTS and basic security headers.
With Chrome or Chromium on the server and pip install mas[browser] (set MAS_CHROMIUM if it is
in an unusual place), the audit also opens the site in a real browser: it records every request and
cookie before any click (a tracker added by JavaScript shows up), then visits again and clicks the
banner's reject button to check that nothing that needs consent starts. The same visit measures
basic accessibility (images without alternative text, unnamed fields, links and buttons, missing
title, blocked zoom, low contrast, headings) and speed (main content time, layout shifts, page
weight). Without a browser the HTML audit alone runs.
After a publication the result also appears on GitHub as a check on the commit (Mas compliance:
score, what is new, the points to fix). It needs the GitHub App's optional Checks: write
permission; without it nothing is posted and the audit is unaffected. Claude agents connected to
Mas (MCP) can read the audit with compliance_report, start one with run_compliance_audit, and
read site_stats and site_uptime.
The score (100 minus 20 per blocking issue, 6 per point to improve) and what is new since the previous audit are shown, with the score over time. A clean audit means nothing visible is wrong, not that the site is legal: how data is handled behind the site (register of processing, contracts with processors, retention, rights requests, breach procedure) stays on a checklist for a human. Mas does not give legal advice.
Backups (administrators) makes a zip of one site: its content files (mas.cms.json, pages,
entries of the collections kept in the repository, the media folders) and what Mas keeps about it
(daily statistics, goals, cookie proofs and banner versions, compliance audits, uptime, the settings
of the banner, goals, status page, redirects). Not in a backup: notification secrets (sealed with the
server's key), visitor hashes and the list of CMS commits. Backups stay on the server
(cms-backups/<site>/), can be downloaded and uploaded again (a backup restores into the site it
came from only), and a switch makes one every day (the 14 latest automatic ones are kept).
A restore asks what to put back (content and media, statistics and settings). The site as it is now is saved first, so a restore can be undone. Content comes back in one commit of files that differ from the repository; files created since are kept, and only paths the CMS itself writes are accepted.
Three roles: administrator, editor (writes and publishes the sites they were given) and
author (writes drafts only: cannot publish, schedule, edit what is online, delete, undo a
change, or touch the cookie banner, goals, legal pages and audits; collections need "drafts": true
for an author to write in them). The role is chosen when creating an account or an invitation, and
an administrator can change it later from the users list.
Search engines in the sidebar has two parts.
- A look at the live site: Mas reads the home page and a few pages of the sitemap and reports,
each with a fix: titles and descriptions (missing, too short or long, duplicated), headings, page
language, viewport, images without alt text, canonical address,
noindex, social preview, arobots.txtthat blocks everything, a missing sitemap,http://not redirecting tohttps://. The Google-style snippet of each page is shown. For titles and descriptions that are missing, too short or too long, Mas suggests wording taken from the page itself (first paragraph, heading), with a copy button. - Optimize (administrators): Fix with Mas / Optimize now turns on a
robots.txtand asitemap.xmlin one step: the pages found on the live site are listed, collection entries are added by a pattern Mas guesses from the site's own links (/blog/{slug}), arobots.txtthat blocks everything is replaced, and the sitemap is announced inrobots.txt. The look runs again after. - While writing an entry, a Search engines box shows the Google-style preview, a score and checks
(title and description length, 300 words, subheadings, short address, an optional focus keyword in
the title, description and first 100 words) and writes the description from the text on request.
It finds the description field by its name (
description,excerpt,summary,intro…). - What Mas writes for the site (administrators; apps Mas deploys, with a domain): redirects
(
/oldto/newor to a full address, 301 or 302;/blog/*moves a whole section), a robots.txt (replaces the repository's file; default text points to the sitemap) and a sitemap.xml (listed pages, plus one address per published entry of the collections you give a pattern like/blog/{slug}; rewritten every 15 minutes). Paths are checked against a narrow alphabet before they reach nginx; ifnginx -trefuses the result, the previous settings are kept.
An entry has a Copy a preview link button: a signed link, valid 7 days, that shows the entry
(draft included) to someone without an account, as plain content (not the site's design). Links are
noindex, and an administrator can revoke every link of a site at once. The command palette (⌘K)
searches the words inside the pages and entries of the site, not only the titles (the first 150
entries of each collection are read and kept for ten minutes).
Images of Supabase collections live in Supabase Storage and are not part of the media library.