cratis-fundamentals-type-discovery

cratis-fundamentals-type-discovery is a skill for Claude Code, Codex from Cratis/AI. It costs 45 tokens per session (634 once invoked), scanned A, original, MIT.

A dependency-injection pattern for automatically finding every implementation of an interface. Instead of maintaining a list of registrations by hand, code asks for all matching implementations discovered by Cratis.Types.

In plain words
What is it for?
Use it for handler sets, filter chains, strategy collections, or dispatchers that must run across every implementation. It is not for a service where exactly one implementation should be selected.
Why use it?
Manual registration lists can become outdated when implementations are added or removed. Automatic discovery keeps the implementation set in one place and reduces matching setup in tests.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for handler sets, filter chains, strategy collections, or dispatchers that must run across every implementation. It is not for a service where exactly one implementation should be selected.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cratis/ai/cratis-fundamentals-type-discovery
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Cratis/AI --skill cratis-fundamentals-type-discovery
Clone the repo
git clone --depth 1 https://github.com/Cratis/AI

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cratis-fundamentals-type-discovery

README.md
[![agentmods](https://agentmods.dev/badge/skills/cratis/ai/cratis-fundamentals-type-discovery/github.svg)](https://agentmods.dev/skills/cratis/ai/cratis-fundamentals-type-discovery)
Your own site
<a href="https://agentmods.dev/skills/cratis/ai/cratis-fundamentals-type-discovery"><img src="https://agentmods.dev/badge/skills/cratis/ai/cratis-fundamentals-type-discovery/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cratis-fundamentals-type-discovery

Your own site · 80×15
<a href="https://agentmods.dev/skills/cratis/ai/cratis-fundamentals-type-discovery"><img src="https://agentmods.dev/badge/skills/cratis/ai/cratis-fundamentals-type-discovery.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 634 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.00634
Opus 5.5 $0.00018 $0.00254
Sonnet 5.5 $0.00009 $0.00127
Haiku 4.5 $0.00005 $0.00063

Measured today against content hash 6cdfb59603a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cratis-fundamentals-type-discovery scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cratis/ai/skills/cratis-fundamentals-type-discovery/SKILL.md · 41 lines

What it actually says

Discover implementations in .NET

When a consumer needs every implementation, inject IInstancesOf<T> from Cratis.Types. Use a concrete, non-generic implementation of an interface or abstract class. Discovering a set avoids maintaining a second list in the composition root. For one chosen service, inject that service's interface instead; for a sequence returned as data, use an ordinary collection type.

  1. Reference Cratis.Fundamentals in projects that contribute implementations; its NuGet package carries the discovery analyzer. Arc's AddCratisArc() already configures discovery and convention bindings. Choose explicit host setup when using a plain .NET host: call services.AddTypeDiscovery(), services.AddBindingsByConvention() and services.AddSelfBindings() before building the provider (Cratis.DependencyInjection and Microsoft.Extensions.DependencyInjection). A project reference to Fundamentals source doesn't bring the analyzer: see discovery diagnostics if the host can't see a contributor.

  2. Implement the contract. Leave the lifetime unspecified for a transient; use [Scoped] for a scope-bound implementation or [Singleton] for an implementation safe to share across scopes and concurrent calls. Both attributes are in Cratis.DependencyInjection. Keep the consumer within a scope if it resolves scoped implementations.

  3. Enumerate the discovered set in the operation. In this example, neither the consumer nor its implementations needs a manual registration in an Arc host:

    using System.Linq;
    using Cratis.Types;
    
    namespace Reports;
    
    public interface IReportSection
    {
        string Heading { get; }
    }
    
    public class TotalsSection : IReportSection
    {
        public string Heading => "Totals";
    }
    
    public class ReportOutline(IInstancesOf<IReportSection> sections)
    {
        public string[] GetHeadings() => sections.Select(section => section.Heading).ToArray();
    }
    

    The set resolves concrete self-bindings, not IEnumerable<T> interface registrations. Remove old manual registrations only after checking that no other consumer needs them. Each enumeration resolves instances from the captured provider, so a singleton consumer cannot safely resolve scoped implementations. Materialize once when an operation needs to reuse the same resolved instances. Do not rely on discovery order as business precedence; apply an explicit order when it matters.

  4. Build and exercise the behavior through the host. Assert the expected contributions, not just that iteration completed: an empty set can otherwise pass a fan-out spec. If a contribution is missing or enumeration throws, use discovery diagnostics.

Choose IImplementationsOf<T> when the consumer needs only type metadata. It enumerates Type without constructing the implementations, so concrete self-bindings aren't needed for that enumeration.

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · -162 lines · +2 tokens per session 6cdfb59603a3
  2. 1mo ago Changed · -26 tokens per session c902dcfc403d
  3. 1mo ago Changed · +13 lines 73c2dc79b6b9
  4. 1mo ago Changed c05dec096608
  5. 1mo ago Changed · +37 lines 1124b632c3cd
  6. 1mo ago Changed · -2 tokens per session 8f9f11830345
  7. 2mo ago Changed 6f32c41ec458
  8. 2mo ago First seen · 153 lines · 71 tokens per session scan A 6cf847780b99

Subscribe to this mod's changes

cratis-fundamentals-type-discovery is a skill published in the GitHub repository Cratis/AI (4 stars, last pushed today), licensed MIT. It adds 45 tokens to every session and 634 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-08.

Related

cratis-fundamentals-type-discovery compared with skills from other repositories

cratis-fundamentals-type-discovery next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cratis-fundamentals-type-discoveryCratis/AISkill4todayMITA45Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill101ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill395ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill330k2d agoMITA21Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill14kyesterdayCC0-1.0A113Claude Code, Codex
next-cache-components-adoptionvercel/next.jsSkill144ktodayMITA95Claude Code