Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Show HN: Topos – Structural code quality metrics for agent-written programs

Topos is an open-source tool that evaluates code quality by analyzing structural properties of programs using graph representations (AST, CFG, CPG, MDG). It calculates metrics for simplicity, composability, and security, designed to help review agent-written code. The project is inspired by category theory and available as a CLI, MCP Server, and VS Code Extension under BSD-3 license.

Background

- This tool (Topos) is a response to a new problem: as AI coding agents (like Claude, Copilot, or Cursor) write more production code, reviewing that code for quality has become a bottleneck. Traditional checks ("does it pass tests?") aren't enough — you need to know if the code is maintainable, secure, and well-structured. - Topos analyzes source code by converting files into graph representations (AST = abstract syntax tree, CFG = control flow graph, etc.) and computes metrics that measure simplicity, composability, and security. The idea is to give both human reviewers and AI agents a quantitative way to judge code quality. - The tool is named after a concept from category theory (a branch of mathematics). The developers are framing code quality evaluation in formal mathematical terms — "objects," "morphisms," "probes," "profunctors" — to create a rigorous evaluation framework. - It ships as a CLI, a VS Code extension, and an MCP server (Model Context Protocol — a standard for connecting AI agents to tools). Open source under BSD-3 license. - The company behind it is Krv Labs (krv.ai). This is an early-stage project posted on Hacker News ("Show HN").