SpecForge

io.github.leaderiop由 GitHub 帳號 leaderiop 發布v0.1.0-rc1更新於 Oct 26, 2026

Turn your team's rules into checks your AI agent can't skip. Deterministic, no AI inside.

概覽

AI 產生的概覽

確定性的規格編譯器,讓 AI 代理透過 MCP 讀取、查詢並編輯受規則檢核的專案實體圖。

可以做什麼
  • 讀取並查詢由專案內 .spec 檔案編譯而成的實體與連結圖
  • 透過具型別的操作新增與修改實體和連結,違反規則的變更會被拒絕
  • 檢核規格,將失效參照、缺漏內容與未被證明的承諾回報為錯誤與警告
  • 依據模型回答問題,例如某個人物角色使用哪些管道、哪些項目尚未排程
  • 在你核准測試指令後,記錄哪些測試證明了哪些實體
適用情境
適合希望代理依據結構化、可機器檢核的知識工作,而非依據散文式規格、PRD 或政策文件的場合;也適合要求違規變更被拒絕而非被默默略過的團隊。可用於軟體規格、產品計畫,以及任何有值得檢核規則的領域,前提是有對應的擴充套件。
執行需求
以本機 MCP 伺服器執行,透過 specforge mcp 指令並指定專案的絕對路徑啟動;專案需先以 specforge init 初始化並啟用所需擴充套件。以單一二進位檔提供,無相依套件;形式化證明另需在 PATH 中提供 z3 求解器。未宣告驗證、環境變數或標頭。
安裝前請注意
代理可以編輯圖,但無效的變更會被拒絕且不會寫入。執行 specforge collect 會在詢問一次後執行你的測試指令,請先確認將要執行的內容。擴充套件是從套件庫安裝的 WASM 套件,應視為需要信任的程式碼。它本身不呼叫模型,也不會向第三方傳送資料。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 SpecForge,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[SpecForge. Turn your team's expertise into rules your AI can't skip. AI drafts, SpecForge checks, you sign.]

See it in 60 seconds · How it works · What you can build · Docs

SpecForge turns what your organisation knows into rules your AI can't skip.

You write down your things, how they link, and the rules they must obey. SpecForge compiles that into one typed, checked graph. People and AI agents read it and change it through standard protocols (CLI, MCP, LSP), and a change that breaks a rule is refused, whoever made it.

It works for software specs, product plans, quality procedures, or any field with rules worth checking. SpecForge doesn't know your field until you install an extension that teaches it.

The problem

AI can now do real work: write code, draft a launch plan, prepare a batch record. What it works from is the weak part.

The knowledge that should guide it sits in places nothing enforces:

  • Documents and specs in prose (PRDs, Markdown specs, policies, brand guides). An agent can misread a rule or skip it, silently. Nothing checks that the document is complete or that its parts agree.
  • Wikis and decks drift away from reality, and nothing breaks when they do.
  • Traceability (which requirement has a test, which procedure has an approval, which campaign has a source for its claim) is a spreadsheet someone updates by hand, until they stop.
  • Every session starts from zero. The agent re-reads dozens of files to rediscover what you meant, and still guesses.

The more work you give to AI, the worse this gets. It produces faster than anyone can review.

This isn't a problem with the model. It's a problem with where your rules live.

The idea: hard skills, not soft skills

There are two ways to teach an AI how your organisation works.

A soft skill is advice placed in the AI's context: a prompt, a Markdown spec, a policy PDF, a skill file. It helps, but it's prose. The AI may follow it, or not.

A hard skill is a rule a program enforces. The AI can't skip it, because the check fails and says why.

Soft skill
prompt, Markdown spec, policy, skill file
Hard skill
SpecForge extension
Lives inThe AI's context window, as proseA compiler, as code
Can the AI ignore it?Yes, silentlyNo: the check fails
Same verdict twice?Not alwaysAlways. There's no AI inside
Knows what's missing?NoYes: broken links, unenforced rules, unproven promises
Shared how?Copied between filesVersioned and installed, like a library

SpecForge is an engine for hard skills. Think of it as a type checker for what your organisation means.

The five parts

