SKILL

cratis-fundamentals-type-discovery

Use when a Cratis handler set, filter chain, strategy set or dispatcher must discover every implementation of an abstraction. Not for selecting one service implementation at composition time.

原文 · 译文尚未补齐

适用对象:对象待分类。自动收录 · 待核查。

原作者说明节选

从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。

查看英文原文

原文涵盖的主题

  • Cratis implementation discovery
  • Verified product sources
  • Route near misses
  • When you need this
  • Step 1 — Confirm the implementations are discoverable
  • Step 2 — Choose the lifetime with an attribute
  • Step 3 — Inject IInstancesOf in the consumer
  • Step 4 — Delete the dead registrations

services.AddSingleton () looks free at the registration line. The cost arrives later: a new implementation in another folder does nothing until someone remembers the line, a removed one leaves a registration that fails at startup, and every specification setup has to mirror the composition root. IInstancesOf moves that knowledge into the implementation. Adding or removing one becomes a single-file change. | Package | Purpose | | --- | --- | | Cratis.Fundamentals | IInstancesOf , IImplementationsOf , ITypes, convention bindings and the bundled Cratis.Fundamentals.TypeDiscovery.Generator | Reverify against the Cratis Fundamentals repository before claiming support for another version. The consumer needs one implementation chosen at composition time: constructor-inject the interface and let the IFoo → Foo convention resolve it. This skill does not apply. The method returns a sequence of values to a caller: IEnumerable (or IReadOnlyList ) is still the right return type. The rule is about injecting implementations of an abstraction, not about returning values. You only need the types, never instances: inject IImplementationsOf , which enumerates Type rather than T. The consumer of an ab

这里只展示节选,请以完整原文和当前要求为准。

来源仓库
Cratis/AI
源文件
.cratis/ai/skills/cratis-fundamentals-type-discovery/SKILL.md
固定版本
868bc20e7f474299466331a3cf86eaf995be0a2b
阅读完整原作者说明 ↗

来源与内容状态

本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。

原作者:Cratis/AI · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-12T11:00:49.571Z。

分类由名称、说明与路径规则生成,分类不代表已核实适配。

许可与权利归属

MIT。第三方内容及版权归原作者,使用条件以原文为准。

许可原文 ↗

本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。

限制与注意事项

  • 元数据收录不代表本站已经安装、适配、实测或进行安全审查。