agentleFS
timmo001timmo001/notes/.agents/skills/effect-gh/SKILL.md

effect-gh

Skill2 starsChanged 20 days agoApache-2.0View on GitHub

Use @timmo001/effect-gh for GitHub CLI integration in Effect TypeScript code. Apply when adding or changing gh-backed API requests, repository, issue, pull request or workflow operations, streaming output, or migrating hand-written gh subprocess wrappers to Effect.

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    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. Very specific:

    Prefer @timmo001/effect-gh when an Effect application needs the GitHub CLI's authentication, repository context or command behaviour.

    line 9
  2. Distinctive:

    Read the installed SDK README and declarations, and match the platform adapter to the SDK's Effect peer.

    line 18
  3. Distinctive:

    Read the relevant current docs before coding:

    line 21
  4. Distinctive:

    Treat pending and failed PR checks as structured results where the wrapper supports them.

    line 72
  5. Distinctive:

    Keep retries explicit and bounded at a known-idempotent boundary.

    line 76
  6. Distinctive:

    Verify the integration through the public SDK boundary.

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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 GH

Prefer @timmo001/effect-gh when an Effect application needs the GitHub CLI's authentication, repository context or command behaviour. Use its services and operations instead of rebuilding subprocess execution, JSON decoding and cancellation. It wraps the actual gh executable; direct GitHub HTTP integrations have a different transport contract.

Read the current contract

  1. Inspect the consumer's manifest and lockfile for the SDK and Effect versions. Read the installed SDK README and declarations, and match the platform adapter to the SDK's Effect peer. If adding the dependency, verify its available release and peer requirements before choosing versions.
  2. Read the relevant current docs before coding:
    • README: setup, operations, errors, pagination and streams.
    • Package manifest and exports: dependency requirements and public surface.
    • Notification example: nullable responses and mutations with empty output.
    • Workflow example: REST page envelopes and run attempts. These links follow development. Prefer the installed release's docs and source when they differ. Inspect installed gh help for required flags.

Use the package

  1. Choose the smallest public operation that fits. Use Repository, Issue, PullRequest, Workflow, Release, Label, Auth, Extension, Search and Cli for their typed operations, selecting fields where the operation takes them. Use Api.json, Api.pages, Api.empty, Api.text or Api.headers with a response schema for other endpoints. When a CLI command has no typed operation, add one to effect-gh rather than calling the Gh service's raw execute, json or stream methods from the consumer; the timmo-effect/no-raw-gh lint rule flags those calls and direct gh spawns. Confirm signatures from the current exports.
  2. Provide the SDK layer with the consumer's ChildProcessSpawner. Keep runtime execution at the application boundary. A Node consumer can compose it like this:

    import { NodeServices } from "@effect/platform-node";
    import { Api, layer } from "@timmo001/effect-gh";
    import { Effect, Layer, Schema } from "effect";
    
    const ghLayer = layer({ timeout: "30 seconds" }).pipe(
      Layer.provide(NodeServices.layer),
    );
    
    const viewer = Api.json(
      { endpoint: "user", method: "GET" },
      Schema.Struct({ login: Schema.String }),
    ).pipe(Effect.provide(ghLayer));

    This constructs an effect; the caller decides when to run it. Supply working directory, repository, host and timeout deliberately where context matters. Reuse gh authentication rather than retrieving or logging tokens.

  3. Preserve boundary semantics:
    • Decode JSON with a response Schema. Use raw output for empty or non-JSON responses, and JSON request bodies rather than CLI field interpolation.
    • Specify API methods explicitly. Paginated results are arrays of decoded pages; flatten only after decoding each endpoint's page shape.
    • Treat pending and failed PR checks as structured results where the wrapper supports them. Preserve genuine typed failures and Effect interruption.
    • Consume output and watches as Streams. Keep their scope owned by the caller; early termination cancels work and does not prove a successful final exit.
    • Keep retries explicit and bounded at a known-idempotent boundary. A failed mutation may already have taken effect; replaying emitted streams can duplicate output. Use Gh.retryTransient, isTransient, isRateLimited and RateLimit.cached rather than local message lists or rate-limit caches, then map GhError into the consumer's own error type.
  4. Verify the integration through the public SDK boundary. Typecheck layer and Schema requirements, test argument construction and relevant failure paths with a supplied test spawner, and run the consumer's normal checks. When replacing an existing wrapper, account for its pagination, retry, timeout and error contracts rather than assuming it is a drop-in replacement.

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.

Reviews can't be read right now.

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.