# Wind Kit Diagnostics Contracts

**Read wind_kit state without depending on it.**

Per-element widget state and process-wide counters for debug tools and AI agents, through one registry. No UI, no native code, no wind_kit in your build.

## One registry. Two contracts.

wind_kit exposes its runtime state through small abstract contracts. A debug tool reads them, wind_kit fills them, and neither imports the other.

### Per-element state

Ask the resolver about any `Element` for its `className`, `breakpoint`, `brightness`, `platform`, `states` and colours. An element that is not wind_kit resolves to an empty map.

[Learn more about Per-element state](https://anilcancakir.com/wind_kit_diagnostics_contracts/docs/basics/debug-resolver.md)

### Process-wide counters

Cache hits and misses, build counts per widget type and inherited reads, from `WindPerfResolver.stats()`.

[Learn more about Process-wide counters](https://anilcancakir.com/wind_kit_diagnostics_contracts/docs/basics/perf-resolver.md)

### One registry

`WindDebugRegistry` holds a debug slot and a perf slot. Both are `null` until wind_kit installs its resolvers at boot.

[Learn more about One registry](https://anilcancakir.com/wind_kit_diagnostics_contracts/docs/basics/registry.md)

### No wind_kit dependency

It depends on `flutter` and `meta` only, so a debug tool never pulls wind_kit into its build. An app that uses wind_kit already has it.

[Learn more about No wind_kit dependency](https://anilcancakir.com/wind_kit_diagnostics_contracts/docs/getting-started/installation.md)

### Test with a fake

`registerForTesting` puts a fake resolver in the debug slot and `resetForTesting` clears both slots, so a test needs no wind_kit.

[Learn more about Test with a fake](https://anilcancakir.com/wind_kit_diagnostics_contracts/docs/guides/testing.md)

### A stable 1.x contract

A new key is a minor release and a renamed or removed one is a major release, so a tool that reads the keys it needs keeps working.

[Learn more about A stable 1.x contract](https://anilcancakir.com/wind_kit_diagnostics_contracts/docs/guides/versioning.md)

## Add it in seconds

```bash
flutter pub add wind_kit_diagnostics_contracts
```

Or add to `pubspec.yaml`:

```yaml
dependencies:
  wind_kit_diagnostics_contracts: ^1.3.0
```

Or give your AI agent this prompt:

```text
Read https://anilcancakir.com/wind_kit_diagnostics_contracts/docs/llms.txt and install the Wind Kit Diagnostics Contracts package in this project.
```

## Docs

### Getting Started

- [Installation](https://anilcancakir.com/wind_kit_diagnostics_contracts/docs/getting-started/installation.md)

### The Basics

- [WindDebugRegistry](https://anilcancakir.com/wind_kit_diagnostics_contracts/docs/basics/registry.md)
- [WindDebugResolver](https://anilcancakir.com/wind_kit_diagnostics_contracts/docs/basics/debug-resolver.md)
- [WindPerfResolver](https://anilcancakir.com/wind_kit_diagnostics_contracts/docs/basics/perf-resolver.md)

### Guides

- [Testing](https://anilcancakir.com/wind_kit_diagnostics_contracts/docs/guides/testing.md)
- [Versioning](https://anilcancakir.com/wind_kit_diagnostics_contracts/docs/guides/versioning.md)
