agent_primitives - capabilities your coding agent has to prove with specs
Morning all,
I’ve just released agent_primitives, a gem for ruby devs who let coding agents write a good share of their code.
It’s extracted from the harness I have built for www.pitchd.ai, myself and my wife’s marketing tech startup. I rely heavily on this functionality, it has revolutionised how I work with my agents and I wanted to share it.
The problem: your code shows what the app does today, but not what it must keep doing, or why. Every agent session starts without that knowledge. So an agent “fixes” a deliberate decision because it looks like a bug, or weakens the one spec that protected a behaviour you care about, and the suite stays green.
agent_primitives makes each capability of your app something that is stated, then proven.
Stated. Each capability gets a short doc that lists what it must do, as plain numbered sentences. “A reader can reply to any comment.” “Replies show nested under their parent.”
Proven. Each sentence is tied to the RSpec examples that prove it, with a tag on the example:
it “shows replies nested under their parent”, intent: “comment_threads#I2” do So for any behaviour you care about, you can ask “which specs prove this?” and get an answer. A capability with a sentence nobody has proven is reported as unproven.
Watched. The tooling flags any change that touches the intent or its proof: an example removed or weakened, a tag dropped, a sentence reworded. The agent can’t change what the app is supposed to do without you seeing it. That decision stays yours.
It also works forwards. Write the capability before the code, and the agent builds the feature from specific, behaviour-based statements, not a loose prompt. Each statement becomes a spec it has to make pass, so “done” means every behaviour you asked for is proven.
You don’t maintain the docs as a separate chore. The gem ships a set of agent skills that fold this into the planning, building and review you already do, and it can interview you to backfill features that already exist.
It needs RSpec and an agent that can load skills.
gem “agent_primitives”, group: :development Source and README: GitHub - pitch-sourcery/agent_primitives · https://github.com/pitch-sourcery/agent_primitives
It’s a 0.1.0, so I’d really value feedback.
Post a comment