docs(agent): meta.agent Anleitungen plus Design-Guide für freie Blöcke
deploy to production / deploy (push) Successful in 43s
deploy to production / deploy (push) Successful in 43s
Ohne Repo verständlich: Routen, Lookup-Pfade, Upload-Format src/path, translationKey-Falle, SSR-Cache, Tailwind/Svelte-Regeln.
This commit is contained in:
@@ -7,6 +7,13 @@ meta:
|
|||||||
muiIcon: chat
|
muiIcon: chat
|
||||||
group: community
|
group: community
|
||||||
imageUrl: "https://images.unsplash.com/photo-1522096823084-2d1aa8411c13?auto=format&fit=crop&q=80&w=800"
|
imageUrl: "https://images.unsplash.com/photo-1522096823084-2d1aa8411c13?auto=format&fit=crop&q=80&w=800"
|
||||||
|
agent:
|
||||||
|
purpose: "Page comments counted via aggregate and listed per contentId."
|
||||||
|
instructions: "Required: contentId (content.id), author, message. App loads aggregate commentCount plus list {active:true, contentId}. Only active:true is public."
|
||||||
|
fieldHints:
|
||||||
|
contentId: "content.id the comment belongs to"
|
||||||
|
examples: [{ author: "Demo", message: "Nice page", active: true }]
|
||||||
|
hints: ["mutations invalidate SSR via clear_cache hooks"]
|
||||||
preview:
|
preview:
|
||||||
label: author
|
label: author
|
||||||
secondary: message
|
secondary: message
|
||||||
|
|||||||
@@ -30,6 +30,16 @@ meta:
|
|||||||
- group: seo
|
- group: seo
|
||||||
label: { de: "SEO", en: "SEO" }
|
label: { de: "SEO", en: "SEO" }
|
||||||
viewHint: cards
|
viewHint: cards
|
||||||
|
agent:
|
||||||
|
purpose: "CMS pages rendered by App.svelte + BlockRenderer (hero, features, richtext, accordion, contact-form)."
|
||||||
|
instructions: "Required: name, path, lang. Always set translationKey (unique per lang, avoids null/de collision) and active:true for public. path pattern ^/[a-z0-9-/]*$. Blocks: hero needs headline + heroImage.image (medialib ID); richtext needs text + imagePosition none/left/right + image (medialib ID, only shown when lookup resolves file.src); features needs featureBoxes[{icon,title,text}] with icon in lightning/palette/database/globe/monitor/flask; accordion needs accordionItems[{question,answer,open}]; contact-form needs headline + anchorId. Always request lookup blocks.heroImage.image:medialib,blocks.image:medialib."
|
||||||
|
fieldHints:
|
||||||
|
path: "lowercase, e.g. /ueber-uns; stored without language prefix"
|
||||||
|
translationKey: "required, e.g. home/ueber-uns/kontakt; unique per lang"
|
||||||
|
blocks: "type selects visible fields via dependsOn $parent.type"
|
||||||
|
examples: [{ name: "Startseite", path: "/", lang: "de", translationKey: "home", active: true }]
|
||||||
|
workflows: ["filter before create (path+lang) to stay idempotent; 409 means exists", "after PUT/DELETE verify /de and /api/content?lookup; SSR invalidates via clear_cache hooks"]
|
||||||
|
hints: ["richtext image only renders when _lookup.image.file.src exists", "hero fallback is gradient when no image"]
|
||||||
|
|
||||||
hooks:
|
hooks:
|
||||||
get:
|
get:
|
||||||
|
|||||||
@@ -40,6 +40,14 @@ meta:
|
|||||||
muiIcon: file_document
|
muiIcon: file_document
|
||||||
filter:
|
filter:
|
||||||
file.type_like: ^(?!image/|video/|audio/).+
|
file.type_like: ^(?!image/|video/|audio/).+
|
||||||
|
agent:
|
||||||
|
purpose: "Reusable uploads referenced via foreignMedia (blocks.heroImage.image, blocks.image)."
|
||||||
|
instructions: "Upload file as object {src:'data:<mime>;base64,...', path:'name.jpg'} (path optional). Stored as {src:'<field>/name.jpg', path, type}. Never {filename,data}, never file as plain string. Public read URL: /api/medialib/<entryId>/<src> plus ?filter=l-webp for raster images. downscale max 2048px applies on upload."
|
||||||
|
fieldHints:
|
||||||
|
file: "required, widget file, max 50MB"
|
||||||
|
alt: "object {de,en}, used by MedialibImage for accessibility"
|
||||||
|
examples: [{ title: "Demo Hero 1200", file: { src: "data:image/jpeg;base64,...", path: "demo-hero-1200.jpg" } }]
|
||||||
|
hints: ["list with select excluding file.data to avoid context bloat", "verify file.src starts with <field>/ after create"]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -49,6 +49,14 @@ meta:
|
|||||||
sidebar:
|
sidebar:
|
||||||
- group: settings
|
- group: settings
|
||||||
label: { de: "Einstellungen", en: "Settings" }
|
label: { de: "Einstellungen", en: "Settings" }
|
||||||
|
agent:
|
||||||
|
purpose: "Header/footer trees per language, rendered by App.svelte from elements."
|
||||||
|
instructions: "Singletons: type header/footer x language de/en (unique type+language). elements: {name, page->content.id} internal, {name, external:true, externalUrl} external, optional hash without #. Always request lookup elements.page:content; href = localizedPath(_lookup.page.path) + hash."
|
||||||
|
fieldHints:
|
||||||
|
type: "header or footer"
|
||||||
|
language: "de or en"
|
||||||
|
examples: [{ language: "de", type: "header", elements: [{ name: "Start", page: "<content.id>" }] }]
|
||||||
|
hints: ["page holds content.id, resolve via _lookup.page.path", "never hardcode /de prefix in DB"]
|
||||||
|
|
||||||
hooks:
|
hooks:
|
||||||
get:
|
get:
|
||||||
|
|||||||
@@ -50,6 +50,11 @@ meta:
|
|||||||
return 'background:' + raw + ';color:' + text + ';border:1px solid ' + border
|
return 'background:' + raw + ';color:' + text + ';border:1px solid ' + border
|
||||||
})()
|
})()
|
||||||
//!js
|
//!js
|
||||||
|
agent:
|
||||||
|
purpose: "Managed keywords referenced by medialib.tags."
|
||||||
|
instructions: "No public filter hook by design (no active field); keep names short, group system/kategorie. Mutations invalidate SSR via clear_cache hooks."
|
||||||
|
examples: [{ name: "hero", group: "system" }]
|
||||||
|
hints: ["name is unique"]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
namespace: __TIBI_NAMESPACE__
|
namespace: __TIBI_NAMESPACE__
|
||||||
|
|
||||||
meta:
|
meta:
|
||||||
|
agent:
|
||||||
|
description: "Tibi Svelte starter: Svelte 5 SPA with pagebuilder blocks, goja SSR, per-language navigation."
|
||||||
|
frontend:
|
||||||
|
routes: "/:lang/* (e.g. /de/, /de/ueber-uns); / redirects to browser language; content.path stored without language prefix"
|
||||||
|
lookup: "content: blocks.heroImage.image:medialib, blocks.image:medialib; navigation: elements.page:content; comments via aggregate on comment.contentId"
|
||||||
|
rendering: "App.svelte loads getCachedEntries(content, {lang, path, active:true} + lookup); BlockRenderer maps Hero/Features/Richtext/Accordion/ContactForm; images only via widgets/MedialibImage.svelte"
|
||||||
|
designGuide: "Future free code/HTML blocks: add block type in content.blocks (type + fields with dependsOn $parent.type), Svelte component in frontend/src/blocks/ + case in BlockRenderer.svelte, keep admin preview contract; Svelte 5 runes ($props/$state/$derived, never destructure block), SSR-safe (window guards), MedialibImage is the only image boundary (file.src or data URI, no ?filter on data URIs), Tailwind v4 canonical (bg-linear-to-*, aspect-video/square else arbitrary, trailing ! e.g. bg-brand-600!), i18n via svelte-i18n ($_), always pass foreignMedia lookup explicitly"
|
||||||
|
workflows: ["Create page (name, path, lang, translationKey, active:true) -> fill blocks -> link navigation -> verify /de plus /api/content?lookup -> respect SSR cache (POST creates, PUT/DELETE invalidate via clear_cache hooks)", "Upload image (medialib file {src:data URI, path}) -> put ID into heroImage.image or blocks.image -> verify with lookup (file.src must be <field>/<name>)"]
|
||||||
|
hints: ["Public reads need active:true plus publication window (filter_public)", "path pattern ^/[a-z0-9-/]*$ (lowercase, no umlauts)", "translationKey+lang and path+lang are unique: always set translationKey, else second doc collides on null/de", "File upload: {src:'data:<mime>;base64,...', path:'n.jpg'} (path optional); stored {src:'<field>/n.jpg', type}; never {filename,data}, never file as plain string", "Reads with select/projection excluding file.data (else context bloat); file.src is enough", "SSR cache lives in ssr collection with dependencies content:<id>/content:*/medialib:*/navigation:*/comment:*; after manual MCP writes use ssr?clear=1 if needed"]
|
||||||
imageUrl:
|
imageUrl:
|
||||||
eval: "$projectBase + '_/assets/img/admin-pic.svg'"
|
eval: "$projectBase + '_/assets/img/admin-pic.svg'"
|
||||||
i18n:
|
i18n:
|
||||||
|
|||||||
Reference in New Issue
Block a user