trails-discriminate-union

Analyze Trails union-like outputs to identify stable discriminants and governance actions.

4|1|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/outfitter-dev/trails --skill trails-discriminate-union
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trails-discriminate-union
Source: https://github.com/outfitter-dev/trails/tree/main/plugin/skills/trails-discriminate-union
Command: npx skills add https://github.com/outfitter-dev/trails --skill trails-discriminate-union

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Review Trails outputs that expose union-like shapes to agents or surfaces and supports deciding whether stable discriminants are required, or whether the issue is schema cleanup, advisory guidance, or Warden work.

Core Features & Use Cases

  • Identify branch evidence across Zod schemas, JSON Schema projections, tests, and downstream surface behavior.
  • Detect stable discriminants such as kind, mode, or type to determine whether consumers can reliably distinguish branches.
  • Provide actionable recommendations (add a discriminant, keep private unions internal, or raise advisory follow-up) and indicate when Warden enforcement is safe.
  • Reference authoritative sources and audits to guide governance decisions.

Quick Start

Review the public Trails output to determine whether a stable discriminant should be introduced.

Frequently Asked Questions about trails-discriminate-union

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify discriminant needs for union-like branches in API schemas?

To identify discriminant needs for union-like branches in API schemas, analyze public Trails outputs across projections and surface responses to detect stable discriminants like kind, mode, or type. This process evaluates branch evidence and risk to determine if consumers can reliably distinguish branches.

What are stable discriminants and when do I need them for queryable shapes?

Stable discriminants are properties like kind, mode, or type that allow consumers to reliably distinguish union branches in queryable shapes. You need them when exposing union-like public API outputs to agents or surfaces, ensuring schema stability and safe Warden enforcement.

How to analyze Zod schemas and JSON Schema projections for branch evidence?

Analyze Zod schemas and JSON Schema projections for branch evidence by reviewing Trails outputs to detect stable discriminants across tests and downstream surface behavior. This identifies whether schema changes are warranted or if advisory follow-ups are sufficient for governance.

Does this schema analysis tool work with public API surfaces and Warden enforcement?

Yes, this schema analysis tool works with public API surfaces and Warden enforcement by evaluating union-like branch outputs. It determines whether a stable discriminant exists, indicating when Warden enforcement is safe or when to raise advisory follow-ups and keep private unions internal.

When should I not add a discriminant to a union schema?

You should not add a discriminant to a union schema when the analysis determines the issue is schema cleanup or advisory guidance rather than a stable discriminant requirement. In these cases, keep private unions internal and raise advisory follow-ups instead of enforcing Warden actions.

What's the best way to govern union-like branches exposed in public Trails outputs?

The best way to govern union-like branches exposed in public Trails outputs is to analyze branch evidence and risk across projections. This determines whether to add a discriminant, keep private unions internal, or raise advisory follow-ups based on authoritative source audits.