Skip to main content
Glama
io.github.cdeust/prd-spec-generator

io.github.cdeust/prd-spec-generator

by cdeust

AI Architect MCP Spec

Check requirements, acceptance criteria and test traceability before a specification becomes code. AI Architect MCP Spec is a local MCP server with a deterministic verifier and a host-driven PRD workflow. You can run the verifier on an existing document or use the full profile to generate and verify a PRD.

What works today

Capability

Behavior

Evidence

Portable verifier

validate_prd_section checks one Markdown section. validate_prd_document adds cross-section checks for requirement IDs, acceptance criteria and test links.

MCP handlers · Portable runtime smoke test

Symbol references

Supply known_symbols to report unresolved inline-code references as advisory findings. The optional graph integration belongs to the full workflow.

Validation handlers · Symbol check

Full PRD workflow

The server emits the next action and records the result. The host runs model calls, asks questions and writes exported artifacts. The packaged /generate-prd command requests a model review of scope and declared edge cases.

Host command · MCP stdio scenarios

Planning handoff

An eligible checkpoint exposes validated requirements and acceptance criteria, and the generated tickets' estimates, prerequisites and criteria when the run generated them. Spec derives a proposal for one Step and binds it to the Define data with SHA-256. Architect OS prepares the preview and owns approval and execution.

Define contract · Plan projection · Architect OS Plan

Implementation review dossier

With an operator-approved record, Spec returns a Git comparison for the pinned revisions and marks each acceptance criterion evidence_required.

Review contract · MCP stdio scenarios

The verifier reports whether the input satisfies its implemented rules. A report with no violations establishes structural conformance. Factual accuracy and implementation behavior require their own evidence. Rule implementation

Related MCP server: spec-gate

The pipeline

Six-stage workflow with ready and next badges. Spec analyses and verifies a PRD, then exports Define and a deterministic proposal for Architect OS approval, execution and delivery. Optional graph analysis and the pinned review dossier are ready. Independent Plan review, specimen replay and delivery evidence remain next for the paired loop.

Generate and verify a PRD

Call start_pipeline, execute the returned NextAction, and send the result with submit_action_result. Repeat until the server returns a terminal action. Use get_pipeline_state to recover the current action and inspect saved progress. When an action or report is paginated, follow __page.next_offset to the last page before acting on the complete result. MCP protocol · Host dispatch rules

The full packaged workflow uses the companion tools and model actions described in the host skill. Set codebase_path only when the host can execute the graph actions through AI Architect MCP Codebase. Scope and edge-case review checks model findings and citations against the saved review inputs. Findings, inconclusive results, stale evidence or missing evidence can block Define. Semantic review · Define gate

Read a planning handoff

Use get_pipeline_state with the saved run_id. An eligible checkpoint is a successful automatic completion, a legacy checkpoint with a pending decision that permits a handoff, or a finished run whose gate kept a passed Define, while the checkpoint still projects it.

Format

Result

define_handoff_v1

Validated requirements and acceptance criteria with explicit requirement references, and tickets (id, story_points, depends_on, acceptance_ids) when the run generated them.

verified_plan_v1

A deterministic proposal for the plan_step you supply. The hashes bind the run, Define file and proposal file. The file format is compact UTF-8 JSON with a trailing newline.

reviewed_plan_v1

