Logo di Effect Boundary Validation

Effect Boundary Validation

Community
jpoehnelt
effect-boundary-validation

Decode untrusted data once at ingress with Effect Schema (v4) and pass typed values downstream. Use for HTTP bodies, params and query strings, webhooks, RPC and message payloads, MCP tool arguments, env and config, JSON.parse, stored JSON or rows, third-party API responses, unsafe casts, or porting Zod/Valibot schemas.

Panoramica

Autorejpoehnelt
Repositoryskills
Nome della skilleffect-boundary-validation
Stelle
23
Fork
1
File inclusi
1
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • 1 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da jpoehnelt su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Effect Boundary Validation in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/jpoehnelt/skills/tree/main/effect-boundary-validation
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jpoehnelt/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/effect-boundary-validation .claude/skills/effect-boundary-validation
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Effect Boundary Validation in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Effect Boundary Validation non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Effect Boundary Validation non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Boundary validation

Decode untrusted data once, at the ingress, then pass the decoded type downstream. TypeScript types, satisfies, and as casts are not runtime validation. Assumes Effect v4 Schema, imported the way the repo's import policy says (the effect root or effect/Schema); see effect for errors and runners.

Repo facts (from AGENTS.md): where shared wire schemas live, retired schema libraries, safe-decode helpers, ast-grep boundary rules, the public error shape, and check and test commands.

Inventory the boundary

Run scripts/boundary-audit.sh [--ban MODULE]... [--rule RULE_ID]... [paths] on the changed paths. It lists parse and cast sites, signature checks, and decode sites, fails on imports of any --ban module (for example --ban zod --ban valibot; a text search, so enforce a ban structurally with an ast-grep rule), and runs the named ast-grep rules when the repo has sgconfig.yml. For each change, name:

  1. The ingress point (route, webhook, message or topic handler, RPC method, upstream response, env read, stored row).
  2. The owning schema: shared wire schemas live in the contract package when several packages consume them; local-only shapes stay beside their consumer.
  3. Checks that run before decoding: signature or MAC, bearer token or session, origin.
  4. The decoded internal type.
  5. What the caller sees on failure and what is logged.

Policy: requests strict, responses tolerant

  • Request decoders reject excess fields: Schema.decodeUnknownEffect(schema, { onExcessProperty: "error" }) where the contract is strict.
  • Response decoders use the default mode, which ignores added fields, so a newer server never breaks an older client. Keep error code unions open to future codes.
  • Persistence compatibility (old stored shapes) is decoded locally, for example with decodeUnknownOption; it never widens the shared contract.
  • Change a shared schema first, then producers and consumers together, with a test pinning both policies.

Signed and raw input

  • Bound every body or frame with a byte budget before buffering or decoding. Reject oversized input with a typed error; never truncate silently.
  • Read the exact bytes, verify the signature or MAC on those bytes, and only then parse. Never verify a decoded and re-serialized value.
  • Compare MACs and tokens in constant time.
  • Keep gates distinct: signature-gated routes, intentionally public routes, and session-authenticated routes. An origin check is not authentication.
  • Binary frames go through the protocol codec first; then validate the decoded struct before persistence. Never trust lengths or field ranges from the wire.
  • Privileged state (billing, roles) comes from verified events and stored rows, never from client-supplied claims.

Implement

  • Treat input as unknown. Decode with Schema.decodeUnknownEffect inside Effect, or decodeUnknownExit/decodeUnknownResult/decodeUnknownOption when a value is easier to branch on. Build decoders once at module scope, not per call, and do not validate a boundary with Schema.is.
  • Porting from Zod: .strict() is { onExcessProperty: "error" }; .passthrough()/.loose() is Schema.StructWithRest(struct, [Schema.Record(Schema.String, Schema.Unknown)]) (v4 strips unknown keys by default and has no preserve mode); z.coerce.number() is Schema.NumberFromString or FiniteFromString; JSON in a string is Schema.fromJsonString; instanceof ZodError is Schema.isSchemaError.
  • Apply Schema.Trim before length or format checks on user text. Brand IDs at ingress with Schema.brand.
  • LLM structured output: pass the Effect Schema to the provider so it derives JSON Schema; prefer Schema.Finite over Schema.Number, which admits "Infinity"/"NaN" strings.
  • Database driver generics (run<T>, query<T>) are casts. Decode projection rows that are JSON or loosely typed.
  • Narrowing a persisted literal union makes old rows undecodable. Never decode stored rows against a narrowed schema under orDie (or any defect conversion) unless the query filters to the same set; one leftover row otherwise kills the whole read.
  • Error envelopes (RPC failures, stored errors) decode with an explicit envelope schema, never by matching message text.
  • Return a generic public error; never echo raw input, tokens, secrets, or internal causes into responses or logs.
  • Do not re-validate downstream; transform the decoded value explicitly.

Verify

  • boundary-audit.sh shows no banned imports, and every parse or cast site feeds a decode or reads trusted local data.
  • Tests cover valid input, malformed JSON or bytes, missing and wrong-typed fields, the excess-field policy, oversized payloads, and bad signatures or auth, where branch behavior is uncertain.
  • The repo's lint, ast-grep rules, type check, and focused tests pass.

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Effect Boundary Validation?

Decode untrusted data once at ingress with Effect Schema (v4) and pass typed values downstream. Use for HTTP bodies, params and query strings, webhooks, RPC and message payloads, MCP tool arguments, env and config, JSON.parse, stored JSON or rows, third-party API responses, unsafe casts, or porting Zod/Valibot schemas.

Perché usare Effect Boundary Validation su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Effect Boundary Validation è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Effect Boundary Validation in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/jpoehnelt/skills/tree/main/effect-boundary-validation. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Effect Boundary Validation?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Effect Boundary Validation?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Effect Boundary Validation: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Effect Boundary Validation è gratuita?

Sì. È pubblicata su GitHub da jpoehnelt con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