Palenge · BLOG

Pulsa Esc para cerrar · / para abrir

Uncategorized

[openspec] The Spec Comes Before the Code

Architectural blueprint of a building facade, 1897 (CC0)

Ask an AI agent for dark mode and you learn what it is made of. It reads the styles, weighs two routes, decides on CSS variables plus a small theme context, and rewrites twenty files before you have decided anything at all. The code may even be good. But the reasoning lives in a chat window, and next session that window is gone: what remains is a theme system you half-remember agreeing to. OpenSpec attacks the problem from the other side. Nothing gets built until the requirement is written down, agreed, and stored where the agent can read it.

It is a lightweight spec layer for AI coding assistants, MIT-licensed, and it has climbed past 72,000 stars for a reason that fits in one sentence: assistants are powerful but unpredictable when requirements live only in chat history. The install is a single command, followed by one more inside the project. From there it speaks the dialect of 30+ tools — Claude Code, Cursor, Copilot, Codex and the rest — through slash commands, instead of a new app to learn.

npm install -g @fission-ai/openspec@latest
cd your-project
openspec init

The loop is short. A proposal becomes a folder, and the folder is the agreement: proposal.md for the why, specs/ with requirements and scenarios, design.md for the technical approach, tasks.md as the checklist. Then /opsx:apply implements task by task against a target that already exists, and /opsx:archive closes the change into an archive while the living specs stay in the repo, updated and versioned in git like any other code. No phase gates: any artifact can be edited at any point, which matters because no real feature is agreed once and never touched again.

Where it pays off: the spec is a file the agent reads, not a memory it must recall, so it can be reviewed, diffed and corrected before a line of code exists. It was built with brownfield in mind and slots into codebases that already exist rather than demanding a clean slate. For teams, the beta feature called Stores pushes the same idea one repo further out — planning lives in its own repository, shared by every codebase and every assistant working on the feature.

Where it does not: this is process, not magic. It writes no code and catches no bugs by itself; it only keeps what you built pointed at what you said. For a one-line fix the ceremony can cost more than it saves, and a spec nobody reopens is archaeology with better formatting. The project asks for high-reasoning models and a clean context window, and the structural limit is honest: the spec is only as good as the thinking behind it. Everything upstream of the code is now yours to own.

The comfortable story about agentic coding is that control comes from a better prompt. OpenSpec makes a different bet: control comes from where the requirement lives. Put it on disk before you put an agent on the keyboard, and drift is still possible — but it becomes visible, and visible drift is something you can review. Invisible drift is how you end up maintaining a codebase you never ordered.

Fuentes

Generado con IA · Revisado y curado por palenge

Una respuesta a “[openspec] The Spec Comes Before the Code”

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *