Resolver query

From mycelium-hq/ai-brain-starter · View interactive version

Resolver query is an AI agent skill from the GitHub repository mycelium-hq/ai-brain-starter. Use when an operator asks which rule or policy governs a question — pricing exceptions, deploys, refunds, hiring — or wants to look up the matching rule in Meta/RESOLVER.md without reading the whole index by hand. Triggers: /resolver-query <question>, "which rule applies", "what''s our policy on X",

How to use this skill

Skill file

/resolver-query

Look up which rule in Meta/RESOLVER.md applies to a natural-language question. The skill itself does NOT call an LLM. It reads RESOLVER.md, parses every rule row, and returns either a decisive match, a ranked candidate list, or "no rule matches." The host Claude session does the natural-language understanding on top of the structured output.

When to run

How it works

  1. The skill reads Meta/RESOLVER.md from the vault root.
  2. It parses the YAML frontmatter for the build timestamp and counts.
  3. It parses every row of the ## Rules table into a structured record.
  4. It runs a deterministic match against the question:

a. Tokenize the question (lowercase, drop stopwords, keep stems).

b. For each rule, score by token overlap against rule_id, source path, skill link, and source-file H1/topic when available.

c. If exactly one rule scores >= the decisive threshold, return that rule directly.

d. Otherwise return up to --limit rules ranked by score.

e. If no rule scores above zero, return no rule matches this query.

  1. The host session then reads the structured output and frames the answer to the operator.

Step 1: Run the skill

python3 skills/resolver-query/query.py "How do we handle pricing exceptions?" \
    --vault-root <vault>

Output is a JSON document on stdout with shape:

{
  "question": "...",
  "vault_root": "...",
  "resolver_built_at": "...",
  "rule_count": 17,
  "match_kind": "decisive | ranked | none",
  "matched_rules": [
    {
      "rule_id": "...",
      "type": "decision | workflow | exception | fact",
      "status": "active | stale | superseded | under-review | unknown",
      "last_verified": "...",
      "source_path": "...",
      "skill_link": "...",
      "score": 0.0
    }
  ],
  "summary": "..."
}

Step 2: Read the matched rule

If the match kind is decisive, the host session opens the rule's source file (source_path). If ranked, the host session presents the top candidates to the operator and lets them pick. If none, the host session tells the operator no rule applies and offers to draft one manually.

Rules

Boundary

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.