Building in Public | Building the Calculator Before the App
Updated: Oct 15
TL;DR Thinking about how to make my knitting calculator available to AI assistants led me back to an approach I already wanted to take: building the calculation engine as a standalone library, with a command-line tool as its first interface. That same library can power an iOS app, Android app, web app, public API, MCP-backed plugin, and more.
I am positively itching to start building this knitting app.
Lately, I've been thinking that as soon as I get a spare moment I want to create a Git repository and start coding. But today, instead of thinking about the app itself, I found myself thinking about "meeting users where they are." The phrase came up at work, and it stuck with me. I started thinking: What if, instead of seeking out an app or a website, some knitters are asking AI assistants to calculate evenly spaced increases?
Could an assistant use the calculator I'm planning to build? And if it did, could it give me credit? What would I need to create to make that possible? Those questions led me to APIs, MCP servers, and skills.
Oddly enough, all of that research led me back to the approach I was already planning to take, and reinforced why it mattered.

The command-line idea
Earlier this year, I read Mobile System Design by Tjeerd in ’t Veen. The book discusses a well-known principle: keep an application’s business logic separate from its user interface. But in 't Veen suggests what I think is an ingenious way to enforce that separation: make the business logic usable from the command line.
A command-line tool has no buttons, navigation, animations, or screen layout. It accepts text input and produces text output. If the essential behaviour of an application works there, it cannot quietly depend on a particular graphical interface.
I love this idea. As soon as I read it, I knew I wanted to build my next project this way.
When I started thinking about AI assistants earlier today, I eventually realised I was circling the same idea. The boundary that prevents the calculation code from becoming tangled with an iPhone interface is the same boundary that allows an AI assistant to use it.
A calculator for AI assistants
A normal web calculator has a graphical user interface. A knitter enters a starting stitch count into a text field, a target stitch count into another text field, sets some toggles, presses a button, and—voilà!—they are presented with beautiful and clear instructions. That works well when a human being visits the website directly.
But what if, instead, the human being asks ChatGPT or Claude how to increase evenly from 52 to 60 stitches?
An AI assistant could attempt the calculation itself, and it might produce the correct answer. But that's not the same as using a thoroughly-tested calculator. However, if I want an assistant to use my calculator, I need to give it a way to communicate with my calculator directly.
That's where APIs come in. An API is an interface intended for software rather than people. Instead of filling in a form, an AI assistant could send the stitch counts directly to the calculator’s public API. It could send something like:
{
"currentStitchCount": 52,
"targetStitchCount": 60,
"constructionMethod": "InTheRound"
}The API could return the result as structured data, along with the calculator’s name and a link to a human-readable explanation.
Where MCP and skills fit
MCP stands for Model Context Protocol. This protocol provides a standard way for an AI application to connect to an external server and use the tools that server offers.
Once connected, the AI application can ask the MCP server which tools it provides. My MCP server might offer tools with names such as:
calculate_even_increases
calculate_even_decreases
Along with each tool’s name, the server can provide a natural-language explanation of what the tool does and a structured description of the inputs it accepts. When a knitter asked a matching question, the assistant could select the appropriate tool, pass it the stitch counts, and use the returned calculation in its answer.
A skill would play a different role. The MCP server would provide access to the calculation engine, while the skill would teach the assistant how to use that engine. For example, it could tell the assistant to
ask for missing stitch counts,
clarify ambiguous requests,
call the calculator instead of attempting the arithmetic itself,
and explain the result using familiar knitting language.
An installable plugin would package the skill together with the configuration needed to connect to the MCP server:
Knitting Calculator plugin
├── Skill
│ └── Instructions for handling knitting questions
└── MCP connection
└── Hosted MCP server
└── Calculator libraryThis would give knitters one thing to install. They would not need to understand the distinction between a skill, a plugin, and an MCP server in order to use the calculator.
I plan to keep the skill open source on GitHub so that anyone can inspect, adapt, or install it manually. I will also include it in the installable calculator plugin. Most knitters could simply follow a plugin installation link, while more technical users would still have access to the skill itself.
To summarise:
The calculator library performs the calculation.
The API makes the calculation available through a public web request.
The MCP server presents the calculation as tools an AI application can call.
The skill teaches an AI assistant when and how to use those tools.
The plugin packages the skill and MCP connection into something a knitter can install.
Discoverability
Publishing an API and MCP server would make my calculator available to AI assistants, but it would not make it automatically discoverable. An assistant does not roam the internet looking for useful MCP servers. Before it could call mine, the knitter would need to connect the server to their AI application—most likely by installing a knitting-calculator plugin from a supported directory.
Even then, I doubt many knitters would stumble across the plugin on their own. They could find it by searching the directory, but more likely I would point them to it from my website, blog, or app.
Installation would not guarantee that the assistant uses my calculator or credits it. The assistant still controls the answer it shows. All I can do is give it access to a thoroughly tested calculation engine, return clear attribution with every result, and offer it an alternative to recreating the logic itself.
This may never be how most knitters use the calculator. But wrapping the same library in an API and MCP server is a relatively small investment—and one worth making if it helps me meet knitters where they are.
One library, many interfaces
All of these possible interfaces point to the same small first step: build the calculation engine as a thoroughly tested standalone library, with a command-line tool as its first interface. Everything else can come later, powered by that same library.
AI assistants may be changing the ways people interact with software, but the architectural principle remains the same: keep the core logic separate from the interface.
So, before I build the app, I am going to build the calculator.




Comments