REWRITE THE MATRIX

Develop Story for Telegram, Bale, Rubika Bots Once!

The era of raw arrays and chaotic state management is dead. You are no longer a coder. You are a StoryCaster. Experience the ultimate evolution of the Laravel ecosystem with Katana.

The Monolith of Power

Welcome to [ KrubiK Cyber-Citadel ]

KrubiK Stack Architecture

The Monolithic Ascension

Witness the sacred hierarchy of KRUBイス. Built upon the solid bedrock of raw PHP and the Symfony Layer, ascending through the golden chambers of Laravel and Katana: Origin, culminating in the lightning-charged crowns of KrubiK and Krubot at the ultimate Nexus.

The Dev✸✸ Manifesto

Dev✸✸ is a command doctrine for engineers who build with Dominance.
KrubiK consolidates intent, interface, and execution into a governed architectural kernel — a profoundly powerful, fundamentally robust, super-performant, and dynamically responsive kernel — reducing chaos, preserving clarity, and giving complex systems a Single Strategic Will.
This is DX for those who Command Software, not chase it.

[ Developer Experience Exponentiation ]

The KrubiK Crew


Unveiling_::_The Kernel Anatomy_::_How the Will Is Manifested
The Rebel Warlord

The Nemesis

The Sentient Neuro-Link of the CyberCitadel. He continuously scans the environment, performs deep payload introspection, identifies platform signatures, and selectively summons the optimal Driver while injecting precise identity protocols. Nemesis ensures that every execution carries the correct multiverse identity, and preserving coherence of the core.

Amethyst The Magician

The AmethystMatrix

KrubiK's All-Seeing Eye, The Wise Oracle. She observes chaos, remembers patterns, and performs the alchemy of intent and execution. Bridging logging, caching, and debugging with omniscient will, Amethyst grants the Warlord total systemic consciousness.

Amethyst The Magician

The PhantomShell

System-Hypnotist and Master of the Dark Sciences. Leveraging Reflection, C++, FFI, and raw OS layers, PhantomShell shatters the ultimate Zend Engine barriers. He surgically bypasses private, protected, readonly, and final constraints via MemoryManipulation, granting KrubiK Crew absolute, unrestricted mutation over immutable systemic data.

PrimeAgent

The PrimeAgent

The KrubiK's absolute proxy, executing commands with full impunity. Operating in Diplomat or Spy modes, she engages any platform protocol  via Her Quartessence. Her Native Async toolkit orchestrates non-blocking, concurrent operations, delivering direct and unrestricted commands.

The Sage of Memory

The Dimensional Enforcers

The military-grade execution Drivers of KrubiK.
By encapsulating all platform-specific behavior and configuration, they preserve the architectural coherence of the core while enabling consistent, high-fidelity operation across disparate messaging systems, converting high-level narrative intents into raw, platform-specific kinetic energy.

The Sage of Memory

The Lazarus

The Ultimate Daemon , The Immortal Phoenix. A Trinity of Poller, Worker, and Guardian, Lazarus orchestrates self-resurrection, defies termination, and leverages atomic locks for sovereign control, ensuring perpetual systemic integrity. This Necromancer converts death into a lifecycle energy.

The Warlord :: Krubot

Lord and Sovereign Control-Spine of KrubiK CyberCitadel. He does not run bots — he Commands realities. Write intention once, and Krubot mobilizes routes, memory, UI, drivers, forms, telemetry, and cross-platform execution — Fusing them into one unbreakable field of intent: your intention. One throne. Three fronts. Infinite intent.
This is where Story becomes multi-verse law.

Krubot Nexus Terminal

Narrative Fluent Surface

Compose replies, keyboards, actions, and flow through a chainable, intent-first API. Krubot makes code read closer to conversation design than transport wiring.

Named Routes & Reverse Resolution

Replace fragile callback strings with named routes, parameter resolution, forwarding, and internal route execution that survives refactors with dignity.

Attribute-Driven Routing Matrix

Commands, actions, regex portals, and route metadata are declared with modern PHP attributes, creating a cleaner dispatch layer with stronger discoverability.

Forms, Wizards & Flow Control

Build validated multi-step journeys, restore interrupted progress, and guide structured interaction without collapsing into manual state-machine boilerplate.

Context-Isolated Storage Layers

User, chat, global, and contextual storage give memory precise scope, turning state persistence and accessibility across multi-platforms into architecture instead of improvisation.

Story-Driven UI Composition

Build interfaces as composable scene blocks, not array archaeology. Grids, selections, and responsive keyboard layouts stay expressive and deterministic.

Middleware Boundaries for Real Systems

Global middleware, route middleware, aliases, and grouped boundaries make Krubot fit serious production flows, not disposable demos.

Hyper-DX with Structural Integrity

Expressive for fast creation, disciplined for real architecture. Krubot gives juniors momentum and gives seniors substance.

The Anatomy of a Nexus

[ Master the Modern Art of Commanding Krubot ]

GamePanelNexus.php
namespace App\Nexus;
// To Activate, Just Drop The Code In :: app/Nexus/GamePanelNexus.php

