К основному содержанию
скилл CX Codex

coi-profile — скилл для Claude Code: настройка профиля

Скилл создаёт, редактирует и проверяет профили Coi с настройками образа, AI-инструмента, ресурсов, монтирования, сети и безопасности.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add coipond/coi --skill coi-profile -a claude-code
Открыть на GitHub

Что делает coi-profile

coi-profile работает с каталогами профилей Coi и их config.toml. Он помогает прочитать схему через coi schema profile, выбрать допустимые ключи и значения, создать профиль командой coi profile create, а затем проверить файл через coi validate profile. После правок можно посмотреть итоговые настройки с учётом наследования через coi profile info.

Скилл учитывает вложенные таблицы лимитов, относительные пути и правила сетевого allowlist. Для профилей из .coi/profiles/ часть настроек, ослабляющих изоляцию, удаляется при загрузке, поэтому такие параметры нужно хранить в ~/.coi/profiles/. Профиль с [container.build] требует Incus и команды coi build --profile <name> перед первым использованием.

Какие задачи решает

  • создать профиль Coi с наследованием
  • проверить ключи и значения в config.toml
  • настроить лимиты CPU и памяти
  • проверить сетевой allowlist и пути файлов
  • сверить итоговые настройки после наследования

Примеры запросов агенту

  • Создай профиль Coi rust-dev с наследованием от hardened и настрой его config.toml.
  • Проверь профиль ~/.coi/profiles/<name>/config.toml по схеме Coi и исправь все ошибки.
  • Покажи итоговую конфигурацию профиля <name> после наследования и скажи, нужен ли coi build --profile <name>.

Как установить coi-profile

1Через Skills CLI (Vercel)

npx skills add coipond/coi --skill coi-profile -a claude-code

2Вручную: положить файлы

~/.claude/skills/coi-profile/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/coi-profile/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о coi-profile

Как установить coi-profile в Claude Code?

Выполните npx skills add coipond/coi --skill coi-profile -a claude-code. Затем проверьте файл ~/.claude/skills/coi-profile/SKILL.md.

Что делает coi-profile?

Скилл помогает создавать, изменять и валидировать Coi-профили в формате config.toml. Он использует схему Coi, учитывает наследование и показывает итоговую конфигурацию.

Что нужно для профиля с [container.build]?

Перед первым использованием такого профиля нужен Incus и команда coi build --profile <name>. Сборку можно выполнить отдельно от создания профиля.

Исходный текст

SKILL.md · MIT
---
name: coi-profile
description: Write, edit and validate Coi (Code on Incus) profiles, the config.toml files under ~/.coi/profiles/<name>/ or .coi/profiles/<name>/ that set a sandbox's image, AI tool, resource limits, mounts, network mode and security settings. Use when asked to create or change a coi profile or a coi config.toml.
---

# Writing Coi profiles

A Coi profile is a directory named after the profile that holds a `config.toml`, plus any files it points to (a build script, a context `.md`, prompt files). It is applied with `coi shell --profile <name>` or `coi run --profile <name>`.

Never guess a key or a value. The `coi` binary is the source of truth: read its schema, and validate every file you write.

## Workflow

1. **Read the schema first.** `coi schema profile` prints the JSON Schema (2020-12) of a profile `config.toml`. Every accepted key, type, enum and description is in it; unknown keys are errors.

   ```bash
   coi schema profile > /tmp/coi-profile.schema.json
   jq '.properties | keys' /tmp/coi-profile.schema.json                 # top-level keys
   jq '."$defs".NetworkConfig.properties.mode' /tmp/coi-profile.schema.json  # one field, with its enum
   ```

   Section names map to `$defs` (`[network]` is `NetworkConfig`, `[limits.memory]` is `MemoryLimits`, `[container.build]` is `BuildConfig`). Read a field's `description` before you set it.

