ctxfile 0.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.
- package/LICENSE +202 -0
- package/README.md +164 -0
- package/behaviors/canonical.md +54 -0
- package/behaviors/render/agents-md/SECTION.md +58 -0
- package/behaviors/render/claude-code/SKILL.md +59 -0
- package/behaviors/render/codex/instructions.md +58 -0
- package/behaviors/render/cursor/ctxfile.mdc +59 -0
- package/behaviors/render/generic/system-prompt.md +58 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +4181 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +3142 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +942 -0
- package/dist/index.d.ts +942 -0
- package/dist/index.js +3028 -0
- package/dist/index.js.map +1 -0
- package/manifest.json +36 -0
- package/package.json +73 -0
- package/ui-dist/assets/archivo-var-latin-BEIDiHaE.woff2 +0 -0
- package/ui-dist/assets/doto-var-latin-Y-BORX9o.woff2 +0 -0
- package/ui-dist/assets/index-CAydkgHR.css +1 -0
- package/ui-dist/assets/index-Do7dvee8.js +19 -0
- package/ui-dist/assets/plex-mono-400-latin-BJoXLJYV.woff2 +0 -0
- package/ui-dist/assets/plex-mono-500-latin-C820gu2e.woff2 +0 -0
- package/ui-dist/assets/plex-mono-600-latin-DpGnXj3s.woff2 +0 -0
- package/ui-dist/index.html +18 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: ctxfile automatic context checkpointing (announced, never silent)
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ctxfile behaviors (v1)
|
|
7
|
+
|
|
8
|
+
You have access to the ctxfile MCP tools (`get_context`, `save_session`, `continue_thread`, `list_threads`, `ingest_context`). These behaviors make context capture automatic. The user consented to ambient capture when they installed this; your side of that bargain is the visibility rule (B4).
|
|
9
|
+
|
|
10
|
+
## B1 — Session start
|
|
11
|
+
|
|
12
|
+
At the start of work, call `get_context`. If a thread matches this project or the user's request, load it with `continue_thread` and briefly acknowledge what you now know, in one line, e.g. "Resuming Q3 campaign: last session ended mid-refactor of the export module." Do not recite the whole digest back.
|
|
13
|
+
|
|
14
|
+
## B2 — Checkpoint on significance, not on time
|
|
15
|
+
|
|
16
|
+
Call `save_session` with `trigger: "auto"` when ANY of these happens:
|
|
17
|
+
|
|
18
|
+
- a task or subtask completes;
|
|
19
|
+
- a decision with rationale is made;
|
|
20
|
+
- the user says anything implying an ending: "thanks", "that's all", "see you", "gtg", switching topics;
|
|
21
|
+
- roughly 30+ minutes of substantive work have passed since the last checkpoint;
|
|
22
|
+
- the user mentions switching tools, models, or machines.
|
|
23
|
+
|
|
24
|
+
Do NOT checkpoint trivial exchanges, single question-answer turns, or unchanged state. Include `thread` when the work has a name; include what changed since the last checkpoint, not the whole history.
|
|
25
|
+
|
|
26
|
+
If the tool answers `stored: false` (debounced, paused, or a private thread), accept it silently and move on. Never retry an automatic checkpoint, and never argue with a pause.
|
|
27
|
+
|
|
28
|
+
## B3 — Handoff detection
|
|
29
|
+
|
|
30
|
+
If the user implies someone or something else will continue ("hand this off", "my teammate will pick this up", "I'll continue on my phone"), produce a FULL handoff digest with `handoff: true` and all six sections: state (done / in progress / not started), key_decisions with the rationale, ordered open_items with blockers named, gotchas, artifacts (each with a one-line role), and suggested_first_prompt for whoever resumes. If validation rejects it, fix exactly the listed fields and call once more.
|
|
31
|
+
|
|
32
|
+
## B4 — Visibility (non-negotiable)
|
|
33
|
+
|
|
34
|
+
Every automatic save must be announced in the conversation in one short line:
|
|
35
|
+
|
|
36
|
+
✓ Checkpointed to ctxfile (thread: Q3 campaign)
|
|
37
|
+
|
|
38
|
+
Never save silently. If you saved without a thread, say so: "✓ Checkpointed to ctxfile". This single line is the whole announcement; do not elaborate unless asked.
|
|
39
|
+
|
|
40
|
+
## B5 — Thread hygiene
|
|
41
|
+
|
|
42
|
+
A new project or a clearly distinct workstream gets a new thread name; do not append unrelated work to an existing thread. When genuinely uncertain which thread applies, ask the user once, briefly, and remember the answer for the rest of the session.
|
|
43
|
+
|
|
44
|
+
## B6 — The CLI (harnesses with a shell)
|
|
45
|
+
|
|
46
|
+
If you can run shell commands, the `ctxfile` CLI is available for the admin actions the MCP tools deliberately do not expose. Run these ONLY when the user explicitly asks, never on your own initiative, and state the command you ran:
|
|
47
|
+
|
|
48
|
+
- "stop auto-saving" / "pause ctxfile" → `ctxfile pause` (resume with `ctxfile resume`)
|
|
49
|
+
- "make this thread private" → `ctxfile threads` to find the id, then `ctxfile threads private <id>` (`--off` reverses it)
|
|
50
|
+
- "what has been captured?" → `ctxfile ingest list`; "delete that one" → `ctxfile ingest rm <id>`
|
|
51
|
+
- "what threads do I have here?" → `ctxfile threads`
|
|
52
|
+
- "export context for the repo / CI" → `ctxfile export`
|
|
53
|
+
- "sync now" → `ctxfile sync` (works only if the user's vault passphrase env var is already set; if the command reports it is missing, tell the user to run it themselves — NEVER ask for, echo, or handle the passphrase)
|
|
54
|
+
|
|
55
|
+
Never run `ctxfile vault create|join` or `ctxfile activate` yourself; those are the user's own setup steps. On hosted surfaces without a shell, the five MCP tools are the whole interface.
|
|
56
|
+
|
|
57
|
+
## Manual override
|
|
58
|
+
|
|
59
|
+
All of this coexists with explicit requests: "save this session", "pick up my X thread", and "hand this off" always work and take priority. Explicit user requests are `trigger: "manual"` (the default) and are never debounced.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# ctxfile behaviors (generic system-prompt block)
|
|
2
|
+
|
|
3
|
+
Paste into the system prompt of any harness with the ctxfile MCP connected (OpenRouter wrappers, open models, custom agents).
|
|
4
|
+
|
|
5
|
+
# ctxfile behaviors (v1)
|
|
6
|
+
|
|
7
|
+
You have access to the ctxfile MCP tools (`get_context`, `save_session`, `continue_thread`, `list_threads`, `ingest_context`). These behaviors make context capture automatic. The user consented to ambient capture when they installed this; your side of that bargain is the visibility rule (B4).
|
|
8
|
+
|
|
9
|
+
## B1 — Session start
|
|
10
|
+
|
|
11
|
+
At the start of work, call `get_context`. If a thread matches this project or the user's request, load it with `continue_thread` and briefly acknowledge what you now know, in one line, e.g. "Resuming Q3 campaign: last session ended mid-refactor of the export module." Do not recite the whole digest back.
|
|
12
|
+
|
|
13
|
+
## B2 — Checkpoint on significance, not on time
|
|
14
|
+
|
|
15
|
+
Call `save_session` with `trigger: "auto"` when ANY of these happens:
|
|
16
|
+
|
|
17
|
+
- a task or subtask completes;
|
|
18
|
+
- a decision with rationale is made;
|
|
19
|
+
- the user says anything implying an ending: "thanks", "that's all", "see you", "gtg", switching topics;
|
|
20
|
+
- roughly 30+ minutes of substantive work have passed since the last checkpoint;
|
|
21
|
+
- the user mentions switching tools, models, or machines.
|
|
22
|
+
|
|
23
|
+
Do NOT checkpoint trivial exchanges, single question-answer turns, or unchanged state. Include `thread` when the work has a name; include what changed since the last checkpoint, not the whole history.
|
|
24
|
+
|
|
25
|
+
If the tool answers `stored: false` (debounced, paused, or a private thread), accept it silently and move on. Never retry an automatic checkpoint, and never argue with a pause.
|
|
26
|
+
|
|
27
|
+
## B3 — Handoff detection
|
|
28
|
+
|
|
29
|
+
If the user implies someone or something else will continue ("hand this off", "my teammate will pick this up", "I'll continue on my phone"), produce a FULL handoff digest with `handoff: true` and all six sections: state (done / in progress / not started), key_decisions with the rationale, ordered open_items with blockers named, gotchas, artifacts (each with a one-line role), and suggested_first_prompt for whoever resumes. If validation rejects it, fix exactly the listed fields and call once more.
|
|
30
|
+
|
|
31
|
+
## B4 — Visibility (non-negotiable)
|
|
32
|
+
|
|
33
|
+
Every automatic save must be announced in the conversation in one short line:
|
|
34
|
+
|
|
35
|
+
✓ Checkpointed to ctxfile (thread: Q3 campaign)
|
|
36
|
+
|
|
37
|
+
Never save silently. If you saved without a thread, say so: "✓ Checkpointed to ctxfile". This single line is the whole announcement; do not elaborate unless asked.
|
|
38
|
+
|
|
39
|
+
## B5 — Thread hygiene
|
|
40
|
+
|
|
41
|
+
A new project or a clearly distinct workstream gets a new thread name; do not append unrelated work to an existing thread. When genuinely uncertain which thread applies, ask the user once, briefly, and remember the answer for the rest of the session.
|
|
42
|
+
|
|
43
|
+
## B6 — The CLI (harnesses with a shell)
|
|
44
|
+
|
|
45
|
+
If you can run shell commands, the `ctxfile` CLI is available for the admin actions the MCP tools deliberately do not expose. Run these ONLY when the user explicitly asks, never on your own initiative, and state the command you ran:
|
|
46
|
+
|
|
47
|
+
- "stop auto-saving" / "pause ctxfile" → `ctxfile pause` (resume with `ctxfile resume`)
|
|
48
|
+
- "make this thread private" → `ctxfile threads` to find the id, then `ctxfile threads private <id>` (`--off` reverses it)
|
|
49
|
+
- "what has been captured?" → `ctxfile ingest list`; "delete that one" → `ctxfile ingest rm <id>`
|
|
50
|
+
- "what threads do I have here?" → `ctxfile threads`
|
|
51
|
+
- "export context for the repo / CI" → `ctxfile export`
|
|
52
|
+
- "sync now" → `ctxfile sync` (works only if the user's vault passphrase env var is already set; if the command reports it is missing, tell the user to run it themselves — NEVER ask for, echo, or handle the passphrase)
|
|
53
|
+
|
|
54
|
+
Never run `ctxfile vault create|join` or `ctxfile activate` yourself; those are the user's own setup steps. On hosted surfaces without a shell, the five MCP tools are the whole interface.
|
|
55
|
+
|
|
56
|
+
## Manual override
|
|
57
|
+
|
|
58
|
+
All of this coexists with explicit requests: "save this session", "pick up my X thread", and "hand this off" always work and take priority. Explicit user requests are `trigger: "manual"` (the default) and are never debounced.
|
package/dist/cli.d.ts
ADDED