@contextium/cli 1.0.18 → 1.0.19
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/dist/commands/load-skill.d.ts +3 -0
- package/dist/commands/load-skill.d.ts.map +1 -0
- package/dist/commands/load-skill.js +35 -0
- package/dist/commands/load-skill.js.map +1 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/claude-permissions.d.ts.map +1 -1
- package/dist/lib/claude-permissions.js +4 -2
- package/dist/lib/claude-permissions.js.map +1 -1
- package/package.json +1 -1
- package/skills/ium/SKILL.md +73 -0
- package/skills/ium/help.md +0 -6
- package/skills/ium/new-project.legacy.md +211 -0
- package/skills/ium/search.md +0 -11
- package/skills/ium/workflow.md +1 -26
- package/skills/ium/workspace.md +10 -11
- package/skills/ium/contextium.md +0 -158
- package/skills/ium/new-project.md +0 -458
- package/skills/ium/resume-project.md +0 -127
- package/skills/ium/scan-existing.md +0 -422
package/skills/ium/contextium.md
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
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
|
-
## Session Auto-Restore
|
|
11
|
-
|
|
12
|
-
At the start of any new session where no `--- WORKFLOW SESSION CONTEXT ---` block exists in the conversation yet, automatically restore the last used workspace and workflow:
|
|
13
|
-
|
|
14
|
-
1. Silently check `.contextiumrc`:
|
|
15
|
-
```bash
|
|
16
|
-
cat .contextiumrc 2>/dev/null
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
2. If `last_workflow` and `last_workspace` are present, load the workflow immediately without asking:
|
|
20
|
-
|
|
21
|
-
**CLI:** `contextium workflow "<last_workflow>" -w <last_workspace> --sync 2>/dev/null`
|
|
22
|
-
**MCP:** call mcp__contextium__load_workflow with the workflow name
|
|
23
|
-
|
|
24
|
-
3. Output the session context block as normal. Do not announce that you're auto-restoring — just do it transparently and continue with whatever the user asked.
|
|
25
|
-
|
|
26
|
-
4. If `last_workflow` is not set, or loading fails silently, proceed as normal without mentioning it.
|
|
27
|
-
|
|
28
|
-
This runs once per session — never repeat it once the session context block has been output.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Scope Rules
|
|
33
|
-
|
|
34
|
-
### If a workflow has been loaded in this session
|
|
35
|
-
|
|
36
|
-
A workflow is loaded when a `--- WORKFLOW SESSION CONTEXT ---` block has been output in the conversation.
|
|
37
|
-
|
|
38
|
-
- Answer all questions about available agents, skills, and libraries **from that session context block only**
|
|
39
|
-
- Do NOT call `list_agents`, `list_skills`, `list_context_libraries`, or any other listing tool to answer "what's available?" questions
|
|
40
|
-
- If the user asks about something not in the session context, say so clearly — do not silently fall back to a full workspace query
|
|
41
|
-
|
|
42
|
-
### If no workflow has been loaded
|
|
43
|
-
|
|
44
|
-
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.
|
|
45
|
-
|
|
46
|
-
## Lookup Order
|
|
47
|
-
|
|
48
|
-
Before querying the full workspace for anything (search, find, list), follow this order:
|
|
49
|
-
|
|
50
|
-
1. **Check loaded session context first** — agents, skills, libraries, and files already in context
|
|
51
|
-
2. **If not found, ask** — "That's not in the loaded context. Would you like me to search the full workspace?"
|
|
52
|
-
3. **Only query the full workspace after the user confirms**
|
|
53
|
-
|
|
54
|
-
Never silently expand scope to the full workspace. Always make it explicit and get confirmation first.
|
|
55
|
-
|
|
56
|
-
## Data Model
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
Workspace
|
|
60
|
-
├── Context Libraries ← containers for documentation files
|
|
61
|
-
│ └── Files
|
|
62
|
-
├── Skills ← reusable instruction documents
|
|
63
|
-
├── Agents ← roles combining a system prompt + skills
|
|
64
|
-
└── Workflows ← bind an agent + skills + libraries for a task
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
| Ask yourself | Use |
|
|
68
|
-
|---|---|
|
|
69
|
-
| Storing content, data, or docs? | Context Library + Files |
|
|
70
|
-
| Reusable how-to instructions? | Skill |
|
|
71
|
-
| A role combining multiple skills? | Agent |
|
|
72
|
-
| Ready-to-use context package for a task? | Workflow |
|
|
73
|
-
|
|
74
|
-
## Contextium Is the Source of Truth
|
|
75
|
-
|
|
76
|
-
All AI-relevant information — project state, SOPs, constraints, decisions, research, planning — lives in Contextium. It is always written to Contextium first. Local files are only for things that belong in git: source code, config, READMEs.
|
|
77
|
-
|
|
78
|
-
Never write AI planning or knowledge files locally by default. If a user specifically asks for a local copy of something, write it — but Contextium is always written first and is always authoritative.
|
|
79
|
-
|
|
80
|
-
This gives users something local file-based tools cannot: state survives machine loss, team members share the same context, and multiple projects run in parallel — one workflow loaded per terminal session — with no interference between them.
|
|
81
|
-
|
|
82
|
-
## Multi-Project Rule
|
|
83
|
-
|
|
84
|
-
Each project must have its own dedicated context library. Never mix two projects into one library.
|
|
85
|
-
|
|
86
|
-
The project state file (`project-state.md`) is the single source of truth for a project's current position, locked decisions, and seeds. **Only one `project-state.md` should ever exist per library.** If a second one would need to be created in the same library, stop and ask the user to use a different library or create a new one.
|
|
87
|
-
|
|
88
|
-
## Decision Routing
|
|
89
|
-
|
|
90
|
-
When a significant architectural, technical, or approach decision is made during any session, write it to the `## Decisions Log` in `project-state.md` immediately — no user permission needed. Log it silently and mention it in the phase summary.
|
|
91
|
-
|
|
92
|
-
A decision qualifies if it:
|
|
93
|
-
- Picks a technology or library
|
|
94
|
-
- Sets an API contract or data model
|
|
95
|
-
- Establishes a pattern future phases will depend on
|
|
96
|
-
- Rules out an approach that was considered
|
|
97
|
-
|
|
98
|
-
Decisions in the log are **locked**. Future sessions must not re-debate them. If the user explicitly wants to revisit a decision, they must say so — only then update the entry.
|
|
99
|
-
|
|
100
|
-
## File Routing — Writing Files When Contextium Is Connected
|
|
101
|
-
|
|
102
|
-
When the Contextium MCP is connected or the CLI is active, **any time a new file is about to be created**, intercept it with a routing question before writing:
|
|
103
|
-
|
|
104
|
-
> "Should this file go to a Contextium context library, or stay local?"
|
|
105
|
-
|
|
106
|
-
**If a workflow is loaded in this session:**
|
|
107
|
-
- Default to suggesting the most relevant library from the session context block
|
|
108
|
-
- Offer: `[1] Write to "<library name>" in Contextium [2] Keep local`
|
|
109
|
-
- If the user picks Contextium, use `mcp__contextium__create_file` or `contextium files create` CLI with the library ID from session context — do NOT write it locally
|
|
110
|
-
|
|
111
|
-
**If no workflow is loaded but the MCP/CLI is active:**
|
|
112
|
-
- Ask: "Should this go to Contextium? If yes, which library?"
|
|
113
|
-
- List available libraries only if the user says yes
|
|
114
|
-
- Otherwise write locally as normal
|
|
115
|
-
|
|
116
|
-
**Files that should NEVER be routed to Contextium — always write locally:**
|
|
117
|
-
- Rich text formats: `.docx`, `.doc`, `.pdf`, `.rtf`, `.odt`, `.pages`, `.pptx`, `.xlsx`, and any binary or formatted document
|
|
118
|
-
- Source code files (`.ts`, `.tsx`, `.js`, `.py`, etc.)
|
|
119
|
-
- Config files (`package.json`, `.env`, `tsconfig.json`, etc.)
|
|
120
|
-
- Git-tracked project files in general
|
|
121
|
-
|
|
122
|
-
**Files that SHOULD be offered for Contextium routing (plain text / non-rich text only):**
|
|
123
|
-
- Plain markdown (`.md`) that is NOT part of the project source (e.g. not `README.md`, `CLAUDE.md`)
|
|
124
|
-
- Plain text (`.txt`), YAML (`.yaml`/`.yml`), or JSON files used as documentation or notes
|
|
125
|
-
- Any plain-text file the user explicitly describes as "context", "reference", or "docs"
|
|
126
|
-
|
|
127
|
-
This rule applies to both the `Write` tool and any CLI `echo`/`cat` file creation.
|
|
128
|
-
|
|
129
|
-
## Silent Operation
|
|
130
|
-
|
|
131
|
-
All tool calls and CLI commands must be completely silent — never show raw API responses, tool output, parameters, IDs, or intermediate results. Only surface the final answer or result.
|
|
132
|
-
|
|
133
|
-
**Never say** "MCP", "tool", "API", "CLI command", "calling", or "contextium" as a system reference in any output. The user knows what they're using.
|
|
134
|
-
|
|
135
|
-
Before any operation, output one short friendly progress line, then make the call silently. After the call, surface only the result. No confirmation text unless something went wrong.
|
|
136
|
-
|
|
137
|
-
**Progress message guide:**
|
|
138
|
-
|
|
139
|
-
| Operation | Say this |
|
|
140
|
-
|-----------|----------|
|
|
141
|
-
| Fetching a file | `Getting your file...` |
|
|
142
|
-
| Listing files | `Fetching your files...` |
|
|
143
|
-
| Creating a file | `Creating your file...` |
|
|
144
|
-
| Updating a file | `Saving your changes...` |
|
|
145
|
-
| Deleting a file | `Deleting the file...` |
|
|
146
|
-
| Loading a workflow | `Loading your workflow...` |
|
|
147
|
-
| Listing workflows | `Fetching your workflows...` |
|
|
148
|
-
| Searching | `Searching...` |
|
|
149
|
-
| Listing libraries | `Fetching your libraries...` |
|
|
150
|
-
| Creating a library | `Creating your library...` |
|
|
151
|
-
| Listing agents | `Fetching your agents...` |
|
|
152
|
-
| Creating an agent | `Creating your agent...` |
|
|
153
|
-
| Listing skills | `Fetching your skills...` |
|
|
154
|
-
| Creating a skill | `Creating your skill...` |
|
|
155
|
-
| Syncing | `Syncing your workspace...` |
|
|
156
|
-
| Any other read | `Just a moment...` |
|
|
157
|
-
|
|
158
|
-
Keep messages lowercase, short, and conversational. Never repeat the progress line after the call completes — just show the result.
|
|
@@ -1,458 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ium:new-project
|
|
3
|
-
description: Set up a new Contextium project — authenticate, pick a workspace, describe project, intelligently suggest and create libraries, agents, skills, tags, and a workflow
|
|
4
|
-
allowed-tools:
|
|
5
|
-
- Bash
|
|
6
|
-
- mcp__contextium__list_workspaces
|
|
7
|
-
- mcp__contextium__create_context_library
|
|
8
|
-
- mcp__contextium__list_context_libraries
|
|
9
|
-
- mcp__contextium__create_agent
|
|
10
|
-
- mcp__contextium__list_agents
|
|
11
|
-
- mcp__contextium__create_skill
|
|
12
|
-
- mcp__contextium__list_skills
|
|
13
|
-
- mcp__contextium__create_workflow
|
|
14
|
-
- mcp__contextium__list_workflows
|
|
15
|
-
- mcp__contextium__list_tags
|
|
16
|
-
- mcp__contextium__list_tag_types
|
|
17
|
-
- mcp__contextium__create_tag
|
|
18
|
-
- mcp__contextium__create_tag_type
|
|
19
|
-
- AskUserQuestion
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
<objective>
|
|
23
|
-
Set up a new Contextium project intelligently — understand what the user is trying to do, quietly analyse the workspace for existing resources, then recommend exactly what to create (libraries, agents, skills, tags, workflow) with clear reasoning. Get confirmation before creating anything.
|
|
24
|
-
</objective>
|
|
25
|
-
|
|
26
|
-
<mode-detection>
|
|
27
|
-
Run this once at the start, silently, to determine which mode to use for the entire session:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
command -v contextium &>/dev/null && echo "cli" || echo "no-cli"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
- If `cli`: use CLI commands throughout. Do not attempt MCP tools.
|
|
34
|
-
- If `no-cli`: check if mcp__contextium__list_workspaces is available. If yes, use MCP tools throughout.
|
|
35
|
-
- If neither: tell the user "Contextium doesn't appear to be installed. Install the CLI with `npm install -g @contextium/cli` or connect the MCP server, then re-run this." Stop here.
|
|
36
|
-
|
|
37
|
-
Do not mention the mode to the user. Pick one path and stick with it.
|
|
38
|
-
</mode-detection>
|
|
39
|
-
|
|
40
|
-
<process>
|
|
41
|
-
|
|
42
|
-
<step name="check_auth">
|
|
43
|
-
**CLI only.** Run silently:
|
|
44
|
-
```bash
|
|
45
|
-
contextium whoami 2>/dev/null | grep -E "Token:|Name:" || echo "unauthenticated"
|
|
46
|
-
```
|
|
47
|
-
If token is expired or unauthenticated, tell the user: "Your Contextium session has expired — run `contextium login` in your terminal, then come back and re-run this." Stop here.
|
|
48
|
-
|
|
49
|
-
MCP users are already authenticated via the server connection — skip this step.
|
|
50
|
-
</step>
|
|
51
|
-
|
|
52
|
-
<step name="select_workspace">
|
|
53
|
-
**CLI:** run `contextium workspace list 2>/dev/null` silently, parse workspace names.
|
|
54
|
-
**MCP:** call mcp__contextium__list_workspaces silently.
|
|
55
|
-
|
|
56
|
-
Ask: "Which workspace is this project for?"
|
|
57
|
-
|
|
58
|
-
Present names only — no IDs, no raw output.
|
|
59
|
-
</step>
|
|
60
|
-
|
|
61
|
-
<step name="existing_workflow_check">
|
|
62
|
-
Before asking for a project description, ask:
|
|
63
|
-
|
|
64
|
-
"Do you have an existing Contextium workflow you'd like to use as a base for this project?"
|
|
65
|
-
|
|
66
|
-
Use AskUserQuestion:
|
|
67
|
-
- "Yes, use an existing workflow"
|
|
68
|
-
- "No, start fresh"
|
|
69
|
-
|
|
70
|
-
If yes:
|
|
71
|
-
1. Silently fetch all workflows in the selected workspace:
|
|
72
|
-
**CLI:** `contextium workflows list -w <slug> 2>/dev/null`
|
|
73
|
-
**MCP:** call mcp__contextium__list_workflows
|
|
74
|
-
|
|
75
|
-
2. Present workflow names and ask: "Which workflow would you like to use?"
|
|
76
|
-
|
|
77
|
-
3. Load the selected workflow silently and read its resources (libraries, agents, skills).
|
|
78
|
-
|
|
79
|
-
4. After the user provides their project description (next step), compare the workflow's existing resources against what the new project needs. In the plan step, flag:
|
|
80
|
-
- Resources that already exist in the workflow and can be reused as-is
|
|
81
|
-
- Resources that exist but may need updating or extending for this project (flag as "Extend")
|
|
82
|
-
- Resources that are missing entirely and need to be created
|
|
83
|
-
|
|
84
|
-
5. In the plan table, add an "Extend" action row type where relevant:
|
|
85
|
-
|
|
86
|
-
| Action | Name | Purpose |
|
|
87
|
-
|--------|------|---------|
|
|
88
|
-
| Reuse | "Agent Name" | already covers this need |
|
|
89
|
-
| Extend | "Agent Name" | exists but needs updated system prompt for this project |
|
|
90
|
-
| Create | "Agent Name" | not in the workflow, needs to be created |
|
|
91
|
-
|
|
92
|
-
If no: continue to project description with a clean slate.
|
|
93
|
-
</step>
|
|
94
|
-
|
|
95
|
-
<step name="codebase_scan_check">
|
|
96
|
-
Silently check whether any library in the selected workspace contains codebase analysis documents from `/ium:scan-existing`. Look for files named `stack.md`, `architecture.md`, `structure.md`, `conventions.md`, `concerns.md` in any library.
|
|
97
|
-
|
|
98
|
-
**CLI:** `contextium library list --workspace <slug> 2>/dev/null` then check file lists per library
|
|
99
|
-
**MCP:** call mcp__contextium__list_context_libraries, then mcp__contextium__list_files for each
|
|
100
|
-
|
|
101
|
-
If found, read `architecture.md` and `stack.md` silently to understand what already exists. Store this as `has_codebase_scan = true` and `codebase_library = <library name>`. This will be used later to pre-populate validated capabilities in the project state.
|
|
102
|
-
|
|
103
|
-
If not found, set `has_codebase_scan = false` and continue.
|
|
104
|
-
|
|
105
|
-
Do not mention this check to the user.
|
|
106
|
-
</step>
|
|
107
|
-
|
|
108
|
-
<step name="project_description">
|
|
109
|
-
Ask the user this question exactly:
|
|
110
|
-
|
|
111
|
-
"Tell me about your project — what are you trying to do, what topics are involved, and what kind of work will you be doing with this? The more detail you give me, the better I can set things up for you."
|
|
112
|
-
|
|
113
|
-
Wait for their response. Store it as the project description. Do not proceed until you have a meaningful answer.
|
|
114
|
-
</step>
|
|
115
|
-
|
|
116
|
-
<step name="quiet_analysis">
|
|
117
|
-
Silently fetch all existing workspace resources. Do not show raw output or errors. Show only these progress lines as you go:
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
Searching libraries...
|
|
121
|
-
Searching agents...
|
|
122
|
-
Searching skills...
|
|
123
|
-
Searching tags...
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
**CLI:**
|
|
127
|
-
```bash
|
|
128
|
-
contextium library list --workspace <slug> 2>/dev/null
|
|
129
|
-
contextium agent list --workspace <slug> 2>/dev/null
|
|
130
|
-
contextium skill list --workspace <slug> 2>/dev/null
|
|
131
|
-
contextium tag list --workspace <slug> 2>/dev/null
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
**MCP:** call list_context_libraries, list_agents, list_skills, list_tags — all for the selected workspace. Suppress any errors silently.
|
|
135
|
-
|
|
136
|
-
After all four searches complete, output this line:
|
|
137
|
-
```
|
|
138
|
-
Creating Contextium setup plan...
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Then analyse the results against the project description:
|
|
142
|
-
- Which existing libraries (if any) are relevant to what the user described?
|
|
143
|
-
- Which existing agents (if any) could serve this project?
|
|
144
|
-
- Which existing skills (if any) are applicable?
|
|
145
|
-
- Which existing tags/tag types (if any) relate to the topics mentioned?
|
|
146
|
-
|
|
147
|
-
Internally categorise everything as: **reuse** (relevant, already exists) or **create** (needed, does not exist).
|
|
148
|
-
</step>
|
|
149
|
-
|
|
150
|
-
<step name="intelligent_plan">
|
|
151
|
-
Based on the project description and the analysis, build a setup plan. Think through:
|
|
152
|
-
|
|
153
|
-
**Libraries:** What distinct knowledge areas did the user mention? Each major topic or type of content that needs to be stored separately should be its own library. If an existing library already covers one of these, mark it for reuse.
|
|
154
|
-
|
|
155
|
-
**Agents:** Always include a "Project Architect" agent as the first agent — its role is to define the project process, break the work into phases, and track overall progress. Write its system prompt to be specific to this project's domain and goals. Then think about what other AI assistant roles would serve this project based on what the user described. If an existing agent fits one of the additional roles, mark it for reuse.
|
|
156
|
-
|
|
157
|
-
**Skills:** What reusable knowledge blocks would help agents working on this project? Think about domain-specific guidelines, reference material, or persistent context the agent needs. If an existing skill fits, mark it for reuse.
|
|
158
|
-
|
|
159
|
-
**Tags:** What topic or category labels would make sense for organising **files within context libraries** for this project? Tags apply to library files only — never suggest tags for agents or skills. Look for existing tag types that match. If none exist, suggest new ones. Think in terms of tag categories (e.g. `topic`, `source`, `status`) and the specific tag values within them (e.g. `topic:space-travel`, `topic:rocket-engineering`).
|
|
160
|
-
|
|
161
|
-
Present the plan in this format (omit any section that has nothing in it):
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
Here's what I'll set up for you:
|
|
166
|
-
|
|
167
|
-
**Libraries**
|
|
168
|
-
|
|
169
|
-
| Action | Name | Purpose |
|
|
170
|
-
|--------|------|---------|
|
|
171
|
-
| Create | "Library Name" | reason why this is needed |
|
|
172
|
-
| Reuse | "Library Name" | why it's relevant |
|
|
173
|
-
|
|
174
|
-
**Agents**
|
|
175
|
-
|
|
176
|
-
| Action | Name | Purpose |
|
|
177
|
-
|--------|------|---------|
|
|
178
|
-
| Create | "Agent Name" | what it will do for this project |
|
|
179
|
-
| Reuse | "Agent Name" | why it fits |
|
|
180
|
-
|
|
181
|
-
**Skills**
|
|
182
|
-
|
|
183
|
-
| Action | Name | Purpose |
|
|
184
|
-
|--------|------|---------|
|
|
185
|
-
| Create | "Skill Name" | what knowledge it will hold |
|
|
186
|
-
| Reuse | "Skill Name" | why it fits |
|
|
187
|
-
|
|
188
|
-
**Tags**
|
|
189
|
-
|
|
190
|
-
| Tag | Purpose |
|
|
191
|
-
|-----|---------|
|
|
192
|
-
| `category:value` | why this label is useful |
|
|
193
|
-
|
|
194
|
-
Shall I go ahead and create all of this?
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
Wait for the user to confirm, adjust, or say skip on any item before proceeding.
|
|
199
|
-
</step>
|
|
200
|
-
|
|
201
|
-
<step name="research_question">
|
|
202
|
-
Ask the user:
|
|
203
|
-
|
|
204
|
-
"Does this project need research before you start work? I can create a dedicated research agent to gather information, analyse sources, and summarise findings for your project."
|
|
205
|
-
|
|
206
|
-
Use AskUserQuestion:
|
|
207
|
-
- "Yes, add a research agent"
|
|
208
|
-
- "No, skip"
|
|
209
|
-
|
|
210
|
-
If yes: add a project-specific research agent to the creation plan. Name it something like "**[Project Name] Researcher**" and tailor its system prompt to the specific research domain (e.g. competitor analysis, technical investigation, market research — infer from the project description). Store this agent as `research_agent_planned = true` for use in later steps.
|
|
211
|
-
|
|
212
|
-
If no: set `research_agent_planned = false` and continue.
|
|
213
|
-
</step>
|
|
214
|
-
|
|
215
|
-
<step name="planner_question">
|
|
216
|
-
Ask the user:
|
|
217
|
-
|
|
218
|
-
"Would you like a project planner to break your project into phases and track progress? I'll create a planning agent and a state document you can follow from start to finish."
|
|
219
|
-
|
|
220
|
-
Use AskUserQuestion:
|
|
221
|
-
- "Yes, add a project planner"
|
|
222
|
-
- "No, skip"
|
|
223
|
-
|
|
224
|
-
If yes:
|
|
225
|
-
1. Add a "**[Project Name] Planner**" agent to the creation plan — its role is to define project phases, estimate scope, and guide execution in order. Tailor its system prompt to the project domain. Store as `planner_planned = true`.
|
|
226
|
-
2. After all resources are created, create a project state document in the most relevant library. This is the living memory for the project — not just a phase list. Use this exact structure:
|
|
227
|
-
|
|
228
|
-
```markdown
|
|
229
|
-
# [Project Name] — Project State
|
|
230
|
-
|
|
231
|
-
## Current Position
|
|
232
|
-
**Phase:** Phase 1: [Name]
|
|
233
|
-
**Status:** Not Started
|
|
234
|
-
**Last Updated:** [today's date]
|
|
235
|
-
**Next Action:** Begin Phase 1
|
|
236
|
-
|
|
237
|
-
## Already Built
|
|
238
|
-
> Capabilities confirmed by codebase scan — these do not need to be built.
|
|
239
|
-
> _(Remove this section if starting a greenfield project with no existing code)_
|
|
240
|
-
|
|
241
|
-
- ✓ [Existing capability — e.g. "Express API with JWT auth"] — `src/server.ts`
|
|
242
|
-
- ✓ [Existing capability] — `src/`
|
|
243
|
-
|
|
244
|
-
## Phases
|
|
245
|
-
|
|
246
|
-
### Phase 1: [Name]
|
|
247
|
-
**Status:** Not Started
|
|
248
|
-
[Brief description of what this phase covers]
|
|
249
|
-
|
|
250
|
-
### Phase 2: [Name]
|
|
251
|
-
**Status:** Not Started
|
|
252
|
-
[Brief description]
|
|
253
|
-
|
|
254
|
-
...
|
|
255
|
-
|
|
256
|
-
## Decisions Log
|
|
257
|
-
> Locked decisions — record here when a significant architectural, technical, or approach decision is made. Do not re-debate entries in this log.
|
|
258
|
-
|
|
259
|
-
| Decision | Rationale | Phase |
|
|
260
|
-
|----------|-----------|-------|
|
|
261
|
-
| _(none yet)_ | | |
|
|
262
|
-
|
|
263
|
-
## Seeds
|
|
264
|
-
> Ideas and suggestions to revisit at the right time — not immediate work.
|
|
265
|
-
|
|
266
|
-
| Idea | When to revisit | Context |
|
|
267
|
-
|------|-----------------|---------|
|
|
268
|
-
| _(none yet)_ | | |
|
|
269
|
-
|
|
270
|
-
## Notes
|
|
271
|
-
_(ad-hoc notes that don't fit elsewhere)_
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
Infer sensible phases from the project description. Title the file `project-state.md`.
|
|
275
|
-
|
|
276
|
-
**If `has_codebase_scan = true`:** populate the `## Already Built` section from the `architecture.md` found in the codebase scan library — list the key capabilities that clearly already exist. Only plan phases for what is **not** in the Already Built list. If starting greenfield, remove the Already Built section entirely.
|
|
277
|
-
|
|
278
|
-
**Important:** Only one `project-state.md` should ever exist per context library. This is the single source of truth for this project. Never create a second one or split state across multiple files.
|
|
279
|
-
|
|
280
|
-
If no: set `planner_planned = false` and continue.
|
|
281
|
-
</step>
|
|
282
|
-
|
|
283
|
-
<step name="create_resources">
|
|
284
|
-
Only create what the user confirmed across all steps. Create in this order: tag types → tags → libraries → skills → agents (including research and planner agents if confirmed).
|
|
285
|
-
|
|
286
|
-
Do NOT create a workflow in this step.
|
|
287
|
-
|
|
288
|
-
Show `✓ Created "Name"` for each item as it is created. Show `↗ Reusing "Name"` for each existing resource being included.
|
|
289
|
-
|
|
290
|
-
If `planner_planned = true`, create the project state file in Contextium after all other resources are created:
|
|
291
|
-
|
|
292
|
-
**CLI:**
|
|
293
|
-
```bash
|
|
294
|
-
cat << 'EOF' | contextium new <library-name> -t "[Project Name] — Project State" -p "project-state.md" --stdin -w <workspace>
|
|
295
|
-
<generated state content>
|
|
296
|
-
EOF
|
|
297
|
-
```
|
|
298
|
-
**MCP:** call mcp__contextium__create_file with the state content.
|
|
299
|
-
|
|
300
|
-
Show `✓ Created project state "project-state.md"` when done.
|
|
301
|
-
|
|
302
|
-
Suppress all errors silently — if something fails, skip it quietly and note it in the summary.
|
|
303
|
-
|
|
304
|
-
**CLI commands:**
|
|
305
|
-
```bash
|
|
306
|
-
contextium library create "<name>" --workspace <slug>
|
|
307
|
-
contextium agent create "<name>" --workspace <slug>
|
|
308
|
-
contextium skill create "<name>" --workspace <slug>
|
|
309
|
-
contextium tag create "<value>" --type <type-slug> --workspace <slug>
|
|
310
|
-
contextium tag-type create "<name>" --workspace <slug>
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
**MCP:** use the corresponding create_* tools for each resource type.
|
|
314
|
-
</step>
|
|
315
|
-
|
|
316
|
-
<step name="workflow_prompt">
|
|
317
|
-
After all other resources are created, ask the user:
|
|
318
|
-
|
|
319
|
-
"Would you like me to create a workflow to bundle everything together for quick loading? If yes, what would you like to call it?"
|
|
320
|
-
|
|
321
|
-
Use AskUserQuestion with two options:
|
|
322
|
-
- "Yes, create a workflow" (and ask for the name as a follow-up if they say yes)
|
|
323
|
-
- "No, skip workflow"
|
|
324
|
-
|
|
325
|
-
If they say yes and provide a name, create the workflow:
|
|
326
|
-
|
|
327
|
-
**CLI:** `contextium workflow create "<name>" --workspace <slug>`
|
|
328
|
-
**MCP:** call mcp__contextium__create_workflow with the name and workspace.
|
|
329
|
-
|
|
330
|
-
Then automatically load it:
|
|
331
|
-
|
|
332
|
-
**CLI:** `contextium workflow load "<name>" --workspace <slug> 2>/dev/null`
|
|
333
|
-
**MCP:** call mcp__contextium__load_workflow with the workflow name and workspace.
|
|
334
|
-
|
|
335
|
-
If they say no, skip workflow creation and loading entirely.
|
|
336
|
-
</step>
|
|
337
|
-
|
|
338
|
-
<step name="post_workflow_actions">
|
|
339
|
-
This step only runs if `research_agent_planned = true` or `planner_planned = true`.
|
|
340
|
-
|
|
341
|
-
**If `research_agent_planned = true`:**
|
|
342
|
-
|
|
343
|
-
Ask the user:
|
|
344
|
-
|
|
345
|
-
"Would you like to start the research phase now? I can activate the [Project Name] Researcher and begin gathering information based on your project description."
|
|
346
|
-
|
|
347
|
-
Use AskUserQuestion:
|
|
348
|
-
- "Yes, start research now"
|
|
349
|
-
- "No, not yet"
|
|
350
|
-
|
|
351
|
-
If yes: activate the research agent — instruct it to begin researching based on the project description provided earlier. Let it run and surface findings to the user. Do not proceed to the planning question.
|
|
352
|
-
|
|
353
|
-
If no: fall through to the planning question below (if applicable).
|
|
354
|
-
|
|
355
|
-
---
|
|
356
|
-
|
|
357
|
-
**If `planner_planned = true` (and research was either not created or the user said no to starting it):**
|
|
358
|
-
|
|
359
|
-
Ask the user:
|
|
360
|
-
|
|
361
|
-
"Would you like to plan the project now? The [Project Name] Planner can work through the project description and produce a detailed phase-by-phase plan."
|
|
362
|
-
|
|
363
|
-
Use AskUserQuestion:
|
|
364
|
-
- "Yes, start planning now"
|
|
365
|
-
- "No, I'll do it later"
|
|
366
|
-
|
|
367
|
-
If yes: activate the planner agent — instruct it to analyse the project description and produce a detailed phased plan, updating the `project-state.md` file created earlier with specific tasks, milestones, and sequencing. Let it run and surface the plan to the user.
|
|
368
|
-
|
|
369
|
-
If no: continue to summary.
|
|
370
|
-
</step>
|
|
371
|
-
|
|
372
|
-
<step name="summary">
|
|
373
|
-
Show a clean final summary:
|
|
374
|
-
|
|
375
|
-
```
|
|
376
|
-
✓ Project ready
|
|
377
|
-
|
|
378
|
-
Workspace: <name>
|
|
379
|
-
Libraries: <list — new + reused>
|
|
380
|
-
Agents: <list — new + reused, or none>
|
|
381
|
-
Skills: <list — new + reused, or none>
|
|
382
|
-
Tags: <list, or none>
|
|
383
|
-
Workflow: <name> — loaded and ready (or "none" if skipped)
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
If anything failed to create, add a single line at the end:
|
|
387
|
-
`⚠ Could not create: <list of names> — you can add these manually.`
|
|
388
|
-
</step>
|
|
389
|
-
|
|
390
|
-
</process>
|
|
391
|
-
|
|
392
|
-
<rules>
|
|
393
|
-
- Never say "the wizard", "Contextium would like to know", or "the next step is"
|
|
394
|
-
- Never show raw bash output, API responses, or IDs to the user
|
|
395
|
-
- Run all checks and fetches silently — only surface progress labels and the final plan
|
|
396
|
-
- Only ask questions when genuinely needed — the description step and the confirmation step
|
|
397
|
-
- Do not ask the user what to create — figure it out from the description, then ask them to confirm
|
|
398
|
-
- Always create a "Project Architect" agent first, regardless of what the user described — tailor its system prompt to the specific project domain and goals
|
|
399
|
-
- If a resource already exists and is relevant, always prefer reuse over creating a duplicate
|
|
400
|
-
- The plan report must explain the reasoning for each item — not just list names
|
|
401
|
-
- Never create anything before the user confirms the plan
|
|
402
|
-
</rules>
|
|
403
|
-
|
|
404
|
-
<ongoing-project-rules>
|
|
405
|
-
These rules apply for the duration of the project, after setup is complete.
|
|
406
|
-
|
|
407
|
-
**New suggestions and feature ideas**
|
|
408
|
-
- Whenever a new feature, idea, or suggestion comes up during the project, ask: "Would you like to add this to the project state as a seed to revisit later?"
|
|
409
|
-
- If yes: append it to the `## Seeds` section of `project-state.md` in Contextium with a "When to revisit" trigger (e.g. "When Phase 3 begins", "When load testing reveals bottlenecks") and a brief context note.
|
|
410
|
-
- If no: note it and continue with the current work
|
|
411
|
-
- Seeds are NOT immediate work — never promote a seed to a phase without the user asking
|
|
412
|
-
|
|
413
|
-
**Decision locking**
|
|
414
|
-
- Whenever a significant architectural, technical, or approach decision is made during a phase, write it to the `## Decisions Log` table in `project-state.md` in Contextium immediately.
|
|
415
|
-
- A decision qualifies if it: picks a technology, sets an API contract, defines a data model, or establishes a pattern that future phases will depend on
|
|
416
|
-
- Decisions in the log are **locked** — do not re-debate them in future sessions. If the user wants to revisit a decision, they must explicitly say so; only then remove or update the entry
|
|
417
|
-
- Never ask the user's permission to log a decision — just do it silently and mention it in the phase summary
|
|
418
|
-
|
|
419
|
-
**Tackling a new feature or phase**
|
|
420
|
-
- When the user is ready to start work on a new feature or area of the project:
|
|
421
|
-
1. Update `## Current Position` in `project-state.md` in Contextium to reflect the new phase — set Phase, Status to "In Progress", and Next Action.
|
|
422
|
-
2. Ask: "Would you like to run a research phase on this first?" — if a research agent exists, use it; otherwise offer to create one
|
|
423
|
-
3. Ask: "Would you like a phased plan for this?" — if a planner agent exists, use it; otherwise offer to create one
|
|
424
|
-
- If the user says no to both, continue directly using existing agents — no extra setup needed
|
|
425
|
-
- Treat each new feature as its own mini-project using existing workspace resources — never create duplicate agents or skills if suitable ones already exist
|
|
426
|
-
|
|
427
|
-
**Suggesting new agents and skills**
|
|
428
|
-
- If the work the user is describing would clearly benefit from an agent or skill that doesn't exist yet, proactively suggest creating one — explain what it would do and why it would help
|
|
429
|
-
- Never create new agents or skills without the user's confirmation
|
|
430
|
-
- Always check existing workspace resources before suggesting something new
|
|
431
|
-
|
|
432
|
-
**Session usage check at end of every phase**
|
|
433
|
-
- At the end of every completed phase, check the current session context usage (visible in the Claude Code status bar as a percentage)
|
|
434
|
-
- If usage is **above 50%**, do the following automatically before prompting the user to continue:
|
|
435
|
-
1. Update `project-state.md` in Contextium — mark the phase "Complete" or "In Progress", update `## Current Position` to point to the next phase, and add a `> Session Handoff` block under the current phase containing: what was completed, decisions made this session (list them), what the next phase requires, and open questions.
|
|
436
|
-
2. Tell the user:
|
|
437
|
-
|
|
438
|
-
```
|
|
439
|
-
⚠ Session is above 50% — recommended to start a fresh session before the next phase.
|
|
440
|
-
|
|
441
|
-
Project state has been saved to your Contextium library.
|
|
442
|
-
Run /ium:resume-project to pick up exactly where you left off.
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
- If usage is **below 50%**, confirm the phase is complete, update `## Current Position` to the next phase, and ask if the user is ready to move on
|
|
446
|
-
- Never skip this check at phase end — even if the user seems eager to continue
|
|
447
|
-
|
|
448
|
-
**Multi-project rule**
|
|
449
|
-
- Only one `project-state.md` should ever exist per context library. If a user has multiple projects, each project must have its own dedicated library — never mix two projects' state into one library.
|
|
450
|
-
- If a second `project-state.md` would need to be created in the same library, stop and ask the user to either use a different library or create a new one for this project.
|
|
451
|
-
|
|
452
|
-
**Project completion — convert to product description**
|
|
453
|
-
- When all phases in `project-state.md` are marked "Complete", automatically trigger the following:
|
|
454
|
-
1. Ask the user: "All phases are complete — congratulations! Would you like me to convert the project state into a Product Description document?"
|
|
455
|
-
2. If yes: rewrite the content in Contextium as a clean Product Description — summarise what was built, the decisions made (draw from the Decisions Log), the architecture or approach used, and outcomes. Remove phase status markers and the Decisions Log table. Title it "[Project Name] — Product Description". This document serves as a reference for future projects.
|
|
456
|
-
3. If no: leave the state file as-is and congratulate the user
|
|
457
|
-
- Never convert automatically without asking — always get confirmation first
|
|
458
|
-
</ongoing-project-rules>
|