For a run started with plan_step (routes from the server's PRD_GEN_PLAN_DRAFTER and PRD_GEN_PLAN_REVIEWER, provider/model, and its verdict bound from PRD_GEN_PLAN_VERDICT_CAP; no Cortex call): the plan its drafter wrote for that plan_step, with the reviewer's clear verdict on its exact bytes and the clear scope and edge-case review of its Define. Each role is named by provider and model.

plan_review

For a run started with plan_step, at any point of the run: every model reply its independent Plan review keeps, oldest first (the parent run's question and proposal a clarification answers, each attempt's proposal then its verdict, and the proposal of a refused revision), with why a revision was refused or the review stopped. A reply that was refused as evidence is not kept. Paged by whole replies from entry_offset; __page.next_offset names the next page, null on the last; restart from 0 when __page.record_sha256 changes. Whatever full sheds of the review is read back here.

implementation_review_v1

A read-only dossier for the plan_step and review_id you supply. The trusted launcher config binds the approved manifest and exact Git revisions. The dossier can be ready_for_review while every criterion still needs behavioral evidence.

Projection implementation · Review dossier setup

A planning run whose review refuses its Define

A run started with plan_step needs three settings in the server's environment: PRD_GEN_PLAN_DRAFTER and PRD_GEN_PLAN_REVIEWER (provider/model, two different models), and PRD_GEN_PLAN_VERDICT_CAP (a positive whole number: how many judge verdicts its self-check may ask for). Without all three, start_pipeline answers plan_models_unavailable.

When the review judges every claim and refuses some, the run does not end there. After the verification report it returns one ask_user per finding, under the id define_finding_<sha256>. The question holds the refused claim, each verdict with its judge and model, and the reviewer's reason. The id is a digest of the run, of what the review read and of the finding. Only an answer under the id of the open question is read: an answer kept from another run, from an earlier document of the run or from another finding changes nothing.

The operator answers each finding in one of three ways:

  • Their own words (freeform, at most 1,000 characters, nothing selected): a decision, or a fact the draft cannot see. The answer is recorded as a clarification of the run, so every later draft and the scope review read it as an operator source.

  • Repair from the review: the drafter repairs the claim from the reviewer's reason alone.

  • Stop: the Define stays refused and the run ends needs_attention.

No answer passes a Define. Once every finding of the review has its answer, every section is drafted again as a revision of the refused text. The text of each claim the review accepted is kept as it is: a draft that rewords or drops one is refused and retried, and so is a draft that leaves a refused claim unchanged. A criterion that cites a refused requirement may change with it. New reviewer sessions then judge the whole revision, and the same gate decides.

The files of a revision are written beside those of the document before it, as 01-prd.rev1.md, 10-verification-report.rev1.md and so on. Each report lists the earlier findings and how they were settled. The host bounds the path: each round needs an operator answer and spends model sessions that the host counts. The server sets no number of rounds. Two limits it already had apply: 1,000 characters for an answer and 50 operator turns for a run.

A refusal that no review finding explains (an invalid document, refused tickets, a failed section, a scope review that is not clear) still ends the run. Findings and answers · Revision

Exported files per context profile

The table shows the files of a fully passed run with the standard request size. Failed or skipped sections can reduce the export. See 00-run-notes.md for omissions.

Context

Files written

proposal

00-run-notes.md, 01-prd.md, 05-testing.md, 06-deployment.md, 07-jira-tickets.md, 10-verification-report.md

feature

00-run-notes.md, 01-prd.md, 02-data-model.md, 03-api-spec.md, 04-security.md, 05-testing.md, 07-jira-tickets.md, 10-verification-report.md, stage-5.affected_symbols.json

bug

00-run-notes.md, 01-prd.md, 05-testing.md, 06-deployment.md, 07-jira-tickets.md, 10-verification-report.md, stage-5.affected_symbols.json

incident

00-run-notes.md, 01-prd.md, 04-security.md, 05-testing.md, 06-deployment.md, 07-jira-tickets.md, 10-verification-report.md, stage-5.affected_symbols.json

poc

00-run-notes.md, 01-prd.md, 05-testing.md, 07-jira-tickets.md, 10-verification-report.md, stage-5.affected_symbols.json

mvp

00-run-notes.md, 01-prd.md, 05-testing.md, 06-deployment.md, 07-jira-tickets.md, 10-verification-report.md, stage-5.affected_symbols.json

release

00-run-notes.md, 01-prd.md, 04-security.md, 05-testing.md, 06-deployment.md, 07-jira-tickets.md, 10-verification-report.md, stage-5.affected_symbols.json

cicd

00-run-notes.md, 01-prd.md, 04-security.md, 05-testing.md, 06-deployment.md, 07-jira-tickets.md, 10-verification-report.md, stage-5.affected_symbols.json

A run declared request_size: "tiny" writes 00-run-notes.md, 01-prd.md, 05-testing.md, 07-jira-tickets.md and 10-verification-report.md, whatever its context except an incident. Incidents follow their table row.

Export regression

Integration status

  • Ready on Spec main. The portable verifier, host-driven Define verification, deterministic proposal and revision-bound review dossier are implemented. Verification and Define · Deterministic proposal · Review dossier

  • Next for the paired loop. The independent review handoff reached the Architect OS preview in an offline replay using a candidate Spec bundle and two model fixtures. Production evidence still needs signed-in adapters that attest the account and effective model, results on specimen inputs before Step, and results per criterion on the delivered revision. Architect OS integration and replay

A recorded handoff

The delivery-command fixture drives an actual Spec process over stdio and compares the resulting dossier with the approved Git revisions. Its assertions cover ready_for_review and evidence_required for each acceptance criterion. Input fixture · Expected results

A separate paired run used an experimental Spec bundle with two deterministic model fixtures. Architect OS accepted the exact reviewed Plan as pending, and a second admitted session resumed it with zero model calls. The PR records the tested Architect OS commit and the materialization refusal when specimen evidence was missing. Recorded paired replay

Getting started

Portable verifier

The checked-in Codex and Gemini CLI manifests start mcp-server/index.js --profile verifier and expose the two deterministic validation tools. The verifier makes zero model calls. Codex manifest · Gemini CLI manifest

For any stdio MCP host, clone the repository and install the bundled server dependencies. Use Node 20 or later for the launcher.

git clone https://github.com/cdeust/ai-architect-mcp-spec.git
cd ai-architect-mcp-spec/mcp-server
npm ci --omit=dev

Configure the host to start node /absolute/path/to/ai-architect-mcp-spec/mcp-server/index.js --profile verifier. Call validate_prd_section with section_type and content. To check cross-section traceability, pass sections as an array of objects with type and content to validate_prd_document. Request schemas

Full profile in Claude Code

claude plugin marketplace add cdeust/ai-architect-mcp-spec
claude plugin install ai-architect-mcp-spec@ai-architect-mcp-spec-marketplace

Start a fresh session, configure the companions required by the host skill, then run /generate-prd with a feature description. The plugin uses Node and npm to start its bundled server. The host supplies the model and companion tools. Plugin launcher · Generate PRD command

Supported platforms

The CI matrix runs these jobs. It probes the plugin launcher, node bin/ensure-deps.mjs, over stdio. On macOS and Windows, the environment command then runs pnpm install --frozen-lockfile, pnpm build, pnpm test, pnpm bundle, the portable checks and scripts/release/smoke-mcpb.sh.

Platform

CI runner

Jobs

Linux

ubuntu-latest

unit, regression, e2e, environment, install

macOS

macos-latest

environment (plugin launch, the test suite and the .mcpb smoke), install

Windows

windows-latest

environment (plugin launch, the test suite and the .mcpb smoke), install

Platform contract · CI commands · CI runs

What the .mcpb carries

The bundle carries the MCP server and its launch configuration. check_health reports degraded with skillAvailable: false and evidenceDbHealthy: false for the bundle. Use the Claude Code plugin for its packaged skill and commands. Bundle manifest · Bundle smoke test

Companion ecosystem

These are the plugin commands printed by the current full-profile preflight. The codebase companion applies when you supply codebase_path. The portable verifier is standalone.

claude plugin marketplace add cdeust/ai-architect-mcp-codebase
claude plugin marketplace add cdeust/Cortex
claude plugin marketplace add cdeust/zetetic-team-subagents

claude plugin install ai-architect-mcp-codebase@ai-architect-mcp-codebase-marketplace
claude plugin install hypermnesia-mcp@cortex-plugins
claude plugin install zetetic-team-subagents@zetetic-marketplace

Preflight contract

Reproduce the checks

pnpm install --frozen-lockfile
pnpm build
pnpm test
pnpm test:portable
pnpm test:portable:runtime

The boundary scenarios drive MCP stdio with recorded fixture responses. The portable runtime smoke test checks the tool surface through the launchers declared in the host manifests. Boundary scenarios · Portable smoke test

Contribute

The architecture and dependency rules describe how the core, validation, orchestration and MCP layers fit together. See the assurance case for the verification evidence and release instructions for packaging.

MIT license · Privacy · Security

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables typed batch evidence processing, including classification, extraction, summarization, and triage, with SQLite checkpoints, exact source offsets, CLI, and MCP integration.
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Provides MCP tools to score request sufficiency against a profile, block underspecified work, and write committed decision records with evidence and overrides.
      2
      Apache 2.0
    • A
      license
      C
      quality
      C
      maintenance
      Enables users to build constraint-driven novel-writing pipelines through MCP: create project bibles, track foreshadowing and hard facts, run chapter reviews and release gates, and produce next-chapter writing briefs.
      27
      MIT
    • A
      license
      A
      quality
      F
      maintenance
      Enables agents to run an end-to-end credit-risk modeling pipeline — data loading and profiling, feature analysis/screening, preprocessing, splitting, training, tuning, evaluation, confirmation, and reporting — through 20 MCP tools. Every step writes contract-frozen, reproducible artifacts to disk and returns explicit ok / needs_user_input / error states so failures stay visible.
      20
      PolyForm Noncommercial 1.0.0