@axinom/mosaic-agent-skills 0.0.1
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 +121 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +6 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +15 -0
- package/dist/logger.js.map +1 -0
- package/dist/tools/graphql/index.d.ts +3 -0
- package/dist/tools/graphql/index.d.ts.map +1 -0
- package/dist/tools/graphql/index.js +84 -0
- package/dist/tools/graphql/index.js.map +1 -0
- package/dist/tools/graphql/tools.d.ts +71 -0
- package/dist/tools/graphql/tools.d.ts.map +1 -0
- package/dist/tools/graphql/tools.js +187 -0
- package/dist/tools/graphql/tools.js.map +1 -0
- package/dist/tools/graphql/utils.d.ts +20 -0
- package/dist/tools/graphql/utils.d.ts.map +1 -0
- package/dist/tools/graphql/utils.js +140 -0
- package/dist/tools/graphql/utils.js.map +1 -0
- package/dist/tools/skills/index.d.ts +3 -0
- package/dist/tools/skills/index.d.ts.map +1 -0
- package/dist/tools/skills/index.js +62 -0
- package/dist/tools/skills/index.js.map +1 -0
- package/dist/tools/skills/tools.d.ts +5 -0
- package/dist/tools/skills/tools.d.ts.map +1 -0
- package/dist/tools/skills/tools.js +67 -0
- package/dist/tools/skills/tools.js.map +1 -0
- package/dist/tools/skills/types.d.ts +12 -0
- package/dist/tools/skills/types.d.ts.map +1 -0
- package/dist/tools/skills/types.js +3 -0
- package/dist/tools/skills/types.js.map +1 -0
- package/dist/tools/skills/utils.d.ts +11 -0
- package/dist/tools/skills/utils.d.ts.map +1 -0
- package/dist/tools/skills/utils.js +127 -0
- package/dist/tools/skills/utils.js.map +1 -0
- package/package.json +40 -0
- package/skills/_shared/actions/execution-summary.md +53 -0
- package/skills/_shared/actions/typescript-codegen.md +32 -0
- package/skills/_shared/actions/typescript-validation.md +32 -0
- package/skills/_shared/conventions/field-component-mapping.md +155 -0
- package/skills/_shared/conventions/field-validation-schema.md +77 -0
- package/skills/_shared/discovery/discover-paths.md +52 -0
- package/skills/_shared/discovery/extract-entity-features.md +565 -0
- package/skills/generate-create-station/SKILL.md +93 -0
- package/skills/generate-create-station/refs/finalization/station-registration.md +163 -0
- package/skills/generate-create-station/refs/templates/create-form-station.md +206 -0
- package/skills/generate-create-station/refs/templates/graphql-operations.md +56 -0
- package/skills/generate-details-station/SKILL.md +125 -0
- package/skills/generate-details-station/refs/finalization/explorer-integration.md +242 -0
- package/skills/generate-details-station/refs/finalization/station-registration.md +139 -0
- package/skills/generate-details-station/refs/templates/actions.md +127 -0
- package/skills/generate-details-station/refs/templates/breadcrumb.md +67 -0
- package/skills/generate-details-station/refs/templates/details-form-station.md +589 -0
- package/skills/generate-details-station/refs/templates/details-wrapper.md +54 -0
- package/skills/generate-details-station/refs/templates/form-data-types.md +62 -0
- package/skills/generate-details-station/refs/templates/graphql-operations.md +256 -0
- package/skills/generate-details-station/refs/templates/managed-integrations/image-management-station.md +322 -0
- package/skills/generate-details-station/refs/templates/managed-integrations/video-management-station.md +283 -0
- package/skills/generate-explorer-station/SKILL.md +121 -0
- package/skills/generate-explorer-station/refs/finalization/station-registration.md +145 -0
- package/skills/generate-explorer-station/refs/select-columns-filters.md +63 -0
- package/skills/generate-explorer-station/refs/templates/bulk-edit.md +369 -0
- package/skills/generate-explorer-station/refs/templates/common/bulk-actions.md +64 -0
- package/skills/generate-explorer-station/refs/templates/common/columns.md +131 -0
- package/skills/generate-explorer-station/refs/templates/common/data-provider.md +83 -0
- package/skills/generate-explorer-station/refs/templates/common/filters.md +220 -0
- package/skills/generate-explorer-station/refs/templates/common/inline-actions.md +45 -0
- package/skills/generate-explorer-station/refs/templates/common/types.md +28 -0
- package/skills/generate-explorer-station/refs/templates/graphql-operations.md +235 -0
- package/skills/generate-explorer-station/refs/templates/navigation-explorer-station.md +144 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: field-component-mapping
|
|
3
|
+
input:
|
|
4
|
+
- EntityFeatures.fields.scalars[]
|
|
5
|
+
- EntityFeatures.fields.associations
|
|
6
|
+
output:
|
|
7
|
+
- Component selection rules for each field type
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Field Component Mapping
|
|
11
|
+
|
|
12
|
+
Maps GraphQL types to `@axinom/mosaic-ui` form components.
|
|
13
|
+
|
|
14
|
+
## Scalar Fields
|
|
15
|
+
|
|
16
|
+
| GraphQL Type | Component | Props | Notes |
|
|
17
|
+
| --------------- | ------------------------------- | ----------------------- | ---------------------------------------------- |
|
|
18
|
+
| `String` | `SingleLineTextField` | - | Use for short single-line texts (title, name) |
|
|
19
|
+
| `String` (long) | `TextAreaField` | - | Use for lengthy multi-line texts (description) |
|
|
20
|
+
| `Int` / `Float` | `SingleLineTextField` | `type="number"` | Numeric input |
|
|
21
|
+
| `Boolean` | `CheckboxField` or `RadioField` | See below | AI decides based on context |
|
|
22
|
+
| `Date` | `DateTimeTextField` | `modifyTime={false}` | Date only |
|
|
23
|
+
| `Datetime` | `DateTimeTextField` | - | Date and time |
|
|
24
|
+
| `Enum` | `SelectField` | `options={enumOptions}` | Dropdown with enum values |
|
|
25
|
+
|
|
26
|
+
## Association Fields
|
|
27
|
+
|
|
28
|
+
| Association Type | Component | Props |
|
|
29
|
+
| ----------------------- | ----------------- | ------------------------------------ |
|
|
30
|
+
| TagLike (autocomplete) | `CustomTagsField` | `liveSuggestionsResolver={resolver}` |
|
|
31
|
+
| ManyToMany (fixed list) | `TagsField` | `tagsOptions={options}` |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Examples
|
|
36
|
+
|
|
37
|
+
### String (short)
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
<Field name="title" label="Title" as={SingleLineTextField} />
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### String (long)
|
|
44
|
+
|
|
45
|
+
Detected by field name containing: `description`, `notes`, `comment`, `body`,
|
|
46
|
+
`content`
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
<Field name="description" label="Description" as={TextAreaField} />
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Int / Float
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<Field
|
|
56
|
+
type="number"
|
|
57
|
+
name="index"
|
|
58
|
+
label="Episode Index"
|
|
59
|
+
as={SingleLineTextField}
|
|
60
|
+
/>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Boolean - CheckboxField
|
|
64
|
+
|
|
65
|
+
Simple on/off toggle:
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
<Field name="allowSignUp" label="Allow Sign Up" as={CheckboxField} />
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Boolean - RadioField
|
|
72
|
+
|
|
73
|
+
Explicit labels (Active/Inactive, Enabled/Disabled):
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<Field
|
|
77
|
+
name="enabled"
|
|
78
|
+
label="Status"
|
|
79
|
+
options={[
|
|
80
|
+
{ value: true, label: 'Enabled' },
|
|
81
|
+
{ value: false, label: 'Disabled' },
|
|
82
|
+
]}
|
|
83
|
+
transform={(value: string) => JSON.parse(value)}
|
|
84
|
+
as={RadioField}
|
|
85
|
+
/>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Date
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
<Field
|
|
92
|
+
name="released"
|
|
93
|
+
label="Release Date"
|
|
94
|
+
as={DateTimeTextField}
|
|
95
|
+
modifyTime={false}
|
|
96
|
+
/>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Datetime
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
<Field name="createdAt" label="Created At" as={DateTimeTextField} />
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Enum
|
|
106
|
+
|
|
107
|
+
Extract enum values from GraphQL schema:
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
// GraphQL: enum ContentType { MAIN | TRAILER | EXTRA }
|
|
111
|
+
<Field
|
|
112
|
+
name="contentType"
|
|
113
|
+
label="Content Type"
|
|
114
|
+
options={[
|
|
115
|
+
{ value: ContentType.Main, label: 'Main' },
|
|
116
|
+
{ value: ContentType.Trailer, label: 'Trailer' },
|
|
117
|
+
{ value: ContentType.Extra, label: 'Extra' },
|
|
118
|
+
]}
|
|
119
|
+
as={SelectField}
|
|
120
|
+
/>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### TagLike (autocomplete)
|
|
124
|
+
|
|
125
|
+
With live suggestions resolver:
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
const tagsResolver = async (value: string): Promise<(string | null)[]> => {
|
|
129
|
+
const { data } = await client.query<SearchMovieTagsQuery>({
|
|
130
|
+
query: SearchMovieTagsDocument,
|
|
131
|
+
variables: { searchKey: value, limit: 10 },
|
|
132
|
+
});
|
|
133
|
+
return data.getMoviesTagsValues?.nodes ?? [];
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
<Field
|
|
137
|
+
name="tags"
|
|
138
|
+
label="Tags"
|
|
139
|
+
liveSuggestionsResolver={tagsResolver}
|
|
140
|
+
as={CustomTagsField}
|
|
141
|
+
/>;
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### ManyToMany (fixed list)
|
|
145
|
+
|
|
146
|
+
With predefined options:
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
<Field
|
|
150
|
+
name="genres"
|
|
151
|
+
label="Genres"
|
|
152
|
+
tagsOptions={genresOptions}
|
|
153
|
+
as={TagsField}
|
|
154
|
+
/>
|
|
155
|
+
```
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: field-validation-schema
|
|
3
|
+
input:
|
|
4
|
+
- EntityFeatures.fields.scalars[]
|
|
5
|
+
output:
|
|
6
|
+
- Yup validation schema rules
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Field Validation Schema
|
|
10
|
+
|
|
11
|
+
Yup validation patterns based on existing implementations.
|
|
12
|
+
|
|
13
|
+
## Validation Mapping
|
|
14
|
+
|
|
15
|
+
| GraphQL Type | Yup Validation | Notes |
|
|
16
|
+
| ----------------- | ----------------------------------- | ------------------------------------------------------ |
|
|
17
|
+
| `String` | `Yup.string().max(length).min(min)` | Use `scalar.constraints.maxLength/minLength` if exists |
|
|
18
|
+
| `Int` | `Yup.number().integer().positive()` | Positive integers |
|
|
19
|
+
| `Float` | `Yup.number().positive()` | Positive numbers |
|
|
20
|
+
| `Boolean` | `Yup.boolean()` | Boolean validation |
|
|
21
|
+
| `Date`/`Datetime` | `Yup.date()` | Date validation |
|
|
22
|
+
| `Enum` | `Yup.string()` | SelectField handles validation |
|
|
23
|
+
|
|
24
|
+
## Required Fields
|
|
25
|
+
|
|
26
|
+
Add `.required('{Label} is a required field')` if `scalar.isRequired === true`
|
|
27
|
+
|
|
28
|
+
## Optional Fields
|
|
29
|
+
|
|
30
|
+
Add `.nullable()` if `scalar.isRequired === false`
|
|
31
|
+
|
|
32
|
+
## String Length Constraints
|
|
33
|
+
|
|
34
|
+
- Use `scalar.constraints.maxLength` if available
|
|
35
|
+
- Use `scalar.constraints.minLength` if available
|
|
36
|
+
- Only add `.max()` or `.min()` when constraint exists
|
|
37
|
+
|
|
38
|
+
## Example Schema
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
const {entityCamel}DetailSchema = Yup.object<
|
|
42
|
+
ObjectSchemaDefinition<{Entity}DetailsFormData>
|
|
43
|
+
>({
|
|
44
|
+
// String field with maxLength constraint (required)
|
|
45
|
+
// scalar.constraints.maxLength = 100
|
|
46
|
+
title: Yup.string()
|
|
47
|
+
.required('Title is a required field')
|
|
48
|
+
.max(100),
|
|
49
|
+
|
|
50
|
+
// String field with no constraints (optional)
|
|
51
|
+
externalId: Yup.string().nullable(),
|
|
52
|
+
|
|
53
|
+
// String field with both minLength and maxLength (optional)
|
|
54
|
+
// scalar.constraints.minLength = 3, maxLength = 50
|
|
55
|
+
code: Yup.string()
|
|
56
|
+
.min(3)
|
|
57
|
+
.max(50)
|
|
58
|
+
.nullable(),
|
|
59
|
+
|
|
60
|
+
// Number field (required)
|
|
61
|
+
index: Yup.number()
|
|
62
|
+
.integer()
|
|
63
|
+
.positive('Index must be a positive number')
|
|
64
|
+
.required('Index is a required field'),
|
|
65
|
+
|
|
66
|
+
// Boolean field (required)
|
|
67
|
+
enabled: Yup.boolean().required(),
|
|
68
|
+
|
|
69
|
+
// Date field (optional)
|
|
70
|
+
released: Yup.date().nullable(),
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Notes
|
|
75
|
+
|
|
76
|
+
- Only add `.max()` or `.min()` when `scalar.constraints` contains the value
|
|
77
|
+
- Numbers default to `.positive()`
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: discover-paths
|
|
3
|
+
input:
|
|
4
|
+
- Entity name (e.g., Movie, ServiceAccount, Aircraft)
|
|
5
|
+
output:
|
|
6
|
+
- DiscoveredPaths object
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Discover Project Paths
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
interface DiscoveredPaths {
|
|
13
|
+
/**
|
|
14
|
+
* Absolute path to GraphQL schema file.
|
|
15
|
+
* Discovery: Search for `type {EntityName}` in `services/%/service/src/generated/graphql/schema.graphql` files.
|
|
16
|
+
* If multiple or none found → ask user which service.
|
|
17
|
+
*/
|
|
18
|
+
schemaPath: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Path to Apollo Client instance.
|
|
22
|
+
* Discovery: Search for `export.%client.%ApolloClient` in `workflows/src/` (typically `apolloClient.ts` or `client.ts`)
|
|
23
|
+
*/
|
|
24
|
+
apolloClientPath: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Path to codegen output directory.
|
|
28
|
+
* Typically a `graphql.tsx` file inside a `generated` folder such as `workflows/src/generated`.
|
|
29
|
+
*/
|
|
30
|
+
generatedTypesPath: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Path to workflows directory.
|
|
34
|
+
* Typically `services/{serviceName}/workflows`
|
|
35
|
+
*/
|
|
36
|
+
workflowsPath: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Service name (e.g., "media", "fleet", "video").
|
|
40
|
+
* Extract from schema path: `services/{serviceName}/service/...`
|
|
41
|
+
* Used in extract phase to compute `serviceId` and `permissions`.
|
|
42
|
+
*/
|
|
43
|
+
serviceName: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Path to `ExtensionsContext` export.
|
|
47
|
+
* Discovery: Search for `export.*ExtensionsContext` in `workflows/src/` (typically `workflows/src/externals/piralExtensions.tsx`)
|
|
48
|
+
* If not found: Skip dependencies of `ExtensionsContext` (i.e. for image/video rendering) and add a `TODO`
|
|
49
|
+
*/
|
|
50
|
+
extensionsContextPath?: string;
|
|
51
|
+
}
|
|
52
|
+
```
|