feat: domain/subdomain/tag bulk ops + enriched INDEX

- domains, subdomains, tags : frontmatter distribution counts
- enable-domain / disable-domain        : bulk by 'domain:' (eg. cybersecurity)
- enable-subdomain / disable-subdomain  : bulk by 'subdomain:' (eg. malware-analysis)
- enable-tag / disable-tag [--all]      : multi-tag union (default) or intersection
- INDEX.json now exposes domain, subdomain, tags[]
- INDEX.md columns expanded; top-domains/subdomains/tags summaries
- PyYAML-first frontmatter parser (regex fallback) — parses 1027/1032 descriptions
  and 758 skills' tags correctly (previous regex parser missed almost everything)
- enable/disable now incrementally update INDEX.json status so bulk ops stay
  consistent without a full reindex
- jq --args bug fix in tag commands ('--' was leaking into ARGS.positional)
This commit is contained in:
salva
2026-04-30 22:09:41 +03:00
parent 81a288e629
commit 70763091af
2 changed files with 301 additions and 34 deletions

View File

@@ -29,19 +29,53 @@ Override via env:
## Commands
### Inspection
```
opc-skills status # counts of active vs parked
opc-skills list {active|parked|all} # skill folder names
opc-skills categories # prefix-based category counts
opc-skills enable <folder> # copy parked → active
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 <folder> # copy parked → active
opc-skills disable <folder> # remove from active (parked preserved)
opc-skills enable-category <prefix> # fzf multi-pick within a prefix
opc-skills disable-all [-y|--yes] # disable every active skill
```
### 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.
`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