Skip to content

feat: agent skill and octopi agents install for Claude Code, Codex, and other agents - #81

Merged
jtschwar merged 1 commit into
mainfrom
feat/agent-skill
Nov 25, 2026
Merged

jtschwar merged 1 commit into
mainfrom
feat/agent-skill

Conversation

@jtschwar

Copy link
Copy Markdown
Collaborator

Summary

Ships an Agent Skills skill with octopi, so coding agents (Claude Code, Codex, and other open-source agents) can drive the octopi CLI directly. Adds one command, octopi agents install, that sets up both the skill and the existing MCP server.

Skill (octopi/skills/octopi/)

  • SKILL.md covers:
    • workflow order (download/import → create-targets → model-explore/train → segment → localize → evaluate → extract)
    • URI shorthand and which flag each URI maps to
    • run-vs-suggest rules: GPU jobs are only suggested, never run without explicit permission
    • an example for each step
    • gotchas: --submitit True, and leaving out --model-config for Hugging Face checkpoint aliases
  • Training on an existing segmentation without picks: explains the targets-<user>_<session>_<name>.yaml label map that train and model-explore require, and gives two ways to provide it (wrap the mask with create-targets, or hand-write the YAML with a template).
  • reference.md: a short flag reference for every command, loaded only when needed.
  • Skill and MCP instructions suggest --model-type segresnet for model-explore. The CLI defaults are unchanged.

octopi agents install | status | uninstall

  • Installs the skill to .claude/skills/octopi (Claude Code) and .agents/skills/octopi (Codex and other Agent Skills clients).
  • Registers the MCP server with Claude Code (~/.claude.json or ./.mcp.json) and, if the codex CLI is installed, with Codex via codex mcp add.
  • Options: --target global|project, --agent claude|agents|all, --no-mcp, --desktop, --force. Help output is grouped into Scope, MCP Server and Options.
  • Re-running is safe: up-to-date entries are left alone. status reports skill copies that are outdated after an octopi upgrade.
  • The legacy octopi mcp install|status|uninstall commands still work but are hidden. Their config handling is now shared helpers in octopi/mcp/cli.py.

Docs (docs/user-guide/claude-code-mcp.md, now "AI Agent Integration")

  • Restructured into: what agents can do → a single setup command → example workflow.
  • Fixed stale examples:
    • --submitit needs a value (--submitit True)
    • model-explore writes model_config.yaml and best_model.pth
    • targets use the name:user/session format

Repo

  • .claude/skills/octopi and .agents/skills/octopi are symlinks to the bundled skill, so contributors working in this repo get it automatically.

Test plan

  • octopi agents install / status / uninstall against a temporary HOME/CODEX_HOME: global, project, --no-mcp, a second install that changes nothing, outdated detection and --force. Verified the generated .claude.json, .mcp.json and Codex config.toml entries.
  • The built wheel includes octopi/agents/* and octopi/skills/octopi/*.md.
  • Docs build cleanly (zensical build); the in-page anchors and the setup section render.
  • Hand-written target YAML template loads through octopi.utils.io.get_config with the expected labels and class count.
  • Try the skill end to end in a fresh Claude Code and Codex session on a real CoPick project.

Known issue (not fixed here)

io.get_config without a session ID searches for targets_*<name>.yaml, but the files are written as targets-..., so the short --target-uri name form fails to find the config. The skill tells agents to use the full name:user/session URI for now.

🤖 Generated with Claude Code

… and other agents

Ship an Agent Skills (agentskills.io) skill with octopi so coding agents can drive the
octopi CLI without relying on the MCP server, and add one command that sets up both.

- add `octopi/skills/octopi/` (SKILL.md + reference.md): workflow order, URI shorthand,
  run-vs-suggest rules for GPU jobs, per-step examples, flag reference, and how to train
  on an existing segmentation (wrap it with create-targets, or hand-write the
  `targets-<user>_<session>_<name>.yaml` label map)
- add `octopi agents install|status|uninstall`: installs the skill to
  `.claude/skills` and `.agents/skills`, and registers the MCP server with Claude Code
  and (via `codex mcp add`) Codex; `--no-mcp`, `--desktop`, `--target`, `--agent`, `--force`
- hide the legacy `octopi mcp install|status|uninstall` (still functional) and factor
  their config handling into shared helpers
- skill and MCP instructions suggest `--model-type segresnet` for model-explore
  (CLI defaults unchanged)
- symlink the skill into `.claude/skills` and `.agents/skills` for contributors
- restructure the agent docs page: what agents can do, single setup command, example
  workflow; fix `--submitit True`, `model_config.yaml`/`best_model.pth`, and target URI
  format in the examples

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jtschwar
jtschwar requested a review from ESmi99 November 25, 2026 02:47
@jtschwar
jtschwar merged commit fe4151b into main Nov 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants