Skip to content
Skills Library
Programming · Testing

spec-derive

/spec-derive

[UDS] Derive BDD scenarios, TDD skeletons, integration and E2E tests, and ATDD tables from an approved specification. Use when: a spec has been approved and needs test artifacts, generating tagged test skeletons from acceptance criteria, producing contract stubs from a spec. Not for: recovering a spec from existing code — use /reverse; writing or reviewing the spec itself — use /sdd. Keywords: forward derivation, spec to test, BDD scenario, TDD skeleton, ATDD table, 正向推演, 規格衍生, 測試生成.

Licence
MIT
Last repository change
27.10.2026

Assessment and security

95/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

[UDS] Derive BDD scenarios, TDD skeletons, integration and E2E tests, and ATDD tables from an approved specification. Use when: a spec has been approved and needs test artifacts, generating tagged test skeletons from acceptance criteria, producing contract stubs from a spec. Not for: recovering a spec from existing code — use /reverse; writing or reviewing the spec itself — use /sdd. Keywords: forward derivation, spec to test, BDD scenario, TDD skeleton, ATDD table, 正向推演, 規格衍生, 測試生成.

Arguments

/spec-derive [all|bdd|tdd|it|e2e|atdd] <spec-file>
Original author description

[UDS] Derive BDD scenarios, TDD skeletons, integration and E2E tests, and ATDD tables from an approved specification. Use when: a spec has been approved and needs test artifacts, generating tagged test skeletons from acceptance criteria, producing contract stubs from a spec. Not for: recovering a spec from existing code — use /reverse; writing or reviewing the spec itself — use /sdd. Keywords: forward derivation, spec to test, BDD scenario, TDD skeleton, ATDD table, 正向推演, 規格衍生, 測試生成.

How it works

  1. Subcommands | 子命令
  2. Workflow | 工作流程
  3. Anti-Hallucination Rules | 防幻覺規則
  4. Generated Artifact Tags | 產生工件標籤
  5. Usage | 使用方式
  6. Next Steps Guidance | 下一步引導
  7. Reference | 參考
  8. AI Agent Behavior | AI 代理行為
Original SKILL.md headings · 74 lines, 444 words
SKILL.md preview
---
name: spec-derive
scope: partial
description: |
  [UDS] Derive BDD scenarios, TDD skeletons, integration and E2E tests, and ATDD tables from an approved specification.
  Use when: a spec has been approved and needs test artifacts, generating tagged test skeletons from acceptance criteria, producing contract stubs from a spec.
  Not for: recovering a spec from existing code — use /reverse; writing or reviewing the spec itself — use /sdd.
  Keywords: forward derivation, spec to test, BDD scenario, TDD skeleton, ATDD table, 正向推演, 規格衍生, 測試生成.
allowed-tools: Read, Write, Grep, Glob
argument-hint: "[all|bdd|tdd|it|e2e|atdd] <spec-file>"
prerequisites: ["spec-approved"]
status: stable
# 2026-08-18: `disable-model-invocation: true` removed, and a status recorded.
#
# The flag was applied by d415937e alongside the description rewrite and, like
# the two lifted on 2026-08-17, followed no stateable rule. These eight were
# left alone that day for a reason that was correct at the time: the rule
# settled on was "a reference is model-invocable", and none of them carried a
# `status` at all, so lifting them would have replaced one unruled state with
# one unruled action.
#
# Measured 2026-08-18, which is what closed it: all eight carry a full
# `Use when:` trigger and a `Not for:` exclusion, all eight describe an action
# rather than reference material, and all eight already have a slash command —
# which is exactly the shape of `code-review-assistant`, whose paired `/code-review`
# was ruled not to justify the flag. `journey-test-assistant` is the standing
# precedent: same "Generate X" shape, `status: stable`, never disabled.
#
# `stable` rather than a new value: `skills/` uses reference, stable and
# experimental, and inventing a fourth would be the same unruled-action mistake
# in different clothing.
#
# The cost of being wrong is asymmetric and observable in only one direction.
# Over-triggering shows up and is undone by deleting a line; a skill that is
# structurally unable to fire produces no signal at all. (XSPEC-378 R5)
---

# Forward Derivation | 正向推演

Generate derived artifacts (BDD scenarios, TDD skeletons, ATDD tables) from approved SDD specifications.

從已批准的 SDD 規格生成衍生工件(BDD 場景、TDD 骨架、ATDD 表格)。

## Subcommands | 子命令

| Subcommand | Description | Output |
|------------|-------------|--------|
| `all` | Full derivation pipeline (BDD + TDD + IT + E2E + ATDD + Contracts) | `.feature` + `.test.*` + `.it.test.*` + `.e2e.test.*` + `.md` + `.json` |
| `bdd` | Generate BDD scenarios only | `.feature` |
| `tdd` | Generate TDD skeletons only | `.test.*` |
| `it` | Generate Integration test skeletons | `.it.test.*` |
| `e2e` | Generate E2E test skeletons | `.e2e.test.*` |
| `atdd` | Generate ATDD test tables | `.md` (Markdown tables) |

