developing-weft
Work on Weft itself, covering the pnpm monorepo layout, the HarnessAdapter seam, adding a new harness adapter, and the test/coverage gates. Use when contributing to the Weft compiler rather than authoring a plugin.
- License 许可
- MIT
- 最近更新
- 2026-06-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- developing-weft
- description
- Work on Weft itself, covering the pnpm monorepo layout, the HarnessAdapter seam, adding a new harness adapter, and the test/coverage gates. Use when contributing to the Weft compiler rather than authoring a plugin.
03 SKILL.md 正文
Weft is a pnpm + Bun monorepo. Every package publishes as @michaelfromyeg/weft-* and is
meant to be depended on independently, so the dependency direction is strict: adapters depend
only on adapter-kit + schema, never on core.
Packages
schemais the source of truth: Zod schemas + inferred types + JSON-Schema export. YAML is parsed in 1.2 "core" mode socountry: NOstays a string (the Norway problem).coreis the compile pipeline: load -> static pass (validate, namespace/alias) -> transform/emitManifest/emitCatalog per adapter -> place (build vs install) -> a content-addressedweft.lock. Also resolve (git/file refs), deps, config/secrets, managed-mode, and ed25519 signing.adapter-kitis theHarnessAdapterinterface and helpers. This is the seam.adapter-claude|codex|cursor|copilot|opencodeare the compiler backends, one per harness.evalis the runner plus a headlessHarnessDriverper harness.indexis metadata + MCP-Registry federation + badges + the publish gate.cliwires it all together with citty; it is the only package that prints (via its logger).
The adapter contract
An adapter is a plain object. Everything harness-specific hides behind targetSchema, so an
upstream format change is a version bump in one package, not a change to any plugin:
export const myAdapter: HarnessAdapter = {
target: "myharness",
version: "0.1.0",
targetSchema: "myharness/1.0",
detect(scope, cwd) { /* InstallPaths per scope */ },
transform(component, ctx) { /* one component -> native artifacts */ },
emitManifest(plugin, ctx) { /* plugin-level manifest, or [] */ },
emitCatalog(marketplace) { /* native catalog */ },
driver: { /* optional headless eval support */ },
};
To add a harness: create packages/adapter-<name>, implement the contract, register it in
the CLI's registry, and add a driver only if the harness has a usable headless mode. If it
has no structured trace, set traceUnavailable so the eval runner degrades honestly instead
of faking a pass.
Working in the repo
pnpm install
pnpm typecheck # tsc across the workspace
pnpm test # vitest
pnpm test:coverage # enforces the 80% gate (all metrics)
pnpm lint # biome (no import cycles, no console outside the CLI logger, etc.)
pnpm build # tsup, Node-compatible ESM
No fake tests: a test must assert on real output, not just that a function ran. New behavior
needs coverage that keeps every metric above 80%. Lint forbids export * (barrels use
explicit named re-exports) and console outside the CLI's logger module.
04 同仓库更多 Skills
using-weft
Author an agent capability once (a skill or an MCP server) and compile it to every coding-agent harness with Weft. Use when the user wants to write, build, install, evaluate, or import Weft plugins and marketplaces.
code-review
Review a code diff for correctness bugs and suggest concrete, minimal fixes.
lint
Lint a file and report style and correctness issues with concrete fixes.
demo-skill
A demo skill used to prove that skill evals run end to end.