Files
opc-skills/README.md
salva a6e9fedf72 feat: multi-target (opencode + claude) — single archive source-of-truth
- Default targets: opencode + claude (override via --target / OPC_TARGETS)
- enable/disable/disable-all now iterate over selected targets
- INDEX schema: per-target 'active' array (replaces legacy 'status' enum)
- Status command shows per-target counts + parked
- Reindex scans both ~/.config/opencode/skills and ~/.claude/skills
- PARKED moved to ~/Documents/personas/skills-archive (backward-compat symlink kept)
- bulk filters (domain/subdomain/tag) updated to per-target schema
- jq filters no longer reference legacy 'status' values

Migration: previous OPC_PARKED at ~/Documents/opencode-skills-parked is now a
symlink to personas/skills-archive — existing scripts continue to work.

This addresses the opencode 1.14 'external skills' bloat: opencode auto-scans
~/.claude/skills as well as its own dir, so a 1000-skill Claude archive bloats
the prompt. opc-skills now manages both targets explicitly + lazily.
2026-04-30 23:47:02 +03:00

118 lines
5.3 KiB
Markdown

# opc-skills
**Multi-target** skill manager for **opencode** + **Claude Code**. Single source-of-truth (parked archive in the personas repo), per-target lazy activation. Default operations target both platforms.
## Why
opencode (≥1.14) auto-scans `~/.claude/skills/` as well as its own `~/.config/opencode/skills/` — so a 1000-skill Claude Code archive ends up bloating the opencode prompt. opc-skills inverts this: keep both target dirs *empty by default*, copy individual skills into them on demand.
For full agent / skill / persona generation across multiple AI platforms, see the upstream [`personas`](https://gitea.taygun.net.tr/salvacybersec/personas) repo.
## Install
```bash
ln -s ~/Documents/opc-skills/bin/opc-skills ~/.local/bin/opc-skills
```
Ensure `~/.local/bin` is on your `PATH`.
## Layout it expects
```
~/Documents/personas/skills-archive/ # full catalog — single source-of-truth
<skill-name>/SKILL.md
INDEX.json
INDEX.md
~/.config/opencode/skills/ # currently-enabled (opencode target)
<skill-name>/SKILL.md
~/.claude/skills/ # currently-enabled (claude target)
<skill-name>/SKILL.md
```
(`~/Documents/opencode-skills-parked` is symlinked to `personas/skills-archive` for backward-compat.)
Override via env:
- `OPC_PARKED` — parked catalog root (default `~/Documents/personas/skills-archive`)
- `OPC_ACTIVE` — opencode active dir (default `~/.config/opencode/skills`)
- `OPC_CLAUDE_ACTIVE` — claude active dir (default `~/.claude/skills`)
- `OPC_TARGETS` — comma-separated default targets (default `opencode,claude`)
## Targets
`enable`, `disable`, and `disable-all` accept `--target` / `-t`:
| flag | meaning |
|---|---|
| `--target opencode` | only `~/.config/opencode/skills/` |
| `--target claude` | only `~/.claude/skills/` |
| `--target both` (or `all`) | both — also the default |
When omitted, the default is taken from `OPC_TARGETS` (default `opencode,claude`).
## Commands
### Inspection
```
opc-skills status # parked + per-target active counts
opc-skills list {active|parked|all} # skill folder names
opc-skills categories # verb-prefix counts (performing, detecting, ...)
opc-skills domains # frontmatter `domain:` distribution
opc-skills subdomains # frontmatter `subdomain:` distribution
opc-skills tags # frontmatter `tags:` distribution
```
### Single-skill operations
```
opc-skills enable [--target T] <folder> # copy parked → active in selected targets
opc-skills disable [--target T] <folder> # remove from active in selected targets
opc-skills disable-all [--target T] [-y|--yes] # disable every active skill across targets
```
### Bulk by axis
```
opc-skills enable-category <prefix> # fzf multi-pick within a verb-prefix
opc-skills disable-category <prefix>
opc-skills enable-domain <domain> # bulk by frontmatter domain (eg. cybersecurity)
opc-skills disable-domain <domain>
opc-skills enable-subdomain <subdomain> # bulk by subdomain (eg. malware-analysis)
opc-skills disable-subdomain <subdomain>
opc-skills enable-tag [--all] <tag>... # bulk by tags (default: any; --all: intersection)
opc-skills disable-tag [--all] <tag>...
```
### Interactive / search
```
opc-skills pick # fzf: category → multi-select → enable
opc-skills disable-pick # fzf: ACTIVE category → multi-select → disable
opc-skills search [query] # fzf fuzzy over name+description
opc-skills disable-search [query] # fzf over ACTIVE only
opc-skills reindex # rebuild INDEX.json / INDEX.md
```
`fzf` is required for the interactive commands; `jq` for the bulk-by-axis commands; `python3` (with optional `PyYAML`) for `reindex`.
### INDEX schema
`reindex` parses each `SKILL.md` frontmatter and emits records with: `folder`, `name`, `description`, `domain`, `subdomain`, `tags[]`, `status`. `enable` / `disable` perform an incremental status update on `INDEX.json` so `enable-domain` / `disable-tag` etc. stay accurate without a full reindex.
## Shared reference files
Some skills reference sibling files via `../<name>.md` (e.g. the 20 Feynman research skills use `../_platform-mapping.md` for cross-platform tool mapping). `opc-skills enable` auto-syncs any such files from PARKED → ACTIVE so the relative references keep resolving.
Currently synced:
- `_platform-mapping.md` — Feynman-skills cross-platform subagent/scheduling/persistence mapping
If you add new shared-reference files at the PARKED root, extend `sync_shared_refs()` in `bin/opc-skills`.
## Known interaction
The `personas` repo's `build.py --install opencode` currently wipes and repopulates `~/.config/opencode/skills/` as part of installation, which destroys the active set curated here. Use `opc-skills` *after* any personas install, or skip the skills half of `build.py` installs.
`build.py --install opencode` and `build.py --install claude-skills` both emit `_platform-mapping.md` at the skills-root alongside the 20 Feynman skills (`deep-research`, `literature-review`, `paper-code-audit`, `peer-review`, `paper-writing`, `replication`, `source-comparison`, `summarize`, `alpha-research`, `eli5`, `autoresearch`, `docker`, `modal-compute`, `runpod-compute`, `session-log`, `session-search`, `jobs`, `watch`, `preview`, `contributing`).