AGENT SKILL

effect-craft

Craft Effect TypeScript APIs with the discipline of the Effect and opencode codebases. Use when modeling data with Schema, building services with Context and Layer, naming operations with Effect.fn, exposing modules through barrels, designing hooks or HTTP surfaces, or writing JSDoc with runnable examples — new code, refactors, and API reviews.

License 许可
MIT
所属仓库
hadronomy/skills
最近更新
2026-10-08
Stars
★ 0
Forks
0

01 前言 Front Matter

name
effect-craft
description
Craft Effect TypeScript APIs with the discipline of the Effect and opencode codebases. Use when modeling data with Schema, building services with Context and Layer, naming operations with Effect.fn, exposing modules through barrels, designing hooks or HTTP surfaces, or writing JSDoc with runnable examples — new code, refactors, and API reviews.

02 资源文件 7

03 SKILL.md 正文

Effect Craft

Write Effect TypeScript that reads like the call it serves: one consumer line, one Schema per shape, one narrow service per capability. The rules here are distilled from the codebases that set the bar: Effect-TS/effect and sst/opencode on the v2 branch. Read references/sources.md when you need to check why a rule exists.

This is a routed skill. Always apply the core contract. Read only the reference layers the task needs.

Core contract

  1. The consumer line is the whole DX. Write the call before the implementation. If the call needs a comment, rename until it does not. If the call needs three config objects, merge them into one.
  2. One Schema per shape. A record is a Schema.Struct, a state is a Schema.Literal union, an ID is a brand, a failure is a Schema.TaggedError with the Self generic. The declaration is the type, the decoder, and the wire entry. Never triplicate them.
  3. One narrow service per capability. Define it with Context.Service, build it with Layer.effect, consume it with yield* or Effect.provide. Bind services to named variables. Never nest yields. Never return Effect from a pure helper.
  4. Name every operation. Wrap reusable work in Effect.fn("Name") and compose bodies with Effect.gen. The name becomes the span and the log field.
  5. Values, not machinery. Config travels through Config recipes — process.env stays out of domain code. Failures are tagged data matched with catchTag. Retries are bounded Schedule values, and only transport, rate-limit, and internal faults retry.
  6. Barrels re-export; files implement. One concept per file, export * as Name from a logic-free index.ts, deep imports inside the repo, generated sections regenerated and never hand-edited.
  7. Docs earn their place. Document public exports with one practical paragraph, fixed tag order, and runnable ts examples executed as tests. Delete every doc that restates its signature.
  8. Check narrowly. Run the smallest check that covers the change. Touch a public export and its docs travel in the same change.

Branches

Task Read
Data models, brands, tagged errors references/models.md
Services, layers, named ops, config, retry, streams references/services.md
Barrels, dual call styles, client flavors, protocol and codegen references/surface.md
JSDoc shape, runnable examples, code comments, slop filters references/docs.md
Quality gates, per-artifact checklists, friction fixes references/quality.md
Why behind a rule, with source links references/sources.md

Done when

  • npm run validate passes for this skill.
  • Every touched public export carries docs plus a runnable example where the signature does not show the behavior.
  • The narrowest check covering the change is green, and the result is reported.

04 同仓库更多 Skills

hadronomy
hadronomy/skills

windows-mcp

Driving the Windows desktop on `workstation` through the windows MCP server. Use before any `mcp__windows__` tool, when a desktop call blocks or returns "Desktop busy", when Snapshot or Screenshot come back empty, or when this agent has no desktop tools and the task needs them.

★ 0
hadronomy
hadronomy/skills

typst-author

Author idiomatic, compilable Typst documents. Use when creating or editing Typst (.typ) files, when a task involves Typst syntax, packages, templates, or bibliographies, or when a Typst build fails and the error needs a fix.

★ 0
hadronomy
hadronomy/skills

setup-hadronomy

暂无简介

★ 0
hadronomy
hadronomy/skills

rust-craft

Craft production Rust the way the top toolchain teams do. Use when writing, reviewing, or restructuring Rust — workspace layout, Cargo manifests, lints, and profiles; type, trait, and error API design; performance, allocation, and profiling work; async and concurrency; CLI construction; test, snapshot, and benchmark suites; crate selection; release, semver, MSRV, and feature flags.

★ 0
hadronomy
hadronomy/skills

pr-craft

Write pull requests a reviewer can act on. Use when opening, rewriting, or reviewing the body of a pull request — title and description, the problem and approach, call-stack diffs, before-and-after screenshots, verification steps, risks, a review guide, and the tools that produce each part.

★ 0
hadronomy
hadronomy/skills

docs-craft

Documentation discipline for code comments, API docs, and docs pages. Use when writing or reviewing doc comments, JSDoc or rustdoc, README sections, or framework docs pages — or when comments and docs read as filler and need cutting.

★ 0