## Workflow | 工作流程

1. **Read Spec** - Analyze the input `SPEC-XXX.md` file | 分析規格檔案
2. **Extract AC** - Parse all Acceptance Criteria | 解析所有驗收條件
3. **Generate Artifacts** - Create BDD/TDD/ATDD outputs | 產生衍生工件
4. **Verify** - Ensure 1:1 mapping between AC and generated items | 驗證一對一對應

## Anti-Hallucination Rules | 防幻覺規則

| Rule | Description | 說明 |
|------|-------------|------|
| **1:1 Mapping** | Every AC has exactly one test/scenario | 每個 AC 對應一個測試 |
| **Traceability** | All artifacts reference Spec ID and AC ID | 所有工件引用規格與 AC 編號 |
| **No Invention** | Do not add scenarios not in the spec | 不新增規格外的場景 |

## Generated Artifact Tags | 產生工件標籤

| Tag | Meaning | 含義 |
|-----|---------|------|
| `[Source]` | Direct content from spec | 直接來自規格 |
| `[Derived]` | Transformed from source | 從來源轉換 |
| `[Generated]` | AI-generated structure | AI 產生的結構 |
| `[TODO]` | Requires human implementation | 需人工實作 |

## Usage | 使用方式

```
/derive all specs/SPEC-001.md           - Full derivation pipeline | 完整推演管線
/derive bdd specs/SPEC-001.md           - Derive BDD scenarios only | 僅推演 BDD 場景
/derive tdd specs/SPEC-001.md           - Derive TDD skeletons only | 僅推演 TDD 骨架
/derive it specs/SPEC-001.md            - Derive Integration test skeletons | 推演整合測試骨架
/derive e2e specs/SPEC-001.md           - Derive E2E test skeletons | 推演 E2E 測試骨架
/derive atdd specs/SPEC-001.md          - Derive ATDD tables | 推演 ATDD 表格
```

## Next Steps Guidance | 下一步引導

After `/derive` completes, the AI assistant should suggest:

> **測試工件已產生。建議下一步 / Test artifacts generated. Suggested next steps:**
> - 執行 `/tdd` 開始紅綠重構循環 ⭐ **Recommended / 推薦** — Start Red-Green-Refactor cycle
> - 執行 `/bdd` 細化 Gherkin 場景 — Refine Gherkin scenarios
> - 檢查產生的 `[TODO]` 標記並補齊實作 — Review `[TODO]` markers and fill in implementations

## Reference | 參考

- Detailed guide: [guide.md](./guide.md)
- Core standard: [forward-derivation-standards.md](../../core/forward-derivation-standards.md)


## AI Agent Behavior | AI 代理行為

> 完整的 AI 行為定義請參閱對應的命令文件:[`/derive`](../commands/derive.md#ai-agent-behavior--ai-代理行為)
>
> For complete AI agent behavior definition, see the corresponding command file: [`/derive`](../commands/derive.md#ai-agent-behavior--ai-代理行為)
Files in this package (2)
  • SKILL.md 5 KB
  • guide.md 17 KB

Versions

RepositoryScoreLicence
This page · AsiaOstrich/universal-dev-standards95MIT
AsiaOstrich/universal-dev-standards95MIT
AsiaOstrich/universal-dev-standards95MIT
AsiaOstrich/universal-dev-standards95MIT

Database snapshot: 13.11.2026 · package version a65b4c9099c0 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 84spec
    Specification-first development (BDD/TDD). Use when implementing new features, creating new components, or when requirements need clarification through tests.
  • 90planning-bdd-atdd
    Use this skill when the user asks about BDD, ATDD, behavior-driven development, acceptance test-driven development, Gherkin, Cucumber, SpecFlow, specification by example, executable specifications, living documentation, three amigos, example mapping, or acceptance criteria…
  • 95e2e
    [UDS] Generate E2E test skeletons from BDD .feature scenarios, with framework detection and coverage gap analysis. Use when: turning finished .feature scenarios into runnable E2E skeletons, detecting the project E2E framework, finding AC with no E2E coverage. Not for:…
  • 100bdd-guide
    Use when driving software from concrete agreed examples of behaviour: running three-amigos discovery and example mapping before coding, formulating Given-When-Then scenarios in feature files, and treating them as living documentation that tests the team their shared…
  • 90bmad-testarch-atdd
    Generate red-phase acceptance test scaffolds using the TDD cycle. Use when the user says "lets write acceptance tests" or "I want to do ATDD
  • 87atdd
    [UDS] 引導驗收測試驅動開發(ATDD)流程,用於定義和驗證使用者故事

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.