Skip to content
Back to skills

Effect Services

ASecurity

Route all side-effecting operations (filesystem, shell, git, clock) through port interfaces in src/ports/ using Effect dependency injection.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 19, 2026
developmenttypescriptgoshellnodegitbackend

Works with

  • cli

Security analysis

A100/100

Scanned October 19, 2026

npx -y skills add lbdremy/phax --skill effect-services --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Effect Services?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Effect Services
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lbdremy-effect-services/badge)](https://www.skillsdirectory.com/skills/lbdremy-effect-services)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: effect-services
description: Route all side-effecting operations (filesystem, shell, git, clock) through port interfaces in src/ports/ using Effect dependency injection.
---

# Effect services

## The rule

**Direct access to the filesystem, shell, git, Claude, editor, clock, or
`process.env` is only allowed inside `src/infra/` adapters.** All other layers
must go through the port interfaces using Effect's dependency injection.

## How ports are consumed in app/

```typescript
import { FileSystem } from "../../ports/fs.js";
import { Effect } from "effect";

export const createRunFolder = (shortName: string) =>
  Effect.gen(function* () {
    const fs = yield* FileSystem; // injected — no concrete adapter here
    yield* fs.mkdirp(runPath);
    yield* fs.writeAtomic(statusPath, JSON.stringify(initialStatus));
  });
```

The concrete adapter (`NodeFileSystem`) is provided at the composition root in
`cli/main.ts` or in test helpers.

## Why

Infrastructure access outside `infra/` means:

- Tests cannot swap in fakes without patching globals.
- The adapter cannot be replaced (e.g., swapping git for a different VCS
  backend) without touching every call-site.
- Side-effecting code is hidden inside layers that should be pure.

## Common violations and fixes

| Violation                      | Fix                                                     |
| ------------------------------ | ------------------------------------------------------- |
| `fs.readFileSync(…)` in `app/` | Use `FileSystem` port via `yield* FileSystem`           |
| `execSync(…)` in `domain/`     | Move to `infra/shell.ts`; expose via `Shell` port       |
| `process.env.X` in `app/`      | Read in `cli/` on startup; pass as a typed config value |
| `new Date()` in `app/`         | Use the `Clock` port (`yield* Clock`)                   |

## Audit rule

`PHAX_EFFECT_001` — direct FS/shell/git/Claude/editor/clock/`process.env`
access detected outside `infra/`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.