Agent Skillsdifferent-ai/openwork › write-a-spec

write-a-spec

GitHub

指导编写端到端测试规范,使用 @openwork/testkit 构建 E2E 测试。涵盖资源依赖管理、故障注入、状态读取及断言证据规范,确保测试可机器检查且行为描述准确。

.opencode/skills/write-a-spec/SKILL.md different-ai/openwork

触发场景

编写新的端到端测试用例 在 evals/specs 中创建测试规范 使用 testkit 进行功能验证

安装

npx skills add different-ai/openwork --skill write-a-spec -g -y
更多选项

非标准路径

npx skills add https://github.com/different-ai/openwork/tree/dev/.opencode/skills/write-a-spec -g -y

不安装直接使用

npx skills use different-ai/openwork@write-a-spec

指定 Agent (Claude Code)

npx skills add different-ai/openwork --skill write-a-spec -a claude-code -g -y

安装 repo 全部 skill

npx skills add different-ai/openwork --all -g -y

预览 repo 内 skill

npx skills add different-ai/openwork --list

SKILL.md

Frontmatter
{
    "name": "write-a-spec",
    "description": "Write a spec, new E2E test, or test a feature end to end. Use when authoring an @openwork\/testkit test in evals\/specs."
}

Skill: Write a Spec

Write new tests in evals/specs/**/*.test.ts and import test from @openwork/testkit. App-driving E2E tests use .e2e.test.ts; the PR lane excludes them. Model setup as resources in dependency order: needs()server()app().

Use the testkit primitives

  • server() boots or reuses Den and provisions isolated organizations.
  • app() boots a signed-in desktop. Use profileDir for caller-owned profile continuity and localServerDelayMs for deterministic startup races.
  • inviteMember() adds a named member to an existing Den.
  • faultProxy() injects faults.status() or faults.latency() and exposes the requests log for assertions about attempts and recovery.
  • eventually() bounds polling and reports its last value or error.
  • readDenClientState(), readConnectState(), and readConnectStateFile() expose client, local-server, and persisted-profile state.

Claims and witnesses

  • Make each claim machine-checkable with an observable assertion and its explicit negative half. Assert both the intended effect and what must not happen to another identity, account, request, file, or state.
  • Prose is never proof. Screenshots explain an assertion but cannot replace it.
  • Describe product behavior, not incidental layout. Claims such as "side by side" can disagree even when pixels are identical across runs.
  • Match claims to what the product actually says on screen. If product and claim diverge, explicitly change one; never silently bend the claim.
  • Never smuggle the answer into the prompt. Assert that the user-facing request does not contain connector or resource IDs.

Evidence contract

  • Test evidence is ambient: screenshot() records screenshot artifacts, validate() records their visual validations whether they pass or fail, and recordAssertionEvidence() holds witness assertions.
  • Never create or pass test-evidence recorder handles in test bodies.
  • Bound every wait.
  • Declare every external requirement in needs() so missing dependencies skip loudly instead of timing out or weakening coverage.

版本历史

  • ff5d298 当前 2026-08-20 11:36

同 Skill 集合

.opencode/skills/agent-first-screenshots/SKILL.md
.opencode/skills/browser-automation/SKILL.md
.opencode/skills/build-a-witness/SKILL.md
.opencode/skills/cloud-dashboard-walkthrough/SKILL.md
.opencode/skills/create-plugin/SKILL.md
.opencode/skills/daytona-chrome-cdp/SKILL.md
.opencode/skills/daytona-cloud-instance/SKILL.md
.opencode/skills/daytona-cloud-server/SKILL.md
.opencode/skills/daytona-dev/SKILL.md
.opencode/skills/daytona-electron-den/SKILL.md
.opencode/skills/daytona-electron-test/SKILL.md
.opencode/skills/daytona-flow-validator/SKILL.md
.opencode/skills/daytona-recording-artifacts/SKILL.md
.opencode/skills/daytona-secrets-volume/SKILL.md
.opencode/skills/daytona-seeded-cloud-demo/SKILL.md
.opencode/skills/daytona-windows-cert/SKILL.md
.opencode/skills/diagnose-a-red-run/SKILL.md
.opencode/skills/fraimz/SKILL.md
.opencode/skills/get-env-var/SKILL.md
.opencode/skills/openwork-models/SKILL.md
.opencode/skills/product-tutorial-pipeline/SKILL.md
.opencode/skills/prove-a-pr/SKILL.md
.opencode/skills/publish-evidence/SKILL.md
.opencode/skills/run-evals/SKILL.md
.opencode/skills/run-tests/SKILL.md
.opencode/skills/shadcn/SKILL.md
.opencode/skills/upload-photo/SKILL.md
.warden/skills/desktop-den-sync-review/SKILL.md
.warden/skills/diff-security-review/SKILL.md

元信息

文件数
0
版本
757601b
Hash
1f522fab
收录时间
2026-08-20 11:36

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-17 02:14
浙ICP备14020137号-1