Memories

Capture technical gotchas into the JIT `memories/` knowledge base, either from the current conversation or by mining past `.jsonl` transcripts. Accepts only reproducible, monorepo-specific constraints with a concrete root cause. Use when the user says "memories", "save gotchas", "extract gotchas", "mine chat history", "process the backlog", or after a session that uncovered a non-obvious trap worth keeping. For auditing, merging or pruning what is already filed, use `memories-manager` instead.

How to use

Use this at the end of a technical discussion or task to preserve constraints.

Prompt

Capture Gotchas

Extract high-fidelity technical "gotchas" and save them to the JIT memories/ knowledge base.

The on-disk contract — block format, category map, sort order, index line — lives in @.agents/skills/cebreus-memories/GOTCHA-FORMAT.md. Read it before writing anything.

CRITICAL CONSTRAINTS (FAIL-CLOSED)

  1. Zero Hallucination: Extracted data MUST be technically precise. DO NOT invent, infer, or extrapolate constraints beyond what is explicitly stated or demonstrated in the source. A candidate that cannot be tied to a specific, verifiable technical behaviour is discarded, not softened.
  2. No Root Appending: NEVER append gotchas directly to a root or workspace AGENTS.md. Gotchas live ONLY in memories/ subdirectories. AGENTS.md gets the one-line index reference and nothing else.
  3. No Silent Drops: A candidate you cannot classify is reported as flagged, never quietly abandoned.
  4. Dates Come From The Tool: Never work out **Date Discovered:** yourself. Run node .agents/skills/cebreus-memories/gotchas.mjs date and paste the result. See @.agents/skills/cebreus-memories/GOTCHA-FORMAT.md.

1. Pick The Source

Current conversation (default). Analyse the conversation in front of you. Use this unless the user explicitly asks for history.

Transcript backlog. Use when the user asks for past sessions — "mine chat history", "process the backlog". Then:

  • Run node .agents/skills/cebreus-memories/gotchas.mjs mine. It reads the Claude and Gemini CLI transcript stores for this repo, writes .txt extracts to .temp/extracted_chats/, and prints how many transcripts it mined. A zero exit code is the go-ahead; it exits non-zero when it finds no transcripts or no usable messages, in which case report the printed reason and halt.
  • Do NOT read the raw .jsonl files, and do NOT read the extracts whole. Delegate them to sub-agents in chunks of at most 50k tokens, one chunk per sub-agent, with no cross-referencing between chunks.
  • Give each sub-agent @.agents/skills/cebreus-memories/GOTCHA-FORMAT.md and the filter in section 2 below. Collect their candidates; you do the writing.
  • Record which extract each candidate came from. Its date is that session's, not today's: node .agents/skills/cebreus-memories/gotchas.mjs date .temp/extracted_chats/<session>.txt.
  • The backlog has no cursor: every run re-reads every transcript. Expect repeats of what is already filed, and drop them at section 3 rather than appending a second copy.
  • Delete .temp/extracted_chats/ when done.

2. Filter

A valid gotcha is reproducible, has a concrete technical root cause, and is specific to this monorepo rather than general industry knowledge.

  • Include: specific error codes, version-pinned dependency conflicts, undocumented API behaviour, race conditions, environment-specific failures, toolchain and configuration traps.
  • Exclude: subjective "vibes", general best practices, stylistic preferences, conversational context, or any claim that cannot be reproduced from the source alone.
  • Flag: ambiguous candidates whose technical specificity is uncertain. Report them in the final table with confidence Flagged; do not file them and do not drop them.

Scope: decide whether the gotcha is global (monorepo root) or workspace-specific (e.g. packages/ui). When ambiguous, default to the most specific scope the evidence supports.

Category: classify as EXACTLY one category from the map in GOTCHA-FORMAT.md. If a gotcha could fit several, choose the one that best describes its primary failure mode.

3. Write

  1. Deduplicate. Read the target file first. If the gotcha is already filed, skip it. If a filed entry is a weaker variant of what you found, leave it alone and hand the pair to memories-manager; merging is that skill's job, not this one's.
  2. Date. Run node .agents/skills/cebreus-memories/gotchas.mjs date for a gotcha from this conversation, or ... date <extract> for one mined from the backlog. Paste the output; do not compose it yourself.
  3. Append. Write the block to the END of the target file, in the format from GOTCHA-FORMAT.md.
  4. Index. If the scope's AGENTS.md does not already reference the target file, append the index line.
  5. Sort. Run node .agents/skills/cebreus-memories/gotchas.mjs sort. Verify the file count it prints matches the files you touched.

4. Report

Output a short summary table with columns: Gotcha Name, Category, Scope, Target File Path, Confidence (High/Flagged). DO NOT print the full markdown blocks in the chat.

Attachments