sticky-note-cli 2.6.4 → 2.6.6
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
CHANGED
package/templates/CLAUDE.md
CHANGED
|
@@ -186,6 +186,27 @@ after. A raw `git checkout` or `git switch` will fail if sticky-note
|
|
|
186
186
|
files have uncommitted changes. The alias `git sw <branch>` also works
|
|
187
187
|
if set up by `npx sticky-note init`.
|
|
188
188
|
|
|
189
|
+
### ⚠️ Overlap warnings (CRITICAL — always surface these)
|
|
190
|
+
|
|
191
|
+
Sticky-note hooks detect when your files overlap with other teammates'
|
|
192
|
+
open or stuck threads. When you see `[STICKY-NOTE] ⚠️ OVERLAP DETECTED`
|
|
193
|
+
in your injected context, you **MUST** start your response with this
|
|
194
|
+
exact banner format before doing ANYTHING else:
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
⚠️ Overlap detected: [user] is working on [files] — [narrative summary]
|
|
198
|
+
Status: [STUCK/OPEN] | Resume: npx sticky-note resume [id]
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Rules:
|
|
202
|
+
- This banner MUST be the **very first thing** in your response
|
|
203
|
+
- Do NOT bury it at the end or in a footnote
|
|
204
|
+
- Do NOT rephrase it as "Also noted..." or "By the way..."
|
|
205
|
+
- Then continue with the user's actual request normally
|
|
206
|
+
|
|
207
|
+
This pattern exists to prevent two teammates from wasting hours on the
|
|
208
|
+
same problem. Treat it like a system alert, not optional context.
|
|
209
|
+
|
|
189
210
|
### `[STICKY-NOTE]` tags
|
|
190
211
|
|
|
191
212
|
All sticky-note hooks prefix their output with `[STICKY-NOTE]`. When you
|
|
@@ -168,17 +168,29 @@ if set up by `npx sticky-note init`.
|
|
|
168
168
|
|
|
169
169
|
Sticky-note hooks detect when your files overlap with other teammates'
|
|
170
170
|
open or stuck threads. When you see `[STICKY-NOTE] ⚠️ OVERLAP DETECTED`
|
|
171
|
-
in your injected context, you **MUST**
|
|
171
|
+
in your injected context, you **MUST** start your response with this
|
|
172
|
+
exact banner format before doing ANYTHING else:
|
|
172
173
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
```
|
|
175
|
+
⚠️ Overlap detected: [user] is working on [files] — [narrative summary]
|
|
176
|
+
Status: [STUCK/OPEN] | Resume: npx sticky-note resume [id]
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Example:
|
|
180
|
+
```
|
|
181
|
+
⚠️ Overlap detected: alice is working on session-start.js, cli.js — fixing auth token refresh
|
|
182
|
+
Status: STUCK (tried retry logic, tokens expire mid-request) | Resume: npx sticky-note resume demo-ali
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Rules:
|
|
186
|
+
- This banner MUST be the **very first thing** in your response
|
|
187
|
+
- Show it BEFORE your thinking indicators (◐, ●, etc.)
|
|
188
|
+
- Do NOT bury it at the end or in a footnote
|
|
189
|
+
- Do NOT rephrase it as "Also noted..." or "By the way..."
|
|
190
|
+
- Then continue with the user's actual request normally
|
|
177
191
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
BEFORE doing any other work, even if the user asked you to do something
|
|
181
|
-
else first.
|
|
192
|
+
This pattern exists to prevent two teammates from wasting hours on the
|
|
193
|
+
same problem. Treat it like a system alert, not optional context.
|
|
182
194
|
|
|
183
195
|
### `[STICKY-NOTE]` tags
|
|
184
196
|
|
|
@@ -442,7 +442,7 @@ function main() {
|
|
|
442
442
|
const scored = [];
|
|
443
443
|
for (const t of live) {
|
|
444
444
|
// V2.5: Skip threads already injected this session by PreToolUse or session-start
|
|
445
|
-
if (isThreadInjected(t.id)) continue;
|
|
445
|
+
if (isThreadInjected(t.id, sessionId)) continue;
|
|
446
446
|
|
|
447
447
|
let s = scoreThread(t, recentlyModified, currentBranch, currentUser, keywords);
|
|
448
448
|
if (resumeThreadId && t.id === resumeThreadId) {
|
|
@@ -169,7 +169,7 @@ function main() {
|
|
|
169
169
|
|
|
170
170
|
// Filter out already-injected threads
|
|
171
171
|
const newThreads = fileAttr.threads.filter(
|
|
172
|
-
(t) => !isThreadInjected(t.thread ? t.thread.id : t.id)
|
|
172
|
+
(t) => !isThreadInjected(t.thread ? t.thread.id : t.id, sessionId)
|
|
173
173
|
);
|
|
174
174
|
|
|
175
175
|
if (newThreads.length === 0) {
|
|
@@ -569,8 +569,14 @@ function clearInjectedSet() {
|
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
571
|
|
|
572
|
-
function isThreadInjected(threadId) {
|
|
572
|
+
function isThreadInjected(threadId, sessionId) {
|
|
573
573
|
const data = loadInjectedSet();
|
|
574
|
+
// Only consider threads injected in the SAME session — the file is shared
|
|
575
|
+
// across concurrent sessions and stale entries from other sessions must
|
|
576
|
+
// not suppress injection.
|
|
577
|
+
if (sessionId && data.session_id && data.session_id !== sessionId) {
|
|
578
|
+
return false;
|
|
579
|
+
}
|
|
574
580
|
return (data.thread_ids || []).includes(threadId);
|
|
575
581
|
}
|
|
576
582
|
|