// ARCANUM PROTOCOLS // GANG OF FOUR LINEAGE //

Grimoire of Incantations

Where POSIX shell philosophy, multi-language systems code (Bash, Python, Rust, Perl, JavaScript), and generative latent space converge. Battle-tested scripts and frontier AI prompt patterns, traced back to the sacred 1994 Gang of Four design patterns with an arcane magical slant.

TOTAL SPELLS: 3371
SHELL PIPELINES: 61
POLYGLOT CODE: 127
AI PROMPT PATTERNS: 32
PRIMORDIAL CODEX: 161
ESOTERIC RUNES: 161
DOMAIN & CHAOS: 161
ABYSSAL & HARDWARE: 69
ARCANUM TRADITIONS: 25 SCHOOLS
mage@tekromancy:~$
Corporate
GoF Lineage: Abstract Factory

Abstract Factory in ABAP

Enterprise pact magic using the Abstract Factory pattern.

* abap
INTERFACE lif_abstract_factory.
  METHODS create_product_a RETURNING VALUE(ro_product) TYPE REF TO object.
ENDINTERFACE.
CLASS lcl_sap_enterprise_factory DEFINITION.
  PUBLIC SECTION.
    INTERFACES lif_abstract_factory.
ENDCLASS.
CLASS lcl_sap_enterprise_factory IMPLEMENTATION.
  METHOD lif_abstract_factory~create_product_a.
    " Corporate Runes enacted
  ENDMETHOD.
ENDCLASS.
#abap #abstract-factory #enterprise
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory

A necromantic factory for summoning families of Flash Golems and Stage Phantoms.

// asc
package arcana.factories {
    import flash.display.Sprite;

    public interface IGolemFactory {
        function createWarrior():Sprite;
        function createMage():Sprite;
    }

    public class BoneGolemFactory implements IGolemFactory {
        public function createWarrior():Sprite {
            trace("Summoning a warrior of calcified flash memory.");
            return new BoneWarrior();
        }
        public function createMage():Sprite {
            trace("Raising a bone-mage from the deprecated timeline.");
            return new BoneMage();
        }
    }

    public class SpectralGolemFactory implements IGolemFactory {
        public function createWarrior():Sprite {
            trace("Evoking a spectral warrior from the AVM2 abyss.");
            return new SpectralWarrior();
        }
        public function createMage():Sprite {
            trace("Binding a phantom mage to the stage.");
            return new SpectralMage();
        }
    }

    internal class BoneWarrior extends Sprite {}
    internal class BoneMage extends Sprite {}
    internal class SpectralWarrior extends Sprite {}
    internal class SpectralMage extends Sprite {}
}
#abstract-factory #actionscript #flash
Read Full Scroll →
Abjuration
GoF Lineage: Abstract Factory

The Abstract Factory Incantation

A highly robust framework for generating families of military-grade wards without exposing their concrete manifestations.

$ ADA_EXEC
package Ward_Factories is

   type Shield is abstract tagged null record;
   procedure Deploy (S : in Shield) is abstract;

   type Countermeasure is abstract tagged null record;
   procedure Activate (C : in Countermeasure) is abstract;

   type Abstract_Ward_Factory is abstract tagged null record;

   function Create_Shield (Factory : Abstract_Ward_Factory) return Shield is abstract;
   function Create_Countermeasure (Factory : Abstract_Ward_Factory) return Countermeasure is abstract;

end Ward_Factories;

package body Ward_Factories is
   -- Abstract implementations omitted for brevity; strictly defined interface.
end Ward_Factories;

package DoD_Standard_Wards is
   use Ward_Factories;

   type DoD_Shield is new Shield with null record;
   overriding procedure Deploy (S : in DoD_Shield);

   type DoD_Countermeasure is new Countermeasure with null record;
   overriding procedure Activate (C : in DoD_Countermeasure);

   type DoD_Factory is new Abstract_Ward_Factory with null record;
   overriding function Create_Shield (Factory : DoD_Factory) return Shield;
   overriding function Create_Countermeasure (Factory : DoD_Factory) return Countermeasure;

end DoD_Standard_Wards;
#ada #abjuration #military-grade
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory Incantation

Summon families of dependent artifacts without specifying their concrete rune-forms.

$_ EXEC
module AbstractFactory where

open import Data.String

record WidgetFactory (Button Checkbox : Set) : Set where
  field
    createButton   : Button
    createCheckbox : Checkbox

