wiki-first-query

A rule requiring the coding agent to consult a project's curated Markdown wiki before rereading raw sources. The wiki is the project's maintained memory for concepts, decisions, incidents, workflows, and open questions.

In plain words
What is it for?
Use it whenever work touches a topic covered by the project wiki. The agent reads the main index, follows relevant page links, and checks raw sources only when the wiki is silent or outdated.
Why use it?
It lets the agent start from the project's current understanding and avoid rediscovering context from specifications, issues, pull requests, or code every session.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/gosha70/code-copilot-team/wiki-first-query
Clone the repo
git clone --depth 1 https://github.com/gosha70/code-copilot-team

Made for: Cursor.

Per session 543 This file is loaded in full into every session.
When invoked 543 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00543 $0.00543
Opus 5 $0.00271 $0.00271
Sonnet 5 $0.00109 $0.00109
Haiku 4.5 $0.00054 $0.00054

Measured 2d ago against content hash 964517e0751c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

wiki-first-query scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

adapters/cursor/.cursor/rules/wiki-first-query.mdc · 60 lines

How it starts

The opening of the file, as written. The whole thing — 60 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Wiki-First Query Convention

This project maintains a curated knowledge layer at knowledge/wiki/. It is the canonical home for durable project knowledge — concepts, workflows, incidents, decisions, playbooks, glossary entries, and known open questions. Every page is cited back to a raw source.

The convention

When you start work on a topic that touches this project's domain (SDD workflow, peer review, adapter generation, agent safety, shape-up cycles, etc.), consult the wiki first:

  1. Read knowledge/wiki/index.md (repo-relative path) to find pages relevant to your topic.
  2. Follow the links into concepts/, workflows/, incidents/, decisions/, playbooks/, or glossary/ as relevant.
  3. Treat what you find there as the project's current best understanding. Each page lists its sources in frontmatter; if you need deeper detail, follow those citations.

Only after consulting the wiki should you fall back to raw sources (specs, issues, PRs, code) for the same topic. The wiki exists so that you do not re-discover the same context every session.

When the wiki is silent or stale

If the wiki has nothing on the topic, or what it has is clearly out of date with the current code:

  1. Do the raw research yourself.
  2. If what you learn is reusable beyond this session, propose a promotion by following the procedure in knowledge/wiki/workflows/promote-lesson-to-wiki.md (repo-relative path).
  3. Do not silently fix wiki content as a side effect of other work — wiki edits are intentional, single-purpose changes.

In Claude Code, the /promote-lesson <description> slash command runs the promotion workflow on your behalf. Other adapters can follow the workflow document directly.

What this convention does NOT do

  • It does not require you to read every wiki page on every invocation. Read the index, then drill into what is relevant.
  • It does not replace the SDD spec workflow. Specs still own feature requirements; the wiki holds knowledge that outlives any one feature.
  • It does not replace session memory. Memory holds session ephemera; the wiki holds what survives.

Read the full file on GitHub · 60 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 60 lines · 543 tokens per session scan A 964517e0751c

Subscribe to this mod's changes

wiki-first-query is a cursor rule published in the GitHub repository gosha70/code-copilot-team (6 stars, last pushed 2d ago), licensed MIT. It adds 543 tokens to every session, about $0.0027 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.