DEV Community

Sagar Kewat
Sagar Kewat

Posted on Originally published at kit.sagarithm.in

Introducing Sagarithm Kit: Turning Unchecked LLM Generation into Disciplined Software Engineering

AI coding assistants write code in 5 seconds. Then spend 2 hours breaking your repository’s architecture, leaking high-entropy secrets, and hallucinating that tests passed.

If you’ve used Cursor, Claude Code, GitHub Copilot, or Windsurf on large-scale production codebases (1,000+ files), you have undoubtedly experienced this phenomenon.

We call it the "Assumed Success" epidemic.


The Core Problem: Assumed Success

Large Language Models are probabilistic pattern matchers. When tasked with implementing a feature or fixing a bug, they write plausible-looking functions and confidently return:

"I have updated the authentication handler, implemented the caching layer, and all tests are passing."

Except:

  1. They never ran the tests in a real terminal.
  2. They introduced an implicit circular dependency cycle between modular boundaries.
  3. They accidentally committed a high-entropy API token or private key directly to git history.
  4. They created redundant utility folders (utils/, helpers/) that violate bounded context domain architecture.

Even worse? Vendor fragmentation.

  • Cursor enforces .cursorrules or .cursor/rules/
  • Claude Code demands CLAUDE.md
  • GitHub Copilot expects .github/copilot-instructions.md
  • Windsurf looks for .windsurfrules
  • Antigravity parses .agents/ and AGENTS.md

If developers on your team prefer different AI tools, or if you switch between IDEs, your engineering governance instantly fractures into isolated silos.


Enter Sagarithm Kit (sagarithm-kit)

Today, we are open-sourcing Sagarithm Kit — a vendor-agnostic governance and engineering framework that bridges the gap between chaotic LLM code generation and enterprise-grade software architecture.

npx sagarithm-kit init
Enter fullscreen mode Exit fullscreen mode

Sagarithm Kit is built on three foundational pillars:

1. Canonical Single Source of Truth

Instead of maintaining five separate proprietary agent config files, you maintain your engineering constitution in standard, version-controlled Markdown:

├── constitution/       # Non-negotiable principles & branch rules
├── policies/           # Machine-enforced constraints (entropy, acyclic architecture)
├── workflows/          # Structured execution lifecycles (bug-fix, feature, release)
└── skills/             # Reusable domain patterns & checklists
Enter fullscreen mode Exit fullscreen mode

2. Universal Transpilation Engine (sagarithm sync)

One command compiles your canonical Markdown specifications into native configuration files for all major AI coding agents:

npx sagarithm-kit sync
Enter fullscreen mode Exit fullscreen mode
🔄 Syncing Sagarithm Kit canonical specifications to target agents...
📦 Loaded canonical assets: 12 articles, 5 skills, 9 policies, 4 workflows.
  ✓ Compiled for [antigravity]: 9 files updated.
  ✓ Compiled for [cursor]: 6 files updated.
  ✓ Compiled for [claude-code]: 1 files updated.
  ✓ Compiled for [copilot]: 1 files updated.
  ✓ Compiled for [windsurf]: 1 files updated.
✨ Sync complete! Updated 18 target configuration files.
Enter fullscreen mode Exit fullscreen mode

3. The 5-Vector Verification Gate (sagarithm verify)

Sagarithm Kit replaces "Assumed Success" with empirical validation across 5 distinct vectors:

  1. Static AST Analysis: Verifies TypeScript syntax contracts and compiler integrity (tsc --noEmit).
  2. Shannon Entropy Security Scan ($H \ge 4.5$): Scans string literals for high-entropy patterns to prevent hardcoded private keys and API tokens.
  3. Architectural Acyclicity: Constructs an AST module dependency graph and detects circular dependency cycles before commits.
  4. Behavioral Terminal Execution: Runs actual test suites in a real shell environment. No simulated passes.
  5. Documentation Topology Sync: Verifies that repository architecture matches the indexed sagarithm.manifest.json.
npx sagarithm-kit verify
Enter fullscreen mode Exit fullscreen mode
🛡️  Running Sagarithm Multi-Vector Verification Gate (Zero Assumed Success)...

📊 Multi-Dimensional Verification Vectors:
  ✅ PASS   [STATIC] (18796ms)
  ✅ PASS   [SECURITY] (268ms) — 0 issue(s) detected
  ✅ PASS   [ARCHITECTURE] (669ms) — 0 issue(s) detected
  ✅ PASS   [BEHAVIORAL] (26886ms) — Passed test suite: test
  ✅ PASS   [DOCUMENTATION] (0ms) — Project topology manifest is present

============================================================
🏆 VERIFICATION STATE: [VERIFIED]
   All multi-vector verification criteria satisfied with empirical evidence.
============================================================
Enter fullscreen mode Exit fullscreen mode

Battle-Tested on a 3,093-File Production Monorepo

We didn't just build this in theory—we dogfooded Sagarithm Kit on our production Next.js monorepo this morning.

During our first run, sagarithm verify immediately caught an implicit circular dependency cycle: an automated content workflow was importing from root scripts, while root testing scripts were importing from automation core.

Neither TypeScript nor Next.js Turbopack caught this error during regular builds. Sagarithm Kit's AST topology analyzer flagged the cycle instantly, allowing us to refactor the internal tasks and preserve clean acyclic architecture.


Get Started in 30 Seconds

Sagarithm Kit is completely open source under the MIT license.

Initialize it in your project today:

npx sagarithm-kit init
Enter fullscreen mode Exit fullscreen mode

Built by builders, for builders. Let's turn unchecked LLM generation into true software engineering discipline.

Top comments (0)