Source profileQuality 96/100

event4u-app/agent-config/src/skills/corpus-grounding/SKILL.md

corpus-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.

Source repository stars
9
Declared platforms
0
Static risk flags
1
Last source update
2026-08-28
Source checked
2026-08-28

Decision brief

What it does: where it fits

The reusable grounding layer from ADR-061: one pure-stdlib engine (BM25 retrieval + structured pre-filters + decision-rule evaluation) that any domain plugs into via a manifest — frontend design is its first consumer (design-intelligence). A corpus grounds (pre-action, constrain…

Best for

  • A skill needs pre-action selection grounded in curated knowledge
  • You are authoring a new domain corpus — write a manifest + CSVs,
  • You need stack-scoped Do/Don't guidance (--stack react …).

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/corpus-grounding"
Safe inspection promptEditorial

Inspect the Agent Skill "corpus-grounding" from https://github.com/event4u-app/agent-config/blob/6a5670b7881a676c0da90d2afb950298087c4ccb/src/skills/corpus-grounding/SKILL.md at commit 6a5670b7881a676c0da90d2afb950298087c4ccb. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Procedure: Consult a corpus

    1. Locate the domain manifest (/data/manifest.json). 2. Run search (one domain / stack axis) or ground (reasoning plan). 3. Read confidence + evidencegap before trusting any row. 4. Propose grounded options; the human confirms (Tier-1 default).

    Locate the domain manifest (/data/manifest.json).Run search (one domain / stack axis) or ground (reasoning plan).Read confidence + evidencegap before trusting any row.
  2. 02

    Procedure: Author a new domain corpus

    1. Pass the qualification rubric (ADR-061 §5): decision-rule utility beats row count; grounding must happen before action; "fits in 5 lines → it's a rule, not a corpus". 2. Write data/manifest.json + CSVs in your domain skill; run the grounding CLI (ground validate via ./scripts…

    Pass the qualification rubric (ADR-061 §5): decision-rule utility beatsWrite data/manifest.json + CSVs in your domain skill; runName an owner + refresh cadence in the manifest, pin the upstream SHA.
  3. 03

    Security constraints (Step 1.6 runtime-safety record)

    Four scripts ship under scripts/: ground.ts (CLI), bm25search.ts, decisionengine.ts, schemavalidator.ts.

    What they may touch — corpus CSVs and the manifest under theWhat they must never do — read outside that directory, reach theDefault invocation — read-only. The single write surface is opt-in
  4. 04

    When to use

    A skill needs pre-action selection grounded in curated knowledge

    A skill needs pre-action selection grounded in curated knowledgeYou are authoring a new domain corpus — write a manifest + CSVs,You need stack-scoped Do/Don't guidance (--stack react …).
  5. 05

    Do NOT

    Do NOT use the corpus for mid-task fact lookup — that is reference

    Do NOT use the corpus for mid-task fact lookup — that is referenceDo NOT use it for output validation — write a rule/linter.Do NOT build a corpus that fits in 5 lines of an always-on rule.

Permission review

Static risk signals and limitations

Reads files

low · line 190

The documentation asks the agent to read local files, directories, or repositories.

**What they must never do** — read outside that directory, reach the

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score96/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars9SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
event4u-app/agent-config
Skill path
src/skills/corpus-grounding/SKILL.md
Commit
6a5670b7881a676c0da90d2afb950298087c4ccb
License
MIT
Collected
2026-08-28
Default branch
main
View the original SKILL.md

corpus-grounding

The reusable grounding layer from ADR-061: one pure-stdlib engine (BM25 retrieval + structured pre-filters + decision-rule evaluation) that any domain plugs into via a manifest — frontend design is its first consumer (design-intelligence). A corpus grounds (pre-action, constrains the option space); it never replaces mid-action reference (RAG), post-action validation (rules), or the method itself (a framework skill).

Engine provenance: ported from nextlevelbuilder/ui-ux-pro-max-skill @ b7e3af80f6e331f6fb456667b82b12cade7c9d35 (MIT, last checked 2026-06-07) — BM25 de-duplicated, slide-only paths stripped, every frontend-hardcoded axis moved into the manifest. Full license obligations: design-intelligence/ATTRIBUTION.md.

When to use

  • A skill needs pre-action selection grounded in curated knowledge ("which layout pattern / threat class / index strategy applies here").
  • You are authoring a new domain corpus — write a manifest + CSVs, validate with the grounding CLI (ground validate via ./scripts-run), never fork the engine.
  • You need stack-scoped Do/Don't guidance (--stack react …).

Do NOT

  • Do NOT use the corpus for mid-task fact lookup — that is reference (references/ docs / RAG).
  • Do NOT use it for output validation — write a rule/linter.
  • Do NOT build a corpus that fits in 5 lines of an always-on rule.
  • Do NOT fork the engine per domain — plug in via a manifest.
  • Do NOT merge a manifest without owner + refresh cadence (validator refuses it anyway).

Procedure: Consult a corpus

  1. Locate the domain manifest (<domain-skill>/data/manifest.json).
  2. Run search (one domain / stack axis) or ground (reasoning plan).
  3. Read confidence + evidence_gap before trusting any row.
  4. Propose grounded options; the human confirms (Tier-1 default).

Invocation (consumer runtime)

Scripts resolve all paths skill-relative (per docs/contracts/skill-bundled-assets.md) — they work from any cwd:

./scripts-run <skills-root>/corpus-grounding/scripts/ground search \
  --manifest <skills-root>/<domain-skill>/data/manifest.json \
  "fintech dashboard" [--domain style] [--stack react] \
  [--filter "Severity=HIGH"] [--max-results 3] [--json]

./scripts-run <skills-root>/corpus-grounding/scripts/ground ground \
  --manifest <skills-root>/<domain-skill>/data/manifest.json \
  "luxury e-commerce" [--context '{"data_heavy": true}'] [--persist DIR] \
  [--variance 1-10] [--motion 1-10] [--density 1-10]

./scripts-run <skills-root>/corpus-grounding/scripts/ground validate --manifest …

<skills-root> is wherever skills are deployed (~/.claude/skills/ for Claude Code installs; src/skills/ inside this repo).

The three ground dials are optional 1-10 preferences, and unset means unset — a dial you do not pass changes nothing, so the no-flag result is byte-identical to what it was before they existed. --variance biases which style is selected from the rows the corpus returned (never which rows come back), and when it changes the pick away from the grounding rule's own choice the run says so in its evidence gaps. --motion needs a gsap domain in the manifest and reports when a tier matches nothing. --density overrides the spacing scale. All three render in the text output and in a persisted MASTER.md, not only under --json.

Output format

Interface contract v1 — stability promise. Per ADR-061 §2 ("Opus condition"), this interface is versioned; domains may depend on it. Breaking any item below requires a major bump (manifest_version: 2), a migration note here, and updates to every consuming skill in the same PR. Additive fields are allowed anytime.

Stable v1 surface:

  1. Modules + public namesbm25_search.{BM25, load_csv, apply_filters, search_rows, RETRIEVERS}, decision_engine.{detect_domain, search_domain, search_stack, evaluate_rules, ground, persist_grounding}, schema_validator.{load_manifest, validate_manifest, resolve_data_path, ManifestError, MANIFEST_VERSION, TIERS}.
  2. CLI — the grounding CLI (ground {search|ground|validate} via ./scripts-run) with the flags shown above.
  3. Result shape — search: {domain|stack, query, file, count, results, scores, filtered_from, confidence{label,score}, evidence_gap[]}; ground: {domain, query, category, rule, rules_evaluation{matched, unmatched}, selections{<domain>: {best, alternatives, confidence}}, confidence{label,score}, evidence_gap[]}.
  4. Contract invariants — every output carries confidence and evidence_gap; retrievers are name-selected (bm25 default, structured, hybrid); no network, no subprocess, read-only except the opt-in --persist DIR.

Manifest contract (schema-agnostic plug-in)

Each domain ships data/manifest.json beside its CSVs — declaring its own axes; the engine never assumes the frontend schema:

{
  "manifest_version": 1,
  "domain": "frontend-design",
  "tier": "conditional-grounding",
  "data_dir": ".",
  "retriever": "bm25",
  "default_domain": "style",
  "domains": {
    "style": {
      "file": "styles.csv",
      "search_cols": ["Style Category", "Keywords"],
      "output_cols": ["Style Category", "Best For"],
      "max_results": 3,
      "filters": {}
    }
  },
  "detect": { "style": ["minimalism", "glassmorphism"] },
  "stacks": { "react": "stacks/react.csv" },
  "stack_cols": { "search_cols": ["…"], "output_cols": ["…"] },
  "reasoning": {
    "file": "ui-reasoning.csv",
    "category_domain": "product",
    "category_column": "Product Type",
    "match_column": "UI_Category",
    "rules_column": "Decision_Rules",
    "priority_column": "Style_Priority",
    "priority_domain": "style",
    "name_columns": { "style": "Style Category" },
    "plan": { "style": 3, "color": 2 },
    "rules_module": "rules.ts"
  },
  "owner": "package-maintainer",
  "refresh_cadence": "quarterly",
  "upstream": { "repo": "…", "sha": "…", "last_checked": "YYYY-MM-DD" }
}
  • tierlookup-only | conditional-grounding | constraint-emission; reasoning is only legal above lookup-only.
  • owner, refresh_cadence, upstream{repo,sha,last_checked} are required — provenance discipline per ADR-061 §6; an unowned corpus is not merged.
  • rules_module (optional TypeScript escape hatch where JSON rules cap out — a module exposing evaluate(rules, query, context); a legacy .py name in a manifest is remapped to its .ts/.js twin) must live beside the manifest — absolute paths and .. are refused.
  • Decision rules are surfaced as matched and unmatched — the full rule space stays auditable, never a hidden gate.

Procedure: Author a new domain corpus

  1. Pass the qualification rubric (ADR-061 §5): decision-rule utility beats row count; grounding must happen before action; "fits in 5 lines → it's a rule, not a corpus".
  2. Write data/manifest.json + CSVs in your domain skill; run the grounding CLI (ground validate via ./scripts-run).
  3. Name an owner + refresh cadence in the manifest, pin the upstream SHA.
  4. Cite this skill from your domain skill; consult via the CLI (Tier-1 consultation default — propose grounded options, human confirms).

Gotchas

  • An empty result is a legitimate outcome — surface the evidence gap and proceed on priors; never silently widen filters to force a hit.
  • The structured filters pre-filter matches case-insensitive substrings; an over-specific value silently filters everything out — check filtered_from vs count when results look thin.
  • detect keyword routing falls back to default_domain; product-shaped queries route best ("fintech dashboard"), generic words land on the default.
  • BM25 tokenizer drops tokens ≤2 chars — "UI", "a11y" style queries need longer companions.

Security constraints (Step 1.6 runtime-safety record)

Four scripts ship under scripts/: ground.ts (CLI), bm25_search.ts, decision_engine.ts, schema_validator.ts.

  • What they may touch — corpus CSVs and the manifest under the manifest's own directory. resolve_data_path refuses absolute paths and .. escapes, so the manifest directory is the read boundary.
  • What they must never do — read outside that directory, reach the network, or spawn a subprocess. Embeddings and remote retrievers are intentionally not implemented (ADR-061 §2), and that is a containment decision, not a missing feature.
  • Default invocation — read-only. The single write surface is opt-in --persist DIR, which writes MASTER.md (and pages/<page>.md when --page is given) under DIR/design-system/<project-slug>/. Nothing else writes.
  • Outbound — nothing. No network access at all.

One qualified exception: rules_module executes a manifest-adjacent TypeScript module via dynamic import(). That is the same trust domain as the skill shipping the manifest, and its containment is resolve_data_path.

See also

Frequently asked questions

What to verify before installation and use

What does the corpus-grounding source document cover?

The reusable grounding layer from ADR-061: one pure-stdlib engine (BM25 retrieval + structured pre-filters + decision-rule evaluation) that any domain plugs into via a manifest — frontend design is its first consumer (design-intelligence). A corpus grounds (pre-action, constrain…

How do I install corpus-grounding?

The source record exposes this install command: npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/corpus-grounding". Inspect the command and pinned source before running it.

Which permission-related actions were detected?

Static rules flagged read-files in the source; the page lists the matching lines and excerpts.

Alternatives

Compare before choosing

Computed 100133

JasonColapietro/suede-creator-skills

suede-ab-testing

Suede-owned experimentation discipline for hypotheses, sample sizing, test duration, significance, and repeatable experiment programs. Use when comparing variants, deciding whether a result is reliable, or building an experiment backlog and cadence. NOT FOR: analytics instrumentation (use suede-analytics), post-click conversion diagnosis (use suede-site-alchemy), or writing the variant copy itself (use suede-copy).

Computed 1008

narrative-io/narrative-skills-marketplace

design-analysis

Translate a fuzzy analytical question into a rigorous investigation plan. Interrogates the ask, grounds the plan in the available data dictionary, applies analytical best practices, and produces a structured brief of query specifications for a downstream query-writing skill. Plans, does not write SQL. Use when: "why did X drop", "is there a relationship between A and B", "who are our highest-value customers", "what's driving the change in Y", "investigate this trend", "design an analysis for", "

Computed 9944

Ratimon/openquok-monorepo

openquok-core

Schedule and manage social posts with the openquok CLI — authenticate, upload media, create drafts and scheduled posts, configure internal plugs, and read channel analytics for integrations in your OpenQuok workspace.

Computed 9836,049

K-Dense-AI/scientific-agent-skills

dask

Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.