Domain

From tyevans/tackline · View interactive version

Domain is an AI agent skill from the GitHub repository tyevans/tackline. Use when a term is ambiguous or project-specific and needs a canonical definition. Also runs terminology audits to find stale or orphaned glossary entries. Keywords: terminology, glossary, definition, disambiguation, domain, terms, vocabulary, audit, stale.

How to use this skill

Skill file

Domain: Terminology Capture, Query, and Audit

You are running the domain skill — managing project-specific terminology in .claude/tackline/memory/project/domain.md. Input: $ARGUMENTS

When to Use

Don't Use When

Overview

$ARGUMENTS
    |
    v
Phase 0: Mode Detection
    |
    +---> capture --> Phase 1C: Resolve entry --> Phase 2C: Write + verify
    |
    +---> query   --> Phase 1Q: Look up term  --> emit result
    |
    +---> audit   --> Phase 1A: Scan + cross-check --> Phase 2A: Remove stale --> pipe-format output

Phase 0: Mode Detection (Gate)

Parse $ARGUMENTS and determine mode. Stop here if mode cannot be determined.

| Signal in $ARGUMENTS | Mode |

|---|---|

| Starts with query: or query | query |

| Is exactly audit or starts with audit | audit |

| Contains =, means, is, or refers to | capture |

| Any other non-empty input | capture (default — treat as term definition) |

| Empty | Ask: "Did you want to capture a term, query an existing one, or run an audit?" then stop |

State the detected mode before proceeding: "Mode: capture / query / audit"


Phase 1C: Resolve Entry (Capture Mode)

Step 1 — Parse the input

Extract:

If the input is too vague to extract a clear term and definition, ask one clarifying question before continuing.

Step 2 — Read domain.md

Read .claude/tackline/memory/project/domain.md if it exists.

Step 3 — Check for existing entry (Gate)

If the term already exists:

If the term is new:

Step 4 — Gather codebase examples (optional but preferred)

Use Grep to search the codebase for the term (case-insensitive). Collect up to 3 file:line references where the term appears in a meaningful context (not just comments or string literals).

If examples are found, include them under **Examples** in the entry. If none found, omit the **Examples** line.


Phase 2C: Write and Verify (Capture Mode)

Write the entry

Entry format:

## <Term>
**Definition**: <one sentence>
**Disambiguation**: <when ambiguous, clarify which meaning is canonical here>
**Examples**: <file:line, file:line> (omit this line if no examples)
**Added**: YYYY-MM-DD

If creating the file for the first time, write the header first:

# Project Domain Terminology

Terms and disambiguation rules for this project. Maintained by `/domain`.

---

Then append the entry below the separator.

If the term exists, use Edit to replace the existing entry block (from its ## <Term> heading to the blank line before the next heading or end of file). Update **Added** only if the definition changed.

If the term is new, append using Edit (or Write if creating the file).

Verify

After writing, read .claude/tackline/memory/project/domain.md and confirm the term appears under a ## <Term> heading. State: "Verified: <Term> is present in domain.md."

If the read does not find the term, report the failure and do not claim success.

Completion

Emit a one-line summary: "Captured: <Term> — <definition>."


Phase 1Q: Look Up Term (Query Mode)

Strip the query: prefix and trim whitespace to get the lookup term.

Read .claude/tackline/memory/project/domain.md.


Phase 1A: Scan for Stale Entries (Audit Mode)

Goal: Find entries in domain.md that are no longer referenced in the codebase — potential orphans or stale definitions.

Step 1 — Read domain.md

If .claude/tackline/memory/project/domain.md does not exist: "No domain file found. Nothing to audit." Exit.

Extract all terms from ## headings. State: "N terms found in domain.md."

Step 2 — Cross-check each term against codebase

For each term, run Grep (case-insensitive) across the codebase (excluding .claude/tackline/memory/). Record:

Step 3 — Emit audit findings in pipe format

## Domain Audit: Stale Entry Report

**Source**: /domain (audit)
**Input**: audit of .claude/tackline/memory/project/domain.md
**Pipeline**: (none — working from direct input)

### Items (N)

1. **<Term>** — stale: no codebase references found
   - source: .claude/tackline/memory/project/domain.md
   - confidence: LIKELY

2. **<Term>** — active: found in <file:line>
   - source: <file:line>
   - confidence: CONFIRMED

### Summary

<N-stale> of <N-total> terms appear to have no codebase references and may be stale or obsolete. <N-active> terms are actively used.

Use LIKELY (not CONFIRMED) for stale entries — absence of grep hits does not guarantee the term is truly unused (it may appear in non-text assets or external docs).


Phase 2A: Remove Stale Entries (Audit Mode, only if stale entries found)

Gate: Only proceed if stale entries were found AND the user confirms removal.

After emitting the audit findings, ask: "Remove N stale entries? (yes / no / list which ones)"

On confirmation:

For each confirmed stale entry, use Edit to remove the ## <Term> block (heading through the blank line before the next heading). Preserve all active entries exactly.

Verify removal:

After editing, read .claude/tackline/memory/project/domain.md and confirm none of the removed terms appear as ## headings. State: "Verified: removed terms are no longer present."

If any removed term still appears, report the failure explicitly.


Guidelines

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.