PartWhat it isIn plain words
ExtensionsWASM packages that declare entity kinds, their fields and links, the rules that judge them, and commandsThe "apps": they teach SpecForge a domain
The graphEvery entity and link, compiled from small .spec files in your repositoryThe "memory": one source of truth
ValidationThe extensions' rules plus structural checks, on every compile and every editThe "referee": a change that breaks a rule is refused, whoever made it
SurfacesCLI, MCP, LSP with a VS Code extension, and a package registryThe "doors" people and agents come in through
AI modelsClaude or any other agent, driving SpecForge from outside, mostly over MCPThe "brain": bring your own

[Extensions plug into the SpecForge core, which parses, links and checks and knows no domain: software, product, governance, formal, test runners, and your own, such as pharma quality, medical devices or safety cases.]

The core grammar knows five structural words: spec, ref, use, define, defaults. Every other word in a spec (behavior, persona, invariant, campaign, procedure) and every rule ("an invariant must be enforced by a behavior", "a journey's persona must exist") exists only because an extension declares it.

These extensions ship inside the binary, as a starter set:

ExtensionWhat it declares
@specforge/softwareBehaviors, events, types, and interfaces (ports)
@specforge/productFeatures, personas, channels, journeys, deliverables, milestones, releases, modules, and your team's vocabulary (terms)
@specforge/governanceRules that must always hold (invariants), decisions, constraints, and failure modes
@specforge/formalProperties and axioms that an SMT solver proves or refutes
@specforge/testing, @specforge/cargo-test, @specforge/vitestWhich of your tests prove which entities
@specforge/rust, @specforge/typescriptSource analysis that helps an agent write a spec from existing code

Turn one on with specforge add @specforge/product. The full list is in the extension inventory. To teach SpecForge your own field, see Extending SpecForge and the extension SDK.

