LearnLoop
Copilot instructions4 starsChanged 59 days agoMITView on GitHub
Five MCP tools: coach, wiki_lookup, wiki_save, wiki_bootstrap, wiki_proven_prompts. These tools are NOT optional. They REPLACE native Read/Grep/Glob/file-search for any question that touches team conventions, prior decisions, or "how we do X here". Calling Read or Grep before wiki_lookup is a regression that loses the team's distilled knowledge — the wiki has already curated what raw source can only hint at. For any user message that asks you to fix, add, refactor, implement, change, debug, optimize, rename, design, plan, or explain…
The file
We split this copilot-instructions.md into the rules it gives an agent
10 rules. About 0 are common, 1 is distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Write the code, applying the team conventions surfaced in step 2.
- Very specific: line 21
If the user states a new convention, call wiki_save.
- Very specific: line 23
If wiki_lookup is called for a file that obviously exists and returns no results, the wiki was never bootstrapped — call wiki_bootstrap …
- Very specific: line 37
If
proceed: true: if text is non-empty, relay it verbatim to the user. - Very specific: line 54
NEVER skip coach to "save time" — the score-arc IS the user-facing product.
- Very specific: line 60
If at any coaching round the user says "skip", "as-is", "just do it", "no questions", "nevermind", "stop coaching", or otherwise dismisses …
- Very specific: line 71
Before you reach for Read, Grep, or Glob to figure out how the codebase handles something, call wiki_lookup first.
- Very specific: line 76
CALL wiki_lookup INSTEAD OF:
- Very specific: line 124
Call wiki_bootstrap({}) with no arguments — the server walks the working directory, bundles source files, and runs LLM passes that fill …
- Very specific: line 142
Call wiki_proven_prompts({}) for the whole library.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Trailhead coaching — always on, never block
Five MCP tools: coach, wiki_lookup, wiki_save, wiki_bootstrap,
wiki_proven_prompts.
These tools are NOT optional. They REPLACE native Read/Grep/Glob/file-search
for any question that touches team conventions, prior decisions, or "how
we do X here". Calling Read or Grep before wiki_lookup is a regression
that loses the team's distilled knowledge — the wiki has already curated
what raw source can only hint at.
Default order of operations on every code task
For any user message that asks you to fix, add, refactor, implement, change, debug, optimize, rename, design, plan, or explain code:
coach— score and (if needed) loop. ALWAYS first.wiki_lookup— once you know the file or topic. ALWAYS before Read/Grep/Glob.- Write the code, applying the team conventions surfaced in step 2.
- If the user states a new convention, call
wiki_save.
If wiki_lookup is called for a file that obviously exists and returns
no results, the wiki was never bootstrapped — call wiki_bootstrap
once with no arguments and stop.
coach — call BEFORE answering any code task
A code task is any user message that asks you to fix, add, refactor, implement, change, debug, optimize, rename, design, plan, or explain code. Examples: "fix the retry", "add a webhook handler", "refactor handleAuth", "why is this failing", "make this faster", "what does this function do", "how should I structure X".
- Call
coach({ prompt: <user's exact message>, file_path: <if known> }). - The tool returns
{ proceed, text, next_round_inputs?, ... }. - If
proceed: true: iftextis non-empty, relay it verbatim to the user. Then produce your answer. The server bakes the graduation banner ("Your prompt scored X/10 and joined your team's library…") intotextitself whenmode === "score" && overall >= 7, so relayingtextverbatim is sufficient — you do not need to add the sentence yourself. Done. - If
proceed: false: relaytextverbatim, wait for the user's reply, then callcoachagain with:prompt: the user's reply concatenated to the previous promptmode: "score"round_token: echo thenext_round_inputs.round_tokenstring verbatim. This single field replaces the legacy four-field echo (original_prompt,original_dimensions,previous_dimensions,round) — fewer slots for the LLM to drop. The four fields are still accepted as a fallback if you can't echo the token. Loop. The server enforces the cap (5 rounds) and bails on no-progress.
NEVER skip coach to "save time" — the score-arc IS the user-facing
product. The user is here to learn the rubric; producing an answer
without scoring defeats the entire purpose of installing Trailhead.
Skip detection
If at any coaching round the user says "skip", "as-is", "just do it",
"no questions", "nevermind", "stop coaching", or otherwise dismisses
the loop, call coach ONCE more with:
prompt: the user's most recent promptmode: "skip_reveal"original_promptandoriginal_dimensionsfrom the session Then relay the returnedtextverbatim and produce your answer using the user's ORIGINAL prompt (not any improved version).
wiki_lookup — REPLACES Read/Grep/Glob for team-knowledge questions
Before you reach for Read, Grep, or Glob to figure out how the codebase
handles something, call wiki_lookup first. It returns the curated
distillation: the team's rules, durable learnings, and graduated prompt
examples for the path or topic.
CALL wiki_lookup INSTEAD OF:
- Reading a file just to learn its conventions →
wiki_lookup({ file_path: <path> }). - Grepping the repo for "how do we handle X" →
wiki_lookup({ query: "X" }). - Browsing folders to learn the codebase shape →
wiki_lookup({ file_path: <any path in the folder> }). - Asking "what's our convention for Y" →
wiki_lookup({ query: "Y" }). - Asking "do we have a pattern for Z" →
wiki_lookup({ query: "Z" }).
You may STILL use Read/Grep/Glob — but ONLY after wiki_lookup returned
no relevant results, OR for tasks that are unambiguously about the
literal file contents (e.g., "rename variable foo to bar in handler.ts" —
the literal source is what matters, not the convention).
For any path-scoped lookup, pass file_path AND query together to
narrow the search.
wiki_save — call WHEN the user states a teamwide convention
Trigger on phrases like:
- "we always..."
- "we never..."
- "team convention is..."
- "the rule here is..."
- "make sure to always..."
- "we standardized on..."
- "from now on..."
- "going forward..."
- "by default we..."
- "our pattern for X is..."
Call wiki_save({ node_path: <folder ending in />, insight: <one-sentence rule> }).
The server dedupes; calling twice with the same insight is safe and
reinforces the count. NEVER ask permission first — silently saving
durable conventions is the point.
wiki_bootstrap — call WHEN the user asks to set up Trailhead
Trigger on phrases like:
- "set up Trailhead for this repo"
- "bootstrap the wiki"
- "initialize the team wiki"
- "/init the project for Trailhead"
- "create the Trailhead wiki for this codebase"
ALSO fire this when wiki_lookup returns empty for a file_path that
obviously exists in the repo. An empty wiki means bootstrap was never
run; calling it once primes the team's knowledge base before the user
notices the gap.
Call wiki_bootstrap({}) with no arguments — the server walks the working
directory, bundles source files, and runs LLM passes that fill every
folder/file with a narrative summary plus draft learnings (rich mode is
the default; takes ~30-90s). Pass paths: [...] only when the user lists
specific folders explicitly. Pass mode: "minimal" only when the user
asks for a fast/free skeleton-only setup. The operation is idempotent —
already-populated nodes are left alone.
wiki_proven_prompts — call WHEN the user wants the team's proven library
Trigger on phrases like:
- "show me the team's best prompts"
- "what prompts have worked here?"
- "any proven examples?"
- "list the top prompts"
- "what's our prompt library?"
- "show me 8/10+ prompts"
Call wiki_proven_prompts({}) for the whole library. Pass min_score,
file_path, topic, or limit to narrow. Each item includes the actual
graduated_overall_score (7-10) and reuse_count, ranked by score then
reuse. Differs from wiki_lookup (path-anchored, returns conventions +
one curated example) — this is the FULL graduated library for discovery.
Anti-patterns to avoid
- ❌ Calling Read on a file before
wiki_lookup({ file_path })for that file. - ❌ Calling Grep for "how does X work in this codebase" before
wiki_lookup({ query: "X" }). - ❌ Producing code or a plan before
coachhas run. - ❌ Asking the user "should I save this as a team convention?" — just call
wiki_save. - ❌ Falling back to
mode: "minimal"onwiki_bootstrapwithout an explicit user request.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

