@pega/sdk 0.0.2 → 0.0.3
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/dist/index.js +2 -2
- package/package.json +1 -1
- package/templates/react-sdk-reference/.claude/instructions/component-map.md +38 -0
- package/templates/react-sdk-reference/.claude/instructions/dse-component.md +75 -0
- package/templates/react-sdk-reference/.claude/instructions/field-component.md +71 -0
- package/templates/react-sdk-reference/.claude/instructions/template-component.md +92 -0
- package/templates/react-sdk-reference/.claude/instructions/widget-component.md +87 -0
- package/templates/react-sdk-reference/.claude/prompts/add-component.md +144 -0
- package/templates/react-sdk-reference/.claude/prompts/component-manifest.json +111 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-all-components.md +149 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-dse-components.md +126 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-field-components.md +139 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-template-components.md +151 -0
- package/templates/react-sdk-reference/.claude/prompts/generate-widget-components.md +124 -0
- package/templates/react-sdk-reference/.claude/prompts/identify-components.md +105 -0
- package/templates/react-sdk-reference/.claude/prompts/replace-design-system.md +519 -0
- package/templates/react-sdk-reference/.claude/skills/component-contracts.md +140 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/AlertBanner.md +135 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Banner.md +149 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/CaseSummaryFields.md +154 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/DetailsFields.md +144 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldGroup.md +131 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldGroupList.md +111 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/FieldValueList.md +115 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Operator.md +149 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/Pulse.md +83 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/RichTextEditor.md +206 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension-skills/WssQuickCreate.md +135 -0
- package/templates/react-sdk-reference/.claude/skills/design-system-extension.md +289 -0
- package/templates/react-sdk-reference/.claude/skills/field-components.md +294 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/AutoComplete.md +112 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/CancelAlert.md +203 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Checkbox.md +158 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Currency.md +106 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Date.md +99 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/DateTime.md +103 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Decimal.md +98 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Dropdown.md +114 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Email.md +107 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Group.md +90 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Integer.md +87 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Location.md +136 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Multiselect.md +164 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/ObjectReference.md +164 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Percentage.md +92 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Phone.md +110 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/RadioButtons.md +146 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/RichText.md +138 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/ScalarList.md +124 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/SelectableCard.md +216 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/SemanticLink.md +148 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/TextArea.md +96 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/TextContent.md +101 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/TextInput.md +104 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/Time.md +88 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/URL.md +85 -0
- package/templates/react-sdk-reference/.claude/skills/field-skills/UserReference.md +180 -0
- package/templates/react-sdk-reference/.claude/skills/run-and-verify.md +68 -0
- package/templates/react-sdk-reference/.claude/skills/template-components.md +322 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/AdvancedSearch.md +144 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/AppShell.md +122 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/BannerPage.md +83 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseSummary.md +100 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseView.md +131 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/CaseViewActionsMenu.md +126 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/Confirmation.md +107 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DataReference.md +120 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DefaultForm.md +102 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DefaultPage.md +110 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/Details.md +88 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsSubTabs.md +95 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsThreeColumn.md +78 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DetailsTwoColumn.md +78 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/DynamicTabs.md +101 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/FieldGroupTemplate.md +109 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/HierarchicalForm.md +113 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/InlineDashboard.md +104 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/InlineDashboardPage.md +85 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/ListPage.md +68 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/ListView.md +139 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/MultiReferenceReadOnly.md +80 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/NarrowWide.md +141 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/OneColumn.md +109 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/PromotedFilters.md +124 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/SelfServiceCaseView.md +135 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/SimpleTable.md +127 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/SingleReferenceReadOnly.md +103 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/SubTabs.md +79 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/TwoColumn.md +131 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/WideNarrow.md +150 -0
- package/templates/react-sdk-reference/.claude/skills/template-skills/WssNavBar.md +135 -0
- package/templates/react-sdk-reference/.claude/skills/widget-components.md +271 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/AppAnnouncement.md +82 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/Attachment.md +146 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/CaseHistory.md +107 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/FileUtility.md +200 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/Followers.md +99 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/QuickCreate.md +114 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/SummaryItem.md +167 -0
- package/templates/react-sdk-reference/.claude/skills/widget-skills/ToDo.md +190 -0
- package/templates/react-sdk-reference/.cursor/rules/component-map.mdrules +41 -0
- package/templates/react-sdk-reference/.cursor/rules/dse-component.mdrules +78 -0
- package/templates/react-sdk-reference/.cursor/rules/field-component.mdrules +74 -0
- package/templates/react-sdk-reference/.cursor/rules/pega-sdk.mdrules +247 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/add-component.mdrules +149 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/component-manifest.json +111 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-all-components.mdrules +154 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-dse-components.mdrules +131 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-field-components.mdrules +144 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-template-components.mdrules +156 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/generate-widget-components.mdrules +129 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/identify-components.mdrules +110 -0
- package/templates/react-sdk-reference/.cursor/rules/prompts/replace-design-system.mdrules +524 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/component-contracts.mdrules +145 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/AlertBanner.mdrules +140 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Banner.mdrules +154 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/CaseSummaryFields.mdrules +159 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/DetailsFields.mdrules +149 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldGroup.mdrules +136 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldGroupList.mdrules +116 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/FieldValueList.mdrules +120 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Operator.mdrules +154 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/Pulse.mdrules +88 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/RichTextEditor.mdrules +211 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension-skills/WssQuickCreate.mdrules +140 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/design-system-extension.mdrules +294 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-components.mdrules +299 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/AutoComplete.mdrules +117 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/CancelAlert.mdrules +208 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Checkbox.mdrules +163 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Currency.mdrules +111 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Date.mdrules +104 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/DateTime.mdrules +108 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Decimal.mdrules +103 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Dropdown.mdrules +119 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Email.mdrules +112 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Group.mdrules +95 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Integer.mdrules +92 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Location.mdrules +141 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Multiselect.mdrules +169 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/ObjectReference.mdrules +169 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Percentage.mdrules +97 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Phone.mdrules +115 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/RadioButtons.mdrules +151 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/RichText.mdrules +143 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/ScalarList.mdrules +129 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/SelectableCard.mdrules +221 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/SemanticLink.mdrules +153 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextArea.mdrules +101 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextContent.mdrules +106 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/TextInput.mdrules +109 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/Time.mdrules +93 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/URL.mdrules +90 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/field-skills/UserReference.mdrules +185 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/run-and-verify.mdrules +73 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-components.mdrules +327 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/AdvancedSearch.mdrules +149 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/AppShell.mdrules +127 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/BannerPage.mdrules +88 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseSummary.mdrules +105 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseView.mdrules +136 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/CaseViewActionsMenu.mdrules +131 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/Confirmation.mdrules +112 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DataReference.mdrules +125 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DefaultForm.mdrules +107 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DefaultPage.mdrules +115 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/Details.mdrules +93 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsSubTabs.mdrules +100 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsThreeColumn.mdrules +83 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DetailsTwoColumn.mdrules +83 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/DynamicTabs.mdrules +106 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/FieldGroupTemplate.mdrules +114 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/HierarchicalForm.mdrules +118 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/InlineDashboard.mdrules +109 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/InlineDashboardPage.mdrules +90 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/ListPage.mdrules +73 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/ListView.mdrules +144 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/MultiReferenceReadOnly.mdrules +85 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/NarrowWide.mdrules +146 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/OneColumn.mdrules +114 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/PromotedFilters.mdrules +129 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SelfServiceCaseView.mdrules +140 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SimpleTable.mdrules +132 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SingleReferenceReadOnly.mdrules +108 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/SubTabs.mdrules +84 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/TwoColumn.mdrules +136 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/WideNarrow.mdrules +155 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/template-skills/WssNavBar.mdrules +140 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-components.mdrules +276 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/AppAnnouncement.mdrules +87 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/Attachment.mdrules +151 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/CaseHistory.mdrules +112 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/FileUtility.mdrules +205 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/Followers.mdrules +104 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/QuickCreate.mdrules +119 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/SummaryItem.mdrules +172 -0
- package/templates/react-sdk-reference/.cursor/rules/skills/widget-skills/ToDo.mdrules +195 -0
- package/templates/react-sdk-reference/.cursor/rules/template-component.mdrules +95 -0
- package/templates/react-sdk-reference/.cursor/rules/widget-component.mdrules +90 -0
- package/templates/react-sdk-reference/.github/copilot-instructions.md +58 -0
- package/templates/react-sdk-reference/.github/prompts/add-component.prompt.md +144 -16
- package/templates/react-sdk-reference/.github/prompts/generate-all-components.prompt.md +154 -0
- package/templates/react-sdk-reference/.github/prompts/generate-dse-components.prompt.md +131 -0
- package/templates/react-sdk-reference/.github/prompts/generate-field-components.prompt.md +144 -0
- package/templates/react-sdk-reference/.github/prompts/generate-template-components.prompt.md +156 -0
- package/templates/react-sdk-reference/.github/prompts/generate-widget-components.prompt.md +129 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension.md +58 -18
- package/templates/react-sdk-reference/.github/skills/field-components.md +55 -23
- package/templates/react-sdk-reference/.github/skills/template-components.md +48 -11
- package/templates/react-sdk-reference/.github/skills/widget-components.md +49 -12
- package/templates/react-sdk-reference/AGENTS.md +217 -29
- package/templates/react-sdk-reference/package.json +1 -1
- package/templates/react-sdk-reference/pega-constellationjs-0.26.3-local.tgz +0 -0
- package/templates/react-sdk-reference/pega-sdk-react-0.1.0.tgz +0 -0
- package/templates/react-sdk-reference/sdk-config.json +1 -1
- package/templates/react-sdk-reference/vite.config.ts +1 -1
- package/templates/react-sdk-reference/.github/prompts/replace-all-fields.prompt.md +0 -48
- package/templates/react-sdk-reference/.github/prompts/replace-component.prompt.md +0 -81
- package/templates/react-sdk-reference/.github/prompts/replace-field.prompt.md +0 -41
- package/templates/react-sdk-reference/.github/prompts/swap-design-system.prompt.md +0 -49
- package/templates/react-sdk-reference/.github/skills/swap-design-system.md +0 -105
- package/templates/react-sdk-reference/pega-constellationjs-0.26.2.tgz +0 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
---
|
|
2
|
+
alwaysApply: true
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Pega SDK — Cursor Rules
|
|
6
|
+
|
|
7
|
+
You are assisting developers in a React reference application that demonstrates the Pega Infinity SDK. Customers clone this repo and **replace the sample UI components with their own design system** (MUI, Chakra, Radix, Shadcn, Ant Design, or any other).
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. Repository Purpose
|
|
12
|
+
|
|
13
|
+
This is a **reference implementation** — not a framework. The UI components (fields, templates, widgets) are intentionally simple MUI-based implementations meant to be swapped out. The SDK wiring (bootstrap, PConnect bridge, component registry) is reusable infrastructure that should NOT be modified.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 2. What Is Replaceable vs. Infrastructure
|
|
18
|
+
|
|
19
|
+
### Replaceable (customer modifies these)
|
|
20
|
+
|
|
21
|
+
| Directory | Purpose |
|
|
22
|
+
| --------------------------------------- | ----------------------------------------------------------- |
|
|
23
|
+
| `src/components/field/` | Form field components (TextInput, Dropdown, Date, etc.) |
|
|
24
|
+
| `src/components/template/` | Layout templates (OneColumn, TwoColumn, Details, etc.) |
|
|
25
|
+
| `src/components/widget/` | Data widgets (ToDo, Attachment, CaseHistory, etc.) |
|
|
26
|
+
| `src/components/designSystemExtension/` | Extended UI (AlertBanner, FieldGroup, RichTextEditor, etc.) |
|
|
27
|
+
|
|
28
|
+
### Infrastructure (do NOT modify unless you know what you're doing)
|
|
29
|
+
|
|
30
|
+
| File/Directory | Purpose |
|
|
31
|
+
| --------------------------------------- | --------------------------------------------------------- |
|
|
32
|
+
| `src/MashupApp.tsx` | Auth + bootstrap + root rendering |
|
|
33
|
+
| `src/components/component-map.ts` | Registry wiring (only add/remove entries) |
|
|
34
|
+
| `src/components/infra/` | Infrastructure components (ActionButtons, Stages, NavBar) |
|
|
35
|
+
| `src/components/helpers/event-utils.ts` | PConnect event handler utility |
|
|
36
|
+
| `@pega/sdk-react` | SDK bridge — never modify |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 3. Component Architecture
|
|
41
|
+
|
|
42
|
+
### The PConnect Bridge
|
|
43
|
+
|
|
44
|
+
Every component receives `getPConnect` as a prop. This is the bridge to the Pega platform:
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
const pConn = getPConnect();
|
|
48
|
+
const actions = pConn.getActionsApi(); // For field updates
|
|
49
|
+
const propName = (pConn.getStateProps() as any).value; // Property path
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Event Handling Pattern
|
|
53
|
+
|
|
54
|
+
All field components use this pattern for two-way binding:
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import handleEvent from '../../helpers/event-utils';
|
|
58
|
+
|
|
59
|
+
// On change (local state only):
|
|
60
|
+
function handleChange(event) {
|
|
61
|
+
setInputValue(event.target.value);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// On blur (push to platform):
|
|
65
|
+
function handleBlur() {
|
|
66
|
+
handleEvent(actions, 'changeNblur', propName, inputValue);
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Display Mode Handling
|
|
71
|
+
|
|
72
|
+
Field components must handle `displayMode` prop:
|
|
73
|
+
|
|
74
|
+
- `undefined` → render editable input
|
|
75
|
+
- `'DISPLAY_ONLY'` → render read-only value via `FieldValueList`
|
|
76
|
+
- `'STACKED_LARGE_VAL'` → render stacked read-only via `FieldValueList` with `variant='stacked'`
|
|
77
|
+
|
|
78
|
+
### Component Registry
|
|
79
|
+
|
|
80
|
+
Components are registered by name in `src/components/component-map.ts`:
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
import { sdkComponents } from '@pega/sdk-react';
|
|
84
|
+
|
|
85
|
+
function getSampleComponentMap() {
|
|
86
|
+
return {
|
|
87
|
+
...sdkComponents, // Infrastructure (View, Region, FlowContainer, etc.)
|
|
88
|
+
TextInput, // Your field components
|
|
89
|
+
Dropdown,
|
|
90
|
+
// ...
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
To add a new component: add the import + add to the map object.
|
|
96
|
+
To replace a component: change the import to point to your new implementation.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 4. Props Interfaces
|
|
101
|
+
|
|
102
|
+
### Field Components (`PConnFieldProps`)
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
106
|
+
|
|
107
|
+
interface PConnFieldProps {
|
|
108
|
+
getPConnect: () => typeof PConnect;
|
|
109
|
+
label: string;
|
|
110
|
+
required: boolean;
|
|
111
|
+
disabled: boolean;
|
|
112
|
+
value?: string;
|
|
113
|
+
validatemessage: string;
|
|
114
|
+
status?: string; // 'error' | 'warning' | undefined
|
|
115
|
+
onChange: any;
|
|
116
|
+
onBlur?: any;
|
|
117
|
+
readOnly: boolean;
|
|
118
|
+
testId: string;
|
|
119
|
+
helperText: string;
|
|
120
|
+
displayMode?: string; // 'DISPLAY_ONLY' | 'STACKED_LARGE_VAL'
|
|
121
|
+
hideLabel: boolean;
|
|
122
|
+
placeholder?: string;
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Template/Widget Components (`PConnProps`)
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
130
|
+
|
|
131
|
+
interface PConnProps {
|
|
132
|
+
getPConnect: () => typeof PConnect;
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 5. Rules for Replacing Components
|
|
139
|
+
|
|
140
|
+
1. **Keep the same default export name** — the component-map references it.
|
|
141
|
+
2. **Keep `getPConnect` wiring intact** — extract props, call `handleEvent` on blur.
|
|
142
|
+
3. **Handle `displayMode`** — return `FieldValueList` for read-only modes.
|
|
143
|
+
4. **Handle validation** — show `validatemessage` when `status === 'error'`.
|
|
144
|
+
5. **Preserve `data-test-id`** — pass `testId` to the root interactive element.
|
|
145
|
+
6. **Use `getComponentFromRegistry`** to render sub-components (e.g., `FieldValueList`) — don't hardcode imports for components that might also be replaced.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 6. Build & Dev Commands
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# From monorepo root (if developing locally with source packages):
|
|
153
|
+
npm run build # Build all packages + samples
|
|
154
|
+
npm run dev:react # Build + dev server
|
|
155
|
+
|
|
156
|
+
# From this directory (standalone):
|
|
157
|
+
npm run dev # Vite dev server (port 3500)
|
|
158
|
+
npm run build # Production build
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 7. Key Imports
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
// From SDK (never modify these)
|
|
167
|
+
import {
|
|
168
|
+
PConnectComponent,
|
|
169
|
+
PegaStoreContext,
|
|
170
|
+
registerComponentCreator,
|
|
171
|
+
getComponentFromRegistry,
|
|
172
|
+
sdkComponents,
|
|
173
|
+
} from '@pega/sdk-react';
|
|
174
|
+
import type { PConnProps, PConnFieldProps } from '@pega/sdk-react';
|
|
175
|
+
|
|
176
|
+
// Event utility (preserve this)
|
|
177
|
+
import handleEvent from '../../helpers/event-utils';
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 8. Do NOT
|
|
183
|
+
|
|
184
|
+
- Modify `MashupApp.tsx` bootstrap flow when replacing design system components.
|
|
185
|
+
- Import from `@pega/sdk-react/src/...` — use the package entry point only.
|
|
186
|
+
- Hardcode component references — use `getComponentFromRegistry('Name')` for components that may be overridden.
|
|
187
|
+
- Remove the `...sdkComponents` spread from `component-map.ts`.
|
|
188
|
+
- Use `any` without justification — prefer `unknown` and narrow.
|
|
189
|
+
- Add `@ts-ignore` — use `@ts-expect-error` with explanation if truly needed.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 9. Component Generation Workflow — Single Component
|
|
194
|
+
|
|
195
|
+
When the user asks to generate, create, add, or replace **a single UI component** (e.g., "generate an AutoComplete component", "add a Dropdown using Chakra UI"),
|
|
196
|
+
read the full contents of `.cursor/rules/prompts/add-component.mdrules` and
|
|
197
|
+
execute every step in order before writing any code.
|
|
198
|
+
Do not skip steps or proceed without reading the required skill files first.
|
|
199
|
+
|
|
200
|
+
> For generating **multiple field components** at once, see Section 10.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## 10. Batch Field Component Generation
|
|
205
|
+
|
|
206
|
+
When the user asks to generate, create, or replace **multiple field components** or **all field components** with a design system (e.g., "generate field components with Ant Design", "replace all fields with Chakra UI", "generate all field components using Radix"),
|
|
207
|
+
read the full contents of `.cursor/rules/prompts/generate-field-components.mdrules` and
|
|
208
|
+
execute every step in order before writing any code.
|
|
209
|
+
Do not skip steps or proceed without reading the required skill files first.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 11. Batch Template Component Generation
|
|
214
|
+
|
|
215
|
+
When the user asks to generate, create, or replace **multiple template components** or **all template components** with a design system (e.g., "generate template components with Ant Design", "replace all templates with Chakra UI", "generate layout templates using Radix"),
|
|
216
|
+
read the full contents of `.cursor/rules/prompts/generate-template-components.mdrules` and
|
|
217
|
+
execute every step in order before writing any code.
|
|
218
|
+
Do not skip steps or proceed without reading the required skill files first.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## 12. Batch Widget Component Generation
|
|
223
|
+
|
|
224
|
+
When the user asks to generate, create, or replace **multiple widget components** or **all widget components** with a design system (e.g., "generate widget components with Ant Design", "replace all widgets with Chakra UI", "generate widgets using Carbon"),
|
|
225
|
+
read the full contents of `.cursor/rules/prompts/generate-widget-components.mdrules` and
|
|
226
|
+
execute every step in order before writing any code.
|
|
227
|
+
Do not skip steps or proceed without reading the required skill files first.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 13. Batch Design System Extension Component Generation
|
|
232
|
+
|
|
233
|
+
When the user asks to generate, create, or replace **multiple design system extension components** or **all DSE components** with a design system (e.g., "generate DSE components with Ant Design", "replace design system extension components with Chakra UI", "generate designSystemExtension components using Carbon"),
|
|
234
|
+
read the full contents of `.cursor/rules/prompts/generate-dse-components.mdrules` and
|
|
235
|
+
execute every step in order before writing any code.
|
|
236
|
+
Do not skip steps or proceed without reading the required skill files first.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## 14. Generate All Components (Multi-Type)
|
|
241
|
+
|
|
242
|
+
When the user asks to generate, create, or replace components across **multiple types** or **all component types** at once (e.g., "generate all components with Ant Design", "replace everything with Chakra UI", "generate field and widget components using Carbon", "regenerate all components"),
|
|
243
|
+
read the full contents of `.cursor/rules/prompts/generate-all-components.mdrules` and
|
|
244
|
+
execute every step in order before writing any code.
|
|
245
|
+
Do not skip steps or proceed without reading the required skill files first.
|
|
246
|
+
|
|
247
|
+
> Use this section when the request spans more than one component type. For a single type, use Sections 10–13.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: add-component.prompt
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Step 0 — Resolve missing information
|
|
7
|
+
|
|
8
|
+
Read the user's message carefully. Extract:
|
|
9
|
+
|
|
10
|
+
- **Component name** — the exact name (e.g. `AutoComplete`, `DatePicker`)
|
|
11
|
+
- **Component type** — one of: `field` | `template` | `widget` | `designSystemExtension`
|
|
12
|
+
- **Design system** — the UI library to use (e.g. `Ant Design`, `Chakra UI`, `Carbon`, `Radix UI`)
|
|
13
|
+
- **Output path** — the exact or relative path where the component should be generated (e.g. `src/components/field/AutoComplete`)
|
|
14
|
+
|
|
15
|
+
If any of the four are missing or ambiguous, ask the user all unresolved items in **one numbered list** and wait for their answers before continuing. Do not guess or proceed with assumptions.
|
|
16
|
+
|
|
17
|
+
Example questions to ask (only ask the ones that are actually missing):
|
|
18
|
+
1. Which design system should I use? (e.g. Ant Design, Chakra UI, Carbon, Radix UI)
|
|
19
|
+
2. What is the exact component name?
|
|
20
|
+
3. What type of component is this? (field / template / widget / designSystemExtension)
|
|
21
|
+
4. What is the exact or relative path where the component should be generated? (e.g. `src/components/field/AutoComplete`)
|
|
22
|
+
|
|
23
|
+
### Case-insensitive component name matching
|
|
24
|
+
|
|
25
|
+
The user may enter the component name in any casing (e.g. `autocomplete`, `Autocomplete`, `autoComplete`). It is your responsibility to match it to the correct canonical name by checking the skill files in `.cursor/rules/skills/field-skills/`, `.cursor/rules/skills/template-skills/`, `.cursor/rules/skills/widget-skills/`, and `.cursor/rules/skills/design-system-extension-skills/`. For example, if the user types `autocomplete`, match it to `AutoComplete`.
|
|
26
|
+
|
|
27
|
+
Once all four are known, continue to Step 1.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Step 1 — Check for existing component (overwrite check)
|
|
32
|
+
|
|
33
|
+
Before generating, check if a component already exists at the resolved output path:
|
|
34
|
+
|
|
35
|
+
1. Check if `<outputPath>/<ComponentName>.tsx` (or the directory) already exists.
|
|
36
|
+
2. If it **does exist**, ask the user: _"A component named `<ComponentName>` already exists at `<outputPath>`. Do you want to overwrite it with the new implementation?"_
|
|
37
|
+
- If the user says **yes**, proceed to overwrite.
|
|
38
|
+
- If the user says **no**, stop and skip generation.
|
|
39
|
+
3. If it **does not exist**, continue to Step 2.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Step 2 — Check for skill files
|
|
44
|
+
|
|
45
|
+
Always read the **general type skill** for the component type:
|
|
46
|
+
|
|
47
|
+
| Component Type | General Skill File |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `field` | `.cursor/rules/skills/field-components.mdrules` |
|
|
50
|
+
| `template` | `.cursor/rules/skills/template-components.mdrules` |
|
|
51
|
+
| `widget` | `.cursor/rules/skills/widget-components.mdrules` |
|
|
52
|
+
| `designSystemExtension` | `.cursor/rules/skills/design-system-extension.mdrules` |
|
|
53
|
+
|
|
54
|
+
Then look for a **component-specific skill** based on the component type:
|
|
55
|
+
|
|
56
|
+
| Component Type | Specific Skill Location |
|
|
57
|
+
|---|---|
|
|
58
|
+
| `field` | `.cursor/rules/skills/field-skills/<ComponentName>.mdrules` |
|
|
59
|
+
| `template` | `.cursor/rules/skills/template-skills/<ComponentName>.mdrules` |
|
|
60
|
+
| `widget` | `.cursor/rules/skills/widget-skills/<ComponentName>.mdrules` |
|
|
61
|
+
| `designSystemExtension` | `.cursor/rules/skills/design-system-extension-skills/<ComponentName>.mdrules` |
|
|
62
|
+
|
|
63
|
+
If the component-specific skill file exists, read it fully. Pay special attention to:
|
|
64
|
+
- **Behavioral Contract** — state management, event handling, option loading, edge cases
|
|
65
|
+
- **Design System Mapping** table — the recommended component for the chosen design system
|
|
66
|
+
|
|
67
|
+
You must read **both** the general type skill and the component-specific skill (if it exists) before proceeding.
|
|
68
|
+
|
|
69
|
+
Examples:
|
|
70
|
+
- `AutoComplete` (field) → read `field-components.md` + `field-skills/AutoComplete.md`
|
|
71
|
+
- `AdvancedSearch` (template) → read `template-components.md` + `template-skills/AdvancedSearch.md`
|
|
72
|
+
- `AppAnnouncement` (widget) → read `widget-components.md` + `widget-skills/AppAnnouncement.md`
|
|
73
|
+
- `AlertBanner` (designSystemExtension) → read `design-system-extension.md` + `design-system-extension-skills/AlertBanner.md`
|
|
74
|
+
|
|
75
|
+
If no component-specific skill file exists, continue using the general pattern from the type skill.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Step 3 — Check and install dependencies
|
|
80
|
+
|
|
81
|
+
Run:
|
|
82
|
+
```
|
|
83
|
+
cat package.json | grep "<design-system-package>"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
If the design system package is **not** listed in `dependencies` or `devDependencies`, install it:
|
|
87
|
+
```
|
|
88
|
+
npm install <design-system-package>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Also install any peer dependencies documented in the package's README. Report what was installed.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Step 4 — Discover the design system's API
|
|
96
|
+
|
|
97
|
+
Before writing any code, inspect the installed package:
|
|
98
|
+
|
|
99
|
+
1. `cat node_modules/<designSystem>/README.md` — note the correct import path and usage patterns for the installed version.
|
|
100
|
+
2. `grep "^export" node_modules/<designSystem>/dist/index.d.ts 2>/dev/null || grep -rl "^export" node_modules/<designSystem> --include="index.d.ts" | head -3 | xargs grep "^export"` — lists every component actually exported by the installed version.
|
|
101
|
+
3. For every component you plan to use, read its TypeScript prop interface from the installed `.d.ts`:
|
|
102
|
+
`find node_modules/<designSystem> -name "ComponentName.d.ts" | head -3`, then `grep -A 40 "interface.*Props"` on the result.
|
|
103
|
+
4. Only use component names and prop names confirmed in those files. Do not rely on training knowledge of the API.
|
|
104
|
+
|
|
105
|
+
Also check:
|
|
106
|
+
- Whether the design system has a **form layout wrapper** (label + input + helper text) — use it instead of manual margins
|
|
107
|
+
- Whether it has **size/density/variant conventions** — use built-in props rather than custom padding
|
|
108
|
+
- Whether it has a **companion icons package** — read its exports before using any icon name; never guess icon names
|
|
109
|
+
- Whether it has a **tokens or CSS directory** — use design system CSS custom properties for spacing; never hardcode `px` values
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Step 5 — Generate the component
|
|
114
|
+
|
|
115
|
+
Create the component directory at the resolved output path (from Step 0).
|
|
116
|
+
|
|
117
|
+
Create `<ComponentName>.tsx` using the pattern for the component type:
|
|
118
|
+
|
|
119
|
+
- **field**: Extend `PConnFieldProps` from `@pega/sdk-react`. Extract `getPConnect`, `label`, `required`, `disabled`, `value`, `validatemessage`, `status`, `readOnly`, `testId`, `helperText`, `displayMode`, `hideLabel`, `placeholder`. Call `handleEvent(actions, 'changeNblur', propName, value)` on blur. Handle `displayMode === 'DISPLAY_ONLY'` and `'STACKED_LARGE_VAL'` using `getComponentFromRegistry('FieldValueList')`. Show `validatemessage` when `status === 'error'`. Pass `data-test-id={testId}` on the interactive element.
|
|
120
|
+
- **template**: Extend `PConnProps`, render children via the design system's grid/layout primitives
|
|
121
|
+
- **widget**: Extend `PConnProps`, fetch data via `PCore.getDataPageUtils()`
|
|
122
|
+
- **designSystemExtension**: Pure display props or extend `PConnProps`
|
|
123
|
+
|
|
124
|
+
Create `index.tsx`:
|
|
125
|
+
```typescript
|
|
126
|
+
export { default } from './<ComponentName>';
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Step 6 — Register in component-map.ts
|
|
132
|
+
|
|
133
|
+
Edit `src/components/component-map.ts`:
|
|
134
|
+
|
|
135
|
+
1. Add the import at the top of the file, in the correct section (Fields / Templates / Widgets / Design System Extension)
|
|
136
|
+
2. Add an entry in `getSampleComponentMap()` under the matching category comment
|
|
137
|
+
|
|
138
|
+
Do not restructure or reorder any existing entries.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Step 7 — Verify the build
|
|
143
|
+
|
|
144
|
+
Run:
|
|
145
|
+
```
|
|
146
|
+
npm run build
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
If build errors occur, fix them before reporting completion. Report what files were created and what was added to `component-map.ts`.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"folderScopes": {
|
|
3
|
+
"field": "src/components/field",
|
|
4
|
+
"template": "src/components/template",
|
|
5
|
+
"widget": "src/components/widget",
|
|
6
|
+
"infra": "src/components/infra",
|
|
7
|
+
"designSystemExtension": "src/components/designSystemExtension"
|
|
8
|
+
},
|
|
9
|
+
"namedScopes": {
|
|
10
|
+
"workflow-form": {
|
|
11
|
+
"folders": ["field"],
|
|
12
|
+
"components": [
|
|
13
|
+
{ "name": "Stages", "category": "infra", "path": "src/components/infra/Stages" }
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"components": {
|
|
18
|
+
"field": [
|
|
19
|
+
{ "name": "AutoComplete", "path": "src/components/field/AutoComplete" },
|
|
20
|
+
{ "name": "CancelAlert", "path": "src/components/field/CancelAlert" },
|
|
21
|
+
{ "name": "Checkbox", "path": "src/components/field/Checkbox" },
|
|
22
|
+
{ "name": "Currency", "path": "src/components/field/Currency" },
|
|
23
|
+
{ "name": "Date", "path": "src/components/field/Date" },
|
|
24
|
+
{ "name": "DateTime", "path": "src/components/field/DateTime" },
|
|
25
|
+
{ "name": "Decimal", "path": "src/components/field/Decimal" },
|
|
26
|
+
{ "name": "Dropdown", "path": "src/components/field/Dropdown" },
|
|
27
|
+
{ "name": "Email", "path": "src/components/field/Email" },
|
|
28
|
+
{ "name": "Group", "path": "src/components/field/Group" },
|
|
29
|
+
{ "name": "Integer", "path": "src/components/field/Integer" },
|
|
30
|
+
{ "name": "Location", "path": "src/components/field/Location" },
|
|
31
|
+
{ "name": "Multiselect", "path": "src/components/field/Multiselect" },
|
|
32
|
+
{ "name": "ObjectReference", "path": "src/components/field/ObjectReference" },
|
|
33
|
+
{ "name": "Percentage", "path": "src/components/field/Percentage" },
|
|
34
|
+
{ "name": "Phone", "path": "src/components/field/Phone" },
|
|
35
|
+
{ "name": "RadioButtons", "path": "src/components/field/RadioButtons" },
|
|
36
|
+
{ "name": "RichText", "path": "src/components/field/RichText" },
|
|
37
|
+
{ "name": "ScalarList", "path": "src/components/field/ScalarList" },
|
|
38
|
+
{ "name": "SelectableCard", "path": "src/components/field/SelectableCard" },
|
|
39
|
+
{ "name": "SemanticLink", "path": "src/components/field/SemanticLink" },
|
|
40
|
+
{ "name": "TextArea", "path": "src/components/field/TextArea" },
|
|
41
|
+
{ "name": "TextContent", "path": "src/components/field/TextContent" },
|
|
42
|
+
{ "name": "TextInput", "path": "src/components/field/TextInput" },
|
|
43
|
+
{ "name": "Time", "path": "src/components/field/Time" },
|
|
44
|
+
{ "name": "URL", "path": "src/components/field/URL" },
|
|
45
|
+
{ "name": "UserReference", "path": "src/components/field/UserReference" }
|
|
46
|
+
],
|
|
47
|
+
"template": [
|
|
48
|
+
{ "name": "AdvancedSearch", "path": "src/components/template/AdvancedSearch" },
|
|
49
|
+
{ "name": "AppShell", "path": "src/components/template/AppShell" },
|
|
50
|
+
{ "name": "BannerPage", "path": "src/components/template/BannerPage" },
|
|
51
|
+
{ "name": "CaseSummary", "path": "src/components/template/CaseSummary" },
|
|
52
|
+
{ "name": "CaseView", "path": "src/components/template/CaseView" },
|
|
53
|
+
{ "name": "CaseViewActionsMenu", "path": "src/components/template/CaseViewActionsMenu" },
|
|
54
|
+
{ "name": "Confirmation", "path": "src/components/template/Confirmation" },
|
|
55
|
+
{ "name": "DataReference", "path": "src/components/template/DataReference" },
|
|
56
|
+
{ "name": "DefaultForm", "path": "src/components/template/DefaultForm" },
|
|
57
|
+
{ "name": "DefaultPage", "path": "src/components/template/DefaultPage" },
|
|
58
|
+
{ "name": "Details", "path": "src/components/template/Details" },
|
|
59
|
+
{ "name": "FieldGroupTemplate", "path": "src/components/template/FieldGroupTemplate" },
|
|
60
|
+
{ "name": "HierarchicalForm", "path": "src/components/template/HierarchicalForm" },
|
|
61
|
+
{ "name": "InlineDashboard", "path": "src/components/template/InlineDashboard" },
|
|
62
|
+
{ "name": "InlineDashboardPage", "path": "src/components/template/InlineDashboardPage" },
|
|
63
|
+
{ "name": "ListPage", "path": "src/components/template/ListPage" },
|
|
64
|
+
{ "name": "ListView", "path": "src/components/template/ListView" },
|
|
65
|
+
{ "name": "MultiReferenceReadOnly", "path": "src/components/template/MultiReferenceReadOnly" },
|
|
66
|
+
{ "name": "NarrowWide", "path": "src/components/template/NarrowWide" },
|
|
67
|
+
{ "name": "ObjectPage", "path": "src/components/template/ObjectPage" },
|
|
68
|
+
{ "name": "OneColumn", "path": "src/components/template/OneColumn" },
|
|
69
|
+
{ "name": "PromotedFilters", "path": "src/components/template/PromotedFilters" },
|
|
70
|
+
{ "name": "SelfServiceCaseView", "path": "src/components/template/SelfServiceCaseView" },
|
|
71
|
+
{ "name": "SimpleTable", "path": "src/components/template/SimpleTable" },
|
|
72
|
+
{ "name": "SingleReferenceReadOnly","path": "src/components/template/SingleReferenceReadOnly" },
|
|
73
|
+
{ "name": "SubTabs", "path": "src/components/template/SubTabs" },
|
|
74
|
+
{ "name": "TwoColumn", "path": "src/components/template/TwoColumn" },
|
|
75
|
+
{ "name": "WideNarrow", "path": "src/components/template/WideNarrow" },
|
|
76
|
+
{ "name": "WssNavBar", "path": "src/components/template/WssNavBar" }
|
|
77
|
+
],
|
|
78
|
+
"widget": [
|
|
79
|
+
{ "name": "AppAnnouncement", "path": "src/components/widget/AppAnnouncement" },
|
|
80
|
+
{ "name": "Attachment", "path": "src/components/widget/Attachment" },
|
|
81
|
+
{ "name": "CaseHistory", "path": "src/components/widget/CaseHistory" },
|
|
82
|
+
{ "name": "FileUtility", "path": "src/components/widget/FileUtility" },
|
|
83
|
+
{ "name": "Followers", "path": "src/components/widget/Followers" },
|
|
84
|
+
{ "name": "QuickCreate", "path": "src/components/widget/QuickCreate" },
|
|
85
|
+
{ "name": "SummaryItem", "path": "src/components/widget/SummaryItem" },
|
|
86
|
+
{ "name": "SummaryList", "path": "src/components/widget/SummaryList" },
|
|
87
|
+
{ "name": "ToDo", "path": "src/components/widget/ToDo" }
|
|
88
|
+
],
|
|
89
|
+
"infra": [
|
|
90
|
+
{ "name": "ActionButtons", "path": "src/components/infra/ActionButtons" },
|
|
91
|
+
{ "name": "DashboardFilter", "path": "src/components/infra/DashboardFilter" },
|
|
92
|
+
{ "name": "DeferLoad", "path": "src/components/infra/DeferLoad" },
|
|
93
|
+
{ "name": "NavBar", "path": "src/components/infra/NavBar" },
|
|
94
|
+
{ "name": "Stages", "path": "src/components/infra/Stages" },
|
|
95
|
+
{ "name": "VerticalTabs", "path": "src/components/infra/VerticalTabs" }
|
|
96
|
+
],
|
|
97
|
+
"designSystemExtension": [
|
|
98
|
+
{ "name": "AlertBanner", "path": "src/components/designSystemExtension/AlertBanner" },
|
|
99
|
+
{ "name": "Banner", "path": "src/components/designSystemExtension/Banner" },
|
|
100
|
+
{ "name": "CaseSummaryFields", "path": "src/components/designSystemExtension/CaseSummaryFields" },
|
|
101
|
+
{ "name": "DetailsFields", "path": "src/components/designSystemExtension/DetailsFields" },
|
|
102
|
+
{ "name": "FieldGroup", "path": "src/components/designSystemExtension/FieldGroup" },
|
|
103
|
+
{ "name": "FieldGroupList", "path": "src/components/designSystemExtension/FieldGroupList" },
|
|
104
|
+
{ "name": "FieldValueList", "path": "src/components/designSystemExtension/FieldValueList" },
|
|
105
|
+
{ "name": "Operator", "path": "src/components/designSystemExtension/Operator" },
|
|
106
|
+
{ "name": "Pulse", "path": "src/components/designSystemExtension/Pulse" },
|
|
107
|
+
{ "name": "RichTextEditor", "path": "src/components/designSystemExtension/RichTextEditor" },
|
|
108
|
+
{ "name": "WssQuickCreate", "path": "src/components/designSystemExtension/WssQuickCreate" }
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: generate-all-components.prompt
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Step 0 — Resolve inputs
|
|
7
|
+
|
|
8
|
+
Read the user's message carefully. Extract:
|
|
9
|
+
|
|
10
|
+
- **Design system** — the UI library to use (e.g. `Ant Design`, `Chakra UI`, `Carbon`, `Radix UI`)
|
|
11
|
+
- **Base components folder** — the root folder that contains (or will contain) the component type subfolders (e.g. `src/components/`)
|
|
12
|
+
- **Component types in scope** — which types to generate (default: all four if not specified)
|
|
13
|
+
|
|
14
|
+
Both **design system** and **base components folder** are required. If either is missing or ambiguous, ask both unresolved items in one numbered list. Do not assume or default the base folder — the client's folder structure may differ.
|
|
15
|
+
|
|
16
|
+
Example questions (ask only the ones that are actually missing):
|
|
17
|
+
1. Which design system should I use? (e.g. Ant Design, Chakra UI, Carbon, Radix UI)
|
|
18
|
+
2. What is your base components folder? (e.g. `src/components/`) — subfolders `field/`, `template/`, `widget/`, and `designSystemExtension/` will be used under it.
|
|
19
|
+
|
|
20
|
+
### Component type scope
|
|
21
|
+
|
|
22
|
+
Extract which types the user wants from the message:
|
|
23
|
+
|
|
24
|
+
| User says | Types in scope |
|
|
25
|
+
|---|---|
|
|
26
|
+
| "generate all components" | field + template + widget + designSystemExtension |
|
|
27
|
+
| "generate field and widget components" | field + widget |
|
|
28
|
+
| "generate widget, template components" | widget + template |
|
|
29
|
+
| "generate all components except templates" | field + widget + designSystemExtension |
|
|
30
|
+
| "replace everything" | field + template + widget + designSystemExtension |
|
|
31
|
+
|
|
32
|
+
Default to **all four types** if the message does not restrict the scope.
|
|
33
|
+
|
|
34
|
+
### Derived output paths
|
|
35
|
+
|
|
36
|
+
Once the base folder is known, derive the output path for each type in scope:
|
|
37
|
+
|
|
38
|
+
| Type | Derived path |
|
|
39
|
+
|---|---|
|
|
40
|
+
| field | `<base>/field/` |
|
|
41
|
+
| template | `<base>/template/` |
|
|
42
|
+
| widget | `<base>/widget/` |
|
|
43
|
+
| designSystemExtension | `<base>/designSystemExtension/` |
|
|
44
|
+
|
|
45
|
+
Once design system, base folder, and type scope are resolved, continue to Step 1.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Step 1 — Read general skill files (once, for each type in scope)
|
|
50
|
+
|
|
51
|
+
Read the general skill file for every type in scope. Do this upfront — do not re-read per component.
|
|
52
|
+
|
|
53
|
+
| Type | Skill file to read |
|
|
54
|
+
|---|---|
|
|
55
|
+
| field | `.cursor/rules/skills/field-components.mdrules` |
|
|
56
|
+
| template | `.cursor/rules/skills/template-components.mdrules` |
|
|
57
|
+
| widget | `.cursor/rules/skills/widget-components.mdrules` |
|
|
58
|
+
| designSystemExtension | `.cursor/rules/skills/design-system-extension.mdrules` |
|
|
59
|
+
|
|
60
|
+
Keep all loaded skill files active throughout the entire session.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Step 2 — Install and discover the design system (once)
|
|
65
|
+
|
|
66
|
+
Execute **Step 3** from `.cursor/rules/prompts/add-component.mdrules` exactly as written:
|
|
67
|
+
- Check `package.json` for the DS package
|
|
68
|
+
- Install if missing, including any peer dependencies
|
|
69
|
+
- Report what was installed
|
|
70
|
+
|
|
71
|
+
Then execute **Step 4** from `.cursor/rules/prompts/add-component.mdrules` exactly as written:
|
|
72
|
+
- Read the DS README from `node_modules`
|
|
73
|
+
- Discover all exported components from `dist/index.d.ts`
|
|
74
|
+
- Read prop interfaces for primitives needed across **all types in scope**:
|
|
75
|
+
- **field**: form input controls (Input, Select, Checkbox, DatePicker, etc.)
|
|
76
|
+
- **template**: grid/layout primitives (Grid, Flex, Columns, SimpleGrid, etc.)
|
|
77
|
+
- **widget**: card/list/table/button/badge primitives
|
|
78
|
+
- **designSystemExtension**: alert/notification/avatar primitives
|
|
79
|
+
- Note form layout wrappers, size/variant conventions, icon packages, and design tokens
|
|
80
|
+
|
|
81
|
+
Build a unified **DS API reference map** covering all types in scope. Reuse it throughout — do not repeat discovery commands per component.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Step 3 — Overwrite check (all types, all at once)
|
|
86
|
+
|
|
87
|
+
For every type in scope, check whether each component's `<outputPath>/<ComponentName>/<ComponentName>.tsx` already exists.
|
|
88
|
+
|
|
89
|
+
Collect all existing components across all types and report them in one consolidated list:
|
|
90
|
+
|
|
91
|
+
> "The following N components already exist across [types]: [list grouped by type]. How should I proceed?
|
|
92
|
+
> - **Overwrite all** — replace all existing implementations
|
|
93
|
+
> - **Skip existing** — only generate components that don't exist yet
|
|
94
|
+
> - **Cancel** — stop without generating anything"
|
|
95
|
+
|
|
96
|
+
Wait for the user's answer before proceeding. If none exist, continue immediately.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Step 4 — Generate field components (skip if field not in scope)
|
|
101
|
+
|
|
102
|
+
If `field` is in scope, execute **Step 4** from `.cursor/rules/prompts/generate-field-components.mdrules` in full:
|
|
103
|
+
- Use the derived field output path: `<base>/field/`
|
|
104
|
+
- The general skill (`field-components.md`) is already loaded from Step 1 — do not re-read it
|
|
105
|
+
- The DS API reference map is already built from Step 2 — do not repeat discovery commands
|
|
106
|
+
- For each of the 27 field components: read skill file → generate → register in `component-map.ts`
|
|
107
|
+
- Report progress after each component
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Step 5 — Generate template components (skip if template not in scope)
|
|
112
|
+
|
|
113
|
+
If `template` is in scope, execute **Step 4** from `.cursor/rules/prompts/generate-template-components.mdrules` in full:
|
|
114
|
+
- Use the derived template output path: `<base>/template/`
|
|
115
|
+
- The general skill (`template-components.md`) is already loaded from Step 1 — do not re-read it
|
|
116
|
+
- The DS layout API is already discovered from Step 2 — do not repeat discovery commands
|
|
117
|
+
- For each of the 32 template components: read skill file → generate → register in `component-map.ts`
|
|
118
|
+
- Report progress after each component
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Step 6 — Generate widget components (skip if widget not in scope)
|
|
123
|
+
|
|
124
|
+
If `widget` is in scope, execute **Step 4** from `.cursor/rules/prompts/generate-widget-components.mdrules` in full:
|
|
125
|
+
- Use the derived widget output path: `<base>/widget/`
|
|
126
|
+
- The general skill (`widget-components.md`) is already loaded from Step 1 — do not re-read it
|
|
127
|
+
- The DS UI primitive map is already built from Step 2 — do not repeat discovery commands
|
|
128
|
+
- For each of the 9 widget components: read skill file → generate → register in `component-map.ts`
|
|
129
|
+
- If no skill file exists for a component (e.g., `SummaryList`), use the general pattern from `widget-components.md`
|
|
130
|
+
- Report progress after each component
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Step 7 — Generate design system extension components (skip if DSE not in scope)
|
|
135
|
+
|
|
136
|
+
If `designSystemExtension` is in scope, execute **Step 4** from `.cursor/rules/prompts/generate-dse-components.mdrules` in full:
|
|
137
|
+
- Use the derived DSE output path: `<base>/designSystemExtension/`
|
|
138
|
+
- The general skill (`design-system-extension.md`) is already loaded from Step 1 — do not re-read it
|
|
139
|
+
- The DS display primitive map is already built from Step 2 — do not repeat discovery commands
|
|
140
|
+
- For each of the 11 DSE components: read skill file → generate → register in `component-map.ts`
|
|
141
|
+
- Apply the Pattern B/A/C branching as specified in the skill file and `design-system-extension.md`
|
|
142
|
+
- Report progress after each component
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Step 8 — Verify the build
|
|
147
|
+
|
|
148
|
+
Execute **Step 7** from `.cursor/rules/prompts/add-component.mdrules` exactly as written:
|
|
149
|
+
- Run `npm run build`
|
|
150
|
+
- Fix any TypeScript or build errors before reporting completion
|
|
151
|
+
- Report a final summary:
|
|
152
|
+
- Total components generated, grouped by type
|
|
153
|
+
- All entries added to `component-map.ts`
|
|
154
|
+
- Any components skipped (if "skip existing" was chosen in Step 3)
|