wayfind 0.0.1 → 2.0.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 (60) hide show
  1. package/BOOTSTRAP_PROMPT.md +120 -0
  2. package/bin/connectors/github.js +617 -0
  3. package/bin/connectors/index.js +13 -0
  4. package/bin/connectors/intercom.js +595 -0
  5. package/bin/connectors/llm.js +469 -0
  6. package/bin/connectors/notion.js +747 -0
  7. package/bin/connectors/transport.js +325 -0
  8. package/bin/content-store.js +2006 -0
  9. package/bin/digest.js +813 -0
  10. package/bin/rebuild-status.js +297 -0
  11. package/bin/slack-bot.js +1535 -0
  12. package/bin/slack.js +342 -0
  13. package/bin/storage/index.js +171 -0
  14. package/bin/storage/json-backend.js +348 -0
  15. package/bin/storage/sqlite-backend.js +415 -0
  16. package/bin/team-context.js +4209 -0
  17. package/bin/telemetry.js +159 -0
  18. package/doctor.sh +291 -0
  19. package/install.sh +144 -0
  20. package/journal-summary.sh +577 -0
  21. package/package.json +48 -6
  22. package/setup.sh +641 -0
  23. package/specializations/claude-code/CLAUDE.md-global-fragment.md +53 -0
  24. package/specializations/claude-code/CLAUDE.md-repo-fragment.md +16 -0
  25. package/specializations/claude-code/README.md +99 -0
  26. package/specializations/claude-code/commands/doctor.md +31 -0
  27. package/specializations/claude-code/commands/init-memory.md +154 -0
  28. package/specializations/claude-code/commands/init-team.md +415 -0
  29. package/specializations/claude-code/commands/journal.md +66 -0
  30. package/specializations/claude-code/commands/review-prs.md +119 -0
  31. package/specializations/claude-code/hooks/check-global-state.sh +20 -0
  32. package/specializations/claude-code/hooks/session-end.sh +36 -0
  33. package/specializations/claude-code/settings.json +15 -0
  34. package/specializations/cursor/README.md +120 -0
  35. package/specializations/cursor/global-rule.mdc +53 -0
  36. package/specializations/cursor/repo-rule.mdc +25 -0
  37. package/specializations/generic/README.md +47 -0
  38. package/templates/autopilot/design.md +22 -0
  39. package/templates/autopilot/engineering.md +22 -0
  40. package/templates/autopilot/product.md +22 -0
  41. package/templates/autopilot/strategy.md +22 -0
  42. package/templates/autopilot/unified.md +24 -0
  43. package/templates/deploy/.env.example +110 -0
  44. package/templates/deploy/docker-compose.yml +63 -0
  45. package/templates/deploy/slack-app-manifest.json +45 -0
  46. package/templates/github-actions/meridian-digest.yml +85 -0
  47. package/templates/global.md +79 -0
  48. package/templates/memory-file.md +18 -0
  49. package/templates/personal-state.md +14 -0
  50. package/templates/personas.json +28 -0
  51. package/templates/product-state.md +41 -0
  52. package/templates/prompts-readme.md +19 -0
  53. package/templates/repo-state.md +18 -0
  54. package/templates/session-protocol-fragment.md +46 -0
  55. package/templates/slack-app-manifest.json +27 -0
  56. package/templates/statusline.sh +22 -0
  57. package/templates/strategy-state.md +39 -0
  58. package/templates/team-state.md +55 -0
  59. package/uninstall.sh +105 -0
  60. package/README.md +0 -4