-- Concrete Rune Forms
record WinButton : Set where
  field render : String
record WinCheckbox : Set where
  field toggle : String
  
winFactory : WidgetFactory WinButton WinCheckbox
winFactory = record 
  { createButton   = record { render = "WinButton" }
  ; createCheckbox = record { toggle = "WinCheckbox" }
  }
#agda #dependent-types #cyber-magic
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory: Matrix of Creation

Define a family of polymorphic relations without specifying their concrete instantiations.

$ ALLOY_EXEC
abstract sig ConstructA {}
abstract sig ConstructB {}

sig CyberConstructA1, CyberConstructA2 extends ConstructA {}
sig NeonConstructB1, NeonConstructB2 extends ConstructB {}

abstract sig AbstractForge {
  createA: one ConstructA,
  createB: one ConstructB
}

sig CorpForgeAlpha extends AbstractForge {}
{
  createA in CyberConstructA1
  createB in NeonConstructB1
}

sig CorpForgeBeta extends AbstractForge {}
{
  createA in CyberConstructA2
  createB in NeonConstructB2
}

pred generate_constructs {}
run generate_constructs for 3
#creational #factories #sigils
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory

Conjure arrays of alien artifacts using interchangeable glyph matrices.

⍝ Dyalog APL
:Namespace AlienTech
    :Class AbstractFactory
        ∇ R←CreateWeapon
          :Access Public Shared
          R←'?'
        ∇
        ∇ R←CreateVessel
          :Access Public Shared
          R←'?'
        ∇
    :EndClass

    :Class ZetaRetculiFactory : AbstractFactory
        ∇ R←CreateWeapon
          :Access Public Shared
          R←'Plasma ⍋ Emitter'
        ∇
        ∇ R←CreateVessel
          :Access Public Shared
          R←'Saucer ⍟'
        ∇
    :EndClass

    :Class PleiadianFactory : AbstractFactory
        ∇ R←CreateWeapon
          :Access Public Shared
          R←'Photon ⍉ Beam'
        ∇
        ∇ R←CreateVessel
          :Access Public Shared
          R←'Lightship ⍒'
        ∇
    :EndClass
:EndNamespace
#apl #creational #alien
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory: Barbarian's Arsenal

Summoning related groups of destructive tools without specifying their exact concrete classes, barbarian style.

$_ EXEC
IT'S SHOWTIME

LISTEN TO ME VERY CAREFULLY CREATE_WEAPON
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE FACTORY_TYPE
GIVE THESE PEOPLE AIR
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE WEAPON_ID
BECAUSE I'M GOING TO SAY PLEASE FACTORY_TYPE
  GET TO THE CHOPPER WEAPON_ID
  HERE IS MY INVITATION 1
  ENOUGH TALK
  TALK TO THE HAND "Plasma Rifle created!"
BULLSHIT
  GET TO THE CHOPPER WEAPON_ID
  HERE IS MY INVITATION 2
  ENOUGH TALK
  TALK TO THE HAND "Minigun created!"
YOU HAVE NO RESPECT FOR LOGIC
I'LL BE BACK WEAPON_ID
HASTA LA VISTA, BABY

I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE FACTORY
GET TO THE CHOPPER FACTORY
HERE IS MY INVITATION 1
ENOUGH TALK

I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE MY_WEAPON
GET YOUR ASS TO MARS MY_WEAPON
DO IT NOW CREATE_WEAPON FACTORY
TALK TO THE HAND "Arsenal loaded."

YOU HAVE BEEN TERMINATED
#creational #abstract-factory #arnoldc
Read Full Scroll →
Necromancy
GoF Lineage: Abstract Factory

The Abstract Factory

A dark ritual to conjure families of related entities from the silicon void.

; nasm -f elf64
section .data
    msg_ghoul db "Ghoul arisen", 0
    msg_wraith db "Wraith materialized", 0

section .text
    global _start

; Abstract factory interface in RAX
_start:
    ; Call factory method for Ghoul
    mov rax, spawn_ghoul
    call rax

    ; Call factory method for Wraith
    mov rax, spawn_wraith
    call rax

    mov rax, 60
    xor rdi, rdi
    syscall

spawn_ghoul:
    ; Implementation for spawning a ghoul
    ret

spawn_wraith:
    ; Implementation for spawning a wraith
    ret
