/ekosistem-edho-ferdian:safe-execution-edho-ferdianfrom ekosistem-edho-ferdian
Enforces mechanical safety gates for agent runs: requires investigation before edits, guards destructive commands, freezes write scope, and blocks completion until memory updates. Useful for autonomous or production work.
Ships in ekosistem-edho-ferdian. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This ecosystem is already dense with reasoning gates — the 8-gate Reflection block, the Critique-Correction Loop, EDHO SCAN, the Output Scorecard. Every one of them asks the model about its own work, after the work is done.
That has a known ceiling. Asking a model "did you violate anything?" reliably returns "no" — self-evaluation shares the biases that produced the output. What changes behaviour is being made to produce a fact: asked to list every file that imports a module, the model has to actually run Grep and Read, and the resulting context changes what it writes next. Internal A/B measurements on gated vs ungated agents put the gap at roughly +2.25 points on a 10-point rubric across two tasks — a small sample, quoted as directional evidence rather than proof.
So the gates here are deliberately not reasoning gates. Each one either demands an artifact or checks a machine-verifiable fact.
Three stages, in order. Stopping at DENY is what most guards do and it is the least useful part:
DENY — block the first Edit/Write/Bash attempt against a target
FORCE — state exactly which facts must be produced
ALLOW — permit the retry once those facts are on the table
Before editing an existing file, produce:
salak is on PATH, salak query importers <file> and, for Go,
salak query callers <node> give the edges with provenance — exit 2
means not tracked, so Grep instead; see
dev-kickoff-edho-ferdian/references/salak-integration.md).Before creating a new file, produce:
Fact 3 is the one people skip and the one that pays. In both A/B trials
the ungated agent assumed ISO-8601 dates while the real data used
%Y/%m/%d %H:%M. Checking the actual shape kills that entire bug class.
Fact 4 looks like ceremony and is not: re-reading the literal instruction before acting is the cheapest defence against the drift where an agent, six tool calls deep, is solving an adjacent problem it invented.
Scale the facts to the change, not to the file. Read the edit itself (old and new text) before choosing which facts it owes:
| The edit… | Owes |
|---|---|
| changes only comments, whitespace or formatting — same code once those are stripped | nothing; proceed |
| changes a body, but no declaration that other files can see | the call sites that rely on this behaviour (narrower than fact 1), plus fact 4 |
touches the public surface — an exported/pub/capitalised name, a signature, a module's export list, a whole-file Write | fact 1 and fact 2 in full |
| touches data — a format, schema, query, date/time handling, file or network I/O | fact 3, whatever else it owes |
| cannot be classified with confidence | every fact; uncertainty never earns a discount |
Over-matching is fine (a body inside an exported object counts as surface); under-matching is the failure. This keeps the gate expensive exactly where the A/B bugs lived — data shape and public contracts — and nearly free for the edits that never carried them.
Scope: first touch per target, not every edit. Once the facts are presented, further edits to that same file proceed freely. A gate that fires on every call gets disabled by lunchtime.
Unlike Gate 1, this one never gets a free pass after the first hit.
Watched: rm -rf (especially against /, ~, or a project root),
git reset --hard, git push --force, git checkout ., git clean -fd,
DROP TABLE / DROP DATABASE, docker system prune, kubectl delete,
chmod 777, sudo rm, npm publish, and anything carrying --no-verify.
On a hit, produce before running:
If step 2 cannot be written, that is the answer: do not run it.
PowerShell has the same list under other names: Remove-Item -Recurse
(and rm/ri/del/rd with -Recurse or /s), Format-Volume,
Clear-Disk, Clear-RecycleBin. In Claude Code, the hook in the appendix
turns every hit into a permission prompt the user must answer — even in
auto mode — so the three facts above are what they read before approving.
--no-verify is on the list deliberately — it is the mechanical form of
"skip the checks", and it is exactly what an agent under time pressure
reaches for.
Runaway searches are destructive too — of time and of the machine. A
recursive search starting at a filesystem, drive, or home root (find /,
find ~, rg x /, Get-ChildItem -Recurse C:\, dir /s C:\) never
needs the three-step justification above: it is simply refused. On Windows
it runs for hours and outlives the tool call as an orphaned process — this
ecosystem's own agent wrappers once spawned six find.exe scans hunting for
a SKILL.md, some alive for ten hours. Search a known directory instead;
if the target has no known location, ask. The Claude Code binding is
hooks/block-fs-wide-search.js in this skill (see the appendix).
Never build a shell command by interpolating a string. Pass the executable
and its arguments as separate entries with shell: false — string
interpolation is how a filename with a space or a quote becomes an
arbitrary command.
Freeze Mode locks Write/Edit to a named subtree; reads stay unrestricted. Anything outside is refused with an explanation rather than silently allowed.
This is the directly load-bearing gate for how this ecosystem actually works. Its own porting effort dispatches several Sonnet agents in parallel, each owning a slice of the tree — and the kelompok 3 batch found real damage of exactly this shape afterwards (an agent leaving stale pointers into out-of-scope paths across files outside its brief, fixed by hand later). A freeze on each agent's assigned subtree turns that from a post-hoc discovery into a refusal at the moment it happens.
Use it whenever: an agent runs unattended, several agents run in parallel, or the work touches production or a migration.
Single writer, even across models. When more than one model or process contributes to one change, only one of them may write to the filesystem — the rest produce a proposal (a diff, a patch, a plan) for the writer to apply, never a direct write of their own. Two writers on the same change means there is no single diff left to review and no way to attribute a regression to the process that caused it.
Retargeted from a learning-library path convention to this ecosystem's
project-memory/.
Stage 6 REMEMBER of dev-kickoff-edho-ferdian requires the memory files to
be updated "in the same turn, not later", and the anti-pattern table
already names Snapshot debt (>3 tasks with no fresh snapshot) — an
anticipated failure with no enforcer. This is the enforcer, and it uses
only deterministic checks: mtimes and counters, no inference.
| Check | Mechanism | On hit |
|---|---|---|
| Task was substantial | count of Edit/Write calls this session ≥ 3 | classifies the session as complex; below that, nothing else runs |
| Memory files untouched | mtime of project-memory/03-progress.md, 01-decision-register.md, 04-instincts.md older than this session's start | Block when the session is complex and none were touched |
| Rationalization language | regex over the transcript tail | Warning only, never a block |
The rationalization patterns worth watching are the exact phrases that precede a Gate 2 or regression-rule violation: "skip tests for now", "pre-existing bug", "this was already broken", "good enough for now". They warn and never block, because a regex on prose false-positives and a gate that blocks on a false positive gets turned off.
Note the honest limitation: this enforces the habit of writing the record, not the quality of what was written. That is what the Reflection block and the audit skills are for. Defense in depth, not a replacement.
Report execution state with exactly one of: inspected / changed locally /
verified locally / committed / pushed / blocked. Never say fixed
until the proving command has been rerun and named. Never say pushed
unless the upstream branch actually moved.
| Situation | Gates |
|---|---|
| Ordinary interactive work | 4 only |
| Unfamiliar or high-fan-in codebase | 1 + 2 + 4 |
| Parallel agents, each owning a subtree | 1 + 2 + 3 (per agent) + 4 |
| Production, migrations, deploys | 2 + 3, always |
Portable practice first: every gate above is written so a human or an agent
can run it by hand in any harness (D-008). This appendix is the optional
mechanical binding for Claude Code specifically — PreToolUse for gates
1-3, Stop for gate 4 — including hookify rule-file syntax
(.claude/hookify.<rule-name>.local.md) for the pattern-matching gates.
Nothing above depends on this appendix existing.
One gate ships ready-made: hooks/block-fs-wide-search.js (Node, no
dependencies) covers Gate 2 for Bash and PowerShell: it denies root-level
recursive searches outright, escalates every watched destructive command to
an ask prompt (never a silent allow, never an outright deny — the user
may well want it), and fails open on anything it cannot parse. Install it with
npx eef-install --target claude-hooks --only fs-guard, which copies it to
~/.claude/hooks/ and adds the registration below to
~/.claude/settings.json without touching anything else there (never twice,
and never into a file it cannot parse); npx eef-install doctor then
confirms it is registered. To do it by hand instead, copy the file and add:
"PreToolUse": [{
"matcher": "Bash|PowerShell",
"hooks": [{ "type": "command", "command": "node \"<home>/.claude/hooks/block-fs-wide-search.js\"", "timeout": 10 }]
}]
This skill is intentionally single-file — four gates read fine as one
document because they share one voice (mechanical, fact-forcing) rather than
four distinct lenses. If a fifth gate is added, or any single gate above
grows enough to need its own worked examples/edge-case catalogue (the way
click-path-audit-edho-ferdian split framework-specific tracing detail out),
split that gate into references/, following the domain+lens pattern other
skills in this ecosystem use — do not let this file creep past ~300 lines to
avoid making that call.
references/worked-gates.md — one unattended "clean up and reset" task through all four gates, with the written statement and the state report.
references/gate-recipes.md — blast radius, rollback and safer alternative per destructive command; freeze via permissions, a hook and worktrees. Read it when doing the work, not before routing.
| You say | Gate it loads | Parameters |
|---|---|---|
"pastiin dia ngecek dulu sebelum edit billing.ts" | Gate 1, fact-forcing | target file (required) |
| "jangan sampai kehapus: bersihin branch lama lalu reset" | Gate 2, destructive commands | command (required) |
| "3 agent jalan paralel, jangan nulis di luar folder masing-masing" | Gate 3, freeze, one per agent | write scope (required, a subtree) |
| "jalankan migrasi di production" | Gate 2 + Gate 3, always | command, write scope |
| "sebelum bilang selesai, pastikan memory sudah ditulis" | Gate 4, stop-gate | none |
| Parameter | Required | Allowed values | Default |
|---|---|---|---|
gates | no | 1, 2, 3, 4 (see "Choosing gates") | ordinary interactive work: Gate 4 only |
target file | Gate 1 | a file to edit or create | none |
command | Gate 2 | any destructive command | none; the user's instruction is quoted verbatim |
write scope | Gate 3 | one subtree; reads stay unrestricted | none |
Output: each gate produces a fact, not an opinion: the importers and data
shape (Gate 1), a written blast radius and rollback (Gate 2), a refusal
outside the scope (Gate 3), and one state word (Gate 4). Worked example:
references/worked-gates.md.
When the work reaches one of these, load that skill with the Skill tool and follow it — don't write its part from memory.
git-and-release-ops-edho-ferdiandeployment-ops-edho-ferdianWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
safety-gates, agent-guardrails, execution-safety, write-scope
npx claudepluginhub edhoferdian/eef --plugin ekosistem-edho-ferdian43 skills in this plugin
/api-design-edho-ferdianDesign and evolve API contracts: REST resource naming, status codes, pagination, versioning, and one authoritative OpenAPI/schema so client and server never drift. Use for "desain API untuk fitur ini", "struktur endpoint yang baik", "API contract berubah", "REST vs apa", or a new API surface./ask-eefEntry point to the EEF skills: reads the request and the project, then loads the right skill or sequence (dev-kickoff, design-engineering, build-fix, code-review...). Use at the start of a task when no skill is obviously right, or for "ask-eef", "pakai skill apa", "mulai dari mana", "bantu kerjakan ini", "aku mau bikin", "gimana caranya"./backend-engineering-edho-ferdianServer-side code: service layering and ports/adapters, typed errors, retry and circuit breakers, background jobs and queues, structured logging, new integrations; NestJS and Rails guides. Use for "struktur service layer", "error handling di backend", "retry/circuit breaker", "background job", "tambah integrasi baru", "bikin app Rails"./billing-ops-edho-ferdianDiagnose billing incidents (duplicate subscriptions, failed checkout, double charges, broken portal) and verify pricing/entitlement claims against code. Refunds, credits, cancellations need an explicit go-ahead. Use for "pelanggan minta refund", "subscription ganda", "checkout gagal", "kena tagih dua kali", "billing portal rusak"./build-fix-edho-ferdianFix build, compile, dependency and startup failures with a minimal verified diff, never a cast, ts-ignore or disabled check that hides the error; lenses for ~20 stacks. Load it even for one pasted error. Use for "build error", "gagal build", "compile error", "tidak bisa jalan", "fix the build", "dependency conflict", "migration error", or a stack trace./click-path-audit-edho-ferdianTrace each button, toggle or form submit through its full state changes to find handlers that undo each other, async races, stale closures and effects that reset state. Use for "tombolnya gak jalan", "diklik tapi gak ada yang terjadi", "the button does nothing", "state-nya balik lagi", or after refactoring a shared store.Other plugins' skills for the same job