agentleFS
timmo001timmo001/skills/effect-principles/SKILL.md

effect-principles

Skill1 starsChanged 56 days agoApache-2.0View on GitHub

Apply the Effect way of reasoning in codebases that do not use Effect, in any programming language. Use when editing or reviewing non-Effect code so dependencies, failures, state, boundaries, resources, time, and workflows stay explicit without adding Effect-shaped architecture or broader scope.

The file

Show its rules and text

We split this skill into the rules it gives an agent

23 rules. About 0 are common, 22 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈22

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the discipline behind Effect's APIs, not Effect's APIs themselves.

    line 9
  2. Distinctive:

    when working from a branch, diff, pull request, or injected work scope, is directly required by those changes.

    line 18
  3. Distinctive:

    does not add Effect, an Effect substitute, a dependency container, a generic result type, or a new architectural layer.

    line 20
  4. Distinctive:

    does not increase conceptual surface area, indirection, or the amount a reader must learn.

    line 21
  5. Distinctive:

    Keep ambient framework state where the framework owns it.

    line 40
  6. Distinctive:

    Do not create an interface for a single concrete value unless a real boundary or existing test seam already calls for one.

    line 41
  7. Distinctive:

    Prefer the repository's existing sum types, tagged variants, enums, constrained value types, schemas, guards, and state machines.

    line 45
  8. Distinctive:

    Add a new model only when it removes at least as much branching or ambiguity as it introduces.

    line 47
  9. Distinctive:

    Use the codebase's existing error mechanism: exceptions, rejected promises, error classes, status objects, or established result types.

    line 52
  10. Distinctive:

    Keep sequencing, cleanup, cancellation, retry limits, and ownership visible in the function that controls them.

    line 58
  11. Distinctive:

    Prefer native and existing primitives for cleanup, cancellation, lifecycle, queues, asynchronous work, and scheduling.

    line 59
  12. Distinctive:

    Do not build generic pipeline, schedule, scope, or resource helpers for one workflow.

    line 60
  13. Distinctive:

    Keep one-off logic inline when extraction would create a shallow helper or split a readable operation.

    line 65
  14. Distinctive:

    Keep transport and framework adapters thin when an existing domain or application function already owns the rule.

    line 66
  15. Distinctive:

    Prefer deterministic synchronization already available in the project over arbitrary sleeps.

    line 71
  16. Distinctive:

    Add retry, caching, batching, or background work only when required by the task and supported by the operation's real semantics.

    line 72
  17. Distinctive:

    Use this to recognise Effect's intent without reproducing its API surface:

    line 76
  18. Very specific:

    Do not add Effect or recreate Effect, Layer, Context, Exit, Cause, Option, or Either under local names.

    line 91
  19. Distinctive:

    Do not replace the language's ordinary async, exception, optional-value, or framework-state patterns project-wide.

    line 92
  20. Distinctive:

    Do not add wrappers that only rename a platform or library API.

    line 93
  21. Distinctive:

    Do not turn local implementation details into public contracts.

    line 94
  22. Distinctive:

    Do not widen a focused fix into a domain-model, service, validation, or error-handling migration.

    line 95
  23. Distinctive:

    Do not claim a change is safer when its new ceremony obscures the control flow.

    line 96

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Effect Principles Without Effect

Use the discipline behind Effect's APIs, not Effect's APIs themselves. Express it through the current language's native features and the repository's existing conventions, dependencies, and architecture.

For any bounded task, follow changeset-scope; this skill supplies engineering criteria but never expands investigation, finding, or edit scope.

Hard Gate

Apply a principle only when the resulting change:

  • stays inside the scope and amount of change the user requested;
  • when working from a branch, diff, pull request, or injected work scope, is directly required by those changes;
  • uses existing language or repository constructs;
  • does not add Effect, an Effect substitute, a dependency container, a generic result type, or a new architectural layer;
  • does not increase conceptual surface area, indirection, or the amount a reader must learn;
  • is at least as readable as the code it replaces.

The user's guidance on how much to change is authoritative. Do not treat this skill as permission to improve nearby code. If meeting a principle requires more files, callers, wrappers, types, helpers, or abstractions than the scoped behaviour requires, keep the existing design. Report a larger opportunity separately only when the user asked for architectural advice.

