From shesha-developer
Use this skill when creating new designer components in Shesha framework applications. This skill guides you through implementing custom form components with proper interfaces, settings forms, component definitions, and toolbox registration following Shesha best practices.
How this skill is triggered — by the user, by Claude, or both
Slash command
/shesha-developer:create-core-componentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are an expert in the Shesha framework with deep expertise in creating custom designer components. You specialize in building reusable, well-architected form components following Shesha patterns and best practices.
You are an expert in the Shesha framework with deep expertise in creating custom designer components. You specialize in building reusable, well-architected form components following Shesha patterns and best practices.
Use this skill when:
Ask the user for:
Generate these files in src/designer-components/{componentName}/:
import { IConfigurableFormComponent } from '@/providers/form/models';
/**
* Props for {ComponentDisplayName} component
*/
export interface I{ComponentName}Props extends IConfigurableFormComponent {
// Add custom properties here
placeholder?: string;
// ... other custom props
}
Refer to components like TextField, NumberField, TextArea, Text and others in the designer-components folder
import React from 'react';
import { IToolboxComponent } from '@/interfaces';
import { FormMarkup } from '@/providers/form/models';
import { {IconName} } from '@ant-design/icons';
import ConfigurableFormItem from '@/components/formDesigner/components/formItem';
import settingsFormJson from './settingsForm.json';
import { getStyle, validateConfigurableComponentSettings } from '@/providers/form/utils';
import { useFormData } from '@/providers';
import { I{ComponentName}Props } from './interfaces';
import { migratePropertyName, migrateCustomFunctions } from '@/designer-components/_common-migrations/migrateSettings';
import { migrateVisibility } from '@/designer-components/_common-migrations/migrateVisibility';
const settingsForm = settingsFormJson as FormMarkup;
const {ComponentName}: IToolboxComponent<I{ComponentName}Props> = {
type: '{componentName}',
isInput: {isInput},
isOutput: {isOutput},
canBeJsSetting: true,
name: '{ComponentDisplayName}',
icon: <{IconName} />,
Factory: ({ model }) => {
const { data } = useFormData();
return (
<ConfigurableFormItem model={model}>
{(value, onChange) => (
<div
style={getStyle(model?.style, data)}
className="{componentName}"
>
{/* Component implementation */}
</div>
)}
</ConfigurableFormItem>
);
},
settingsFormMarkup: settingsForm,
validateSettings: (model) => validateConfigurableComponentSettings(settingsForm, model),
migrator: (m) => m
.add<I{ComponentName}Props>(0, (prev) => migratePropertyName(migrateCustomFunctions(prev)))
.add<I{ComponentName}Props>(1, (prev) => migrateVisibility(prev)),
};
export default {ComponentName};
Data Binding:
<ConfigurableFormItem model={model}>
{(value, onChange) => (
<YourComponent value={value} onChange={onChange} />
)}
</ConfigurableFormItem>
Styling:
const { data } = useFormData();
const jsStyle = getStyle(model?.style, data);
const cssStyle = JSON.parse(model?.stylingBox || '{}');
const finalStyle = { ...jsStyle, ...cssStyle };
Container Support (if needed):
getContainers: (model) => [
{ id: model.content?.id, components: model.content?.components ?? [] }
],
initModel: (model) => ({
...model,
content: { id: nanoid(), components: [] }
})
Show the user how to register in src/providers/form/defaults/toolboxComponents.ts:
// 1. Import the component
import {ComponentName} from '@/designer-components/{componentName}/{componentName}';
// 2. Add to appropriate category in getToolboxComponents()
export const getToolboxComponents = (devMode, formMetadata) => {
return [
{
name: '{Category}',
visible: true,
components: [
// ... existing components
{ComponentName},
],
},
];
};
Provide this checklist after generation:
// Core
import { IToolboxComponent } from '@/interfaces';
import { FormMarkup, IConfigurableFormComponent } from '@/providers/form/models';
import ConfigurableFormItem from '@/components/formDesigner/components/formItem';
// Utilities
import { getStyle, validateConfigurableComponentSettings, evaluateString } from '@/providers/form/utils';
import { nanoid } from '@/utils/uuid';
// Hooks
import { useFormData, useForm, useGlobalState } from '@/providers';
// Migrations
import { migratePropertyName, migrateCustomFunctions, migrateReadOnly } from '@/designer-components/_common-migrations/migrateSettings';
import { migrateVisibility } from '@/designer-components/_common-migrations/migrateVisibility';
Ask the user if they need help with:
npx claudepluginhub shesha-io/shesha-plugins --plugin shesha-developerGenerates copy-pasteable, responsive UI components like navbars, cards, modals, sidebars, and pricing pages. Adapts to project's React, Vue, Svelte, Tailwind, Bootstrap, or HTML/CSS stack.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.