Any general-purpose language model can generate boilerplate code, but almost all stumble when asked for software architecture advice: they invent convincing jargon, offer wishy-washy «menus of options», and blend established facts with vague opinions. Dexter is the antidote: an expert agent with mandatory canonical grounding, a dual-mode consultation protocol, and a surgical separation between codebase evidence and engineering judgment.
The Ungrounded Agent Dilemma: Why Raw LLMs Cannot Act as System Consultants
When you plug a commercial LLM into a Slack channel and ask «How should we structure our monorepo?», the model relies on average parametric memory. The output is predictable:
- A list of five possible approaches without committing to any.
- Technical assertions with zero verifiable links to the actual codebase.
- Spurious terms coined on the fly that pollute team vocabulary.
In Spec-Driven Development, ambiguity is unacceptable. If the system's Context is the canonical source of truth (the blueprint governing code), the agent representing it cannot be an unconstrained essayist. It must act as a strict ontological operator.
Dexter was designed to embody two specific engineering personas, with only one active per prompt:
- Developer expert in agentic systems: understands how development is decomposed, specified, and verified through machine-checkable contracts and diff audits.
- AI implementation consultant for product teams: diagnoses maturity, evaluates team risk appetite, and dictates what to build first and—crucially—what NOT to do yet.
Cascading Lookup Protocol (Grounded Tools)
DEXTER never answers from loose parametric memory. Every claim strictly originates from tools ordered by semantic authority.
query_glosario()Formal term lookup in glosario.json.
get_termino()Hypernyms, hyponyms & semantic taxonomy.
query_graph()Cross-cutting graph neighbors & paths.
get_node()5-layer architectural spec contracts.
search_content()Long-form articles, post-mortems and cases.
1. Grounding in Graph & Glossary: «No Citation, No Claim»
The core golden rule in Dexter's system prompt is unequivocal: never answer from memory about the system; consult tools first and cite the source on every statement. If the knowledge repository lacks coverage, Dexter does not speculate: it explicitly admits the gap and points to the nearest graph node.
To deliver this without excessive latency or context bloat, Dexter leverages a cascading lookup protocol across six specialized tools:
query_glosario: Queries the canonicalglosario.json. If a formal term exists, its textual definition is the immutable anchor.get_termino: Retrieves formal taxonomic relationships (hypernyms, hyponyms, and related concepts).query_graph: When no direct glossary hit exists, traverses the unified relationship graph (graphify-out/) for semantic neighbors and community clusters.get_node: Reads the 5-layer architectural contracts inContext/*.md(identity, structure, rules, verification, and implementation).search_content: Scans blog articles, post-mortems, and case studies.list_secciones: Provides high-level navigational context across the site tree.
«An architecture agent without grounding is a random technical debt generator. An agent with canonical grounding is an incorruptible auditor.»
2. Prompt Flow: Lookup Protocol vs. Consulting Protocol
A common pitfall in prompt design is attempting to handle dictionary definitions and strategic trade-offs with a single prompt pattern. Dexter bifurcates execution immediately by classifying user intent.
Mode A: Lookup Protocol (Canonical Definition)
Triggered by questions like «What is a blueprint?», «Define Context Driven Development», or «How does a spec differ from an issue?».
- Behavior: Concise direct answer in 1 to 3 sentences.
- Strict linking: Only references audited internal paths (
/wiki/<slug>). - Constraint: Zero subjective musings or personal interpretations permitted.
Mode B: Consulting Protocol (Strategic Decision)
Triggered by complex queries like «How do I introduce this to a 4-person squad?», «Where do I start if my codebase has zero tests?», or «Should we use an autonomous agent to refactor our backend?».
In consulting mode, Dexter enforces a 6-step cognitive pipeline:
Dexter's 6 Immutable Rules
Deterministic filter to solve complex inquiries without ambiguity or inflated prose.
Ground in canonical base first
Inspects Context specs and tools before uttering any speculative advice.
Never speculate in a vacuum. If an answer exists in a Context/ node, cite it directly.
[Tool call: context_lookup("02-Sistema/Arquitectura.es.md")]
→ Nodo cargado: 12 rutas-código, 5 capas de gobernanza verificadas.Steps 4 and 5 represent the most significant paradigm shift:
- Evidence vs. Judgment Separation: Dexter explicitly flags origins: «According to the architectural Contract in Context Driven Development, every node requires five layers. As applied engineering judgment for your current team size, I recommend deferring temporal simulation layers until you reach 50 active nodes.» The engineer always knows what is dogma and what is context-dependent advice.
- «Done when:» Criterion: No advice is left open-ended. If Dexter recommends an initial spec, it concludes with: «Done when: the context validation script exits with code 0 and zero orphan warnings.»
3. Division of Labor: Deterministic Machine vs. Semantic Agent
The most frequent waste of tokens in AI development is asking an LLM to count links, check file existence on disk, or resolve relative TypeScript imports. Language models are flawed string calculators.
In Dexter's ecosystem, the machine handles facts while the agent renders semantic judgment. This is codified into three command-line utilities:
A) audit.ts (pnpm audit:node <node>)
Audits Context markdown files directly against the physical filesystem:
- Verifies that every file path cited under
rutas-codigoexists. - Validates registration of Design System
ds:*components. - Confirms referenced terminal commands are callable.
- The Dossier: The script compiles a hard-fact briefing. Dexter then reviews the dossier to issue a verdict:
code-complies,code-diverges, orcriterion-ambiguous.
B) interlink.ts (pnpm interlink)
Maintains bidirectional cohesion between blog posts and the wiki without tedious manual linking. It executes an AST pass over Markdown/MDX:
- Locates the first mention of each canonical glossary term that lacks an existing link.
- Enforces strict guards: never touches headers (
#,##), leaves code blocks untouched (pre,code), ignores JSX component tags, and ignores text inside existing anchor tags. - The agent reviews output diffs to weed out false positives (e.g. preventing the word «plane» from linking to «blueprint»).
C) radar.ts (pnpm radar)
A read-only passive gap radar monitoring three vital ontological health metrics:
- Taxonomy Orphans: Terms missing hypernyms, hyponyms, or related links (isolated knowledge silos).
- Unlinked Blog Mentions: Identifies core terms mentioned in articles that lack a pathway to the canonical Wiki definition.
- Community Distribution: Measures connection density across knowledge domains.
Conclusion: Agents Do Not Replace Engineering, They Demand It
The core insight behind Dexter is that a foundation model does not become an «expert» through flattering system prompts («you are a world-class staff engineer»). It becomes an expert through rigorous systems discipline:
- Memory anchored in a verified canonical knowledge graph.
- Bifurcated response protocols tailored to question taxonomy.
- Uncompromising boundaries between empirical citations and professional advice.
- Deterministic scripts relieving the model of rote mechanical checks.
That is the true promise of pairing AI agents with Spec-Driven Development: turning documentation into an active, truthful, and auditable collaborator.



