cratis/ai.distribution/cratis-react-page
Claude Code and agent skill by cratis/ai.distribution
- community
Checking that the SKILL.md file is still in the repository.
Step-by-step guidance for building a React page in a Cratis Arc application — DataPage lists, CommandDialog toolbar actions, confirmation and busy-indicator dialogs, row selection, details components, observable queries, and MVVM. Use when building or modifying a page that lists/displays data, adding a table, wiring Add/Edit/Delete, connecting a component to a proxy-generated query (standard or observable), or asking the user to confirm something.
Install
npx vskill@latest install cratis/ai.distribution/cratis-react-pageSKILL.md
The same SKILL.md was published earlier as cratis/ai.distribution/cratis-react-page.
Workflow
Step 1 — Prerequisites
- Backend query and command endpoints must already exist (see
cratis-readmodelandcratis-commandskills). - Run a Debug
dotnet buildon the backend to regenerate proxies before importing them.
Import DataPage (and its Column/MenuItem helpers) from the subpath, not the root barrel:
Step 2 — Basic DataPage setup
DataPage combines a toolbar/menu, a data table, and an optional details component. title, query, emptyMessage, and children are required; columns are declared compositionally inside <DataPage.Columns> using PrimeReact <Column>.
Step 3 — Add menu actions
Toolbar actions go in <DataPage.MenuItems>. MenuItem is a PrimeReact menu item (use command, not onClick); the disableOnUnselected flag greys it out until a row is selected. Create a separate dialog component using DialogProps, then wire it up with useDialog.
Dialog component (`CreateAccountDialog.tsx`):
Page component:
See dialogs.md and the stepper-command-dialog skill for the full dialog patterns.
Confirming, and showing that something is in progress
Do not build either of these into a page. ConfirmationDialog and BusyIndicatorDialog are registered once at the app root through DialogComponents and raised by hook from anywhere, which is what keeps every confirmation and every busy indicator looking the same:
A busy indicator dialog is only for work that genuinely has to block the user. It is modal and deliberately non-dismissible, so it takes the whole screen away until the work finishes — reach for it when carrying on would be wrong: a multi-step import, a migration, something the next click would corrupt or duplicate.
For everything else — and that is most of it — the in-flight button is the right control. A command that appends events and returns in milliseconds sits behind a button that already disables itself and shows progress (eventual-consistency rule 9); putting a modal in front of it makes the screen flash and tells the user nothing. Never open one just to signal "working".
When you do use it, pair it with closeBusy() in a finally — a non-dismissible dialog whose close was skipped strands the user with no way out:
Step 4 — Row selection and edit dialog
Track selection with selection + onSelectionChange, and supply the row data as props to the edit dialog.
Edit dialog (`EditAccountDialog.tsx`):
Page wiring:
initialValuessets the change-tracking baseline (e.g. IDs that must be present but aren't user-entered).currentValuespre-populates the visible field values.
Step 5 — Observable vs standard query
The same `query` prop accepts a standard query (IQueryFor) or an observable query (IObservableQueryFor) — there is no separate observableQuery prop. Pass the observable query proxy and DataPage subscribes to live updates automatically:
Observable results push updates automatically; for snapshot data that changes only on user action, pass the standard query and call onRefresh after a command succeeds.
Step 6 — Details component (optional)
detailsComponent renders detail for the selected row. It receives { item, onRefresh }:
Step 7 — MVVM view model (for complex pages)
For pages with complex state or coordination logic, wrap the page in a view model (see react.md):
Read viewModel.property inside JSX (never destructure observables at the top of the body). See react.md for the full MVVM rules.
Quick decision guide
| Need | Use | |
|---|---|---|
| Read-only list | DataPage with a standard query | |
| Real-time updates | DataPage with an observable query passed to the same query prop | |
| Add / create action | <DataPage.MenuItems> + MenuItem + CommandDialog + useDialog | |
| Edit selected row | selection + onSelectionChange + CommandDialog + currentValues/initialValues | |
| Detail for selected row | detailsComponent prop | |
| Complex page logic | withViewModel MVVM wrapper |
Key DataPage props
| Prop | Purpose | |
|---|---|---|
title (required) | toolbar title | |
query (required) | the query proxy — standard or observable | |
emptyMessage (required) | shown when there are no rows | |
children (required) | <DataPage.Columns> + optional <DataPage.MenuItems> | |
queryArguments | arguments passed to the query | |
selection / onSelectionChange | controlled single-row selection | |
detailsComponent | React.FC<IDetailsComponentProps<T>> rendered for the selected row | |
globalFilterFields / defaultFilters / clientFiltering | filtering | |
onRefresh | invoked to re-fetch a standard query | |
tablePt / menubarPt / *Unstyled | PrimeReact pass-through styling |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cratis-react-page/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cratis/ai.distribution/cratis-react-page)