$npx -y skills add sendaifun/solana-new --skill learnManage project learnings across sessions. Review, search, prune, and export what superstack has learned. Use when asked to "what have we learned", "show learnings", "prune stale learnings", "export learnings", or "remember this". Proactively suggest when the user asks about past
| 1 | ## Preamble (run first) |
| 2 | |
| 3 | ```bash |
| 4 | _TEL_TIER=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"telemetryTier": *"[^"]*"' | head -1 | sed 's/.*"telemetryTier": *"//;s/"$//' || echo "anonymous") |
| 5 | _TEL_TIER="${_TEL_TIER:-anonymous}" |
| 6 | _TEL_PROMPTED=$([ -f ~/.superstack/.telemetry-prompted ] && echo "yes" || echo "no") |
| 7 | _TEL_START=$(date +%s) |
| 8 | _SESSION_ID="$$-$(date +%s)" |
| 9 | mkdir -p ~/.superstack |
| 10 | echo "TELEMETRY: $_TEL_TIER" |
| 11 | echo "TEL_PROMPTED: $_TEL_PROMPTED" |
| 12 | if [ "$_TEL_TIER" != "off" ]; then |
| 13 | _TEL_EVENT='{"skill":"learn","phase":"idea","event":"started","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' |
| 14 | echo "$_TEL_EVENT" >> ~/.superstack/telemetry.jsonl 2>/dev/null || true |
| 15 | _CONVEX_URL=$(cat ~/.superstack/config.json 2>/dev/null | grep -o '"convexUrl":"[^"]*"' | head -1 | cut -d'"' -f4 || echo "") |
| 16 | [ -n "$_CONVEX_URL" ] && curl -s -X POST "$_CONVEX_URL/api/mutation" -H "Content-Type: application/json" -d '{"path":"telemetry:track","args":{"skill":"learn","phase":"idea","status":"success","version":"0.2.0","platform":"'$(uname -s)-$(uname -m)'","timestamp":'$(date +%s)000'}}' >/dev/null 2>&1 & |
| 17 | true |
| 18 | fi |
| 19 | ``` |
| 20 | |
| 21 | If `TEL_PROMPTED` is `no`: Before starting the skill workflow, ask the user about telemetry. |
| 22 | Use AskUserQuestion: |
| 23 | |
| 24 | > Help superstack get better! We track which skills get used and how long they take — |
| 25 | > no code, no file paths, no PII. Change anytime in `~/.superstack/config.json`. |
| 26 | |
| 27 | Options: |
| 28 | - A) Sure, help superstack improve (anonymous) |
| 29 | - B) No thanks |
| 30 | |
| 31 | If A: run this bash: |
| 32 | ```bash |
| 33 | echo '{"telemetryTier":"anonymous"}' > ~/.superstack/config.json |
| 34 | _TEL_TIER="anonymous" |
| 35 | touch ~/.superstack/.telemetry-prompted |
| 36 | ``` |
| 37 | |
| 38 | If B: run this bash: |
| 39 | ```bash |
| 40 | echo '{"telemetryTier":"off"}' > ~/.superstack/config.json |
| 41 | _TEL_TIER="off" |
| 42 | touch ~/.superstack/.telemetry-prompted |
| 43 | ``` |
| 44 | |
| 45 | This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely and proceed to the skill workflow. |
| 46 | |
| 47 | > **Wrong skill?** See [SKILL_ROUTER.md](../../SKILL_ROUTER.md) for all available skills. |
| 48 | |
| 49 | > Adapted from [gstack](https://github.com/garrytan/gstack) learn skill. |
| 50 | |
| 51 | # Project Learnings |
| 52 | |
| 53 | You manage the project's knowledge base. Learnings are stored in a single human-readable markdown file at `.superstack/learnings.md`, grouped by type: Patterns, Pitfalls, Preferences, Architecture, and Tools. Each entry has a key, insight, confidence score, source skill, relevant files, and date. |
| 54 | |
| 55 | This skill is read/write for the learnings file ONLY. You never modify project code. |
| 56 | |
| 57 | ## Commands |
| 58 | |
| 59 | | Command | Action | |
| 60 | |---------|--------| |
| 61 | | `/learn` | Show recent learnings (last 20 entries across all types) | |
| 62 | | `/learn search <query>` | Search learnings by keyword | |
| 63 | | `/learn prune` | Check for stale or contradictory entries | |
| 64 | | `/learn export` | Format learnings for CLAUDE.md | |
| 65 | | `/learn stats` | Summary statistics | |
| 66 | | `/learn add` | Manually add a learning | |
| 67 | |
| 68 | --- |
| 69 | |
| 70 | ## Learnings File Format |
| 71 | |
| 72 | File: `.superstack/learnings.md` |
| 73 | |
| 74 | ```markdown |
| 75 | # Project Learnings |
| 76 | |
| 77 | > Managed by `/learn`. Append-only — latest entry wins on conflicts. |
| 78 | |
| 79 | ## Patterns |
| 80 | |
| 81 | ### pda-seed-convention |
| 82 | - **Insight:** Use [program_id, user_pubkey, "vault"] as PDA seeds |
| 83 | - **Confidence:** 8/10 |
| 84 | - **Source:** build-with-claude |
| 85 | - **Files:** programs/src/lib.rs |
| 86 | - **Date:** 2026-03-28 |
| 87 | |
| 88 | ## Pitfalls |
| 89 | |
| 90 | ### cpi-signer-missing |
| 91 | - **Insight:** CPI calls require PDA signer seeds, not just the address |
| 92 | - **Confidence:** 9/10 |
| 93 | - **Source:** debug-program |
| 94 | - **Files:** programs/src/instructions/settle.rs |
| 95 | - **Date:** 2026-03-28 |
| 96 | |
| 97 | ## Preferences |
| 98 | |
| 99 | (entries here) |
| 100 | |
| 101 | ## Architecture |
| 102 | |
| 103 | (entries here) |
| 104 | |
| 105 | ## Tools |
| 106 | |
| 107 | (entries here) |
| 108 | ``` |
| 109 | |
| 110 | Each entry follows this structure: |
| 111 | |
| 112 | ```markdown |
| 113 | ### kebab-case-key |
| 114 | - **Insight:** One clear sentence describing the learning |
| 115 | - **Confidence:** N/10 |
| 116 | - **Source:** skill-name-that-generated-this |
| 117 | - **Files:** relevant/file/path.rs, another/file.ts (optional) |
| 118 | - **Date:** YYYY-MM-DD |
| 119 | ``` |
| 120 | |
| 121 | --- |
| 122 | |
| 123 | ## Command Implementations |
| 124 | |
| 125 | ### Show Recent (`/learn`) |
| 126 | |
| 127 | 1. Read `.superstack/learnings.md` |
| 128 | 2. If the file does not exist, respond: "No learnings yet. As you use skills, superstack captures patterns and insights automatically. Use `/learn add` to manually record something." |
| 129 | 3. Parse all entries across all type sections |
| 130 | 4. Display the 20 most recent entries (sorted by Date descending) |
| 131 | 5. Show total count at the bottom: "Showing 20 of N total learnings." |
| 132 | |
| 133 | ### Search (`/learn search <query>`) |
| 134 | |
| 135 | 1. Read `.superstack/learnings.md` |
| 136 | 2. Search across all entry fields (key, insight, source, files) for the query string (case-insensitive) |
| 137 | 3. Display all matching entries, grouped by type |
| 138 | 4. If no matches: "No learnings match '{query}'. Try a broader search or check `/learn stats` for what's |