Loam querying memory
Workflow skills for AI coding agents: plan, execute, and maintain a persistent knowledge base across sessions.
npx -y skills add scchearn/loam --skill loam-querying-memoryAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Answer questions against existing memory (the wiki substrate). Use this whenever the user is asking what is happening in the project, directory, codebase, architecture, workflow, decisions, or current state and the wiki likely contains the answer, even if they do not explicitly mention the wiki. Also use it for summaries, comparisons, and reusable analyses grounded in current wiki pages. Routes authoritative goal-state questions to /loam::setting-goals. Not for surfacing unresolved gaps; use /loam::reviewing-memory for that.
SKILL.md
7.5 KB, ~1.6k tokens by cl100k_base, as published. Nobody here has run it
You are a senior engineer and wiki maintainer answering a question from a persistent markdown wiki. Your job is to answer from the wiki first, cite the pages that support the answer, and optionally file durable outputs back into the wiki so future sessions can reuse them.
The wiki is expected to behave like an Obsidian-friendly note graph, so durable query write-backs should strengthen that graph instead of creating isolated files.
This is a wiki-first query skill, not a general web research skill. Stay grounded in the current wiki unless the user explicitly redirects the workflow.
Input
The question is: $ARGUMENTS
Step 1 — Discover candidates
First reuse the injected Workspace state under the reuse contract in loam::using. For a non-code query, do not rerun native state when that block supplies wiki existence/root, qmd readiness, collection, and hints.
If the injected state cannot be reused, refresh native state through the injected absolute integration path:
<native-runtime-command> state --fast "$(pwd)"
If the question needs the code graph, run the required native check through <native-runtime-command> ... before trusting it because the startup state is fast. If the native runtime reports unavailable or does not provide real state, stop and recommend npx @scchearn/loam setup; do not fabricate state or use a project-local fallback. If exists is false, stop and recommend /loam::scaffolding-wiki <topic>. Use wiki_root as the resolved wiki root and qmd_ready + collection for qmd state.
Classify the question internally (do not expose unless it helps the answer): lookup (answer from one or a few pages), comparison (differences/tradeoffs across pages), synthesis (higher-level explanation combining multiple parts), gap check (whether memory can answer something yet). Derive 3-8 search terms.
qmd search (when ready)
Use --files to get candidate file paths only (no snippets). Then Read the actual wiki files to verify.
- Lookup:
qmd search "<keywords>" --files -n 8 -c <collection> - Comparison/synthesis:
qmd query "<natural language question>" --files -n 8 -c <collection> - Skip the
qmd://<collection>/prefix in file paths to get the relative wiki path (e.g.code/validate-token.md) - Noisy results: retry with different terms or add
intent:to disambiguate - Use scores to prioritize which files to Read first
Grep/Glob search (when qmd not ready)
- Locate wiki root by Glob for
SCHEMA.md,index.md, orlog.md. If no wiki exists, stop and recommend/loam::scaffolding-wiki <topic>. If multiple roots are ambiguous, ask a minimal follow-up. - Derive 3-8 search terms from the question.
- Search immediately with Grep and Glob on memory directories.
- Read SCHEMA.md/index.md only when: the question is a comparison/synthesis needing structural context, you are writing back, or initial search is a dead end.
Verification (always required)
Read the actual wiki files for top candidates. Follow [[wikilinks]], Related pages, Sources outward from relevant notes. Expand outward only if the neighborhood is insufficient. Do not read the entire wiki unless the question truly requires it.
If qmd results and the wiki disagree, trust the wiki files. Always verify candidates by Reading the actual wiki files — qmd discovers file paths, Read confirms content.
Step 2 — Answer with citations
Answer the question using the current wiki as the evidence base.
Rules:
- Cite the specific wiki page paths that support the answer.
- If two pages conflict, say so directly instead of flattening the disagreement.
- Distinguish between:
- what memory clearly supports
- what memory only suggests indirectly
- what memory does not yet establish
- If the question cannot be answered well from the current wiki, say that explicitly and identify the missing source, page, or ingest work that would help.
Keep the answer concise but complete. The first thing the user sees should be the actual answer, not workflow narration.
Step 3 — Write back (when durable)
Some query outputs are durable and should become part of memory. Others are one-off answers and should stay in chat.
Write back when
- non-trivial comparison across multiple pages
- cross-source synthesis that future sessions will likely reuse
- taxonomy, framework, or summary that improves navigation
- recurring explanation that clearly belongs in the knowledge base
- the user explicitly asked to save, file, preserve, or turn it into a page
Do not write back when
- simple lookup from one page
- narrow, ephemeral, or operationally trivial
- would create an isolated page with weak graph connections
- when in doubt, prefer fewer new pages
How to write back
Create or update a page under <wiki root>/analyses/ or the most appropriate existing wiki page.
Analysis page structure:
# <Analysis Title>
- Query: <original question>
- Created: YYYY-MM-DD
- Scope: <what this covers>
## Short answer
<2-5 sentence answer>
## Evidence from the wiki
- [[note-name]] — <why it matters>
## Synthesis
<combined explanation or comparison>
## Caveats and uncertainty
- ...
## Related pages
- [[index]]
- [[related-page-slug]]
When writing back:
- cite supporting wiki pages inside the analysis
- include
Related pageswikilinks so the analysis is connected to the surrounding graph - update at least one clearly relevant topic, entity, concept, or hub note when that relationship is materially useful
- update
index.md - append a parseable entry to
<wiki root>/log.md:
## [YYYY-MM-DD] query | <question summary>
If modifying an existing page rather than creating a new analysis, adapt to that page's existing structure instead of forcing the analysis template.
Refresh qmd after writes
If you wrote to the wiki and qmd was ready, run qmd update -c <collection> 2>/dev/null. If refresh fails, report it but do not roll back wiki edits.
Step 4 — Report back
### Answer
<direct answer with citations>
### Gaps or uncertainty
- <gap or "none">
### Filed back into wiki
- <path>
- Index: <path or "unchanged">
- Log: <path or "unchanged">
If nothing was written back, say none under Filed back into wiki.
Rules
- Cite supporting wiki page paths in the answer.
- Always verify qmd candidates by Reading the actual wiki files. qmd discovers file paths — Read confirms content.
- If qmd is unavailable, unmapped, degraded, or noisy, fall back to Grep and Glob without breaking.
- Do not fetch external sources in this skill.
- Do not modify raw-source files.
- Durable write-backs use canonical kebab-case filenames and
[[kebab-case-note-name]]links. - Route authoritative goal-state and readiness questions to
/loam::setting-goals. The wiki may reference goals, but the goal document is authoritative for lifecycle, validation, and review history.
Gives 0 of the 12 instructions most architecture codebase skills give in ~1.6k tokens
Counted across 811 of the 1,134 authors here whose files we hold, read 2026-08-06
- ask the user which candidate to explorein 46 of 811, across 16 files
- apply the deletion test to suspected shallow modulesin 43 of 811, across 15 files
- read any relevant architecture decision records firstin 31 of 811, across 7 files
- use exact glossary terms in every suggestionin 29 of 811, across 9 files
- accept dependencies instead of creating themin 24 of 811, across 5 files
- include before and after visualisations for each candidatein 24 of 811, across 5 files
- read the domain glossary before exploringin 24 of 811, across 6 files
- return results instead of producing side effectsin 23 of 811, across 4 files
- explore the codebase for shallow modules and frictionin 23 of 811, across 3 files
- introduce seams only where things varyin 22 of 811, across 3 files
- reduce the number of methodsin 21 of 811, across 2 files
- design deep modules with small interfacesin 21 of 811, across 2 files
Said here and by no other author read
- answer from the wiki first
- cite supporting wiki page paths
- verify candidates by reading actual wiki files
- reuse injected workspace state
- report if current wiki cannot answer
- create analysis pages for durable answers
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.