meridian-dev 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/BOOTSTRAP_PROMPT.md +110 -0
  2. package/README.md +344 -0
  3. package/backup/hooks/session-end.sh +44 -0
  4. package/backup/hooks/session-start.sh +37 -0
  5. package/backup/setup.sh +156 -0
  6. package/bin/meridian.js +100 -0
  7. package/doctor.sh +173 -0
  8. package/install.sh +62 -0
  9. package/journal-summary.sh +577 -0
  10. package/package.json +42 -0
  11. package/setup.sh +407 -0
  12. package/specializations/claude-code/CLAUDE.md-global-fragment.md +52 -0
  13. package/specializations/claude-code/CLAUDE.md-repo-fragment.md +16 -0
  14. package/specializations/claude-code/README.md +96 -0
  15. package/specializations/claude-code/commands/doctor.md +31 -0
  16. package/specializations/claude-code/commands/init-memory.md +127 -0
  17. package/specializations/claude-code/commands/init-team.md +335 -0
  18. package/specializations/claude-code/commands/journal.md +66 -0
  19. package/specializations/claude-code/hooks/check-global-state.sh +68 -0
  20. package/specializations/claude-code/settings.json +10 -0
  21. package/specializations/cursor/README.md +112 -0
  22. package/specializations/cursor/global-rule.mdc +53 -0
  23. package/specializations/cursor/repo-rule.mdc +25 -0
  24. package/specializations/generic/README.md +47 -0
  25. package/templates/global.md +73 -0
  26. package/templates/memory-file.md +18 -0
  27. package/templates/personal-state.md +14 -0
  28. package/templates/product-state.md +39 -0
  29. package/templates/repo-state.md +18 -0
  30. package/templates/session-protocol-fragment.md +46 -0
  31. package/templates/strategy-state.md +37 -0
  32. package/templates/team-state.md +29 -0
  33. package/uninstall.sh +85 -0
