Skip to content

Latest commit

 

History

History

Examples

Each folder is one CraftCode pattern as a real before / after pair you can open side by side — not a snippet buried in prose. The before reads like fresh AI output; the after reads like a senior wrote it. Same behavior, different texture.

The patterns are spread across six languages on purpose: they are language-agnostic. The idea is the same whether you write Python, Go, Rust, JavaScript, or CSS.

# Pattern Language What the diff shows
01 Intent comments Python Delete the what-comments; keep one why-comment on the non-obvious in-place mutation.
02 Fail-open / fail-closed Go Peripheral (logger, plugin) degrades and continues; auth denies when it can't verify.
03 Idempotency awareness Python Charge + email move out of the retry loop; retry only transient errors.
04 Native over library JavaScript Drop AOS / Moment / Lodash for IntersectionObserver, Date, and Set.
05 Constraints baked in HTML + CSS Self-hosted font + click-to-load map — privacy designed in, not bolted on.
06 Defensive boundary, clean core Rust Parsing fenced at the edge; the core is one honest sum().

Pattern 0 (mirror the neighbors before you write) has no standalone example — by definition it only shows up inside a project, matching the files already there.

Read the reasoning behind each in ../SKILL.md, and see the evidence the skill actually changes model output in ../PROOF.md.