- Create .claude-plugin/marketplace.json at repo root - Register orch as first dual-publish plugin - Update emes-conversion-guide.md to explain dual-publish pattern - Cross-agent support (Gemini, OpenCode) via Nix - Claude plugin system for hooks and /plugin install UX Part of skills-6x1 (emes plugin architecture epic) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3.6 KiB
3.6 KiB
Dual-Publish Plugin Conversion Guide
Converting skills to support both Nix deployment (cross-agent) AND Claude plugin system.
Why Dual-Publish?
| System | Pros | Cons |
|---|---|---|
| Our Nix system | Cross-agent (Gemini, OpenCode), system-level | No hooks, manual distribution |
| Claude plugins | Marketplace, hooks, /plugin install UX |
Claude Code only |
Decision: Maintain both. Cross-agent support is important (see skills-bo8).
Background: emes Architecture
The emes org builds modular AI agent tools:
- tissue: Git-native issue tracking (machine-first)
- idle: Quality gate (blocks exit until reviewer approves)
- jwz: Async messaging with identity/git context
- marketplace: Plugin distribution registry
Key Principles (from emes)
- Pull context on-demand - Don't inject large prompts upfront
- Mechanical enforcement - Use hooks, not prompt instructions
- References over inline - Point to files, don't embed content
- Machine-first interfaces - JSON output, non-interactive
Dual-Publish Directory Structure
Before (Nix-only):
skills/my-skill/
├── SKILL.md # Instructions with YAML frontmatter
├── README.md # Human docs
└── scripts/ # Supporting scripts (optional)
After (Dual-publish):
skills/my-skill/
├── .claude-plugin/
│ └── plugin.json # Claude plugin metadata
├── skills/
│ └── my-skill.md # Claude auto-discovery (copy of SKILL.md)
├── hooks/
│ └── hooks.json # Optional Claude lifecycle hooks
├── SKILL.md # Nix deployment (Gemini, OpenCode, etc.)
├── README.md
└── scripts/
Both paths lead to the same skill content:
- Nix:
~/.claude/skills/my-skill/SKILL.md - Claude plugin: Auto-discovered from
skills/my-skill.md
plugin.json Schema
{
"name": "my-skill",
"description": "Brief description",
"version": "1.0.0",
"author": {
"name": "author-name"
},
"license": "MIT",
"keywords": ["keyword1", "keyword2"],
"hooks": {
"SessionStart": [...],
"PostToolUse": [...]
}
}
Conversion Checklist
- Create
.claude-plugin/plugin.jsonwith metadata - Copy
SKILL.mdtoskills/<name>.md - Add hooks if skill needs lifecycle events
- Keep original
SKILL.mdfor Nix deployment - Test with
/plugin install ./path/to/skill - Register in marketplace.json (optional)
Hook Events
Available hook events:
SessionStart- On session beginSessionEnd- On session endPreToolUse- Before tool executionPostToolUse- After tool executionPreCompact- Before context compactionUserPromptSubmit- On user messageStop- When agent stopsSubagentStop- When subagent stopsNotification- On notifications
Example: Quality Gate (idle pattern)
For skills that need review before completion:
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "check-review-status.sh"
}
]
}
]
}
}
Testing
# Install locally
/plugin install ./skills/my-skill
# Or add to marketplace and install
/plugin marketplace add owner/repo
/plugin install my-skill@marketplace-name
Dual Deployment
We maintain both:
- Nix deployment (system-level) - Uses
SKILL.mdat root - Plugin discovery (Claude Code) - Uses
skills/<name>.md
This allows skills to work in both environments.