sonder-architecture-contract

Documents load-bearing architectural decisions, invariants, and known weaknesses of the Sonder Runtime codebase.

6|3|Updated Jul 3, 2026
One-click install
npx skills add https://github.com/Krilliac/Sonder-runtime --skill sonder-architecture-contract-krilliac
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sonder-architecture-contract
Source: https://github.com/Krilliac/Sonder-runtime/tree/main/.claude/skills/sonder-architecture-contract
Command: npx skills add https://github.com/Krilliac/Sonder-runtime --skill sonder-architecture-contract-krilliac

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Engineers working on the Sonder Runtime need to know why the code is structured the way it is, which documents are authoritative, and which invariants are machine-enforced before making structural changes. This Skill answers architecture questions without requiring a full read of the ADRs, the master spec, and the 641-line check_architecture.py script. ## Core Features & Use Cases - Document authority hierarchy: Ranks the master implementation spec, focused contract docs, verified evidence, and historical planning docs so rank-4 documents are never cited as current status. - ADR and invariant reference: Summarizes the six SPEC-5 ADRs, the layered package dependency rule, and the ratchets enforced by scripts/check_architecture.py, including retired-module and shim policies. - Violation triage and weak points: Maps check_architecture.py violation messages to the correct fix and lists known-weak points such as the 25,325-line server.py composition root. - Use Case: When check_architecture.py fails with "production caller imports compatibility root module", consult this Skill to learn the right fix is importing the packaged sonder_runtime adapter instead of adding an exception. ## Quick Start Ask why the Sonder Runtime code is structured this way or what invariant a proposed import change would break.

Frequently Asked Questions about sonder-architecture-contract

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a check_architecture.py layer violation?

Map the violation message to a placement decision rather than a suppression. For example, interfaces importing adapters should route through an application service, and sqlite3.connect calls belong in an adapters/persistence module injected into callers.

Which Sonder architecture document is authoritative?

The master implementation spec SONDER-MASTER-IMPLEMENTATION-SPEC.md ranks first, followed by focused contract docs like ARCHITECTURE.md and SECURITY.md, then verified evidence files. Historical WP and REMAINING documents are rank 4 and must never be cited as current status.

Can I add a compatibility shim for a retired module?

No. ADR-002 forbids permanent shims, and check_architecture.py allowlists exactly one byte-exact shim at sonder_runtime/adapters/ollama/gateway.py. Adding entries to APPROVED_RETIRED_SHIMS trips the ratchet by design.

Why did check_architecture.py report a retired root module?

A file matching one of the 52 RETIRED_ROOT_MODULES paths exists in the tree; the check works by filesystem presence even without git. Delete the file and use its packaged replacement under sonder_runtime/ instead.

When should I not use this architecture reference?

Do not use it to execute a server.py decomposition slice, debug CI gate mechanics, or update documentation. Those tasks belong to the decomposition campaign, change-control, and docs-and-writing skills respectively.