Skip to content
Skills Library
AI & agents · Research

knowledge-grounding

/knowledge-grounding

Use when checking what knowledge sources are available (wikis, docs, Confluence, Jira, vector stores, internet), determining grounding mode (internal-only vs full), routing queries to the best source, or flagging ungrounded answers. Covers source discovery, air-gap detection, grounding tiers (verified/grounded/inferred/training-only), and strict_airgap enforcement.

Licence
MIT
Last repository change
31.07.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 31.07.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/discover.sh

What it does and when to use it

Use when checking what knowledge sources are available (wikis, docs, Confluence, Jira, vector stores, internet), determining grounding mode (internal-only vs full), routing queries to the best source, or flagging ungrounded answers. Covers source discovery, air-gap detection, grounding tiers (verified/grounded/inferred/training-only), and strict_airgap enforcement.

Original author description

Use when checking what knowledge sources are available (wikis, docs, Confluence, Jira, vector stores, internet), determining grounding mode (internal-only vs full), routing queries to the best source, or flagging ungrounded answers. Covers source discovery, air-gap detection, grounding tiers (verified/grounded/inferred/training-only), and strict_airgap enforcement.

How it works

  1. Overview
  2. When to Use
  3. When NOT to Use
  4. Operations
  5. Routing Logic (per-query priority)
  6. Grounding Tiers
  7. Integration
  8. Anti-Patterns
  9. See also
Original SKILL.md headings · 110 lines, 856 words
SKILL.md preview
---
name: knowledge-grounding
description: Use when checking what knowledge sources are available (wikis, docs, Confluence, Jira, vector stores, internet), determining grounding mode (internal-only vs full), routing queries to the best source, or flagging ungrounded answers. Covers source discovery, air-gap detection, grounding tiers (verified/grounded/inferred/training-only), and strict_airgap enforcement.
---

# Knowledge Grounding -- Source Discovery and Answer Provenance

## Overview

Discovers available knowledge sources, produces a manifest, routes queries to the best source, and flags ungrounded answers. Companion to env-adoption (which handles tool availability). Two-tier state: persistent manifest (`~/.claude/state/sources.json`) and volatile session state (`$XDG_RUNTIME_DIR/knowledge-grounding/session-<id>.json`).

## When to Use

- Session start (after env-adoption) -- discover available knowledge sources
- Before answering factual questions -- check what sources can ground the answer
- On air-gapped / enterprise systems -- detect what is reachable
- When a query returns training-only results -- flag explicitly with tier
- When `strict_airgap: true` -- enforce user override for ungrounded answers

## When NOT to Use

- Do not replace wiki auto_consult -- this skill composes with `.wiki-link` behavior
- Do not use for tool availability -- that is env-adoption
- Do not use for search execution -- that is web-research, wiki, confluence-rest-api

## Operations

| Operation | Command | Purpose |
|-----------|---------|---------|
| **discover** | `bash ~/.claude/skills/knowledge-grounding/scripts/discover.sh discover` | Scan local sources, internet canary, write manifest |
| **status** | `bash ~/.claude/skills/knowledge-grounding/scripts/discover.sh status` | Human-readable knowledge landscape |
| **get** | `bash ~/.claude/skills/knowledge-grounding/scripts/discover.sh get <path>` | Shell-friendly accessor (thin jq wrapper) |

### discover flags

| Flag | Effect |
|------|--------|
| `--force` | Re-probe even if manifest is fresh (<24h) |
| `--remote` | Also probe remote endpoints immediately (adds latency) |
| `--silent` | No stdout, just write state files |
| `--json` | Output combined manifest + session as JSON |

### get paths

```bash
discover.sh get internet_reachable           # true/false
discover.sh get grounding_mode               # internal-only / full
discover.sh get strict_airgap                # true/false
discover.sh get sources.wiki_trading.path    # /path/to/wiki
discover.sh get sources.internet.reachable   # true/false
discover.sh get session.active_sources       # JSON array
```

## Routing Logic (per-query priority)

When answering a factual question, check sources in this order. Stop at the first tier that produces a match. Combine if multiple tiers contribute.

| Priority | Source Type | Check | Skill/Tool |
|----------|-----------|-------|------------|
| 1 | Wiki (auto_consult first) | grep for keywords | wiki skill |
| 2 | Project docs (local) | grep docs/, PROJECT.md, COMPONENT.md | Read/Grep |
| 3 | Git repo docs (local) | grep configured doc_paths | Read/Grep |
| 4 | Vector store | semantic search if configured | research-vectorization |
| 5 | Confluence (remote, lazy) | CQL search | confluence-rest-api |
| 6 | Jira (remote, context) | JQL search | jira-rest-api |
| 7 | Internet | web search | web-research (only if `internet_reachable: true`) |
| 8 | Training data | always available | flag explicitly as tier 4 |

