@intentsolutions/refiner
Skill Refiner orchestrator + I/O adapters + CLI — wave 2 of the Skill Refiner
buildout (Phase A). The pure foundation it builds on is
@intentsolutions/refiner-core (wave 1).
Published as @intentsolutions/refiner@0.1.0 to npm under the @intentsolutions scope
per CEO directive 2026-06-21. CLI identity remains j-rig refine (unchanged).
This is the I/O half of the value-oriented Refiner discipline whose pure half
lives in @intentsolutions/refiner-core. It supplies the four pieces of plan 027 § 4
Phase A build-order steps 4–7:
| Step | Piece | Module |
|---|---|---|
| 4 | Content-addressed store + append-only event log + single mutable best-pointer | store.ts (RefinerStore) |
| 5 | score() — delegate to the existing j-rig eval via an injectable shell-out |
score.ts |
| 6 | propose() — tiered (haiku|sonnet, never opus) Anthropic-backed RefinerModel wired to a refiner-core RefinerStrategy |
propose.ts |
| 7 | The 5 j-rig refine <cmd> CLI commands |
cli.ts |
Reuse, not reinvention
Per the plan's "Reuses existing infrastructure" mandate:
score()delegates toj-rig eval— it shells out to the already-shippedj-rig eval <skill-dir> --jsoncommand and maps that command'sscoreCard(pass_rate) into a refiner-coreScoreRecord. No new scorer is built.propose()wires refiner-core'sRefinerStrategy(NaiveInContextStrategy/SkillOptStyleStrategy, both from wave 1) to a model-completion seam. It reuses the repo's SDK-free Anthropic-Messages-API convention (an injectable transport, no@anthropic-ai/sdkdependency), the same approach the eval command'sRealAnthropicProvideruses.
Injectable boundaries (so tests need no live evaluator / SDK / disk)
Every side-effecting boundary is injected:
RefinerStoretakes aFileSystemseam → tests use an in-memory fake.score()takes anEvalRunnerseam → tests assert it delegates + maps without spawningj-rig.propose()/createRefinerModel()take aCompletionClient→ tests mock the model (and assert tiered routing rejects opus) withoutANTHROPIC_API_KEY.
CLI
j-rig refine bootstrap <skill-dir> # synthesize a held-out eval set (offline)
j-rig refine score <skill-dir> # delegate scoring to `j-rig eval` (needs a model key)
j-rig refine propose <skill-dir> # propose a bounded edit (needs ANTHROPIC_API_KEY)
j-rig refine apply <skill-dir> --proposal <hash> # apply a stored proposal → new version (offline)
j-rig refine status <skill-id> # show the store + event log (offline)Not in this wave (gated / later)
The SkillVersion kernel entity, the skill-refiner-pass/v1 predicate URI + signed
evidence emission, the Claude Code plugin + 3-layer hooks, and the synchronized
npm release ceremony are all gated to later waves.
License: Apache-2.0.