소스 정보
- 저장소
- hpsgd/turtlestack
- 최근 소스 활동
- 2026년 4월 2일 08:38
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/hpsgd/turtlestack --skill write-feature-spec명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | write-feature-spec |
| description | Write a BDD feature specification in Gherkin with step definitions. |
| argument-hint | [feature or behaviour to specify] |
| user-invocable | true |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep |
| paths | ["**/*.py","**/*.feature"] |
Write a BDD feature spec for $ARGUMENTS.
Before writing any Gherkin:
Read existing features — match conventions:
find . -name "*.feature" | head -20
find . -name "test_*.py" -path "*/step_defs/*" | head -20
Check existing step definitions — reuse where possible:
grep -rn "@given\|@when\|@then" --include="*.py" | head -30
Identify the domain language — what terms do product/business use? Use those, not technical terms
Every feature file follows this structure:
# tests/features/<feature-name>.feature
Feature: <Feature name in business language>
As a <role>
I want <capability>
So that <business value>
Background:
Given <common precondition shared by all scenarios>
Scenario: <Happy path — most common success case>
Given <specific precondition in business language>
When <user action in business language>
Then <expected outcome in business language>
Scenario: <Edge case — boundary or unusual input>
Given <precondition>
When <action with edge-case input>
Then <expected outcome>
Scenario: <Error case — invalid input or failed precondition>
Given <precondition>
When <action that should fail>
Then <expected error behaviour>
Scenario Outline: <Parameterised scenario for multiple inputs>
Given <precondition with <parameter>>
When <action with <input>>
Then <outcome with <expected>>
Examples:
| parameter | input | expected |
| value1 | x | y |
| value2 | a | b |
Language rules:
Given the user table has a row with id=5 and status='active'Given an active user named "Alice"When a POST request is sent to /api/login with body {"email": "..."}When Alice logs in with her email and passwordThen the response status code is 200Then Alice sees her dashboardStructure rules:
Given/When/Then is ONE statement. Use And for additional conditionsGiven establishes state — not action. It describes what IS, not what happenedWhen is ONE user action or system event. Never multiple actions in one WhenThen verifies ONE outcome. Multiple assertions use AndBackground for preconditions shared by ALL scenarios in the file — not just some"Successful login" not "Test login endpoint"Scenario completeness: Every feature MUST include at minimum:
Anti-patterns in Gherkin:
Given a user with email "test@example.com" and password "Pass123!" and role "admin" and created_at "2024-01-01" — only include details that matter for this scenarioWhen the user logs in and navigates to settings and changes their name — that's three stepsThen the user is created after When the user is created — test the EFFECT, not the action# tests/step_defs/test_<feature>.py
from pytest_bdd import given, when, then, scenarios, parsers
import pytest
# Link to feature file
scenarios('../features/<feature>.feature')
# GIVEN — establish state using fixtures
@given('an active user named "<name>"', target_fixture='user')
def active_user(name, db_session):
"""Create an active user in the test database."""
return UserFactory.create(name=name, status='active')
@given('the user has <count> pending notifications', target_fixture='notifications')
def pending_notifications(user, count, db_session):
"""Create pending notifications for the user."""
return NotificationFactory.create_batch(int(count), user=user, status='pending')
# WHEN — perform the action, capture the result
@when('the user marks all notifications as read', target_fixture='result')
def mark_all_read(user, notification_service):
"""Call the service to mark all notifications as read."""
return notification_service.mark_all_read(user.id)
# THEN — assert the outcome
@then('all notifications are marked as read')
def ():
notification notifications:
db_session.refresh(notification)
notification.status ==
():
count = notification_service.get_unread_count(user.)
count == (expected)
Step definition rules:
target_fixture to pass data between steps — not global variables or module-level statetest_<feature>.py maps to <feature>.featureReusable steps go in conftest.py:
# tests/step_defs/conftest.py
from pytest_bdd import given, parsers
import pytest
# Shared fixtures
@pytest.fixture
def db_session(app):
"""Provide a database session for the test."""
session = app.db.create_session()
yield session
session.rollback()
session.close()
@pytest.fixture
def notification_service(db_session):
"""Provide the notification service."""
return NotificationService(db_session)
# Shared steps — reusable across feature files
@given('an active user named "<name>"', target_fixture='user')
def active_user(name, db_session):
return UserFactory.create(name=name, status='active')
@given('an admin user named "<name>"', target_fixture='admin')
def admin_user(name, db_session):
return UserFactory.create(name=name, role='admin')
Reuse rules:
conftest.pytest_<feature>.pyparsers.parse for typed parameters: @given(parsers.parse('a user with {count:d} items')) for integer parsing# tests/factories.py
import factory
from myapp.models import User, Notification
class UserFactory(factory.Factory):
class Meta:
model = User
id = factory.LazyFunction(uuid4)
name = factory.Faker('name')
email = factory.Faker('email')
status = 'active'
role = 'user'
created_at = factory.LazyFunction(lambda: datetime.now(UTC))
class NotificationFactory(factory.Factory):
class Meta:
model = Notification
id = factory.LazyFunction(uuid4)
user = factory.SubFactory(UserFactory)
message = factory.Faker('sentence')
status = 'pending'
created_at = factory.LazyFunction(lambda: datetime.now(UTC))
Factory rules:
factory.SubFactory for relationshipsfactory.LazyFunction for dynamic defaults (UUIDs, timestamps)create_batch(n) for generating multiple instancesFor logic-heavy features, add Hypothesis property-based tests alongside BDD scenarios:
# tests/test_<feature>_properties.py
from hypothesis import given, strategies as st
from hypothesis import settings
@given(
amount=st.decimals(min_value=0.01, max_value=10000, places=2),
currency=st.sampled_from(['USD', 'EUR', 'GBP']),
)
@settings(max_examples=200)
def test_conversion_roundtrip_preserves_value(amount, currency):
"""Converting to USD and back should preserve the original amount."""
usd = convert(amount, currency, 'USD')
back = convert(usd, 'USD', currency)
assert abs(back - amount) < Decimal('0.01')
@given(items=st.lists(st.builds(OrderItem, quantity=st.integers(1, 100), price=st.decimals(0.01, 1000, places=2))))
def test_order_total_equals_sum_of_line_items(items):
"""Order total should always equal the sum of item quantity * price."""
order = Order(items=items)
expected = sum(item.quantity * item.price for item in items)
assert order.total == expected
Property-based rules:
max_examples=200 is a good default — enough to find edge cases, fast enough for CIst.integers() for prices# Run all BDD tests
pytest tests/ -v --tb=short
# Run a specific feature
pytest tests/step_defs/test_notifications.py -v
# Run with coverage
pytest tests/ --cov=myapp --cov-report=term-missing
Given a row in the users table is infrastructure, not behaviourWhen the user logs in and creates a post is two scenariosconftest.pyDeliver:
tests/features/<feature>.feature) with happy path, edge case, and error scenariostests/step_defs/test_<feature>.py) with factories and fixturesconftest.py if reusable/python-developer:write-schema — when the feature involves configuration or data contracts, write the schema after the feature spec defines the behaviour.