本文へ移動
cccskills
無料GitHub で公開

gherkin-authoring

Produce valid, consistently named Gherkin story files with correct IDs, timestamps, and tags. Use when writing or updating story files.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.9 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

SKILL: gherkin-authoring

Purpose

Produce valid, consistently named Gherkin story files. Handles ID allocation, timestamp generation, filename construction, tag formatting, and scenario validation. Used by the product-owner agent whenever a new story is written or updated.

Story File Naming Convention

<epic-slug>-<story-slug>-<timestamp>-<NNNN>.md
PartFormatExample
epic-slugkebab-case, 2–4 wordsuser-auth
story-slugkebab-case, 2–5 wordsreset-password
timestampYYYYMMDDHHMMSS20250416143000
NNNN4-digit zero-padded, sequential within epic0003

Full example: user-auth-reset-password-20250416143000-0003.md

Allocate the Next Story ID

# Count existing stories for an epic to get next sequential ID
EPIC="user-auth"
NEXT_ID=$(ls docs/stories/${EPIC}-* 2>/dev/null \
  | grep -oE '\-[0-9]{4}\.md$' \
  | grep -oE '[0-9]{4}' \
  | sort -n | tail -1 \
  | python3 -c "import sys; n=sys.stdin.read().strip(); print(f'{int(n)+1:04d}' if n else '0001')")
[ -z "$NEXT_ID" ] && NEXT_ID="0001"
echo "$NEXT_ID"

Generate Filename

EPIC="user-auth"
STORY="reset-password"
TS=$(date -u +"%Y%m%d%H%M%S")
ID="$NEXT_ID"   # from allocation step above
FILENAME="${EPIC}-${STORY}-${TS}-${ID}.md"
echo "$FILENAME"   # user-auth-reset-password-20250416143000-0001.md

Story File Template

Every story file must contain:

---
id: "{EPIC}-{NNNN}"
title: "{Human-readable story title}"
epic: "{epic-slug}"
priority: "high|medium|low|critical"
ui: false
adr_required: false
milestone: "{milestone name}"
labels:
  - "type:feature"
  - "priority:high"
  - "phase:discover"
issue_number: null
issue_url: null
---

## Story

**As a** {actor},
**I want** {capability},
**so that** {business outcome}.

## Acceptance Criteria

```gherkin
@story:{EPIC}-{NNNN} @epic:{epic-slug} @priority:{level}
Feature: {Feature title}

  Scenario: {scenario title}
    Given {precondition}
    When {action}
    Then {expected outcome}

Definition of Done

  • All Gherkin scenarios have passing step implementations
  • Unit tests written and passing
  • Integration tests written and passing (if applicable)
  • Code reviewed and approved
  • No regressions in related features
  • Documentation updated (if applicable)

ADR Links

<!-- Add links to relevant ADRs here -->

## Gherkin Validation Rules

Before writing a scenario, verify:

1. **Single responsibility**: each `Scenario` tests exactly one behavior.
2. **Given-When-Then order**: never skip or reorder.
3. **No implementation detail in steps**: steps describe intent, not code.
4. **Declarative steps**: `Given the user is logged in` ✓ — `Given I call POST /auth/login` ✗
5. **Tags present**: `@story:`, `@epic:`, `@priority:` required on every Feature block.
6. **No `And` as first step**: `And` is only valid after a `Given`, `When`, or `Then`.

## Background Block (shared preconditions)

```gherkin
Feature: Password Reset

  Background:
    Given the user has a verified account
    And the account is not locked

  Scenario: Successful reset request
    When the user submits their email address
    Then a reset link is sent to that address

Use Background when 2+ scenarios share the same preconditions.

Scenario Outline (data-driven)

  Scenario Outline: Reject invalid email formats
    When the user submits "<email>"
    Then they see a validation error "<message>"

    Examples:
      | email        | message                  |
      | notanemail   | Invalid email format     |
      | @nodomain    | Invalid email format     |
      | a@b          | Domain must have TLD     |

Tags Reference

TagRequiredDescription
@story:{id}YesLinks scenario to story file
@epic:{slug}YesGroups stories by epic
@priority:{level}Yescritical, high, medium, low
@wipNoWork in progress — excluded from CI by default
@uiNoRequires browser/UI driver
@integrationNoRequires external services
@smokeNoRuns in production smoke suite

Failure Modes

ConditionAction
Story ID collision (same NNNN exists)Re-run allocation step. Never overwrite an existing file.
docs/stories/ does not existCreate it: mkdir -p docs/stories/
Scenario has no WhenInvalid — split into two scenarios or add action step
Missing required tagsAdd tags before writing the file
Title exceeds 72 charactersShorten. Titles appear in issue headings and PR titles.

Logging

[gherkin] ALLOCATE  epic=user-auth  next_id=0003
[gherkin] CREATE    docs/stories/user-auth-reset-password-20250416143000-0003.md
[gherkin] VALIDATE  scenarios=3  tags=ok  structure=ok

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Run WCAG 2.2 Level AA accessibility audits against generated UI. Use when a story has ui:true or when asked to audit accessibility.

日本語の概要は準備中です。原文の説明を表示しています。

kinncj/Heimdall702026年9月2日 更新

Generate a complete component file tree wired to design tokens with tests and Gherkin spec. Use when scaffolding a new UI component.

日本語の概要は準備中です。原文の説明を表示しています。

kinncj/Heimdall702026年9月2日 更新

Extract Gherkin scenarios from story markdown files into runnable .feature files and generate step definition stubs. Use when syncing stories to test suites.

日本語の概要は準備中です。原文の説明を表示しています。

kinncj/Heimdall702026年9月2日 更新

Read and write design tokens in W3C DTCG format (tokens.json) and emit CSS, Tailwind, and Mantine outputs. Use when modifying or generating design tokens.

日本語の概要は準備中です。原文の説明を表示しています。

kinncj/Heimdall702026年9月2日 更新

Apply Docker and Docker Compose best practices for containerising services. Use when writing or reviewing Dockerfiles and compose configs.

日本語の概要は準備中です。原文の説明を表示しています。

kinncj/Heimdall702026年9月2日 更新

Identify and annotate cloud cost implications of architectural decisions. Use when reviewing infrastructure changes or designing new services.

日本語の概要は準備中です。原文の説明を表示しています。

kinncj/Heimdall702026年9月2日 更新

kinncj のスキルをすべて見る

このスキルの問題を報告する