#abstract-factory #assembly #creational
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Poltergeist's Abstract Factory

Summon families of spectral keystrokes and phantom clicks without binding your incantations to their mortal forms.

$_ EXEC
class AbstractGhostFactory {
    CreateKeystrokeGhost() {
        throw Error("Not implemented")
    }
    CreateMouseGhost() {
        throw Error("Not implemented")
    }
}

class MischiefFactory extends AbstractGhostFactory {
    CreateKeystrokeGhost() {
        return MischiefKeystroke()
    }
    CreateMouseGhost() {
        return MischiefMouse()
    }
}

class MischiefKeystroke {
    Haunt() {
        Send("^{Left}")
    }
}

class MischiefMouse {
    Haunt() {
        Click("Right")
    }
}

; Summoning
factory := MischiefFactory()
k := factory.CreateKeystrokeGhost()
m := factory.CreateMouseGhost()
k.Haunt()
m.Haunt()
#autohotkey #abstract-factory #automation
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory in AWK

Conjure text factories dynamically to shape raw data streams into refined artifacts.

$_ EXEC
# The Abstract Factory weaves distinct grimoire formats
function factory_html_begin() { return "<html><body><div class='scroll'>" }
function factory_html_end() { return "</div></body></html>" }
function factory_json_begin() { return "{ \"scroll\": [" }
function factory_json_end() { return "] }" }

# The Factory Selector - Channeling the chosen text realm
function begin_doc(type) {
    if (type == "html") return factory_html_begin()
    if (type == "json") return factory_json_begin()
}

function end_doc(type) {
    if (type == "html") return factory_html_end()
    if (type == "json") return factory_json_end()
}

BEGIN { 
    format = "json"
    print "Opening the artifact..."
    print begin_doc(format) 
    print end_doc(format)
}
#awk #text-processing #creational
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory

Forging the precursor runes to spawn ancient objects through typeless invocation.

/* b compile */
/* The primordial essence knows no types, only vectors and addresses */

rune_a_forge() {
    auto mem[2];
    mem[0] = 'R'; mem[1] = 'A';
    return mem;
}

rune_b_forge() {
    auto mem[2];
    mem[0] = 'R'; mem[1] = 'B';
    return mem;
}

/* The Abstract Factory is merely an array of forge pointers */
ext factory[2];

init_factory() {
    factory[0] = rune_a_forge;
    factory[1] = rune_b_forge;
}

spawn_rune(type) {
    /* Dynamic dispatch across the void */
    return (factory[type])();
}
#b #design-pattern #precursor
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory of the Cyber-Realm

A grimoire on summoning cross-platform shell artifacts using the Abstract Factory pattern.

#!/usr/bin/env bash
#!/usr/bin/env bash

# The Abstract Forge
bind_artifact_forge() {
  local realm=$1
  if [[ "$realm" == "neon" ]]; then
    forge_weapon="neon_blade"
    forge_armor="neon_shield"
  elif [[ "$realm" == "void" ]]; then
    forge_weapon="void_scythe"
    forge_armor="void_cloak"
  else
    echo "Unknown realm: $realm" >&2
    return 1
  fi
}

# Neon Realm Conjurations
neon_blade() { echo "[Neon Blade]: Emits a humming pink plasma arc."; }
neon_shield() { echo "[Neon Shield]: Deflects kinetic and thermal damage."; }

# Void Realm Conjurations
void_scythe() { echo "[Void Scythe]: Cuts through reality itself."; }
void_cloak() { echo "[Void Cloak]: Absorbs all ambient light."; }

# Client code
summon_gear() {
  local realm=$1
  echo "Binding to $realm forge..."
  bind_artifact_forge "$realm"
  $forge_weapon
  $forge_armor
}

summon_gear "neon"
summon_gear "void"
#bash #abstract-factory #creational
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory of the Ancestral Void

Conjure families of related void-artifacts without specifying their concrete structures.

$_ EXEC
GET "libhdr"

// The Void Interface
MANIFEST $(
  VOID_CREATE_WEAPON = 0
  VOID_CREATE_ARMOR = 1
$)

// Concrete Factories
LET AbyssalFactory(op) = VALOF $(
  SWITCHON op INTO $(
    CASE VOID_CREATE_WEAPON: RESULTIS "Abyssal Blade"
    CASE VOID_CREATE_ARMOR:  RESULTIS "Abyssal Plating"
    DEFAULT: RESULTIS "Nothing"
  $)
$)

