Skip to main content
Glama

Forge

CI License: MIT Node forge MCP server

将 Claude Code 转变为结构化的交付循环:规划工作、并行运行模块、深度验证、智能重试,并延续有效的工作成果。

安装

复制粘贴:

claude plugin marketplace add TT-Wang/forge
claude plugin install forge@tt-wang-plugins

首次启动可能需要几秒钟,因为 Forge 会自动引导其 MCP 服务器依赖项。

安装后:

  1. 如果 Claude Code 已经打开,请重启它

  2. 打开您想要工作的任何仓库

  3. 运行 /forge <objective>

示例:

/forge add audit logging for admin actions

Related MCP server: Orchestrator MCP Server

核心理念

Forge 适用于单纯的提示词(prompting)不再足够的场景。

如果任务涉及多个文件、需要模块间的协调,或者需要证明它确实有效,Forge 会为 Claude Code 提供一个工作流,而不仅仅是另一个提示词:

  • 将工作分解为模块

  • 运行可并行化的任务

  • 严格验证每个模块

  • 使用调试器上下文重试失败的任务

  • 记住对下一个任务有效的内容

您仍然使用 Claude Code。Forge 只是在困难部分周围增加了结构。

您将获得什么

  • 结构化规划:将功能分解为具有依赖关系和验证命令的模块

  • 并行执行:在隔离的工作树中同时运行独立模块

  • 深度验证:检查文件、命令、语法和跨模块 API 合约

  • 智能重试:跟踪尝试次数,检测停滞,并升级到调试器代理

  • 会话可恢复性:从中断处继续工作,而不是从头开始

  • 跨会话记忆:记住约定、失败模式和测试命令

  • 状态可见性:在 Claude 输出和终端状态行中显示进度

为什么不直接使用 Claude Code?

对于许多任务,您应该直接使用它。

任务形态

普通 Claude Code

Forge

小型编辑

更好

大材小用

快速调查

更好

大材小用

多文件功能

需要手动协调

非常适合

可并行工作

您自己管理

内置支持

深度验证

您需要记得运行它

工作流的一部分

失败后重试

手动重试和调试

可跟踪、可引导、可恢复

跨会话重用模式

特设(Ad hoc)

内置记忆

Forge 并不试图取代正常使用。它适用于编排至关重要的任务。

快速入门

60 秒设置

  1. 使用上述两条命令安装 Forge

  2. 重启 Claude Code

  3. 打开您的项目

  4. 粘贴一个目标:

/forge add JWT auth with refresh tokens
  1. 批准生成的计划

运行

/forge build an audit log for admin actions

检查进度

/forge-status

重新检查一个模块

/forge-validate m2

典型会话

/forge add JWT auth with refresh tokens

[forge] Phase 1: Planning...
[forge] Proposed Plan: 4 modules, 2 parallel groups
[forge] Proceed with this plan? (yes / modify / abort)

[forge] Phase 2: Executing m1...
[forge] Phase 2: Executing m2, m3 in parallel...
[forge] ✓ m2: DONE — validated, score 1.0
[forge] ✗ m3: FAILED — retrying with debugger
[forge] ✓ m3: DONE — validated after retry

[forge] ## Forge Complete
[forge] 4/4 modules completed

这就是 Forge 追求的体验:更少的手动引导、更明显的进度以及更少的静默失败。

首次运行预期

  • Forge 将在您的项目中创建一个本地 .forge/ 目录

  • MCP 服务器可能需要几秒钟来安装其 Node 依赖项

  • 您的第一次真实交互是计划审查步骤

  • 在您明确批准计划之前,不会执行任何操作

当前项目结构

forge/
├── .claude-plugin/
│   ├── plugin.json
│   └── marketplace.json
├── .claude/
│   ├── settings.json
│   └── settings.local.json
├── agents/
│   ├── planner.md
│   ├── worker.md
│   ├── reviewer.md
│   └── debugger.md
├── skills/
│   ├── forge/
│   │   └── SKILL.md
│   ├── forge-status/
│   │   └── SKILL.md
│   └── forge-validate/
│       └── SKILL.md
├── forge-mcp-server/
│   ├── index.mjs
│   ├── start.sh
│   ├── package.json
│   └── tests/
├── statusline/
│   └── forge-status.sh
├── docs/
│   ├── architecture.md
│   ├── mcp-tools.md
│   └── launch/
├── CHANGELOG.md
├── CONTRIBUTING.md
├── SECURITY.md
├── CLAUDE.md
└── README.md

在运行时,Forge 还会在此工作项目中创建一个本地 .forge/ 目录,用于存储计划、日志、记忆、重试历史和可恢复状态。

主要组成部分

代理

Forge 附带四个专注的代理:

  • planner(规划器):探索代码库并提出模块计划

  • worker(工作器):在隔离的工作树中实现一个模块

  • reviewer(审查器):检查正确性、安全性和合约不匹配

  • debugger(调试器):调查失败的模块并驱动重试

技能

面向用户的命令包括:

  • /forge:完整的编排器工作流

  • /forge-status:当前计划、模块进度和已学习的模式

  • /forge-validate:为一个模块重新运行验证

MCP 服务器

捆绑的 MCP 服务器提供了 Forge 所需的共享运行时能力:

  • validate

  • validate_plan

  • memory_recall

  • memory_save

  • iteration_state

  • forge_logs

  • session_state

这些工具允许多个代理进行协调,而无需依赖松散的对话记忆。

状态行

Forge 可以在您的终端中实时呈现进度:

[forge] ████░░░░░░ 2/5 | VALIDATE | refresh endpoint | 3m19s | ~2m30s left

使用方法:

claude statusline set "bash /path/to/forge/statusline/forge-status.sh"

项目中的内容

Forge 将其运行时状态保存在工作项目内的本地 .forge/ 目录中。这包括:

  • 执行计划

  • 重试历史

  • 已学习的模式

  • 结构化日志

  • 可恢复的会话状态

这使得工作流可检查,而不是将所有内容隐藏在不透明的代理状态之后。

文档

  • 架构 — 编排器、代理、MCP 服务器和状态流

  • MCP 工具参考 — 所有 7 个工具的输入/输出模式和示例

  • 更新日志 — 发行说明

  • 贡献 — 开发设置、测试、linting 和 PR 流程

  • 安全 — 漏洞报告和安全范围

手动安装

如果您不想从 Claude Code 市场安装,可以手动配置 Forge:

git clone https://github.com/TT-Wang/forge.git /tmp/forge
mkdir -p .claude/agents .claude/skills
cp /tmp/forge/agents/*.md .claude/agents/
cp -r /tmp/forge/skills/* .claude/skills/
cp -r /tmp/forge/forge-mcp-server ./forge-mcp-server/
cd forge-mcp-server && npm install && cd ..

然后使用 .claude/settings.json 中的参考配置连接 MCP 服务器。

开发

git clone https://github.com/TT-Wang/forge.git
cd forge/forge-mcp-server
npm install
npm test

完美搭配

  • memem — 为 Claude Code 提供持久的跨会话记忆。Forge 处理规划和执行;memem 帮助在运行之间延续有用的模式。

  • Vibereader — 在 Claude 工作时提供精选技术新闻

许可证

MIT — 见 LICENSE

Available Tools

7 tools
forge_logsA

Query the structured JSONL event stream that forge writes on every tool call throughout a run. Filter by runId, moduleId, phase (planning, execution, validation, review, retry, memory, session, tool_call, plan_validation), severity (info, warn, error), and limit. Lets agents reconstruct what happened without re-running anything, and lets humans audit a run after the fact without paging through console output.

Behaviour:

  • READ-ONLY, idempotent.

  • Reads .forge/logs/<runId>.jsonl. When runId is omitted, the most recently modified log file in .forge/logs/ is used.

  • runId is guarded against path traversal via _RUN_ID_PATTERN.

  • JSON parse errors on individual lines are silently skipped — a single corrupt line does not crash the query.

  • No authentication, no network, no rate limits.

Use when:

  • A debugger agent needs the sequence of events leading up to a module failure — especially useful for diagnosing why validation failed even though review passed.

  • A user wants to audit what a forge run actually did, after the fact, without re-running anything.

  • The orchestrator wants to confirm that a prior phase completed successfully before transitioning.

  • Investigating an escalation: pull all severity: "error" entries for the run and read them in order.

Do NOT use for:

  • Live progress display — read /tmp/forge-status.json which the server refreshes on every tool call, or call session_state with action: "list".

  • Appending new entries — the server writes logs automatically; there is no external append API.

  • Long-term knowledge — that's memory_save / memory_recall.

Returns: { runId, entries: [...], total }. Each entry is { timestamp, runId, phase, moduleId, event, severity, data }. data is a free-form object whose shape depends on the event type.

Example: forge_logs({ runId: "2026-04-15-1", phase: "validation", severity: "error", limit: 10 }) → { "runId": "2026-04-15-1", "total": 2, "entries": [ { "timestamp": "...", "phase": "validation", "moduleId": "m3", "event": "validate", "severity": "error", "data": { "passed": false, "score": 0.5, ... } }, ... ] }

ParametersJSON Schema
NameRequiredDescriptionDefault
runIdNoRun ID to query. If omitted, uses most recent log file.
moduleIdNoFilter by module ID
phaseNoFilter by phase name
severityNoFilter by severity level
limitNoMax entries to return (default: 50)

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and delivers comprehensive behavioral disclosure. It explicitly states 'READ-ONLY, idempotent,' describes file system behavior, security measures (path traversal guard), error handling (silent skip of corrupt lines), and operational characteristics (no authentication, no network, no rate limits).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, behavior, use cases, exclusions, returns, example) and every sentence adds value. It's comprehensive without being verbose, using bullet points and clear headings to organize information efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only query tool with 5 parameters and no output schema, the description provides complete context. It explains the tool's purpose, behavior, usage scenarios, exclusions, and detailed return format. The example demonstrates both input and output, compensating for the lack of output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description lists the filterable parameters in the opening sentence and provides an example showing parameter usage, but doesn't add significant semantic value beyond what the schema already documents. The description of 'runId' behavior when omitted is already covered in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Query the structured JSONL event stream that forge writes on every tool call throughout a run.' It specifies the exact resource (structured JSONL event stream) and action (query with filtering), and distinguishes itself from siblings by mentioning specific alternatives like 'session_state' and 'memory_save'/'memory_recall'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit 'Use when' scenarios with four specific use cases (debugging, auditing, orchestration confirmation, investigation) and 'Do NOT use for' guidance with three clear exclusions (live progress display, appending entries, long-term knowledge). It names alternative tools for each exclusion case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

iteration_stateA

Read, update, or reset the per-module retry state for a forge run. Tracks attempt count, score history, last status, last root cause from the debugger, and a stagnation flag. In v0.4.0+ state is scoped per run via runId so attempt counts don't accumulate across unrelated forge runs that happen to share a moduleId (pre-v0.4.0 a brand-new m1 in a fresh plan could see attempt: 21 because 20 prior runs had also used "m1" — stagnation detection would then escalate a module that had just started).

Behaviour:

  • READ (get), MUTATION (update, reset).

  • State files live at .forge/iterations/<runId>/<moduleId>.json when runId is provided, or .forge/iterations/<moduleId>.json for legacy callers.

  • runId is guarded against path traversal via the _RUN_ID_PATTERN regex (/^[\w.-]{1,128}$/) — invalid values return a structured error, never a traversal attempt.

  • No authentication, no network, no rate limits.

  • get on an unknown module returns a clean empty-state object { attempts: [], scores: [], stagnant: false } rather than throwing.

Use when:

  • The orchestrator wants to know how many times module m3 has been retried so far and whether the stagnation flag has flipped — drives the decision between RETRY and ESCALATE.

  • A debugger agent wants to inspect the last root cause before proposing a new approach.

  • Resetting: a plan has finished and the next run should start fresh even if moduleIds are reused. Or a human has manually cleared a stuck module and wants the counter zeroed.

Do NOT use for:

  • Cross-module reasoning or run-wide progress — that is session_state.

  • Recording the result of a single validation attempt — that is done automatically by validate on every call.

  • Inspecting validation results without side effects — get is safe, but update bumps counters and flags.

Returns (get): The full state object { attempts: [...], scores: [...], stagnant: bool, lastStatus, lastRootCause }. Returns (update): { updated: true, attempt: N, stagnant: bool }. Returns (reset): A confirmation string.

Example: iteration_state({ moduleId: "m3", action: "get", runId: "2026-04-15-1" }) → { "attempts": [ { "timestamp": "...", "status": "failed", "score": 0.4, "issues": [...] }, { "timestamp": "...", "status": "failed", "score": 0.6, "issues": [...] } ], "scores": [0.4, 0.6], "stagnant": false }

ParametersJSON Schema
NameRequiredDescriptionDefault
moduleIdYesModule ID (e.g. m1)
runIdNoOptional run ID (plan slug). Scopes state to the current forge run. Without it, falls back to legacy global-state behavior.
actionYesget = read state, update = add attempt, reset = clear state
updateNoData for update action

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and delivers comprehensive behavioral disclosure. It details the three action types (READ, MUTATION), file storage locations, runId validation with regex pattern, security guarantees against path traversal, authentication/network/rate limit status, and get behavior for unknown modules. It also explains version differences in state scoping and distinguishes safe vs side-effect operations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, behavior, usage guidelines, returns, example) and every sentence adds value. While comprehensive, it's appropriately sized for a complex tool with multiple operations. The front-loaded purpose statement immediately communicates core functionality, though some behavioral details could be more condensed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with 4 parameters, no annotations, and no output schema, the description provides exceptional completeness. It covers purpose, behavior, usage scenarios, exclusions, security aspects, version differences, return formats for all three actions, and includes a concrete example. The description fully compensates for the lack of structured metadata, making the tool's functionality and constraints completely understandable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the baseline is 3. The description adds meaningful context beyond the schema by explaining the runId's purpose in scoping state to forge runs and legacy behavior implications, clarifying that update action bumps counters and flags, and providing concrete examples of moduleId values. However, it doesn't elaborate on specific parameter interactions or edge cases beyond what the schema already documents.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool's purpose as 'Read, update, or reset the per-module retry state for a forge run' with specific details about what it tracks (attempt count, score history, last status, last root cause, stagnation flag). It clearly distinguishes this from sibling tools by contrasting with session_state for cross-module reasoning and validate for recording validation attempts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit 'Use when' scenarios with three concrete examples (orchestrator retry decisions, debugger inspection, resetting for fresh runs) and 'Do NOT use for' guidance that names specific alternative tools (session_state for cross-module reasoning, validate for recording attempts). This gives clear context for when to choose this tool versus alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_recallA

Search forge's learned-pattern memory for entries relevant to a query. Memory is a simple JSONL store (not a vector index) — forge keeps it deliberately primitive so the format is human-readable, git-friendly, and cheap to grep. Each entry has a category (convention, failure_pattern, success_pattern, test_command, architecture, dependency, tool_usage), a free-text pattern, a confidence in [0,1], and a timestamp. Results are keyword-matched against pattern text, category name, and any included tags.

Behaviour:

  • READ-ONLY, idempotent. No telemetry side effects, no access counters bumped, no state mutated.

  • No authentication, no network, no rate limits.

  • Reads .forge/memory/project.jsonl and/or .forge/memory/global.jsonl depending on scope.

  • Returns an informative empty result if the query has no matches — never throws.

Use when:

  • The planner agent is about to decompose an objective and wants to check whether forge has already learned conventions for this project (test commands, style rules, known failure modes).

  • The debugger agent is analysing a failure and wants to check whether the same pattern has been seen and resolved before.

  • A worker agent is deciding between two approaches and wants to bias towards one that previously worked.

Do NOT use for:

  • Saving new patterns — use memory_save.

  • Looking up per-module retry history — use iteration_state.

  • Querying structured run events — use forge_logs.

  • Full-text search across commit history or codebase — this is learned patterns only, not source code.

Returns: A text block listing matching entries, each showing category, pattern, confidence, and timestamp. Grouped by scope (project first, then global) and sorted by confidence descending within each group.

Example: memory_recall({ query: "test command", scope: "project" }) → "Found 2 matches in project memory: [test_command] 0.9 — pnpm vitest --run (watch mode hangs in CI) [test_command] 0.8 — avoid npm test, use pnpm test instead"

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesKeywords to search for (e.g. 'test conventions', 'auth patterns', 'python')
scopeNoWhich memory store to search (default: all)

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure and excels at it. It explicitly states: 'READ-ONLY, idempotent. No telemetry side effects, no access counters bumped, no state mutated. No authentication, no network, no rate limits.' It also describes file sources, empty result behavior ('never throws'), and implementation details (JSONL store, keyword matching). This provides rich behavioral context beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, behavior, usage guidelines, exclusions, returns, example) and every sentence adds value. It's appropriately sized for a tool with rich behavioral context and sibling differentiation, with no redundant or wasted text. The information is front-loaded with the core purpose first.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description provides exceptional completeness. It covers purpose, behavioral traits, usage scenarios, exclusions, return format (text block with grouping and sorting), and includes a concrete example. The only minor gap is not explicitly documenting the exact output schema, but the return description and example adequately compensate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so the baseline is 3. The description adds meaningful context: it explains that 'query' searches against 'pattern text, category name, and any included tags' (not just keywords), and clarifies that 'scope' determines which files are read (project.jsonl vs. global.jsonl). However, it doesn't provide additional syntax or format details beyond what the schema already documents.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Search forge's learned-pattern memory for entries relevant to a query.' It specifies the exact resource (learned-pattern memory) and verb (search), and distinguishes it from siblings like memory_save (for saving), iteration_state (for retry history), and forge_logs (for structured events).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit 'Use when' scenarios with three concrete examples (planner agent decomposition, debugger analysis, worker agent decision-making) and a 'Do NOT use for' section that names four specific alternatives (memory_save, iteration_state, forge_logs, and full-text search). This gives comprehensive guidance on when to use this tool versus others.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

memory_saveA

Persist a learned pattern to forge's project or global memory for future recall. Patterns are stored as JSONL entries with category, pattern text, confidence, and timestamp. Duplicate patterns (same category + same text, case-insensitive) are rejected on write to prevent memory bloat from repeatedly saving the same lesson across runs.

Behaviour:

  • MUTATION. Appends a new JSON line to .forge/memory/<scope>.jsonl. Dedup check reads the existing file first; if a matching (category, pattern) already exists, the save is skipped and a "duplicate skipped" message is returned.

  • Idempotent on (category, pattern): calling twice with the same values produces one entry, not two.

  • No authentication, no network, no rate limits.

  • Appends are atomic on POSIX filesystems, so parallel workers can save concurrently without corrupting the file.

Use when:

  • Phase 5 (Learn) at the end of a forge run — the orchestrator records test commands that worked, conventions discovered by the planner, and failure patterns surfaced by the debugger.

  • A debugger agent has diagnosed a non-obvious root cause and wants to make sure the next run doesn't re-learn it from scratch.

  • A reviewer agent has identified a convention (naming, file layout, test framework) the project consistently follows and wants future workers to match it automatically.

Do NOT use for:

  • Ephemeral session state — use session_state instead. Memory is for knowledge that should outlive the run.

  • Module retry history — that is tracked automatically by iteration_state and validate.

  • Run-specific commentary or event logs — those belong in forge_logs, which is written automatically on every tool call.

  • Huge blobs of text (>1 KB) — memory entries are meant to be compact lessons, not dumps.

Returns: Confirmation string — either "Saved to memory []: " on new insert, or "Duplicate pattern already in memory, skipped." on dedup hit.

Example: memory_save({ pattern: "pnpm vitest --run for CI; watch mode hangs", category: "test_command", scope: "project", confidence: 0.9 }) → "Saved to project memory [test_command]: pnpm vitest --run..."

ParametersJSON Schema
NameRequiredDescriptionDefault
patternYesThe pattern or learning to save
categoryYesCategory of the learning. `success_pattern` is used by orchestrator Phase 5 to record run-shape calibration data (module count, tier depth, total time) for future planning.
confidenceNoConfidence level 0-1 (default: 0.7)
scopeNoSave to project memory (this project only) or global (all projects). Default: project

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and delivers rich behavioral details: it discloses this is a MUTATION tool (file append), describes deduplication logic, idempotency, atomic writes for concurrency, and operational characteristics (no auth/network/rate limits). It also explains the return format and duplicate handling behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Behaviour, Use when, Do NOT use, Returns, Example) and front-loads the core purpose. While comprehensive, some sentences could be more concise (e.g., the duplicate explanation is slightly verbose). Overall, most content earns its place by adding value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description provides complete context: it explains the tool's purpose, behavioral characteristics, usage guidelines, parameter context, return values, and includes a concrete example. This gives the agent everything needed to correctly select and invoke this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds meaningful context beyond the schema: it explains that patterns are stored as JSONL entries with timestamp (not in schema), clarifies duplicate detection is case-insensitive, and provides concrete examples of pattern usage (test commands, conventions, failure patterns) that help understand parameter semantics in practice.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('persist', 'store') and resources ('learned pattern', 'JSONL entries'), distinguishing it from siblings like session_state (ephemeral) and forge_logs (event logs). It explicitly defines what constitutes a pattern and how it's stored.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit 'Use when' scenarios (Phase 5 Learn, debugger root cause, reviewer conventions) and 'Do NOT use for' exclusions (ephemeral state, retry history, logs, large blobs), with clear alternatives named (session_state, iteration_state, forge_logs). This gives comprehensive guidance on when to choose this tool over siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

session_stateA

Save, load, or list orchestrator session snapshots for resumability. Lets a /forge workflow survive a crash, conversation restart, or an intentional pause — the next invocation can pick up exactly where the previous one left off, without re-planning or re-running completed modules.

Behaviour:

  • MUTATION on save, READ on load and list.

  • State lives at .forge/state/<runId>.json. Writes use atomic tmp + rename semantics so a crash mid-save can never leave a partial file on disk.

  • runId is guarded against path traversal via _RUN_ID_PATTERN (/^[\w.-]{1,128}$/).

  • Every save stamps the state with a fresh lastUpdatedAt ISO timestamp; list sorts most-recent first using this field.

  • No authentication, no network, no rate limits.

Use when:

  • The orchestrator has just completed a phase transition (plan approved, first parallel batch finished, module escalated) and wants to persist progress in case the session drops.

  • A fresh Claude Code session wants to resume an abandoned run: call session_state({ action: "list" }), find the most recent run with completedCount < totalCount, then session_state({ action: "load", runId: "..." }).

  • A user has invoked /forge-status and the orchestrator is computing the summary.

Do NOT use for:

  • Per-module retry state — that's iteration_state.

  • Cross-run learned patterns — that's memory_save.

  • Ephemeral progress for the statusline — the server writes /tmp/forge-status.json automatically on every tool call; don't duplicate it here.

Returns: save: { saved: true, runId, lastUpdatedAt } load: { found: true, ...state } when the file exists, { found: false, runId } when it does not. list: { sessions: [{ runId, lastUpdatedAt, currentPhase, completedCount, totalCount }, ...] } sorted by lastUpdatedAt descending.

Example: session_state({ action: "save", runId: "2026-04-15-1", state: { currentPhase: "execute", moduleStatuses: { m1: "done", m2: "running", m3: "pending" }, completedModules: ["m1"], startedAt: "2026-04-15T10:00:00Z" } }) → { "saved": true, "runId": "2026-04-15-1", "lastUpdatedAt": "..." }

ParametersJSON Schema
NameRequiredDescriptionDefault
actionYessave = persist state, load = restore state, list = show all sessions
runIdNoRun ID (required for save/load, ignored for list)
stateNoOrchestrator state to persist (for save). Expected shape: {runId, planPath, currentPhase, moduleStatuses: {[moduleId]: status}, retryCounts: {[moduleId]: number}, completedModules: [string], startedAt, lastUpdatedAt}

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and delivers exceptional behavioral transparency. It details mutation/read behavior per action, file storage location, atomic write semantics, runId validation pattern, timestamp stamping, sorting behavior, and explicitly states 'No authentication, no network, no rate limits.' This provides complete behavioral understanding beyond what parameters alone would convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly structured with clear sections (Behaviour, Use when, Do NOT use for, Returns, Example). Every sentence earns its place by providing essential information without redundancy. The front-loaded purpose statement immediately communicates the tool's value, followed by organized details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (3 parameters, no output schema, no annotations), the description provides complete context. It covers purpose, behavior, usage guidelines, parameter semantics, return values, and includes a detailed example. The description fully compensates for the lack of output schema and annotations, making the tool completely understandable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the baseline is 3, but the description adds significant value. It explains the expected shape of the state parameter with detailed field descriptions, clarifies when runId is required/ignored, and provides a comprehensive example showing parameter usage. This goes well beyond what the schema provides alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs (save, load, list) and resource (orchestrator session snapshots). It distinguishes from siblings by explicitly mentioning what NOT to use it for (iteration_state, memory_save), showing clear differentiation from other tools on the server.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit 'Use when' scenarios with three concrete examples and 'Do NOT use for' guidance with three specific alternatives. It clearly defines when to use this tool versus sibling tools like iteration_state and memory_save, offering comprehensive usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

validateA

Run full verification for a forge module against a specific working directory. Executes the module's verify commands in a subprocess, checks that required files exist on disk, runs AST-level syntax validation for .js/.mjs/.cjs/.py/.ts/.tsx files, and performs cross-module API contract checks (importer references matched against exporter symbols). Tracks attempts across retries, detects stagnation when the same failure set recurs, measures score velocity across attempts, and flags oscillation when the current failures match any of the last four attempts. Returns a structured pass/fail verdict with a per-check breakdown and a recommendation field (PROCEED, RETRY, ESCALATE).

Behaviour:

  • MUTATION. Appends an attempt entry to the module's iteration state at .forge/iterations/<runId>/<moduleId>.json when runId is provided, or the legacy flat path otherwise. Also emits a tool_call and a validate event to the current run's JSONL log.

  • No authentication, no network calls, no rate limits.

  • Verify commands run with a 2-minute per-command timeout; AST syntax checks get 60 seconds each. Commands execute through the shell (execSync) so plan-generated commands can use pipes and redirects — plans are human-approved before execution.

  • The cwd argument (v0.4.0+) redirects file existence checks, syntax checks, contract checks, and command execution to a specified directory. Precedence: args.cwd > FORGE_CWD env > process.cwd(). Workers running in isolated git worktrees MUST pass their worktree path as cwd — otherwise validation silently checks the main project root, and every worker DONE report would be meaningless.

  • Nonexistent cwd returns a cwd_check failure with recommendation: "ESCALATE" and a clear diagnostic, rather than letting every command fail with an opaque ENOENT.

Use when:

  • The orchestrator has received a DONE report from a worker agent and needs to verify that the changes actually compile, run, and honor any cross-module API contracts before merge-back.

  • A module has just been retried by the debugger agent and you want to know whether the attempt count has crossed the stagnation threshold.

  • A user invokes /forge-validate <moduleId> manually to re-run checks on a completed or in-progress module.

Do NOT use for:

  • Plan-level structural checks (DAG cycles, missing commands) — use validate_plan instead.

  • Querying past validation attempts without bumping a counter — use forge_logs or iteration_state with action: "get".

  • Running commands outside the context of a known moduleId — this tool mutates per-module iteration state.

Returns: A JSON text block with { passed, score, results[], attempt, stagnant, velocity, oscillating, recommendation, sameAsPrev } where results[] is a list of per-check objects tagged with type (file_check, syntax_check, contract_check, command, cwd_check) and their pass/fail metadata.

Example: validate({ moduleId: "m3", runId: "2026-04-15-1", files: ["src/auth.mjs", "src/auth.test.mjs"], commands: ["node --test src/auth.test.mjs"], cwd: "/tmp/forge-worktrees/m3" }) → { "passed": true, "score": 1.0, "recommendation": "PROCEED", "results": [ ... ], "attempt": 1, "stagnant": false }

ParametersJSON Schema
NameRequiredDescriptionDefault
moduleIdYesModule ID (e.g. m1, m2)
runIdNoOptional run ID (plan slug). Scopes iteration state so attempts from different forge runs don't pollute each other. Strongly recommended — without it, attempts accumulate across all runs forever.
cwdNoOptional absolute path to redirect file checks and command execution. Workers running in git worktrees should pass their worktree path here so validation sees their changes. Precedence: args.cwd > FORGE_CWD env > process.cwd(). Must exist when provided — nonexistent paths return a cwd_check failure with recommendation=ESCALATE.
commandsYesShell commands to run as verification checks
filesNoFile paths (relative to the validation working dir — `cwd` if provided, else server CWD) that should exist after module completion
contractChecksNoOptional cross-module API contract checks — verifies importer references match exporter exports

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and delivers comprehensive behavioral disclosure. It details mutation behavior (appends to iteration state, emits events), execution constraints (timeouts, shell execution), authentication/network/rate limit status, cwd precedence rules, and failure handling for nonexistent paths.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Behavior, Use when, Do NOT use, Returns, Example) and front-loaded core purpose. While comprehensive, some sentences could be more concise (e.g., the cwd precedence explanation is verbose). Overall, most content earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex mutation tool with 6 parameters, no annotations, and no output schema, the description provides exceptional completeness. It covers purpose, usage guidelines, behavioral details, parameter context, return structure with example, and distinguishes from all relevant sibling tools, leaving no significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds meaningful context beyond schema: it explains cwd precedence rules, consequences of nonexistent cwd, that commands use shell execution allowing pipes/redirects, and that contract checks verify importer references match exporter exports. However, it doesn't fully explain all parameter interactions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the verb ('Run full verification') and resource ('forge module'), clearly distinguishing it from siblings like 'validate_plan' for plan-level checks. It specifies the comprehensive scope including verification commands, file existence, syntax validation, and API contract checks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes explicit 'Use when' scenarios (e.g., after DONE report, after retry, manual validation) and 'Do NOT use for' exclusions (e.g., plan-level checks, querying past attempts), naming specific alternative tools like 'validate_plan', 'forge_logs', and 'iteration_state'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

validate_planA

Structurally validate a forge plan JSON file before any worker spawns. Checks: required-field schema (id, title, objective, files, verify, doneWhen on every module), DAG cycle detection via Kahn's algorithm, references to unknown dependsOn modules, file-overlap warnings between modules that could run in parallel (which would cause worktree merge conflicts), and verify-command existence on PATH (commands are checked via execFileSync('which', [firstWord]) to avoid shell injection via crafted verify strings). Catches plans that would fail at runtime and reports concrete errors before any worker is spawned.

Behaviour:

  • READ-ONLY for the plan file. Emits a plan_validation event to the current run's JSONL log.

  • No authentication, no network, no rate limits.

  • Never throws to the caller — every problem is returned as an entry in the errors[] or warnings[] arrays.

  • planPath is optional; when omitted, the most recently modified file in .forge/plans/ is used.

Use when:

  • Immediately after the planner agent writes a plan to disk, and before the orchestrator enters Phase 1b (plan approval).

  • Debugging why a plan's execution order looks wrong — file-overlap warnings usually explain "two parallel workers clobbered each other" bug reports.

  • A human is hand-editing a plan file and wants a pre-flight check.

Do NOT use for:

  • Executing a plan — this tool is dry-run only.

  • Validating a single module's build output — use validate instead.

  • Inspecting attempt counts or retry history — use iteration_state with action: "get".

Returns: { valid: bool, errors[], warnings[] }. valid is true iff errors[] is empty. Errors halt execution (cycles, missing required fields, commands not found on PATH). Warnings are advisory (file overlap between parallel modules).

Example: validate_plan({ planPath: ".forge/plans/add-auth.json" }) → { "valid": true, "errors": [], "warnings": [ { "type": "file_overlap", "modules": ["m2", "m3"], "files": ["src/config.mjs"], "message": "Modules m2 and m3 both modify src/config.mjs but could run in parallel. Consider adding a dependency edge." } ] }

ParametersJSON Schema
NameRequiredDescriptionDefault
planPathNoPath to a plan JSON file. If omitted, reads the most recent plan from .forge/plans/.

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure and excels. It details the tool's read-only nature, event emission, no authentication/network/rate limits, error-handling approach (never throws, returns arrays), and optional parameter behavior. This covers safety, side effects, and operational constraints thoroughly beyond what a schema could convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Behavior, Use when, Do NOT use, Returns, Example) and front-loaded key information. While detailed, every sentence adds value (e.g., explaining validation checks, usage contexts, return structure). Minor verbosity in listing all checks keeps it from a perfect 5, but it remains efficient and organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (validation with multiple checks) and lack of annotations/output schema, the description is highly complete. It explains the validation scope, behavioral traits, usage guidelines, parameter semantics, and return structure with examples. No critical gaps exist; an agent has all needed context to invoke and interpret results correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the baseline is 3. The description adds significant value by explaining the optional parameter's behavior: 'planPath is optional; when omitted, the most recently modified file in .forge/plans/ is used.' This clarifies the default logic, enhancing understanding beyond the schema's basic description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('structurally validate a forge plan JSON file') and resources ('plan JSON file'), distinguishing it from siblings like 'validate' (for single module build output) and 'iteration_state' (for attempt counts). It explicitly lists the validation checks performed, making the purpose highly specific and differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit 'Use when' scenarios (e.g., after planner writes a plan, debugging execution order issues, human pre-flight checks) and 'Do NOT use for' exclusions (e.g., executing a plan, validating single module output, inspecting retry history), with named alternatives like 'validate' and 'iteration_state'. This gives comprehensive guidance on when to use this tool versus others.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 7 tool updatesv0.1.0
    • First observedforge_logs
    • First observediteration_state
    • First observedmemory_recall
    • First observedmemory_save
    • First observedsession_state
    • First observedvalidate
    • First observedvalidate_plan

TDQS

A4.9/5.0

Scored across 7 tools

Disambiguation5/5

Each tool has a distinct, well-defined purpose with clear boundaries. For example, forge_logs is for event stream queries, iteration_state handles retry tracking, memory_recall/save manage learned patterns, session_state handles session persistence, and validate/validate_plan handle different validation scopes. The descriptions explicitly state what each tool should and should not be used for, preventing confusion.

Naming Consistency5/5

All tools follow a consistent snake_case naming convention with clear verb_noun patterns. Tools like forge_logs, iteration_state, memory_recall, memory_save, session_state, validate, and validate_plan maintain perfect consistency throughout the set, making them predictable and easy to understand.

Tool Count5/5

With 7 tools, this server is well-scoped for its forge orchestration domain. Each tool serves a specific, necessary function in the workflow (logging, state management, memory, validation), and none feel redundant or missing. The count supports comprehensive coverage without being overwhelming.

Completeness5/5

The tool set provides complete coverage for forge orchestration workflows. It includes logging (forge_logs), state management (iteration_state, session_state), knowledge persistence (memory_recall/save), and validation at both module and plan levels (validate, validate_plan). There are no obvious gaps—agents can manage the entire lifecycle from planning through execution to learning.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers