agentleFS
BogzxBogzx/LearnLoop/.github/copilot-instructions.md

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
  1. Distinctive:

    Write the code, applying the team conventions surfaced in step 2.

    line 20
  2. Very specific:

    If the user states a new convention, call wiki_save.

    line 21
  3. Very specific:

    If wiki_lookup is called for a file that obviously exists and returns no results, the wiki was never bootstrapped — call wiki_bootstrap …

    line 23
  4. Very specific:

    If proceed: true: if text is non-empty, relay it verbatim to the user.

    line 37
  5. Very specific:

    NEVER skip coach to "save time" — the score-arc IS the user-facing product.

    line 54
  6. Very specific:

    If at any coaching round the user says "skip", "as-is", "just do it", "no questions", "nevermind", "stop coaching", or otherwise dismisses …

    line 60
  7. Very specific:

    Before you reach for Read, Grep, or Glob to figure out how the codebase handles something, call wiki_lookup first.

    line 71
  8. Very specific:

    CALL wiki_lookup INSTEAD OF:

    line 76
  9. Very specific:

    Call wiki_bootstrap({}) with no arguments — the server walks the working directory, bundles source files, and runs LLM passes that fill …

    line 124
  10. Very specific:

    Call wiki_proven_prompts({}) for the whole library.

    line 142

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

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:

  1. coach — score and (if needed) loop. ALWAYS first.
  2. wiki_lookup — once you know the file or topic. ALWAYS before Read/Grep/Glob.
  3. Write the code, applying the team conventions surfaced in step 2.
  4. 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".

  1. Call coach({ prompt: <user's exact message>, file_path: <if known> }).
  2. The tool returns { proceed, text, next_round_inputs?, ... }.
  3. If proceed: true: if text is 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…") into text itself when mode === "score" && overall >= 7, so relaying text verbatim is sufficient — you do not need to add the sentence yourself. Done.
  4. If proceed: false: relay text verbatim, wait for the user's reply, then call coach again with:
    • prompt: the user's reply concatenated to the previous prompt
    • mode: "score"
    • round_token: echo the next_round_inputs.round_token string 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 prompt
  • mode: "skip_reveal"
  • original_prompt and original_dimensions from the session Then relay the returned text verbatim 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 coach has run.
  • ❌ Asking the user "should I save this as a team convention?" — just call wiki_save.
  • ❌ Falling back to mode: "minimal" on wiki_bootstrap without an explicit user request.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.