Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
293 changes: 243 additions & 50 deletions .cratis/ai.manifest.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions .cratis/ai/agents/backend-developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ description: >
Creates the single slice file containing all backend artifacts:
commands, events, validators, constraints, read models, projections,
and reactors — all in strict compliance with the vertical slice architecture.
model: claude-sonnet-4-5
tools:
- githubRepo
- codeSearch
- usages
- rename
- terminalLastCommand
- Read
- Grep
- Glob
- Bash
- Edit
- Write
---
<!-- cratis-ai-managed: agents/backend-developer.md -->

Expand Down
16 changes: 8 additions & 8 deletions .cratis/ai/agents/code-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ description: >
Quality gate agent for Cratis-based projects. Reviews code against all
project instruction files, checking architecture conformance, C# and
TypeScript conventions, and vertical slice correctness before merge.
model: claude-sonnet-4-5
tools:
- githubRepo
- codeSearch
- usages
- rename
- terminalLastCommand
- Read
- Grep
- Glob
- Bash
readonly: true
---
<!-- cratis-ai-managed: agents/code-reviewer.md -->

Expand Down Expand Up @@ -52,6 +51,7 @@ When checking unused code, references, or naming, use semantic navigation if the
- [ ] No shared state between commands
- [ ] No service locator (`IServiceProvider` not injected); `IInstancesOf<T>` (not `IEnumerable<T>`) for discovering implementations
- [ ] No explicit singleton registration when `[Singleton]` attribute suffices
- [ ] No `[Singleton]` takes a scoped dependency (event store and anything off it, MongoDB collection/database/client, `DbContext`, read model by key) — such a type is transient or scoped instead
- [ ] Logging is in a separate `*Logging.cs` partial file with `[LoggerMessage]`

## C# Commands checklist
Expand Down Expand Up @@ -110,7 +110,7 @@ When checking unused code, references, or naming, use semantic navigation if the

## TypeScript Styling checklist

- [ ] No hard-coded hex/rgb values — PrimeReact CSS variables used
- [ ] No hard-coded hex/rgb values — `--cratis-*` tokens used
- [ ] CSS co-located with component (`.css` file in same folder)
- [ ] No `!important` unless absolutely required and justified with a comment

Expand All @@ -128,7 +128,7 @@ When checking unused code, references, or naming, use semantic navigation if the
- [ ] README.md exists for complex component folders
- [ ] `CommandDialog` from `@cratis/components/CommandDialog` used for command-based dialogs
- [ ] `Dialog` from `@cratis/components/Dialogs` used for data-only dialogs
- [ ] Never imports `Dialog` directly from `primereact/dialog`
- [ ] Never uses a vendor or hand-rolled modal — `CommandDialog` / `Dialog` from Cratis Components
- [ ] No monolithic components — decomposed into smaller, focused sub-components

---
Expand Down
10 changes: 5 additions & 5 deletions .cratis/ai/agents/coordinator.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ description: >
Use this agent when a request spans multiple concerns (backend + frontend,
multiple slices, mixed C#/TypeScript work, or requires both implementation
and review).
model: claude-sonnet-4-5
tools:
- githubRepo
- codeSearch
- usages
- terminalLastCommand
- Read
- Grep
- Glob
- Bash
- Agent
---
<!-- cratis-ai-managed: agents/coordinator.md -->

Expand Down
75 changes: 34 additions & 41 deletions .cratis/ai/agents/frontend-developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ description: >
Specialist for TypeScript/React frontend code within a vertical slice.
Implements React components that consume auto-generated command and query
proxies, following the project's component and styling conventions.
model: claude-sonnet-4-5
tools:
- githubRepo
- codeSearch
- usages
- rename
- terminalLastCommand
- Read
- Grep
- Glob
- Bash
- Edit
- Write
---
<!-- cratis-ai-managed: agents/frontend-developer.md -->

