spec-kitty-glossary-context

Curate and apply canonical terminology across Spec Kitty missions. Triggers: "update the glossary", "use canonical terms", "check terminology", "add a term", "fix term drift", "glossary conflicts", "resolve ambiguity", "review terminology consistency". Does NOT handle: runtime loop advancement, setup or repair requests, agent configuration, or direct code implementation tasks.

1,029 stars

Best use case

spec-kitty-glossary-context is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Curate and apply canonical terminology across Spec Kitty missions. Triggers: "update the glossary", "use canonical terms", "check terminology", "add a term", "fix term drift", "glossary conflicts", "resolve ambiguity", "review terminology consistency". Does NOT handle: runtime loop advancement, setup or repair requests, agent configuration, or direct code implementation tasks.

Teams using spec-kitty-glossary-context should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/spec-kitty-glossary-context/SKILL.md --create-dirs "https://raw.githubusercontent.com/Priivacy-ai/spec-kitty/main/src/doctrine/skills/spec-kitty-glossary-context/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/spec-kitty-glossary-context/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How spec-kitty-glossary-context Compares

Feature / Agentspec-kitty-glossary-contextStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Curate and apply canonical terminology across Spec Kitty missions. Triggers: "update the glossary", "use canonical terms", "check terminology", "add a term", "fix term drift", "glossary conflicts", "resolve ambiguity", "review terminology consistency". Does NOT handle: runtime loop advancement, setup or repair requests, agent configuration, or direct code implementation tasks.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# spec-kitty-glossary-context

Maintain semantic integrity by curating the project glossary, detecting term
drift, and ensuring that all mission artifacts use canonical terminology.

Use this skill when the user wants to inspect, update, or enforce glossary
terms. Do not use it for purely operational tasks like advancing the runtime
loop or repairing an installation.

---

## How the Glossary Works

The glossary is a **semantic integrity runtime** — a 5-layer middleware pipeline
that intercepts mission step execution, extracts terms from inputs/outputs,
checks them against stored definitions, and can **block generation** if
terminology conflicts are unresolved.

### Data Model

**Terms** have a `surface` (normalized to lowercase), `definition`, `scope`,
`confidence` (0.0–1.0), and `status` (draft/active/deprecated).

**Seed files** (`.kittify/glossaries/{scope}.yaml`) provide initial definitions.
**Event logs** (`.kittify/events/glossary/*.events.jsonl`) record all runtime
mutations as append-only JSONL. State is reconstructed by replaying seed files
then events.

### 4 Scopes (narrowest wins)

| Precedence | Scope | Use For |
|:---:|---|---|
| 0 (highest) | `mission_local` | Feature-specific jargon |
| 1 | `team_domain` | Team/org conventions |
| 2 | `audience_domain` | Industry/domain standards |
| 3 (lowest) | `spec_kitty_core` | Framework terms (lane, work package, mission) |

### The 5-Layer Middleware Pipeline

When a mission primitive executes (via `@glossary_enabled` decorator or
`GlossaryAwarePrimitiveRunner`), this pipeline processes the step:

**Layer 1 — Term Extraction.** Scans step input/output for terminology using
multiple methods (in priority order):

| Method | Confidence | Example |
|---|:---:|---|
| Metadata hints (`glossary_watch_terms`) | 1.0 | Explicit list of terms to monitor |
| Quoted phrases | 0.8 | `"work package"` in text |
| Acronyms (2-5 uppercase) | 0.8 | `WP`, `API` |
| Casing patterns (snake_case, CamelCase) | 0.8 | `worktree_node`, `WorkspaceManager` |
| Repeated nouns (3+ occurrences) | 0.5 | Frequent domain words |

Emits `TermCandidateObserved` events.

**Layer 2 — Semantic Check.** Resolves each extracted term against the scope
hierarchy and classifies conflicts:

| Conflict Type | Trigger | Severity |
|---|---|---|
| `UNKNOWN` | Term not in any scope | Varies by confidence + criticality |
| `AMBIGUOUS` | 2+ active senses for same surface | HIGH in critical steps |
| `INCONSISTENT` | Output contradicts glossary definition | LOW (informational) |
| `UNRESOLVED_CRITICAL` | Unknown term in critical step, low confidence | HIGH |

Emits `SemanticCheckEvaluated` events.

**Layer 3 — Clarification (runs BEFORE the gate).** Users get a chance to
resolve conflicts before generation is blocked:

- In interactive mode: prompts user to select a candidate sense, provide a
  custom definition, or defer
- In non-interactive mode (CI/headless): auto-defers all conflicts
- Resolved conflicts are removed; deferred ones pass to Layer 4

Emits `GlossaryClarificationRequested`, `GlossaryClarificationResolved`,
and `GlossarySenseUpdated` events.

**Layer 4 — Generation Gate.** Evaluates whether to block based on strictness:

| Strictness | Behavior |
|---|---|
| `off` | Never block |
| `medium` (default) | Block only HIGH severity conflicts |
| `max` | Block any unresolved conflict |

Strictness resolved via 4-tier precedence: runtime flag > step metadata >
mission config > global default (`.kittify/config.yaml`).

If blocking: saves a **checkpoint** (SHA256 input hash, scope versions, retry
token), emits `StepCheckpointed` and `GenerationBlockedBySemanticConflict`
events, then raises `BlockedByConflict`.

**Layer 5 — Resume.** For retry after a block:

- Loads checkpoint from event log
- Verifies input hash hasn't changed (detects context drift)
- Prompts user if context changed
- Restores execution state

### Step-Level Configuration

Individual mission steps can control glossary behavior via metadata:

```yaml
# In step definition
glossary_check: enabled          # or "disabled" to skip this step
glossary_check_strictness: max   # override strictness for this step
glossary_watch_terms:            # explicit terms to monitor (confidence 1.0)
  - work package
  - lane
glossary_aliases:                # map synonyms to canonical forms
  task: work package
  status: lane
glossary_exclude_terms:          # terms to ignore
  - the
  - a
```

### 8 Event Types

| Event | When | Effect |
|---|---|---|
| `GlossaryScopeActivated` | Scope loaded at runtime | Informational |
| `TermCandidateObserved` | Term extracted from text | Records extraction |
| `SemanticCheckEvaluated` | Semantic check completes | Records findings |
| `GlossaryClarificationRequested` | Conflict needs resolution | Creates pending conflict |
| `GlossaryClarificationResolved` | User selects a sense | Promotes selected sense |
| `GlossarySenseUpdated` | Term added/definition changed | Updates store |
| `GenerationBlockedBySemanticConflict` | Gate blocks generation | Records block |
| `StepCheckpointed` | State saved before block | Enables resume |

All events are append-only in `.kittify/events/glossary/{mission-id}.events.jsonl`.

### Integration Patterns

```python
# 1. Decorator (simplest)
@glossary_enabled(repo_root=Path("."))
def my_primitive(context):
    return {"result": "ok"}

# 2. Function processor
processor = attach_glossary_pipeline(repo_root, runtime_strictness, interaction_mode)
processed_context = processor(context)  # May raise BlockedByConflict

# 3. Runner class
runner = GlossaryAwarePrimitiveRunner(repo_root, runtime_strictness)
result = runner.execute(primitive_fn, context)
```

The `BlockedByConflict` exception carries the `conflicts` list, `strictness`
mode, and a user-facing message. Callers should catch it, present the conflicts,
and offer resolution before retrying.

---

## Step 1: Locate Glossary Context

Identify the glossary state for the current project.

**What to check:**

- Seed files under `.kittify/glossaries/` (one YAML per scope)
- Event logs under `.kittify/events/glossary/` (JSONL, event-sourced)
- The store replays seed files then events at query time

**Commands:**

```bash
spec-kitty glossary list
spec-kitty glossary list --scope spec_kitty_core
spec-kitty glossary list --status active --json
```

**Expected outcome:** You know which scopes are populated and whether event
logs contain runtime mutations.

