Designs or audits Effect service modules with guidance on authority seams, Layers, and composition. Useful when creating a new service or improving existing Effect code.
Ships in timmo-effect-service-design. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Treat a service as an authority seam: a cohesive capability whose requirements should propagate through Effect context. An Effect service module owns the service contract, construction, production Layer, and any honest reusable test implementation that belong to the same capability.
Read the nearest AGENTS.md, architecture docs, coding standards, project Effect guidance, pinned Effect version/source, and relevant vendored examples. Prefer current project-compatible patterns over remembered APIs.
Complete when: the governing files and pinned source examples have been read and recorded for use in later decisions.
references/AUDIT.md, applying the rules below to every candidate it finds.Complete when: one branch is selected, its scope is bounded, and the caller-visible operations in scope are named.
A real service owns at least one meaningful capability:
Prefer an existing Effect service such as Clock, Crypto, Random, Config, HttpClient, FileSystem, or Path before defining an application service.
Keep these as values or pure modules:
A test-only desire to inject a value is not enough. The seam must represent real ownership or variability in production.
Complete when: the deletion test and the existing-service/adapter audit both support either “service” or “value,” and the rejected alternative is stated plainly.
make and layer; it need not share a file with the application-owned port.Yield stable dependencies while building the Layer and close over them in service methods. Yield request-, fiber-, or operation-scoped context inside the method that uses it. Let requirements propagate until the module that truthfully chooses an implementation provides them.
Passing an external library's constructor options remains correct after the owning adapter has yielded the relevant runtime capability. React props, request values, domain inputs, and framework constructors are not Effect dependency injection.
Complete when: dependencies point inward, raw technology types stop at adapters, and no inner caller chooses a concrete implementation it does not own.
Follow the project's established equivalent of this shape:
export interface Interface {
readonly operation: (input: Input) => Effect.Effect<Output, OperationError>
}
export class Service extends Context.Service<Service, Interface>()(
"@app/Capability",
) {}
export const make: Effect.Effect<
Service["Service"],
never,
Dependency.Service
> = Effect.gen(function* () {
const dependency = yield* Dependency.Service
const operation = Effect.fn("Capability.operation")(function* (input: Input) {
return yield* dependency.operation(input)
})
return Service.of({ operation })
})
export const layerWithoutDependencies = Layer.effect(Service, make)
export const layer = layerWithoutDependencies.pipe(
Layer.provide([Dependency.layer]),
)
export const layerTest = Layer.succeed(
Service,
Service.of({
operation: (_input) => Effect.succeed(testOutput),
}),
)
layerWithoutDependencies preserves the service's requirements for composition. layer is the ready production assembly and provides the concrete dependency Layers. layerTest illustrates a complete static substitute; export it only when that behavior is reusable and honest. Use layerMemory instead when an in-memory implementation faithfully preserves the observable contract.
Use Layer.succeed for an already-built value, Layer.sync for lazy synchronous construction, and Layer.effect for effectful acquisition. Preserve an established compatible naming convention when renaming would add churn without clarity.
Keep interfaces narrow and domain-shaped. Use named Effect.fn methods, typed expected errors, and yielded dependencies. Add options, methods, services, and combinators only when each hides enough complexity to earn its place.
Complete when: the tag, interface, make, dependency-preserving Layer, production layer, errors, methods, and test strategy have one clear owner, and every exported symbol is required by a caller.
Layer.succeed for a complete static implementation.layerTest plus a test-control service when reusable state, failure injection, or observation is part of a real seam.layerMemory only when it faithfully implements the service's observable contract in memory.Tests cross the same service interface as production callers. When a reusable control service exists, back its production tag and test-control tag with the same object. Partial objects with “unused” methods that die are focused test fixtures, not reusable in-memory adapters.
Complete when: each test implementation is complete for its advertised name, tests observe outcomes through the public interface, and no new seam exists only to support mocking.
Complete when: the designed capability has an explicit disposition and validated implementation when requested, or every audit inventory row has a disposition; validation passes or every failure is reported.
What SKILL.md sets; muted values are Claude Code's defaults
/timmo-effect-service-design:effect-service-designfrom timmo-effect-service-design
timmo-effect-service-design@timmo001-skills is listed by timmo001/skills — review the source before installing
npx claudepluginhub timmo001/skills --plugin timmo-effect-service-designOther plugins' skills for the same job