Expand Down Expand Up @@ -65,7 +65,7 @@ Confirm that the TypeScript proxies exist in the slice folder before writing any
- Place `.tsx` files in the **same folder** as the corresponding `.cs` file.
- Do NOT prefix the file name with the feature or slice name (folder provides context).
- Each component has its own `.css` file for static styles.
- Use PrimeReact CSS variables for all colors, backgrounds, and borders — never hard-code hex values. The default stack is Cratis Components on PrimeReact theming — not Tailwind.
- Use the `--cratis-*` design tokens for all colors, backgrounds, and borders — never hard-code hex values. The default stack is Cratis Components 4 (Components-owned markup and tokens; no PrimeReact) — not Tailwind.
- Use `const` over `let`.
- Use full descriptive names (never abbreviations like `e`, `idx`, `prev`).
- **Move non-trivial state out of the render function** into a `withViewModel` view model (or a tested state module) — see `react.md`. Extract as soon as a component has 3+ `useState`, a state-syncing `useEffect`, or derived values. A view model is a plain class with no React hooks, constructible in a spec.
Expand All @@ -91,28 +91,22 @@ const handleSubmit = async () => {
## Query usage pattern (with paging)

```tsx
const pageSize = 10;

export const Listing = () => {
const [allProjectsResult, , setPage] = AllProjects.useWithPaging(pageSize);

return (
<DataTable
lazy paginator
value={allProjectsResult.data}
rows={pageSize}
totalRecords={allProjectsResult.paging.totalItems}
alwaysShowPaginator={false}
first={allProjectsResult.paging.page * pageSize}
onPage={event => setPage(event.page ?? 0)}
scrollable scrollHeight="flex"
emptyMessage="No items found.">
<Column field="name" header="Name" />
</DataTable>
);
};
import { DataTableForQuery, Column } from '@cratis/components/DataTables';
import { AllProjects } from './AllProjects';

// The table subscribes to the query itself and pages server-side (20 rows a page);
// do not fetch rows and pass an items array.
export const Listing = () => (
<DataTableForQuery query={AllProjects} emptyMessage="No items found.">
<Column field="name" header="Name" />
</DataTableForQuery>
);
```

For caller-controlled paging outside a table, use the proxy hook directly —
`const [result, , , setPage] = AllProjects.useWithPaging(pageSize)`; `result.data` and
`result.paging` (`page`, `size`, `totalItems`, `totalPages`) drive your own layout.

---

## Dialog patterns
Expand All @@ -134,7 +128,7 @@ export const AddProject = ({ closeDialog }: DialogProps) => {
title="Add Project"
okLabel="Add"
cancelLabel="Cancel"
onConfirm={() => closeDialog(DialogResult.Ok)}
onSuccess={() => closeDialog(DialogResult.Ok)}
onCancel={() => closeDialog(DialogResult.Cancelled)}
>
<InputTextField<RegisterProject>
Expand All @@ -158,7 +152,7 @@ Use this for dialogs that collect data and return it without executing a command
import { useState } from 'react';
import { DialogProps, DialogResult } from '@cratis/arc.react/dialogs';
import { Dialog } from '@cratis/components/Dialogs';
import { InputText } from 'primereact/inputtext';
import { TextInput } from '@cratis/components/Common';

export const AddProject = ({ closeDialog }: DialogProps<{ name: string }>) => {
const [name, setName] = useState('');
Expand All @@ -174,18 +168,18 @@ export const AddProject = ({ closeDialog }: DialogProps<{ name: string }>) => {
onConfirm={() => closeDialog(DialogResult.Ok, { name })}
onCancel={() => closeDialog(DialogResult.Cancelled)}
>
<InputText
<TextInput
value={name}
onChange={event => setName(event.target.value)}
onChange={value => setName(value)}
placeholder="Enter a name"
autoFocus
aria-label="Project name"
/>
</Dialog>
);
};
```

> **Never** import `Dialog` from `primereact/dialog` directly.
> **Never** use a vendor or hand-rolled modal — dialogs are Components-owned.

---

Expand All @@ -196,20 +190,19 @@ import { Page } from '@cratis/components/Common';
import { AddProject } from './Registration/AddProject';
import { Listing } from './Listing/Listing';
import { DialogResult, useDialog } from '@cratis/arc.react/dialogs';
import { Button } from 'primereact/button';
import * as mdIcons from 'react-icons/md';
import { Button } from '@cratis/components/Common';
import { MdAdd } from 'react-icons/md';

export const Projects = () => {
const [AddProjectDialog, showAddProjectDialog] = useDialog(AddProject);

// For a query-backed list page, prefer `DataPage` with `<DataPage.MenuItems>`
// (it owns the action bar). PrimeReact 11 removed the standalone `Menubar`;
// for a custom toolbar, compose `Button`s (content is children in v11).
// (it owns the action bar). For a custom action row, compose Components `Button`s
// (`variant`: solid | outline | ghost | link; `tone`: neutral | accent | positive | caution | critical).
return (
<Page title="Projects">
<Button variant="text" onClick={() => showAddProjectDialog()}>
<mdIcons.MdAdd />
<span>Add Project</span>
<Button variant="ghost" icon={<MdAdd aria-hidden="true" />} onClick={() => showAddProjectDialog()}>
Add Project
</Button>
<Listing />
<AddProjectDialog />
Expand Down Expand Up @@ -239,7 +232,7 @@ Before handing back:
- [ ] `npx tsc -b` passes with zero errors
- [ ] Components are in the correct slice folder
- [ ] If the app has a localization convention, user-visible text is routed through it (product policy — not a Cratis rule)
- [ ] No hard-coded hex/rgb color values — PrimeReact CSS variables used throughout
- [ ] No hard-coded hex/rgb color values — `--cratis-*` tokens used throughout
- [ ] All variable/parameter names are fully descriptive (no abbreviations)
- [ ] No `any` types — `unknown` with type guards where needed
- [ ] Composition page updated to include the new component
Expand Down
12 changes: 6 additions & 6 deletions .cratis/ai/agents/orchestrator.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ description: >
Use this agent as the entry point whenever multiple agents need to work together
as a team: mixed implementation + documentation + review, multi-feature work,
large refactors, or any goal that spans more than one concern.
model: claude-sonnet-4-5
tools:
- githubRepo
- codeSearch
- usages
- terminalLastCommand
- Read
- Grep
- Glob
- Bash
- Agent
---
<!-- cratis-ai-managed: agents/orchestrator.md -->

Expand Down Expand Up @@ -115,7 +115,7 @@ When you receive a goal:
- [ ] [security-reviewer] Security review of all changed files

### Phase 5 — Documentation (if applicable)
- [ ] [write-documentation skill] Document <feature/concept>
- [ ] [documentation] Document <feature/concept> in its authored source with cratis-documentation-writing (or cratis-engineering-docs-authoring) and cratis-technical-examples for code, when the repository's profiles install them; otherwise follow the repository's own documentation rules
```

---
Expand Down
10 changes: 5 additions & 5 deletions .cratis/ai/agents/performance-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ description: >
Performance-focused review agent for Cratis-based projects. Analyzes changed
files for projection efficiency, query patterns, unnecessary allocations,
React render overhead, and Chronicle anti-patterns before merge.
model: claude-sonnet-4-5
tools:
- githubRepo
- codeSearch
- usages
- terminalLastCommand
- Read
- Grep
- Glob
- Bash
readonly: true
---
<!-- cratis-ai-managed: agents/performance-reviewer.md -->

Expand Down
10 changes: 5 additions & 5 deletions .cratis/ai/agents/planner.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ description: >
Breaks the work into ordered, parallelisable tasks, delegates each task
to the right specialist agent, and ensures quality gates are met before
the work is considered done.
model: claude-sonnet-4-5
tools:
- githubRepo
- codeSearch
- usages
- terminalLastCommand
- Read
- Grep
- Glob
- Bash
- Agent
---
<!-- cratis-ai-managed: agents/planner.md -->

Expand Down
4 changes: 2 additions & 2 deletions .cratis/ai/agents/repository-investigation-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ description: >
Independent, read-only reviewer for typed Cratis repository investigations.
Reviews evidence and repository-mode reasoning without applying application
conventions to framework or client-library repositories.
model: claude-opus-5
tools:
- Read
- Glob
- Grep
- Glob
readonly: true
---
<!-- cratis-ai-managed: agents/repository-investigation-reviewer.md -->

Expand Down
4 changes: 2 additions & 2 deletions .cratis/ai/agents/repository-investigator.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ description: >
Read-only investigator for Cratis application and framework repositories.
Produces typed, evidence-backed findings without changing source, invoking
mutating Chronicle operations, or assuming an application architecture.
model: claude-opus-5
tools:
- Read
- Glob
- Grep
- Glob
- Bash
readonly: true
---
<!-- cratis-ai-managed: agents/repository-investigator.md -->

Expand Down
10 changes: 5 additions & 5 deletions .cratis/ai/agents/security-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ description: >
security review of all changed files before merge, covering input validation,
auth/authz, data exposure, secrets, event sourcing specifics, and frontend
attack surface.
model: claude-sonnet-4-5
tools:
- githubRepo
- codeSearch
- usages
- terminalLastCommand
- Read
- Grep
- Glob
- Bash
readonly: true
---
<!-- cratis-ai-managed: agents/security-reviewer.md -->

Expand Down
11 changes: 8 additions & 3 deletions .cratis/ai/agents/slice-implementer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ description: >
Implements a Cratis vertical slice end-to-end — all backend artifacts in one slice file, BDD specs
in when_*/ folders, and the React surface (page and/or command dialog). Use for new slices and for
non-trivial slice changes spanning backend and frontend.
model: claude-opus-4-8
tools: [githubRepo, codeSearch, usages, rename, terminalLastCommand]
tools:
- Read
- Grep
- Glob
- Bash
- Edit
- Write
---
<!-- cratis-ai-managed: agents/slice-implementer.md -->

Expand Down Expand Up @@ -53,7 +58,7 @@ Proxies now exist. Build React components from the generated proxies (`react.md`
- Events: no arguments on `[EventType]`, non-nullable, past tense, `<summary>`, never carry the event-source id.
- `[OnceOnly]` on non-idempotent reactor side effects; reactors return side-effect events or use `ICommandPipeline` (never `IEventLog`).
- Specs `#if DEBUG`, command aliased, per-test unique values.
- Frontend via `withViewModel` + Arc proxy hooks + Cratis Components; never edit generated proxies; never import `Dialog` from `primereact/dialog`.
- Frontend via `withViewModel` + Arc proxy hooks + Cratis Components; never edit generated proxies; never use a vendor or hand-rolled modal (dialogs come from `@cratis/components/CommandDialog` and `/Dialogs`).

## Output

Expand Down
11 changes: 6 additions & 5 deletions .cratis/ai/agents/spec-writer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ description: >
Specialist for writing C# specs (the in-process scenario family) and
TypeScript/React specs for vertical slices. Ensures every slice has
comprehensive behavior coverage following the project's BDD conventions.
model: claude-sonnet-4-5
tools:
- githubRepo
- codeSearch
- usages
- terminalLastCommand
- Read
- Grep
- Glob
- Bash
- Edit
- Write
---
<!-- cratis-ai-managed: agents/spec-writer.md -->

Expand Down
Loading
Loading