[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DNAAMH4P6B5ZZ5FP7AQP94":3,"skill-same:01M7DNAAMH4P6B5ZZ5FP7AQP94":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":13,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7DNAAMH4P6B5ZZ5FP7AQP94","cratis-performance-review",null,"Perform a focused scalability review of changed code in a Cratis application — Chronicle observers and replay, read-model query shape, command and query payloads, .NET enumeration, and React render cost — and report findings by risk. Use when asked to check for performance or scalability problems. Do not use for ordinary implementation and do not override the authoritative paging guidance.","Cratis\u002FFundamentals.Go","Cratis","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F16456213?v=4","01M6BXRH290K4C8RS4PTKK3HXQ","01M7DN6YCMASAFGKYBBH3C1Z6E",0,"MIT","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fcratis-performance-review\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fcratis-performance-review\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cratis-performance-review\ndescription: Perform a focused scalability review of changed code in a Cratis application — Chronicle observers and replay, read-model query shape, command and query payloads, .NET enumeration, and React render cost — and report findings by risk. Use when asked to check for performance or scalability problems. Do not use for ordinary implementation and do not override the authoritative paging guidance.\nlicense: MIT\n---\n\u003C!-- cratis-ai-managed: skills\u002Fcratis-performance-review\u002FSKILL.md -->\n\n# Cratis performance review\n\nMost performance findings in a Cratis application are shape problems, not\nhot-loop problems: a projection that has to re-read, a query that materializes\nbefore it filters, a payload nobody uses. They are cheap to fix while the change\nis open and expensive once data has grown behind them.\n\nTwo things make this stack different. **A projection must be able to replay the\nentire history** — a cost that is invisible at development volumes and fatal at\nproduction ones. And **an event is permanent**, so an oversized event is a\nstorage and replay cost that never goes away.\n\n## Verified product sources\n\n| Package | Purpose |\n| --- | --- |\n| `Cratis.Chronicle` | Observers, projections, reducers, reactors, replay |\n| `Cratis.Arc.Core` | Query return shapes and server-side paging |\n| `@cratis\u002Fcomponents` | `DataTable` paging surface |\n\nPaged MongoDB observations re-read page and total on each change; see the\nread-model query reference for the distinction from unpaged retained sets.\n\nReverify against the owning product repository before asserting a framework\nbehavior this file does not already state.\n\n## Route near misses\n\n- General correctness and maintainability: use `cratis-code-review`. Its\n  performance section is the pass-by list; this skill is the focused one. When\n  both have run, do not restate the same finding twice.\n- Adding paging to a query rather than judging one: use\n  `cratis-arc-query-paging`. That skill is authoritative on the mechanism; this\n  one does not override it.\n- Security or data exposure: use `cratis-security-review`. An over-fetching\n  payload is a finding for both — say which lens produced it.\n\n## Step 1 — Chronicle and event sourcing\n\n- **A projection joins on events, never on a read model.** A read-model join\n  forces a re-read the projection engine cannot optimize, and it makes the\n  projection depend on another observer's position.\n- **A reactor does not re-query the event log inside its handler.** The event it\n  received already carries what it needs. (Reactor dispatch is by the handler's\n  first parameter type — the method name is free, so look for the event-typed\n  parameter, not for a method called `On`.)\n- **A new projection can replay all earlier events without failing.** Ask it\n  explicitly: at production volume, does this projection complete a full replay?\n- **Events are small.** No large blob and no base64 payload embedded in an\n  event; put the content elsewhere and carry a reference.\n- No eager load of a whole event sequence without paging or filtering.\n- AutoMap is on by default. Hand-mapping every property is both a maintenance\n  and a cost problem — and, since AutoMap runs anyway, it does not save the work\n  it appears to.\n\n## Step 2 — Read models and their store\n\n- Queries filter on indexed fields. An unintentional full-collection scan is the\n  most common finding here.\n- **A list that can grow returns a shape Arc pages** — `IQueryable\u003CT>` for a\n  LINQ-native provider, `collection.Observe(...)` for MongoDB — so Arc applies\n  server-side paging and sorting. A query that writes its own `Skip`\u002F`Take` or\n  `OrderBy` for the client's page or sort is a finding, as is MongoDB\n  `AsQueryable()` (translation failures at request time). Materializing and then slicing in memory reads the whole\n  collection every request.\n- No N+1: one query returns what the caller needs.\n- A count is a count. Hydrating the collection to measure its length is the\n  same finding as an unpaged list, wearing different clothes.\n- Prefer slim projection-backed summaries over repeatedly assembling broad\n  collections. Query composition is supported; one collection per query is not\n  a framework requirement. Bound each input and measure recomputation.\n- Embed bounded related state, not growing histories; page timelines separately.\n  Evaluate variants for divergent lifecycle shapes, not every status field.\n- Preserve reducer admission and ordering guards when proposing a projection\n  conversion; an unconditional setter may resurrect or prematurely create state.\n- Count passive models as inventory, not a smell. Assess history length and read\n  frequency against consistency\u002Fsecurity needs. Requires Chronicle 19.77.3 for\n  per-key strongly consistent projection reads to fold from the start each time;\n  repeated reads are O(key history), not incremental cache hits. Prefer a\n  materialized projection for frequent long-history reads when freshness permits. `IMongoCollection\u003CT>` cannot\n  read passive computed state; never materialize secrets to make that query work.\n- Distinguish retained `Observe` state and in-memory emissions from explicit\n  recompute queries. Narrow source filters and inspect page-refill\u002Fmembership\n  lookups; do not claim every change re-queries the entire collection. See the\n  **cratis-chronicle-read-model** query reference for versioned behavior.\n\n## Step 3 — Commands and queries\n\n- A response payload carries only fields the client uses.\n- Command validators are synchronous and in-memory. Validation is on the hot\n  path of every attempt, including the ones that will be rejected — an I\u002FO call\n  there is paid on every request.\n- No `await Task.Run(() => syncWork)` wrapping for work that is naturally\n  asynchronous.\n\n## Step 4 — .NET\n\n- No `.ToList()` before `.Where()`. Filter before materializing.\n- An `IEnumerable\u003CT>` is not enumerated more than once — materialize once when\n  it must be reused.\n- Large-object logging uses the destructuring form only at `Debug` level, so a\n  production log level does not pay to serialize it.\n\n## Step 5 — React\n\n- A `DataTable` over a growable collection uses lazy loading and a paginator\n  rather than rendering every row.\n- No inline object or array literal passed as a prop: it is a new identity every\n  render and defeats memoization downstream.\n- `useEffect` dependencies are correct — neither missing nor over-broad. An\n  over-broad dependency array is a re-run per render, which reads as a\n  correctness bug and behaves as a performance one.\n- Components over large collections hold stable references or are memoized.\n- No `JSON.parse(JSON.stringify(x))` deep cloning.\n\n## Step 6 — Report\n\nRead and use `.cratis\u002Fai\u002Frules\u002Freview-reports.md` when writing the report.\nKeep the performance risk label on each finding:\n\n| Risk | Shared classification |\n| --- | --- |\n| **High** | Blockers: degradation at moderate load requiring correction before merge |\n| **Medium** | Suggestions: degradation under load or as data grows |\n| **Low** | Suggestions: minor inefficiency |\n\nUse the shared verdict vocabulary, not a separate performance verdict. If a\nscale-dependent degradation must be corrected before merge, classify it as High\nand state the relevant scale rather than leaving a blocker under Medium.\n\n**Say what the finding costs and at what scale.** \"This is slow\" is not\nactionable; \"this scans the whole collection on every page load, so it is fine\nat hundreds of rows and not at tens of thousands\" is. Distinguish measured cost\nfrom code-shape inference; use the shared scope line to name unmeasured behavior.\n\n## What breaks\n\n- **A shape finding is reported as a measurement.** Reading code tells you the\n  shape; only running it tells you the cost. Say which one you have.\n- **The paging advice contradicts the paging skill.** `cratis-arc-query-paging`\n  is authoritative on the mechanism. Report the missing paging; do not invent an\n  alternative to it.\n- **A replay cost is judged at development volume.** A projection over a hundred\n  seeded events proves nothing about a replay over a production history.\n- **Every finding is High.** The classification is the value; when all findings\n  are urgent, none are.\n\n## How it is proven\n\nThe build and specifications are green before the report is written; each\nfinding cites the file and line and states the scale at which it bites; and the\nreport says plainly that it reviewed code shape rather than measured behavior,\nnaming anything that would need a benchmark to settle.\n","\u003C!-- cratis-ai-managed: skills\u002Fcratis-performance-review\u002FSKILL.md -->\n\n# Cratis performance review\n\nMost performance findings in a Cratis application are shape problems, not\nhot-loop problems: a projection that has to re-read, a query that materializes\nbefore it filters, a payload nobody uses. They are cheap to fix while the change\nis open and expensive once data has grown behind them.\n\nTwo things make this stack different. **A projection must be able to replay the\nentire history** — a cost that is invisible at development volumes and fatal at\nproduction ones. And **an event is permanent**, so an oversized event is a\nstorage and replay cost that never goes away.\n\n## Verified product sources\n\n| Package | Purpose |\n| --- | --- |\n| `Cratis.Chronicle` | Observers, projections, reducers, reactors, replay |\n| `Cratis.Arc.Core` | Query return shapes and server-side paging |\n| `@cratis\u002Fcomponents` | `DataTable` paging surface |\n\nPaged MongoDB observations re-read page and total on each change; see the\nread-model query reference for the distinction from unpaged retained sets.\n\nReverify against the owning product repository before asserting a framework\nbehavior this file does not already state.\n\n## Route near misses\n\n- General correctness and maintainability: use `cratis-code-review`. Its\n  performance section is the pass-by list; this skill is the focused one. When\n  both have run, do not restate the same finding twice.\n- Adding paging to a query rather than judging one: use\n  `cratis-arc-query-paging`. That skill is authoritative on the mechanism; this\n  one does not override it.\n- Security or data exposure: use `cratis-security-review`. An over-fetching\n  payload is a finding for both — say which lens produced it.\n\n## Step 1 — Chronicle and event sourcing\n\n- **A projection joins on events, never on a read model.** A read-model join\n  forces a re-read the projection engine cannot optimize, and it makes the\n  projection depend on another observer's position.\n- **A reactor does not re-query the event log inside its handler.** The event it\n  received already carries what it needs. (Reactor dispatch is by the handler's\n  first parameter type — the method name is free, so look for the event-typed\n  parameter, not for a method called `On`.)\n- **A new projection can replay all earlier events without failing.** Ask it\n  explicitly: at production volume, does this projection complete a full replay?\n- **Events are small.** No large blob and no base64 payload embedded in an\n  event; put the content elsewhere and carry a reference.\n- No eager load of a whole event sequence without paging or filtering.\n- AutoMap is on by default. Hand-mapping every property is both a maintenance\n  and a cost problem — and, since AutoMap runs anyway, it does not save the work\n  it appears to.\n\n## Step 2 — Read models and their store\n\n- Queries filter on indexed fields. An unintentional full-collection scan is the\n  most common finding here.\n- **A list that can grow returns a shape Arc pages** — `IQueryable\u003CT>` for a\n  LINQ-native provider, `collection.Observe(...)` for MongoDB — so Arc applies\n  server-side paging and sorting. A query that writes its own `Skip`\u002F`Take` or\n  `OrderBy` for the client's page or sort is a finding, as is MongoDB\n  `AsQueryable()` (translation failures at request time). Materializing and then slicing in memory reads the whole\n  collection every request.\n- No N+1: one query returns what the caller needs.\n- A count is a count. Hydrating the collection to measure its length is the\n  same finding as an unpaged list, wearing different clothes.\n- Prefer slim projection-backed summaries over repeatedly assembling broad\n  collections. Query composition is supported; one collection per query is not\n  a framework requirement. Bound each input and measure recomputation.\n- Embed bounded related state, not growing histories; page timelines separately.\n  Evaluate variants for divergent lifecycle shapes, not every status field.\n- Preserve reducer admission and ordering guards when proposing a projection\n  conversion; an unconditional setter may resurrect or prematurely create state.\n- Count passive models as inventory, not a smell. Assess history length and read\n  frequency against consistency\u002Fsecurity needs. Requires Chronicle 19.77.3 for\n  per-key strongly consistent projection reads to fold from the start each time;\n  repeated reads are O(key history), not incremental cache hits. Prefer a\n  materialized projection for frequent long-history reads when freshness permits. `IMongoCollection\u003CT>` cannot\n  read passive computed state; never materialize secrets to make that query work.\n- Distinguish retained `Observe` state and in-memory emissions from explicit\n  recompute queries. Narrow source filters and inspect page-refill\u002Fmembership\n  lookups; do not claim every change re-queries the entire collection. See the\n  **cratis-chronicle-read-model** query reference for versioned behavior.\n\n## Step 3 — Commands and queries\n\n- A response payload carries only fields the client uses.\n- Command validators are synchronous and in-memory. Validation is on the hot\n  path of every attempt, including the ones that will be rejected — an I\u002FO call\n  there is paid on every request.\n- No `await Task.Run(() => syncWork)` wrapping for work that is naturally\n  asynchronous.\n\n## Step 4 — .NET\n\n- No `.ToList()` before `.Where()`. Filter before materializing.\n- An `IEnumerable\u003CT>` is not enumerated more than once — materialize once when\n  it must be reused.\n- Large-object logging uses the destructuring form only at `Debug` level, so a\n  production log level does not pay to serialize it.\n\n## Step 5 — React\n\n- A `DataTable` over a growable collection uses lazy loading and a paginator\n  rather than rendering every row.\n- No inline object or array literal passed as a prop: it is a new identity every\n  render and defeats memoization downstream.\n- `useEffect` dependencies are correct — neither missing nor over-broad. An\n  over-broad dependency array is a re-run per render, which reads as a\n  correctness bug and behaves as a performance one.\n- Components over large collections hold stable references or are memoized.\n- No `JSON.parse(JSON.stringify(x))` deep cloning.\n\n## Step 6 — Report\n\nRead and use `.cratis\u002Fai\u002Frules\u002Freview-reports.md` when writing the report.\nKeep the performance risk label on each finding:\n\n| Risk | Shared classification |\n| --- | --- |\n| **High** | Blockers: degradation at moderate load requiring correction before merge |\n| **Medium** | Suggestions: degradation under load or as data grows |\n| **Low** | Suggestions: minor inefficiency |\n\nUse the shared verdict vocabulary, not a separate performance verdict. If a\nscale-dependent degradation must be corrected before merge, classify it as High\nand state the relevant scale rather than leaving a blocker under Medium.\n\n**Say what the finding costs and at what scale.** \"This is slow\" is not\nactionable; \"this scans the whole collection on every page load, so it is fine\nat hundreds of rows and not at tens of thousands\" is. Distinguish measured cost\nfrom code-shape inference; use the shared scope line to name unmeasured behavior.\n\n## What breaks\n\n- **A shape finding is reported as a measurement.** Reading code tells you the\n  shape; only running it tells you the cost. Say which one you have.\n- **The paging advice contradicts the paging skill.** `cratis-arc-query-paging`\n  is authoritative on the mechanism. Report the missing paging; do not invent an\n  alternative to it.\n- **A replay cost is judged at development volume.** A projection over a hundred\n  seeded events proves nothing about a replay over a production history.\n- **Every finding is High.** The classification is the value; when all findings\n  are urgent, none are.\n\n## How it is proven\n\nThe build and specifications are green before the report is written; each\nfinding cites the file and line and states the scale at which it bites; and the\nreport says plainly that it reviewed code shape rather than measured behavior,\nnaming anything that would need a benchmark to settle.\n",{"name":5,"license":14,"description":7},"main","45728854e223fd51b203724ca0e5be9c8f93a5a4",".cratis\u002Fai\u002Fskills\u002Fcratis-performance-review","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go","https:\u002F\u002Fwww.cratis.io\u002Ffundamentals\u002Fgo\u002F","https:\u002F\u002Fgithub.com\u002FCratis","https:\u002F\u002Fwww.cratis.io","Open-source (MIT) event sourcing and CQRS for .NET and beyond: Chronicle, Arc, Components and Screenplay.","2026-11-14 15:52:19",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Cratis\u002FFundamentals.Go --skill cratis-performance-review",{"tool":39,"command":40},"bunx","bunx skills add Cratis\u002FFundamentals.Go --skill cratis-performance-review",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Cratis\u002FFundamentals.Go --skill cratis-performance-review","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fcratis-performance-review\u002FSKILL.md",true,[47],{"path":48,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":15},"LICENSE","许可证",204,[52,60,68,76,85,92],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":56,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7DNCY3BCGY3MC5BFJ9S59BF","spf13-go","Review Go library APIs, package boundaries, tests, iterators and standard-library choices. Load for broad design or idiom reviews after the repository-owned Go skills.","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fspf13-go\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fspf13-go\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":64,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7DNCSQQH7GQ03ZETFX9XHAS","samber-golang-error-handling","Review Go error creation, wrapping, inspection and logging boundaries. Load when changing caller-visible failures after go-errors-and-context.","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fsamber-golang-error-handling\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fsamber-golang-error-handling\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":72,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7DNCM4ZC15SSDA5FAAHN5S0","samber-golang-context","Design Go context propagation, cancellation, deadlines and request metadata. Load for operation-lifetime changes or context-related leaks after go-errors-and-context.","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fsamber-golang-context\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fsamber-golang-context\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":80,"licenseFileUrl":81,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7DNCGNSMHK640AK1R3J0CPD","jetbrains-go-modern-guidelines","Choose version-compatible modern Go syntax and standard-library APIs. Load when modernizing touched Go code after reading go.mod and build constraints.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fjetbrains-go-modern-guidelines\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fjetbrains-go-modern-guidelines\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7DNCBYSD6FPAPWM6PPSJR96","go-testing","Write and review Go unit, contract, transport, race, fuzz, and deterministic concurrency tests. Use for new behavior, bug fixes, flaky tests, and public API parity evidence.","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fgo-testing\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7DNC7ES2RD6WGKC94KMMXTD","go-release-modules","Review Go module dependencies, minimum versions, compatibility, semantic labels, release-action tags, and proxy discoverability. Use for release preparation, retractions, and major-version migration planning.","https:\u002F\u002Fgithub.com\u002FCratis\u002FFundamentals.Go\u002Fblob\u002Fmain\u002F.cratis\u002Fai\u002Fskills\u002Fgo-release-modules\u002FSKILL.md",[],[]]