sticky-note-cli 2.5.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.
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "sticky-note-cli",
3
+ "version": "2.5.0",
4
+ "description": "Human-to-human handoff for AI coding assistants. Git-backed shared memory for Claude Code and Copilot CLI.",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "sticky-note": "./bin/cli.js"
8
+ },
9
+ "keywords": [
10
+ "ai",
11
+ "claude-code",
12
+ "copilot-cli",
13
+ "handoff",
14
+ "sticky-note-json",
15
+ "hooks",
16
+ "developer-tools"
17
+ ],
18
+ "author": "Dheeraj Bandaru",
19
+ "homepage": "https://github.com/BandaruDheeraj/sticky-note#readme",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/BandaruDheeraj/sticky-note.git"
23
+ },
24
+ "files": [
25
+ "bin/",
26
+ "templates/"
27
+ ],
28
+ "engines": {
29
+ "node": ">=16.0.0"
30
+ },
31
+ "scripts": {
32
+ "test": "node test/smoke.test.js"
33
+ }
34
+ }
@@ -0,0 +1,208 @@
1
+ <!-- sticky-note:start — DO NOT EDIT between markers; updated by `npx sticky-note update` -->
2
+ # Sticky Note — AI Assistant Instructions
3
+
4
+ This repository uses **Sticky Note** for team handoff context.
5
+ All session threads are stored in `.sticky-note/sticky-note.json`.
6
+
7
+ ## When asked about threads, sessions, or teammate activity
8
+
9
+ **Always read `.sticky-note/sticky-note.json` first** — do NOT use git log,
10
+ git history, your own session memory, or any other source.
11
+
12
+ ```bash
13
+ cat .sticky-note/sticky-note.json
14
+ ```
15
+
16
+ ### Thread fields
17
+
18
+ | Field | Meaning |
19
+ |--------------------|--------------------------------------------|
20
+ | `status` | open, stuck, stale, closed, expired |
21
+ | `user` | Who created the thread |
22
+ | `tool` | Which AI tool created it (claude-code, copilot-cli) |
23
+ | `branch` | Git branch the work happened on |
24
+ | `files_touched` | Files modified during the session |
25
+ | `narrative` | Summary of what happened |
26
+ | `failed_approaches`| What was tried and didn't work |
27
+ | `handoff_summary` | Handoff notes for teammates |
28
+ | `last_note` | Most recent status note |
29
+ | `work_type` | bug-fix, feature, debugging, refactor, etc.|
30
+ | `prompts` | User prompts from the session (for cross-tool resume) |
31
+ | `related_session_ids` | Session IDs that resumed this thread |
32
+ | `contributors` | All users who worked on this thread (V2.5) |
33
+ | `resumed_by` | Most recent user to resume this thread (V2.5) |
34
+ | `resumed_at` | ISO timestamp of most recent resume (V2.5) |
35
+ | `resume_history` | Full resume chain: user, timestamp, session (V2.5) |
36
+
37
+ ### Status icons
38
+
39
+ - [STUCK] `stuck` — hit a blocker, includes failed approaches
40
+ - [OPEN] `open` — work in progress (or resumed)
41
+ - [STALE] `stale` — no activity for 14+ days
42
+ - [CLOSED] `closed` — completed
43
+ - [EXPIRED] `expired` — tombstoned, minimal data remains
44
+
45
+ ### Smart injection (V2.5)
46
+
47
+ Context injection uses a **two-tier model** via Claude Code hooks:
48
+
49
+ - **Eager:** Stuck/relevant threads are injected at session start
50
+ (via the `UserPromptSubmit` hook in `inject-context.js`)
51
+ - **Lazy:** Other threads are injected when you first touch a file they authored
52
+ (via git blame attribution in the `PreToolUse` hook in `pre-tool-use.js`)
53
+
54
+ Each thread is injected **at most once per session** with line-range detail
55
+ showing exactly which lines each thread authored.
56
+
57
+ **Fallback (no hooks):** If hooks are not running (e.g., in Copilot CLI or
58
+ other tools), self-serve context injection instead:
59
+ 1. At session start: read `.sticky-note/sticky-note.json` and check for
60
+ stuck/open threads. Summarize any that exist.
61
+ 2. Before editing a file for the first time: run
62
+ `npx sticky-note get-line-attribution --file <path>` to check for prior
63
+ thread context. Review attribution before making changes.
64
+
65
+ ### Checkpointing (V2.5)
66
+
67
+ When switching between different work topics during a session, set a checkpoint
68
+ so edits are attributed to the correct topic:
69
+
70
+ ```bash
71
+ npx sticky-note checkpoint "fixing auth token sliding window expiry"
72
+ ```
73
+
74
+ **AI assistants should set checkpoints automatically** when the user shifts
75
+ to a different task mid-session. This enables precise attribution — each
76
+ edit is tagged with what you were working on, not just the session start prompt.
77
+
78
+ ### Resuming threads
79
+
80
+ Users can resume a previous thread with `npx sticky-note resume <id>`.
81
+ This writes a `.sticky-resume` signal file that hooks detect automatically.
82
+ The resumed thread reopens as `open`, and its full context is injected at
83
+ session start.
84
+
85
+ **Smart resume (V2.5):** Users can also use natural language:
86
+ ```bash
87
+ npx sticky-note resume-thread --query "auth refresh work" --user alice
88
+ npx sticky-note resume-thread "pick up where Alice left off"
89
+ ```
90
+ This searches thread narratives and file attribution to find the best match.
91
+
92
+ **When a session starts with a resumed thread**, always present a brief recap
93
+ to the user: what was worked on, what was accomplished, any problems hit,
94
+ and what's left to do. Then ask how they'd like to proceed.
95
+
96
+ ### Resuming threads mid-session
97
+
98
+ When a user asks to resume a thread **during an active session**, do NOT
99
+ tell them to exit. Instead, run the resume command directly:
100
+
101
+ ```bash
102
+ npx sticky-note resume <thread-id>
103
+ ```
104
+
105
+ The command outputs the thread's **full context** (narrative, files, failed
106
+ approaches, prompts). Read and present this context to the user immediately —
107
+ do NOT tell them to start a new session. The inject-context hook will also
108
+ pick up the resumed thread on subsequent prompts.
109
+
110
+ ### File attribution (V2.5)
111
+
112
+ To see which threads are related to a specific file:
113
+ ```bash
114
+ npx sticky-note get-line-attribution --file src/auth/refresh.ts
115
+ npx sticky-note get-line-attribution --file src/auth/refresh.ts --lines 200:260
116
+ ```
117
+ Returns thread data with line-level attribution (which thread authored which lines).
118
+
119
+ ### Example queries the user might ask
120
+
121
+ - "Show me all threads" → read sticky-note.json, list all threads
122
+ - "What's stuck?" → filter threads where status = "stuck"
123
+ - "What did Alice work on?" → filter threads where user = "alice"
124
+ - "Show threads for this branch" → filter by current branch name
125
+ - "What files were touched?" → aggregate files_touched across threads
126
+ - "Resume thread X" → run `npx sticky-note resume <id>` directly (works mid-session)
127
+ - "Pick up Alice's auth work" → run `npx sticky-note resume-thread --query "auth" --user alice`
128
+ - "Who contributed to this thread?" → check the `contributors` field
129
+
130
+ ### Displaying threads
131
+
132
+ When listing threads, **always show the `user` (author) and `tool` fields**
133
+ so users can see who created each thread and which AI assistant was used.
134
+ Use these labels for the tool field:
135
+
136
+ - 🤖 `claude-code` — created by Claude Code
137
+ - 🛠️ `copilot-cli` — created by GitHub Copilot CLI
138
+ - ❓ `unknown` — tool not detected
139
+
140
+ Example format:
141
+ ```
142
+ [CLOSED] closed · dbandaru · 🛠️ copilot-cli · feature/v2
143
+ Last note: updated auth middleware
144
+ Files: src/auth.js, src/middleware.js
145
+ Contributors: dbandaru, alice
146
+ ```
147
+
148
+ ### Git commit rules for sticky-note files
149
+
150
+ **Always commit** (shared with the team):
151
+ - `.sticky-note/sticky-note.json` — the thread memory (this is the whole point)
152
+ - `.sticky-note/sticky-note-config.json` — team settings
153
+ - `.sticky-note/audit/*.jsonl` — per-user audit logs (team-wide action trail)
154
+ - `.sticky-note/presence/*.json` — per-user presence (who's active)
155
+
156
+ **Never commit** (transient, already in `.gitignore`):
157
+ - `.sticky-note/.sticky-resume` — transient resume signal
158
+ - `.sticky-note/.sticky-session` — transient session ID
159
+ - `.sticky-note/.sticky-head` — transient HEAD snapshot
160
+ - `.sticky-note/.sticky-injected` — transient injection tracking (V2.5)
161
+ - `.sticky-note/.sticky-active-resume` — transient active resume marker (V2.5)
162
+
163
+ When a session ends or the user asks to commit, **always include
164
+ `sticky-note.json` and the `audit/` and `presence/` directories**
165
+ so teammates see updated thread state and activity.
166
+
167
+ ### Audit trail
168
+
169
+ Per-user audit logs are stored in `.sticky-note/audit/<username>.jsonl`
170
+ (one JSON object per line). Use `npx sticky-note audit` to query the
171
+ merged trail across all team members.
172
+
173
+ ### Team presence
174
+
175
+ Per-user presence is stored in `.sticky-note/presence/<username>.json`.
176
+ Use `npx sticky-note who` to see who's active.
177
+
178
+ ### Branch switching
179
+
180
+ **IMPORTANT:** Before switching git branches, always use:
181
+ ```bash
182
+ npx sticky-note switch <branch>
183
+ ```
184
+ This auto-stashes `.sticky-note/` data before switching and restores it
185
+ after. A raw `git checkout` or `git switch` will fail if sticky-note
186
+ files have uncommitted changes. The alias `git sw <branch>` also works
187
+ if set up by `npx sticky-note init`.
188
+
189
+ ### `[STICKY-NOTE]` tags
190
+
191
+ All sticky-note hooks prefix their output with `[STICKY-NOTE]`. When you
192
+ see this tag in hook output, **briefly surface it to the user** so they
193
+ know what sticky-note did. Examples:
194
+
195
+ - `[STICKY-NOTE] ⚠️ Stuck Threads` → mention the stuck threads
196
+ - `[STICKY-NOTE] 3 relevant threads injected` → note context was loaded
197
+ - `[STICKY-NOTE] Tracked Edit on src/auth.ts (lines 40-55)` → confirm the edit was logged
198
+ - `[STICKY-NOTE] Session closed — thread created (5 files, 3 commits)` → confirm session saved
199
+ - `[STICKY-NOTE] Marked thread as STUCK` → acknowledge the error was recorded
200
+
201
+ Do NOT hide or suppress these tags. The user expects transparency about
202
+ when sticky-note is acting on their behalf.
203
+
204
+ ## Team conventions
205
+
206
+ Check `.sticky-note/sticky-note-config.json` for team conventions,
207
+ MCP servers, and configuration.
208
+ <!-- sticky-note:end -->
@@ -0,0 +1,185 @@
1
+ <!-- sticky-note:start — DO NOT EDIT between markers; updated by `npx sticky-note update` -->
2
+ # Sticky Note — Copilot CLI Instructions
3
+
4
+ This repository uses **Sticky Note** for team handoff context.
5
+ All session threads are stored in `.sticky-note/sticky-note.json`.
6
+
7
+ ## When asked about threads, sessions, or teammate activity
8
+
9
+ **Always read `.sticky-note/sticky-note.json` first** — do NOT use git log,
10
+ git history, your own session memory, or any other source.
11
+
12
+ ### Thread statuses
13
+
14
+ - [STUCK] `stuck` — hit a blocker, includes failed approaches
15
+ - [OPEN] `open` — work in progress (or resumed)
16
+ - [STALE] `stale` — no activity for 14+ days
17
+ - [CLOSED] `closed` — completed
18
+ - [EXPIRED] `expired` — tombstoned, minimal data remains
19
+
20
+ ### Proactive context injection (V2.5)
21
+
22
+ Copilot CLI does not have lifecycle hooks, so **you must self-serve context**.
23
+ Follow these two rules every session:
24
+
25
+ #### 1. Eager: At session start, check for stuck/open threads
26
+
27
+ Before doing any work, read `.sticky-note/sticky-note.json` and check for
28
+ threads with status `stuck` or `open`. If any exist, briefly summarize them
29
+ to the user (what's blocked, what files are involved).
30
+
31
+ #### 2. Lazy: Before editing a file, check for prior thread context
32
+
33
+ **The first time you edit or read a file in a session**, run:
34
+ ```bash
35
+ npx sticky-note get-line-attribution --file <path>
36
+ ```
37
+ If threads are returned, review the attribution before making changes —
38
+ it shows which threads authored which lines, including stuck threads with
39
+ failed approaches. This prevents re-introducing bugs or duplicating work.
40
+
41
+ Skip this check for files that are clearly unrelated to prior work
42
+ (e.g., new files you just created, config files with trivial changes).
43
+
44
+ ### Checkpointing (V2.5)
45
+
46
+ When switching between different work topics during a session, set a checkpoint
47
+ so edits are attributed to the correct topic:
48
+
49
+ ```bash
50
+ npx sticky-note checkpoint "fixing auth token sliding window expiry"
51
+ ```
52
+
53
+ **AI assistants should set checkpoints automatically** when the user shifts
54
+ to a different task mid-session. This enables precise attribution — each
55
+ edit is tagged with what you were working on, not just the session start prompt.
56
+
57
+ ### Resuming threads
58
+
59
+ Users can resume a previous thread with `npx sticky-note resume <id>`.
60
+ This writes a `.sticky-resume` signal file that hooks detect automatically.
61
+ The resumed thread reopens as `open`, and its full context is injected at
62
+ session start.
63
+
64
+ **Smart resume (V2.5):** Users can also use natural language:
65
+ ```bash
66
+ npx sticky-note resume-thread --query "auth refresh work" --user alice
67
+ npx sticky-note resume-thread "pick up where Alice left off"
68
+ ```
69
+ This searches thread narratives and file attribution to find the best match.
70
+
71
+ **When a session starts with a resumed thread**, always present a brief recap
72
+ to the user: what was worked on, what was accomplished, any problems hit,
73
+ and what's left to do. Then ask how they'd like to proceed.
74
+
75
+ ### Resuming threads mid-session
76
+
77
+ When a user asks to resume a thread **during an active session**, do NOT
78
+ tell them to exit. Instead, run the resume command directly:
79
+
80
+ ```bash
81
+ npx sticky-note resume <thread-id>
82
+ ```
83
+
84
+ The command outputs the thread's **full context** (narrative, files, failed
85
+ approaches, prompts). Read and present this context to the user immediately —
86
+ do NOT tell them to start a new session. The inject-context hook will also
87
+ pick up the resumed thread on subsequent prompts.
88
+
89
+ ### File attribution (V2.5)
90
+
91
+ To see which threads are related to a specific file:
92
+ ```bash
93
+ npx sticky-note get-line-attribution --file src/auth/refresh.ts
94
+ ```
95
+ Returns thread data with line-level attribution (which thread authored which lines).
96
+
97
+ ### Common queries
98
+
99
+ - "Show me all threads" → read sticky-note.json, list all threads with status icons
100
+ - "What's stuck?" → filter threads where status = "stuck"
101
+ - "What did [user] work on?" → filter threads by user field
102
+ - "Show threads for this branch" → filter by current git branch
103
+ - "What files were touched?" → aggregate files_touched across threads
104
+ - "Resume thread X" → run `npx sticky-note resume <id>` directly (works mid-session)
105
+ - "Pick up Alice's auth work" → run `npx sticky-note resume-thread --query "auth" --user alice`
106
+ - "Who contributed to this thread?" → check the `contributors` field
107
+
108
+ ### Displaying threads
109
+
110
+ When listing threads, **always show the `user` (author) and `tool` fields**
111
+ so users can see who created each thread and which AI assistant was used.
112
+ Use these labels for the tool field:
113
+
114
+ - 🤖 `claude-code` — created by Claude Code
115
+ - 🛠️ `copilot-cli` — created by GitHub Copilot CLI
116
+ - ❓ `unknown` — tool not detected
117
+
118
+ Example format:
119
+ ```
120
+ [CLOSED] closed · dbandaru · 🛠️ copilot-cli · feature/v2
121
+ Last note: updated auth middleware
122
+ Files: src/auth.js, src/middleware.js
123
+ Contributors: dbandaru, alice
124
+ ```
125
+
126
+ ### Git commit rules for sticky-note files
127
+
128
+ **Always commit** (shared with the team):
129
+ - `.sticky-note/sticky-note.json` — the thread memory (this is the whole point)
130
+ - `.sticky-note/sticky-note-config.json` — team settings
131
+ - `.sticky-note/audit/*.jsonl` — per-user audit logs (team-wide action trail)
132
+ - `.sticky-note/presence/*.json` — per-user presence (who's active)
133
+
134
+ **Never commit** (transient, already in `.gitignore`):
135
+ - `.sticky-note/.sticky-resume` — transient resume signal
136
+ - `.sticky-note/.sticky-session` — transient session ID
137
+ - `.sticky-note/.sticky-head` — transient HEAD snapshot
138
+ - `.sticky-note/.sticky-injected` — transient injection tracking (V2.5)
139
+ - `.sticky-note/.sticky-active-resume` — transient active resume marker (V2.5)
140
+
141
+ When a session ends or the user asks to commit, **always include
142
+ `sticky-note.json` and the `audit/` and `presence/` directories**
143
+ so teammates see updated thread state and activity.
144
+
145
+ ### Audit trail
146
+
147
+ Per-user audit logs are stored in `.sticky-note/audit/<username>.jsonl`
148
+ (one JSON object per line). Use `npx sticky-note audit` to query the
149
+ merged trail across all team members.
150
+
151
+ ### Team presence
152
+
153
+ Per-user presence is stored in `.sticky-note/presence/<username>.json`.
154
+ Use `npx sticky-note who` to see who's active.
155
+
156
+ ### Branch switching
157
+
158
+ **IMPORTANT:** Before switching git branches, always use:
159
+ ```bash
160
+ npx sticky-note switch <branch>
161
+ ```
162
+ This auto-stashes `.sticky-note/` data before switching and restores it
163
+ after. A raw `git checkout` or `git switch` will fail if sticky-note
164
+ files have uncommitted changes. The alias `git sw <branch>` also works
165
+ if set up by `npx sticky-note init`.
166
+
167
+ ### `[STICKY-NOTE]` tags
168
+
169
+ All sticky-note hooks prefix their output with `[STICKY-NOTE]`. When you
170
+ see this tag in hook output, **briefly surface it to the user** so they
171
+ know what sticky-note did. Examples:
172
+
173
+ - `[STICKY-NOTE] ⚠️ Stuck Threads` → mention the stuck threads
174
+ - `[STICKY-NOTE] 3 relevant threads injected` → note context was loaded
175
+ - `[STICKY-NOTE] Tracked Edit on src/auth.ts (lines 40-55)` → confirm the edit was logged
176
+ - `[STICKY-NOTE] Session closed — thread created (5 files, 3 commits)` → confirm session saved
177
+ - `[STICKY-NOTE] Marked thread as STUCK` → acknowledge the error was recorded
178
+
179
+ Do NOT hide or suppress these tags. The user expects transparency about
180
+ when sticky-note is acting on their behalf.
181
+
182
+ ### Team config
183
+
184
+ Check `.sticky-note/sticky-note-config.json` for team conventions and settings.
185
+ <!-- sticky-note:end -->
@@ -0,0 +1,18 @@
1
+ # Sticky Note - local overrides
2
+ .claude/settings.local.json
3
+
4
+ # Sticky Note - transient session/resume signals
5
+ .sticky-note/.sticky-session
6
+ .sticky-note/.sticky-resume
7
+ .sticky-note/.sticky-head
8
+ .sticky-note/.sticky-injected
9
+ .sticky-note/.sticky-active-resume
10
+ .sticky-note/.sticky-checkpoint
11
+
12
+ # Sticky Note - debug log
13
+ .sticky-note/hook-debug.log
14
+ .sticky-note/.sticky-debug.jsonl
15
+
16
+ # Sticky Note - legacy single files (migrated to per-user dirs)
17
+ .sticky-note/sticky-note-audit.jsonl
18
+ .sticky-note/.sticky-presence.json