class GamePanelNexus
{
    #[OnCommand('panel')]
    public function showDashboard(Krubot $bot): void
    {
        // Super-Speed Fail-safe resolver for userData
        $isActive = $bot->userStorage()->get('subscribed', false);

        $bot->reply('**Welcome back Commander!**\nYour Account Status 🎮: ' . ($isActive ? 'Active ✅' : 'DeActive ❌️'))
            ->attachKeyboard(function($kb) use($isActive) {
                
            $kb

                // 🟡 Row 1: Primary Action Buttons (3 columns each = 50% width distribution)
                ->row(fn($row) => $row
                    ->add(PowerButton::make('♦️ Buy Gems 💎')->col(3)->action('buy_gem'))
                    ->add(PowerButton::make('♦️ Top-up Wallet 💰')->col(3)->action('wallet'))
                )

                // Only attach Server buttons IF the account is active
                ->when($isActive, function(Keyboard $kbx) {

                    // 🔵 Row 2: Conditional Server Selection Matrix
                    // This demonstrates the raw power of the col() method; strictly aligning
                    // 3 elements side-by-side (2 columns each = 33.33% viewport width).
                    $kbx->row(
                        fn($row) => $row
                            ->add(PowerButton::simple('srv_1', 'IR 🇮🇷')->col(2))
                            ->add(PowerButton::simple('srv_2', 'US 🇺🇸')->col(2))
                            ->add(PowerButton::simple('srv_3', 'EU 🇪🇺')->col(2))
                    );

                })

                // 🔴 Row 3: Full-width Support / Fallback Button (6 columns = 100% viewport width)
                ->row(fn($row) => $row
                    ->add(PowerButton::make('♦️ Online Support 🆘')->col(6)->action('support'))
                );
            })
        ->send();
    }

    #[Action('buy_gem')]
    public function buy_gem(Krubot $bot): void 
    {
        // Business logic for purchasing gems...
    }
    
    #[Action('wallet')]
    public function show_wallet(Krubot $bot): void 
    {
        // Business logic for wallet top-up...
    }

    #[OnCommand('menu')]
    public function showGamesMenu(Krubot $bot): void
    {
        // 1. Fetching VIP products from the database.
        $products = Product::query()
            ->where('is_vip', true)
            ->get(['id', 'name', 'price']); // Returns an Eloquent Collection
        
        // 2. Rapid Transformation via Laravel Collections.
        // Mapping the Products directly into the PowerButton actionable architecture.
        $buttons = $products->map(function (Product $product) {
            $label = "{$product->name} (💰 {$product->price}T)";
            return PowerButton::make($label)->action('order', ['id' => $product->id]);
        })->toArray();

        // 3. The Magic of Chunking: Automatically grouping elements into a pristine matrix.
        // Changing chunk(2) to chunk(3) effortlessly switches the grid layout to a 3-column UI.
        $bot->reply("Today's Exclusive VIP Games: ✨️🧧")
            ->keyboard(
                Keyboard::make()
                    ->rtl() // Can be used for properly Align Persian layouts on the screen by forcing Right-to-Left rendering order // + rtl(false) === ltr()
                    ->buttons($buttons)
                    ->chunk(2) // <--- Its DX! Zero manual row calculation!
            )
        ->send();
    }

    #[Action('order')]
    public function orderGame(Krubot $bot, int $id): void 
    {
        // Business logic for $product Order

        $product = Product::find($id);
        if(!$product)
            return $bot->reply("Product Id is Invalid")->send();

        // $userId = $bot->userId();
        // AmethystMatrix::whisper('Order Started', compact('userId', 'product'));
        // not needed userId, AmethystMatrix collects & logs any data allowed to her via: `config('krubot.amethyst.report_context')[]`

        AmethystMatrix::whisper('Order Started', $product);

        $bot
        ->reply('You\'ve Chosen a Great Game to Engage ✨️🎮️ :: ***' . $product->name . '***')
        ->send();

    }
}

Whispers from Fellow Mages

"Krubot's story-code approach is pure magic. It transformed complex logic into an elegant narrative. A true revelation for multi-platform bot development!"

Anya Sharma, Lead Bot Architect

"The power to deploy on multiple platforms with one code is revolutionary. It feels like wielding forbidden knowledge, but it's all for good!"

Kenji Tanaka, Senior Developer

The Stellar-Synergistic Agreement [S.S.A]

I. The Law of True Origin

All KrubiK / Krubot-based works must honor the originating architecture, the spirit of the ecosystem, and the doctrinal gravity of the structures forged by DoKtor K. Attribution is not decoration; it is lineage.

II. The Law of Continuous Creation

You may build, extend, remix, and transmit — but never by amputating the soul of the system. Innovation is welcome; spiritual dilution is not.

III. The Law of the StoryCaster

Stop treating code as dead machinery. Start shaping software as intentional narrative. The tool serves the story, the story shapes the interaction, and the interaction reveals the architecture.

Join the Krubot / HyperDX Newsletter

[ Or Message to ToyMaker ]