用途:在 Gherkin/BDD 格式与其他规格格式之间进行双向转换,适合规格驱动开发中统一需求与场景表达。
主要能力:支持 EARS↔Gherkin、Canonical(规范文档)↔Gherkin、内联验收标准↔.feature 文件。内置从 EARS 模式到 Gherkin 的映射规则,例如 WHEN...SHALL 映射为 When/Then 场景,WHILE...SHALL 映射为 Given 持续状态,IF...THEN...SHALL 映射为错误或边界场景,WHERE...SHALL 映射为特性开关 @tag,通用约束映射为 Background 或不变式检查。
使用方式:参数 $1 为源文件路径;--to 指定目标格式(gherkin、feature、canonical、ears、inline);--output 可选指定输出文件路径。示例:/spec-driven-development:gherkin-convert .specs/auth/spec.md --to feature;/spec-driven-development:gherkin-convert tests/login.feature --to canonical;/spec-driven-development:gherkin-convert ears-requirements.md --to gherkin;/spec-driven-development:gherkin-convert spec.md --to feature --output tests/spec.feature。
工作流程:读取源文件并识别当前格式,解析需求与场景、识别结构,调用 spec-converter gherkin 智能体转换并应用最佳实践,校验 Gherkin 语法与完整性,最后写入 .feature 文件或规格文档。
限制:资料未说明支持的输入输出格式细节、错误处理方式、依赖环境及性能表现,暂未提供。