# `Diffo.Provider.Validations.ValidateSpecificationKind`
[🔗](https://github.com/diffo-dev/diffo/blob/v0.9.0/lib/diffo/provider/validations/validate_specification_kind.ex#L5)

Validates that the specification an instance is being specified by matches the
instance kind: a **Service** must be specified by a `:serviceSpecification`, a
**Resource** by a `:resourceSpecification`.

Runtime counterpart to the compile-time
`Diffo.Provider.Extension.Verifiers.VerifySpecificationKind`. The verifier guards
the statically-declared `specification do type` on consumer leaves; this guards
the specification associated **at runtime** via the `specified_by` argument —
covering generic instances (`Provider.Instance` and resource leaves with no spec
DSL) and `respecify`, which the verifier cannot see.

Declared on the `Service` / `Resource` fragments with the expected spec type, so
each kind carries its own constraint. A no-op on changes that do not set
`specified_by`. A missing/unreadable spec is left to other machinery — this
validation only rejects a *present, wrong-kind* specification.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
