Effect keeps the surfaces on one contract

An Effect Schema defines accepted values and provides types and runtime checks. Our shared contract describes one action’s input, output, failures, and metadata. Effect Schema owns inputs, outputs, and failures in our shared contract. implement.ts binds the handler and its approval requirement.¶

A projection builds an interface from a capability, a named action with a contract and handler. The HTTP projection creates an Effect HttpApi. Other projections create CLI commands and an AI toolkit from the same contracts.¶

apps/cli/src/surfaces.ts and apps/site/src/app.ts supply implementations with Layers.¶

Follow one interface at a time

Layer supplies the job

packages/core/src/join-intake.ts builds a Layer.effect(JoinInterest, ...). It captures the ticket, scoring, events, contact store, delivery, and token services. It then returns the submission method.¶

Source: packages/core/src/join-intake.ts at a646f7ffd00273d85fbe1d905d9cdb194fdc0f60, lines 58–64.¶

packages/core/src/join-intake.ts · a646f7ff
    ): Effect.fn.Return<JoinOutput> {
      const statusRef = yield* newStatusRef;
      const answer = { message: JOIN_ANSWER, statusRef } as const;

      if (intake.agent?.enabled !== true) {
        return { message: JOIN_NOT_OPEN, statusRef };
      }

Effect’s Layer.provide supplies a Layer’s dependencies. HttpApiBuilder.layer registers HTTP routes and can expose OpenAPI15. Neither requires a second domain handler.¶

One capability, every surface18 states the house rule9. Hexagonal architecture19 names the adapter boundary. The fence39 enforces it.¶

The peers page records other Effect and Alchemy projects, whose designs can differ.¶

Start with Effect basics17, then construct a service16 and compose its Layers13.¶

See also: Structure an Effect codebase by domain16.¶

Sources

  1. packages/capability/src/contract.ts. GitHub. packages/capability/src/contract.ts Accessed 2026-10-02.
  2. packages/capability/src/implement.ts. GitHub. packages/capability/src/implement.ts Accessed 2026-10-02.
  3. packages/capability/src/to-http-api.ts. GitHub. packages/capability/src/to-http-api.ts Accessed 2026-10-02.
  4. apps/cli/src/surfaces.ts. GitHub. apps/cli/src/surfaces.ts Accessed 2026-10-02.
  5. apps/site/src/app.ts. GitHub. apps/site/src/app.ts Accessed 2026-10-02.
  6. packages/core/src/join-intake.ts. GitHub. packages/core/src/join-intake.ts Accessed 2026-10-02.
  7. Effect 4 Layer. GitHub. Effect 4 Layer Accessed 2026-10-02.
  8. Effect 4 HttpApiBuilder. GitHub. Effect 4 HttpApiBuilder Accessed 2026-10-02.

Last changed 2026-10-10 in 978dccc. Source on GitHub. Change log.

Linked from

  1. Agent guide. An Effect stack so pure (aspirational) Kit Langton will blush.

    Effect keeps the surfaces on one contract — Schema owns values, projections build interfaces, and Layers supply implementations.

  2. Change log. What changed in the files served here, newest first.

    Effect keeps the surfaces on one contract — edited: docs: point live docs, skills and Brain pages at apps/site

  3. Full agent guide. An Effect stack so pure (aspirational) Kit Langton will blush.
  4. MCP is another surface. MCP lists and calls schema-typed tools; rat-stack projects the same handlers instead of adding MCP-only behavior.

    See how we do it with Effect for the whole path.¶

  5. One program can replace several tool calls. Code mode combines typed content calls inside one bounded execute request.

    See how we do it with Effect for the whole path.¶

  6. One schema, three surfaces. A capability contract feeds CLI, HTTP, and MCP; OpenAPI is generated output, not their input.

    See how we do it with Effect for the whole path.¶

  7. OpenAPI describes the refusal too. The generated HTTP contract declares inputs, outputs, and the bodyless 400 returned when decoding fails.

    See how we do it with Effect for the whole path.¶

  8. Rat Stack lore | rat-stack. Short, source-grounded notes on the ideas and decisions behind rat-stack.

    Effect keeps the surfaces on one contract — Schema owns values, projections build interfaces, and Layers supply implementations.

  9. Source change history (log.md). The generated change log as Markdown.

    Effect keeps the surfaces on one contract — edited: docs: point live docs, skills and Brain pages at apps/site