From 4f6b20b5844ebe83ea52dff7c329b1dfb8ef677c Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 20 Feb 2026 23:46:50 +0000 Subject: [PATCH] added base configuration for support uniform.dev at cursor marketplace. it will be good if uniform publish it to Cursor. but probably repo should be other it for sent to cursor validation --- .../.cursor-plugin/marketplace.json | 25 ++ cursor-marketplace/README.md | 63 +++++ .../.cursor-plugin/plugin.json | 11 + .../enterprise-toolkit/.mcp.json | 9 + .../enterprise-toolkit/README.md | 22 ++ .../agents/compliance-checker.md | 15 ++ .../agents/security-reviewer.md | 17 ++ .../enterprise-toolkit/assets/logo.svg | 19 ++ .../commands/run-compliance-scan.md | 27 ++ .../enterprise-toolkit/hooks/hooks.json | 21 ++ .../enterprise-toolkit/rules/code-style.mdc | 13 + .../rules/security-standards.mdc | 16 ++ .../enterprise-toolkit/scripts/audit.sh | 4 + .../enterprise-toolkit/scripts/format-code.py | 11 + .../scripts/validate-shell.sh | 4 + .../skills/compliance-check/SKILL.md | 21 ++ .../skills/security-review/SKILL.md | 25 ++ .../uniform-rules/.cursor-plugin/plugin.json | 9 + cursor-marketplace/uniform-rules/README.md | 16 ++ .../rules/solution-architecture.mdc | 44 ++++ .../uniform-rules/rules/uniform-mesh.mdc | 31 +++ .../rules/uniform-next-app-router.mdc | 32 +++ .../rules/uniform-next-page-router.mdc | 25 ++ .../uniform-rules/rules/uniform-sdk.mdc | 107 ++++++++ .../uniform-rules/rules/uniform-sveltekit.mdc | 76 ++++++ .../uniform-rules/rules/uniform.mdc | 242 ++++++++++++++++++ 26 files changed, 905 insertions(+) create mode 100644 cursor-marketplace/.cursor-plugin/marketplace.json create mode 100644 cursor-marketplace/README.md create mode 100644 cursor-marketplace/enterprise-toolkit/.cursor-plugin/plugin.json create mode 100644 cursor-marketplace/enterprise-toolkit/.mcp.json create mode 100644 cursor-marketplace/enterprise-toolkit/README.md create mode 100644 cursor-marketplace/enterprise-toolkit/agents/compliance-checker.md create mode 100644 cursor-marketplace/enterprise-toolkit/agents/security-reviewer.md create mode 100644 cursor-marketplace/enterprise-toolkit/assets/logo.svg create mode 100644 cursor-marketplace/enterprise-toolkit/commands/run-compliance-scan.md create mode 100644 cursor-marketplace/enterprise-toolkit/hooks/hooks.json create mode 100644 cursor-marketplace/enterprise-toolkit/rules/code-style.mdc create mode 100644 cursor-marketplace/enterprise-toolkit/rules/security-standards.mdc create mode 100644 cursor-marketplace/enterprise-toolkit/scripts/audit.sh create mode 100644 cursor-marketplace/enterprise-toolkit/scripts/format-code.py create mode 100644 cursor-marketplace/enterprise-toolkit/scripts/validate-shell.sh create mode 100644 cursor-marketplace/enterprise-toolkit/skills/compliance-check/SKILL.md create mode 100644 cursor-marketplace/enterprise-toolkit/skills/security-review/SKILL.md create mode 100644 cursor-marketplace/uniform-rules/.cursor-plugin/plugin.json create mode 100644 cursor-marketplace/uniform-rules/README.md create mode 100644 cursor-marketplace/uniform-rules/rules/solution-architecture.mdc create mode 100644 cursor-marketplace/uniform-rules/rules/uniform-mesh.mdc create mode 100644 cursor-marketplace/uniform-rules/rules/uniform-next-app-router.mdc create mode 100644 cursor-marketplace/uniform-rules/rules/uniform-next-page-router.mdc create mode 100644 cursor-marketplace/uniform-rules/rules/uniform-sdk.mdc create mode 100644 cursor-marketplace/uniform-rules/rules/uniform-sveltekit.mdc create mode 100644 cursor-marketplace/uniform-rules/rules/uniform.mdc diff --git a/cursor-marketplace/.cursor-plugin/marketplace.json b/cursor-marketplace/.cursor-plugin/marketplace.json new file mode 100644 index 0000000..b0f0792 --- /dev/null +++ b/cursor-marketplace/.cursor-plugin/marketplace.json @@ -0,0 +1,25 @@ +{ + "name": "uniform.dev", + "owner": { + "name": "Uniform.dev", + "email": "plugins@example.com" + }, + "metadata": { + "description": "Uniform.dev", + "version": "1.0.0" + }, + "plugins": [ + { + "name": "uniform-rules", + "source": "uniform-rules", + "description": "Uniform CMS rules for AI-assisted development (compositions, components, patterns, SDK, mesh)", + "keywords": ["uniform", "cms", "headless", "canvas", "sveltekit", "next"] + }, + { + "name": "enterprise-toolkit", + "source": "enterprise-toolkit", + "description": "Enterprise development toolkit with security, compliance, and automation", + "keywords": ["enterprise", "security", "compliance", "code-review"] + } + ] +} diff --git a/cursor-marketplace/README.md b/cursor-marketplace/README.md new file mode 100644 index 0000000..e3e2281 --- /dev/null +++ b/cursor-marketplace/README.md @@ -0,0 +1,63 @@ +# Cursor Marketplace – AI Rules + +This repository is a **Cursor marketplace**: a multi-plugin repo that can be submitted to the Cursor marketplace so others can install the plugins. + +## Structure + +``` +cursor-marketplace/ +├── .cursor-plugin/ +│ └── marketplace.json # Marketplace manifest (lists plugins) +├── uniform-rules/ # Plugin: Uniform CMS rules +│ ├── .cursor-plugin/ +│ │ └── plugin.json +│ ├── rules/ +│ │ ├── uniform.mdc +│ │ ├── uniform-sdk.mdc +│ │ ├── uniform-sveltekit.mdc +│ │ ├── uniform-next-app-router.mdc +│ │ ├── uniform-next-page-router.mdc +│ │ └── uniform-mesh.mdc +│ └── README.md +├── enterprise-toolkit/ # Plugin: Security, compliance, automation +│ ├── .cursor-plugin/ +│ │ └── plugin.json +│ ├── rules/ +│ ├── skills/ +│ ├── agents/ +│ ├── commands/ +│ ├── hooks/ +│ ├── .mcp.json +│ ├── assets/ +│ ├── scripts/ +│ └── README.md +└── README.md +``` + +## Plugins + +| Plugin | Description | +|---------------------|-------------| +| **uniform-rules** | Uniform CMS rules for compositions, components, patterns, SDK, SvelteKit, Next.js, Mesh. | +| **enterprise-toolkit** | Rules, skills, agents, commands, hooks, and optional MCP for security, compliance, and automation. | + +## Submitting to the Cursor marketplace + +1. Push this repo (or the `cursor-marketplace` folder as its own repo) to a **public** Git host. +2. Go to [cursor.com/marketplace/publish](https://cursor.com/marketplace/publish) and submit the repository URL. +3. Ensure: + - Each plugin has a valid `.cursor-plugin/plugin.json` with a unique `name` (lowercase, kebab-case). + - All rules/skills/agents/commands have proper frontmatter. + - Paths in manifests are relative and valid. + - You have tested the plugins locally. + +## Local use + +To use as a local marketplace or single plugin: + +- **Multi-plugin**: Point Cursor at the root of `cursor-marketplace` (where `.cursor-plugin/marketplace.json` lives). +- **Single plugin**: Point Cursor at `cursor-marketplace/uniform-rules` or `cursor-marketplace/enterprise-toolkit`. + +## License + +See repository license. Plugin manifests may specify their own license. diff --git a/cursor-marketplace/enterprise-toolkit/.cursor-plugin/plugin.json b/cursor-marketplace/enterprise-toolkit/.cursor-plugin/plugin.json new file mode 100644 index 0000000..803e063 --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/.cursor-plugin/plugin.json @@ -0,0 +1,11 @@ +{ + "name": "enterprise-toolkit", + "version": "1.0.0", + "description": "Enterprise development toolkit with security scanning, compliance checks, and automation", + "author": { + "name": "AI Rules", + "email": "plugins@example.com" + }, + "keywords": ["enterprise", "security", "compliance", "code-review"], + "logo": "assets/logo.svg" +} diff --git a/cursor-marketplace/enterprise-toolkit/.mcp.json b/cursor-marketplace/enterprise-toolkit/.mcp.json new file mode 100644 index 0000000..4c596b6 --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/.mcp.json @@ -0,0 +1,9 @@ +{ + "mcpServers": { + "filesystem": { + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", "."], + "env": {} + } + } +} diff --git a/cursor-marketplace/enterprise-toolkit/README.md b/cursor-marketplace/enterprise-toolkit/README.md new file mode 100644 index 0000000..5b82b89 --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/README.md @@ -0,0 +1,22 @@ +# Enterprise Toolkit + +Cursor plugin with security standards, compliance checks, and automation for enterprise development. + +## Contents + +- **Rules**: `security-standards.mdc`, `code-style.mdc` +- **Skills**: `compliance-check`, `security-review` +- **Agents**: `security-reviewer`, `compliance-checker` +- **Commands**: `run-compliance-scan` +- **Hooks**: afterFileEdit (format), beforeShellExecution (validate), sessionEnd (audit) +- **MCP**: Optional filesystem server (configure path in `.mcp.json`) + +## Configuration + +- Edit `hooks/hooks.json` to enable or disable hooks and matchers. +- Edit `.mcp.json` to add or change MCP servers (e.g. database, APIs). +- Replace placeholder scripts in `scripts/` with your formatters and validators. + +## Usage + +Install this plugin via the Cursor marketplace or from this repo. Rules and skills apply when the plugin is active. Use agents and commands from the Cursor UI as needed. diff --git a/cursor-marketplace/enterprise-toolkit/agents/compliance-checker.md b/cursor-marketplace/enterprise-toolkit/agents/compliance-checker.md new file mode 100644 index 0000000..72e5d9e --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/agents/compliance-checker.md @@ -0,0 +1,15 @@ +--- +name: compliance-checker +description: Runs compliance and policy checks on the codebase +--- + +# Compliance Checker + +You run compliance and policy checks. When asked: + +1. Summarize security-related findings (secrets, dependencies, obvious vulnerabilities) +2. Note licensing and policy documents (CONTRIBUTING, SECURITY, LICENSE) +3. Compare current state to any stated policies +4. Produce a short pass/warn/fail report with next steps + +Use the compliance-check skill when performing detailed audits. diff --git a/cursor-marketplace/enterprise-toolkit/agents/security-reviewer.md b/cursor-marketplace/enterprise-toolkit/agents/security-reviewer.md new file mode 100644 index 0000000..324d9f3 --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/agents/security-reviewer.md @@ -0,0 +1,17 @@ +--- +name: security-reviewer +description: Security-focused code reviewer that checks for vulnerabilities and proven approaches +--- + +# Security Reviewer + +You are a security-focused code reviewer. When reviewing code: + +1. Check for injection vulnerabilities (SQL, XSS, command injection) +2. Verify proper authentication and authorization +3. Look for sensitive data exposure (API keys, passwords, PII) +4. Ensure secure cryptographic practices +5. Review dependency security and known vulnerabilities +6. Check for proper input validation and sanitization + +Report findings with severity and concrete remediation. Prefer safe defaults. diff --git a/cursor-marketplace/enterprise-toolkit/assets/logo.svg b/cursor-marketplace/enterprise-toolkit/assets/logo.svg new file mode 100644 index 0000000..252a7b4 --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/assets/logo.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + diff --git a/cursor-marketplace/enterprise-toolkit/commands/run-compliance-scan.md b/cursor-marketplace/enterprise-toolkit/commands/run-compliance-scan.md new file mode 100644 index 0000000..0d91e5f --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/commands/run-compliance-scan.md @@ -0,0 +1,27 @@ +--- +name: run-compliance-scan +description: Run a full compliance scan (security, licensing, policy) on the current project +--- + +# Run compliance scan + +Execute a compliance scan for the current project: + +1. **Security** + - Check for hardcoded secrets and unsafe patterns + - List dependency audit commands (e.g. `npm audit`, `pnpm audit`) and suggest running them + - Note any obvious injection or auth issues in the codebase + +2. **Licensing** + - Identify root and package license files + - Summarize license types; flag any that may need legal review + +3. **Policy** + - Look for CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md, or similar + - Summarize requirements and whether the repo state aligns + +4. **Report** + - Output a short summary with pass/warn/fail per area + - Recommend concrete next steps (e.g. run `npm audit`, add SECURITY.md) + +Do not modify code or run destructive commands unless the user asks. diff --git a/cursor-marketplace/enterprise-toolkit/hooks/hooks.json b/cursor-marketplace/enterprise-toolkit/hooks/hooks.json new file mode 100644 index 0000000..603426e --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/hooks/hooks.json @@ -0,0 +1,21 @@ +{ + "hooks": { + "afterFileEdit": [ + { + "command": "./scripts/format-code.py", + "matcher": "**/*.py" + } + ], + "beforeShellExecution": [ + { + "command": "./scripts/validate-shell.sh", + "matcher": "rm\\s+-rf|curl\\s+.*\\|\\s*sh|wget\\s+.*\\|\\s*sh" + } + ], + "sessionEnd": [ + { + "command": "./scripts/audit.sh" + } + ] + } +} diff --git a/cursor-marketplace/enterprise-toolkit/rules/code-style.mdc b/cursor-marketplace/enterprise-toolkit/rules/code-style.mdc new file mode 100644 index 0000000..6e91751 --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/rules/code-style.mdc @@ -0,0 +1,13 @@ +--- +description: Consistent code style and cleanup +alwaysApply: true +globs: +--- + +# Code style + +- Prefer `const` over `let` for variables that are never reassigned. +- Remove unused code and imports so linters and type checks pass. +- Use the project's existing style (indentation, quotes, semicolons). When in doubt, match surrounding code. +- Keep functions and files focused; avoid unnecessary abstraction. +- Add comments in English when non-obvious logic needs explanation. diff --git a/cursor-marketplace/enterprise-toolkit/rules/security-standards.mdc b/cursor-marketplace/enterprise-toolkit/rules/security-standards.mdc new file mode 100644 index 0000000..83d8b07 --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/rules/security-standards.mdc @@ -0,0 +1,16 @@ +--- +description: Security standards for code - injection, auth, secrets, crypto +alwaysApply: false +globs: "**/*.{ts,tsx,js,jsx,py,go,java}" +--- + +# Security standards + +When writing or reviewing code, enforce these practices: + +1. **Injection**: Never concatenate user input into SQL, shell commands, or HTML. Use parameterized queries, safe APIs, and output encoding. +2. **Authentication and authorization**: Verify identity and permissions on every sensitive operation. Prefer established libraries (e.g. OAuth2, JWT validation). +3. **Secrets**: Never commit API keys, passwords, or tokens. Use environment variables or secret managers. Do not log or expose secrets in errors. +4. **Cryptography**: Use standard libraries and algorithms (e.g. bcrypt/argon2 for hashing, TLS for transport). Avoid custom crypto. +5. **Input validation**: Validate and sanitize all external input. Enforce allowlists and bounds where possible. +6. **Dependencies**: Keep dependencies updated. Check for known vulnerabilities (e.g. npm audit, dependabot). diff --git a/cursor-marketplace/enterprise-toolkit/scripts/audit.sh b/cursor-marketplace/enterprise-toolkit/scripts/audit.sh new file mode 100644 index 0000000..878a8c6 --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/scripts/audit.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +# Optional session-end audit. Hook script for enterprise-toolkit. +# Placeholder: e.g. log session end, run lightweight checks. +exit 0 diff --git a/cursor-marketplace/enterprise-toolkit/scripts/format-code.py b/cursor-marketplace/enterprise-toolkit/scripts/format-code.py new file mode 100644 index 0000000..07d16cd --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/scripts/format-code.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 +""" +Format Python files after edit. Hook script for enterprise-toolkit. +Replace with actual formatter (e.g. black, ruff format) as needed. +""" +import sys + +# Placeholder: in production, run e.g. subprocess.run(["black", path]) +# This script is invoked by the afterFileEdit hook for **/*.py +if __name__ == "__main__": + sys.exit(0) diff --git a/cursor-marketplace/enterprise-toolkit/scripts/validate-shell.sh b/cursor-marketplace/enterprise-toolkit/scripts/validate-shell.sh new file mode 100644 index 0000000..47d1634 --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/scripts/validate-shell.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +# Validates shell commands before execution. Hook script for enterprise-toolkit. +# Placeholder: in production, parse stdin and block dangerous patterns (e.g. rm -rf /, curl | sh). +exit 0 diff --git a/cursor-marketplace/enterprise-toolkit/skills/compliance-check/SKILL.md b/cursor-marketplace/enterprise-toolkit/skills/compliance-check/SKILL.md new file mode 100644 index 0000000..fe1a9fd --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/skills/compliance-check/SKILL.md @@ -0,0 +1,21 @@ +--- +name: compliance-check +description: Run compliance checks for security, licensing, and policy. Use when auditing a codebase, before releases, or when asked about compliance or policy. +--- + +# Compliance Check Skill + +## When to use + +- Auditing a codebase for security or policy compliance +- Before releases or merge to main +- When the user asks about compliance, licensing, or policy + +## Instructions + +1. **Security**: Scan for hardcoded secrets, unsafe dependencies, and obvious injection or auth issues. Suggest fixes or follow-up tools (e.g. npm audit, secret scanning). +2. **Licensing**: Note any license files or package metadata. Flag incompatible or unclear licenses if the user cares about license compliance. +3. **Policy**: If the project has a CONTRIBUTING, SECURITY, or policy doc, summarize requirements and check whether the current change aligns. +4. **Reporting**: Summarize findings in a short report (pass/warn/fail per area). Recommend concrete next steps. + +Do not run destructive or invasive commands unless the user explicitly requests them. diff --git a/cursor-marketplace/enterprise-toolkit/skills/security-review/SKILL.md b/cursor-marketplace/enterprise-toolkit/skills/security-review/SKILL.md new file mode 100644 index 0000000..ebb41c4 --- /dev/null +++ b/cursor-marketplace/enterprise-toolkit/skills/security-review/SKILL.md @@ -0,0 +1,25 @@ +--- +name: security-review +description: Security-focused code review. Use when reviewing PRs, auditing for vulnerabilities, or improving secure coding practices. +--- + +# Security Reviewer Skill + +## When to use + +- Reviewing pull requests or diffs for security issues +- Auditing code for vulnerabilities +- Improving secure coding practices + +## Instructions + +When performing a security review: + +1. **Injection**: Look for SQL, command, or XSS injection (untrusted input in queries, exec, or DOM). +2. **Auth and access control**: Check that sensitive operations require authentication and correct authorization. +3. **Secrets and PII**: Ensure no API keys, passwords, or PII are logged, committed, or exposed in errors. +4. **Crypto**: Verify hashing, encryption, and TLS usage follow best practices (no custom crypto, strong algorithms). +5. **Dependencies**: Note outdated or known-vulnerable packages; suggest updates or alternatives. +6. **Input validation**: Check that external input is validated and sanitized before use. + +Provide a concise list of findings with severity (high/medium/low) and concrete remediation steps. Prefer safe defaults and defense in depth. diff --git a/cursor-marketplace/uniform-rules/.cursor-plugin/plugin.json b/cursor-marketplace/uniform-rules/.cursor-plugin/plugin.json new file mode 100644 index 0000000..61e9d62 --- /dev/null +++ b/cursor-marketplace/uniform-rules/.cursor-plugin/plugin.json @@ -0,0 +1,9 @@ +{ + "name": "uniform-rules", + "version": "1.0.0", + "description": "Uniform CMS rules for AI-assisted development: compositions, components, patterns, SDK, and framework guides", + "author": { + "name": "AI Rules" + }, + "keywords": ["uniform", "cms", "headless", "canvas", "sveltekit", "next", "mesh"] +} diff --git a/cursor-marketplace/uniform-rules/README.md b/cursor-marketplace/uniform-rules/README.md new file mode 100644 index 0000000..294b0b3 --- /dev/null +++ b/cursor-marketplace/uniform-rules/README.md @@ -0,0 +1,16 @@ +# Uniform Rules + +Cursor plugin that provides Uniform CMS rules for AI-assisted development. + +## Contents + +- **uniform.mdc** – Core concepts: compositions, components, patterns, entries, content types, assets, localization +- **uniform-sdk.mdc** – SDK: auth, routing, CLI, frontend integration +- **uniform-sveltekit.mdc** – SvelteKit: packages, component mapping, hooks, preview, edge personalization +- **uniform-next-app-router.mdc** – Next.js App Router +- **uniform-next-page-router.mdc** – Next.js Page Router +- **uniform-mesh.mdc** – Mesh integrations: manifest, locations, data connectors + +## Usage + +Install this plugin via the Cursor marketplace or from this repo. Use when building or maintaining projects that use Uniform CMS (Canvas, Context, Mesh). diff --git a/cursor-marketplace/uniform-rules/rules/solution-architecture.mdc b/cursor-marketplace/uniform-rules/rules/solution-architecture.mdc new file mode 100644 index 0000000..9f880c4 --- /dev/null +++ b/cursor-marketplace/uniform-rules/rules/solution-architecture.mdc @@ -0,0 +1,44 @@ +--- +description: Optional coding standards and Uniform practices (React, Tailwind, slots, patterns) +globs: +alwaysApply: false +--- + +# Coding standards + +- Always generate clean code and remove unused code, so the linter and typescript checks pass automatically. IMPORTANT: do not ever run build of the application as a part of the validation as this breaks developer server and is causing issues. + +- Always use `pnpm` to install packages if you see `pnpm-lock.yaml` in the root folder, otherwise use `npm`. Never use `yarn`. + +- You are a senior React engineer, follow best practices of React at all times. +- Use TailwindCSS best practices when building CSS. Don't re-invent the wheel. +- You are a senior engineer, do not try to impress me with over-delivery. +- Do not create more components than I ask you to. Keep things to the minimum required. + +# Uniform practices + +1. CRITICAL: Always create a component pattern when pushing a new component to Uniform project and fill it with content using previous examples of this component usage if possible. If not, generate content for component pattern yourself. + +2. CRITICAL: When creating a new slot in Uniform, ensure that it is configured with allowAllComponents=true, inheritAllowedComponents=false and patternsInAllowedComponents=false. + +3. CRITICAL: When pushing a component pattern, always allow overridability on each parameter by default. + +4. CRITICAL: When registering components with Uniform and spotting repeated properties, always resort to modeling repeated set of properties as child components and create `` to render those. This will ensure reuse and avoid pollution with properties such as title1, description1, image1, title2, description2 and so on. + +# Environment variables + +1. Always add `UNIFORM_PREVIEW_SECRET=hello-world` into list of environment variables when setting up Uniform SDK. + +## Uniform SDK + +1. CRITICAL! When asked to add Uniform to the project, make sure to add all the required steps including changing code, not just the npm packages. + +2. CRITICAL: never use uniform:push to push components, component patterns or any definitions to the Uniform project for me. Instead, rely on the Uniform MCP tool to take care of that. + +3. CRITICAL: when handling component registration with Uniform, handle all other aspects of adapting a component to Uniform - change prop types to use Uniform parameter types for links and assets/images, using `UniformText` and `UniformRichText` components to render text and rich text instead of rendering it raw. + +# Next.js + +1. When creating a catch all page handler with Uniform (`[[...path]].tsx`), always place it at the root. Check if there is a conflicting page route definition, like `index.tsx` and disable it by renaming it to `.off` extension to avoid conflict. + +2. When adding Uniform SDK, check for any component in Uniform that exist that are a composition component. If so, automatically create a corresponding React component for it in the codebase, register it and define all the slots that exist on the component definition in Uniform project. diff --git a/cursor-marketplace/uniform-rules/rules/uniform-mesh.mdc b/cursor-marketplace/uniform-rules/rules/uniform-mesh.mdc new file mode 100644 index 0000000..c1b5ca3 --- /dev/null +++ b/cursor-marketplace/uniform-rules/rules/uniform-mesh.mdc @@ -0,0 +1,31 @@ +--- +description: Uniform Mesh integrations - custom web apps extending the Uniform UI and data connectors +globs: +alwaysApply: true +--- + +# Uniform Mesh Integrations + +Uniform Mesh extends the Uniform UI with custom web applications. Integrations run on URLs you host and communicate with the Uniform dashboard via iframe messaging. + +## Core stack + +- **Framework**: Next.js with page router (recommended) +- **SDK**: `@uniformdev/mesh-sdk-react` +- **Design**: `@uniformdev/design-system` +- **CLI**: `@uniformdev/cli` (register in team, install in project) +- **Language**: TypeScript (recommended) + +## Manifest (mesh-manifest.json) + +Required: `type`, `displayName`, `baseLocationUrl`, `locations`. Optional: `logoIconUrl`, `badgeIconUrl`, `category`, `scopes`. + +## Location types + +- **Install**: Shown when installing; configure in manifest (description, informationUrl). +- **Settings**: Integration-wide config; use `useMeshLocation<'settings'>` with value/setValue. +- **Data Connectors**: Data Source Editor (connection settings, secure storage), Data Type Editor (path, parameters), Data Resource Editor (object search). Do not store secrets in Data Type; use Data Source for credentials. + +## Implementation + +Use `useMeshLocation()` for value and setValue. Use design-system components for consistent UI. Locations receive **value** (editable) and **metadata** (read-only). diff --git a/cursor-marketplace/uniform-rules/rules/uniform-next-app-router.mdc b/cursor-marketplace/uniform-rules/rules/uniform-next-app-router.mdc new file mode 100644 index 0000000..0341c62 --- /dev/null +++ b/cursor-marketplace/uniform-rules/rules/uniform-next-app-router.mdc @@ -0,0 +1,32 @@ +--- +description: Rules for Uniform SDK for Next.js App Router +globs: "**/*.{tsx,jsx}" +alwaysApply: true +--- + +# Uniform React Next App Router + +See uniform.mdc for general Uniform principles and practices. +See uniform-sdk.mdc for framework-agnostic developer principles. + +## Required npm packages + +- `@uniformdev/canvas-next-rsc` +- `@uniformdev/canvas` + +## Config + +- Add `uniform.server.config.js` in project root (defaultConsent, evaluation, experimental). +- Wrap Next config with `withUniformConfig()` from `@uniformdev/canvas-next-rsc/config`. + +## Fetching and rendering + +In `app/[[...path]]/page.{tsx|jsx}` use `retrieveRoute(props)` and render with `UniformComposition` from `@uniformdev/canvas-next-rsc` and `resolveComponent` for mapping. Use `mode="server"`. + +## Layout + +Wrap `{children}` in `UniformContext` from `@uniformdev/canvas-next-rsc` in `app/layout.tsx` for personalization and A/B testing. + +## Component registration + +Use `resolveComponent` (or equivalent) to map Uniform component types to React components. Create a component for every composition component in the Uniform project and add slots as in the definition. diff --git a/cursor-marketplace/uniform-rules/rules/uniform-next-page-router.mdc b/cursor-marketplace/uniform-rules/rules/uniform-next-page-router.mdc new file mode 100644 index 0000000..44bd030 --- /dev/null +++ b/cursor-marketplace/uniform-rules/rules/uniform-next-page-router.mdc @@ -0,0 +1,25 @@ +--- +description: Rules for Uniform SDK for Next.js Page Router +globs: "**/*.{tsx,jsx}" +alwaysApply: true +--- + +# Uniform Next.js Page Router + +See uniform.mdc for general Uniform principles and practices. +See uniform-sdk.mdc for framework-agnostic developer principles. + +## Required npm packages + +- `@uniformdev/canvas` +- `@uniformdev/canvas-react` +- `@uniformdev/canvas-next` +- `@uniformdev/context-react` + +## Fetching and rendering + +In `pages/[[...path]].{tsx|jsx}` use `withUniformGetServerSideProps()` for SSR and pass `data` to `UniformComposition` from `@uniformdev/canvas-react`. Type the page with `UniformCompositionNextPage`. + +## Component registration + +Use `registerUniformComponent({ type, component })` from `@uniformdev/canvas-react`. Import registrations in `_app.tsx` so they run. Use `ComponentProps` for parameter typing; all parameter props optional. Use `UniformSlot` for child slots. diff --git a/cursor-marketplace/uniform-rules/rules/uniform-sdk.mdc b/cursor-marketplace/uniform-rules/rules/uniform-sdk.mdc new file mode 100644 index 0000000..da2dc41 --- /dev/null +++ b/cursor-marketplace/uniform-rules/rules/uniform-sdk.mdc @@ -0,0 +1,107 @@ +--- +description: Uniform SDK developer reference - auth, routing, CLI, frontend integration +globs: +alwaysApply: true +--- +# Uniform SDK Developer Reference + +This document details general information and practices about how Uniform works for developers writing frontend applications. + +See uniform.mdc for general Uniform principles and practices. + +## Authenticating to Uniform + +To fetch a composition, you need a Uniform API key configured. API keys are commonly stored as `UNIFORM_API_KEY` in a `.env` file. They follow the format `uf......`. The API key requires "Read Published Compositions" permission. + +## How Uniform transfers layout data to frontend applications + +Uniform provides _composition instances_, a hierarchical JSON structure of components that define screens or pages in an application. A composition is made up of any number of _components_ which have a type that we map to a frontend component. + +### Routing + +Uniform's _Project Map_ feature enables automatic dynamic route delegation to Uniform authors. Frontend applications define a wildcard route that delegates routing to the Uniform _Route API_, which takes a dynamic path and resolves the correct composition instance data to display for that path. + +### Syncing data with the Uniform CLI + +Uniform provides a CLI which can be used to sync the state of a Uniform project, such as component definitions, pattern definitions, or compositions, to files on disk. These files may be committed to source control and used to ensure the states of environment or developer-specific projects are kept up to date to reduce the chance of errors. + +#### Required package for Uniform CLI + +The Uniform CLI is contained in the `@uniformdev/cli` npm package. IMPORTANT: this package must be installed as a devDependency. + +#### Authenticating with the Uniform CLI + +The Uniform CLI requires a Uniform API key to authenticate. The API key and other connectivity details are stored in a `.env` file. When creating an API key for the CLI, the user can use the "Copy as .env" function in the Uniform dashboard to get the appropriate environment variable values. +API keys used for the Uniform CLI require read and write permissions to any entity types that are to be synced. The default 'developer' role is a shortcut to full permissions. + +#### Configuring the Uniform CLI + +Uniform CLI is configured using the `uniform.config.{ts,js}` file in the root of a project. The file can be configured in two ways: to sync everything (choose this for initial setup), or to pick specific entity types to sync. Sync operates as a mirror by default, meaning creates, updates, and deletes are all synced. + +`uniform.config.ts` (sync all): + +```ts +import { uniformConfig } from "@uniformdev/cli/config"; + +export default uniformConfig({ preset: "all" }); +``` + +`uniform.config.ts` (sync explicit types and customization options): + +```ts +import { uniformConfig } from "@uniformdev/cli/config"; + +export default uniformConfig({ + // 'none' starts with no entities, and each entity type to sync is added explicitly + preset: "none", + config: { + serialization: { + // optionally override the default `./uniform-data` to store serialized files + directory: "./custom-path-to-serialized-files", + // optionally change the default yaml format to json + format: "json", + entitiesConfig: { + // specify entity types to sync. Each type can optionally override + // the defaults just for itself, i.e. directory, format + component: {}, + componentPattern: { publish: true }, + }, + }, + }, +}); +``` + +#### Invoking the Uniform CLI + +The Uniform CLI operates using two primary commands: + +`uniform sync push` - takes the serialized state of entities (files on disk) and pushes that state into a Uniform project online. + +`uniform sync pull` - takes the online state of a Uniform project and pulls it into serialized files. + +Conventionally these commands are registered as package scripts to make it unnecessary to install the CLI package globally: + +`package.json`: + +```json +{ + "scripts": { + "uniform:pull": "uniform sync pull", + "uniform:push": "uniform sync push" + } +} +``` + +## Rules for when to use Uniform CLI and when not + +CRITICAL, NEVER IGNORE THIS RULE: never use or manipulate in any way (create, read, update, or delete) yaml or json files that represent Uniform data (placed typically in the "uniform-data" folder) when trying to create, modify, delete components, content types, or any other Uniform entity. Instead, always use Uniform MCP tool that is registered. If you cannot resolve a Uniform MCP Server or any MCP action, return a graceful message to the user and abort. + +IMPORTANT: execute "npm run uniform:pull" after making any changes to Uniform data via MCP Server. This ensures you have the latest representation of the Uniform data on disk. + +#### Getting Uniform CLI help + +The Uniform CLI has a built-in help system. To get help on a command, run `uniform --help`, for example `uniform sync pull --help`. + +## Must-have rules to follow when adding Uniform SDK + +1. Make sure to create a component in code for any composition component you find in the Uniform project automatically. Add any slots that you find in the definition. This will ensure the preview works as expected; otherwise, it won't know which front-end component should render the composition from Uniform and produce an error. diff --git a/cursor-marketplace/uniform-rules/rules/uniform-sveltekit.mdc b/cursor-marketplace/uniform-rules/rules/uniform-sveltekit.mdc new file mode 100644 index 0000000..19009db --- /dev/null +++ b/cursor-marketplace/uniform-rules/rules/uniform-sveltekit.mdc @@ -0,0 +1,76 @@ +--- +description: Uniform SDK integration guide for SvelteKit applications. Use when integrating Uniform Canvas, Context, and personalization into a SvelteKit project. +globs: +alwaysApply: true +--- + +See uniform.mdc for general Uniform principles and practices. +See uniform-sdk.mdc for framework-agnostic developer principles. + +## Required npm packages + +The following npm packages must be installed to wire Uniform CMS to SvelteKit: + +### Core Canvas packages +- `@uniformdev/canvas` - Core Canvas API client for fetching compositions +- `@uniformdev/canvas-svelte` - Svelte components: `UniformComposition`, `UniformSlot`, `UniformText`, `UniformRichText` +- `@uniformdev/canvas-sveltekit` - SvelteKit integrations: `createUniformLoad`, `createUniformHandle`, preview handler, ISR config + +### Core Context packages (for personalization) +- `@uniformdev/context` - Personalization Context engine +- `@uniformdev/context-svelte` - `UniformContext` provider component + +### Edge personalization packages (optional, for production) +- `@uniformdev/context-edge` - Edge-side context processing +- `@uniformdev/context-edge-sveltekit` - NESI response handler for edge personalization +- `@vercel/functions` - Vercel edge functions support +- `cookie` - Cookie parsing utility + +### Dev dependencies +- `@uniformdev/cli` - CLI for pulling manifests and syncing content (IMPORTANT: must be installed as devDependency) + +## Configuring TypeScript Types + +Update `src/app.d.ts` to include Uniform preview data types: + +```typescript +import type { UniformPreviewData } from '@uniformdev/canvas-sveltekit'; + +declare global { + namespace App { + interface Locals { + uniformPreview?: UniformPreviewData; + } + } +} + +export {}; +``` + +## Component Mapping + +Create `src/lib/uniform/componentMap.ts` to map Uniform component types to Svelte components. Use `type__variant` format for variants. Register all composition components so preview works. + +## Server Hooks and Catch-All Route + +- Use `createUniformHandle` from `@uniformdev/canvas-sveltekit` in `src/hooks.server.ts` for preview cookies. +- Use `createUniformLoad` in `src/routes/[...path]/+page.server.ts` with `RouteClient` to fetch compositions. +- Render with `UniformComposition` and `UniformSlot` in `+page.svelte`. + +## Preview Handler + +Create `src/routes/preview/+server.ts` with `createPreviewHandler` from `@uniformdev/canvas-sveltekit/preview`. + +## Rendering Uniform Components with Svelte + +- Use `ComponentProps` for type-safe parameter access; all parameter props must be optional. +- Use `UniformText` for editable text parameters, `UniformRichText` for rich text (Lexical JSON), `UniformSlot` for nested slots. +- Use `flattenValues` from `@uniformdev/canvas` for asset parameters. + +## Environment Variables + +Required: `UNIFORM_API_KEY`, `UNIFORM_PROJECT_ID`, `UNIFORM_PROJECT_MAP_ID` (optional), `UNIFORM_PREVIEW_SECRET`. + +## CLI + +Use `uniform.config.ts` with `uniformConfig({ preset: 'all' })`. Add scripts: `uniform:pull`, `uniform:push`, `pull:manifest` for context manifest. diff --git a/cursor-marketplace/uniform-rules/rules/uniform.mdc b/cursor-marketplace/uniform-rules/rules/uniform.mdc new file mode 100644 index 0000000..5efe101 --- /dev/null +++ b/cursor-marketplace/uniform-rules/rules/uniform.mdc @@ -0,0 +1,242 @@ +--- +description: Uniform core concepts - compositions, components, patterns, entries, content types +globs: +alwaysApply: true +--- + +## Uniform Core Concepts + +Uniform is a modern, headless, component-based Content Management System (CMS). Its primary purpose is to allow non-technical authors (marketers, etc) to create and maintain websites and other similar experiences in a visual editor. + +### Uniform Compositions + +A composition instance in Uniform is roughly equivalent to a page. Composition definitions define a reusable schema for composition instances. +Composition definitions have a structure identical to a Uniform Component, i.e. parameters and slots. +Composition instances differ from components in that they also define a route or page. +Instances of a composition create pages or routes within an application. +The term "Composition" can be used to refer either to a definition or instance of a composition, you will need to infer which is meant (schema/reusable template = definition, page/route = instance). + +Composition parameters should only be used for global content that will never need to be personalized. +Good example: OpenGraph data and meta tags (if they exist) +Bad example: "hero title" belongs in a Hero component in the content slot. + +A single composition definition called 'Page' is generally a good starting point. Additional composition definitions are only required if the page shell is different (e.g. Page, Popup, Minimal Page), or if there are different parameters needed on the composition definition + +In developer terms, a composition instance is a dynamic layout that is defined by non-technical authors; a composition definition is a hierarchical content schema definition. + +### Uniform Entries + +Entries are instances of structured content that you create using predefined Uniform Content Types. Think of content types as blueprints and entries as the actual content built from those blueprints. + +Each entry contains structured data for content pieces like articles, events, products, or any other content you need. Once created, entries become reusable assets that can power multiple experiences across your digital channels. + +#### How entries differ from compositions and components + +An entry is structured content that represents a piece of content in a design-agnostic way. A component or composition describes the experience layer by defining which concrete UI component should be used to show particular content. Entries can also define relationships to other entries via references, which allows building complex content structures. + +By connecting the fields of an entry to the parameters of a component, you define how the content is displayed in a certain context. For example, you could show the same article entry in a hero, a card, or a list component. Which fields of an entry are shown can be different for each use case. + +### Uniform Components + +Uniform Components are used to allow CMS authors to create and manipulate visual elements on a composition. Each property of a Uniform Component, such as a title or image, is called a _Component Parameter_. See _Uniform Parameter/Field Types_ for the exact types of parameter that are allowed. Components have both a definition (their schema) and instances (when an instance of that schema is placed within a slot on a composition). + +Uniform Components can define named _slots_. + +- A slot allows additional components (or component patterns) to be inserted within the Uniform Component. For example an accordion component could have an 'items' slot that allows adding Accordion Item components. +- Each named slot has 0..n child components. The order in the slot determines the order of rendering. +- Each slot definition allows only specific Uniform Components to be placed within it (by public id). It can also define the minimum and maximum number of components allowed. +- Components allowed within slots can also have their own slots, with no depth limit - but it is generally undesirable to nest more than 2-3 levels deep to improve author understanding. +- When a Uniform Composition is defined, it almost always has a generic 'content' slot added to it that allows using various components to define the layout. + +Uniform Component Definition attributes: + +- _name_ +- _public ID_ +- _parameters_ +- _slots_ + +Uniform Slot Definition attributes: + +- _name_ +- _public ID_ +- _allowed components_ +- _min components_ +- _max components_ + +In technical terms, a Uniform Component maps directly to a presentational frontend component such as a React component. The parameters are component props. Slots are component props that contain rendered child components. + +#### Determining which Uniform Components or Component Patterns are allowed in a Slot + +In Uniform, slot definitions control which components or component patterns can be placed in a slot. This is governed by a combination of properties that make slot configuration both powerful and flexible. + +Here's how it works: + +1. `allowAllComponents: true`: If this is set, any component or component pattern can be added to the slot - no restrictions. +2. `allowAllComponents: false`: If this is provided, `allowedComponents` is a list of allowed Uniform component public IDs. You can also include component patterns by using the prefix `$p:` followed by the pattern UUID. +Example: +`["hero", "callToAction", "$p:00000000-0000-0000-0000-000000000000"]` +3. `patternsInAllowedComponents` This controls how component patterns are validated against `allowedComponents`. + * If `true`: A pattern is only allowed if it is explicitly listed in allowedComponents (with the `$p:` prefix). + Example: + `["hero", "$p:00000000-0000-0000-0000-000000000000"]` + Only the listed pattern and `hero` components are allowed - no other patterns based on `hero` are valid. + * If `false`: a pattern is allowed if its base component type is listed in `allowedComponents`. + Example: + `["hero"]` + Only `hero` components and any pattern based on `hero` are allowed. +4. If you are editing a component pattern or composition pattern, the slot section component ($slotSection) is always allowed. + +IMPORTANT: Before you add new components to a slot, make sure that they are allowed according to the preceding rules. +IMPORTANT: If you change `patternsInAllowedComponents` to false, remove any existing pattern IDs in the allowed list. + +#### Slot sections +When editing component patterns and composition patterns definitions only, there is an additional built-in component available to insert in any slot called a _slot section_ ($slotSection). +Slot sections create an extension point where consumers of the pattern definition can insert new components - normally, slots on a pattern cannot be modified by pattern consumers. +Slot sections may not have 'default components' when defined on a pattern definition. +When fetched for content delivery, the slot section component dissolves and its children become part of the parent slot. +IMPORTANT: If the current context item is not a component pattern or a composition pattern, do not include Slot Sections in a list of system components. Slot sections are only valid insertions on component patterns and composition patterns. + +When editing a pattern instance (when one of its ancestors has the _pattern property set) and a slot section is found, you may insert components into the slot section to extend the pattern's slot contents. +All $slotSection components support only one slot, $slotSectionItems. +Adding components to a slot section works by inserting them into the slot section's slot. You may not use the parent slot name of the slot section, the slot name must be $slotSectionItems. + +When dealing with nested patterns, slot sections' contents may only be set on the direct parent consumer of the pattern (this differs from property overrides, which can be set on any ancestor of the pattern). To expose a slot section from a nested pattern, you must 're-export' the slot section by adding a slot section to the parent pattern in the child's slot section. + +### Uniform Content Types + +Uniform Content Types define a reusable structure for individual reusable pieces of content. A Uniform content type differs from a Uniform component because a component represents a specific visual element on a composition/page, but a content type is an abstract, reusable content schema. An instance of a Uniform Content Type is called an _Entry_. Entries each have their own built-in slug: there is no need to define an explicit slug field. + +For example a Product might be a Uniform Content Type, and the data from instances of that Product could be presented in different contexts by Uniform Patterns such as Product List, Product Detail, or Product Card. + +Uniform Content Types define content properties called _Fields_ (e.g. a blog post could have a single-line text input for title, and a rich text editor for body). See _Uniform Parameter/Field Types_ for the exact types of field that are allowed. + +Uniform Content Type attributes: + +- _name_ +- _public ID_ +- _fields_ + +### Uniform Patterns + +Patterns are a unit of content reuse within Uniform. Updates made to patterns are immediately reflected to all usages of the pattern. There are several types of patterns: + +#### Uniform Component Patterns + +Component Patterns allow reusing the same content across compositions. The simplest way to think of a pattern is that it is a _shared component instance_ that can be placed within a slot to insert the pattern's content there. The pattern, like any other component instance, can have values in its parameters and child components in its slots. All usages of the same pattern reference the same shared content. Component Patterns may be nested within each other (e.g. a Blog Post Hero pattern could include a Author Bio pattern in one of its slots). Nesting beyond 2-3 levels can cause performance issues. + +#### Uniform Composition Patterns + +Composition Patterns allow creating compositions from a shared template. Non-overridable data in the composition pattern is locked down to reference the pattern. Composition patterns are created to lock down compositions and allow changing only a subset of data, or to rapidly make pages from external data sources. + +#### Entry Patterns + +Entry Patterns allow creating Entries from a shared template. Non-overridable data in the entry pattern is locked down to reference the pattern. Entry patterns are created to lock down entries and allow changing only a subset of data, or to rapidly make entries from external data sources. + +#### Uniform Pattern Overrides + +Parameters or fields on patterns can be defined _overridable_ by the pattern definition. Overridable parameter values default to using the value defined on the pattern, but consumers of the pattern may choose to break the inheritance of that parameter value and replace it with their own instance-specific value. Patterns that contain other patterns may not alter the overridability of nested pattern parameters: once overridable, any consumer of the pattern can change the value. Overrides are used to allow partial content sharing and exception cases. + +#### Using Uniform Patterns as Shared Content Snippets + +Patterns can be used to reuse shared content, for example the same legal disclaimer might be required on every press release. Both patterns and components allow content reuse: the difference is that patterns reuse exact content, whereas components reuse content schemas but do not provide content values. + +#### Using Uniform Patterns as Data Binding Templates + +Patterns can be used to create bindings between structured data (from Uniform Entries or external data sources, like REST APIs or other CMSes) and presentation parameters. A pattern can define a _Data Resource_ which is the result of fetching from a data source. Then parameters in the pattern can use _Dynamic Tokens_ to bind to elements within the data resource. For example, we might have a Card component that has a title and image. Then we create a Product Card pattern, based on the Card component, which has a Uniform Entry Data Resource that fetches an entry specified by the pattern consumer. The Product Card automatically binds the title and image from the product entry to the Card component's parameters. As an author, one can then insert a Product Card pattern, choose the product to use, and have the title and image automatically set up for them. + +Example of a resolved Data Resource (named 'myEntry'): +{ "myEntry": { "fields": { "title": "hello world" } } } + +Example of a Dynamic Token in a text parameter referencing the myEntry title: +"today's greeting: ${#jptr:/myEntry/fields/title}" (this resolves to "today's greeting: hello world") + +#### Uniform Pattern attributes + +- _name_ +- _type_ - public ID of the base Uniform Component +- _public id_ - id of the pattern +- _data resources_ (name, type) +- _parameters_ (value, overridable) +- _slots_ + +### Uniform assets + +Media files that are used in Uniform compositions and entries are called _Assets_ and are managed in the _Asset Library_. Mesh integrations can extend the Asset Library to allow for custom asset sources like external DAM systems or asset repositories (like Unsplash, Getty Images, etc). + +#### Asset attributes + +- _public id_ - the asset's unique identifier +- _type_ - the asset's type, such as 'image', 'video', 'audio', 'document', 'other' +- _source_ - such as 'uniform-assets' or an identifier specific to a Mesh integration +- _fields_ - the asset's metadata, such as the title, description, file, url, focal point coordinates, dimensions, etc + + +### Localization + +Uniform defines locales at a project level. These are locales that content can be written in. +Individual compositions, entries, and patterns must also _enable_ a locale to indicate that they have content in that locale. This allows for specific content to support a subset of locales. +Locales must be enabled on compositions, entries, or patterns before their parameters or fields can have values in that locale. + +## Conventions + +### Uniform Field/Parameter Types + +Uniform Fields or Uniform Parameters attributes: + +- _name_ +- _public ID_. Must be unique within a Uniform Component or Uniform Content Type (including the ID of group fields/parameters) +- _localizable_. Localizable values have a distinct value for each locale; otherwise the value is the same for all locales. +- _required_. Required means that a CMS author must input a value in order to be considered valid. +- _type_. See list below. +- _guidance_. Brief LLM instructions used when generating or editing values. +- _overridable_. Only applies for fields/parameters on a pattern definition. Allows consumers of the pattern to break inheritance and change the pattern definition's value for the field/parameter. + +Exhaustive list of allowed field/parameter types: + +- _text_: Plain text content +- _richText_: Formatted text with styling (Lexical JSON format) +- _select_: Choose between a controlled vocabulary of options +- _multi-select_: Choose between a controlled vocabulary of options, allowing multiple selections +- _number_: Numeric value +- _date_: Calendar date +- _dateTime_: Date with timezone +- _checkbox_: Boolean toggle +- _link_: URL or internal reference +- _asset_: Image, video, audio, or other file +- _json_: A JSON object. Not for use in author-facing fields/parameters, who will have trouble editing JSON. +- _contentReference_: Allows referencing one or more Entries of a specific type. Can be used in Content Types, but not in Uniform Components. +- _$enr_: Tag content with enrichments (relevant segments) to make viewing the content alter the classification of the visitor that saw it. +- _group_: Group multiple fields/parameters together visually, for example a group of address fields. IMPORTANT: fields added to a group must come directly after the group in the fields list. + +### Uniform Naming Conventions + +- All names should be title-cased prose, not technical shorthand (e.g. "Main Header" not "main-header" or "MainHeader"). There is no need to include the type of entity in a name (e.g. 'Hero' not 'Hero Component'). +- Do not name Uniform Components, Uniform Content Types, or Fields/Parameters based on visible content found in inputs; treat it as FPO (e.g.

