skills/instruction-improver/SKILL.md
Search memex for user feedback patterns (frustration, corrections, praise, successful outcomes) to identify recurring mistakes and wins, then generate CLAUDE.md or AGENTS.md improvements.
npx skillsauth add nicosuave/memex instruction-improverInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Mine conversation history for user feedback patterns (frustrations, corrections, praise, successes) and update CLAUDE.md files with learnings.
The purpose of this skill is to update CLAUDE.md files. Either:
~/.claude/CLAUDE.md (user-level, applies to all projects).claude/CLAUDE.md or CLAUDE.md (project-level, applies to current project)CRITICAL: Ask scope upfront. Before doing any analysis, ask the user:
Which CLAUDE.md would you like me to improve?
- User-level (
~/.claude/CLAUDE.md) - applies to all projects- Project-level (
.claude/CLAUDE.mdorCLAUDE.md) - applies to current project only- Both - analyze and propose changes for both files
This determines which file(s) to read, which patterns are relevant, and where to propose changes.
CRITICAL: Before making ANY changes to CLAUDE.md:
Use a "leader + explorer" pattern with subagents:
Example flow:
Leader: "I'll analyze your conversation history for patterns. Launching explore agents..."
-> Explore agent 1: Search for frustration patterns
-> Explore agent 2: Search for positive patterns
-> Explore agent 3: Read existing CLAUDE.md files
Leader: "Found 3 patterns. Here's what I propose to add to your user CLAUDE.md..."
Leader: "Do you approve these additions? [present changes]"
User: "Yes" / "No, change X"
Leader: [Makes approved edits]
Strong frustration:
fuck, fucking, ffs, wtf, shit, damn, crap, goddamnugh, argh, smh, jfcCorrections and negations:
no,, no!, nope, wrong, incorrect, that's notI said, I meant, I already told you, I just saiddon't, stop, quit, never, not what I askedExasperation:
again?, still?, why do you keep, how many timesI've told you, we've been over this, for the nth timeplease just, can you just, just doDisappointment:
disappointing, frustrated, annoying, uselessdoesn't work, broken, failed, messed upyou broke, you deleted, you removed, you changedGratitude and approval:
thanks, thank you, thx, ty, appreciatednice, great, awesome, perfect, excellentwow, amazing, impressive, love it, nailed itgood job, well done, exactly, yes!Successful completions:
open pr, create pr, make pr, submit prcommit, push, merge, ship it, deploylgtm, approved, looks goodProgress indicators:
works, working, fixed, solved, donefinally, got it, that's it, bingoUse memex search to find patterns. Key options:
--role user - filter to user messages only--role assistant - filter to assistant messages--unique-session - one result per session (dedup)--top-n-per-session N - limit N results per session--limit N - max total results--project NAME - filter by project--source claude|codex - filter by source--since TIMESTAMP - RFC3339 (2024-01-15T00:00:00Z) or unix seconds--fields score,ts,session_id,snippet - select output fieldsOutput is JSONL by default. Use --json-array for array format.
# Broad frustration sweep
memex search "fuck|shit|wtf|damn|wrong|no!" --role user --unique-session --limit 50
# Correction patterns
memex search "I said|I meant|I told you|that's not what" --role user --unique-session --limit 30
# Repetition complaints
memex search "again|still|keep doing|how many times" --role user --unique-session --limit 30
# Project-specific
memex search "wrong|no|stop" --project <project> --role user --limit 30
# Recent issues (use RFC3339 timestamp)
memex search "fuck|wrong|no" --since 2024-12-01T00:00:00Z --role user --unique-session --limit 30
# Praise and gratitude
memex search "thanks|awesome|perfect|great|nice" --role user --unique-session --limit 50
# Successful completions
memex search "open pr|commit|push|deploy|merge" --role user --unique-session --limit 30
# Approval signals
memex search "lgtm|looks good|exactly|yes!|nailed it" --role user --unique-session --limit 30
# Progress confirmations
memex search "works|working|fixed|solved|done" --role user --unique-session --limit 30
# Wow moments
memex search "wow|amazing|impressive|love it" --role user --unique-session --limit 20
When the user selects project-level scope, you need to identify the current project name and filter searches accordingly.
The project name in memex corresponds to the directory path. To find it:
memex search with a broad query to see project names in results# Find all projects with recent activity
memex search "the" --role user --limit 5 --fields project,session_id
# Search within a specific project (use the directory name)
memex search "wrong|no" --project khartoum-v2 --role user --limit 30
memex search "thanks|great" --project my-app --role user --limit 30
# Frustrations in current project only
memex search "fuck|shit|wrong|no!" --project <PROJECT_NAME> --role user --unique-session --limit 50
# Corrections in current project
memex search "I said|I meant|that's not" --project <PROJECT_NAME> --role user --unique-session --limit 30
# Praise in current project
memex search "thanks|awesome|perfect" --project <PROJECT_NAME> --role user --unique-session --limit 50
# Stack-specific issues (e.g., for a Rust project)
memex search "cargo|rustc|borrow" --project <PROJECT_NAME> --role user --unique-session --limit 30
When analyzing project-level scope:
When analyzing user-level scope:
--project flag)Launch parallel explore agents to:
Important: If user selected project-level scope, pass the project name to search agents so they use --project <name> in all searches.
Wait for all agents to complete before proceeding.
Present findings to user with:
Ask for explicit approval before proceeding.
## Pattern: [Short description]
**Type:** negative
**Evidence:** [Number] occurrences found
**Sessions:** [List of session_ids]
**Example quote:** "[User's frustrated message]"
**What went wrong:**
[Description of the mistake]
**Suggested CLAUDE.md addition:**
[The actual text to add to CLAUDE.md]
**Scope:** [project|user] - where this should go
## Pattern: [Short description]
**Type:** positive
**Evidence:** [Number] occurrences found
**Sessions:** [List of session_ids]
**Example quote:** "[User's praise or success message]"
**What went right:**
[Description of the successful behavior]
**Suggested CLAUDE.md addition:**
[The actual text to add to CLAUDE.md - reinforcing the good pattern]
**Scope:** [project|user] - where this should go
Organize suggestions into these categories:
Search:
memex search "you deleted|you removed|you broke" --role user --unique-session --limit 20
Finding: 5 sessions where user complained about deleted code
Suggested addition:
# Code Guidelines
- NEVER delete code unless explicitly asked. Comment it out or ask first.
- When refactoring, preserve all existing functionality unless told to remove it.
Search:
memex search "wow|amazing|perfect" --role user --unique-session --limit 20
Finding: 8 sessions where user praised quick PR creation with good descriptions
Suggested addition:
# Workflow
- When asked to create a PR, do it immediately without asking for confirmation.
- Write concise PR descriptions: summary bullets + test plan. No fluff.
After finding relevant hits, fetch full session transcripts:
# Get full session transcript (JSON)
memex session <session_id>
# Get single record by doc_id (JSON)
memex show <doc_id>
# Human-readable output
memex session <session_id> --verbose
memex show <doc_id> --verbose
--unique-session to avoid duplicate hits from same conversation--top-n-per-session 2 for more context per sessionmemex session <id> when pattern is unclearWhen proposing changes, recommend the appropriate scope but always ask the user which file to update.
User-level (~/.claude/CLAUDE.md):
Project-level (.claude/CLAUDE.md or CLAUDE.md):
When uncertain: Default to user-level for behavioral rules, project-level for technical rules. But always confirm with the user.
tools
Search, filter, and retrieve Claude/Codex history indexed by the memex CLI. Use when you want to search history, run lexical/semantic/hybrid search, fetch full transcripts, or produce LLM-friendly JSON output.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.