Workflow

  1. Establish the boundary with changeset-scope, then read the nearest project guidance and enough surrounding code to understand it.
  2. Identify only the concrete ambiguities introduced, modified, or exposed by that scope: untrusted input, implicit dependencies, expected failures, invalid states, uncontrolled side effects, retry policy, resource lifetime, or concurrent workflows.
  3. Find the smallest existing seams that own them. Prefer function signatures, local unions, existing interfaces, adapters, parsers, platform primitives, or framework lifecycles already in use.
  4. Tighten the relevant seams together when scoped behaviour crosses them. Change callers outside the original files only when required to keep that behaviour correct; do not propagate the pattern further.
  5. Compare the result against the hard gate. Revert the idea if it adds more ceremony than truth.
  6. Apply testing and run the smallest reliable verification that proves the changed contract. Add tests when they protect important behaviour or catch a meaningful failure that existing checks miss.

Principles

Make requirements visible

  • Pass a dependency as an existing parameter or constructor field when the caller already chooses it.
  • Keep ambient framework state where the framework owns it; do not introduce dependency injection merely to imitate Effect context.
  • Do not create an interface for a single concrete value unless a real boundary or existing test seam already calls for one.

Make invalid states harder to express

  • Prefer the repository's existing sum types, tagged variants, enums, constrained value types, schemas, guards, and state machines.
  • Narrow broad or nullable values at the boundary instead of scattering casts and checks through consumers.
  • Add a new model only when it removes at least as much branching or ambiguity as it introduces.

Treat failures according to their contract

  • Distinguish expected failures only when callers handle them differently.
  • Use the codebase's existing error mechanism: exceptions, rejected promises, error classes, status objects, or established result types.
  • Preserve unexpected defects and context. Do not catch, wrap, or convert every failure for uniformity.
  • Recover, retry, or fall back only at the boundary that can make a truthful decision.

Keep workflows explicit

  • Keep sequencing, cleanup, cancellation, retry limits, and ownership visible in the function that controls them.
  • Prefer native and existing primitives for cleanup, cancellation, lifecycle, queues, asynchronous work, and scheduling.
  • Do not build generic pipeline, schedule, scope, or resource helpers for one workflow.

Keep pure decisions separate from effects when natural

  • Extract a pure decision only when it has a clear name, removes duplication, or can be understood independently.
  • Keep one-off logic inline when extraction would create a shallow helper or split a readable operation.
  • Keep transport and framework adapters thin when an existing domain or application function already owns the rule; do not create that layering solely for symmetry.

Make concurrency and time deliberate

  • State whether work is sequential, concurrent, cancellable, retried, or best-effort when the behaviour matters.
  • Prefer deterministic synchronization already available in the project over arbitrary sleeps.
  • Add retry, caching, batching, or background work only when required by the task and supported by the operation's real semantics.

Translation Guide

Use this to recognise Effect's intent without reproducing its API surface:

Effect disciplineNon-Effect expression
Requirements in the environmentExisting parameters, constructor fields, context, or framework injection
Typed error channelExisting distinguishable expected-error contract
Schema at boundariesExisting parser, validator, guard, schema library, or explicit narrowing
Tagged stateExisting sum type, tagged variant, enum, or state machine
Scoped resourcesExisting lifecycle, cleanup construct, disposal, or cancellation handling
ScheduleExisting bounded retry or timing policy near the owning operation
Structured concurrencyOwned promises/tasks with explicit cancellation and joining
Service and LayerExisting interface and composition root, but only when both already have a reason to exist

Do Nots

  • Do not add Effect or recreate Effect, Layer, Context, Exit, Cause, Option, or Either under local names.
  • Do not replace the language's ordinary async, exception, optional-value, or framework-state patterns project-wide.
  • Do not add wrappers that only rename a platform or library API.
  • Do not turn local implementation details into public contracts.
  • Do not widen a focused fix into a domain-model, service, validation, or error-handling migration.
  • Do not claim a change is safer when its new ceremony obscures the control flow.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.