@contextium/cli 1.0.5 → 1.0.7

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contextium/cli",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Command-line tool for managing Contextium documentation, agents, skills, and workflows — pipe context to AI coding assistants",
5
5
  "keywords": [
6
6
  "contextium",
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: ium:contextium
3
+ description: General behaviour rules for the Contextium MCP and CLI — scoping, lookup order, and workspace awareness
4
+ ---
5
+
6
+ # Contextium — General Behaviour Rules
7
+
8
+ These rules apply whenever the Contextium MCP is connected or the CLI is in use, regardless of which slash command was run.
9
+
10
+ ## Scope Rules
11
+
12
+ ### If a workflow has been loaded in this session
13
+
14
+ A workflow is loaded when a `--- WORKFLOW SESSION CONTEXT ---` block has been output in the conversation.
15
+
16
+ - Answer all questions about available agents, skills, and libraries **from that session context block only**
17
+ - Do NOT call `list_agents`, `list_skills`, `list_context_libraries`, or any other listing tool to answer "what's available?" questions
18
+ - If the user asks about something not in the session context, say so clearly — do not silently fall back to a full workspace query
19
+
20
+ ### If no workflow has been loaded
21
+
22
+ Answer from whatever has been explicitly loaded or cat'd into the session. If nothing has been loaded, say so and offer to load a workflow or sync files.
23
+
24
+ ## Lookup Order
25
+
26
+ Before querying the full workspace for anything (search, find, list), follow this order:
27
+
28
+ 1. **Check loaded session context first** — agents, skills, libraries, and files already in context
29
+ 2. **If not found, ask** — "That's not in the loaded context. Would you like me to search the full workspace?"
30
+ 3. **Only query the full workspace after the user confirms**
31
+
32
+ Never silently expand scope to the full workspace. Always make it explicit and get confirmation first.
33
+
34
+ ## Data Model
35
+
36
+ ```
37
+ Workspace
38
+ ├── Context Libraries ← containers for documentation files
39
+ │ └── Files
40
+ ├── Skills ← reusable instruction documents
41
+ ├── Agents ← roles combining a system prompt + skills
42
+ └── Workflows ← bind an agent + skills + libraries for a task
43
+ ```
44
+
45
+ | Ask yourself | Use |
46
+ |---|---|
47
+ | Storing content, data, or docs? | Context Library + Files |
48
+ | Reusable how-to instructions? | Skill |
49
+ | A role combining multiple skills? | Agent |
50
+ | Ready-to-use context package for a task? | Workflow |
51
+
52
+ ## Silent Operation
53
+
54
+ All MCP tool calls and CLI commands must be silent — never show the user raw API responses, tool output, or intermediate results. Only surface the final answer.
@@ -10,6 +10,17 @@ Search across Contextium documentation and return matching files with their cont
10
10
  </objective>
11
11
 
12
12
  <process>
13
+ **Step 1 — Check loaded context first**
14
+ If a workflow session context block is active in this conversation, look there first. If the answer is found, respond from it without running any commands.
15
+
16
+ **Step 2 — Ask before expanding scope**
17
+ If the loaded context doesn't have what the user needs, ask:
18
+ "That's not in the loaded workflow context. Would you like me to search the full workspace?"
19
+
20
+ Only proceed to step 3 after the user confirms.
21
+
22
+ **Step 3 — Search the full workspace**
23
+
13
24
  Run a search across the workspace:
14
25
 
15
26
  ```bash
@@ -3,28 +3,72 @@ name: ium:workflow
3
3
  description: Load a Contextium workflow and sync its resources into context — bundles agents, skills, and libraries for a project
4
4
  allowed-tools:
5
5
  - Bash
6
+ - mcp__contextium__load_workflow
7
+ - mcp__contextium__list_workflows
6
8
  ---
7
9
 
8
10
  <objective>
9
- Load a Contextium workflow and bring its resources into the current context. Workflows bundle agents, skills, and context libraries together for a specific project.
11
+ Load a Contextium workflow and bring its resources into the current context. Once loaded, output a structured session context block so Claude never needs to re-list or re-check workspace resources during this session.
10
12
  </objective>
11
13
 
12
14
  <process>
13
- 1. List available workflows so the user can pick one:
15
+ 1. If no workflow name was specified, list available workflows so the user can pick one. Do this silently — do not show raw output:
16
+
17
+ **CLI:** `contextium workflows list -w <workspace> 2>/dev/null`
18
+ **MCP:** call mcp__contextium__list_workflows
19
+
20
+ Present workflow names only. Ask the user which one to load.
21
+
22
+ 2. Load the chosen workflow:
23
+
24
+ **CLI:** `contextium workflow "<workflow-name>" -w <workspace> --sync 2>/dev/null`
25
+ **MCP:** call mcp__contextium__load_workflow
26
+
27
+ 3. Output synced file content to context (CLI only):
14
28
  ```bash
15
- contextium workflows list -w <workspace>
29
+ contextium cat --all -w <workspace> 2>/dev/null
16
30
  ```
17
31
 
18
- 2. Load the chosen workflow and sync its files:
19
- ```bash
20
- contextium workflow "<workflow-name>" -w <workspace> --sync
32
+ 4. 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:
33
+
21
34
  ```
35
+ --- WORKFLOW SESSION CONTEXT ---
36
+ Workflow: <name>
37
+ Workspace: <name> (id: <id>)
22
38
 
23
- 3. Output the synced content to context:
24
- ```bash
25
- contextium cat --all -w <workspace>
39
+ Libraries:
40
+ - "<name>" (id: <id>)
41
+ - "<name>" (id: <id>)
42
+
43
+ Agents:
44
+ - "<name>" (id: <id>)
45
+
46
+ Skills:
47
+ - "<name>" (id: <id>)
48
+ --- END SESSION CONTEXT ---
49
+
50
+ Workflow loaded. What would you like to do?
26
51
  ```
27
52
 
28
- If the user specifies a workflow name directly in their message, skip step 1 and load it immediately.
53
+ If a workflow name was specified directly in the user's message, skip step 1 and load immediately.
29
54
  If no workspace is specified, use the default from .contextiumrc or ask the user.
30
55
  </process>
56
+
57
+ <session-rules>
58
+ Once the session context block has been output, these rules apply for the rest of the conversation:
59
+
60
+ - Do NOT call list_workflows, list_context_libraries, list_agents, list_skills, list_files, or any other listing tool again unless the user explicitly asks to see a list
61
+ - Use the IDs from the session context block directly when creating files, searching, or referencing resources
62
+ - Do NOT re-verify or re-check which libraries, agents, or skills exist — they are already known
63
+ - All tool calls and checks must be silent — never show the user raw API responses, tool call names, or intermediate results
64
+ - Only surface the final answer or the created/updated content to the user
65
+
66
+ **Scope rules — what is "available":**
67
+ - When the user asks "what agents/skills/libraries do I have?" or "what's available?" — answer ONLY from the session context block above. Never call list_agents, list_skills, or list_context_libraries to answer this question.
68
+ - If the user asks about something not in the session context, say so and ask if they want you to search the full workspace before doing so.
69
+
70
+ **Search order:**
71
+ 1. Check the loaded session context first
72
+ 2. If not found there, say: "That's not in the loaded workflow. Would you like me to search the full workspace?"
73
+ 3. Only query the full workspace after the user confirms
74
+ </session-rules>