2026-08-23 17:03:40 +02:00
---
2026-08-23 17:26:28 +02:00
name: cpm-setup
2026-08-23 17:56:09 +02:00
description: Activate when the user wants to set up, render, or troubleshoot a CPM package (APM package + team-profile). Use for cpm init, cpm setup, cpm render, team-profile, model-mapping, oh-my-opencode-slim preset, missing model classes.
2026-08-23 17:03:40 +02:00
allowed-tools:
2026-08-23 17:26:28 +02:00
- "Bash(python3 corentic-package-manager/cpm.py *)"
2026-08-23 17:03:40 +02:00
- "Read"
- "Write"
- "Edit"
- "Glob"
---
2026-08-23 17:26:28 +02:00
# CPM Setup Skill
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
Guides the user through: CPM package (APM manifest + team profile) → local model mapping → rendered harness preset (currently: oh-my-opencode-slim).
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
## The flow (Resolve– Validate– Render)
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
### 1. Find the team profile
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
Check whether a `team-profile.yaml` exists (package root or `corentic-package-manager/examples/package/team-profile.yaml` ). Read it and summarize for the user:
2026-08-23 17:03:40 +02:00
```
2026-08-23 17:56:09 +02:00
Profile: acme.job-applications
Roles: orchestrator → strong-generalist, researcher → fast-research,
2026-08-23 17:03:40 +02:00
writer → strong-writing, checker → high-reasoning, notifier → cheap-reliable
2026-08-23 17:56:09 +02:00
MCPs required: openviking, sharelatex (+ websearch/webfetch as OpenCode-native)
2026-08-23 17:03:40 +02:00
```
2026-08-23 17:56:09 +02:00
### 2. Check the mapping
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
Check `~/.config/cpm/model-mapping.yaml` . For **every** model class used in the profile an entry must exist.
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
If a model class is missing, offer the user concrete options (list available models from `~/.config/opencode/opencode.jsonc` ):
2026-08-23 17:03:40 +02:00
```
2026-08-23 17:56:09 +02:00
No model assigned for 'high-reasoning'.
1. Pick an existing model (e.g. ollama/qwen3.6:35b-a3b-q4_K_M)
2. Configure a new provider/model in opencode.jsonc
3. Abort
2026-08-23 17:03:40 +02:00
```
2026-08-23 17:56:09 +02:00
After selection write the mapping and optionally mark `# selected_by: user` .
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
Alternatively use the interactive commands: `cpm init --fill` and `cpm setup` .
2026-08-23 17:26:28 +02:00
2026-08-23 17:56:09 +02:00
### 3. Check MCPs
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
Compare the MCPs named in the profile against the `mcp` section in `~/.config/opencode/opencode.jsonc` . Report missing ones to the user – never silently ignore. OpenCode-native tools (`websearch` , `webfetch` ) are not MCPs and need no entry.
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
### 4. Render
2026-08-23 17:03:40 +02:00
```bash
2026-08-23 17:26:28 +02:00
python3 corentic-package-manager/cpm.py render --package < package-dir >
2026-08-23 17:03:40 +02:00
```
2026-08-23 17:56:09 +02:00
Show the output including warnings. The file `.opencode/oh-my-opencode-slim.json` is generated – never edit it manually.
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
### 5. Activate
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
Guide the user: start `opencode` → `/preset <team-id>` → reload. Preset switches only take effect after a reload (by design).
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
## Error handling
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
| Error | Fix |
2026-08-23 17:03:40 +02:00
|---|---|
2026-08-23 17:56:09 +02:00
| "Model class X is not mapped" | Step 2: add to mapping |
| "MCP ... not configured in opencode.json" | Step 3: set up the MCP or adjust the role |
| "No team profile found" | Check path, use `--team-file` |
| Invalid YAML | Follow the line number in the error message |
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
## Rules
2026-08-23 17:03:40 +02:00
2026-08-23 17:56:09 +02:00
- Never guess or assign models yourself – always let the user choose.
- Never edit the generated `.opencode/oh-my-opencode-slim.json` directly; sources are the team profile + mapping.
- Only ever tighten package security boundaries (MCP/skill allowlists), never widen them.