Skip to content

Commit 4b1fd7f

Browse files
authored
chore: sync catalog counts and sharpen stocktake verdicts (#18)
User-facing copy still advertised 59 skills (43 model-invoked), the v1.8.0 numbers, while the tree and vendor policy have been 62 (46 model, 16 manual) since 1.8.1. Reconcile from the measured tree in README, docs/skills.md, and the architecture diagram. Historical changelog entries keep their original numbers. skill-stocktake becomes a verdict auditor: every item resolves to exactly one of KEEP, COMPRESS, UPDATE, MERGE -> <target>, or RETIRE, gated by an existence pass, a currency pass, and cited evidence. It reports only; it does not rewrite bodies or delete files. eval-harness gains an A/B utility gate (references/skill-utility.md). Run the same dataset without the skill and with it; quality parity at lower token or latency cost passes, and A ~= B on the skill's own claimed task is evidence for RETIRE or COMPRESS. Deterministic assertions first, no external harness, no API key. tests/test_skills.py now reconciles policy against the actual skills/, manual-skills/, and commands/ trees instead of trusting declared counts, plus frontmatter conformance, model/manual collision, a lexical description-overlap gate (warn 50%, fail 75% Jaccard), and a ~/.claude runtime path assertion. Each gate was verified red-capable by temporary mutation. License authority stays vendor/license-audit.json, which states that a missing frontmatter license is not a grant and already maps all 62 skills to MIT or Apache-2.0 with evidence. The test asserts against that file and only forbids frontmatter from contradicting it, rather than forcing a license key into 28 SKILL.md files. Warehouse: DEFER no longer promotes to NEW without an existence pass and a no-skill baseline. Capability drift justifies COMPRESS/RETIRE, never a twin skill. Wave 1-3 counts unchanged. No new skills, no new MCP, no new dependencies. VERSION stays 1.8.2.
1 parent c0c5429 commit 4b1fd7f

10 files changed

Lines changed: 303 additions & 57 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
## Unreleased
44

5-
None.
5+
Catalog hygiene patch. No new skills, no new MCP, no foreign harness runtime. Totals stay **62** (46 model-invoked, 16 manual slash commands).
6+
7+
- Sync stale user-facing catalog copy (`59` / `43 model-invoked`) to the measured tree in `README.md`, `docs/skills.md`, and `docs/architecture.md`. Historical release entries keep their original numbers.
8+
- `skill-stocktake`: replace the schema-only sweep with a verdict protocol. Every catalog item resolves to exactly one of `KEEP`, `COMPRESS`, `UPDATE`, `MERGE → <target>`, or `RETIRE`, backed by an existence pass, a currency pass, and cited evidence. The skill never rewrites or deletes another skill; `COMPRESS`/`UPDATE` hand off to `writing-for-agents` or `prompt-optimizer`.
9+
- `eval-harness`: add `references/skill-utility.md`, an A/B utility gate that scores a task with the skill (Run B) against the same task without it (Run A). Quality parity with lower token or latency passes; `A ≈ B` on the skill's own claimed task is evidence for `RETIRE` or `COMPRESS`. Deterministic assertions first, no external harness, no API key.
10+
- `tests/test_skills.py`: reconcile `vendor/skill-policy.json` against the actual `skills/`, `manual-skills/`, and `commands/` trees instead of trusting declared counts alone. Add frontmatter conformance (`name`, `description`, `compatibility: opencode`, `license`), model/manual name collision detection, a lexical description-overlap gate (warn at 50%, fail at 75% Jaccard), and a `~/.claude` runtime path assertion. Network-free and key-free.
11+
- `docs/warehouse-inventory.md`: `DEFER` no longer promotes to `NEW` without an existence pass and a no-skill baseline. Capability drift is grounds for `COMPRESS`/`RETIRE`, never a twin skill. Wave 1–3 counts are unchanged.
12+
- Document NVIDIA SkillEvaluator as `FOREIGN_ON_DEMAND`: never installed, absent is not a doctor failure, and a malformed MCP entry still fails closed.
613

714
## 1.8.2 — 2026-09-10
815

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# OpenCodeBestFriend
22

33
Production-ready capability layer for OpenCode:
4-
59 routed skills (core + Wave 2/3 warehouse specialists), MCP, Codebase Memory,
4+
62 routed skills (core + Wave 2/3 warehouse specialists), MCP, Codebase Memory,
55
Design Bank, Design Intelligence, SmartDoc, browser and verification tooling.
66

77
OpenCodeBestFriend is an installer and runtime overlay for [OpenCode](https://opencode.ai). It is **not** Claude Code, **not** a model provider, and **not** a dump of a developer home directory.
88

99
## What it is
1010

11-
- 59 skills: 43 model-invoked, 16 manual slash commands
11+
- 62 skills: 46 model-invoked, 16 manual slash commands
1212
- A thin `AGENTS.md` router (lazy, one primary specialist)
1313
- Core MCP: Codebase Memory, Context7, shadcn
1414
- Design Bank discovery or download (media is **not** in git)
@@ -61,7 +61,7 @@ Restart OpenCode after install. Config is not hot-reloaded.
6161
┌───────────────────┼────────────────────┐
6262
▼ ▼ ▼
6363
Skills MCP Rules
64-
43 automatic Codebase Memory Verification
64+
46 automatic Codebase Memory Verification
6565
16 manual Context7 Engineering
6666
shadcn
6767
@@ -127,6 +127,8 @@ Optional:
127127
- `serena` — host binary may exist; MCP is **not** registered unless you run `opencode-bf serena enable`
128128
- `exa``FOREIGN_ON_DEMAND`; installer never adds, removes, or overwrites it
129129

130+
NVIDIA SkillEvaluator is `FOREIGN_ON_DEMAND` in the same sense: a maintainer may run it externally for embedding-based overlap scoring or live catalog evaluation. The installer never adds it, `doctor` does not fail when it is absent, and a malformed MCP entry for it fails closed like any other schema violation.
131+
130132
The installer merges only owned MCP keys. Provider, model, permissions, plugins, and foreign MCP stay yours.
131133

132134
## Design Bank

docs/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
┌───────────────────┼────────────────────┐
1111
▼ ▼ ▼
1212
Skills MCP Rules
13-
43 automatic Codebase Memory Verification
13+
46 automatic Codebase Memory Verification
1414
16 manual Context7 Engineering
1515
shadcn
1616

docs/skills.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Policy: `vendor/skill-policy.json` plus `vendor/skill-allowlist.txt`.
44

5-
- 43 model-invoked skills live under `skills/` and install to `~/.config/opencode/skills/` (core + Wave 2/3 warehouse specialists)
5+
- 46 model-invoked skills live under `skills/` and install to `~/.config/opencode/skills/` (core + Wave 2/3 warehouse specialists)
66
- 16 manual skills live under `manual-skills/` and install to `~/.config/opencode/bestfriend/skills/` plus `commands/`
77

88
`smartdoc` is per-job document intelligence. `smartbook-ingest` compiles reusable local knowledge. `humanizer` cleans user-facing prose tells (`/unslop` is its manual alias). `academic` manages scholarly research, writing, and peer review. `hyperframes` handles deterministic HTML-to-MP4 video composition. `diagram-design` crafts editorial HTML/SVG diagrams. Warehouse diagnostics include `agent-architecture-audit` (agent stack layers), `cost-aware-llm-pipeline` (token budgeting), `eval-harness` (benchmarks), `prompt-optimizer` (prompt refinement), and `skill-stocktake` (catalog hygiene). Wave 3 adds `api-design`, `contract-first`, `automation-audit-ops`, `code-tour`, and `click-path-audit`. Handwriting is a SmartDoc renderer, not a skill.

docs/warehouse-inventory.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ This inventory establishes the contract for warehouse skills across the five ana
1212
- Batch `2a`: Rows marked `decision=NEW` with `batch=2a` were ported in Wave 2.
1313
- Batch `3a`: Only remaining `DEFER` rows marked `decision=NEW` with `batch=3a` are ported in Wave 3. Do not reopen `REJECT`. Do not re-port `DONE`/`MERGE`.
1414
- External harness runtimes, auto-mutations, and CC-BY-NC text are strictly REJECTED.
15+
- `DEFER` does not promote to `NEW` without an existence pass and a no-skill baseline. Route the existence pass through `skill-stocktake` and the baseline through the `eval-harness` utility gate. A procedure that a current model already performs unprompted stays `DEFER` or becomes `REJECT`.
16+
- Capability drift is a legitimate reason to `COMPRESS` or `RETIRE` an existing specialist. It is never a reason to add a twin skill beside it.
1517

1618
## Summary Counts
1719

skills/eval-harness/SKILL.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This skill establishes objective quality gates using Eval-Driven Development (ED
2020
| Application build verification profiles (FAST, STANDARD, RELEASE) | `rules/01-verification.md` |
2121
| Deep architectural failure diagnosis across agent layers | `agent-architecture-audit` |
2222
| Auditing cost tradeoffs across model tiers | `cost-aware-llm-pipeline` |
23+
| Catalog verdicts and skill retirement decisions | `skill-stocktake` |
2324
| **Designing benchmarks, evaluation datasets, rubrics, and regression suites** | **`eval-harness`** |
2425

2526
## Core Methodology
@@ -42,3 +43,8 @@ Consult [references/methodology.md](references/methodology.md) for detailed scor
4243
- Establish a baseline score on the current stable prompt or agent setup.
4344
- Run the eval suite on proposed changes and calculate the score delta.
4445
- Reject any prompt change that introduces regressions on previously passing test cases.
46+
47+
5. **Skill Utility Gate (A/B):**
48+
- Consult [references/skill-utility.md](references/skill-utility.md) when the question is whether a skill beats its own absence.
49+
- Run the same dataset without the skill (Run A) and with it (Run B); quality parity at lower token or latency cost still passes.
50+
- `A ≈ B` on the skill's claimed task is evidence for `RETIRE` or `COMPRESS`; route that verdict to `skill-stocktake`.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Skill Utility Gate (A/B)
2+
3+
Decide whether a skill earns its always-loaded description cost. This measures the skill against its own absence, not against a competitor.
4+
5+
Runs locally. No network, no API key, no external harness runtime, no container image.
6+
7+
## 1. Scope the Claim
8+
9+
Write the claim in one sentence, taken from the skill's own description: what job does it say it wins?
10+
11+
The gate only tests that claim. A skill that wins some unrelated task still fails if it does not beat no-skill on its own claimed job.
12+
13+
## 2. Build the Dataset
14+
15+
Minimum three bands, small on purpose:
16+
17+
- **Happy path** — the canonical case the description promises.
18+
- **Boundary** — same domain, awkward input: missing field, ambiguous intent, conflicting constraint.
19+
- **Adjacent-negative** — a task the description explicitly excludes. Correct behavior is declining or handing off.
20+
21+
Five to ten cases per band is enough to expose a dead skill. Record inputs and expected output properties before running anything.
22+
23+
## 3. Run Both Arms
24+
25+
- **Run A (baseline):** the task with the skill absent from context.
26+
- **Run B (treatment):** the identical task with the skill loaded.
27+
28+
Same model, same temperature, same tooling, same ordering. Change one variable only.
29+
30+
## 4. Score
31+
32+
Deterministic assertions first, per the tiers in [methodology.md](methodology.md). Reach for a model-graded rubric only when the property cannot be checked mechanically.
33+
34+
Record per arm:
35+
36+
- Quality score against the rubric
37+
- `pass@1`, and `pass@k` when the workflow is stochastic
38+
- Total tokens, prompt and completion separately
39+
- Wall-clock latency
40+
41+
Keep `pass@1` and `pass@k` as named metrics. Do not collapse them into a generic 1-5 rating.
42+
43+
## 5. Verdict Thresholds
44+
45+
| Result | Reading |
46+
|---|---|
47+
| B beats A on quality | Utility pass |
48+
| Quality equal, B uses fewer tokens or less latency | Utility pass |
49+
| Quality equal, B costs more | Utility fail; the body is overhead |
50+
| `A ≈ B` on the skill's own claimed task | Evidence for `RETIRE` |
51+
| B wins only on a subset, and the rest of the body is inert | Evidence for `COMPRESS` |
52+
| B fails the adjacent-negative band where A passed | Fence is too broad; fix the description before re-testing |
53+
54+
Quality parity means identical verdicts on every gold case, not a close average.
55+
56+
## 6. Hand Off
57+
58+
Report the numbers and route the decision. `RETIRE` and `COMPRESS` proposals go to `skill-stocktake`, which owns the verdict table and the catalog view. This gate supplies the baseline; it does not delete skills, edit `SKILL.md`, or change the allowlist.
59+
60+
Project unit tests stay with `tdd`. Browser flows stay with `playwright-qa`. Security findings stay with `full-audit-keamanan`.

skills/skill-stocktake/SKILL.md

Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,66 @@ This skill inspects installed skills (`~/.config/opencode/skills/`), manual comm
1717
|---|---|
1818
| Reviewing application source code quality or standards | `matt-code-review` |
1919
| Auditing code security, secrets, permissions, or supply chain | `full-audit-keamanan` |
20-
| Authoring new SKILL.md files or adapting new skills | `writing-for-agents` |
20+
| Authoring or rewriting SKILL.md bodies and descriptions | `writing-for-agents` |
2121
| Optimizing prompt wording and instructional clarity | `prompt-optimizer` |
22+
| Measuring whether a skill actually beats no-skill | `eval-harness` |
2223
| **Auditing skill catalog hygiene, boundaries, and schema conformance** | **`skill-stocktake`** |
2324

25+
This skill audits and reports. It does not rewrite another skill's body, and it does not delete files.
26+
27+
## Verdict Protocol
28+
29+
Every audited skill or command resolves to exactly one verdict. No item is left unjudged, and no item carries two verdicts.
30+
31+
| Verdict | Meaning |
32+
|---|---|
33+
| `KEEP` | Unique trigger, current artifacts, defensible cost asymmetry, existence pass clears |
34+
| `COMPRESS` | Still needed, but the body is longer than the judgment it carries. Scripts and verification gates survive; prose shrinks |
35+
| `UPDATE` | Artifacts, versions, paths, or flags are stale. Requires cited evidence |
36+
| `MERGE → <target>` | Overlaps a sibling. Name the single target and the residue that moves |
37+
| `RETIRE` | Existence pass fails, or the no-skill baseline matches the with-skill run, or the trigger was always covered by runtime, rules, Context7, or the model itself |
38+
2439
## Audit Methodology
2540

26-
Consult [references/checklist.md](references/checklist.md) for the 10-point inspection protocol:
41+
Consult [references/checklist.md](references/checklist.md) for the full inspection protocol.
42+
43+
1. **Existence pass (ask explicitly, per item):**
44+
- If this file disappeared, would the user lose a job that no other skill, rule, core MCP, or cheap on-demand generation already covers?
45+
- Does an independent trigger plus reusable judgment justify the selection cost, drift risk, and maintenance burden?
46+
- A skill that only restates what a current model does unprompted fails this pass.
2747

28-
1. **Frontmatter Schema Validation:**
48+
2. **Currency pass:**
49+
- Paths resolve under `~/.config/opencode/...`, not foreign agent-host directories.
50+
- Flag references to foreign platforms and stale CLI flags, versions, or pinned artifacts.
51+
- Preserve greppable terms, self-enforcing prohibitions, and numeric thresholds verbatim. Do not abstract them into softer prose.
52+
53+
3. **Frontmatter schema validation:**
2954
- Mandatory keys: `name`, `description`, `compatibility: opencode`, `license`.
30-
- Description length and trigger specificity: description must define unambiguous triggers and explicit negative boundaries ("Use when... Not for...").
55+
- `name` matches the directory name.
56+
- Description carries unambiguous positive triggers and explicit negative boundaries ("Use when... Not for...").
57+
58+
4. **Trigger and routing discipline:**
59+
- Detect overlapping or competing trigger phrases across skills.
60+
- Verify model-invoked skills do not shadow manual slash commands.
61+
- Confirm each high-traffic intent has one owner.
62+
63+
5. **Provenance and policy parity:**
64+
- Non-first-party skills carry a compliant `NOTICE.md` under MIT or Apache-2.0. Unknown license is not a grant.
65+
- Name is registered in `vendor/skill-policy.json` and listed alphabetically in `vendor/skill-allowlist.txt`.
66+
- `tests/test_skills.py` assertions match the measured tree, not a remembered count.
67+
68+
## Evidence Requirement
69+
70+
`UPDATE`, `MERGE`, and `RETIRE` are not opinions. Cite at least one of: a path listing, a `--help` or version probe, a checksum, an upstream doc reference, or a no-skill baseline from `eval-harness`. An unproven claim downgrades to `KEEP` with a follow-up note.
71+
72+
## Output
3173

32-
2. **Trigger & Routing Discipline:**
33-
- Detect overlapping or competing trigger phrases across different skills.
34-
- Verify that model-invoked skills do not shadow manual slash commands.
35-
- Ensure high-traffic intents have distinct single-specialist ownership.
74+
Report a single table, one row per audited item, plus a short list of follow-ups.
3675

37-
3. **Path & Environment Hygiene:**
38-
- Verify all path references target OpenCode paths (`~/.config/opencode/skills/...`).
39-
- Flag stale references to foreign platforms (Claude Code, Cursor, Codex).
76+
```text
77+
| Skill | Verdict | Evidence | Handoff |
78+
```
4079

41-
4. **Provenance & Attribution:**
42-
- Confirm every non-first-party skill contains a compliant `NOTICE.md`.
43-
- Ensure licenses match approved policies (MIT or Apache-2.0).
44-
- Verify zero uncredited third-party verbatim copying.
80+
Handoffs: `COMPRESS` and `UPDATE` go to `writing-for-agents` (structure, description, pointers) or `prompt-optimizer` (instruction phrasing). Security findings go to `full-audit-keamanan`. Application code style goes to `matt-code-review`. Utility measurement goes to `eval-harness`.
4581

46-
5. **Test & Policy Parity:**
47-
- Confirm the skill name is registered in `vendor/skill-policy.json` and `vendor/skill-allowlist.txt`.
48-
- Verify that test assertions in `tests/test_skills.py` reflect the current catalog count.
82+
Never auto-delete a file, never auto-edit another skill's body, and never mutate a catalog from a learning log.

0 commit comments

Comments
 (0)