**Manifest provides facts only. This routing logic decides per-query.**

## Grounding Tiers

| Tier | Label | Meaning | When to use |
|------|-------|---------|------------|
| 1 | **verified** | Direct match in wiki, Confluence, or git docs with citation | Source found, content matches query |
| 2 | **grounded** | Partial match or semantic similarity from vector/multi-source | Related content found, synthesized |
| 3 | **inferred** | Cross-referenced from multiple weak signals | No direct match, patterns align |
| 4 | **training-only** | No internal source -- model training knowledge only | Nothing found; flag explicitly |

Every answer should include grounding metadata:
- `[Grounding: verified | source: wiki_trading/page-name]`
- `[Grounding: training-only | no internal sources matched]`

In `strict_airgap` mode (opt-in), tier 4 answers require explicit user override: "No internal source found. This would use model training data (cutoff May 2025). Proceed? [y/n]"

## Integration

| Touchpoint | Behavior |
|-----------|----------|
| **CLAUDE.md session start** | After env-adoption, run `discover.sh discover --silent` |
| **forge step 1** | Read sources.json, include active sources in shared_context |
| **web-research** | Check `internet_reachable` before attempting search; suggest local sources if false |
| **wiki auto_consult** | Unchanged -- grounding skill defers to existing `.wiki-link` behavior |
| **All answers** | Append grounding metadata (tier + source citation) when answering factual questions |

See `references/integration.md` for detailed patterns.

## Anti-Patterns

| Don't | Why | Do Instead |
|-------|-----|------------|
| Replace wiki auto_consult | Breaks existing behavior, two routing paths | Defer to .wiki-link, augment with sources |
| Probe remote endpoints at session start | Hangs on air-gapped systems, violates <3s | Lazy probe on first query needing remote source |
| Bake routing logic into manifest JSON | Routing rules change, manifest becomes stale policy | Manifest = facts, SKILL.md = routing logic |
| Score confidence by source type alone | Stale wiki page is not better than training data | Consider match quality, freshness, provenance |
| Block on training-only answers by default | Most systems are not strict air-gap | strict_airgap is opt-in, default=off |
| Auto-detect enterprise endpoints | URLs are not discoverable, wrong guesses waste time | Config file for enterprise, auto-detect for local |

## See also

- `rag-architecture` — once a vector store is the chosen source, this covers how to build one that
  retrieves the right thing and how to prove it does.
- `llm-api-optimization` — the cost of what you ground with, and when a cached corpus beats retrieval.
Files in this package (6)
  • SKILL.md 6 KB
  • references/config-schema.md 2 KB
  • references/grounding-tiers.md 3 KB
  • references/integration.md 3 KB
  • references/routing-logic.md 3 KB
  • scripts/discover.sh 25 KB

Versions

The database has no other skills named knowledge-grounding.

Database snapshot: 13.11.2026 · package version e6845f70e6c1 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90enrich
    Use when the agent needs access to information beyond its training data — knowledge sources, RAG pipelines, or grounding data.
  • 100pre-action-grounding
    Use when the user says '/pre-action-grounding', 'ground this first', 'plan this properly', or hands you a task whose WHY or done-condition they did not volunteer — especially requests from non-devs that arrive unstructured. Runs the pre-action grounding protocol: derive what…
  • 90agent-grounding
    Configures and controls what a Microsoft 365 agent grounds on - choosing specific sites, libraries, files or connectors rather than broad locations, deciding on web content, restricting answers to named sources, checking permission trimming and citations - and keeps a controlled…
  • 100corpus-grounding
    Shared corpus-grounding engine — BM25 + structured filters + decision rules over CSV corpora via a domain manifest. Use when a skill needs grounded pre-action option-space constraints.
  • 100epistemic-grounding
    Use when authoring any artifact that makes claims — skill content, documentation, audit findings, architecture proposals, code review comments, research summaries, or agent output. Covers the discipline of grounding every claim to a verifiable source, distinguishing…
  • 100confluence-expert
    Confluence expert for spaces, knowledge bases, documentation, page layouts, macros, templates, and Jira-Confluence integration. Use for documentation strategy, space architecture, content organization, and collaborative knowledge management.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.