Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

sec-minimal-trusted-code

/sec-minimal-trusted-code

Ogranicza zaufany kod aplikacji: parsowanie przy budowaniu, interfejsy odporne na błędne użycie i najmniej zależności oraz opcji konfiguracji.

Repozytorium
wings ↗
Licencja
MPL-2.0
Ostatnia zmiana repozytorium
04.08.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 04.08.2026, bez odwołań do wycofanych modeli i API.

Licencja

MPL-2.0, otwarta.

Co robi i kiedy

Ogranicza zaufany kod aplikacji: parsowanie przy budowaniu, interfejsy odporne na błędne użycie i najmniej zależności oraz opcji konfiguracji.

Oryginalny opis (EN)

djb's trusted-code minimization applied to YOUR WINGS app — keep parsing at build time, design misuse-resistant APIs, add the fewest deps and config knobs, don't evaluate user strings at runtime. Use when designing a new component/package/public helper, adding a dependency or config option, or reviewing a diff that grows your app.

Jak działa

  1. How this maps to a WINGS app
  2. Checklist for a new feature / API / component
  3. Anti-patterns
Sekcje z nagłówków SKILL.md, w oryginale · 59 linii, 493 słów
Podgląd SKILL.md
---
name: sec-minimal-trusted-code
description: djb's trusted-code minimization applied to YOUR WINGS app — keep parsing at build time, design misuse-resistant APIs, add the fewest deps and config knobs, don't evaluate user strings at runtime. Use when designing a new component/package/public helper, adding a dependency or config option, or reviewing a diff that grows your app.
---

# Minimal trusted code, for your app

Source: D. J. Bernstein, "Some thoughts on security after ten years of qmail
1.0." Security holes are bugs; the bug rate scales with the amount of code that
must be *correct* for security to hold. Three levers, strongest first:

1. **Eliminate code.** The most secure line is the one never written. Before
   adding a feature, weigh what it costs in lines-that-must-be-right.
2. **Eliminate bugs in what remains.** Small functions, explicit data flow, no
   hidden global state, every branch handled.
3. **Eliminate *trusted* code.** Code can exist and still be untrusted — move
   risky work to where a bug *cannot* breach security.

## How this maps to a WINGS app

- **Keep parsing at build time — that's the qmail pattern, and WINGS already
  does it for you.** `gen_i18n` parses all your HTML and flex syntax at build
  time; the wasm runtime just consumes pre-indexed JSON. Don't undo that by
  building a runtime template/expression evaluator that interprets
  user-supplied strings in the browser. If a feature tempts you to "parse rich
  syntax at runtime," push it to build time instead.
- **Design misuse-resistant APIs (NaCl style).** One call that is correct by
  default beats a toolkit of sharp primitives. WINGS gives you the shape to
  imitate: `wi18n.SetCatalogPublicKey` (one call → all-or-nothing,
  fail-closed signature enforcement), `ApplySkin` (returns a typed error
  instead of panicking). The helpers and components you write should have **no
  "insecure but convenient" mode** — no flag that disables escaping,
  validation, or verification.
- **Dependencies are trusted code you didn't write.** Each one must justify
  itself against "could 30 lines of our own do it?" (see `sec-supply-chain`).
- **Config options multiply states.** Every env var or settings key roughly
  doubles your test matrix and adds a way to be configured insecurely. Prefer
  one good default over a knob; if you must add a knob, make the *default* the
  safe value.

## Checklist for a new feature / API / component

- [ ] Could this live at build time instead of runtime?
- [ ] Single entry point that is safe by default — no flag that turns off
      validation, escaping, or verification?
- [ ] Public helpers return `error` instead of panicking? (A panic is total in
      wasm — see `sec-wasm-go`.)
- [ ] Did security-relevant code shrink or grow? If it grew, is the growth
      isolated in one small package with a narrow interface?
- [ ] Zero new dependencies — or a written justification?

## Anti-patterns

- A "flexible" template/expression feature that evaluates user-supplied strings
  in the browser at runtime.
- A helper that accepts `interface{}`/`js.Value` and "figures it out" — that's a
  parser in disguise; type it at the boundary (see `sec-hostile-input`).
- The same validation duplicated across N call sites instead of one choke point
  (one validator = one place to audit, one place to get it right).

Sibling skills: `sec-hostile-input` (boundary typing), `sec-supply-chain`
(dependency cost), `sec-wasm-go` (why panics are fatal here).

Wersje

RepozytoriumWynikLicencja
Ta strona · luisfurquim/wings90MPL-2.0
luisfurquim/wings100MPL-2.0

Migawka bazy z 13.11.2026 · wersja paczki 2d2ea42f92db (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90sec-hostile-input
    Pilnuje walidacji danych przychodzących do aplikacji spoza modułu: odpowiedzi API, pól formularzy, adresów URL, komunikatów i localStorage.
  • 90sec-hostile-input
    Pilnuje walidacji i parsowania danych wejściowych w kodzie czytającym katalogi, szablony, adresy URL, zmienne środowiskowe i odpowiedzi serwera.
  • 90minimalism-driven
    Ogranicza kod przy pisaniu lub restrukturyzacji, zanim powstanie nowy helper, wrapper, klucz konfiguracji lub zależność, oraz gdy ktoś prosi o minimalny albo DRY kod.
  • 100add-cli-option
    Dodaje nową opcję CLI lub konfiguracji Remotion: tworzy AnyRemotionOption, rejestruje parsowanie, podpina settery i aktualizuje dokumentację.
  • 90minimalism-driven
    Pilnuje prostoty kodu przed dodaniem pomocnika, opakowania, klucza konfiguracji lub zależności, bez strojenia wydajności.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.