Skip to content
Back to skills

Grounding

ASecurity

How /ground decides which board nodes are substantiated by which repo documents — the citation quality bar, drift handling, and per-genre reading priority. Use during /ground's evidence-proposal step, or whenever judging if a document backs a node's claim. Defines what counts as substantiation, anchor/excerpt discipline, and how to treat drifted or unlinked evidence.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 6, 2026
ai-agentsgonodegitapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 12, 2026

npx -y skills add provenmap/pmap-codex --skill grounding --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Grounding?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Grounding
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/provenmap-grounding-pmap-codex/badge)](https://www.skillsdirectory.com/skills/provenmap-grounding-pmap-codex)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: grounding
user-invokable: false
description: How /ground decides which board nodes are substantiated by which repo documents — the citation quality bar, drift handling, and per-genre reading priority. Use during /ground's evidence-proposal step, or whenever judging if a document backs a node's claim. Defines what counts as substantiation, anchor/excerpt discipline, and how to treat drifted or unlinked evidence.
metadata:
  author: ProvenMap
  version: 0.1.0
---

# Grounding — Evidence Links Between Board Nodes and Documents

`/ground` calls this skill in its evidence-proposal step, after `--pull` mirrors the board (or, in a repo `/analyze` built and `/sync` pushed, reads the local board) and inventories the corpus. The CLI already did the mechanical part (mirroring, hashing, diffing); this skill owns the judgment call underneath it — deciding **which documents substantiate which nodes**.

## Building the link set

`--pull` hands you two objects: `evidence` (`linkCount`, `drifted[]`, `missing[]`,
`unlinkedNodes[]`) and `context` (`nodes[]`, `files[]`, `links[]`, `capped`). The proposed set is
built from all four inputs:

1. **Keep fresh links as-is** — every link in `context.links` that is not also in
   `evidence.drifted` or `evidence.missing` is unchanged; carry its
   `nodeSlug`/`path`/`anchor`/`excerpt`/`docUrl` forward as-is, no need to re-read the document.
2. **Re-link drifted links** — for each entry in `evidence.drifted`, read the document at its
   `path` (its content changed since the citation was recorded) and apply *Drift handling* below.
3. **Propose links for `unlinkedNodes`** — for each node slug with zero evidence, search
   `context.nodes`/`context.files` for a document that genuinely substantiates its claim — read it,
   never link on filename alone. No candidate substantiates it? Leave it unlinked; report that in
   `/ground`'s closing report as a finding, not a failure — name the node and say why, because the
   push report never sees which nodes you chose not to link.
4. **Drop missing links** — omit anything in `evidence.missing` entirely; its document no longer
   exists in the corpus.

If `context.capped` is `true`, `context.files` only lists the first 500 of `corpus.files` — the
count still reflects the true total.

## What counts as substantiation

A link is justified when the document **states or specifies** what the node claims — not merely mentions its name in passing. "The Billing API section describes rate limits, retries, and the `/charges` endpoint" substantiates a `billing-api` node; a line that just says "see also the billing API" does not.

- **Read the document before linking.** Never link on filename, title, or path alone.
- **One node, a few strong links** beats many weak ones. A node with one link to the section that actually defines it is better grounded than five links to documents that merely reference it in passing — don't pad a node with tangential mentions.
- **Prefer the most specific anchor available** — a heading/section anchor over a whole-document link, a line-specific citation over a page-level one.
- **Excerpt ≤500 chars, quoted verbatim** from the document — never paraphrase, and never quote code (this connector grounds documents, not source).
- **No candidate substantiates the node? Leave it unlinked and say so.** An unlinked node is a finding — the architect's claim isn't backed by anything in this repo yet — not a failure of the run.

## Drift handling

`--pull`'s `evidence.drifted` / `evidence.missing` name which tracked links need attention this run:

- **Drifted** (the document's content hash no longer matches): re-read it at its current content. Still substantiates the claim? Refresh `anchor`/`excerpt` to match the current text and set `"reverified": true` on the link: that is what tells the push you read the current document, and without it a link that keeps its anchor stays drifted on every run. The claim moved elsewhere or was removed? Drop the link rather than leaving a stale citation.
- **Missing** (path no longer in the corpus): the document is gone — drop the link.
- Everything else in `context.links` is still fresh — carry it forward unchanged.

A `--pull` that reports nothing drifted, missing or unlinked is a quiet run: `/ground` closes on the
Outcome without proposing anything, which is what makes a scheduled drift check cheap — see
`${PLUGIN_ROOT}/knowledge/provenmap-integration/references/recurring-runs.md` for the surfaces.

## Reading priority

Not every document is worth reading first. `references/linking-heuristics.md` has a genre table for prioritizing — a `Decision`-shaped node claim is more likely substantiated by an ADR than a runbook; a requirement-shaped claim by a spec than a meeting note — and a signal catalogue (links, anchors, definition language, citation phrasing) for recognizing real substantiation versus a passing mention once you're reading a candidate document.

## Output

The proposed set is written to `.provenmap/evidence-links.json` — never edit `.provenmap/boards/stores/*.evidence.json` directly; that file is the CLI's own store, rewritten only by `--push`.

```json
{ "links": [ { "nodeSlug": "billing-api", "path": "docs/billing.md", "anchor": "rate-limits", "excerpt": "…", "docUrl": null } ] }
```

You supply `nodeSlug`/`path`/`anchor`/`excerpt`/`docUrl` only, plus `"reverified": true` on a
drifted link you re-read and kept (never on a link you carried forward unread) — the CLI fills
in `contentHash` itself from a fresh read of the document at push time, so never compute or
guess one.

When `--push` exits 3, the links file failed schema validation or an evidence path didn't resolve
in the document corpus; `validationErrors[]` names the exact field/path. Fix
`.provenmap/evidence-links.json` accordingly and retry the push once.

## Scheduled (`--scheduled`)

The unattended drift check a host schedule fires (`recurring-runs.md` in the provenmap-integration
skill). Nobody answers a prompt, and every run is recorded on the platform and shown on the board's
binding.

1. **Step 0's preflight takes `--scheduled ground`.** It opens the run (its JSON `scheduledRun.runId`,
   which the run's pushes then carry), fetches the binding's pinned branch from origin and checks
   its tip out detached into a scratch folder, `.provenmap/worktrees/@pinned` (its JSON
   `worktree.dir`). The checkout's own branch and working tree are not consulted and never move;
   `--pull` inventories the documents under that folder by itself, and every `.provenmap/` file —
   the evidence store, the links file — stays in the checkout. **Read documents only under
   `worktree.dir`** (every `path` the inventory prints is relative to it). Never run `git fetch`,
   `git pull` or `git switch`. A preflight exit 2 whose `status` is `fetch_failed` stops the run
   before anything is read.
2. **A prompt becomes a stop.** The connect-now offer is not asked (the branch-mismatch prompt
   cannot arise): an unmet gate, and any exit that stops the command, ends the run — relay the
   CLI's `error` verbatim — and goes to step 3.
3. **Outcome:** `node ${PLUGIN_ROOT}/scripts/pmap-status.js --brief --command ground --facts '{"mode":"scheduled","outcome":"<outcome>","reasonText":"<error>"}'`.
   `outcome` is `up_to_date` when nothing drifted, went missing or sat unlinked (the quiet run),
   `refreshed` when the run re-linked and pushed evidence, `stopped` on any stop. `reasonText` is the
   stopping CLI's `error` line verbatim, and only for `stopped` (omit the key otherwise). Status
   checks both against the run's allowed values and records the run; the brief's `scheduledRun` says
   what was recorded. Name a stopped run's reason in the Outcome, with the one-line fix.

Files in this skill

  • SKILL.md7.4 KB
  • references/linking-heuristics.md4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.