What you can build with it

  • Software spec frameworks. The builtin software extensions already give agents a checked spec to build against, with tests that name the promise they prove. Methods like GSD, BMAD, OpenSpec and SpecKit are a vocabulary plus rules, so each can become an extension, with its state in checked entities instead of Markdown files. A GSD family (@gsd/*) is being designed; the others are not started.
  • Product and marketing. Personas, channels, journeys, features and releases in one checked map that an agent can report from ("which channels does this persona use?", "what is unscheduled?"). Campaigns, audiences and claims can be added with your own extension.
  • Regulated industries. Pharma (GxP), medical devices, safety cases: procedures, deviations and approvals with the rules an auditor expects, in version control and checked in CI. The AI drafts, the rules check, a qualified person signs. You write this extension yourself today; none ships yet.
  • Your own domain. Any business with entities and rules worth checking. SpecForge can be the product you use, or the harness the business runs on: extensions as its domain, the graph as its memory, AI models as its workers.

The use cases say what works today and what is roadmap for each, and examples has projects you can run.

See it in 60 seconds

No agent needed. Install, create a product plan, then try to break it:

bash
curl -fsSL https://raw.githubusercontent.com/leaderiop/SpecForge/main/install.sh | shmkdir launch-plan && cd launch-planspecforge init --extensions @specforge/product     # a persona, a channel, a journey, a milestonespecforge link onboarding channels email           # point the journey at a channel that doesn't exist
text
error[E080]: the edit would leave the project with 1 error it does not have; nothing was written  error[E003]: unresolved reference 'email' in entity 'onboarding'

The edit is refused and nothing is written. Declare the channel first, and the same edit goes through:

bash
specforge new channel email "Email newsletter" --in spec/hello.spec --description "The monthly newsletter" --status activespecforge link onboarding channels emailspecforge product persona-channels developer       # cli, email

An agent makes the same edits over MCP, and gets the same refusals. Hand-written files get the same check:

bash
mkdir ../sf-demo && cd ../sf-demospecforge init --extensions @specforge/software          # spec/hello.spec, which checks cleansed -i.bak 's/\[user_logged_in\]/[user_loged_in]/' spec/hello.spec   # drop one letterspecforge check
text
[E003] Error: unresolved reference 'user_loged_in' in entity 'authenticate_user' 20 │   produces [user_loged_in]    │ Help: did you mean 'user_logged_in'?
[W007] Warning: event 'user_logged_in' is not produced by any behavior
1 error, 1 warning, 0 infos

A reviewer reads. A check resolves. Errors always fail the check; warnings fail it too with specforge check --strict, which is what you run in CI.

Use it with your agent

1. Install. SpecForge is a single binary with no dependencies.

bash
curl -fsSL https://raw.githubusercontent.com/leaderiop/SpecForge/main/install.sh | sh
Other ways to install
bash
# Homebrew (once the tap is published)brew install leaderiop/tap/specforge
# Prebuilt binary via cargo-binstallcargo binstall --git https://github.com/leaderiop/SpecForge specforge-cli
# From source (stable Rust toolchain)git clone https://github.com/leaderiop/SpecForge && cd SpecForgecargo install --path crates/surfaces/cli

Prebuilt archives for macOS, Linux and Windows are on the Releases page. Formal proofs (@specforge/formal) also need the z3 solver on your PATH; everything else works without it.

2. Create a project with the extensions your work needs:

bash
specforge init --extensions @specforge/software,@specforge/product

This writes a specforge.json and a first file in spec/. In a Cargo or vitest project, it also turns on the matching test runner.

3. Connect your agent. SpecForge speaks MCP, so any MCP client can read, query and edit the graph. Use an absolute path:

bash
claude mcp add specforge -- specforge mcp /path/to/your/project

In Cursor, one click adds it for the open project (${workspaceFolder}):

[Add SpecForge to Cursor]

Other MCP clients
json
{  "mcpServers": {    "specforge": { "command": "specforge", "args": ["mcp", "/path/to/your/project"] }  }}

4. Ask your agent. For example:

Write a spec in spec/ for the feature I described: the behavior, the rules it must never break, the events it emits, and what proves each one. Validate it with the SpecForge tools and fix every error before you show it to me.

5. Read the result yourself.

bash
specforge check     # is the graph consistent?specforge review    # what is still unproven?

6. Link your proof. For software, each test names the entity and obligation it proves. Follow the Rust or vitest guide, then run specforge collect. It asks once before running your test command, and records what each test proves.

Do I have to learn a new language?

You'll want to read it, because the graph is what you approve. You rarely need to write it: your agent writes and fixes the files, or edits them through specforge new, set and link, and the check tells it when it's wrong.

It's built to be easy to read. Each block is one thing, with a kind, a name, a title, and fields, like a filled-in form:

spec
channel email "Email newsletter" {  description "The monthly newsletter"  status      active}

To write specs by hand, start with the authoring tutorial, the worked example and product getting started.

Surfaces

SurfaceStatusWhat it's for
CLI (specforge)ShippedCheck, query, export, typed edits, CI
MCP server (specforge mcp)ShippedAI agents read, query and edit the graph
LSP + VS Code extensionShippedDiagnostics, completion, navigation and formatting while you type
Package registry (add, search, publish)ShippedInstall and share extensions (trust model)
AG-UIPlannedAgent-driven screens for people who don't use an editor
HTTPPlannedOther applications reading and changing the graph

Not built yet, so not claimed: connections to outside systems (a CRM, an issue tracker, a quality system), and proof beyond test results. Extensions are pure WASM today: no files, no network.

How is this different from…

You already useIt's good atWhat SpecForge adds
Specs, PRDs and policies in MarkdownDescribing intent for people and agentsThe same intent as .spec files whose structure is checked. Broken references, missing pieces and unproven promises fail the check
CLAUDE.md, AGENTS.mdWorking rules for the agent: conventions, commands, styleNothing to replace. Keep those rules there; what must be true lives in SpecForge
TestsProving the code does somethingSaying which promise each test proves, and which promises have no test at all
Issue trackers, roadmap toolsTracking work in progressA checked model of what must exist and how it links, that an agent can query
Requirements and quality tools (DOORS, Polarion, eQMS)Traceability for regulated teamsPlain text in your repository, checked in CI, readable by agents, extensible by you
GeneratorsProducing code or documents from a modelNothing. SpecForge never writes your code or your documents. Your agent does, from knowledge SpecForge has checked

What SpecForge is not

  • Not an AI. It makes no model calls. It's a deterministic compiler, written in Rust. The AI is yours.
  • Not a generator. It checks knowledge. Your agent produces the work.
  • Not a test framework. Your tests stay in cargo test or vitest. SpecForge runs them only after you approve the command, and records what they prove.
  • Not only for software. Software is one of its biggest uses, not its definition.

Learn more

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

來源:README.md,提交 656ed2d

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:該軟體包類型無法在沙箱中執行。

版本歷史

1
  1. v0.1.0-rc1最新Oct 22, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分