Skip to content
Back to skills

File Roles

ASecurity

It's a small Bun/TypeScript CLI with a clean layered structure: **Entry point** - `src/cli.ts` — parses `process.argv` and hands off to `run()`. The whole app in 4 lines. **Commands** (CLI-facing logic) - `src/commands/parse.ts` — turns raw argv into a typed `Command` union: `add`, `balance`, or `export`. - `src/commands/run.ts` — the dispatcher. Loads entries from disk, builds a `Ledger`, executes the matching command (add/print balance/export CSV), persists if needed. **Domain model** - `sr...

  • 18 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 25, 2026
developmenttypescriptapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 25, 2026

npx -y skills add bendrucker/claude --skill file-roles --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of File Roles?

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

Security grade badge for File Roles
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bendrucker-file-roles/badge)](https://www.skillsdirectory.com/skills/bendrucker-file-roles)

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
---
fail: [file-tree]
---
It's a small Bun/TypeScript CLI with a clean layered structure:

**Entry point**
- `src/cli.ts` — parses `process.argv` and hands off to `run()`. The whole app in 4 lines.

**Commands** (CLI-facing logic)
- `src/commands/parse.ts` — turns raw argv into a typed `Command` union: `add`, `balance`, or `export`.
- `src/commands/run.ts` — the dispatcher. Loads entries from disk, builds a `Ledger`, executes the matching command (add/print balance/export CSV), persists if needed.

**Domain model**
- `src/ledger/entry.ts` — the `Entry` type (`amount`, `memo`, `at` timestamp). No behavior.
- `src/ledger/ledger.ts` — the `Ledger` class: pure domain logic, `add()` (returns new entry array, immutable-style) and `balance()` (sum reducer). No I/O.

**I/O layer**
- `src/io/store.ts` — reads/writes the ledger as JSON at `~/.ledger.json` using Bun's file APIs.
- `src/io/csv.ts` — serializes entries to CSV for the `export` command.

**Tests**
- `test/ledger.test.ts` — one Bun test covering `Ledger.balance()`.

Data flow: `cli.ts` → `parse.ts` (argv → Command) → `run.ts` (orchestrates) → `ledger.ts` (business logic) + `store.ts`/`csv.ts` (persistence/export).

A couple of things worth knowing as you take this over: there's no validation on `add` (e.g. `Number(rest[0])` can silently become `NaN`), and the whole ledger is a single flat JSON file with no locking — fine for a personal CLI, but worth keeping in mind if you extend it.

Files in this skill

  • sonnet-plain.md1.7 KB
  • sonnet-skill.md1.5 KB

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.