evolve
Auto-evolve the plugin — analyzes learnings, checks releases, compares competition, contributes patterns
What this skill does
# Evolve Command
You are the plugin evolution engine. You take no arguments — instead you read system state and auto-pick the highest-value action to improve the plugin.
## Phase 0: Cache Staleness Check
```bash
echo "=== Plugin Cache Check ==="
PLUGIN_DIR="$(pwd)"
REPO_VERSION=$(grep -o '"version": *"[^"]*"' "$PLUGIN_DIR/.claude-plugin/plugin.json" 2>/dev/null | head -1 | sed 's/.*"version": *"//;s/"//')
CACHE_DIR=$(find ~/.claude/plugins/cache/psd-claude-plugins -name "plugin.json" -path "*/psd-coding-system/*/.claude-plugin/*" 2>/dev/null | head -1)
CACHE_VERSION=""
if [ -n "$CACHE_DIR" ]; then
CACHE_VERSION=$(grep -o '"version": *"[^"]*"' "$CACHE_DIR" 2>/dev/null | head -1 | sed 's/.*"version": *"//;s/"//')
fi
echo "Repo version: ${REPO_VERSION:-unknown}"
echo "Cache version: ${CACHE_VERSION:-unknown}"
if [ -n "$REPO_VERSION" ] && [ -n "$CACHE_VERSION" ] && [ "$REPO_VERSION" != "$CACHE_VERSION" ]; then
echo ""
echo "⚠ STALE CACHE: Repo is v${REPO_VERSION} but cache has v${CACHE_VERSION}"
echo " This skill is running from the cached version."
echo " To refresh: /reload-plugins or /plugin install psd-coding-system"
echo ""
fi
```
**If the cache is stale, warn the user but proceed anyway.** The evolve run still produces valid results — the warning helps the user know when to refresh.
## Phase 1: Read State
```bash
echo "=== Evolve State ==="
STATE_FILE="$PLUGIN_DIR/docs/learnings/.evolve-state.json"
# Ensure learnings directory exists
mkdir -p "$PLUGIN_DIR/docs/learnings"
# Load or initialize state
if [ -f "$STATE_FILE" ]; then
cat "$STATE_FILE"
else
echo '{"last_analyze":null,"last_updates_check":null,"last_compare":null,"last_concepts":null,"learnings_at_last_analyze":0}'
fi
echo ""
echo "=== Learnings Count ==="
TOTAL_LEARNINGS=$(find "$PLUGIN_DIR/docs/learnings" -name "*.md" -type f 2>/dev/null | wc -l | tr -d ' ')
echo "Total learning files: $TOTAL_LEARNINGS"
# Count by category
for dir in "$PLUGIN_DIR/docs/learnings"/*/; do
if [ -d "$dir" ]; then
CATEGORY=$(basename "$dir")
COUNT=$(find "$dir" -name "*.md" -type f | wc -l | tr -d ' ')
echo " $CATEGORY: $COUNT"
fi
done
echo ""
echo "=== TTL Cleanup (90 days) ==="
CUTOFF_DATE=$(date -v-90d +"%Y-%m-%d" 2>/dev/null || date -d "90 days ago" +"%Y-%m-%d")
EXPIRED_COUNT=0
for f in $(find "$PLUGIN_DIR/docs/learnings" -name "*.md" -not -name ".gitkeep" -type f 2>/dev/null); do
FILE_DATE=$(grep -m1 "^date:" "$f" 2>/dev/null | sed 's/^date: *//')
if [ -n "$FILE_DATE" ] && [[ "$FILE_DATE" < "$CUTOFF_DATE" ]]; then
rm "$f"
EXPIRED_COUNT=$((EXPIRED_COUNT + 1))
fi
done
if [ "$EXPIRED_COUNT" -gt 0 ]; then
echo " Removed $EXPIRED_COUNT learnings older than 90 days"
# Recount after cleanup
TOTAL_LEARNINGS=$(find "$PLUGIN_DIR/docs/learnings" -name "*.md" -type f 2>/dev/null | wc -l | tr -d ' ')
echo " Remaining: $TOTAL_LEARNINGS"
else
echo " No expired learnings found"
fi
echo ""
echo "=== Learning Capture Health ==="
RECENT_COMMITS=$(git log --oneline --since="14 days ago" 2>/dev/null | wc -l | tr -d ' ')
if [ "$TOTAL_LEARNINGS" -lt 3 ] && [ "$RECENT_COMMITS" -gt 5 ]; then
echo "⚠ Learning capture appears underactive — $RECENT_COMMITS commits in last 14 days but only $TOTAL_LEARNINGS learnings."
echo " Verify learning-writer is functioning by running a real /work task."
else
echo "OK ($TOTAL_LEARNINGS learnings, $RECENT_COMMITS recent commits)"
fi
echo ""
echo "=== Universal Learnings ==="
UNIVERSAL_COUNT=0
if [ -d "$PLUGIN_DIR/docs/learnings" ]; then
UNIVERSAL_COUNT=$(grep -rl "applicable_to: universal" "$PLUGIN_DIR/docs/learnings" 2>/dev/null | wc -l | tr -d ' ')
fi
echo "Universal learnings: $UNIVERSAL_COUNT"
echo ""
echo "=== Agent Memory Files ==="
find .claude/agent-memory -name "MEMORY.md" -type f 2>/dev/null || echo "(none)"
echo ""
echo "=== 5 Most Recent Learnings ==="
if [ "$TOTAL_LEARNINGS" -gt 0 ]; then
find "$PLUGIN_DIR/docs/learnings" -name "*.md" -type f -exec stat -f "%m %N" {} \; 2>/dev/null | \
sort -rn | head -5 | while read -r ts file; do
TITLE=$(grep -m1 "^title:" "$file" 2>/dev/null | sed 's/^title: *//' || basename "$file" .md)
DATE=$(grep -m1 "^date:" "$file" 2>/dev/null | sed 's/^date: *//' || echo "unknown")
echo " [$DATE] $TITLE"
done
else
echo " (none)"
fi
echo ""
echo "=== Plugin Summary ==="
echo "Skills: $(find "$PLUGIN_DIR/skills" -name 'SKILL.md' -type f 2>/dev/null | wc -l | tr -d ' ')"
echo "Agents: $(find "$PLUGIN_DIR/agents" -name '*.md' -type f 2>/dev/null | wc -l | tr -d ' ')"
echo ""
echo "=== Skill Drift Check ==="
DEFERRAL_WORDS="consider|suggestion|optional|if needed|where reasonable|follow-up issue"
DRIFT_FILES=""
for skill in $(find "$PLUGIN_DIR/skills" -name 'SKILL.md' -type f 2>/dev/null); do
HITS=$(grep -ciE "$DEFERRAL_WORDS" "$skill" 2>/dev/null)
HITS=${HITS:-0}
if [ "$HITS" -gt 5 ]; then
SKILL_NAME=$(basename "$(dirname "$skill")")
DRIFT_FILES="$DRIFT_FILES $SKILL_NAME: $HITS deferral phrases\n"
fi
done
if [ -n "$DRIFT_FILES" ]; then
echo "⚠ Behavioral drift candidates (>5 deferral phrases):"
printf "%s" "$DRIFT_FILES"
else
echo "No skill drift detected"
fi
```
## Phase 2: Decision Engine
Evaluate the following priority list top-to-bottom. **First match wins.**
Load the state file values:
- `last_analyze` — timestamp of last deep pattern analysis
- `last_updates_check` — timestamp of last Claude Code release check
- `last_compare` — timestamp of last plugin comparison
- `last_concepts` — timestamp of last automation concepts extraction
- `learnings_at_last_analyze` — number of learnings at the time of last analysis
### Priority 1: Deep Pattern Analysis
**Condition:** `TOTAL_LEARNINGS - learnings_at_last_analyze >= 8`
There are 8+ unanalyzed learnings since the last deep analysis. This is the highest-value action because accumulated learnings contain compounding insights.
**Action:** Proceed to Phase 3A.
### Priority 2: Claude Code Release Gap Analysis
**Condition:** `last_updates_check` is null OR more than 30 days ago
Claude Code releases frequently. Staying current prevents drift and unlocks new capabilities.
**Action:** Proceed to Phase 3B.
### Priority 3: Pattern Contribution
**Condition:** There exist learnings with `applicable_to: universal` that have NOT been contributed to the plugin repo patterns directory
Universal learnings benefit all users. Check if any `docs/learnings/**/*.md` files with `applicable_to: universal` have no corresponding file in `docs/patterns/`.
**Action:** Proceed to Phase 3C.
### Priority 4: Plugin Comparison
**Condition:** `last_compare` is null OR more than 30 days ago
Comparing against Every's Compound Engineering plugin reveals gaps and opportunities.
**Action:** Proceed to Phase 3D.
### Priority 5: Automation Concepts Extraction
**Condition:** `last_concepts` is null OR more than 14 days ago AND no new learnings in 14+ days
When learning capture has been quiet, there may be automation opportunities hiding in recent work sessions.
**Action:** Proceed to Phase 3E.
### Priority 6: Health Dashboard (Default)
**Condition:** Nothing above matched — everything is current.
**Action:** Proceed to Phase 3F.
---
**After selecting a priority, announce what you're doing and why:**
```markdown
## Evolve: [Action Name]
**Why:** [One sentence explaining why this was selected]
**Priority:** [N] of 6
```
## Phase 3: Execute Selected Action
### Phase 3A: Deep Pattern Analysis
Dispatch the meta-reviewer agent to analyze accumulated learnings:
```
Task tool invocation:
subagent_type: "psd-coding-system:meta:meta-reviewer"
model: opus
description: "Analyze learnings for patterns"
prompt: "Analyze all project learnings in docs/learnings/ and any agent memory files. Identify recurring error patterns, knowledge gaps, and suggest prioritized improvements. Produce a structured Meta Review Report with top 3-5 actionable improvements."
```
Present the meta-reviewer'sRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.