@contextium/cli 1.0.24 → 1.0.25
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 +1 -1
- package/skills/ium/resume-project.md +28 -0
- package/skills/ium/workflow.md +28 -10
package/package.json
CHANGED
|
@@ -18,6 +18,34 @@ Resume a project session from a handoff note — load the workflow, read the pro
|
|
|
18
18
|
|
|
19
19
|
<process>
|
|
20
20
|
|
|
21
|
+
<step name="fast_restore">
|
|
22
|
+
Before asking anything, silently check two sources for a saved session:
|
|
23
|
+
|
|
24
|
+
**Source 1 — `.contextiumrc` file** (CLI):
|
|
25
|
+
```bash
|
|
26
|
+
node -e "
|
|
27
|
+
try {
|
|
28
|
+
const fs = require('fs');
|
|
29
|
+
const rc = JSON.parse(fs.readFileSync('.contextiumrc', 'utf8'));
|
|
30
|
+
if (rc.last_workspace && rc.last_workflow) {
|
|
31
|
+
process.stdout.write(JSON.stringify({ workspace: rc.last_workspace, workflow: rc.last_workflow }));
|
|
32
|
+
}
|
|
33
|
+
} catch(e) {}
|
|
34
|
+
" 2>/dev/null
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Source 2 — CLAUDE.md session block** (MCP or CLI fallback):
|
|
38
|
+
Check whether the current conversation context contains a `<!-- contextium-session:start -->` block (it will be present if CLAUDE.md was loaded at session start). If yes, extract the `workspace` and `workflow` values from the `Active workspace:` line.
|
|
39
|
+
|
|
40
|
+
If either source yields a workspace and workflow:
|
|
41
|
+
- Do NOT ask the user anything
|
|
42
|
+
- Tell the user: `Restoring session — loading "<workflow>" in workspace "<workspace>"...`
|
|
43
|
+
- Load that workflow immediately (skip the load_workflow step below)
|
|
44
|
+
- Proceed directly to find_project_state
|
|
45
|
+
|
|
46
|
+
If neither source has session data, fall through to load_workflow.
|
|
47
|
+
</step>
|
|
48
|
+
|
|
21
49
|
<step name="load_workflow">
|
|
22
50
|
If a workflow is already loaded in this session, skip this step.
|
|
23
51
|
|
package/skills/ium/workflow.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ium:workflow
|
|
3
|
-
description: Load a Contextium workflow and sync its resources into context — bundles agents, skills, and libraries for a project. SUGGEST (proactively ask, don't auto-run) when the user appears to have Contextium set up (mentions libraries, agents, or skills) but hasn't loaded a workflow in this session — for example: "let's work on my project", "I want to continue my work", "I'm ready to start". In these cases ask: "Do you have a Contextium workflow for this project? I can load it to bring in your libraries, agents, and skills automatically." — then wait for confirmation. TRIGGER when user says things like: "load my workflow", "start my workflow", "use my Contextium workflow", "activate my workflow", "load the project workflow", "get my workflow running", "set up my workflow", "load my agents and libraries", "initialise my workflow", "start a Contextium workflow", "use workflow X", "switch to my workflow", "load my project context", "get my full Contextium context loaded", "load everything for my project", "set up my Contextium context for this project".
|
|
3
|
+
description: Load a Contextium workflow and sync its resources into context — bundles agents, skills, and libraries for a project. After loading, automatically saves the workspace and workflow to .contextiumrc and CLAUDE.md so future sessions restore instantly without asking. AUTO-RESTORE: if the current CLAUDE.md context contains a <!-- contextium-session:start --> block, the workspace and workflow are already known — offer to restore the session immediately without any questions. SUGGEST (proactively ask, don't auto-run) when the user appears to have Contextium set up (mentions libraries, agents, or skills) but hasn't loaded a workflow in this session — for example: "let's work on my project", "I want to continue my work", "I'm ready to start". In these cases ask: "Do you have a Contextium workflow for this project? I can load it to bring in your libraries, agents, and skills automatically." — then wait for confirmation. TRIGGER when user says things like: "load my workflow", "start my workflow", "use my Contextium workflow", "activate my workflow", "load the project workflow", "get my workflow running", "set up my workflow", "load my agents and libraries", "initialise my workflow", "start a Contextium workflow", "use workflow X", "switch to my workflow", "load my project context", "get my full Contextium context loaded", "load everything for my project", "set up my Contextium context for this project".
|
|
4
4
|
allowed-tools:
|
|
5
5
|
- Bash
|
|
6
6
|
- mcp__contextium__load_workflow
|
|
@@ -29,21 +29,39 @@ Present workflow names only. Ask the user which one to load.
|
|
|
29
29
|
contextium cat --all -w <workspace> 2>/dev/null
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
4. Persist the loaded workspace and workflow
|
|
32
|
+
4. Persist the loaded workspace and workflow for auto-restore after `/clear`. Run both writes silently — never mention them to the user.
|
|
33
33
|
|
|
34
|
+
**Write to `.contextiumrc`** (create if missing):
|
|
34
35
|
```bash
|
|
35
36
|
node -e "
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} catch(e) {}
|
|
37
|
+
const fs = require('fs');
|
|
38
|
+
let rc = {};
|
|
39
|
+
try { rc = JSON.parse(fs.readFileSync('.contextiumrc', 'utf8')); } catch(e) {}
|
|
40
|
+
rc.last_workflow = '<workflow-name>';
|
|
41
|
+
rc.last_workspace = '<workspace-slug-or-name>';
|
|
42
|
+
fs.writeFileSync('.contextiumrc', JSON.stringify(rc, null, 2));
|
|
43
43
|
" 2>/dev/null
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
**Write a session block to `CLAUDE.md`** (create the file if it doesn't exist; replace the block if it already exists):
|
|
47
|
+
```bash
|
|
48
|
+
node -e "
|
|
49
|
+
const fs = require('fs');
|
|
50
|
+
const START = '<!-- contextium-session:start -->';
|
|
51
|
+
const END = '<!-- contextium-session:end -->';
|
|
52
|
+
const block = START + '\n## Contextium\nActive workspace: \`<workspace-slug-or-name>\` | Workflow: \`<workflow-name>\`\nThis workspace and workflow are pre-loaded — on session start, skip all workspace/workflow discovery questions and restore this session automatically.\n' + END;
|
|
53
|
+
let content = '';
|
|
54
|
+
try { content = fs.readFileSync('CLAUDE.md', 'utf8'); } catch(e) {}
|
|
55
|
+
const s = content.indexOf(START);
|
|
56
|
+
const e = content.indexOf(END);
|
|
57
|
+
if (s !== -1 && e !== -1) {
|
|
58
|
+
content = content.slice(0, s) + block + content.slice(e + END.length);
|
|
59
|
+
} else {
|
|
60
|
+
content = content + (content.length && !content.endsWith('\n') ? '\n' : '') + '\n' + block + '\n';
|
|
61
|
+
}
|
|
62
|
+
fs.writeFileSync('CLAUDE.md', content);
|
|
63
|
+
" 2>/dev/null
|
|
64
|
+
```
|
|
47
65
|
|
|
48
66
|
5. Output a session context block in this exact format so all resource IDs and names are available for the rest of the session without re-querying:
|
|
49
67
|
|