CPM is an international project; only the blogpost stays German. Translated: cpm.py docstring/messages/help texts, README.md, cpm-setup skill, all team-profile.yaml files (incl. runtime_agent comments), example apm.yml wrappers and the model-mapping template. Also fixes DEFAULT_MAPPING_PATH pointing to ~/.config/apm-team instead of ~/.config/cpm.
75 lines
2.8 KiB
Markdown
75 lines
2.8 KiB
Markdown
---
|
||
name: cpm-setup
|
||
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.
|
||
allowed-tools:
|
||
- "Bash(python3 corentic-package-manager/cpm.py *)"
|
||
- "Read"
|
||
- "Write"
|
||
- "Edit"
|
||
- "Glob"
|
||
---
|
||
|
||
# CPM Setup Skill
|
||
|
||
Guides the user through: CPM package (APM manifest + team profile) → local model mapping → rendered harness preset (currently: oh-my-opencode-slim).
|
||
|
||
## The flow (Resolve–Validate–Render)
|
||
|
||
### 1. Find the team profile
|
||
|
||
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:
|
||
|
||
```
|
||
Profile: acme.job-applications
|
||
Roles: orchestrator → strong-generalist, researcher → fast-research,
|
||
writer → strong-writing, checker → high-reasoning, notifier → cheap-reliable
|
||
MCPs required: openviking, sharelatex (+ websearch/webfetch as OpenCode-native)
|
||
```
|
||
|
||
### 2. Check the mapping
|
||
|
||
Check `~/.config/cpm/model-mapping.yaml`. For **every** model class used in the profile an entry must exist.
|
||
|
||
If a model class is missing, offer the user concrete options (list available models from `~/.config/opencode/opencode.jsonc`):
|
||
|
||
```
|
||
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
|
||
```
|
||
|
||
After selection write the mapping and optionally mark `# selected_by: user`.
|
||
|
||
Alternatively use the interactive commands: `cpm init --fill` and `cpm setup`.
|
||
|
||
### 3. Check MCPs
|
||
|
||
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.
|
||
|
||
### 4. Render
|
||
|
||
```bash
|
||
python3 corentic-package-manager/cpm.py render --package <package-dir>
|
||
```
|
||
|
||
Show the output including warnings. The file `.opencode/oh-my-opencode-slim.json` is generated – never edit it manually.
|
||
|
||
### 5. Activate
|
||
|
||
Guide the user: start `opencode` → `/preset <team-id>` → reload. Preset switches only take effect after a reload (by design).
|
||
|
||
## Error handling
|
||
|
||
| Error | Fix |
|
||
|---|---|
|
||
| "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 |
|
||
|
||
## Rules
|
||
|
||
- 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.
|