@@ -0,0 +1,53 @@
1
+
2
+ ## Session State Protocol (Wayfind)
3
+
4
+ **Memory system:** Hierarchical plain-markdown files. No CLI tools, no databases.
5
+
6
+ ### File Hierarchy
7
+
8
+ ```
9
+ ~/.claude/
10
+ global-state.md # Thin index — ALWAYS load at session start
11
+ state.md # Admin/non-repo work
12
+ memory/ # Topic files — load on demand
13
+ <topic>.md
14
+ journal/YYYY-MM-DD.md # Daily log
15
+
16
+ <repo>/.claude/
17
+ team-state.md # Shared team context — committed to git
18
+ personal-state.md # Personal context — gitignored
19
+ ```
20
+
21
+ ### Session Start (REQUIRED)
22
+
23
+ 1. Read `~/.claude/global-state.md`
24
+ 2. Read `.claude/team-state.md` (shared team context) and `.claude/personal-state.md` (your personal context) in the current repo, if they exist. Fall back to `.claude/state.md` for older repos not yet migrated. (Or `~/.claude/state.md` if in home dir.)
25
+ 3. Check the Memory Files table in global-state.md — load any `~/.claude/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 (on "stop" / "done" / "pause" / "tomorrow")
33
+
34
+ 1. Update `.claude/team-state.md` with shared changes and `.claude/personal-state.md` with personal changes. (For older repos not yet migrated, update `.claude/state.md` as before.)
35
+ 2. Do NOT update `~/.claude/global-state.md` — its Active Projects table is rebuilt automatically by `wayfind status`.
36
+ 3. Create/update topic files in `~/.claude/memory/` for significant new cross-repo context
37
+ 4. Append to `~/.claude/memory/journal/YYYY-MM-DD.md`:
38
+ ```
39
+ ## [Repo] — [Title]
40
+ **Why:** [Stated goal]
41
+ **What:** [What was done]
42
+ **Outcome:** [Did we hit it?]
43
+ **On track?:** [Focused or drift?]
44
+ **Lessons:** [Cross-session learnings]
45
+ ```
46
+ 5. Confirm: **"State saved. Say 'let's continue' next time."**
47
+
48
+ ### Rules
49
+
50
+ - Keep `global-state.md` under 80 lines. Detail goes in `~/.claude/memory/` files.
51
+ - Per-repo `state.md` stays focused on that repo only.
52
+ - New cross-repo topics get new files in `~/.claude/memory/`, not appended to global-state.md.
53
+ - Do NOT use external memory databases or CLI tools for state storage. Use plain markdown files only.
@@ -0,0 +1,16 @@
1
+
2
+ ## Session State Protocol
3
+
4
+ **At session start (REQUIRED):**
5
+ 1. Read `~/.claude/global-state.md` — preferences, active projects, memory file manifest
6
+ 2. Read `.claude/team-state.md` in this repo — shared team context (architecture decisions, conventions, sprint focus, gotchas)
7
+ 3. Read `.claude/personal-state.md` in this repo — your personal context (current focus, working notes, opinions)
8
+ 4. Check the Memory Files table in global-state.md — load any `~/.claude/memory/` files relevant to this session's topic
9
+
10
+ **At session end (when user says stop/done/pause/tomorrow):**
11
+ 1. Update `.claude/team-state.md` with shared context: architecture decisions, conventions, gotchas the whole team should know
12
+ 2. Update `.claude/personal-state.md` with personal context: your next steps, working notes, opinions
13
+ 3. Do NOT update `~/.claude/global-state.md` — its Active Projects table is rebuilt automatically by `wayfind status`.
14
+ 4. If significant new cross-repo context was created (patterns, strategies, decisions), create or update a file in `~/.claude/memory/` and add it to the Memory Files manifest in global-state.md
15
+
16
+ **Do NOT use external memory databases or CLI tools for state storage.** Use plain markdown files only.
@@ -0,0 +1,99 @@
1
+ # Claude Code Specialization
2
+
3
+ This directory contains everything needed to wire Wayfind into Claude Code specifically.
4
+
5
+ ## What's Different About Claude Code
6
+
7
+ Claude Code reads a `CLAUDE.md` file at the root of every repo (and `~/.claude/CLAUDE.md` globally) as persistent instructions. It also supports:
8
+ - **Hooks** — shell scripts that run on session start/end, file edits, commands
9
+ - **Custom slash commands** — markdown files in `.claude/commands/` become `/command-name` shortcuts
10
+ - **Settings** — `~/.claude/settings.json` controls hooks and behavior
11
+
12
+ The memory directory for Claude Code is `~/.claude/` (not `~/.ai-memory/`).
13
+
14
+ ## File Map
15
+
16
+ | File | Install to | Purpose |
17
+ |------|-----------|---------|
18
+ | `CLAUDE.md-global-fragment.md` | Append to `~/.claude/CLAUDE.md` | Tells Claude to load memory files at session start |
19
+ | `CLAUDE.md-repo-fragment.md` | Append to `<repo>/CLAUDE.md` | Repo-level session protocol |
20
+ | `settings.json` | Merge into `~/.claude/settings.json` | Registers the anti-drift hook |
21
+ | `hooks/check-global-state.sh` | Copy to `~/.claude/hooks/` | Warns when global index is stale |
22
+ | `commands/init-memory.md` | Copy to `~/.claude/commands/` | Adds `/init-memory` slash command |
23
+ | `commands/init-team.md` | Copy to `~/.claude/commands/` | Adds `/init-team` slash command |
24
+ | `commands/journal.md` | Copy to `~/.claude/commands/` | Adds `/journal` slash command |
25
+ | `commands/doctor.md` | Copy to `~/.claude/commands/` | Adds `/doctor` slash command |
26
+
27
+ The `setup.sh` at the kit root handles all of this automatically.
28
+
29
+ ## Manual Install
30
+
31
+ ```bash
32
+ # 1. Create directories
33
+ mkdir -p ~/.claude/hooks ~/.claude/commands ~/.claude/memory/journal
34
+
35
+ # 2. Copy the global CLAUDE.md fragment
36
+ cat specializations/claude-code/CLAUDE.md-global-fragment.md >> ~/.claude/CLAUDE.md
37
+
38
+ # 3. Install hook script
39
+ cp specializations/claude-code/hooks/check-global-state.sh ~/.claude/hooks/
40
+ chmod +x ~/.claude/hooks/check-global-state.sh
41
+
42
+ # 4. Install init-memory command
43
+ cp specializations/claude-code/commands/init-memory.md ~/.claude/commands/
44
+
45
+ # 5. Merge settings.json
46
+ # If ~/.claude/settings.json doesn't exist:
47
+ cp specializations/claude-code/settings.json ~/.claude/settings.json
48
+ # If it already exists, manually add the "hooks" block from settings.json
49
+
50
+ # 6. Copy global state template
51
+ cp ../../templates/global.md ~/.claude/global-state.md
52
+ # Edit it to add your preferences and projects
53
+ ```
54
+
55
+ ## Per-Repo Setup
56
+
57
+ For each repo you work in:
58
+
59
+ ```bash
60
+ cd ~/repos/your-org/your-repo
61
+ mkdir -p .claude
62
+
63
+ # Copy repo state templates
64
+ cp ~/.claude/team-context/templates/repo-state.md .claude/team-state.md # Shared team context (committed)
65
+ cp ~/.claude/team-context/templates/repo-state.md .claude/personal-state.md # Personal context (gitignored)
66
+
67
+ # Add session protocol to repo CLAUDE.md
68
+ cat ~/.claude/team-context/specializations/claude-code/CLAUDE.md-repo-fragment.md >> CLAUDE.md
69
+
70
+ # Add gitignore entries (IMPORTANT — see note below)
71
+ echo ".claude/personal-state.md" >> .gitignore
72
+ echo ".claude/settings.local.json" >> .gitignore
73
+ echo ".claude/memory.db" >> .gitignore
74
+ ```
75
+
76
+ Or just run `/init-memory` inside Claude Code after setup.
77
+
78
+ ## Gitignore Warning
79
+
80
+ **Never add `.claude/` to `.gitignore` as a whole directory.**
81
+
82
+ Claude Code stores skills, commands, and settings in `.claude/` that should be tracked in git. If you ignore the whole directory, git won't track those files — and negation rules like `!.claude/commands/` won't rescue them (git doesn't descend into ignored directories).
83
+
84
+ **Correct pattern:**
85
+ ```gitignore
86
+ # Claude Code — local only, don't track
87
+ .claude/personal-state.md
88
+ .claude/settings.local.json
89
+ .claude/memory.db
90
+ ```
91
+
92
+ **Wrong:**
93
+ ```gitignore
94
+ .claude/ ← this breaks skills and commands
95
+ ```
96
+
97
+ ## Memory Directory Note
98
+
99
+ Claude Code uses `~/.claude/` as its home. This kit uses that same directory rather than `~/.ai-memory/` so that Claude's native file loading works correctly. The file paths in your `global-state.md` will reference `~/.claude/memory/` accordingly.
@@ -0,0 +1,31 @@
1
+ ---
2
+ description: Run Wayfind health check — validates hooks, state files, backup status, and memory file sizes.
3
+ ---
4
+
5
+ # Wayfind — Doctor
6
+
7
+ Run a health check on the memory system.
8
+
9
+ ## Step 1: Check if doctor.sh is available
10
+
11
+ Look for `~/.claude/team-context/doctor.sh`. If found, run it:
12
+ ```bash
13
+ bash ~/.claude/team-context/doctor.sh
14
+ ```
15
+
16
+ If not found, perform the checks manually:
17
+
18
+ ## Step 2: Manual checks
19
+
20
+ 1. **Hook registered?** — Does `~/.claude/settings.json` contain "check-global-state"?
21
+ 2. **Global state current?** — Read `~/.claude/global-state.md`. When was it last updated?
22
+ 3. **Backup status** — Check `~/.claude/.backup-last-push` and `~/.claude/.backup-last-error`
23
+ 4. **Repos** — Scan `~/repos`, `~/code`, `~/dev` for `.claude/state.md` files
24
+ 5. **Memory files** — List files in `~/.claude/memory/`, flag any over 8KB
25
+
26
+ ## Step 3: Report findings
27
+
28
+ Report in this format:
29
+ - ✓ items that are working correctly
30
+ - ⚠ items that need attention (not broken, but worth knowing)
31
+ - ✗ items that are broken (with how to fix)
@@ -0,0 +1,154 @@
1
+ ---
2
+ description: Initialize Wayfind for the current repo. Creates .claude/team-state.md (tracked in git) and .claude/personal-state.md (gitignored), ensures correct .gitignore entries, appends session protocol to CLAUDE.md, and registers the repo in the global index. Safe to run multiple times (idempotent).
3
+ ---
4
+
5
+ # Initialize Memory System for Current Repo
6
+
7
+ Run these steps in order. Skip any step that's already done (this command is idempotent).
8
+
9
+ ## Step 0: Detect and Migrate Old Protocol
10
+
11
+ Read the repo's `CLAUDE.md` (if it exists). If it contains "Update the project's row in" or "Update the Active Projects row", this repo has the old session protocol that writes to global-state.md.
12
+
13
+ **Migration:** Replace the matching Session End step with:
14
+ > 3. Do NOT update `~/.claude/global-state.md` — its Active Projects table is rebuilt automatically by `wayfind status`.
15
+
16
+ Report: "Migrated session protocol — sessions no longer write to global-state.md."
17
+
18
+ If the old protocol is not detected, skip this step silently.
19
+
20
+ ## Step 1: Detect Context
21
+
22
+ - Determine the current working directory
23
+ - Check if it's a git repo (`ls .git` or `git rev-parse --show-toplevel`)
24
+ - Read `~/.claude/global-state.md` to check if this repo is already registered
25
+
26
+ ## Step 2: Create state files (if missing)
27
+
28
+ This repo uses TWO state files with different visibility:
29
+
30
+ **`.claude/team-state.md`** — committed to git (shared team context)
31
+
32
+ If `.claude/team-state.md` does not exist, create it:
33
+
34
+ ```markdown
35
+ # [Repo Name] — Team State
36
+
37
+ Last updated: [today's date]
38
+
39
+ ## Architecture & Key Decisions
40
+ <!-- Decisions the whole team should know. Include the "why" not just the "what". -->
41
+
42
+ ## Conventions
43
+ <!-- Patterns, naming, tooling choices that apply across the team. -->
44
+
45
+ ## Current Sprint Focus
46
+ <!-- Team-level "what are we working on right now" -->
47
+
48
+ ## Elicitation Prompts
49
+
50
+ <!-- These prompts guide the AI to capture richer context at decision moments.
51
+ The answers aren't for you — they're for your teammates who read the digest. -->
52
+
53
+ When a technical or product decision is made without stated reasoning, ask one of:
54
+ - "What alternatives did you consider?"
55
+ - "What constraint or requirement drove this choice?"
56
+ - "What would need to change for you to reverse this decision?"
57
+ - "Who else on the team does this affect, and how?"
58
+ - "What's the risk if this assumption is wrong?"
59
+
60
+ Do not ask if the decision already includes reasoning, tradeoffs, or constraints.
61
+ Do not ask more than once per decision. Do not ask during routine implementation.
62
+
63
+ ## Shared Gotchas
64
+ <!-- Hard-won lessons. What surprised us. What NOT to do. -->
65
+ ```
66
+
67
+ **`.claude/personal-state.md`** — gitignored (your personal context)
68
+
69
+ If `.claude/personal-state.md` does not exist, create it:
70
+
71
+ ```markdown
72
+ # [Repo Name] — Personal State
73
+
74
+ Last updated: [today's date]
75
+
76
+ (This file is gitignored. It's yours — context you wouldn't want teammates reading as objective fact.)
77
+
78
+ ## My Current Focus
79
+ <!-- Your personal next steps -->
80
+
81
+ ## Personal Context
82
+ <!-- Working notes, opinions, relationship dynamics for this repo -->
83
+
84
+ ## What I'm Watching
85
+ <!-- Open questions, things to follow up on -->
86
+ ```
87
+
88
+ ## Step 3: Fix `.gitignore`
89
+
90
+ Check `.gitignore`. Ensure these lines are present:
91
+
92
+ ```
93
+ .claude/personal-state.md
94
+ .claude/state.md
95
+ .claude/settings.local.json
96
+ .claude/memory.db
97
+ .claude/wayfind.json
98
+ ```
99
+
100
+ **Do NOT add `.claude/` as a whole directory.** That breaks skills and commands. Only add the specific files above. Note that `team-state.md` is intentionally NOT gitignored — it is meant to be committed and shared with your team. The `.claude/state.md` entry covers legacy repos that use a single state file instead of the two-file model.
101
+
102
+ If any of those lines are missing, append them. If `.claude/` (as a directory) is already in `.gitignore`, remove it and replace with the four file-level entries above.
103
+
104
+ ## Step 4: Append Session Protocol to CLAUDE.md
105
+
106
+ Read the repo's `CLAUDE.md`. If it does NOT already contain "Session State Protocol", append this:
107
+
108
+ ```markdown
109
+
110
+ ## Session State Protocol
111
+
112
+ **At session start (REQUIRED):**
113
+ 1. Read `~/.claude/global-state.md` — preferences, active projects, memory file manifest
114
+ 2. Read `.claude/team-state.md` in this repo — shared team context: architecture decisions, conventions, sprint focus, gotchas
115
+ 3. Read `.claude/personal-state.md` in this repo — your personal context: current focus, working notes, opinions
116
+ 4. Check the Memory Files table in global-state.md — load any `~/.claude/memory/` files relevant to this session's topic
117
+
118
+ **At session end (when user says stop/done/pause/tomorrow):**
119
+ 1. Update `.claude/team-state.md` with shared context: architecture decisions, conventions, gotchas the team should know
120
+ 2. Update `.claude/personal-state.md` with personal context: your next steps, working notes, opinions
121
+ 3. Do NOT update `~/.claude/global-state.md` — its Active Projects table is rebuilt automatically by `wayfind status`.
122
+ 4. If significant new cross-repo context was created (patterns, strategies, decisions), create or update a file in `~/.claude/memory/` and add it to the Memory Files manifest in global-state.md
123
+
124
+ **Do NOT use ruvector/claude-flow memory CLI for state storage.** Use plain markdown files only.
125
+ ```
126
+
127
+ If `CLAUDE.md` doesn't exist, create a minimal one with the repo name as a heading and the block above.
128
+
129
+ ## Step 5: Register State Files in Global Index
130
+
131
+ Read `~/.claude/global-state.md`. The Active Projects table is auto-generated by `wayfind status --write` — do NOT add rows to it manually.
132
+
133
+ Add the repo's state files to the State Files table if missing:
134
+
135
+ ```
136
+ | `[full path]/.claude/team-state.md` | Shared team context for this repo |
137
+ | `[full path]/.claude/personal-state.md` | Personal context for this repo (gitignored) |
138
+ ```
139
+
140
+ ## Step 6: Report
141
+
142
+ Tell the user:
143
+ - `.claude/team-state.md` — created or already existed (committed to git, shared with team)
144
+ - `.claude/personal-state.md` — created or already existed (gitignored, personal only)
145
+ - `.gitignore` — updated or already correct
146
+ - `CLAUDE.md` — protocol appended or already present
147
+ - `global-state.md` — repo registered or already listed
148
+
149
+ **If they haven't set up team context yet**, mention:
150
+ "Run `/init-team` to set up team-level context sharing — shared journals, weekly digests
151
+ (Slack + Notion), and persona state files for your configured personas."
152
+
153
+ **Mention persona configuration:**
154
+ "Run `wayfind personas` to see and customize your team's personas (defaults: Product, Design, Engineering, Strategy)."