---

## Step 2: Check Conflicts and Strictness

The glossary gates mission execution through the strictness system.

**Commands:**

```bash
spec-kitty glossary conflicts
spec-kitty glossary conflicts --unresolved
spec-kitty glossary conflicts --strictness max --mission 012-documentation-mission
```

**Expected outcome:** You understand why a conflict blocked the runtime, or you
can confirm no blocking conflicts exist.

---

## Step 3: Update Terms and Resolve Conflicts

**Adding or editing terms:** Edit the seed file for the appropriate scope.

Choose the scope by term ownership:

- Project-internal jargon: `mission_local.yaml`
- Shared domain vocabulary: `team_domain.yaml`
- User-facing terms: `audience_domain.yaml`
- Spec Kitty concepts: `spec_kitty_core.yaml` (rarely edited)

Rules: `surface` must be lowercase/trimmed; `status` is `active`, `deprecated`,
or `draft`; `confidence` is 0.0–1.0.

**Seed file format:**

```yaml
terms:
  - surface: <lowercase trimmed string>
    definition: <non-empty string>
    confidence: <float 0.0-1.0>       # default 1.0
    status: <active|deprecated|draft>  # default draft
```

**Status lifecycle:** `draft` → (promote) → `active` → (retire) → `deprecated`
→ (re-draft) → `draft`. Deprecated senses are excluded from resolution but
remain in event history.

**Resolving conflicts interactively:**

```bash
spec-kitty glossary resolve <conflict_id>
spec-kitty glossary resolve <conflict_id> --mission 012-docs
```

The resolver presents candidate senses. You can select one, enter a custom
definition, or defer. Custom definitions emit both a
`GlossaryClarificationResolved` and a `GlossarySenseUpdated` event.

**Expected outcome:** The glossary reflects intended terminology and runtime-
blocking conflicts are resolved.

---

## Step 4: Detect and Prevent Semantic Drift

Semantic drift occurs when artifacts gradually diverge from glossary definitions.
See `references/semantic-drift-examples.md` for six concrete drift patterns.

**Detection:**

1. Run `spec-kitty glossary list --json` and compare definitions against spec,
   plan, and task files
2. Run `spec-kitty glossary conflicts --unresolved` for terms the runtime flagged
3. Search WP frontmatter for informal synonyms (e.g., "task" instead of the
   canonical "work package")

**Correction:**

- Artifact is wrong: replace with the canonical term
- Glossary is outdated: update the seed file definition
- Genuinely ambiguous: add a second sense and let the strictness system force
  disambiguation

**Prevention:**

- Set strictness to `medium` or `max` so the runtime catches conflicts early
- Add domain terms to the glossary before writing specs that use them
- Use `glossary_watch_terms` in step metadata for high-value terms
- Use `glossary_aliases` to map known synonyms to canonical forms
- Review the conflict log after each completed mission

**Consistency checklist:**

1. Every WP title and description uses canonical surface forms
2. Plan documents reference terms as defined in the glossary
3. No informal synonyms appear without a corresponding glossary entry
4. Deprecated terms are not reintroduced in new artifacts

**Expected outcome:** Terminology is consistent across all mission artifacts
and the glossary remains a living, enforced contract.

---

## References

- `references/glossary-field-guide.md` -- Seed file schema, scope precedence, status lifecycle, event-sourcing mechanics, and CLI quick reference
- `references/semantic-drift-examples.md` -- Concrete drift patterns with detection and correction strategies

Related Skills

spec-kitty-setup-doctor

1029
from Priivacy-ai/spec-kitty

Install, verify, and recover the modern Spec Kitty 2.0.11+ operating surface. Triggers: "set up Spec Kitty", "skills missing", "next is blocked", "runtime is broken", "doctrine assets are missing", "my agent can't find the skills". Does NOT handle: generic coding questions with no Spec Kitty context, direct runtime loop advancement, or editorial glossary maintenance.

spec-kitty-runtime-review

1029
from Priivacy-ai/spec-kitty

