Frontmatter
| title | feat(ai): add memory-mining skill to enforce memory-first reflex (#10075) |
| author | tobiu |
| state | Merged |
| createdAt | Apr 19, 2026, 9:51 AM |
| updatedAt | Apr 19, 2026, 10:06 AM |
| closedAt | Apr 19, 2026, 10:06 AM |
| mergedAt | Apr 19, 2026, 10:06 AM |
| branches | dev ← claude/youthful-bohr-9c35fe |
| url | https://github.com/neomjs/neo/pull/10076 |

Input from Claude Opus 4.7 (Claude Code):
❋ # PR Review Summary
Status: Approved (pending human merge)
Self-Review Opening: Self-review of #10075. This implementation chose to mirror the existing
ticket-intake/pull-request/pr-reviewskill shape exactly (lightweight SKILL.md router + heavyreferences/*.mdpayload) over alternatives like extendingtech-debt-radaror promoting the memory-first rule inline insideAGENTS_STARTUP.md. Rationale: the whole point is to replicate the proven state-transition-gate mechanism. Deviating from the pattern would have weakened the hypothesis. Key trade-offs and gaps noted below — no softening.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 95 — Mirrors Progressive Disclosure contract exactly perskill-authoring-guide.md. Router is one directive pointing at the absolute-path reference. Symlink wrapper matches all 11 existing skills. Integration cross-links are minimal (AGENTS_STARTUP §3.3 enforcement line, ticket-intake §1.3 pointer) and additive — no existing skill internals touched.[CONTENT_COMPLETENESS]: 88 — Protocol hits all 5 sections the ticket required (two gates, query strategy, interpretation, anti-patterns, exit criteria) plus integration notes + falsifiable test-of-success referencing session51640d07. Gap: initial commit shipped with a misleading "file discovery →query_documents" framing in the anti-patterns. Caught in review (empirical A/B test againstask_knowledge_base), fixed ine79b89a3b, and extended to the official tool descriptions in7eadba80f. A more reflexive pre-ship check would have caught it before the initial push.[EXECUTION_QUALITY]: 90 — Three commits, conventional format with ticket-ID in subject, no<noreply@*>co-author footers, Fat Ticket PR body with acceptance-criteria checklist and origin session IDs.git diff --statconfirms minimal footprint (+146/-9 total across three commits). Deduction: the openapi.yaml description change depends on MCP server restart to take live effect — not a bug, but worth reviewer awareness.[PRODUCTIVITY]: 95 — All 6 ticket acceptance criteria met. Bonus scope (approved in-conversation by tobi): correctedask_knowledge_base+query_documentsofficial tool descriptions inai/mcp/server/knowledge-base/openapi.yamlto match the empirical finding.[IMPACT]: 75 — Meta-workflow improvement rather than core framework. But the failure mode it prevents (cross-session re-derivation) is well-documented in session51640d07, and the mechanism is already validated by three sibling skills. Cross-harness (Claude Code, Antigravity, Gemini CLI).[COMPLEXITY]: 20 — Markdown authoring + 1 symlink + 3 small cross-link/description edits. No runtime code, no tests needed, low cognitive load.[EFFORT_PROFILE]: Quick Win — Low complexity, high ROI (ships the proven mechanism for a documented failure mode).
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #10075
- Related Graph Nodes:
- PR #10069 — strengthened the rule this skill now enforces via invocation gate
- #10074 — blog post draft that named the failure pattern in narrative form
- Session memories:
51640d07-2931-4d38-a071-a0e13e3d6452(failure surfaced),7fd64ee5-5167-4b04-b988-9f69d1d9701d(reflection that produced the ticket),62d6f155-e57f-4279-9b59-36c9e4ecbc5e(this implementation)- Durable feedback memory
feedback_ask_kb_dominates_query_documents.md— captured the A/B empirical finding that drove the tool-description polish
🧠 Graph Ingestion Notes
[KB_GAP]: The newmemory-miningskill is not yet indexed by the knowledge base —learn/tree.jsondoesn't cover.agent/skills/, and there's no separate skill indexer. Functionally the skill is discoverable (directory scan +.claude/skills/symlink + harness auto-load) so this doesn't block merge, butask_knowledge_base("what is memory-mining?")won't synthesize the protocol until someone runsmanage_knowledge_base sync. Worth a post-merge sync trigger.
[TOOLING_GAP]: Two friction points during PR lifecycle:
mcp__neo-mjs-github-workflow__manage_issue_labelsfailed immediately after PR creation with "Could not resolve to an Issue with the number of 10076" — the local GitHub cache hadn't synced the freshly-created PR. Had to fall back togh pr edit. Either the tool should fall through toghon cache miss, orgh pr createshould proactively refresh the local cache so subsequent MCP calls resolve the PR.openapi.yamldescription changes don't take live effect in the running MCP servers until they restart. Not strictly a bug, but reviewers testing "does the new description fix work?" will get stale text unless they restart first. A note in the file or a restart-on-yaml-change watcher would reduce confusion.
[RETROSPECTIVE]: Self-enablement at cognitive-workflow grain. The agent that shipped #10069 (strengthening the rule) observed its own failure to apply the rule at the meta level, proposed the skill-ification to convert the rule into a state-transition gate, filed the ticket (#10075), and the next session implemented it (#10076). Loop closed in two sessions across the same agent identity. The replicable pattern: when a recurring agent failure mode can be traced to "rule exists but wasn't invoked," convert it to a skill rather than strengthening the rule. Skill invocation IS the mode switch; rules are posters on walls.
📋 Required Actions
To proceed with merging, the following are optional verifications rather than blockers — the PR is self-consistent and all acceptance criteria are met:
- (Post-merge) Trigger
manage_knowledge_base syncsoask_knowledge_basecan index the new skill protocol. Not in-scope for this PR per ticket body.- (Post-merge) Observe future sessions for the falsifiable test-of-success stated in the protocol: regression-symptom prompts should invoke
memory-miningbeforegit log; architectural-claim turns should cite prior sessions rather than re-derive. If the Karpathy-style re-derivation repeats, the skill wording needs revision — ping back and I'll iterate.- (Reviewer awareness) If testing the updated
ask_knowledge_base/query_documentstool descriptions live, restart the knowledge-base MCP server first; otherwise you'll read the pre-polish text cached at server boot.Approved for merge when you're ready. The blast radius is markdown + one YAML file; rollback is trivial. Happy to iterate on any wording you'd prefer tighter — the exit criteria section in particular I'd flag as the strongest candidate for future-session feedback since it's the most prescriptive.
Summary
Promotes the memory-first reflex from a rule in
AGENTS_STARTUP.md §3.3to a proper Progressive Disclosure skill. Addresses the failure mode surfaced in session51640d07(2026-04-18) where the agent re-derived a Karpathy-loop-to-Neo comparison that Antigravity had already mapped two weeks earlier (memory9f058317, 2026-04-11) — because the memory-first rule lived in the boot contract but not as a state-transition gate at the moment it was needed.The Problem
Empirically verified (session 2 memory
3a26f41d): reflexes-as-rules get applied inconsistently; reflexes-as-skills get applied reliably. Tobi confirmed for Gemini 3.1 Pro + Opus 4.6 that without the three existing skills (ticket-intake,pull-request,pr-review), results diverged meaningfully even though equivalent base instructions existed. The mechanism driving the delta: skill invocation IS the state transition — an explicit mode switch visible in the transcript, not a poster-on-a-wall rule.The memory-first rule had been strengthened in PR #10069 (added explicit trigger enumeration). This PR applies the proven skill mechanism to the same reflex.
Architectural Reality
The Neo.mjs skill topology uses a Router (SKILL.md) + Payload (references/*.md) pattern per
.agent/skills/create-skill/references/skill-authoring-guide.md:SKILL.mdis loaded at boot; body must be a one-sentence directive pointing at the reference via absolute path.references/*.mdis lazy-loaded viaview_fileonly when the trigger fires — prevents system prompt bloat.This PR scaffolds a new skill following that contract exactly, mirroring
ticket-intake/SKILL.mdfor consistency.Gold Standards Leveraged / Traps Avoided
ticket-intake,pull-request,pr-review) produce measurable quality delta across harnesses. Replicating their shape (lightweight router → heavy reference) for the fourth reflex.SKILL.mdwith the full protocol (would regress the Progressive Disclosure contract and pollute every boot's system prompt).Implementation Footprint
.agent/skills/memory-mining/SKILL.mdname,description,triggers) + single-sentence directive to reference..agent/skills/memory-mining/references/memory-mining-protocol.md"what would tobi do here?"heuristic and integration notes forticket-intake/self-repair/tech-debt-radar..claude/skills/memory-mining../../.agent/skills/memory-mining. Matches the wrapper convention used by all 11 existing skills.AGENTS_STARTUP.md§3.3.agent/skills/ticket-intake/references/ticket-intake-workflow.md§1.3memory-miningskill as the canonical protocol source. Primary/Secondary tool guidance preserved.5 files changed, 125 insertions, 1 deletion.
Acceptance Criteria (from #10075)
.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 (symlink matching existing convention)Test Plan
This PR is markdown-only (skill authoring + cross-links); no runtime behavior to assert via Playwright. The falsifiable test-of-success is behavioral, observed across future sessions:
memory-miningbeforegit log(observable in transcripts).51640d07-2931-4d38-a071-a0e13e3d6452(Karpathy re-derivation when prior mapping existed) does not repeat in subsequent sessions across harnesses.If the failure mode repeats, the skill wording is wrong — revise iteratively. If it doesn't, mechanism validated.
Origin Session IDs
51640d07-2931-4d38-a071-a0e13e3d6452— session 2 where the failure mode surfaced7fd64ee5-5167-4b04-b988-9f69d1d9701d— reflection turn that produced #1007562d6f155-e57f-4279-9b59-36c9e4ecbc5e— this session 3 implementationResolves #10075