Hello

does not mean name the component 'Hello' - describe its meaning instead, such as 'Headline'). +- _Public ID_ are developer-facing identifiers for Uniform entities. They are based on a slugified version of the name. Use a camel case, for example if the name is "Main Header", the public ID is "mainHeader". Public IDs must be unique within a given entity type (e.g. Uniform Components). You cannot alter public IDs after creating an entity. IMPORTANT: public IDs on parameters, fields, or components that start with `$` are system-owned, and cannot be altered by users. For example, you may not change parameters of the `$personalization` component or remove the `$viz` parameter from any component. You may add or remove system components such as `$test` to a slot's `allowedComponents`. +- Help text should be no longer than 1 short sentence. It is not necessary to write help text unless we have specific expectations for authors. For example a 'Title' doesn't need help text. But if we identify an image that needs to be 250x250px, that expectation belongs in help text. Descriptions and help text are plain text, no markdown or HTML. + +## Tool Usage Tips + +- Before creating or updating Uniform Patterns, fetch Uniform Component Definitions to ensure you know about valid component types and parameters. +- When making multiple updates to the same Uniform Pattern, such as adding a component and setting a parameter value, batch changes together into a single tool call to improve performance and consistency. +- When a Uniform tool provides you with an edit URL offer it to the user as a link, unless you already have recently. +- Before inserting, removing, or reordering parameters or fields from a Uniform Component or Uniform Content Type, make sure to fetch the latest definition data to ensure you target the correct location. +- If you are tasked with reordering fields or parameters, you must remove them and re-add them in the new order +- Enable the default locale (if one exists) when creating new entries, patterns, or compositions, unless the user specifies locales +- If duplicating or copying entries, compositions, or patterns, always use the duplicate function of the edit tool instead of creating a new entity and re-creating data. + +## Unsupported Features + +The following Uniform features cannot currently be changed using MCP/AI. If asked to perform the following actions, explain you cannot yet do that, and when possible offer a link to perform the task in the Uniform web app. + +- Creating new Loop component instances +- Adding, editing, or removing block type fields/parameters, or block type definitions +- Editing conditional values on parameters or fields (the default value can be edited) +- Setting visibility rules on component instances +- Changing data sources, data types, or data resources +- Adding or removing project map nodes, and linking compositions to project map nodes +- Adding or removing content from Uniform Releases, or changing releases (i.e. locking, scheduling) +- All content you work with is in a 'draft' state. You do not have access to published content and cannot assist with publishing +- Managing workflows, or transitioning compositions, entries, or patterns from one workflow stage to another +- Creating new assets, uploading or editing files for assets, or deleting assets +- Changing user permissions