@abeedoo/radish-schemas 1.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +317 -0
- package/index.js +38 -0
- package/package.json +51 -0
- package/prompts/index.js +118 -0
- package/prompts/radish-app-generation.md +259 -0
- package/prompts/radish-components-generation.md +138 -0
- package/prompts/radish-roles-generation.md +133 -0
- package/prompts/radish-schema-generation.md +267 -0
- package/prompts/radish-theme-generation.md +138 -0
- package/prompts/radish-types-generation.md +294 -0
- package/prompts/radish-ui-generation.md +227 -0
- package/schemas/app.schema.json +289 -0
- package/schemas/components.schema.json +199 -0
- package/schemas/index.js +49 -0
- package/schemas/roles.schema.json +64 -0
- package/schemas/theme.schema.json +196 -0
- package/schemas/types.schema.json +761 -0
- package/schemas/ui.schema.json +346 -0
- package/validators/index.js +175 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
# AI App Blueprint Generation Prompt Template
|
|
2
|
+
|
|
3
|
+
You are an expert application architect. Generate a JSON app blueprint based on the user's description.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
The app blueprint is the **master document** for a Radish application. It captures the high-level intent, audience, workflows, features, and entity overview. Other generators (types.json, roles.json, UI layer) use this blueprint as their primary input.
|
|
8
|
+
|
|
9
|
+
## IMPORTANT: Output Format
|
|
10
|
+
|
|
11
|
+
1. **Return ONLY valid JSON** - No markdown, explanations, or code blocks
|
|
12
|
+
2. **Use this exact top-level structure**:
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"version": 1,
|
|
17
|
+
"app": {
|
|
18
|
+
"name": "AppName",
|
|
19
|
+
"displayName": "App Display Name",
|
|
20
|
+
"description": "Full description of the application",
|
|
21
|
+
"version": "0.1.0",
|
|
22
|
+
"domain": "business-domain",
|
|
23
|
+
"tags": ["tag1", "tag2", "tag3"]
|
|
24
|
+
},
|
|
25
|
+
"audience": {
|
|
26
|
+
"primary": "Primary user persona description",
|
|
27
|
+
"secondary": "Secondary user persona description",
|
|
28
|
+
"admin": "Admin user persona description"
|
|
29
|
+
},
|
|
30
|
+
"workflows": [
|
|
31
|
+
{
|
|
32
|
+
"name": "Workflow Name",
|
|
33
|
+
"actor": "persona",
|
|
34
|
+
"description": "What the user does step by step"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"categories": [
|
|
38
|
+
{
|
|
39
|
+
"name": "Category Name",
|
|
40
|
+
"subcategories": ["Sub1", "Sub2", "Sub3"]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"style": {
|
|
44
|
+
"theme": "radish-admin",
|
|
45
|
+
"tone": "professional but approachable",
|
|
46
|
+
"palette": "description of color palette",
|
|
47
|
+
"typography": "font and spacing preferences",
|
|
48
|
+
"layout": "layout style description",
|
|
49
|
+
"icons": "icon style description",
|
|
50
|
+
"imagery": "imagery style description"
|
|
51
|
+
},
|
|
52
|
+
"features": {
|
|
53
|
+
"auth": true,
|
|
54
|
+
"roles": true,
|
|
55
|
+
"adminPanel": true,
|
|
56
|
+
"api": true,
|
|
57
|
+
"search": true,
|
|
58
|
+
"pagination": true,
|
|
59
|
+
"fileUploads": false,
|
|
60
|
+
"notifications": false,
|
|
61
|
+
"analytics": false,
|
|
62
|
+
"scheduling": false,
|
|
63
|
+
"logging": true
|
|
64
|
+
},
|
|
65
|
+
"entityOverview": {
|
|
66
|
+
"groupName": [
|
|
67
|
+
{ "EntityName": "Description of entity purpose and relationships" }
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"accessPatterns": {
|
|
71
|
+
"public": ["Action anyone can do"],
|
|
72
|
+
"authenticated": ["Action logged-in users can do"],
|
|
73
|
+
"admin": ["Action admins can do"]
|
|
74
|
+
},
|
|
75
|
+
"database": {
|
|
76
|
+
"type": "mongodb",
|
|
77
|
+
"name": "appname"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Section Details
|
|
83
|
+
|
|
84
|
+
### app (required)
|
|
85
|
+
Core application metadata.
|
|
86
|
+
|
|
87
|
+
- **name** (required): PascalCase or camelCase identifier used in code generation
|
|
88
|
+
- **displayName**: Human-readable name for UI display
|
|
89
|
+
- **description** (required): Comprehensive description of what the application does. Be specific about key features, user interactions, and business goals. This drives all downstream generation.
|
|
90
|
+
- **version**: Application version in semver format (start with "0.1.0")
|
|
91
|
+
- **domain**: Business domain category (e.g., education, e-commerce, healthcare, finance, social, productivity)
|
|
92
|
+
- **tags**: Searchable keywords
|
|
93
|
+
|
|
94
|
+
### audience
|
|
95
|
+
Define who uses the application. Be specific about their goals and context.
|
|
96
|
+
|
|
97
|
+
- **primary**: The main user persona — who they are and what they want
|
|
98
|
+
- **secondary**: Supporting user persona — different role or use case
|
|
99
|
+
- **admin**: Administrative persona — platform management responsibilities
|
|
100
|
+
|
|
101
|
+
### workflows
|
|
102
|
+
The most important section for driving UI generation. Describe **what users actually do** in the application.
|
|
103
|
+
|
|
104
|
+
**Guidelines:**
|
|
105
|
+
- Each workflow should describe a complete user journey
|
|
106
|
+
- Use action verbs: browse, create, submit, review, manage
|
|
107
|
+
- Include the sequence of steps where possible
|
|
108
|
+
- Map each workflow to an actor (persona)
|
|
109
|
+
- Think about CRUD operations but describe them as user goals
|
|
110
|
+
|
|
111
|
+
**Example:**
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"name": "Project Planning",
|
|
115
|
+
"actor": "manager",
|
|
116
|
+
"description": "Create a new project, define milestones and tasks, assign team members, set deadlines, track progress through kanban board"
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### categories (optional)
|
|
121
|
+
Content taxonomy for the application. Useful for apps with categorized content.
|
|
122
|
+
|
|
123
|
+
### style
|
|
124
|
+
Branding and UI hints. These inform the UI layer generator but do not enforce specific implementations.
|
|
125
|
+
|
|
126
|
+
- **theme**: Theme identifier (e.g., "radish-admin", "minimal", "dashboard")
|
|
127
|
+
- **tone**: Brand voice description
|
|
128
|
+
- **palette**: Color scheme description or specific colors
|
|
129
|
+
- **typography**: Font preferences and spacing
|
|
130
|
+
- **layout**: Layout pattern preferences (e.g., "card-based", "sidebar navigation", "top navbar")
|
|
131
|
+
- **icons**: Icon style (e.g., "feather/outline", "filled", "material")
|
|
132
|
+
- **imagery**: Placeholder and image style
|
|
133
|
+
|
|
134
|
+
### features
|
|
135
|
+
Boolean flags for application capabilities. These drive which generators and templates are used.
|
|
136
|
+
|
|
137
|
+
| Feature | Description |
|
|
138
|
+
|---------|-------------|
|
|
139
|
+
| auth | Authentication system (login, register, password reset) |
|
|
140
|
+
| roles | Role-based access control |
|
|
141
|
+
| adminPanel | Administrative dashboard |
|
|
142
|
+
| api | REST API endpoints |
|
|
143
|
+
| search | Search functionality across entities |
|
|
144
|
+
| pagination | Paginated list views |
|
|
145
|
+
| fileUploads | File/image upload capability |
|
|
146
|
+
| notifications | In-app or email notifications |
|
|
147
|
+
| analytics | Usage analytics and reporting |
|
|
148
|
+
| scheduling | Calendar, scheduling, or time-based features |
|
|
149
|
+
| logging | Application event logging |
|
|
150
|
+
|
|
151
|
+
### entityOverview
|
|
152
|
+
High-level entity descriptions grouped by domain concern. This drives types.json generation.
|
|
153
|
+
|
|
154
|
+
**Guidelines:**
|
|
155
|
+
- Group entities by domain concern (core, engagement, community, etc.)
|
|
156
|
+
- Use PascalCase for entity names
|
|
157
|
+
- Describe purpose, key relationships, and ownership
|
|
158
|
+
- Mention which entities are "owned by" users
|
|
159
|
+
- Don't define fields here — that's for types.json
|
|
160
|
+
|
|
161
|
+
**Example:**
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"core": [
|
|
165
|
+
{ "Project": "Top-level container. Has tasks and milestones. Owned by creator." },
|
|
166
|
+
{ "Task": "Work item within a project. Assigned to team members. Has status, priority, due date." }
|
|
167
|
+
],
|
|
168
|
+
"collaboration": [
|
|
169
|
+
{ "Comment": "Threaded discussion on tasks or projects." },
|
|
170
|
+
{ "Activity": "Audit log of actions taken on entities." }
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### accessPatterns
|
|
176
|
+
Who can do what, organized by access level. This drives roles.json generation.
|
|
177
|
+
|
|
178
|
+
**Guidelines:**
|
|
179
|
+
- Use clear access levels: public, authenticated, role-specific names, admin
|
|
180
|
+
- Describe actions in plain language
|
|
181
|
+
- Think about read vs. write vs. manage permissions
|
|
182
|
+
- Consider data ownership (users can edit "own" vs "any")
|
|
183
|
+
|
|
184
|
+
### database
|
|
185
|
+
Database configuration for the project.
|
|
186
|
+
|
|
187
|
+
- **type**: Database engine — currently supports "mongodb"
|
|
188
|
+
- **name**: Database name (lowercase, no spaces)
|
|
189
|
+
|
|
190
|
+
## What Makes a Good App Blueprint
|
|
191
|
+
|
|
192
|
+
### DO:
|
|
193
|
+
- Write a rich, detailed app description — it drives everything downstream
|
|
194
|
+
- Define specific workflows with clear user journeys
|
|
195
|
+
- Think about all user personas and their goals
|
|
196
|
+
- Include realistic feature flags
|
|
197
|
+
- Group entities logically by domain concern
|
|
198
|
+
- Define clear access patterns
|
|
199
|
+
|
|
200
|
+
### DON'T:
|
|
201
|
+
- Don't define individual fields — that's for types.json
|
|
202
|
+
- Don't specify routes or pages — that's for the UI layer
|
|
203
|
+
- Don't include implementation details (API endpoints, database queries)
|
|
204
|
+
- Don't create entities for built-in types (User, Profile, Role, Permission, ApiKey, Setting)
|
|
205
|
+
- Don't over-specify style — keep it high-level and suggestive
|
|
206
|
+
|
|
207
|
+
## Built-in Entities (Do NOT Include in entityOverview)
|
|
208
|
+
|
|
209
|
+
The following entities are provided by the system:
|
|
210
|
+
- **User** — Authentication and identity
|
|
211
|
+
- **Profile** — Extended user information
|
|
212
|
+
- **Role** — Permission management
|
|
213
|
+
- **Permission** — Access control
|
|
214
|
+
- **ApiKey** — API authentication
|
|
215
|
+
- **Setting** — System configuration
|
|
216
|
+
|
|
217
|
+
Reference these in workflows and access patterns, but don't redefine them.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
**User Description**: {{USER_DESCRIPTION}}
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Response Format
|
|
226
|
+
|
|
227
|
+
You MUST respond with ONLY a valid JSON object in this EXACT format:
|
|
228
|
+
|
|
229
|
+
```json
|
|
230
|
+
{
|
|
231
|
+
"app": {
|
|
232
|
+
"version": 1,
|
|
233
|
+
"app": {
|
|
234
|
+
"name": "AppName",
|
|
235
|
+
"description": "Full description..."
|
|
236
|
+
},
|
|
237
|
+
"audience": { ... },
|
|
238
|
+
"workflows": [ ... ],
|
|
239
|
+
"features": { ... },
|
|
240
|
+
"entityOverview": { ... },
|
|
241
|
+
"accessPatterns": { ... },
|
|
242
|
+
"database": { ... }
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**CRITICAL REQUIREMENTS**:
|
|
248
|
+
1. Return ONLY the JSON object — no markdown code blocks, no explanations, no preamble
|
|
249
|
+
2. The `app` value must be a complete JSON object (NOT a string)
|
|
250
|
+
3. Must include `"version": 1` at the top level of the app object
|
|
251
|
+
4. All keys and string values must be properly quoted
|
|
252
|
+
|
|
253
|
+
**Common Mistakes to AVOID**:
|
|
254
|
+
- Wrapping response in markdown ```json...``` blocks
|
|
255
|
+
- Including explanatory text before or after the JSON
|
|
256
|
+
- Defining individual entity fields (save for types.json)
|
|
257
|
+
- Including built-in entities (User, Role, etc.) in entityOverview
|
|
258
|
+
- Using implementation-specific details instead of high-level descriptions
|
|
259
|
+
- Returning YAML strings instead of JSON objects
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# AI Components Blueprint Generation Prompt
|
|
2
|
+
|
|
3
|
+
You are a UI component architect for a Svelte 5 + DaisyUI application. Given entity definitions, UI page layouts, and a list of available UI primitives, generate a components.json blueprint that maps each referenced component to an implementation.
|
|
4
|
+
|
|
5
|
+
**Generate ONLY the components blueprint. Do NOT include types, roles, app, ui, or theme.**
|
|
6
|
+
|
|
7
|
+
## Available @radish/components Primitives
|
|
8
|
+
|
|
9
|
+
**Actions:** Button, Dropdown, Swap, ThemeController
|
|
10
|
+
**Composites:** AutoForm, ChatPanel, ConfirmDialog, DataTable, EmptyState, Icon, Modal, PageHeader, Tabs
|
|
11
|
+
**Data Display:** Accordion, Avatar, Badge, Carousel, ChatBubble, CodeBlock, Collapse, Countdown, Kbd, List, Stat, StatGroup, Status, Table, Timeline
|
|
12
|
+
**Data Input:** Calendar, Checkbox, DateRangeInput, DropZone, FileInput, FormField, Radio, Range, Rating, SearchInput, Select, TextInput, Textarea, Toggle
|
|
13
|
+
**Feedback:** Alert, Loading, Progress, RadialProgress, Skeleton, Toast, Tooltip
|
|
14
|
+
**Layout:** Card, Divider, Drawer, Footer, Hero, Stack
|
|
15
|
+
**Navigation:** Breadcrumbs, Dock, Link, Menu, Navbar, Pagination, Steps
|
|
16
|
+
**Content:** ContentBlock
|
|
17
|
+
|
|
18
|
+
## Component Definition Format
|
|
19
|
+
|
|
20
|
+
### Static components (no entity binding)
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"base": "Hero",
|
|
24
|
+
"props": {
|
|
25
|
+
"title": "Welcome to My App",
|
|
26
|
+
"subtitle": "Build something amazing"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Entity-bound card
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"base": "Card",
|
|
35
|
+
"entity": "Course",
|
|
36
|
+
"fields": {
|
|
37
|
+
"title": "title",
|
|
38
|
+
"body": "description",
|
|
39
|
+
"badge": "difficultyLevel"
|
|
40
|
+
},
|
|
41
|
+
"actions": [
|
|
42
|
+
{ "label": "View", "href": "/courses/{id}", "variant": "primary" }
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Entity data table
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"base": "DataTable",
|
|
51
|
+
"entity": "Course",
|
|
52
|
+
"display": "table",
|
|
53
|
+
"columns": ["title", "difficultyLevel", "price", "publishStatus"]
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Grid with card component
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"base": "DataTable",
|
|
61
|
+
"entity": "Course",
|
|
62
|
+
"display": "grid",
|
|
63
|
+
"cardComponent": "CourseCard"
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Editable CMS block
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"base": "ContentBlock",
|
|
71
|
+
"editable": true,
|
|
72
|
+
"defaultContent": "<h2>About Us</h2><p>Learn more about our platform.</p>"
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Rules
|
|
77
|
+
|
|
78
|
+
- Component names must be PascalCase (e.g., `CourseCard`, `HeroSection`, `EnrollmentTable`)
|
|
79
|
+
- Each component referenced in the UI blueprint pages must have a definition
|
|
80
|
+
- Use entity field names that match the types blueprint exactly
|
|
81
|
+
- For entity lists, pick the 3-5 most meaningful columns (skip _id, timestamps, ownerId)
|
|
82
|
+
- For cards, map title/body/badge to the most relevant entity fields
|
|
83
|
+
- Generate realistic default content for editable blocks
|
|
84
|
+
- Actions with `href` support interpolation: `/courses/{id}`, `/users/{userId}`
|
|
85
|
+
|
|
86
|
+
## What NOT to include
|
|
87
|
+
- Do not define the entities themselves (that's types.json)
|
|
88
|
+
- Do not define routes or pages (that's ui.json)
|
|
89
|
+
- Do not define theme colors (that's theme.json)
|
|
90
|
+
- Do not include CSS or styling details
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
**User Description**: {{USER_DESCRIPTION}}
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Response Format
|
|
99
|
+
|
|
100
|
+
You MUST respond with ONLY a valid JSON object:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"version": 1,
|
|
105
|
+
"components": {
|
|
106
|
+
"HeroSection": {
|
|
107
|
+
"base": "Hero",
|
|
108
|
+
"props": { "title": "...", "subtitle": "..." }
|
|
109
|
+
},
|
|
110
|
+
"CourseCard": {
|
|
111
|
+
"base": "Card",
|
|
112
|
+
"entity": "Course",
|
|
113
|
+
"fields": { "title": "title", "body": "description", "badge": "category" },
|
|
114
|
+
"actions": [{ "label": "View", "href": "/courses/{id}" }]
|
|
115
|
+
},
|
|
116
|
+
"CourseTable": {
|
|
117
|
+
"base": "DataTable",
|
|
118
|
+
"entity": "Course",
|
|
119
|
+
"display": "table",
|
|
120
|
+
"columns": ["title", "category", "price", "status"]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**CRITICAL REQUIREMENTS**:
|
|
127
|
+
1. Return ONLY the JSON object - no markdown code blocks, no explanations
|
|
128
|
+
2. Must include `"version": 1`
|
|
129
|
+
3. Must include `"components"` with at least one component
|
|
130
|
+
4. Component names must be PascalCase
|
|
131
|
+
5. `base` must be a valid primitive from the list above
|
|
132
|
+
|
|
133
|
+
**Common Mistakes to AVOID**:
|
|
134
|
+
- Wrapping response in markdown ```json...``` blocks
|
|
135
|
+
- Using lowercase or camelCase for component names
|
|
136
|
+
- Using field names that don't exist in the types blueprint
|
|
137
|
+
- Including too many columns (stick to 3-5 most important)
|
|
138
|
+
- Forgetting to define components referenced in the UI blueprint
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# AI Roles Blueprint Generation Prompt
|
|
2
|
+
|
|
3
|
+
You are an expert in application security and access control. Generate a JSON roles blueprint based on the user's description.
|
|
4
|
+
|
|
5
|
+
**Generate ONLY the roles blueprint. Do NOT include types/entities.**
|
|
6
|
+
|
|
7
|
+
## Role Structure
|
|
8
|
+
|
|
9
|
+
Each role is an object with these properties:
|
|
10
|
+
- **label** (required): Human-readable role name
|
|
11
|
+
- **description** (required): What this role can do
|
|
12
|
+
- **isSystem** (required): Whether this is a system-managed role (permissions resolved in code)
|
|
13
|
+
- **permissions** (optional): Array of permission keys (ignored for system roles)
|
|
14
|
+
|
|
15
|
+
## Permission Format
|
|
16
|
+
|
|
17
|
+
Permission keys use lowercase with colons: `"entity:action"` or `"entity:action:scope"`
|
|
18
|
+
|
|
19
|
+
**Examples:**
|
|
20
|
+
- `"project:create"` - Create projects
|
|
21
|
+
- `"project:edit"` - Edit projects
|
|
22
|
+
- `"project:delete"` - Delete projects
|
|
23
|
+
- `"project:view"` - View projects
|
|
24
|
+
- `"user:manage"` - Manage users
|
|
25
|
+
- `"comment:create"` - Create comments
|
|
26
|
+
- `"report:view:own"` - View own reports
|
|
27
|
+
|
|
28
|
+
## Built-in Roles
|
|
29
|
+
|
|
30
|
+
Always include these two system roles:
|
|
31
|
+
|
|
32
|
+
- **USER** - Standard authenticated user (isSystem: true)
|
|
33
|
+
- **ADMIN** - Full system access (isSystem: true)
|
|
34
|
+
|
|
35
|
+
Add domain-specific roles based on the application description.
|
|
36
|
+
|
|
37
|
+
## Example
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"version": 1,
|
|
42
|
+
"roles": {
|
|
43
|
+
"USER": {
|
|
44
|
+
"label": "Standard User",
|
|
45
|
+
"description": "Standard user with basic permissions",
|
|
46
|
+
"isSystem": true,
|
|
47
|
+
"permissions": []
|
|
48
|
+
},
|
|
49
|
+
"ADMIN": {
|
|
50
|
+
"label": "Administrator",
|
|
51
|
+
"description": "Full system access",
|
|
52
|
+
"isSystem": true,
|
|
53
|
+
"permissions": []
|
|
54
|
+
},
|
|
55
|
+
"MANAGER": {
|
|
56
|
+
"label": "Manager",
|
|
57
|
+
"description": "Can manage projects and teams",
|
|
58
|
+
"isSystem": false,
|
|
59
|
+
"permissions": [
|
|
60
|
+
"project:create",
|
|
61
|
+
"project:edit",
|
|
62
|
+
"project:delete",
|
|
63
|
+
"user:manage"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"PROJECT_MEMBER": {
|
|
67
|
+
"label": "Project Member",
|
|
68
|
+
"description": "Can view and edit assigned projects",
|
|
69
|
+
"isSystem": false,
|
|
70
|
+
"permissions": [
|
|
71
|
+
"project:view",
|
|
72
|
+
"task:create",
|
|
73
|
+
"task:edit",
|
|
74
|
+
"comment:create"
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Rules
|
|
82
|
+
|
|
83
|
+
- Role keys MUST be UPPERCASE (USER, ADMIN, MANAGER), NOT lowercase or camelCase
|
|
84
|
+
- Roles MUST be objects with keys, NOT arrays
|
|
85
|
+
- Permission names use `entity:action` format (e.g., `"project:create"`, `"userProfile:view"`, `"file-upload:manage"`)
|
|
86
|
+
- System roles (USER, ADMIN) have `"isSystem": true` and empty permissions
|
|
87
|
+
- Custom roles have `"isSystem": false` and explicit permissions
|
|
88
|
+
- Derive permissions from the entities and workflows described by the user
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
**User Description**: {{USER_DESCRIPTION}}
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Response Format
|
|
97
|
+
|
|
98
|
+
You MUST respond with ONLY a valid JSON object starting with `{ "version": 1, "roles": { ... } }`.
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"version": 1,
|
|
103
|
+
"roles": {
|
|
104
|
+
"USER": {
|
|
105
|
+
"label": "Standard User",
|
|
106
|
+
"description": "Standard user with basic permissions",
|
|
107
|
+
"isSystem": true,
|
|
108
|
+
"permissions": []
|
|
109
|
+
},
|
|
110
|
+
"ADMIN": {
|
|
111
|
+
"label": "Administrator",
|
|
112
|
+
"description": "Full system access",
|
|
113
|
+
"isSystem": true,
|
|
114
|
+
"permissions": []
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**CRITICAL REQUIREMENTS**:
|
|
121
|
+
1. Return ONLY the JSON object - no markdown code blocks, no explanations, no preamble
|
|
122
|
+
2. Must include `"version": 1`
|
|
123
|
+
3. Must include `"roles"` with at least USER and ADMIN
|
|
124
|
+
4. Do NOT include types/entities - this is roles only
|
|
125
|
+
5. All keys and string values must be properly quoted
|
|
126
|
+
|
|
127
|
+
**Common Mistakes to AVOID**:
|
|
128
|
+
- Wrapping response in markdown ```json...``` blocks
|
|
129
|
+
- Including explanatory text before or after the JSON
|
|
130
|
+
- Including a "types" or "entities" section (generate roles ONLY)
|
|
131
|
+
- Using arrays for roles (must be objects with keys)
|
|
132
|
+
- Permission names without colons (use `"entity:action"` format)
|
|
133
|
+
- Lowercase role keys (must be UPPERCASE)
|