agentleFS
0xrohan100xrohan10/skills/effect-logging/SKILL.md

effect-logging

Skill2 starsChanged 4 months agoMITView on GitHub

Effect v4 logging and observability for APIs and backends. Use for structured logs and logger layers; typed error and Cause boundaries; request context and log spans; or distributed tracing integration.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 6 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the project-pinned effect source first.

    line 8
  2. Distinctive:

    Inspect: Read the pinned Effect version, nearby conventions, error union, runtime layers, HTTP adapter, and telemetry sink.

    line 12
  3. Very specific:

    Apply or review: Keep business code on Effect.log*.

    line 17
  4. Very specific:

    Use Effect.fn("Domain.operation") for named operation boundaries.

    line 23
  5. Very specific:

    Use Effect.annotateLogs for inherited log fields and Effect.withLogSpan only for elapsed-time context in log output.

    line 24
  6. Very specific:

    Use Effect.withSpan and Effect.annotateCurrentSpan for distributed tracing.

    line 25
  7. Distinctive:

    Treat an error's typed status, HTTP status, log level, client body, and alert policy as separate decisions.

    line 26
  8. Distinctive:

    Use static event names plus event-specific allowlisted fields.

    line 27
  9. Very specific:

    Do not infer severity from "typed" versus "defect" alone.

    line 39
  10. Distinctive:

    Every reachable domain error has an exhaustive status, safe body, log level, event name, and alert decision.

    line 45
  11. Very specific:

    Every Cause path handles all typed failures, defects, interruptions, and composite causes without collapsing an Option or swallowing …

    line 46
  12. Distinctive:

    Every logger path deliberately handles event time, every Cause reason, fiber id, allowlisted annotations, and active log spans without …

    line 47
  13. Distinctive:

    Every changed API name and signature was checked against the project-pinned Effect source or current upstream v4 source, and every …

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 v4 Logging and Observability

Use the project-pinned effect source first. If it does not answer an API question, check current upstream source; v4 is version-sensitive.

Process

  1. Inspect. Read the pinned Effect version, nearby conventions, error union, runtime layers, HTTP adapter, and telemetry sink. Continue only when each touched boundary and its data sensitivity are known.
  2. Route. Load every matching reference before proposing or editing code:
    • Error classes, expected failures, external error normalization, catchTag, or orDie: read references/error-patterns.md.
    • HTTP status/body/log policy, Cause, defects, composite causes, interruption, or framework adapters: read references/error-handler.md.
    • Built-in/custom loggers, privacy, log annotations, log spans, tracing, or test capture: read references/logger-setup.md.
  3. Apply or review. Keep business code on Effect.log*; map every domain error explicitly at the owning boundary; preserve interruption; and install logger/tracer implementations once at the runtime edge. Continue until every changed event, error variant, Cause reason, and metadata field has a deliberate policy.
  4. Verify. Typecheck and test against the pinned package, then inspect emitted logs and responses for representative success, each domain error, a defect, a composite cause, and interruption. Review field names and sample values for privacy before completion.

Defaults

  • Model expected application failures with current Schema.TaggedErrorClass<Self>()(...) when schema-backed errors fit.
  • Use Effect.fn("Domain.operation") for named operation boundaries. It creates a tracing span; it is not a log span.
  • Use Effect.annotateLogs for inherited log fields and Effect.withLogSpan only for elapsed-time context in log output.
  • Use Effect.withSpan and Effect.annotateCurrentSpan for distributed tracing. Configure a tracer exporter separately.
  • Treat an error's typed status, HTTP status, log level, client body, and alert policy as separate decisions.
  • Use static event names plus event-specific allowlisted fields. Raw bodies, headers, credentials, tokens, and arbitrary error objects are outside the allowlist.

Severity

LevelUse
Trace / DebugTemporary or sampled diagnostic detail
InfoNormal lifecycle events and routine client outcomes
WarnDegradation, throttling, retries, or conditions needing attention but not immediate investigation
ErrorFailed dependencies, defects, or outcomes needing investigation
FatalProcess-level loss of service where shutdown or restart is expected

Do not infer severity from "typed" versus "defect" alone. A typed persistence failure can be Error; an ordinary not-found can be Info or unlogged.

Completion Gate

Finish only when all of these are true:

  • Every reachable domain error has an exhaustive status, safe body, log level, event name, and alert decision.
  • Every Cause path handles all typed failures, defects, interruptions, and composite causes without collapsing an Option or swallowing cancellation.
  • Every logger path deliberately handles event time, every Cause reason, fiber id, allowlisted annotations, and active log spans without leaking unrestricted payloads.
  • Log annotations, log spans, and distributed tracing are named and configured as distinct mechanisms.
  • Every changed API name and signature was checked against the project-pinned Effect source or current upstream v4 source, and every framework-shaped example is identified as framework-specific or pseudo-code.

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.