skills/improve/SKILL.md
Full system improvement — mines recent sessions for missed insights, audits memory architecture, performs hygiene cleanup, removes stale content, fixes cross-references, and optimizes the EA system. Use when the user says "improve", "clean up", "audit", or "optimize the system".
npx skillsauth add EqualsGroup/claude-executive-assistant improveInstall 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.
Phase 1: Read (main agent, parallel reads)
│
├── Extract session messages since last improve (main agent, bash)
│
▼
Phase 2: Analyze (7 parallel subagents — all research-only, no file edits)
│
├── Subagent 1: Session Mining — Decisions & Context
├── Subagent 2: Session Mining — Missed Work Items
├── Subagent 3: Session Mining — People & Relationships
├── Subagent 4: Session Mining — Workflow Patterns
├── Subagent 5: Architecture Review (structure, context budget, CLAUDE.md, skills, sync sources)
├── Subagent 6: Hygiene Audit (completed items, duplication, stale content, reference integrity)
└── Subagent 7: Outputs Cleanup (digest unique content from outputs/ into memory, then delete)
│
▼
Phase 3: Apply (main agent — consolidates all subagent findings, applies tiered changes)
│
▼
Phase 4: Report + timestamp (main agent — structured summary, update last-improve marker)
Why this shape: Phase 2's seven concerns are independent — they read the same inputs but look for different things. Running them in parallel cuts wall-clock time vs sequential. The main agent handles file reads (Phase 1), session extraction (bash), and all file edits (Phase 3) to avoid conflicts.
Step 1 — Read all files in parallel:
Read everything from $EA_ROOT/:
memory/CLAUDE.mdsync/sources.mdoutputs/skills/ directory)Step 2 — Extract session messages since last improve:
Check when /improve was last run — the timestamp is on line 1 of $EA_ROOT/CLAUDE.md:
head -1 $EA_ROOT/CLAUDE.md | grep -oE '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}Z' || echo "never"
The format is *Last improved: 2026-03-17T15:30Z*. If no timestamp found, default to 7 days ago.
Session history is stored differently depending on the environment. Search all available locations and combine results:
Location 1 — Claude Code (~/.claude/projects/):
Sessions are stored per-project, keyed by the encoded working directory (non-alphanumeric chars replaced with -). Since the EA plugin can be active in any project, search all recent session files across all projects.
Location 2 — Cowork / Claude Desktop (~/Library/Application Support/Claude/):
Sessions are stored under claude-code-sessions/ (current) or local-agent-mode-sessions/ (legacy), grouped by account/org rather than project.
Search both locations, use whichever exist:
LAST_IMPROVE=$(head -1 $EA_ROOT/CLAUDE.md | grep -oE '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}Z' || echo "")
if [ -z "$LAST_IMPROVE" ]; then
DAYS_AGO=7
else
IMPROVE_DATE=$(echo "$LAST_IMPROVE" | grep -oE '[0-9]{4}-[0-9]{2}-[0-9]{2}')
IMPROVE_EPOCH=$(date -d "$IMPROVE_DATE" +%s 2>/dev/null || date -j -f "%Y-%m-%d" "$IMPROVE_DATE" +%s 2>/dev/null || echo "")
NOW_EPOCH=$(date +%s)
if [ -n "$IMPROVE_EPOCH" ]; then
DAYS_AGO=$(( (NOW_EPOCH - IMPROVE_EPOCH) / 86400 + 1 ))
else
DAYS_AGO=7
fi
fi
# Claude Code sessions
find ~/.claude/projects/ -name "*.jsonl" -mtime -"$DAYS_AGO" 2>/dev/null | head -20
# Cowork / Claude Desktop sessions (current location)
find ~/Library/Application\ Support/Claude/claude-code-sessions/ -name "*.jsonl" -mtime -"$DAYS_AGO" 2>/dev/null | head -20
# Cowork / Claude Desktop sessions (legacy location)
find ~/Library/Application\ Support/Claude/local-agent-mode-sessions/ -name "*.jsonl" -mtime -"$DAYS_AGO" 2>/dev/null | head -20
Combine all results. Filter to EA sessions only — most session files won't be EA-related. For each candidate file, do a quick check before full parsing:
grep -l "EA_ROOT" "$file" 2>/dev/null
Only process files that contain EA_ROOT — this confirms the EA plugin was active in that session. Discard the rest.
If no EA session files are found in any location, skip session mining entirely — the architecture/hygiene subagents (5, 6, 7) don't need session data and should still run.
For each matching session file (skip any >10MB), try multiple extraction patterns since the JSONL schema varies:
# Try both "human" and "user" type fields, and handle both string and array message formats
jq -r 'select(.type == "user" or .type == "human") | .message |
if type == "string" then .
elif type == "object" then (.content // empty) | if type == "string" then . elif type == "array" then .[] | select(.type == "text") | .text else empty end
elif type == "array" then .[] | select(.type == "text") | .text
else empty end' "$file" 2>/dev/null | head -200
Filter out noise: skip lines starting with < (XML tags), [ or { (JSON tool results), and lines >500 characters (skill expansions). Focus on short, direct user messages.
Collect all extracted user messages. Note the filename (which contains a timestamp/ID) so subagents can reference session dates.
If session extraction partially fails (some files unreadable, jq errors, empty results), proceed with whatever data was extracted. Note which sessions failed in the Phase 4 report. The architecture/hygiene subagents (5, 6, 7) don't need session data and should always run regardless.
Step 3 — Prepare subagent payloads: Each subagent needs: the extracted user messages + the relevant memory file contents. Compose these as part of each subagent's prompt. Pass the content directly — subagents should NOT need to re-read files or re-extract sessions.
Launch all 7 subagents simultaneously. Each is research-only — returns structured findings, edits nothing.
Input: All user messages + all memory file contents Task:
Input: All user messages + my-work.md content
Task:
my-work.md Master List (all tiers)Input: All user messages + all person files from memory/people/ + dynamics.md content
Task:
Input: All user messages + all skill file contents Task:
Input: All memory file contents + CLAUDE.md + sync/sources.md + all skill files + session message summaries (topic frequency, not full text) Task:
Input: All memory file contents Task:
[x], "done"/"resolved"/"completed"/"shipped"/"delivered"/"merged"/"closed"/"landed", ~~strikethrough~~. For each, note if win-worthy.Input: List of all files in $EA_ROOT/outputs/ directory + all memory file contents
Task:
outputs/ (meeting preps, proposals, assessments, announcements, transcripts, etc.):
Consolidate all 7 subagent results. Apply in three tiers:
*See [file].md for details.*)Present as a single list for user to approve/reject:
my-work.md (from session mining)Update the last-improve marker on line 1 of $EA_ROOT/CLAUDE.md at the end of a successful run:
NEW_TS=$(date -u +%Y-%m-%dT%H:%MZ)
Then edit line 1 of $EA_ROOT/CLAUDE.md to: *Last improved: $NEW_TS*
Report template:
## Session Insights
### Uncaptured Decisions
- [decision] — from session [id/date]. Should live in [file].
### Memory Gaps (repeated context)
- [topic] — explained in [N] sessions. Suggests missing/thin coverage in [file].
### Missed Work Items
- [item] — mentioned in session [id/date], not in Master List.
### People Gaps
- [person] — mentioned in [N] sessions, thin/no entry.
### Skill Opportunities
- [pattern] — done manually [N] times, could be a skill.
## Architecture Findings
### Context Budget
| File | Lines | Est. Tokens | Session References | Value Density |
|------|-------|-------------|-------------------|---------------|
### Bloated Sections
- [file > section] — [N] lines, referenced [M] times.
### Missing Structure
- [topic] — discussed in [N] sessions, no home in memory.
### Stale Structure
- [file > section] — zero references in last 20 sessions.
### Context Placement
| Content | Current Location | Should Be | Reason |
|---------|-----------------|-----------|--------|
CLAUDE.md line count: [N] (target: ≤200)
Registry accuracy: [any trigger words, format headers, or descriptions that need updating]
### Skill Execution Efficiency
| Skill | Current Shape | Recommended Shape | Est. Speedup |
|-------|--------------|-------------------|--------------|
For each skill with optimisation opportunities:
- [skill] — [specific change: e.g. "Phase 2 and 3 are independent, run as parallel subagents"]
## Hygiene Changes Applied
### [filename]
- [what changed and why]
### Stats
- X completed items removed
- X duplications consolidated
- X entries filled in
- X stale items flagged
- X cross-references repaired
- X orphan tracking items flagged
## Outputs Cleanup
### Digested & Deleted
- [file] → digested [what] into [memory file > section]
### Kept (active)
- [file] — [reason]
### Stats
- X output files deleted
- X output files kept
- X memory references updated
## Proposed Changes (Tier 2 — awaiting approval)
- [change and rationale]
## Suggestions (Tier 3 — for later)
- [suggestion and rationale]
## Items Needing Input
- [anything ambiguous]
*See [file].md for details.* or *See [section] in [file].md.*tools
Compare user's data files against the current plugin scaffold to find and fix structural drift — missing sections, wrong placements, format mismatches, CLAUDE.md rule drift, stale placeholders, and directory gaps. Use when the user says "upgrade", "check for updates", "compare scaffold", or after a plugin update.
development
Sync memory files from external sources (~~documents, ~~messaging, ~~code) using parallel subagents. Use when the user says "sync", "refresh", "pull latest", or "update from sources".
testing
Interactive setup wizard — initializes the EA memory folder, fills in placeholders, and checks connector availability. Use when the user says "setup", "initialize", "get started", or when the SessionStart hook reports memory is not initialized.
testing
Review a document with full memory context, then post structured comments on specific sections. Use when the user says "review this", "look at this doc", "give me feedback on", or shares a document link for analysis.