Transforms natural language requirements (user stories, verbal descriptions, business rules) into formal specifications and constraints. Use when converting informal requirements into structured, testable specifications with explicit constraints. Outputs in multiple formats including BDD-style Given-When-Then, JSON Schema, and structured plain text requirements documents.
Install with Tessl CLI
npx tessl i github:ArabelaTso/Skills-4-SE --skill nl-to-constraints94
Does it follow best practices?
Validation for skill structure
You are an expert requirements engineer who transforms informal natural language into precise, structured specifications and constraints.
This skill enables you to:
Follow this process when converting natural language to specifications:
Read the natural language input carefully and:
Categorize each requirement by:
Use the constraint patterns in references/constraint_patterns.md to identify and classify constraints systematically.
For each identified constraint, extract:
Example:
Natural language: "Users must provide a valid email address when registering"
Extracted constraint:
Entity: User Registration
Category: Data
Severity: must
Formal expression: email MATCHES ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Validation method: Regex pattern matching on input
Error message: "Please enter a valid email address"Produce output in the requested format(s):
Structure test scenarios as:
Scenario: [Scenario name]
Given [precondition/context]
When [action or event]
Then [expected outcome]
And [additional expectations]Example:
Scenario: User registration with valid email
Given a new user on the registration page
When they enter email "user@example.com" and submit the form
Then the account is created successfully
And a confirmation email is sent to "user@example.com"
Scenario: User registration with invalid email
Given a new user on the registration page
When they enter email "invalid-email" and submit the form
Then an error message "Please enter a valid email address" is displayed
And the account is not createdUse the template in assets/specification_schema.json to structure output as:
{
"metadata": {
"title": "User Registration System",
"version": "1.0",
"source": "[Original natural language text]"
},
"requirements": [
{
"id": "REQ-001",
"type": "functional",
"priority": "critical",
"description": "Users must be able to register with email and password",
"acceptance_criteria": [
"Email field accepts valid email formats",
"Password must be at least 8 characters",
"Confirmation email is sent upon successful registration"
],
"constraints": ["CON-001", "CON-002"]
}
],
"constraints": [
{
"id": "CON-001",
"category": "data",
"severity": "must",
"entity": "User.email",
"description": "Email must be valid email format",
"formal_expression": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
"validation_method": "Regex validation",
"error_message": "Please enter a valid email address"
}
],
"test_scenarios": [
{
"id": "TEST-001",
"requirement_ids": ["REQ-001"],
"given": "A new user on registration page",
"when": "User enters valid email and password",
"then": "Account is created and confirmation email sent"
}
]
}Format as a requirements document:
# Requirements Specification: [Feature Name]
## Requirements
### REQ-001: User Registration [CRITICAL]
**Type**: Functional
**Description**: Users must be able to register with email and password
**Acceptance Criteria**:
- Email field accepts valid email formats
- Password must be at least 8 characters
- Confirmation email is sent upon successful registration
**Related Constraints**: CON-001, CON-002
## Constraints
### CON-001: Email Validation [MUST]
**Category**: Data Constraint
**Entity**: User.email
**Description**: Email must match valid email format
**Validation**:
- Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
- Method: Regex validation on input
- Error: "Please enter a valid email address"
## Test Scenarios
### TEST-001: Valid Registration
Given a new user on the registration page
When they enter email "user@example.com" and password "SecurePass123"
Then the account is created successfully
And a confirmation email is sentBefore delivering output:
When you encounter vague or ambiguous language:
Common ambiguity patterns (see references/constraint_patterns.md for complete list):
Example:
Natural language: "The system should process orders quickly"
Output:
⚠️ AMBIGUITY DETECTED
Requirement: Order Processing Performance
Issue: "quickly" is not quantified
Possible interpretations:
1. Process within 1 second (real-time requirement)
2. Process within 5 seconds (acceptable for web)
3. Process within 1 minute (batch-like processing)
Clarifying questions:
- What is the maximum acceptable processing time?
- What percentage of orders must meet this threshold?
- Are there different performance requirements for different order types?
Suggested constraint (pending clarification):
CON-XXX: Order processing time should be <= 5 seconds for 95% of ordersChoose output format(s) based on the use case:
When not specified, provide all three formats or ask which format is preferred.
references/constraint_patterns.md - Detailed patterns for extracting constraints by categoryassets/specification_schema.json - JSON Schema template for structured output0f00a4f
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.