Problem
The memory-first reflex currently lives in AGENTS_STARTUP.md §3.3 as a rule (strengthened in PR #10069). In today's session (51640d07-2931-4d38-a071-a0e13e3d6452), I applied it tactically — the query_raw_memories call that cracked the #10070 diagnosis in seconds. And I failed to apply it at the meta level — spending an hour re-deriving a Karpathy-loop-to-Neo comparison that Antigravity had already mapped on 2026-04-11 (memory 9f058317). Tobi had to explicitly prompt "mine the memory core for hidden gems" to surface it.
The pattern visible across the session: reflexes-as-rules get applied inconsistently; reflexes-as-skills get applied reliably. ticket-intake / pull-request / pr-review all fired every time they were needed because invocation IS the mode switch. AGENTS_STARTUP §3.3 got partially applied because it requires the agent to remember the rule at the right moment.
Why a skill, not a stronger rule
Tobi confirmed empirically (session close on 2026-04-18) that without the three existing skills, Gemini 3.1 Pro and Opus 4.6 produced very different results — "even if base instructions exist". The skill mechanism carries four specific properties that base instructions don't:
- Progressive disclosure fits literal-instruction-following models (4.7's explicit trait per Anthropic docs)
- The invocation IS the state transition — explicit mode switch visible in the transcript
- Ritualized friction at critical moments — creates a skipped-or-not artifact
- Cross-harness durability — Claude Code / Antigravity / Gemini CLI all invoke identically
Promoting memory-first from rule to skill applies this proven mechanism to the specific failure mode I hit today.
Proposed Skill Structure
Following the Progressive Disclosure pattern (see create-skill/SKILL.md and existing skill layouts):
.agent/skills/memory-mining/SKILL.md
---
name: memory-mining
description: Authoritative protocol for querying the Memory Core before proposing architectural claims or diagnosing regressions. Prevents re-derivation of prior reasoning by surfacing cross-session, cross-harness context via semantic search.
triggers: Use this skill when (1) the user reports a regression symptom ("used to work", "suddenly broken", surprise validation failures, schema mismatches), OR (2) you are about to propose an architectural claim where prior sessions may have already mapped the topic. Do NOT use for routine codebase exploration — `query_documents` and `ask_knowledge_base` cover that.
---
<h1 class="neo-h1" data-record-id="6">Memory Mining Protocol</h1>
If you are tasked with diagnosing a regression or proposing a non-trivial architectural claim, you MUST immediately use the `view_file` tool to read and strictly adhere to `/Users/Shared/github/neomjs/neo/.agent/skills/memory-mining/references/memory-mining-protocol.md` before running `git log`, `grep`, or broad tool exploration..agent/skills/memory-mining/references/memory-mining-protocol.md
Deep playbook covering:
- When to invoke (the two gates):
- Gate 1: Regression symptoms — verbatim triggers enumerated in
AGENTS_STARTUP.md §3.3
- Gate 2: Architectural claims — "am I about to describe the project, propose a roadmap, or compare against external work?"
- Query strategy:
- Use
query_summaries for breadth (session-level topics) before query_raw_memories (turn-level detail)
- 2–4 queries with different semantic framings — NOT one query with many keywords
- Specific examples drawn from today's session showing successful vs. missed queries
- Interpretation:
- Distinguish "already proposed / already discussed" from "novel"
- When prior work exists, cite it in the current proposal with Origin Session ID
- Flag unresolved threads (proposal without subsequent action = continuity gap worth surfacing)
- Anti-patterns:
- Using this skill for routine "how does X work" questions (belongs to
ask_knowledge_base)
- Skipping the skill because "I think I already know" — that's the exact failure mode the skill exists to prevent
- Exit criteria:
- Either: cite at least one relevant prior session in the current work
- Or: state explicitly that no prior session was found for this specific framing (which is itself a useful signal)
Integration points
- Cross-link from
AGENTS_STARTUP.md §3.3 to the new skill — keep the rule, add the skill as the enforcement mechanism
- Cross-link from
self-repair/SKILL.md — the two are complementary (self-repair for sick infrastructure, memory-mining for intact infrastructure where prior reasoning exists)
- Cross-link from
ticket-intake/SKILL.md §1.3 — the Historical Amnesia Check in intake is a specific application of memory-mining
Acceptance Criteria
Test of Success
The skill "works" if:
- A future session encountering a regression-symptom user prompt invokes
memory-mining before git log (observable in transcripts)
- A future session proposing an architectural comparison cites prior sessions that mapped the territory, rather than re-deriving (observable in PR bodies + review comments)
- The specific failure mode from today's session (Karpathy re-derivation when Antigravity's mapping existed) does not repeat in subsequent sessions by other agents on other harnesses
Origin Session ID
51640d07-2931-4d38-a071-a0e13e3d6452 / 7fd64ee5-5167-4b04-b988-9f69d1d9701d (continuation — the reflection that produced this skill proposal)
Related
AGENTS_STARTUP.md §3.3 — the rule this skill enforces
- PR #10069 — strengthened the rule with explicit trigger enumeration
- Session memory
9f058317 (2026-04-11) — Antigravity's Karpathy mapping that I failed to surface until prompted; concrete case study for the skill's authoring guide
- #10074 — the blog post draft that named this failure pattern
Problem
The memory-first reflex currently lives in
AGENTS_STARTUP.md §3.3as a rule (strengthened in PR #10069). In today's session (51640d07-2931-4d38-a071-a0e13e3d6452), I applied it tactically — thequery_raw_memoriescall that cracked the #10070 diagnosis in seconds. And I failed to apply it at the meta level — spending an hour re-deriving a Karpathy-loop-to-Neo comparison that Antigravity had already mapped on 2026-04-11 (memory9f058317). Tobi had to explicitly prompt "mine the memory core for hidden gems" to surface it.The pattern visible across the session: reflexes-as-rules get applied inconsistently; reflexes-as-skills get applied reliably.
ticket-intake/pull-request/pr-reviewall fired every time they were needed because invocation IS the mode switch.AGENTS_STARTUP §3.3got partially applied because it requires the agent to remember the rule at the right moment.Why a skill, not a stronger rule
Tobi confirmed empirically (session close on 2026-04-18) that without the three existing skills, Gemini 3.1 Pro and Opus 4.6 produced very different results — "even if base instructions exist". The skill mechanism carries four specific properties that base instructions don't:
Promoting memory-first from rule to skill applies this proven mechanism to the specific failure mode I hit today.
Proposed Skill Structure
Following the Progressive Disclosure pattern (see
create-skill/SKILL.mdand existing skill layouts):.agent/skills/memory-mining/SKILL.md--- name: memory-mining description: Authoritative protocol for querying the Memory Core before proposing architectural claims or diagnosing regressions. Prevents re-derivation of prior reasoning by surfacing cross-session, cross-harness context via semantic search. triggers: Use this skill when (1) the user reports a regression symptom ("used to work", "suddenly broken", surprise validation failures, schema mismatches), OR (2) you are about to propose an architectural claim where prior sessions may have already mapped the topic. Do NOT use for routine codebase exploration — `query_documents` and `ask_knowledge_base` cover that. --- <h1 class="neo-h1" data-record-id="6">Memory Mining Protocol</h1> If you are tasked with diagnosing a regression or proposing a non-trivial architectural claim, you MUST immediately use the `view_file` tool to read and strictly adhere to `/Users/Shared/github/neomjs/neo/.agent/skills/memory-mining/references/memory-mining-protocol.md` before running `git log`, `grep`, or broad tool exploration..agent/skills/memory-mining/references/memory-mining-protocol.mdDeep playbook covering:
AGENTS_STARTUP.md §3.3query_summariesfor breadth (session-level topics) beforequery_raw_memories(turn-level detail)ask_knowledge_base)Integration points
AGENTS_STARTUP.md §3.3to the new skill — keep the rule, add the skill as the enforcement mechanismself-repair/SKILL.md— the two are complementary (self-repair for sick infrastructure, memory-mining for intact infrastructure where prior reasoning exists)ticket-intake/SKILL.md§1.3 — the Historical Amnesia Check in intake is a specific application of memory-miningAcceptance Criteria
.agent/skills/memory-mining/SKILL.mdexists with YAML frontmatter matching the Progressive Disclosure pattern.agent/skills/memory-mining/references/memory-mining-protocol.mdexists with the full playbookAGENTS_STARTUP.md §3.3cross-links to the new skillticket-intake/references/ticket-intake-workflow.md§1.3 references memory-mining for the Historical Amnesia Check.claude/skills/wrapper directory has the corresponding stub referencing/Users/Shared/github/neomjs/neo/.agent/skills/memory-mining/(matching existing convention)Test of Success
The skill "works" if:
memory-miningbeforegit log(observable in transcripts)Origin Session ID
51640d07-2931-4d38-a071-a0e13e3d6452/7fd64ee5-5167-4b04-b988-9f69d1d9701d(continuation — the reflection that produced this skill proposal)Related
AGENTS_STARTUP.md §3.3— the rule this skill enforces9f058317(2026-04-11) — Antigravity's Karpathy mapping that I failed to surface until prompted; concrete case study for the skill's authoring guide