Logo vun Shadow Frog Meditate

Shadow Frog Meditate

Organisatioun
microsoft
shadow-frog-meditate

Clean and consolidate the shadow knowledge base. Scans all shadow files for duplicate discoveries (same claim, different wording), near-duplicates (one extends another), and conflicting entries (contradicting claims). Merges duplicates, resolves conflicts by investigating the code, and asks the user only when resolution is unclear. Invoke periodically to keep the shadow focused and free of noise.

Iwwersiicht

Editeurmicrosoft
RepositoryShadowFrog
Skill-Nummshadow-frog-meditate
Stären
33
Forks
9
Matgeliwwert Fichieren
1
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 1 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum microsoft op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Shadow Frog Meditate an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/microsoft/ShadowFrog/tree/main/skills/shadow-frog-meditate
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/microsoft/ShadowFrog.git /tmp/ShadowFrog
mkdir -p .claude/skills
cp -r /tmp/ShadowFrog/skills/shadow-frog-meditate .claude/skills/shadow-frog-meditate
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Shadow Frog Meditate an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Shadow Frog Meditate automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Shadow Frog Meditate net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

ShadowFrog Meditate

Shadow hygiene — deduplicate, merge, and resolve conflicts across the entire .shadow/ knowledge base. Prerequisite: .shadow/ exists with discoveries.

Phase 1: Scan

Use parallel subagents to scan the shadow. Each subagent handles a batch of shadow files.

Scope Optimization

Not every file needs scanning. To reduce cost:

  • Skip files with 0-1 discoveries — they can't have internal duplicates
  • Focus on files modified since last meditate — check _meta/state.json last_update_at against file modification times
  • Always scan files with 5+ discoveries — highest duplicate risk

For the first meditate after a large dream run, most files will need scanning.

Per-File Scan

For each per-file shadow (e.g., src/auth.py.md):

  1. Read all discoveries under each ## symbol heading
  2. Compare discoveries under the same symbol by behavioral meaning, not wording:
    • Duplicate: same behavioral claim, different wording
    • Near-duplicate: one discovery is a subset/refinement of the other
    • Conflict: the two discoveries make contradicting claims
    • Distinct: genuinely different insights — no action needed
  3. Record each finding as a structured action (see below)

Overlapping Also involves: refs can help identify related claims.

Scan Output Format

Subagents must output findings as one JSON object per line so the orchestrator can auto-apply resolutions. This is critical for automation — prose recommendations require manual interpretation.

{"action": "merge", "file": "src/auth.py.md", "symbol": "authenticate_user", "keep": "- silently returns None on expired tokens...", "remove": "- returns None when token expires...", "merged": "- authenticate_user() silently returns None on expired tokens instead of raising. 3 of 7 callers don't check.\n  _(verified, source: exploration, citation_score: 0)_", "reason": "duplicate: same claim, different wording"}
{"action": "merge", "file": "src/db.py.md", "symbol": "connect", "keep": "- connection pool exhaustion...", "remove": "- pool runs out...", "merged": "...", "reason": "near-duplicate: first extends second"}
{"action": "conflict", "file": "src/auth.py.md", "symbol": "validate_token", "entry_a": "- raises ValueError...", "entry_b": "- returns False...", "resolution": "verified_a", "reason": "code inspection: line 42 raises ValueError"}
{"action": "conflict", "file": "src/cache.py.md", "symbol": "invalidate", "entry_a": "...", "entry_b": "...", "resolution": "escalate", "reason": "both claims have evidence, needs user input"}
{"action": "move_to_cross", "file": "src/auth.py.md", "symbol": "validate_token", "entry": "- all validators share...", "cross_slug": "shared-validation-pattern", "reason": "cross-scope: involves 4 files"}

Fields:

  • action: merge | conflict | move_to_cross | move_from_cross
  • file: shadow file path relative to .shadow/
  • symbol: the ##/### heading the discovery lives under
  • keep: the discovery text to keep (for merge)
  • remove: the discovery text to delete (for merge)
  • merged: the final merged text (for merge)
  • resolution: verified_a | verified_b | escalate (for conflict)
  • reason: human-readable explanation

The orchestrator collects all lines, applies merge and conflict actions automatically, and presents escalate items to the user.

Cross-Scope Scan

After per-file scanning:

  1. Collect all per-file discoveries into a flat list
  2. For each _cross/*.md discovery, check if any per-file discovery makes the same or overlapping claim
  3. For each _prefs.md preference, check if any per-file discovery or _cross/ entry duplicates it
  4. Record cross-scope findings the same way

Phase 2: Resolve

Process each finding by type.

Duplicates → Merge

Combine into a single discovery:

  • Keep the richer wording (more detail, more context)
  • Keep the stronger trust: source: user > source: interaction > source: exploration
  • Keep the stronger status: verified > uncertain > refuted
  • Merge Also involves: refs (union of both)
  • Preserve the larger citation_score; do not sum counts that may share history.
  • Delete the weaker entry

Near-Duplicates → Absorb

The broader discovery absorbs the narrower one:

  • Expand the broader entry to include any extra detail from the narrower
  • Delete the narrower entry
  • Preserve the stronger trust/status between the two
  • Preserve the larger citation score for the merged knowledge.

Conflicts → Investigate

When two discoveries contradict each other:

  1. Read the actual source code at the file::symbol location
  2. Trace the logic to determine which claim is correct
  3. If needed, write and run a short test script to verify
  4. Mark the correct claim verified, the incorrect one refuted
  5. If the incorrect claim was once true but code changed, update it to reflect the current behavior and mark it verified

If investigation takes more than a few minutes without resolution:

  • Keep both discoveries
  • Add a note: (conflict unresolved — needs user input)
  • Ask the user to clarify at the end of the meditate session

Cross-Scope Duplicates → Place Correctly

When the same discovery exists in both a per-file shadow and _cross/:

  • If it involves 3+ files → keep in _cross/, remove from per-file
  • If it involves 1-2 files → keep in per-file, remove from _cross/
  • Update cross-references in both directions after moving

When a per-file discovery duplicates a _prefs.md entry:

  • If it's truly project-wide (not tied to a specific symbol) → keep in _prefs.md, remove from per-file
  • If it's specific to that symbol but happens to match a pref → keep both (they serve different purposes)

Phase 3: Report

After all resolutions, print a summary:

Meditate Summary
================
  Files scanned:       42
  Duplicates merged:   7
  Near-dupes absorbed: 3
  Conflicts resolved:  2
  Conflicts escalated: 1
  Cross-scope fixed:   2
  Total entries removed: 12

Escalated (needs your input):
  src/auth.py::validate_token
    - "raises ValueError on invalid format" vs "returns False on invalid format"
    Both claims have evidence. Which behavior is correct?

Parallelism

For large shadows (20+ files), use parallel subagents:

  1. Partition shadow files into batches of ~10 files each
  2. Launch one subagent per batch for Phase 1 (scan)
  3. Each subagent outputs JSON-per-line findings (see Scan Output Format)
  4. Orchestrator collects all JSON lines from all subagents
  5. Auto-apply merge actions: use edit tool with remove as old_str, replace keep with merged
  6. Auto-apply conflict actions where resolution is verified_a or verified_b — mark the loser refuted
  7. Collect escalate items for user review
  8. Run Phase 3 (report)

For smaller shadows, run everything in a single pass — the scan output format is still useful for traceability.

Dream Archive Hygiene (_dreams/)

Meditate performs consistency checks and field repair on _dreams/. It does NOT delete or rewrite report prose (those are historical records), but it DOES fix missing/wrong metadata in the index.

Structural Checks

  1. Index consistency — verify every folder in _dreams/ has a row in _dreams/_index.md, and every row in the index has a matching folder. Fix mismatches (add missing rows, remove orphaned rows).

  2. Report completeness — each _dreams/<id>/ should contain at minimum a report.md. Flag any empty directories.

  3. Stale patches — if base_commit in a report's frontmatter is more than 100 commits behind current HEAD, add a note to the index: ⚠️ patch may not apply cleanly. Check with:

    bash
    git rev-list <base_commit>..HEAD --count 2>/dev/null
  4. Cross-reference integrity — if a per-file discovery has a Dream report: _dreams/<id>/ reference, verify that dream folder exists. Remove dangling references.

Index Field Repair (run after Structural Checks)

Dream subagents sometimes write incomplete index rows (e.g., unknown category/verdict, generic titles). meditate-repair.py (below) auto-resolves these by reading each experiment's report.md frontmatter, manifest.json, and verdict-section signals.

Do NOT hand-edit 50+ rows. Use the script. The agent's job is to surface what the script CAN'T auto-fix:

  • Corrupted reports — when report.md's dream_id (frontmatter or body) doesn't match the folder name, the report was copy-pasted from another experiment. The script prints these to stderr and skips them. Do NOT auto-fix corruption — the content is wrong, not just the ID. Log them in the meditate summary for user review.
  • Ambiguous parent branches — when no manifest.json exists for an experiment, the script falls back to slug heuristics (-extend, -fix, -deeper, -improve, -integration, -cleanup, -metrics, -remaining strongly suggest compounding from a sibling). If the heuristic match is not high-confidence, flag for user review rather than guessing.

Applying Index Repairs

bash
SKILL_DIR=""
for DIR in .github/skills/shadow-frog-meditate \
           .claude/skills/shadow-frog-meditate; do
    [ -d "$DIR" ] && SKILL_DIR="$DIR" && break
done

if [ -n "$SKILL_DIR" ] && [ -x "$SKILL_DIR/meditate-repair.py" ]; then
    python3 "$SKILL_DIR/meditate-repair.py"
else
    echo "meditate-repair.py not found; falling back to manual scan." >&2
fi

What it does:

  • Backs up .shadow/_dreams/_index.md to .bak first
  • Detects corrupted reports (frontmatter dream_id != folder name) and prints them to stderr — these rows are skipped, you resolve manually
  • For every other row with unknown/empty category/verdict/title, resolves the canonical value from the report's frontmatter, manifest, or verdict section signals
  • Title repair replaces generic forms (raw slug, "Dream Report: ", "Dream t##: ") with the first # H1 or ## Summary line

Verdict detection order is manifest > VERDICT_SECTION signals > whole-body signals. Dead-end signals are checked BEFORE useful signals so not useful doesn't match useful.

Idempotent — safe to rerun until output reports 0 repaired.

Do NOT delete dream reports during meditate — only the user decides what to keep or discard (via Phase 7 review or manual cleanup).

Rules

  • Never delete a source: user discovery without asking — user knowledge is the highest trust. If it conflicts with source: exploration, investigate thoroughly before concluding the user was wrong.
  • Preserve Also involves: refs — when merging, take the union.
  • Update _index.md after removing entries (discovery counts change).
  • Update _meta/state.json — set last_update_type: "meditate".
  • Don't touch _prefs.md placement unless a pref is clearly duplicated verbatim in a per-file shadow.

Format Compliance

Every merged or rewritten discovery must exactly follow the canonical format in /shadow-frog (Discovery Format, Cross-Cutting, Preferences). Re-read both the original entries and the spec before writing — a malformed discovery is worse than a duplicate; it breaks the viewer parser and downstream agents.

Meditate-specific rules:

  • Keep visible citation scores when rewording or moving the same knowledge; a new behavioral claim starts at 0. Counts never override trust or correctness.
  • When merging, take the union of labels: [...] from both entries.
  • When merging, preserve every Also involves: file::symbol from both entries (union, not intersection).
  • Dream report: _dreams/<id>/ references must survive the merge — re-attach to the merged entry if either original had one.
  • Status (verified/uncertain/refuted) is taken from the stronger source: user ≻ interaction ≻ verified exploration ≻ uncertain.
  • Discovery text stays behavioral, not a code summary — preserve the more behavioral wording when entries differ in style.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Shadow Frog Meditate?

Clean and consolidate the shadow knowledge base. Scans all shadow files for duplicate discoveries (same claim, different wording), near-duplicates (one extends another), and conflicting entries (contradicting claims). Merges duplicates, resolves conflicts by investigating the code, and asks the user only when resolution is unclear. Invoke periodically to keep the shadow focused and free of noise.

Firwat Shadow Frog Meditate op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Shadow Frog Meditate besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Shadow Frog Meditate an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/microsoft/ShadowFrog/tree/main/skills/shadow-frog-meditate an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Shadow Frog Meditate benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Shadow Frog Meditate benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Shadow Frog Meditate domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Shadow Frog Meditate gratis?

Jo. De Skill gëtt vum microsoft ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