Pega DX Component Builder
Use this skill when you need to create a new component in this repository or bring an incomplete component up to the repo's shipping standard.
Default operating mode:
- fully implement the component, not just scaffold it
- validate the result with practical checks
- update source files only, unless the user explicitly asks for generated artifacts
- rely on bundled guidance first and fetch live Pega docs only when deeper API confirmation is needed
Load These References First
When To Use
- Creating a new
Pega_Extensions_<Name>component undersrc/components/ - Extending a component that needs new
config.jsonproperties, Storybook docs, or tests - Implementing PConnect or PCore interactions such as actions, value updates, case context access, or container behavior
- Verifying that a DX component follows Constellation styling, accessibility, and repository conventions
Inputs To Capture
- Component name and whether it is a
Field,Template, or another supported DX component type - Intended end-user behavior and any required data binding or actions
- Designer properties that must appear in
config.json - Similar existing components in this gallery that can serve as the closest template
- Whether the task requires documentation-only scaffolding, working behavior, or publish-ready validation
Procedure
- Review the repository references and inspect the closest existing component implementation before creating files.
- Use bundled guidance first. Fetch live Pega docs only if the task depends on API details or platform behavior that are not clear from repo examples and bundled summaries.
- Define the component contract:
- Folder name:
src/components/Pega_Extensions_<Name> - exported component name
config.jsonnameandcomponentKey- required runtime props, default config, and any localizations or helper files
- Folder name:
- Implement the component with repository-aligned structure:
index.tsxfor the componentconfig.jsonfor Designer metadataDocs.mdxfor documentationdemo.stories.tsxfor Storybookdemo.test.tsxfor unit coverage- optional
styles.ts,localizations.json, and helper modules only when justified - when a Storybook prop has a constrained set of supported values, expose it with a
selectcontrol and human-readable labels rather than a free-text control - place important custom props near the top of Storybook
argTypesand set explicit defaults for common DX props such astestId: ''andhideLabel: falsewhen relevant - for field-style components, keep
hideLabelas the public component prop and passlabelHidden={hideLabel}only to the underlying Cosmos control when that control uses the Cosmos prop name - for field-style components, type
disabled,readOnly, andrequiredas boolean props, but preserve runtime compatibility by coercingtrueand string'true'values with the shared[readOnly, required, disabled].map(...)pattern used byMaskedInputandDateInput - prefer
getPConnect?: anyfor repo-aligned field component props and callgetActionsApi(),getStateProps(), andignoreSuggestion()from the returned object instead of introducing duplicate localPegaConnect,PegaActionsApi, orPegaStatePropsinterfaces unless a stronger shared type already exists in the repo - if you add non-default stories, add them to a
## Exampleor## Examplessection inDocs.mdxusingStoryblocks
- Prefer
@pega/cosmos-react-core, existing repo dependencies, and functional React patterns. UsewithConfiguration,getPConnect, andPCoreonly where needed and only after confirming the usage pattern. - Keep styling theme-aware. Prefer tokens,
styled-components, andremunits. Avoid direct DOM manipulation unless a dependency or browser API makes it unavoidable. - Update source-of-truth registration or discovery files when the new component must appear in the gallery. Inspect
src/component-list.jsonfirst. Treat generated outputs such assrc/component-list.js,Pega_Extensions/, andstore/as build artifacts unless the task explicitly requires them. - Validate the implementation with the strongest practical checks for the task:
npm run lint- targeted or full
npm run test - additional build or gallery validation if the change affects registration or packaging
- Report assumptions, especially around unavailable runtime data, mocked PConnect behavior in Storybook, or APIs that were inferred from repo examples rather than live platform verification.
Guardrails
- Do not invent DX component metadata. Mirror the shape and naming patterns from this repository.
- Do not hand-edit generated bundles or release artifacts unless explicitly requested.
- Do not add a package dependency for convenience if the repository already has an adequate option.
- Do not leave the component half-finished if the request implies a usable gallery component.
Success Criteria
- The component folder matches repository naming and file conventions.
config.json, implementation, docs, story, and tests are consistent with each other.- PConnect or PCore usage is justified by repo patterns or official guidance.
- Validation results and unresolved assumptions are clearly reported.
Source: pegasystems/constellation-ui-gallery — distributed by TomeVault.