@@ -0,0 +1,112 @@
1
+ # Cursor Integration — Skip Tissue
2
+
3
+ Full setup guide for Cursor users.
4
+
5
+ ## Quick Setup
6
+
7
+ Run the main installer and choose Cursor when prompted:
8
+ ```bash
9
+ bash setup.sh --tool cursor
10
+ ```
11
+
12
+ Or manually follow the steps below.
13
+
14
+ ## How It Works
15
+
16
+ Cursor injects rule files into the AI context at session start. The memory kit hooks into this system to load your state files automatically.
17
+
18
+ ### Memory Directory
19
+
20
+ The Cursor specialization uses `~/.ai-memory/` as the memory root (tool-agnostic, not tied to Cursor's config location):
21
+
22
+ ```
23
+ ~/.ai-memory/
24
+ global.md # Always loaded — thin index of all state
25
+ state.md # Admin/non-repo work
26
+ memory/
27
+ <topic>.md # Loaded on demand
28
+ journal/
29
+ YYYY-MM-DD.md # Daily session log
30
+ ```
31
+
32
+ ### Per-Repo Files
33
+
34
+ ```
35
+ <repo>/.cursor/
36
+ rules/
37
+ memory.mdc # Repo-level memory rules (committed to git)
38
+ ```
39
+
40
+ ### Session Flow
41
+
42
+ **Session start:** Cursor reads `.cursor/rules/memory.mdc` → AI loads `~/.ai-memory/global.md` + repo state
43
+
44
+ **Session end (manual):** Say "done for today, update state files" — the AI updates the state files and appends a journal entry
45
+
46
+ ## Setup
47
+
48
+ ### Step 1: Memory directory
49
+
50
+ ```bash
51
+ mkdir -p ~/.ai-memory/memory/journal
52
+ ```
53
+
54
+ ### Step 2: Global index
55
+
56
+ ```bash
57
+ cp templates/global.md ~/.ai-memory/global.md
58
+ # Edit with your preferences, projects, team context
59
+ ```
60
+
61
+ ### Step 3: Global Cursor rules
62
+
63
+ Cursor supports global rules in `~/.cursor/rules/`. Create the memory rule:
64
+
65
+ ```bash
66
+ mkdir -p ~/.cursor/rules
67
+ cp specializations/cursor/global-rule.mdc ~/.cursor/rules/ai-memory.mdc
68
+ ```
69
+
70
+ ### Step 4: Initialize a repo
71
+
72
+ In any repo you work in with Cursor, run:
73
+
74
+ ```bash
75
+ bash setup.sh --tool cursor --repo .
76
+ # Or manually:
77
+ mkdir -p .cursor/rules
78
+ cp specializations/cursor/repo-rule.mdc .cursor/rules/memory.mdc
79
+ ```
80
+
81
+ Edit `.cursor/rules/memory.mdc` to reflect the repo name and what it's about.
82
+
83
+ ### Step 5: Fill in your global index
84
+
85
+ Open `~/.ai-memory/global.md` and fill in:
86
+ - Your preferences and working style
87
+ - Active projects table
88
+ - Team context (using the examples as a guide)
89
+
90
+ ## Session End Triggers
91
+
92
+ Since Cursor has no native hooks, use these natural language triggers to end a session:
93
+
94
+ - "done for today" — triggers state file updates + journal entry
95
+ - "stop, update memory" — same
96
+ - "save session state" — same
97
+
98
+ The rule file instructs the AI to perform all updates when it hears these phrases.
99
+
100
+ ## What Gets Committed
101
+
102
+ - `.cursor/rules/memory.mdc` — **commit this** (shared context for any AI tool that reads the repo)
103
+ - `~/.ai-memory/` files — **never commit** (personal memory, lives outside the repo)
104
+
105
+ ## Limitations vs. Claude Code
106
+
107
+ | Feature | Claude Code | Cursor |
108
+ |---------|------------|--------|
109
+ | Auto session-start | ✓ Hook fires automatically | ✓ Rule file injected automatically |
110
+ | Auto session-end | ✓ Hook triggers on stop | ✗ Manual trigger required |
111
+ | `/init-memory` command | ✓ | ✗ Use `setup.sh --tool cursor --repo .` |
112
+ | Global memory path | `~/.claude/` | `~/.ai-memory/` |
@@ -0,0 +1,53 @@
1
+ ---
2
+ description: Skip Tissue — Session Protocol (Global)
3
+ alwaysApply: true
4
+ ---
5
+
6
+ ## Session State Protocol
7
+
8
+ **Memory system:** Hierarchical plain-markdown files at `~/.ai-memory/`. No CLI tools, no databases.
9
+
10
+ ### File Hierarchy
11
+
12
+ ```
13
+ ~/.ai-memory/
14
+ global.md # Thin index — ALWAYS load at session start
15
+ state.md # Admin/non-repo work
16
+ memory/ # Topic files — load on demand
17
+ <topic>.md
18
+ journal/YYYY-MM-DD.md # Daily log
19
+ ```
20
+
21
+ ### Session Start (REQUIRED)
22
+
23
+ 1. Read `~/.ai-memory/global.md`
24
+ 2. Read `.cursor/rules/memory.mdc` in the current repo for repo-specific context
25
+ 3. Check the Memory Files table in `global.md` — load any `~/.ai-memory/memory/` files whose keywords match this session's topic
26
+ 4. Summarize current state, then ask: **"What's the goal for this session? What does success look like?"**
27
+
28
+ ### Mid-Session
29
+
30
+ If work drifts from the stated goal, flag it: *"Quick check — we set out to [goal]. This feels like [tangent]. Stay the course or pivot?"*
31
+
32
+ ### Session End Triggers
33
+
34
+ When the user says "done", "stop", "done for today", "save session state", or "update memory":
35
+
36
+ 1. Update `<repo>/.cursor/rules/memory.mdc` with current branch, status, next steps
37
+ 2. Update the Active Projects row in `~/.ai-memory/global.md`
38
+ 3. Create/update topic files in `~/.ai-memory/memory/` for significant new cross-repo context
39
+ 4. Append to `~/.ai-memory/memory/journal/YYYY-MM-DD.md`:
40
+ ```
41
+ ## [Repo] — [Title]
42
+ **Why:** [Stated goal]
43
+ **What:** [What was done]
44
+ **Outcome:** [Did we hit it?]
45
+ **On track?:** [Focused or drift?]
46
+ **Lessons:** [Cross-session learnings]
47
+ ```
48
+ 5. Confirm: **"State saved. Say 'let's continue' next time."**
49
+
50
+ ### Rules
51
+
52
+ - Keep `global.md` under 80 lines. Detail goes in `~/.ai-memory/memory/` files.
53
+ - Do NOT use any CLI memory tools — plain markdown files only.
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: Skip Tissue — Repo State ([REPO_NAME])
3
+ alwaysApply: true
4
+ ---
5
+
6
+ ## Repo State: [REPO_NAME]
7
+
8
+ Last updated: YYYY-MM-DD
9
+
10
+ ### Current Branch
11
+ [branch]
12
+
13
+ ### Current Status
14
+ [what's happening in this repo]
15
+
16
+ ### What's Next
17
+ [concrete next action]
18
+
19
+ ### Gotchas
20
+ [anything to know before diving in]
21
+
22
+ ---
23
+
24
+ *This file is maintained by the AI. Update it at session end.*
25
+ *Global memory lives at `~/.ai-memory/global.md`.*
@@ -0,0 +1,47 @@
1
+ # Generic Specialization
2
+ ## Any AI Tool with System Prompt Support
3
+
4
+ If your tool doesn't have a file-based instruction system, you can still use this kit by pasting the session protocol into your system prompt or the beginning of each conversation.
5
+
6
+ ## Option 1: System Prompt Injection
7
+
8
+ Paste the contents of `../../templates/session-protocol-fragment.md` into your tool's system prompt field. Adjust the memory directory path from `~/.ai-memory/` to wherever you want to store the files.
9
+
10
+ ## Option 2: Conversation Starter
11
+
12
+ If your tool has no persistent system prompt, start each session with:
13
+
14
+ ```
15
+ Before we begin: read ~/.ai-memory/global.md and .ai-memory/state.md in this repo.
16
+ Summarize where we left off, then ask what the goal is for this session.
17
+ ```
18
+
19
+ ## Memory Directory
20
+
21
+ Use `~/.ai-memory/` as a tool-neutral memory root:
22
+
23
+ ```bash
24
+ mkdir -p ~/.ai-memory/memory/journal
25
+ cp ../../templates/global.md ~/.ai-memory/global.md
26
+ ```
27
+
28
+ ## Session End
29
+
30
+ Since there are no hooks, you must explicitly trigger the state update:
31
+
32
+ > "We're done for today. Please update the state files."
33
+
34
+ The AI will update `.ai-memory/state.md`, `~/.ai-memory/global.md`, and append to the journal.
35
+
36
+ ## Limitations
37
+
38
+ - No automatic session-start file loading (must be in system prompt or triggered manually)
39
+ - No hook support for automation
40
+ - No custom commands
41
+
42
+ ## What Still Works
43
+
44
+ - All the file templates
45
+ - The protocol itself (session goals, drift checks, journal)
46
+ - Topic memory files
47
+ - Cross-session continuity (as long as the AI reads the files)
@@ -0,0 +1,73 @@
1
+ # Global State — Index
2
+
3
+ Last updated: YYYY-MM-DD
4
+
5
+ ## Preferences
6
+
7
+ ### Working style
8
+ - [Communication tone — e.g. "direct, no filler, skip pleasantries"]
9
+ - [Draft preference — e.g. "draft all external comms to me first; flag what to leave OUT"]
10
+ - [Review step — e.g. "I review important comms with [name] before sending — always include that step"]
11
+
12
+ ### Technical preferences
13
+ - [Tool/language defaults — e.g. "always TypeScript strict mode"]
14
+ - [Commit style — e.g. "imperative mood, explain why not what"]
15
+ - [Build/deploy habits — e.g. "never touch production before local repro"]
16
+
17
+ ### Team context
18
+ <!--
19
+ This section is where the real leverage lives. Record relationship dynamics so the AI
20
+ handles people correctly without being re-briefed every session. Examples:
21
+
22
+ - "Sarah (Design): prefers async feedback via Figma, not Slack. 24h heads-up for scope changes."
23
+ - "Jordan (co-founder): peer, not a report. Keep informed; Jordan manages their own workload."
24
+ - "Engineering team: mostly PST, decisions async in Notion."
25
+ -->
26
+ - [Name (role): key dynamic, communication preference, anything the AI should know]
27
+
28
+ ### Decision frameworks
29
+ <!--
30
+ Record how you actually think about recurring decision types. Examples:
31
+
32
+ - "Pricing questions: always segment paid vs. free before drawing conclusions."
33
+ - "Build vs. buy: default buy for non-core infra unless vendor creates lock-in risk."
34
+ - "Vendor disputes: frame in writing first, negotiate specifics live."
35
+ -->
36
+ - [Decision type: your default approach or framework]
37
+
38
+ ## Active Projects
39
+
40
+ | Project | Repo | Status | Next |
41
+ |---------|------|--------|------|
42
+ | Example Project | ~/repos/org/repo | Brief current status | Concrete next action |
43
+
44
+ ## Memory Files (load on demand)
45
+
46
+ Load these from `~/.ai-memory/memory/` when the session topic matches:
47
+
48
+ | File | When to load | Summary |
49
+ |------|-------------|---------|
50
+ | `example-topic.md` | Keywords that trigger loading | One-line summary of what's inside |
51
+
52
+ ## State Files (per-repo)
53
+
54
+ | Location | Covers |
55
+ |----------|--------|
56
+ | `~/.ai-memory/state.md` | Admin work, non-repo tasks |
57
+ | `~/repos/org/repo/.ai-memory/state.md` | What this repo is about |
58
+
59
+ ## Session Protocol
60
+
61
+ **Start:**
62
+ 1. Read this file + the repo's `.ai-memory/state.md`
63
+ 2. Check Memory Files table — load any that match this session's topic
64
+ 3. Summarize current state, then ask: **"What's the goal for this session? What does success look like?"**
65
+
66
+ **Mid-session drift check:** If work diverges from the stated goal, flag it gently and ask whether to stay the course or pivot.
67
+
68
+ **End (on "stop" / "done" / "pause" / "tomorrow"):**
69
+ 1. Update this file's Active Projects row for the current repo
70
+ 2. Update the repo's `.ai-memory/state.md`
71
+ 3. Create/update topic memory files for any significant new cross-repo context
72
+ 4. Append to `~/.ai-memory/memory/journal/YYYY-MM-DD.md`
73
+ 5. Confirm: **"State saved. Say 'let's continue' next time."**
@@ -0,0 +1,18 @@
1
+ # [Topic Name]
2
+
3
+ > Load this file when: [keywords that indicate this context is relevant]
4
+
5
+ ## Context
6
+ [What is this? Why does it exist as a memory file?]
7
+
8
+ ## Current State
9
+ [What's the situation right now?]
10
+
11
+ ## Key Details
12
+ [The actual content — decisions, strategies, data, email threads, whatever makes this worth preserving]
13
+
14
+ ## Next Step
15
+ [What action is pending, if any]
16
+
17
+ ## History
18
+ [Brief log of how this evolved — useful for understanding why things are the way they are]
@@ -0,0 +1,14 @@
1
+ # [Repo Name] — Personal State
2
+
3
+ Last updated: YYYY-MM-DD
4
+
5
+ (This file is gitignored. It's yours — context you wouldn't want teammates reading as objective fact.)
6
+
7
+ ## My Current Focus
8
+ <!-- Your personal next steps -->
9
+
10
+ ## Personal Context
11
+ <!-- Working notes, opinions, relationship dynamics for this repo -->
12
+
13
+ ## What I'm Watching
14
+ <!-- Open questions, things to follow up on -->
@@ -0,0 +1,39 @@
1
+ # [Repo/Area] — Product State
2
+
3
+ Last updated: YYYY-MM-DD
4
+ Source: [PM name, or "relayed by [name]", or "self — wearing PM hat"]
5
+
6
+ ## What We're Building
7
+ <!-- The feature or capability in user/customer terms.
8
+ Not "API endpoint returns JSON" — "users can export their data as CSV from settings."
9
+ If this repo covers multiple features, list the active ones. -->
10
+
11
+ ## Why This, Why Now
12
+ <!-- Customer problem, strategic rationale, or business driver.
13
+ What evidence supports this priority? (customer conversations, data, strategic bet)
14
+ Link to source material if it exists (Notion doc, research, Slack thread). -->
15
+
16
+ ## Success Criteria
17
+ <!-- Observable outcomes in user or business terms. Not implementation milestones.
18
+ "Support team resolves X-type tickets without engineering help" not "function deployed."
19
+ Include how we'll measure it if possible. -->
20
+
21
+ ## Scope & Constraints
22
+ <!-- What's in. What's explicitly out. Product decisions that constrain implementation.
23
+ Include the "why" — engineers will push back on constraints they don't understand.
24
+ Example: "No batch mode in v1 — we need to validate the single-record UX first." -->
25
+
26
+ ## Open Questions
27
+ <!-- Unresolved product decisions. Engineering may add to this list during sessions
28
+ when they discover things that need PM input.
29
+ Format: Question — Who should answer — Urgency (blocking / soon / backlog) -->
30
+
31
+ ## Customer Signal
32
+ <!-- What users are saying about this area. Bugs, requests, complaints, praise.
33
+ Include source and date so the signal can be traced back.
34
+ Example: "2026-02-15 — Intercom #4521 — 'We need to export by date range, not just all'" -->
35
+
36
+ ## Decisions Log
37
+ <!-- Product decisions that have been made, with date and rationale. Prevents re-litigating.
38
+ Format: YYYY-MM-DD — Decision — Rationale
39
+ Example: "2026-02-10 — CSV only, no Excel — 80% of users import into Google Sheets anyway" -->
@@ -0,0 +1,18 @@
1
+ # [Repo Name] — Project State
2
+
3
+ Last updated: YYYY-MM-DD
4
+
5
+ ## Current Branch
6
+ main
7
+
8
+ ## Current Status
9
+ [What's the current state of play? What has been done recently? Be specific enough that a fresh session can orient immediately.]
10
+
11
+ ## What's Next
12
+ [Concrete next action. Not a list of options — the one thing to pick up from.]
13
+
14
+ ## Blockers
15
+ [Anything waiting on someone else, a decision, or an external dependency.]
16
+
17
+ ## Gotchas
18
+ [Repo-specific things the AI should know: quirks, non-obvious patterns, traps to avoid, decisions that were made and why.]
@@ -0,0 +1,46 @@
1
+ # Session State Protocol
2
+ ## (Add this to your AI tool's system prompt or project instructions file)
3
+
4
+ ---
5
+
6
+ ## Session State Protocol
7
+
8
+ **Memory directory:** `~/.ai-memory/` (global) and `.ai-memory/` (per-repo)
9
+
10
+ **At session start (REQUIRED):**
11
+ 1. Read `~/.ai-memory/global.md` — preferences, active projects table, memory file manifest
12
+ 2. Read `.ai-memory/state.md` in the current repo — branch, progress, next steps, gotchas
13
+ 3. If `.ai-memory/product-state.md` exists, read it — product intent, success criteria, constraints. This is context from the PM/PO about *why* you're building what you're building. Keep it in mind during the session.
14
+ 4. Check the "Memory Files" table in global.md — load any files from `~/.ai-memory/memory/` whose keywords match this session's topic
15
+ 5. Summarize the current state of the project, then ask: **"What's the goal for this session? What does success look like?"**
16
+
17
+ **Mid-session:**
18
+ If the session appears to be diverging from the stated goal (new tangent, scope creep), gently flag it:
19
+ > *"Quick check — we set out to [goal]. This feels like it's moving toward [tangent]. Want to stay the course, or deliberately pivot?"*
20
+ If the user pivots, update the goal. This is a nudge, not a gate — the user always decides.
21
+
22
+ **At session end (when user says "stop", "done", "pause", "tomorrow", "wrap up"):**
23
+ 1. Update `.ai-memory/state.md` in the current repo: what was done, what's next, blockers, gotchas
24
+ 2. Update the project's row in `~/.ai-memory/global.md` Active Projects table
25
+ 3. If significant new cross-repo context was created (patterns, strategies, decisions), create or update a file in `~/.ai-memory/memory/` and add it to the Memory Files manifest
26
+ 4. Append to `~/.ai-memory/memory/journal/YYYY-MM-DD.md`:
27
+
28
+ ```
29
+ ## [Repo or context] — [Brief title]
30
+ **Why:** [The stated goal]
31
+ **What:** [Bullet list of what was done]
32
+ **Outcome:** [Did we hit the goal? Key deliverables]
33
+ **On track?:** [Focused or drift? What caused drift?]
34
+ **Lessons:** [Worth remembering cross-session]
35
+ **Discovery:** [Optional — things learned that challenge assumptions, create new options,
36
+ or need PM/CTO attention. Skip if nothing notable. Include who should see this and why.]
37
+ ```
38
+
39
+ 5. If the session surfaced items that belong in `.ai-memory/product-state.md` (open questions for the PM, customer signal, scope discoveries), add them there.
40
+ 6. Confirm: **"State saved. Say 'let's continue' next time."**
41
+
42
+ **Rules:**
43
+ - Use the Edit tool to update files in place — don't append new sections
44
+ - Keep `global.md` under 80 lines. Detail goes in topic files.
45
+ - Per-repo state stays focused on that repo. Cross-repo context goes in `~/.ai-memory/memory/`
46
+ - Do NOT use proprietary memory CLI tools for state storage. Plain markdown files only.
@@ -0,0 +1,37 @@
1
+ # Strategy State
2
+
3
+ Last updated: YYYY-MM-DD
4
+
5
+ ## Current Direction
6
+ <!-- What's the strategic thesis right now? What are we betting on and why?
7
+ This is the "north star" that product and engineering decisions should align to. -->
8
+
9
+ ## Active Research
10
+ <!-- What's being investigated. Include the hypothesis being tested.
11
+ Format: Topic — Hypothesis — Status — Repo (if applicable)
12
+ Example: "AI extraction accuracy — Can we hit 95% on room rates? — Testing — ~/repos/research" -->
13
+
14
+ ## Prototype Outcomes
15
+ <!-- What's been built, what it proved or disproved, and what to do with it.
16
+ This is the CTO → PM/Engineering handoff point. Be explicit about what
17
+ the prototype means for the product and who needs to act on it. -->
18
+
19
+ | Prototype | Repo | What it proves | Status | Handoff |
20
+ |---|---|---|---|---|
21
+ <!-- Example row:
22
+ | Extraction pipeline | ~/repos/research | AI extracts room rates at 95% accuracy | Complete | April: spec the support-facing UI; Nick: production-grade the pipeline |
23
+ -->
24
+
25
+ ## Technology Bets
26
+ <!-- What we're betting on, the thesis behind each bet, and what would make us reconsider.
27
+ Example: "Azure Container Apps for batch jobs — cheaper than Functions at scale,
28
+ but if cold start > 30s we'll revisit." -->
29
+
30
+ ## Constraints & Guardrails
31
+ <!-- Strategic decisions that constrain product and engineering. The "we will not" list.
32
+ Example: "No vendor lock-in on data storage — customer must be able to export everything." -->
33
+
34
+ ## Patterns I'm Watching
35
+ <!-- Cross-team observations, market signals, recurring issues. Things that aren't
36
+ urgent but shape where we're heading.
37
+ Example: "Third repo this quarter where the data model assumed 1:1 but reality is 1:many." -->
@@ -0,0 +1,29 @@
1
+ # [Repo Name] — Team State
2
+
3
+ Last updated: YYYY-MM-DD
4
+
5
+ ## Product Context
6
+ <!-- What is this repo building, for whom, and why? One paragraph.
7
+ If a product-state.md exists, summarize it here and point to it for detail.
8
+ Engineers: read this before starting a session. It's why your work matters. -->
9
+
10
+ ## Architecture & Key Decisions
11
+ <!-- Decisions the whole team should know. Include the "why" not just the "what". -->
12
+
13
+ ## Conventions
14
+ <!-- Patterns, naming, tooling choices that apply across the team. -->
15
+
16
+ ## Current Sprint Focus
17
+ <!-- Team-level "what are we working on right now" -->
18
+
19
+ ## Signal Routing
20
+ <!-- Where do external signals for this repo come from, and where should
21
+ engineering discoveries go? This helps the AI route information correctly.
22
+
23
+ Bugs & feedback: [tool — e.g. Intercom, GitHub Issues]
24
+ PM contact: [name — who to flag product questions to]
25
+ CTO/Strategy contact: [name — who to flag architectural patterns to]
26
+ QA process: [how testing works for this repo] -->
27
+
28
+ ## Shared Gotchas
29
+ <!-- Hard-won lessons. What surprised us. What NOT to do. -->
package/uninstall.sh ADDED
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env bash
2
+ # Skip Tissue — Uninstaller
3
+ # Removes installed hooks, commands, and settings fragments.
4
+ # NEVER deletes your memory content (global-state.md, memory/ directory).
5
+ #
6
+ # Usage: bash uninstall.sh [--tool claude-code]
7
+
8
+ set -euo pipefail
9
+
10
+ TOOL="${1:-}"
11
+ [[ "${1:-}" == "--tool" ]] && TOOL="${2:-}"
12
+ [[ "${1:-}" == "--tool="* ]] && TOOL="${1#--tool=}"
13
+
14
+ GREEN='\033[0;32m'; YELLOW='\033[1;33m'; RED='\033[0;31m'; RESET='\033[0m'
15
+ log() { echo -e "${GREEN}✓${RESET} $1"; }
16
+ warn() { echo -e "${YELLOW}⚠${RESET} $1"; }
17
+ info() { echo " $1"; }
18
+ err() { echo -e "${RED}✗${RESET} $1"; exit 1; }
19
+
20
+ echo ""
21
+ echo "Skip Tissue — Uninstall"
22
+ echo ""
23
+ warn "This will remove hooks, commands, and settings fragments."
24
+ warn "Your memory files (global-state.md, memory/) will NOT be deleted."
25
+ echo ""
26
+ read -rp "Continue? [y/N] " confirm
27
+ [[ "$confirm" =~ ^[Yy]$ ]] || { echo "Aborted."; exit 0; }
28
+
29
+ # Remove hook
30
+ HOOK="$HOME/.claude/hooks/check-global-state.sh"
31
+ if [ -f "$HOOK" ]; then
32
+ rm "$HOOK"
33
+ log "Removed $HOOK"
34
+ fi
35
+
36
+ # Remove commands
37
+ CMD="$HOME/.claude/commands/init-memory.md"
38
+ if [ -f "$CMD" ]; then
39
+ rm "$CMD"
40
+ log "Removed $CMD"
41
+ fi
42
+
43
+ DOCTOR_CMD="$HOME/.claude/commands/doctor.md"
44
+ if [ -f "$DOCTOR_CMD" ]; then
45
+ rm "$DOCTOR_CMD"
46
+ log "Removed $DOCTOR_CMD"
47
+ fi
48
+
49
+ # Remove hook from settings.json
50
+ SETTINGS="$HOME/.claude/settings.json"
51
+ if [ -f "$SETTINGS" ] && grep -q "check-global-state" "$SETTINGS" 2>/dev/null; then
52
+ python3 - "$SETTINGS" <<'PYEOF'
53
+ import json, sys
54
+ path = sys.argv[1]
55
+ with open(path) as f:
56
+ settings = json.load(f)
57
+ hooks = settings.get("hooks", {})
58
+ session_start = hooks.get("SessionStart", [])
59
+ hooks["SessionStart"] = [h for h in session_start if "check-global-state" not in h.get("command", "")]
60
+ if not hooks["SessionStart"]:
61
+ del hooks["SessionStart"]
62
+ if not hooks:
63
+ del settings["hooks"]
64
+ with open(path, "w") as f:
65
+ json.dump(settings, f, indent=2)
66
+ f.write("\n")
67
+ PYEOF
68
+ log "Removed hook from $SETTINGS"
69
+ fi
70
+
71
+ # Remove installed kit copy
72
+ KIT_DEST="$HOME/.claude/skip-tissue"
73
+ if [ -d "$KIT_DEST" ]; then
74
+ rm -rf "$KIT_DEST"
75
+ log "Removed $KIT_DEST"
76
+ fi
77
+
78
+ echo ""
79
+ log "Uninstall complete."
80
+ echo ""
81
+ info "Your memory files are preserved:"
82
+ info " ~/.claude/global-state.md"
83
+ info " ~/.claude/memory/"
84
+ info ""
85
+ info "To reinstall: curl -fsSL https://raw.githubusercontent.com/leizerowicz/skip-tissue/main/install.sh | bash"