Ctx kb ask

From ActiveMemory/ctx · View interactive version

Ctx kb ask is an AI agent skill from the GitHub repository ActiveMemory/ctx. Q&A grounded in the existing kb. Read-only on prose; refuses to web-jump; if the kb cannot answer, opens a Q-### row in outstanding-questions.md and reports the gap. Writes an ask closeout for the audit trail.

How to use this skill

Skill file

Ask the KB

Answer a question using only what .context/kb/ already contains.

Cite by EV-###. Do not web-jump, do not invent prose, do not

modify topic pages. If the kb cannot answer, open a Q-### row

in .context/kb/outstanding-questions.md and report the gap.

This is the read side of the editorial pipeline. The write side

is /ctx-kb-ingest. Authority for prose synthesis lives there;

this skill is read-only on prose.

Authoritative background reading:

.context/ingest/KB-RULES.md §Authority boundary and

§Evidence discipline; specs/kb-editorial-pipeline.md §Interface.

When to Use

"what do we know about <topic>", or invokes the explicit slash

form with the question.

to ingest more material.

asserted elsewhere (DECISIONS.md, LEARNINGS.md, conversation).

When NOT to Use

/ctx-kb-site-review).

(use /ctx-kb-ground).

contract (answer from KB-RULES.md / spec directly).

Authority Boundary (vs Other Skills)

evidence-index.md, glossary.md, contradictions.md,

outstanding-questions.md, timeline.md, source-map.md,

domain-decisions.md. Writes are limited to opening a

Q-### row in outstanding-questions.md when the kb cannot

answer, plus the ask closeout.

ingest may add citations or extend topic pages.

grounding-sources.md; this skill never web-jumps to fill a

gap. If the gap matters, recommend /ctx-kb-ground or

/ctx-kb-ingest.

Usage Examples

/ctx-kb-ask "what does the kb say about cursor hooks failure modes?"
/ctx-kb-ask "how do we cite a transcript locator?"
/ctx-kb-ask "are there contradictions on backup retention windows?"

Input Contract

A single question, supplied as the slash argument or inline. No

flags. No sources. No URLs.

Refuse-on-Empty

If the invocation supplied no question (empty slash arg, empty

inline body), return exactly:

no question provided; pass a question or describe it inline.

Stop. Do not prompt interactively. The CLI enforces this

independently via cmd/ask.

Pre-Write Gates

Three distinct refusals, each leaves zero residue (no

Q-### row opened, no closeout):

stop.

refuse with the scope message (same wording as /ctx-kb-ingest

uses) and stop.

Process

  1. Verify pre-write gates. Refuse cleanly if any gate fails.

Zero residue on refusal.

  1. Read the question. Parse for the concept(s) it names.
  1. Survey the kb. Read in this order, stopping early when an

answer surfaces with adequate citation coverage:

sub-pages for any slug that plausibly matches the question.

claim text matches.

relevant to the question.

unanswered questions on the topic.

  1. Decide answer vs gap. One of three outcomes:

EV-### rows cover the question. Compose a concise answer.

Cite every load-bearing claim by EV-###. Name the topic

page(s) where the prose lives. Note the Confidence floor

of the cited rows.

rest is not. Answer the covered part with citations. Name

the gap explicitly. Open a Q-### row for the gap (see §6).

coverage. Do not invent. Do not web-jump. Open a Q-###

row (see §6) and report the gap.

  1. Do not jump. This skill is read-only on prose AND

web-quiet. If the kb cannot answer:

kb evidence.

The correct response to a gap is to name the gap, open a

Q-### row, and recommend /ctx-kb-ground (if external

refresh is the right path) or /ctx-kb-ingest <sources> (if

the user has materials to feed in).

  1. Open a Q-### row if there is a gap. Append a row to

.context/kb/outstanding-questions.md per its schema. The

row's question text is the user's question (or a faithful

paraphrase). The row notes what the kb does cover (if

partial) and what evidence would resolve. Do NOT mint

EV-### rows from this skill; that is ingest's authority.

  1. Write the ask closeout. Create

.context/ingest/closeouts/<TIMESTAMP>-ask-closeout.md with

required frontmatter:

```yaml


sha: <short>

branch: <name>

mode: ask

pass-mode: read-only

life-stage: <bootstrap|maintenance>

generated-at: <RFC-3339>


```

Body sections:

answerable.

with a one-line rationale.

pipeline step (e.g. /ctx-kb-ground to refresh,

/ctx-kb-ingest <sources> to extend).

Edge Cases

| Case | Expected behavior |

|------|-------------------|

| Empty question | Refuse with the standard no-question text. No Q-### opened, no closeout. |

| .context/ missing | Refuse; suggest ctx init. No residue. |

| .context/kb/ missing | Refuse; suggest ctx init --upgrade. No residue. |

| Kb scope undeclared | Refuse with the scope message; point at .context/kb/index.md. No residue. |

| Multiple topics relevant | Cite each topic page; do not synthesize a new cross-topic claim (that would be ingest work). Surface the seam as a Q-### if it merits one. |

| Contradiction surfaces during answer | Answer with the lower-confidence side noted; cite both EV-### rows; point at contradictions.md. |

| Cited rows are all speculative or low | Surface the confidence band in the answer. Recommend /ctx-kb-ground to corroborate. Do not promote in this pass. |

| Question matches an existing Q-### row | Cite the existing row's ID; report status (open, partially-answered); do not open a duplicate. |

| Question requires external evidence the kb does not have | Open a Q-### row; recommend /ctx-kb-ground with the gap named; do not fetch the source. |

| Question is meta (about the pipeline itself) | Answer from KB-RULES.md / spec directly; this skill is for kb content, not pipeline contract. State that explicitly. |

Anti-Patterns

read-only on prose AND web-quiet.

authoring is /ctx-kb-ingest's authority.

/ctx-kb-ingest's authority.

is the audit trail; silence on a gap is invisible.

closeout is the residue wrap-up's handover step folds into

the next session's recall.

Output Contract

For pre-write refusals, return only the specified refusal text

and stop. No residue.

For passes that clear pre-write gates, end with this structured

summary:

EV-###.

(high|medium|low|speculative), or n/a if no rows cited.

none.

was opened (e.g. /ctx-kb-ground or `/ctx-kb-ingest

<sources>), or none` if the answer is complete.

Quality Checklist

Before reporting completion, verify:

returned with zero residue).

EV-### row from evidence-index.md.

row was cited).

training-data recall was quoted as kb evidence.

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.