Build Libraries skill initialization #
Scope #
This change adds a focused build-libraries skill for designing, extracting,
reviewing, packaging, and verifying reusable TypeScript and JavaScript
libraries. It is intentionally separate from CLI interface design, generic
delivery policy, developer-tool packaging automation, ecosystem research, data
platform design, and durable workflow execution.
The skill incorporates the library-first architecture guidebook and the attached decision-justification guidance. It treats “library first,” “composable,” “streaming,” and “tree-shakable” as claims that require a concrete objective, constraints, alternatives, trade-offs, and executable evidence.
Accepted skill surface #
The skill routes eight material references:
- use-case-first architecture, information hiding, deep modules, and qualified boundary decisions;
- composition across values, data flow, capabilities, policies, ecosystems, lifecycles, package graphs, and operations;
- values, arrays, iterables, generators, async iterables, streams, batching, materialization, backpressure, cancellation, and early termination;
- transform-first data-oriented design, hot and cold data, indexing, allocation, locality, and public-to-internal representation boundaries;
- explicit resource ownership,
Disposable,AsyncDisposable,using,await using, partial-construction cleanup, concurrency, buffering, and performance budgets; - ESM exports, public subpaths, side-effect metadata, adapter isolation, declaration reachability, clean consumers, and tree-shaking evidence;
- restartable, checkpoint-resumable, and durably orchestrated execution plus a phased CLI-first extraction process;
- source, artifact, runtime, lifecycle, workload, recovery, compatibility, and cross-skill verification.
Ecosystem position #
The skill preserves strategic ecosystem semantics instead of wrapping every package behind a lowest-common-denominator interface:
- LogTape supplies structured library diagnostics, categories, contexts, filters, sinks, redaction, and lifecycle behavior. Applications configure the logging graph.
- c12 discovers and resolves configuration layers. defu may participate in an application-owned merge algebra. Libraries receive validated resolved values.
- unstorage supplies selectable storage drivers, but the library contract states the actual durability, atomicity, and checkpoint semantics required.
- Hookable is reserved for real extension protocols rather than internal code organization.
- Optique remains owned by
build-clisas the executable command-language adapter.
Ownership boundaries #
Routing changes establish these boundaries:
deliver-softwareselectsbuild-librariesfor library, SDK, extraction, public API, tree-shaking, streaming, resource-lifetime, performance, and resumability work.build-clisowns argv, help, interaction, configuration sources, terminal output, process signals, and exits. It does not own the reusable programming model.build-devtoolsowns build, package, release, and generated developer-tool surfaces.build-librariesowns the meaning of the public API and selective adoption contract.build-workflowsowns persisted execution authority, worker reachability, retries, timers, signals, and operator recovery.build-librariesowns restartable and checkpoint-resumable operation contracts that may be hosted by that workflow layer.explore-ecosystemsremains the owner for broad package-family topology and package selection research.
Evaluation surface #
evals/cases/library-design-deep.json contains 34 cases:
- 8 train;
- 8 valid-seen;
- 6 valid-unseen;
- 7 adversarial;
- 2 transfer;
- 3 test-frozen.
The cases include 29 direct build-libraries cases and 5 cross-skill
composition cases. Eight capability records connect every material reference to
its sources, decision questions, failure signatures, exclusions, and
verification method.
The held-out decision case requires an architecture recommendation to expose its objective, hard constraints, diagnosis, alternatives, rejection reasons, trade-offs, assumptions, defeaters, and qualified decision classification. It prevents package proliferation from being justified by “library first” alone.
Executable frozen fixtures #
Selective adoption #
evals/fixtures/library-selective-adoption begins with an intentionally broken
package whose root entrypoint eagerly reaches a browser adapter and whose module
mutates global state. The oracle requires:
- ESM package identity;
- root, core, and browser public subpaths;
- truthful
sideEffects: falsemetadata; - core and root imports that do not load the browser adapter;
- explicit browser import without global mutation.
Streaming cleanup #
evals/fixtures/library-streaming-cleanup begins with an intentionally eager
Promise<Array> implementation. The oracle requires:
- lazy resource acquisition;
- an
AsyncIterableresult; - one read per consumed value;
- upstream stop after early termination;
- exactly-once asynchronous disposal;
- disposal after failure.
Both fixtures reject their broken state and pass after their expected fixes are applied in temporary copies.
Verification completed #
The following checks were actually run:
- JSON parsing for the new case corpus, capability registry, and source registry;
- custom repository validation equivalent to the deterministic structural rules
in
scripts/validate.ts; - custom SkillOpt matrix validation for reference coverage, root routing, and frozen composition topology;
- Node syntax checks for all new
.mjsfixture files; - broken-state oracle checks for both executable fixtures;
- corrected-state oracle checks in temporary copies for both fixtures;
- SHA-256 verification for the library-first guidebook and attached decision-justification source;
- trailing whitespace, final newline, CRLF, and em-dash checks across all changed files;
- generated-state checks for
.skillopt, Python caches, and macOS metadata.
The structural validator reported:
Checked 13 skills, 544 cases, 16 executable, 52 frozen,
80 capabilities, 70 sources.
Custom repository validation passed.
The matrix validator reported:
Matrix checked 54 capability references, 13 root routers,
and 3 frozen composition topologies.
Custom SkillOpt matrix validation passed.
Blocked or not run #
- The environment does not contain a Deno executable. Network restrictions also
prevented installing one. Therefore
deno task check,deno task test,deno task validate, anddeno task skillopt:matrixwere not run through the repository's native Deno task chain. - Full
sources:verifywas not run because it requires the complete historical attachment directory. The two newly registered local source digests were verified directly. - External model rollouts, LLM judging, cross-model evaluation, and SkillOpt optimization were not available. No model-quality improvement is claimed.
These are release blockers for a final optimized skill release, but not hidden as successful checks in this handoff.