The Onion Architecture: 8-layer diagnostic and scaffold for production AI systems
Four tools with basic descriptions and partial schemas. All tools have descriptions (10-200 chars range), but parameter documentation is sparse. onion_scan and onion_audit lack output schema documentation. onion_fix has a numeric layer parameter with min/max constraints, which is good. Error handling and recovery guidance are absent. No tool annotations (readOnlyHint/destructiveHint). Naming is clear (verb_noun pattern), but descriptions lack WHEN/WHY context that LLMs need for tool selection.
Run a deep quality audit on detected layers. Checks for placeholders, missing decision frameworks, weak security configs, and other quality issues. Returns severity-rated findings with specific fixes.
Generate files to fill a specific missing layer. Returns the generated file contents that should be written to the project.
Generate a GOAL.md fitness function file for AI agents to autonomously improve the project's architecture score. Inspired by Karpathy's autoresearch pattern.
Scan a project directory for the 8 layers of production AI architecture. Returns a detailed report with layer-by-layer detection results, weighted scores, and consistency issues.
No output schemas documented for any tool. LLMs cannot plan downstream calls or extract required fields without knowing return structure.
Descriptions lack WHEN/WHY context. 'Scan a project directory' does not explain when to call this vs onion_audit, or what the agent should do with the results.
No error handling or recovery guidance. If scan fails or layer generation is incomplete, the tool provides no actionable next steps for the LLM.
onion_fix is marked WRITE but has no confirmation/dry-run pattern. Agents may generate and write files without user approval, risking unintended project modifications.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 54 | 2026-07-28+ | v2 |
No tool annotations (readOnlyHint/destructiveHint/idempotentHint). Clients cannot determine which tools are safe to retry or which modify state without reading descriptions.