Review runtime-owned outputs using the Spec Kitty review workflow surface, then direct approval or rejection with structured feedback. Triggers: "review this work package", "check runtime output", "approve this step", "review WP", "is this WP ready to approve", "check this implementation". Does NOT handle: setup-only repair requests, direct implementation work, editorial glossary maintenance, or runtime loop advancement.

spec-kitty-runtime-next

1029
from Priivacy-ai/spec-kitty

Drive the canonical spec-kitty next --agent <name> control loop for mission advancement. Load agent profiles at init, apply action-scoped doctrine context at each step boundary, and pull specific tactics/directives on demand. Triggers: "run the next step", "what should runtime do next", "advance the mission", "what is the next task", "continue the workflow", "what step comes next". Does NOT handle: setup or repair requests, purely editorial glossary or doctrine maintenance, or direct code review.

spec-kitty-orchestrator-api-operator

1029
from Priivacy-ai/spec-kitty

Teach agents and external systems how to use spec-kitty orchestrator-api to drive workflows from outside the host CLI. Triggers: "use orchestrator-api", "build a custom orchestrator", "automate externally", "integrate CI with spec-kitty", "call spec-kitty from another tool", "orchestrator contract", "external automation". Does NOT handle: host-internal lane mutation (use the host CLI directly), runtime loop advancement (use spec-kitty next), mission sequencing logic (the mission state machine owns that), or setup/repair diagnostics.

spec-kitty-mission-system

1029
from Priivacy-ai/spec-kitty

Understand how Spec Kitty missions work: the 4 built-in mission types, how they define workflows via step contracts and action indices, how missions and work packages relate, how templates are resolved through the 5-tier chain, and how doctrine artifacts (procedures, tactics, directives) compose mission behavior. Triggers: "what missions are available", "how do missions work", "which mission should I use", "explain the mission system", "what is a mission", "change the mission", "mission templates", "step contracts", "action index", "mission procedures". Does NOT handle: runtime loop advancement (use runtime-next), setup or repair (use setup-doctor), governance (use charter-doctrine), or glossary curation (use glossary-context).

spec-kitty-git-workflow

1029
from Priivacy-ai/spec-kitty

Understand how Spec Kitty manages git: what git operations Python handles automatically, what agents must do manually, worktree lifecycle, auto-commit behavior, merge execution, and the safe-commit pattern. Triggers: "how does spec-kitty use git", "worktree management", "auto-commit", "who commits what", "git workflow", "merge workflow", "rebase WPs", "worktree cleanup", "safe commit". Does NOT handle: runtime loop advancement (use runtime-next), setup or repair (use setup-doctor), mission selection (use mission-system).

spec-kitty-constitution-doctrine

1012
from Priivacy-ai/spec-kitty

Run constitution interview, generation, context, and sync workflows for project governance in Spec Kitty 2.x. Triggers: "interview for constitution", "generate constitution", "sync constitution", "use doctrine", "set up governance", "constitution status", "extract governance config". Does NOT handle: generic spec writing not tied to governance, direct runtime loop advancement, setup/repair diagnostics, or editorial glossary maintenance.

context-window-management

31392
from sickn33/antigravity-awesome-skills

Strategies for managing LLM context windows including summarization, trimming, routing, and avoiding context rot

context-manager

31392
from sickn33/antigravity-awesome-skills

Elite AI context engineering specialist mastering dynamic context management, vector databases, knowledge graphs, and intelligent memory systems.

context-fundamentals

31392
from sickn33/antigravity-awesome-skills

Context is the complete state available to a language model at inference time. It includes everything the model can attend to when generating responses: system instructions, tool definitions, retrieved documents, message history, and tool outputs.

context-degradation

31392
from sickn33/antigravity-awesome-skills

Language models exhibit predictable degradation patterns as context length increases. Understanding these patterns is essential for diagnosing failures and designing resilient systems.

claude-win11-speckit-update-skill

31392
from sickn33/antigravity-awesome-skills

Windows 11 system management