DEV Community

Yunus Emre Ak
Yunus Emre Ak

Posted on

From Rules to Router: Teaching AI Your Language, Not Laws

From Rules to Router: Teaching AI Your Language, Not Laws

The Problem with Rules

I used to write rules for AI.
"Always format code this way."
"Never use this pattern."
"Follow these 50 guidelines."

Then the context changed. New project, different codebase, fresh requirements.
All rules broke.

The Discovery: Router > Rules

What if AI doesn't need rules?
What if it needs a translator?

I speak human. AI speaks machine.
Not literally - cognitively.

When I say "think about it" - I mean "plan the algorithm before coding."
When I say "check the vibe" - I mean "look at existing patterns, follow culture."
When I say "this is broken" - I mean "abandon this approach, try something else."

The Router Concept

My Request → Router → AI Understanding → Action
Enter fullscreen mode Exit fullscreen mode

Not rules. Translation.

Real Examples from My Router

"make it clean"
→ Remove all comments except JSDoc
→ One action per line: if (x) return y
→ No var declarations, only const/let
→ Delete console.logs

"check the culture" 
→ git log --oneline -20
→ Find naming patterns (camelCase vs snake_case)
→ See if they use async/await or .then()
→ Copy their error handling style

"what's going wrong?"
→ Don't just fix the error
→ Question why we're doing this
→ Is there a third option?
→ Example: "Can't decide between REST or GraphQL?" → Use tRPC

"make it fast"
→ Change loops to .map()
→ Add Redis cache layer
→ Move calculations to SQL
→ Actual metrics: 200ms → 20ms
Enter fullscreen mode Exit fullscreen mode

Each phrase triggers specific, measurable actions.

Why Router Works

1. Context Agnostic

Rules break when context changes.
Router translates intent regardless of context.

2. Human-Centric

I think in my patterns.
Router translates my patterns to AI patterns.

3. Evolutionary

New pattern discovered? Add to router.
Old pattern obsolete? Update translation.

The Kobayashi Maru Effect

Best discovery: "What do you think?"

Example scenario:

Me: "Should I use MongoDB or PostgreSQL?"
Old AI: "MongoDB is good for unstructured data..."
Router AI: "Why choose? Use PostgreSQL with JSONB columns. 
           Get SQL reliability + JSON flexibility."
Enter fullscreen mode Exit fullscreen mode

System gave A or B.
Router found C.

Implementation in Practice

Here's actual router.md content:

# .claude/output-styles/router.md

"commit this"
  1. git status
  2. git diff --cached  
  3. Remove files I didn't change
  4. Message format: "feat(scope): concrete change
     - validateUser() deleted
     - port 3000→8080
     - 3 rules→7 rules"

"simplify this"
  1. Remove abstractions with single usage
  2. Inline functions under 3 lines
  3. Delete unused imports
  4. Combine similar functions
Enter fullscreen mode Exit fullscreen mode

Not vague instructions. Specific actions.

The Popular Lexicon Pattern

One word, thousand concepts.

"Git" → Entire version control universe
"Kobayashi Maru" → No-win scenario pattern

Router uses these triggers.
One word activates entire knowledge domains.

Practical Benefits

Before Router

Me: "Fix the login function"
AI: "I'll add input validation and error handling"
Me: "No, we don't do it that way"
AI: "I'll use try-catch blocks"
Me: "Still wrong, we use Result types"
AI: "Let me add a Result type wrapper"
Me: *Gives up, writes it myself*
Enter fullscreen mode Exit fullscreen mode

After Router

Me: "check the culture and fix login"
AI: *Runs git log --grep="auth"*
    *Sees pattern: Result<User, AuthError>*
    *Copies exact error handling from previous commits*
    *Uses team's naming: authenticateUser not loginUser*
Enter fullscreen mode Exit fullscreen mode

Output was identical to what senior dev would write.

The Philosophy

We're not teaching AI rules.
We're teaching AI our language.

Like moving to a new country.
You don't memorize laws.
You learn the language.

Evolution Path

  1. Started with rules (failed)
  2. Moved to constitution (better)
  3. Discovered culture in git (good)
  4. Created router (breakthrough)

Router is the translation layer between human intuition and AI execution.

Key Insights

  • Rules are brittle - They break with context
  • Router is flexible - It translates intent
  • Culture beats documentation - Git history > README
  • Patterns beat instructions - "check the culture" > 50 lines of rules
  • Lexicon beats explanation - "Kobayashi Maru" > paragraph of context

Your Turn

Stop writing rules for AI.
Start building your router.

What's your "check the vibe"?
What's your "what do you think"?
What triggers your workflows?

Build your translation protocol.
Teach AI your language, not your laws.

The Future

Imagine every developer with their personal router.
AI understanding each person's cognitive patterns.
No more prompt engineering.
Just natural expression.

"Fix this the way I like."
And AI knows exactly what that means.
Because router translated it.

That's where we're heading.
From rules to routers.
From laws to language.


Beyond Code: The Self-Knowledge Connection

This router concept extends beyond coding. The clearer you know yourself, the better you can translate your needs to AI.

I explored this deeper with ClarityOS - an experimental AI project focusing on self-knowledge first. It's currently in selective waitlist mode (not commercial, just exploring the concept). Because unclear mind = unclear prompts = useless AI responses.

The pattern is universal: Know yourself → Express clearly → Get what you need.

Whether it's code, life decisions, or AI interactions.

More at yemreak.com


Read the original: From Rules to Router: Teaching AI Your Language, Not Laws

Top comments (0)