返回顶部
F

Forge锻造

Autonomous quality engineering swarm that forges production-ready code through continuous behavioral verification, exhaustive E2E testing, and self-healing fix loops. Combines DDD+ADR+TDD methodology with BDD/Gherkin specifications, 7 quality gates, defect prediction, chaos testing, and cross-context dependency awareness. Architecture-agnostic — works with monoliths, microservices, modular monoliths, and any bounded-context topology.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,340
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

Forge

Forge — 自主质量工程集群

质量锻造于内,而非附加于外。

Forge 是一个自学习、自主运行的质量工程集群,它将三种方法统一为一种:

支柱来源功能
构建DDD+ADR+TDD 方法论结构化开发,包含质量门禁、缺陷预测、置信度分级修复
验证
BDD/Gherkin 行为规范 | 持续行为验证——产品正常工作,而不仅仅是代码 |
| 修复 | 自主端到端修复循环 | 测试 → 分析 → 修复 → 提交 → 学习 → 重复 |

真正完成 意味着:代码编译通过,并且产品行为符合规范。每个 Gherkin 场景都通过。每个质量门禁都清除。每个依赖图都满足。



架构适应性

Forge 适应任何项目架构。在首次运行前,它会发现你的项目结构:

支持的架构

架构Forge 如何适应
单体应用单一后端进程,所有上下文在一个代码库中。Forge 针对一个服务器运行所有测试。
模块化单体
单一部署,包含作为模块的有界上下文。Forge 发现模块并独立测试每个上下文。 | | 微服务 | 多个服务。Forge 发现服务端点,测试每个服务,验证服务间契约。 | | 单仓库 | 一个仓库中的多个应用/包。Forge 检测工作区结构(Turborepo、Nx、Lerna、Melos、Cargo workspace)。 | | 移动端 + 后端 | 带后端 API 的前端应用。Forge 启动后端,然后针对它运行端到端测试。 | | 全栈单体 | 前端和后端在同一部署中。Forge 通过 UI 层针对真实后端进行测试。 |

项目发现

首次调用时,Forge 分析项目以构建上下文映射:

bash

Forge 自动发现:


1. 后端技术(Rust/Cargo、Node/npm、Python/pip、Go、Java/Maven/Gradle、.NET)


2. 前端技术(Flutter、React、Next.js、Vue、Angular、SwiftUI、Kotlin/Compose)


3. 测试框架(integration_test、Jest、Pytest、Go test、JUnit、xUnit)


4. 项目结构(单仓库布局、服务边界、模块边界)


5. API 协议(REST、GraphQL、gRPC、WebSocket)


6. 构建系统(Make、npm scripts、Gradle tasks、Cargo features)

Forge 存储发现的项目映射:

json
{
architecture: mobile-backend,
backend: {
technology: rust,
buildCommand: cargo build --release --features test-endpoints,
runCommand: cargo run --release --features test-endpoints,
healthEndpoint: /health,
port: 8080,
migrationCommand: cargo sqlx migrate run
},
frontend: {
technology: flutter,
testCommand: flutter drive --driver=testdriver/integrationtest.dart --target={target},
testDir: integration_test/e2e/,
specDir: integration_test/e2e/specs/
},
contexts: [identity, rides, payments, ...],
testDataSeeding: {
method: api,
endpoint: /api/v1/test/seed,
authHeader: X-Test-Key
}
}

配置覆盖

项目可以在仓库根目录提供 forge.config.yaml 文件以覆盖自动发现:

yaml

forge.config.yaml(可选——如果缺失,Forge 会自动发现)


architecture: microservices
backend:
services:
- name: auth-service
port: 8081
healthEndpoint: /health
buildCommand: npm run build
runCommand: npm start
- name: payment-service
port: 8082
healthEndpoint: /health
buildCommand: npm run build
runCommand: npm start
frontend:
technology: react
testCommand: npx cypress run --spec {target}
testDir: cypress/e2e/
specDir: cypress/e2e/specs/
contexts:
- name: identity
testFile: auth.cy.ts
specFile: identity.feature
- name: payments
testFile: payments.cy.ts
specFile: payments.feature
dependencies:
identity:
blocks: [payments, orders]
payments:
depends_on: [identity]
blocks: [orders]


关键:禁止模拟或桩代码

绝对规则:此技能绝不使用后端 API 的模拟或桩代码。

  • - 所有测试都针对真实后端 API 运行
  • 没有用于 API 调用的模拟框架(没有 mockito、wiremock、MockClient、nock、msw、httpretty 等)
  • 没有来自 API 端点的桩响应或虚假数据
  • 在任何测试执行之前,后端必须正在运行且健康
  • 测试数据通过真实 API 调用播种,而非模拟状态

为什么禁止模拟:

  • - 模拟会隐藏真正的集成错误
  • 模拟会制造虚假的信心
  • 模拟不测试实际的数据流
  • 真实 API 测试能捕获序列化、验证和时序问题



阶段 0:后端设置(强制第一步)

在任何测试之前,后端必须被构建、编译并运行。

这是技能做的第一件事——没有例外。

步骤 1:检查并启动后端

bash

1. 读取项目配置或自动发现后端设置


2. 检查后端是否已在运行


curl -s http://localhost:${BACKENDPORT}/${HEALTHENDPOINT} || {
echo 后端未运行。正在启动...

# 3. 导航到后端目录
cd ${BACKEND_DIR}

# 4. 确保环境已配置
cp .env.example .env 2>/dev/null || true

# 5. 构建后端
${BUILD_COMMAND}

# 6. 运行数据库迁移(如果适用)
${MIGRATION_COMMAND}

# 7. 启动后端(后台)
nohup ${RUN_COMMAND} > backend.log 2>&1 &
echo $! > backend.pid

# 8. 等待后端健康(最多 60 秒)
for i in {1..60}; do
if curl -s http://localhost:${BACKENDPORT}/${HEALTHENDPOINT} | grep -q ok\|healthy\|UP; then
echo 后端在端口 ${BACKEND_PORT} 上健康运行
break
fi
sleep 1
done
}

步骤 2:验证后端健康

bash

验证关键端点是否响应


curl -s http://localhost:${BACKENDPORT}/${HEALTHENDPOINT} | jq .

验证测试夹具端点(用于播种)

curl -s -H ${TESTAUTHHEADER} http://localhost:${BACKENDPORT}/${TESTSTATUS_ENDPOINT} | jq .

步骤 3:契约验证

bash

验证 API 规范是否与运行的 API 匹配(如果 OpenAPI/Swagger 可用)


curl -s http://localhost:${BACKENDPORT}/${OPENAPIENDPOINT} > /tmp/live-spec.json

存储契约快照用于回归检测

npx @claude-flow/cli@latest memory store \ --key contract-snapshot-$(date +%s) \ --value $(cat /tmp/live-spec.json | head -c 5000) \ --namespace forge-contracts

步骤 4:播种测试数据(真实 API 调用)

bash

通过真实 API 播种测试数据——根据项目的播种端点进行调整


curl -X POST http://localhost:${BACKENDPORT}/${SEEDENDPOINT} \
-H Content-Type: application/json \
-H ${TESTAUTHHEADER} \
-d ${SEED_PAYLOAD}


阶段 1:行为规范与架构记录

在测试之前,验证目标有界上下文的 Gherkin 规范和架构决策记录是否存在。

行为规范从用户角度定义了产品做什么。每个测试都追溯到一个 Gherkin 场景。如果测试通过但规范失败,则产品已损坏。

规范位置

Gherkin 规范与测试一起存储:

${SPEC_DIR}/
├── [context-a].feature
├── [context-b].feature
├── [context-c].feature

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 forge-1775964961 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 forge-1775964961 技能

通过命令行安装

skillhub install forge-1775964961

下载

⬇ 下载 Forge v1.0.0(免费)

文件大小: 26.92 KB | 发布时间: 2026-4-13 10:20

v1.0.0 最新 2026-4-13 10:20
Initial release: Autonomous quality engineering swarm with 8 agents, 7 quality gates, Gherkin behavioral specs, and self-healing fix loops.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部