LET AstralFactory(op) = VALOF $(
  SWITCHON op INTO $(
    CASE VOID_CREATE_WEAPON: RESULTIS "Astral Spear"
    CASE VOID_CREATE_ARMOR:  RESULTIS "Astral Aegis"
    DEFAULT: RESULTIS "Nothing"
  $)
$)

// Client Conjuration
LET ConjureGear(factory) BE $(
  LET weapon = factory(VOID_CREATE_WEAPON)
  LET armor = factory(VOID_CREATE_ARMOR)
  writef("Conjured Weapon: %s*n", weapon)
  writef("Conjured Armor: %s*n", armor)
$)

LET START() BE $(
  writef("--- Abyssal Conjuration ---*n")
  ConjureGear(AbyssalFactory)
  writef("--- Astral Conjuration ---*n")
  ConjureGear(AstralFactory)
$)
#abstract-factory #void #conjuration
Read Full Scroll →
Evocation
GoF Lineage: Abstract Factory

The Primordial Abstract Factory

Forging related artifacts of the deep metal through distinct metallurgical schools.

$ C_EXEC
#include <stdio.h>
#include <stdlib.h>

// The Primordial Blueprint demands interfaces via function pointers.
typedef struct {
    void (*cast)(void);
} Spell;

typedef struct {
    void (*bind)(void);
} Ward;

typedef struct {
    Spell* (*create_spell)(void);
    Ward* (*create_ward)(void);
} ArcaneFactory;

// Fire School Implementation
void fire_spell_cast(void) { printf("Casting primordial flame!\n"); }
void fire_ward_bind(void) { printf("Binding a wall of ash.\n"); }

Spell* create_fire_spell(void) {
    Spell* s = malloc(sizeof(Spell));
    s->cast = fire_spell_cast;
    return s;
}
Ward* create_fire_ward(void) {
    Ward* w = malloc(sizeof(Ward));
    w->bind = fire_ward_bind;
    return w;
}

ArcaneFactory get_fire_factory(void) {
    ArcaneFactory f = { create_fire_spell, create_fire_ward };
    return f;
}

int main() {
    ArcaneFactory factory = get_fire_factory();
    Spell* spell = factory.create_spell();
    Ward* ward = factory.create_ward();
    
    spell->cast();
    ward->bind();
    
    free(spell);
    free(ward);
    return 0;
}
#c #creational #abstraction
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory

Forging STARK prover artifacts through polymorphic factories.

$ CAIRO_EXEC
trait ArtifactFactory<T> {
    fn create_trace(self: @T) -> felt252;
    fn create_proof(self: @T) -> felt252;
}
#[derive(Copy, Drop)]
struct StarkFactory {}
impl StarkFactoryImpl of ArtifactFactory<StarkFactory> {
    fn create_trace(self: @StarkFactory) -> felt252 { 'stark_trace' }
    fn create_proof(self: @StarkFactory) -> felt252 { 'stark_proof' }
}
#cairo #design-pattern #factory
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory Incantation in Carbon

Forge families of related cyber-arcane artifacts without specifying their concrete C++ Successor classes.

$_ EXEC
package AbstractFactory api;

interface AbstractProductA {
  fn Ignite[me: Self]() -> String;
}

interface AbstractProductB {
  fn Resonate[me: Self]() -> String;
}

interface AbstractFactory {
  fn CreateProductA[me: Self]() -> auto;
  fn CreateProductB[me: Self]() -> auto;
}

class ConcreteProductA1 {
  impl as AbstractProductA {
    fn Ignite[me: Self]() -> String { return "Neon Spark A1"; }
  }
}

class ConcreteProductB1 {
  impl as AbstractProductB {
    fn Resonate[me: Self]() -> String { return "Plasma Hum B1"; }
  }
}

class ConcreteFactory1 {
  impl as AbstractFactory {
    fn CreateProductA[me: Self]() -> auto { return ConcreteProductA1(); }
    fn CreateProductB[me: Self]() -> auto { return ConcreteProductB1(); }
  }
}
#creational #carbon #c++ successor
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory of Profane Flesh

A dark Chef recipe manifesting the Abstract Factory pattern through profane culinary arts.

$ CHEF_EXEC
The Abstract Factory of Profane Flesh.

This recipe provides an interface for creating families of related or dependent culinary abominations without specifying their concrete recipes.

Ingredients.
72 g cursed souls
12 ml liquid shadows
1 pinch despair
3 heaping cups writhing tentacles

Method.
Put cursed souls into the mixing bowl.
Add liquid shadows to the mixing bowl.
Fold despair into the mixing bowl.
Stir the mixing bowl for 13 minutes.
Pour contents of the mixing bowl into the baking dish.

Serves 666.
#creational #abstract-factory #abomination
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory: Multiplexed Switchboards of the Aether

Forging divergent telecommunication switchboard components through a singular arcane interface.

$_ EXEC
ABSTRACT_FACTORY_HEX: MODULE
  GRANT MAKE_SWITCH, MAKE_ROUTER, SWITCH_PROC, ROUTER_PROC;
  
  NEWMODE SWITCH_T = STRUCT ( id INT, capacity INT );
  NEWMODE ROUTER_T = STRUCT ( id INT, bandwidth INT );
  
  SWITCH_PROC: PROCEDURE (s SWITCH_T);
    /* Route the signal through the crystal matrix */
  END SWITCH_PROC;
  
  ROUTER_PROC: PROCEDURE (r ROUTER_T);
    /* Direct the packet through the aether streams */
  END ROUTER_PROC;
  
  MAKE_SWITCH: PROCEDURE (id INT, cap INT) RETURNS (SWITCH_T);
    DCL s SWITCH_T;
    s.id := id; s.capacity := cap;
    RETURN s;
  END MAKE_SWITCH;
  
  MAKE_ROUTER: PROCEDURE (id INT, bw INT) RETURNS (ROUTER_T);
    DCL r ROUTER_T;
    r.id := id; r.bandwidth := bw;
    RETURN r;
  END MAKE_ROUTER;
END ABSTRACT_FACTORY_HEX;
#telecom #chill #conjuration
Read Full Scroll →
Conjuration
GoF Lineage: Abstract Factory

The Abstract Factory Incantation

Manifesting families of arcane glyphs without specifying their concrete forms.

;; clj -M
(ns tekromancy.abstract-factory)

(defprotocol SpellForge
  (cast-fire [_])
  (cast-ice [_]))

(defrecord InfernalForge []
  SpellForge
  (cast-fire [_] "Infernal Fireball")
  (cast-ice [_] "Soul Frost"))

(defrecord CelestialForge []
  SpellForge
  (cast-fire [_] "Holy Flame")
  (cast-ice [_] "Crystal Glacier"))

(defn invoke-elements [forge]
  [(cast-fire forge) (cast-ice forge)])

;; Usage:
;; (invoke-elements (->InfernalForge))
#creational #abstract-factory #clojure
Read Full Scroll →
Necromancy
GoF Lineage: Abstract Factory

The Abstract Factory of Ancient Ledgers

Summoning entire lineages of financial daemons from the mainframe abyss without specifying their concrete incantations.

*> cobc -x
IDENTIFICATION DIVISION.
CLASS-ID. LEDGER-FACTORY INHERITS BASE-DAEMON.

ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
REPOSITORY.
    CLASS BASE-DAEMON IS "System.Object"
    CLASS CURSE-LEDGER IS "CurseLedger"
    CLASS BOON-LEDGER IS "BoonLedger".

IDENTIFICATION DIVISION.
FACTORY.
PROCEDURE DIVISION.

IDENTIFICATION DIVISION.
METHOD-ID. CREATE-CURSE-LEDGER.
DATA DIVISION.
LINKAGE SECTION.
01 RET-LEDGER OBJECT REFERENCE CURSE-LEDGER.
PROCEDURE DIVISION RETURNING RET-LEDGER.
    INVOKE CURSE-LEDGER "NEW" RETURNING RET-LEDGER.
END METHOD CREATE-CURSE-LEDGER.

IDENTIFICATION DIVISION.
METHOD-ID. CREATE-BOON-LEDGER.
DATA DIVISION.
LINKAGE SECTION.
01 RET-LEDGER OBJECT REFERENCE BOON-LEDGER.
PROCEDURE DIVISION RETURNING RET-LEDGER.
    INVOKE BOON-LEDGER "NEW" RETURNING RET-LEDGER.
END METHOD CREATE-BOON-LEDGER.

END FACTORY.
END CLASS LEDGER-FACTORY.
#necromancy #mainframe #gof
Read Full Scroll →