2. **See what exists.** `coi profile list` shows every profile with its source; `coi profile info <name>` prints a profile fully resolved, after inheritance. Built-ins: `default` (Coi's defaults) and `hardened` (for untrusted code).

3. **Create the profile.** Prefer `coi profile create <name> [--inherits <parent>] [--user|--project]` over making the directory by hand: it picks the location (`./.coi/profiles/` when the project has a `.coi/` directory, else `~/.coi/profiles/`) and refuses to overwrite. Then edit its `config.toml`. Do not use `coi profile create default`: it scaffolds the main `~/.coi/config.toml`, not a profile.

4. **Write only what differs from the parent.** Inherit from `default` (implicit) or `hardened`, and set just the overrides.

5. **Validate after every edit.** Fix every reported path, then validate again until it passes.

   ```bash
   coi validate profile ~/.coi/profiles/<name>/config.toml
   coi validate profile ~/.coi/profiles/<name>/config.toml --format json   # {"valid": ..., "errors": [{"path", "message"}]}
   ```

   Exit code 0 means valid, 1 invalid. The `path` (e.g. `/network/mode`) is a JSON Pointer into the file; when the message is terse, look that path up in the schema. TOML syntax errors are reported with an empty path.

6. **Check the result.** `coi profile info <name>` shows the merged profile. Confirm the inherited values are what you expect.

7. **Build the image if the profile has one.** A profile with a `[container.build]` section needs `coi build --profile <name>` before first use. Leave this to the user unless asked: it needs Incus and takes minutes.

## Example

```toml
# ~/.coi/profiles/rust-dev/config.toml
inherits = "hardened"

[container]
image = "coi-rust-dev"

[container.build]
script = "build.sh"           # relative to this profile's directory

[tool]
name = "claude"

[limits.cpu]
count = "4"

[limits.memory]
limit = "8GiB"

[network]
mode = "allowlist"
allowed_domains = ["api.anthropic.com", "crates.io", "static.crates.io", "index.crates.io", "github.com"]
```

## Rules that are easy to get wrong

- **Limits are nested tables.** Use `[limits.cpu] count = "4"` and `[limits.memory] limit = "8GiB"`, never `[limits] cpu = "4"`.
- **Allowlist entries are exact.** `allowed_domains` takes hostnames, IPv4 addresses or CIDRs, optionally with `:ports`. Wildcards (`*.example.com`) are rejected when the session starts (`coi validate profile` does not catch them), and DNS is blocked in allowlist mode, so list every host the tool needs.
- **Relative paths resolve against the profile directory**: the top-level `context` key, `[container.build] script` and `[prompts]` `file`.
- **Project profiles are untrusted.** A profile under a repo's `.coi/profiles/` is loaded with its isolation-weakening settings stripped (with a warning): `env_commands`, `forward_env`, `[ssh] forward_agent = true`, `[prompts]`, `[tool]` `context_file`/`context_json_file`/`pre_launch`, and network, security, git or Docker downgrades. Host mounts outside the workspace need `coi trust`. Put such settings in a profile under `~/.coi/profiles/`, and tell the user why.
- **`hardened` turns things off on purpose** (no Docker, ephemeral, monitoring with auto-kill, a 4-hour cap). Override one of them only when the task needs it, and say which one.
- **Validation covers the file's format alone.** `coi validate profile` does not check that the `inherits` parent exists, that the `context` file or build script is there, or that `allowed_domains` has no wildcard. `coi profile list` and `coi profile info` catch a missing `inherits` parent. The other three fail only when the profile is used (`coi shell --profile <name>`), so check them yourself and tell the user they are unverified.

© coipond · MIT · coipond/coi

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
setup-matt-pocock-skills Matt Pocock Скилл настраивает репозиторий для инженерных скиллов Matt Pocock: задаёт трекер задач, метки триажа и расположение доменной документации. Запустите его перед первым использованием остальных скиллов. 1 052 851установок ask-matt Matt Pocock Помогает выбрать подходящий скилл или рабочий поток из набора Matt Pocock. Пригодится, когда непонятно, с чего начать задачу: от идеи до разбора бага. 766 587установок to-tickets Matt Pocock Разбивает план, спецификацию или переписку на небольшие сквозные задачи и отмечает, какие из них блокируют остальные. Пригодится, когда нужно согласовать порядок работы до публикации задач в трекере. 711 230установок writing-plans Jesse Vincent Скилл превращает требования к многошаговой задаче в подробный план реализации до начала работы с кодом. Пригодится, когда исполнителю нужно зафиксировать файлы, интерфейсы и проверки. CX Codex 282 859установок caveman-review JuliusBrussee Пишет замечания к коду одной строкой: место, проблема, исправление. Пригодится, когда ревью диффа или PR надо пройти быстро и без воды. CX Codex +1 411 800установок caveman-compress JuliusBrussee Сжимает CLAUDE.md, списки задач и другие текстовые файлы в краткий формат, сохраняя читаемую резервную копию. CX Codex +1 411 500установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой