create-harness-spec
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate Harness Spec
创建Harness规格说明
Grill a Hedera feature idea into a complete recipe for
hedera-harness.
Load the shared vocabulary first: read
and its
GLOSSARY.md. Use those terms exactly.
../harness-spec-anatomy/SKILL.mdTargets hedera-harness schemaVersion 3.
These skills are for authoring. Recipes do not list skills — product plugins
from are discovered per run and the generator picks. Keep the
run blind: the PRD carries journeys and outcomes; numbered assertions live
in the evaluate checklist.
hedera-skillsWorks in Claude Code (marketplace plugin) and Cursor / other agents that
load SKILL.md. Prefer when that skill is installed; otherwise use
the inline protocol — Claude Code typically takes the inline path.
/grilling将Hedera功能想法梳理打磨成完整的配方,用于hedera-harness。
请先加载通用词汇表:阅读及其GLOSSARY.md,严格使用其中的术语。
../harness-spec-anatomy/SKILL.md目标版本为hedera-harness schemaVersion 3。
这些技能用于编写工作。配方中不列出技能——中的产品插件会在每次运行时被发现并由生成器选择。请保持运行盲测状态:PRD承载用户旅程和成果;编号断言存放在评估检查清单中。
hedera-skills本技能可在Claude Code(市场插件)以及Cursor/其他加载SKILL.md的Agent中使用。若已安装对应技能,优先使用;否则使用内联协议——Claude Code通常采用内联方式。
/grillingStep 1: Locate the target
步骤1:定位目标
A recipe lives at inside a scaffolded app. There is no other layout.
.harness/| Situation | What to do |
|---|---|
Cwd is a scaffolded app (Scaffold HBAR or | Author into its |
Cwd is an app without | |
| No app yet | |
Cwd already has | Check |
Never treat a v1/v2 recipe as loadable. → , drop ,
set .
contract:eval:skills:schemaVersion: 3Paths in the recipe file are relative to the project root.
配方存放在已搭建应用的目录下,没有其他目录结构。
.harness/| 场景 | 操作方式 |
|---|---|
Cwd是已搭建的应用(通过Scaffold HBAR或 | 在其 |
Cwd是没有 | 执行 |
| 还没有应用 | 执行 |
Cwd已有 | 检查 |
切勿将v1/v2版本的配方视为可加载版本。需将改为,移除字段,设置。
contract:eval:skills:schemaVersion: 3配方文件中的路径均相对于项目根目录。
Step 2: Grill
步骤2:梳理打磨
Follow references/grilling.md. Prefer if
available; otherwise use the inline protocol there.
/grillingDo not write files until the user confirms shared understanding.
遵循references/grilling.md中的说明。若可用,优先使用;否则使用其中的内联协议。
/grilling在用户确认双方理解一致前,不要写入任何文件。
Step 3: Emit the recipe
步骤3:生成配方
Prefer copying the shipped skeleton — it is always current:
bash
cp -r "$(npm root -g)/hedera-harness/skeletons/project-harness/." .harness/Then:
- Write (or one file per increment under
.harness/prd.md) from the grill. Product-facing only — keep the run blind..harness/prds/ - Fill . Required:
.harness/spec.yaml,schemaVersion: 3,name, anddescriptionwith a command literally namedbaseline. Leave every default commented out. A four-key recipe is complete. Omitinstallunless the user wants Cursor (default is Claude).agent: - Write and
.harness/validators/static.jsonagainst the feature deliverables. Do not assert on.harness/validators/yarn.json— create-scaffold-hbar removes it when scaffolding.template.json - Do not add a list. Mention relevant Hedera services in the PRD so the generator can pick product skills.
skills: - Add SMOKE / EVALUATE / CHAIN only if the user opted in during the grill —
see → references/stage-strategy.md. If
harness-spec-anatomyis a list and EVALUATE is on, write a matchingprd:list.eval: - Install the SMOKE host package if you just enabled it — at the project
root, not only inside a workspace. Doctor imports from next to
playwright, and Yarnhedera-harnesshidesnmHoistingLimits: workspacesinstalls.packages/nextjs- SMOKE → (or npm/pnpm equivalent) Skip the add if the root
yarn add -D playwrightalready lists it. Do this as part of emit, not as a follow-up afterpackage.jsonfails. CHAIN does not need a project install:doctorships with@hiero-ledger/sdk. Only the operator env vars are host-provided.hedera-harness
- SMOKE →
Reconstruct bodies by hand only when the skeleton is unavailable:
→ references/spec-files.md.
harness-spec-anatomy优先复制随附的骨架模板——它始终是最新版本:
bash
cp -r "$(npm root -g)/hedera-harness/skeletons/project-harness/." .harness/随后执行以下操作:
- 根据梳理结果编写(或在
.harness/prd.md目录下为每个增量编写单独的文件)。仅面向产品视角——保持运行盲测状态。.harness/prds/ - 填写。必填项:
.harness/spec.yaml、schemaVersion: 3、name,以及包含字面名为description命令的install字段。所有默认配置请保持注释状态。 包含四个键的配方即为完整配方。除非用户指定使用Cursor,否则省略baseline字段(默认使用Claude)。agent: - 针对功能交付物编写和
.harness/validators/static.json。不要对.harness/validators/yarn.json做断言——create-scaffold-hbar在搭建项目时会移除该文件。template.json - 不要添加列表。请在PRD中提及相关的Hedera服务,以便生成器选择对应的产品技能。
skills: - 仅当用户在梳理过程中明确选择时,才添加SMOKE / EVALUATE / CHAIN阶段——参见→ references/stage-strategy.md。如果
harness-spec-anatomy是列表且启用了EVALUATE,则编写对应的prd:列表。eval: - 如果刚启用了SMOKE阶段,请安装其宿主包——需在项目根目录安装,而不仅仅是在工作区内安装。doctor命令会从的同级目录导入
hedera-harness,而Yarn的playwright配置会隐藏nmHoistingLimits: workspaces中的安装包。packages/nextjs- SMOKE → (或npm/pnpm的等效命令) 如果根目录的
yarn add -D playwright中已列出该包,则跳过安装。此步骤需作为生成配方的一部分执行,不要等到package.json运行失败后再补充。 CHAIN阶段不需要在项目中安装依赖:doctor已随@hiero-ledger/sdk一同发布。仅需宿主提供操作员环境变量。hedera-harness
- SMOKE →
仅当无法获取骨架模板时,才手动构建文件内容:参考 → references/spec-files.md。
harness-spec-anatomyStep 4: Completion criterion
步骤4:完成标准
Two checks, in order:
bash
undefined按顺序执行两项检查:
bash
undefined1. Does the recipe load? (authoritative — schema, defaults, baseline, network)
1. Does the recipe load? (authoritative — schema, defaults, baseline, network)
hedera-harness doctor .harness/spec.yaml --recipe-only
hedera-harness doctor .harness/spec.yaml --recipe-only
2. Is it coherent across files? (traceability, stage pairing, blind rule)
2. Is it coherent across files? (traceability, stage pairing, blind rule)
bash <path-to>/harness-spec-anatomy/scripts/check-spec.sh <project-root>
`check-spec.sh` runs `doctor` itself, so running it alone is enough when the
harness CLI is installed. If it reports that the schema was **not** validated,
that is a partial result — install or upgrade the harness and rerun.
**Done when `check-spec.sh` exits clean.**
Then hand off:
```bashbash <path-to>/harness-spec-anatomy/scripts/check-spec.sh <project-root>
`check-spec.sh`会自动运行`doctor`,因此在已安装harness CLI的情况下,仅运行该脚本即可。如果脚本报告schema**未**通过验证,说明结果不完整——请安装或升级harness后重新运行。
**当`check-spec.sh`无错误退出时,即为完成。**
随后交付使用:
```bashPrefer /review-harness-spec next, then:
Prefer /review-harness-spec next, then:
hedera-harness run .harness/spec.yaml --max-attempts 3
hedera-harness run .harness/spec.yaml --max-attempts 3
or: yarn harness:run
or: yarn harness:run
Point at the harness README for install, agent auth, and stage host
prerequisites. `hedera-harness doctor` (without `--recipe-only`) checks those.
Do not expand CLI teaching beyond these next commands.
安装、Agent认证和阶段宿主的前置条件请参考harness的README。`hedera-harness doctor`(不带`--recipe-only`参数)会检查这些条件。除了以下命令外,不要展开讲解CLI的其他用法。Additional resources
额外资源
- references/grilling.md
- Companion:
/review-harness-spec - Vocabulary:
/harness-spec-anatomy - Upstream: docs/authoring-a-recipe.md
- references/grilling.md
- 配套技能:
/review-harness-spec - 词汇表:
/harness-spec-anatomy - 上游文档:docs/authoring-a-recipe.md