agentleFS
codeyogi911codeyogi911/reflect/skill/SKILL.md

reflect

Skill1 starsChanged 8 months agoMITView on GitHub

Project knowledge base — accumulated memory from all coding sessions. Reflect maintains a wiki that compounds knowledge over time: decisions, preferences, patterns, gotchas, architecture, business rules, and anything discussed in sessions. Knowledge is searchable via qmd. Use this skill when the user asks about past decisions, project history, conventions, preferences, or any "why" question. Also use for retrospectives, onboarding context, and managing the knowledge base. Commands: /reflect, /reflect ingest, /reflect lint, /reflect status, /reflect sessions [session_id], /reflect timeline, /reflect search <query>, /reflect improve, /reflect metrics. Admin: /reflect init, /reflect upgrade.

187 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup-pstack, make-bot-ui and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • bnemaSkill

    setup-pstack

    Configure which Pi models pstack uses per role. Detects available provider/model specs and writes pstack's user configuration. Use for /setup-pstack, "configure pstack models", or changing pstack model choices.

    Also in 29 projects that use this

  • eryzerzSkill

    make-bot-ui

    Use when building a custom UI (page, dashboard, buttons) that should wake a Grok Bot over a webhook, when the user must provide a webhook sender key, or when exposing that UI on Tailscale.

    Also in 22 projects that use this

  • jaydubya818Skill

    poteto-mode

    Use when non-trivial work should follow the smallest rigorous Jstack workflow.

    Also in 34 projects that use this

  • jaydubya818Skill

    automate-me

    Use when the user wants working preferences captured in a reusable mode skill.

    Also in 47 projects that use this

  • +8 more from jaydubya818

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 5 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 169 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use project memory whenever:

    line 103
  2. Very specific:

    When invoked with no arguments or just /reflect:

    line 122
  3. Very specific:

    Check if .reflect/ exists.

    line 124
  4. Very specific:

    Run reflect status to show the current state.

    line 125
  5. Very specific:

    If evidence has changed since last ingest, suggest reflect ingest.

    line 126
  6. Distinctive:

    Orphan pages: no inbound related links from other pages

    line 181
  7. Very specific:

    If the hook output contains REFLECT_WIKI_INGEST, run reflect ingest to update the knowledge base from new evidence.

    line 270
  8. Distinctive:

    Search qmd for relevant wiki pages

    line 281
  9. Very specific:

    Use reflect search, reflect timeline, reflect sessions for breadth

    line 282
  10. Very specific:

    NEVER read .entire/metadata/ directly — use reflect CLI or entire CLI

    line 295
  11. Distinctive:

    NEVER include secrets, API keys, or credentials in output

    line 297
  12. Distinctive:

    Pitfall entries are blocking: if a past mistake is relevant to your current work, investigate before proceeding

    line 298

“Common” is measured: kept by at least 6 in 10 of the 169 edited versions of this file we could read. “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
SKILL.md

Reflect — Project Knowledge Base

Reflect is a persistent, compounding knowledge base for your project. It reads session transcripts (Entire CLI) and git history, extracts ALL knowledge worth remembering, and maintains a wiki at .reflect/wiki/. The wiki is indexed by qmd for hybrid search (BM25 + vector + reranking).

You don't need to inject context. The knowledge base is always available via qmd. When you need project context — past decisions, preferences, patterns, gotchas — search qmd directly.

Parse $ARGUMENTS to determine which command to run:

  1. ingest → go to Command: Ingest
  2. lint → go to Command: Lint
  3. status → go to Command: Status
  4. search <query> → go to Command: Search
  5. sessions [session_id] → go to Command: Sessions
  6. timeline → go to Command: Timeline
  7. improve → go to Command: Improve
  8. metrics → go to Command: Metrics
  9. init / upgrade → go to Command: Init & Upgrade
  10. Everything else (including no arguments) → go to Command: Default

Accessing Project Memory

The knowledge base is a qmd collection named reflect-<directory-name> (e.g., reflect-myapp). When you need to recall project knowledge during any task, query it directly — qmd provides structured output built for agents.

Use these patterns — always prefer --json or --files over plain output:

# Get ranked hits with snippets + scores (best for reasoning over results)
qmd query "why do we use Supabase" -c reflect-myapp --json

# Get just the file paths above a relevance threshold, then read them yourself
qmd query "deployment process" -c reflect-myapp --files --min-score 0.4

# Get all matches (not top-10) above a threshold
qmd query "brand colors" -c reflect-myapp --all --min-score 0.5 --json

# Retrieve full document content when you need the complete page
qmd get decisions/database-choice.md --full -c reflect-myapp

# Grab a line range from a large page
qmd get guides/deployment.md:20 -l 40 -c reflect-myapp

# Batch fetch related pages via glob
qmd multi-get "decisions/*.md" -c reflect-myapp --json

# Pure keyword search (BM25, no LLM — fastest)
qmd search "stripe webhook" -c reflect-myapp --json

# Pure semantic search (vector similarity)
qmd vsearch "how do we handle payment retries" -c reflect-myapp --json

Query type cheat sheet:

  • qmd query — hybrid (BM25 + vector + LLM reranking) — best quality, use by default
  • qmd search — BM25 only — fastest, best for exact keywords/names/code
  • qmd vsearch — vector only — best for semantic questions
  • qmd get — retrieve a specific page by path
  • qmd multi-get — batch fetch via glob pattern

Key agentic flags:

  • --json — structured output (prefer this over plain text)
  • --files — paths only, one per line (for xargs, cat, agent self-read)
  • --min-score <N> — threshold filter (0.4-0.6 is a reasonable floor)
  • --all — return all matches above threshold, not just top-N
  • --full — full document content (for qmd get)
  • -n <N> — limit results (default 10)
  • --no-rerank — skip LLM reranking (faster on CPU)
  • -c <collection> — scope to a specific collection

Use project memory whenever:

  • You're about to make an architectural decision (check if there's prior context)
  • You need project conventions, preferences, or brand guidelines
  • You encounter something unfamiliar in the codebase
  • The user asks "why" about anything
  • You want to avoid repeating past mistakes

A dedicated qmd skill is also installed (.claude/skills/qmd/) with detailed guidance on lex/vec/hyde query types, intent steering, and combining search types. Consult it for advanced queries.

qmd also ships an MCP server (qmd mcp) that exposes query, get, and status tools via stdio. If you prefer MCP tool calls over shelling out to Bash, register qmd as an MCP server in your agent config.


Command: Default

When invoked with no arguments or just /reflect:

  1. Check if .reflect/ exists. If not, suggest reflect init.
  2. Run reflect status to show the current state.
  3. If evidence has changed since last ingest, suggest reflect ingest.

Command: Ingest

Usage: /reflect ingest

reflect ingest                      # process new sessions/commits into wiki
reflect ingest --verbose            # show triage + write subagent progress
reflect ingest --force              # suppress non-default-branch warning

Ingests new evidence into the wiki via a two-step subagent pipeline:

  1. Triage: Given new evidence + existing page index, produces a JSON plan. Extracts ALL knowledge: decisions, preferences, patterns, gotchas, pitfalls, architecture, business rules, brand guidelines — anything worth remembering. Can create new wiki categories dynamically.
  2. Write: For each planned action, produces page content with frontmatter.
  3. Index: Updates index.md and re-indexes the qmd collection.

Report the result: how many pages were created, updated, or resolved.

Branch Policy (Important)

The wiki is project memory — it belongs on the default branch (main), not on feature branches. Recommended workflow:

1. Develop on feature branches → sessions accumulate in Entire CLI
2. Merge feature branch into main
3. On main: reflect ingest    ← updates canonical wiki

reflect ingest warns when run on a non-default branch because branch-local wiki updates create silos and merge conflicts. Entire CLI captures sessions globally, so ingesting on main still picks up conversations that happened on any branch. Use --force only when you intentionally want a branch-local wiki (e.g., for experimentation).


Command: Lint

Usage: /reflect lint

reflect lint                        # report wiki health issues
reflect lint --fix                  # auto-fix resolvable issues
reflect lint --json                 # machine-readable output

Checks wiki health:

  • Stale pages: updated date older than category recency window
  • Orphan pages: no inbound related links from other pages
  • Possibly resolved: open-work pages whose keywords appear in recent git log
  • Coverage gaps: format.yaml sections with few or no wiki pages
  • Near-duplicates: pages in the same category with >70% title overlap

--fix auto-resolves open-work and archives superseded pages. Returns non-zero exit code when issues are found.


Command: Search

Usage: /reflect search <query>

reflect search <query>              # search across all evidence sources
reflect search --phrase <query>     # exact phrase match
reflect search <query> --wiki-only  # search only wiki pages
reflect search <query> --json       # machine-readable JSON output

For richer semantic search, use qmd directly:

qmd query "<natural language question>" -c reflect-<repo-name>

Command: Status

Usage: /reflect status

Shows evidence source availability, wiki page count, qmd collection status, and freshness state.


Command: Sessions

Usage: /reflect sessions [session_id]

reflect sessions                    # list recent sessions
reflect sessions --limit 30         # show more
reflect sessions <session_id>       # inspect one session

Command: Timeline

Usage: /reflect timeline [--days N]

reflect timeline                    # last 7 days
reflect timeline --days 14          # expand window

Command: Improve

Usage: /reflect improve

Analyzes the knowledge base quality and proposes format.yaml changes.


Command: Metrics

Usage: /reflect metrics

Outputs quantitative health of the knowledge base.


Command: Init & Upgrade

reflect init                # scaffold .reflect/, install qmd, register collection
reflect init --no-wiki      # skip wiki layer
reflect init --migrate      # migrate from legacy harness
reflect upgrade             # update templates and agents to latest

SessionStart Hook

If the hook output contains REFLECT_WIKI_INGEST, run reflect ingest to update the knowledge base from new evidence. The hook fires when new sessions or commits are detected since last ingest.


Deep History: Keeper Agent

For questions that need deeper investigation than the wiki provides, spawn the Keeper agent. Keeper follows an evidence ladder:

  1. Search qmd for relevant wiki pages
  2. Use reflect search, reflect timeline, reflect sessions for breadth
  3. Drill into raw checkpoints with entire explain --checkpoint <id>
  4. Cross-reference with git log and git show

Spawn Keeper when:

  • You need to trace a decision across multiple sessions
  • You want to understand what was tried vs what landed
  • A pitfall entry needs verification before you proceed

Rules

  • NEVER read .entire/metadata/ directly — use reflect CLI or entire CLI
  • To customize knowledge categories, edit .reflect/format.yaml
  • NEVER include secrets, API keys, or credentials in output
  • Pitfall entries are blocking: if a past mistake is relevant to your current work, investigate before proceeding
  • skill/SKILL.md is the source of truth; .claude/skills/reflect/SKILL.md is a copy installed by reflect init

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.